@neuvybe/jarvis 0.22.1 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +110 -110
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __cliCreateRequire } from 'node:module'; const require = __cliCreateRequire(import.meta.url);
3
- var wE=Object.create;var Ru=Object.defineProperty;var SE=Object.getOwnPropertyDescriptor;var kE=Object.getOwnPropertyNames;var EE=Object.getPrototypeOf,IE=Object.prototype.hasOwnProperty;var ae=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var v=(t,e)=>()=>(t&&(e=t(t=0)),e);var z=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),He=(t,e)=>{for(var n in e)Ru(t,n,{get:e[n],enumerable:!0})},TE=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of kE(e))!IE.call(t,r)&&r!==n&&Ru(t,r,{get:()=>e[r],enumerable:!(i=SE(e,r))||i.enumerable});return t};var Je=(t,e,n)=>(n=t!=null?wE(EE(t)):{},TE(e||!t||!t.__esModule?Ru(n,"default",{value:t,enumerable:!0}):n,t));function OE(t){try{return JSON.stringify(t,(e,n)=>n instanceof Error?{name:n.name,message:n.message,stack:n.stack}:n)}catch{return"[unserializable meta]"}}var Dg,Nu,B,Lg=v(()=>{"use strict";Dg={debug:0,info:1,warn:2,error:3};Nu=class{level;constructor(e="info"){this.level=e}setLevel(e){this.level=e}getLevel(){return this.level}debug(e,n){this.emit("debug",e,n)}info(e,n){this.emit("info",e,n)}warn(e,n){this.emit("warn",e,n)}error(e,n){this.emit("error",e,n)}emit(e,n,i){if(Dg[e]<Dg[this.level])return;let o=`[${new Date().toISOString()}] ${e.toUpperCase()}`,s=i!==void 0?`${o} ${n} ${OE(i)}`:`${o} ${n}`;e==="warn"?console.warn(s):console.error(s)}},B=new Nu});var Ug=v(()=>{"use strict"});var jg,Du=v(()=>{"use strict";jg="JARVIS_HOME"});function m(t,e,n){function i(a,u){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:u,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,u);let c=s.prototype,l=Object.keys(c);for(let d=0;d<l.length;d++){let f=l[d];f in a||(a[f]=c[f].bind(a))}}let r=n?.Parent??Object;class o extends r{}Object.defineProperty(o,"name",{value:t});function s(a){var u;let c=n?.Parent?new o:this;i(c,a),(u=c._zod).deferred??(u.deferred=[]);for(let l of c._zod.deferred)l();return c}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(t)}),Object.defineProperty(s,"name",{value:t}),s}function oe(t){return t&&Object.assign(nr,t),nr}var Mg,Lu,Uu,ot,zt,nr,ir=v(()=>{Lu=Object.freeze({status:"aborted"});Uu=Symbol("zod_brand"),ot=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},zt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(Mg=globalThis).__zod_globalConfig??(Mg.__zod_globalConfig={});nr=globalThis.__zod_globalConfig});var x={};He(x,{BIGINT_FORMAT_RANGES:()=>Hu,Class:()=>Mu,NUMBER_FORMAT_RANGES:()=>qu,aborted:()=>Lt,allowsEval:()=>Zu,assert:()=>RE,assertEqual:()=>AE,assertIs:()=>CE,assertNever:()=>zE,assertNotEqual:()=>PE,assignProp:()=>Nt,base64ToUint8Array:()=>Vg,base64urlToUint8Array:()=>YE,cached:()=>Nr,captureStackTrace:()=>vo,cleanEnum:()=>KE,cleanRegex:()=>Mn,clone:()=>Ee,cloneDef:()=>DE,createTransparentProxy:()=>VE,defineLazy:()=>V,esc:()=>go,escapeRegex:()=>Ke,explicitlyAborted:()=>Ju,extend:()=>GE,finalizeIssue:()=>Ie,floatSafeRemainder:()=>Fu,getElementAtPath:()=>LE,getEnumValues:()=>jn,getLengthableOrigin:()=>Zn,getParsedType:()=>FE,getSizableOrigin:()=>Vn,hexToUint8Array:()=>QE,isObject:()=>or,isPlainObject:()=>Dt,issue:()=>Dr,joinValues:()=>g,jsonStringifyReplacer:()=>Rr,merge:()=>qE,mergeDefs:()=>bt,normalizeParams:()=>w,nullish:()=>Rt,numKeys:()=>ME,objectClone:()=>NE,omit:()=>BE,optionalKeys:()=>Wu,parsedType:()=>$,partial:()=>HE,pick:()=>ZE,prefixIssues:()=>Re,primitiveTypes:()=>Gu,promiseAllObject:()=>UE,propertyKeyTypes:()=>Fn,randomString:()=>jE,required:()=>JE,safeExtend:()=>WE,shallowClone:()=>Bu,slugify:()=>Vu,stringifyPrimitive:()=>b,uint8ArrayToBase64:()=>Zg,uint8ArrayToBase64url:()=>XE,uint8ArrayToHex:()=>eI,unwrapMessage:()=>Un});function AE(t){return t}function PE(t){return t}function CE(t){}function zE(t){throw new Error("Unexpected value in exhaustive check")}function RE(t){}function jn(t){let e=Object.values(t).filter(i=>typeof i=="number");return Object.entries(t).filter(([i,r])=>e.indexOf(+i)===-1).map(([i,r])=>r)}function g(t,e="|"){return t.map(n=>b(n)).join(e)}function Rr(t,e){return typeof e=="bigint"?e.toString():e}function Nr(t){return{get value(){{let n=t();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function Rt(t){return t==null}function Mn(t){let e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}function Fu(t,e){let n=t/e,i=Math.round(n),r=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-i}function V(t,e,n){let i;Object.defineProperty(t,e,{get(){if(i!==Fg)return i===void 0&&(i=Fg,i=n()),i},set(r){Object.defineProperty(t,e,{value:r})},configurable:!0})}function NE(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function Nt(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}function bt(...t){let e={};for(let n of t){let i=Object.getOwnPropertyDescriptors(n);Object.assign(e,i)}return Object.defineProperties({},e)}function DE(t){return bt(t._zod.def)}function LE(t,e){return e?e.reduce((n,i)=>n?.[i],t):t}function UE(t){let e=Object.keys(t),n=e.map(i=>t[i]);return Promise.all(n).then(i=>{let r={};for(let o=0;o<e.length;o++)r[e[o]]=i[o];return r})}function jE(t=10){let e="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<t;i++)n+=e[Math.floor(Math.random()*e.length)];return n}function go(t){return JSON.stringify(t)}function Vu(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function or(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Dt(t){if(or(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let n=e.prototype;return!(or(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Bu(t){return Dt(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function ME(t){let e=0;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function Ke(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ee(t,e,n){let i=new t._zod.constr(e??t._zod.def);return(!e||n?.parent)&&(i._zod.parent=t),i}function w(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 VE(t){let e;return new Proxy({},{get(n,i,r){return e??(e=t()),Reflect.get(e,i,r)},set(n,i,r,o){return e??(e=t()),Reflect.set(e,i,r,o)},has(n,i){return e??(e=t()),Reflect.has(e,i)},deleteProperty(n,i){return e??(e=t()),Reflect.deleteProperty(e,i)},ownKeys(n){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(n,i){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(n,i,r){return e??(e=t()),Reflect.defineProperty(e,i,r)}})}function b(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Wu(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function ZE(t,e){let n=t._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=bt(t._zod.def,{get shape(){let s={};for(let a in e){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(s[a]=n.shape[a])}return Nt(this,"shape",s),s},checks:[]});return Ee(t,o)}function BE(t,e){let n=t._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=bt(t._zod.def,{get shape(){let s={...t._zod.def.shape};for(let a in e){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete s[a]}return Nt(this,"shape",s),s},checks:[]});return Ee(t,o)}function GE(t,e){if(!Dt(e))throw new Error("Invalid input to extend: expected a plain object");let n=t._zod.def.checks;if(n&&n.length>0){let o=t._zod.def.shape;for(let s in e)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=bt(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return Nt(this,"shape",o),o}});return Ee(t,r)}function WE(t,e){if(!Dt(e))throw new Error("Invalid input to safeExtend: expected a plain object");let n=bt(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e};return Nt(this,"shape",i),i}});return Ee(t,n)}function qE(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=bt(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e._zod.def.shape};return Nt(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Ee(t,n)}function HE(t,e,n){let r=e._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=bt(e._zod.def,{get shape(){let a=e._zod.def.shape,u={...a};if(n)for(let c in n){if(!(c in a))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(u[c]=t?new t({type:"optional",innerType:a[c]}):a[c])}else for(let c in a)u[c]=t?new t({type:"optional",innerType:a[c]}):a[c];return Nt(this,"shape",u),u},checks:[]});return Ee(e,s)}function JE(t,e,n){let i=bt(e._zod.def,{get shape(){let r=e._zod.def.shape,o={...r};if(n)for(let s in n){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(o[s]=new t({type:"nonoptional",innerType:r[s]}))}else for(let s in r)o[s]=new t({type:"nonoptional",innerType:r[s]});return Nt(this,"shape",o),o}});return Ee(e,i)}function Lt(t,e=0){if(t.aborted===!0)return!0;for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue!==!0)return!0;return!1}function Ju(t,e=0){if(t.aborted===!0)return!0;for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue===!1)return!0;return!1}function Re(t,e){return e.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(t),n})}function Un(t){return typeof t=="string"?t:t?.message}function Ie(t,e,n){let i=t.message?t.message:Un(t.inst?._zod.def?.error?.(t))??Un(e?.error?.(t))??Un(n.customError?.(t))??Un(n.localeError?.(t))??"Invalid input",{inst:r,continue:o,input:s,...a}=t;return a.path??(a.path=[]),a.message=i,e?.reportInput&&(a.input=s),a}function Vn(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function Zn(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function $(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 n=t;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return e}function Dr(...t){let[e,n,i]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:i}:{...e}}function KE(t){return Object.entries(t).filter(([e,n])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Vg(t){let e=atob(t),n=new Uint8Array(e.length);for(let i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return n}function Zg(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}function YE(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-e.length%4)%4);return Vg(e+n)}function XE(t){return Zg(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function QE(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)n[i/2]=Number.parseInt(e.slice(i,i+2),16);return n}function eI(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var Fg,vo,Zu,FE,Fn,Gu,qu,Hu,Mu,R=v(()=>{ir();Fg=Symbol("evaluating");vo="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};Zu=Nr(()=>{if(nr.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});FE=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}`)}},Fn=new Set(["string","number","symbol"]),Gu=new Set(["string","number","bigint","boolean","symbol","undefined"]);qu={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]},Hu={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};Mu=class{constructor(...e){}}});function Gn(t,e=n=>n.message){let n={},i=[];for(let r of t.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(e(r))):i.push(e(r));return{formErrors:i,fieldErrors:n}}function Wn(t,e=n=>n.message){let n={_errors:[]},i=(r,o=[])=>{for(let s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>i({issues:a},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let a=[...o,...s.path];if(a.length===0)n._errors.push(e(s));else{let u=n,c=0;for(;c<a.length;){let l=a[c];c===a.length-1?(u[l]=u[l]||{_errors:[]},u[l]._errors.push(e(s))):u[l]=u[l]||{_errors:[]},u=u[l],c++}}}};return i(t),n}function Ku(t,e=n=>n.message){let n={errors:[]},i=(r,o=[])=>{var s,a;for(let u of r.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(c=>i({issues:c},[...o,...u.path]));else if(u.code==="invalid_key")i({issues:u.issues},[...o,...u.path]);else if(u.code==="invalid_element")i({issues:u.issues},[...o,...u.path]);else{let c=[...o,...u.path];if(c.length===0){n.errors.push(e(u));continue}let l=n,d=0;for(;d<c.length;){let f=c[d],h=d===c.length-1;typeof f=="string"?(l.properties??(l.properties={}),(s=l.properties)[f]??(s[f]={errors:[]}),l=l.properties[f]):(l.items??(l.items=[]),(a=l.items)[f]??(a[f]={errors:[]}),l=l.items[f]),h&&l.errors.push(e(u)),d++}}};return i(t),n}function Gg(t){let e=[],n=t.map(i=>typeof i=="object"?i.key:i);for(let i of n)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 Yu(t){let e=[],n=[...t.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${Gg(i.path)}`);return e.join(`
4
- `)}var Bg,Bn,Ne,Xu=v(()=>{ir();R();Bg=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,Rr,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},Bn=m("$ZodError",Bg),Ne=m("$ZodError",Bg,{Parent:Error})});var Lr,yo,Ur,_o,jr,Qu,Mr,ec,bo,rI,$o,nI,xo,iI,wo,oI,So,sI,ko,aI,Eo,uI,Io,cI,tc=v(()=>{ir();Xu();R();Lr=t=>(e,n,i,r)=>{let o=i?{...i,async:!1}:{async:!1},s=e._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new ot;if(s.issues.length){let a=new(r?.Err??t)(s.issues.map(u=>Ie(u,o,oe())));throw vo(a,r?.callee),a}return s.value},yo=Lr(Ne),Ur=t=>async(e,n,i,r)=>{let o=i?{...i,async:!0}:{async:!0},s=e._zod.run({value:n,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(r?.Err??t)(s.issues.map(u=>Ie(u,o,oe())));throw vo(a,r?.callee),a}return s.value},_o=Ur(Ne),jr=t=>(e,n,i)=>{let r=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new ot;return o.issues.length?{success:!1,error:new(t??Bn)(o.issues.map(s=>Ie(s,r,oe())))}:{success:!0,data:o.value}},Qu=jr(Ne),Mr=t=>async(e,n,i)=>{let r=i?{...i,async:!0}:{async:!0},o=e._zod.run({value:n,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new t(o.issues.map(s=>Ie(s,r,oe())))}:{success:!0,data:o.value}},ec=Mr(Ne),bo=t=>(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Lr(t)(e,n,r)},rI=bo(Ne),$o=t=>(e,n,i)=>Lr(t)(e,n,i),nI=$o(Ne),xo=t=>async(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Ur(t)(e,n,r)},iI=xo(Ne),wo=t=>async(e,n,i)=>Ur(t)(e,n,i),oI=wo(Ne),So=t=>(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return jr(t)(e,n,r)},sI=So(Ne),ko=t=>(e,n,i)=>jr(t)(e,n,i),aI=ko(Ne),Eo=t=>async(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Mr(t)(e,n,r)},uI=Eo(Ne),Io=t=>async(e,n,i)=>Mr(t)(e,n,i),cI=Io(Ne)});var Fe={};He(Fe,{base64:()=>vc,base64url:()=>To,bigint:()=>Sc,boolean:()=>Ec,browserEmail:()=>vI,cidrv4:()=>mc,cidrv6:()=>gc,cuid:()=>rc,cuid2:()=>nc,date:()=>bc,datetime:()=>xc,domain:()=>bI,duration:()=>uc,e164:()=>_c,email:()=>lc,emoji:()=>dc,extendedDuration:()=>lI,guid:()=>cc,hex:()=>$I,hostname:()=>_I,html5Email:()=>pI,httpProtocol:()=>yc,idnEmail:()=>gI,integer:()=>kc,ipv4:()=>fc,ipv6:()=>hc,ksuid:()=>sc,lowercase:()=>Oc,mac:()=>pc,md5_base64:()=>wI,md5_base64url:()=>SI,md5_hex:()=>xI,nanoid:()=>ac,null:()=>Ic,number:()=>Oo,rfc5322Email:()=>mI,sha1_base64:()=>EI,sha1_base64url:()=>II,sha1_hex:()=>kI,sha256_base64:()=>OI,sha256_base64url:()=>AI,sha256_hex:()=>TI,sha384_base64:()=>CI,sha384_base64url:()=>zI,sha384_hex:()=>PI,sha512_base64:()=>NI,sha512_base64url:()=>DI,sha512_hex:()=>RI,string:()=>wc,time:()=>$c,ulid:()=>ic,undefined:()=>Tc,unicodeEmail:()=>Wg,uppercase:()=>Ac,uuid:()=>sr,uuid4:()=>dI,uuid6:()=>fI,uuid7:()=>hI,xid:()=>oc});function dc(){return new RegExp(yI,"u")}function Hg(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 $c(t){return new RegExp(`^${Hg(t)}$`)}function xc(t){let e=Hg({precision:t.precision}),n=["Z"];t.local&&n.push(""),t.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${e}(?:${n.join("|")})`;return new RegExp(`^${qg}T(?:${i})$`)}function qn(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function Hn(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var rc,nc,ic,oc,sc,ac,uc,lI,cc,sr,dI,fI,hI,lc,pI,mI,Wg,gI,vI,yI,fc,hc,pc,mc,gc,vc,To,_I,bI,yc,_c,qg,bc,wc,Sc,kc,Oo,Ec,Ic,Tc,Oc,Ac,$I,xI,wI,SI,kI,EI,II,TI,OI,AI,PI,CI,zI,RI,NI,DI,Ao=v(()=>{R();rc=/^[cC][0-9a-z]{6,}$/,nc=/^[0-9a-z]+$/,ic=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,oc=/^[0-9a-vA-V]{20}$/,sc=/^[A-Za-z0-9]{27}$/,ac=/^[a-zA-Z0-9_-]{21}$/,uc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,lI=/^[-+]?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)?)??$/,cc=/^([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})$/,sr=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)$/,dI=sr(4),fI=sr(6),hI=sr(7),lc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,pI=/^[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])?)*$/,mI=/^(([^<>()\[\]\\.,;:\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,}))$/,Wg=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,gI=Wg,vI=/^[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])?)*$/,yI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";fc=/^(?:(?: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])$/,hc=/^(([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}|:))$/,pc=t=>{let e=Ke(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},mc=/^((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])$/,gc=/^(([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])$/,vc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,To=/^[A-Za-z0-9_-]*$/,_I=/^(?=.{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])?)*\.?$/,bI=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,yc=/^https?$/,_c=/^\+[1-9]\d{6,14}$/,qg="(?:(?:\\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])))",bc=new RegExp(`^${qg}$`);wc=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Sc=/^-?\d+n?$/,kc=/^-?\d+$/,Oo=/^-?\d+(?:\.\d+)?$/,Ec=/^(?:true|false)$/i,Ic=/^null$/i,Tc=/^undefined$/i,Oc=/^[^A-Z]*$/,Ac=/^[^a-z]*$/,$I=/^[0-9a-fA-F]*$/;xI=/^[0-9a-fA-F]{32}$/,wI=qn(22,"=="),SI=Hn(22),kI=/^[0-9a-fA-F]{40}$/,EI=qn(27,"="),II=Hn(27),TI=/^[0-9a-fA-F]{64}$/,OI=qn(43,"="),AI=Hn(43),PI=/^[0-9a-fA-F]{96}$/,CI=qn(64,""),zI=Hn(64),RI=/^[0-9a-fA-F]{128}$/,NI=qn(86,"=="),DI=Hn(86)});function Jg(t,e,n){t.issues.length&&e.issues.push(...Re(n,t.issues))}var X,Kg,Po,Co,Pc,Cc,zc,Rc,Nc,Dc,Lc,Uc,jc,Fr,Mc,Fc,Vc,Zc,Bc,Gc,Wc,qc,Hc,zo=v(()=>{ir();Ao();R();X=m("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),Kg={number:"number",bigint:"bigint",object:"date"},Po=m("$ZodCheckLessThan",(t,e)=>{X.init(t,e);let n=Kg[typeof e.value];t._zod.onattach.push(i=>{let r=i._zod.bag,o=(e.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?r.maximum=e.value:r.exclusiveMaximum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:n,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Co=m("$ZodCheckGreaterThan",(t,e)=>{X.init(t,e);let n=Kg[typeof e.value];t._zod.onattach.push(i=>{let r=i._zod.bag,o=(e.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?r.minimum=e.value:r.exclusiveMinimum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Pc=m("$ZodCheckMultipleOf",(t,e)=>{X.init(t,e),t._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=e.value)}),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%e.value===BigInt(0):Fu(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),Cc=m("$ZodCheckNumberFormat",(t,e)=>{X.init(t,e),e.format=e.format||"float64";let n=e.format?.includes("int"),i=n?"int":"number",[r,o]=qu[e.format];t._zod.onattach.push(s=>{let a=s._zod.bag;a.format=e.format,a.minimum=r,a.maximum=o,n&&(a.pattern=kc)}),t._zod.check=s=>{let a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?s.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:!0,continue:!e.abort}):s.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:!0,continue:!e.abort});return}}a<r&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!e.abort})}}),zc=m("$ZodCheckBigIntFormat",(t,e)=>{X.init(t,e);let[n,i]=Hu[e.format];t._zod.onattach.push(r=>{let o=r._zod.bag;o.format=e.format,o.minimum=n,o.maximum=i}),t._zod.check=r=>{let o=r.value;o<n&&r.issues.push({origin:"bigint",input:o,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!e.abort}),o>i&&r.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:t,continue:!e.abort})}}),Rc=m("$ZodCheckMaxSize",(t,e)=>{var n;X.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!Rt(r)&&r.size!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<r&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let r=i.value;r.size<=e.maximum||i.issues.push({origin:Vn(r),code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),Nc=m("$ZodCheckMinSize",(t,e)=>{var n;X.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!Rt(r)&&r.size!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>r&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let r=i.value;r.size>=e.minimum||i.issues.push({origin:Vn(r),code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),Dc=m("$ZodCheckSizeEquals",(t,e)=>{var n;X.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!Rt(r)&&r.size!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag;r.minimum=e.size,r.maximum=e.size,r.size=e.size}),t._zod.check=i=>{let r=i.value,o=r.size;if(o===e.size)return;let s=o>e.size;i.issues.push({origin:Vn(r),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),Lc=m("$ZodCheckMaxLength",(t,e)=>{var n;X.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!Rt(r)&&r.length!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<r&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let r=i.value;if(r.length<=e.maximum)return;let s=Zn(r);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),Uc=m("$ZodCheckMinLength",(t,e)=>{var n;X.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!Rt(r)&&r.length!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>r&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let r=i.value;if(r.length>=e.minimum)return;let s=Zn(r);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),jc=m("$ZodCheckLengthEquals",(t,e)=>{var n;X.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!Rt(r)&&r.length!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag;r.minimum=e.length,r.maximum=e.length,r.length=e.length}),t._zod.check=i=>{let r=i.value,o=r.length;if(o===e.length)return;let s=Zn(r),a=o>e.length;i.issues.push({origin:s,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),Fr=m("$ZodCheckStringFormat",(t,e)=>{var n,i;X.init(t,e),t._zod.onattach.push(r=>{let o=r._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(n=t._zod).check??(n.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:e.format,input:r.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(i=t._zod).check??(i.check=()=>{})}),Mc=m("$ZodCheckRegex",(t,e)=>{Fr.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),Fc=m("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Oc),Fr.init(t,e)}),Vc=m("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Ac),Fr.init(t,e)}),Zc=m("$ZodCheckIncludes",(t,e)=>{X.init(t,e);let n=Ke(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${n}`:n);e.pattern=i,t._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),t._zod.check=r=>{r.value.includes(e.includes,e.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:r.value,inst:t,continue:!e.abort})}}),Bc=m("$ZodCheckStartsWith",(t,e)=>{X.init(t,e);let n=new RegExp(`^${Ke(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),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})}}),Gc=m("$ZodCheckEndsWith",(t,e)=>{X.init(t,e);let n=new RegExp(`.*${Ke(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),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})}});Wc=m("$ZodCheckProperty",(t,e)=>{X.init(t,e),t._zod.check=n=>{let i=e.schema._zod.run({value:n.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(r=>Jg(r,n,e.property));Jg(i,n,e.property)}}),qc=m("$ZodCheckMimeType",(t,e)=>{X.init(t,e);let n=new Set(e.mime);t._zod.onattach.push(i=>{i._zod.bag.mime=e.mime}),t._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:t,continue:!e.abort})}}),Hc=m("$ZodCheckOverwrite",(t,e)=>{X.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}})});var Jn,Jc=v(()=>{Jn=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(`
3
+ var PE=Object.create;var Wu=Object.defineProperty;var CE=Object.getOwnPropertyDescriptor;var RE=Object.getOwnPropertyNames;var zE=Object.getPrototypeOf,NE=Object.prototype.hasOwnProperty;var ae=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var v=(t,e)=>()=>(t&&(e=t(t=0)),e);var R=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),He=(t,e)=>{for(var n in e)Wu(t,n,{get:e[n],enumerable:!0})},DE=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of RE(e))!NE.call(t,r)&&r!==n&&Wu(t,r,{get:()=>e[r],enumerable:!(i=CE(e,r))||i.enumerable});return t};var Je=(t,e,n)=>(n=t!=null?PE(zE(t)):{},DE(e||!t||!t.__esModule?Wu(n,"default",{value:t,enumerable:!0}):n,t));function LE(t){try{return JSON.stringify(t,(e,n)=>n instanceof Error?{name:n.name,message:n.message,stack:n.stack}:n)}catch{return"[unserializable meta]"}}var Zg,qu,B,Bg=v(()=>{"use strict";Zg={debug:0,info:1,warn:2,error:3};qu=class{level;constructor(e="info"){this.level=e}setLevel(e){this.level=e}getLevel(){return this.level}debug(e,n){this.emit("debug",e,n)}info(e,n){this.emit("info",e,n)}warn(e,n){this.emit("warn",e,n)}error(e,n){this.emit("error",e,n)}emit(e,n,i){if(Zg[e]<Zg[this.level])return;let o=`[${new Date().toISOString()}] ${e.toUpperCase()}`,s=i!==void 0?`${o} ${n} ${LE(i)}`:`${o} ${n}`;e==="warn"?console.warn(s):console.error(s)}},B=new qu});var Gg=v(()=>{"use strict"});var Wg,Hu=v(()=>{"use strict";Wg="JARVIS_HOME"});function m(t,e,n){function i(a,u){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:u,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,u);let c=s.prototype,l=Object.keys(c);for(let d=0;d<l.length;d++){let h=l[d];h in a||(a[h]=c[h].bind(a))}}let r=n?.Parent??Object;class o extends r{}Object.defineProperty(o,"name",{value:t});function s(a){var u;let c=n?.Parent?new o:this;i(c,a),(u=c._zod).deferred??(u.deferred=[]);for(let l of c._zod.deferred)l();return c}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(t)}),Object.defineProperty(s,"name",{value:t}),s}function oe(t){return t&&Object.assign(nr,t),nr}var qg,Ju,Ku,ot,zt,nr,ir=v(()=>{Ju=Object.freeze({status:"aborted"});Ku=Symbol("zod_brand"),ot=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},zt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(qg=globalThis).__zod_globalConfig??(qg.__zod_globalConfig={});nr=globalThis.__zod_globalConfig});var x={};He(x,{BIGINT_FORMAT_RANGES:()=>sc,Class:()=>Xu,NUMBER_FORMAT_RANGES:()=>oc,aborted:()=>Ut,allowsEval:()=>tc,assert:()=>VE,assertEqual:()=>UE,assertIs:()=>ME,assertNever:()=>FE,assertNotEqual:()=>jE,assignProp:()=>Dt,base64ToUint8Array:()=>Jg,base64urlToUint8Array:()=>oI,cached:()=>Dr,captureStackTrace:()=>So,cleanEnum:()=>iI,cleanRegex:()=>Wn,clone:()=>Ie,cloneDef:()=>BE,createTransparentProxy:()=>KE,defineLazy:()=>V,esc:()=>wo,escapeRegex:()=>Ke,explicitlyAborted:()=>ac,extend:()=>QE,finalizeIssue:()=>Te,floatSafeRemainder:()=>Qu,getElementAtPath:()=>GE,getEnumValues:()=>Gn,getLengthableOrigin:()=>Jn,getParsedType:()=>JE,getSizableOrigin:()=>Hn,hexToUint8Array:()=>aI,isObject:()=>or,isPlainObject:()=>Lt,issue:()=>Lr,joinValues:()=>g,jsonStringifyReplacer:()=>Nr,merge:()=>tI,mergeDefs:()=>$t,normalizeParams:()=>w,nullish:()=>Nt,numKeys:()=>HE,objectClone:()=>ZE,omit:()=>XE,optionalKeys:()=>ic,parsedType:()=>$,partial:()=>rI,pick:()=>YE,prefixIssues:()=>ze,primitiveTypes:()=>nc,promiseAllObject:()=>WE,propertyKeyTypes:()=>qn,randomString:()=>qE,required:()=>nI,safeExtend:()=>eI,shallowClone:()=>rc,slugify:()=>ec,stringifyPrimitive:()=>b,uint8ArrayToBase64:()=>Kg,uint8ArrayToBase64url:()=>sI,uint8ArrayToHex:()=>uI,unwrapMessage:()=>Bn});function UE(t){return t}function jE(t){return t}function ME(t){}function FE(t){throw new Error("Unexpected value in exhaustive check")}function VE(t){}function Gn(t){let e=Object.values(t).filter(i=>typeof i=="number");return Object.entries(t).filter(([i,r])=>e.indexOf(+i)===-1).map(([i,r])=>r)}function g(t,e="|"){return t.map(n=>b(n)).join(e)}function Nr(t,e){return typeof e=="bigint"?e.toString():e}function Dr(t){return{get value(){{let n=t();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function Nt(t){return t==null}function Wn(t){let e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}function Qu(t,e){let n=t/e,i=Math.round(n),r=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-i}function V(t,e,n){let i;Object.defineProperty(t,e,{get(){if(i!==Hg)return i===void 0&&(i=Hg,i=n()),i},set(r){Object.defineProperty(t,e,{value:r})},configurable:!0})}function ZE(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function Dt(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}function $t(...t){let e={};for(let n of t){let i=Object.getOwnPropertyDescriptors(n);Object.assign(e,i)}return Object.defineProperties({},e)}function BE(t){return $t(t._zod.def)}function GE(t,e){return e?e.reduce((n,i)=>n?.[i],t):t}function WE(t){let e=Object.keys(t),n=e.map(i=>t[i]);return Promise.all(n).then(i=>{let r={};for(let o=0;o<e.length;o++)r[e[o]]=i[o];return r})}function qE(t=10){let e="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<t;i++)n+=e[Math.floor(Math.random()*e.length)];return n}function wo(t){return JSON.stringify(t)}function ec(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function or(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Lt(t){if(or(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let n=e.prototype;return!(or(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function rc(t){return Lt(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function HE(t){let e=0;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function Ke(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ie(t,e,n){let i=new t._zod.constr(e??t._zod.def);return(!e||n?.parent)&&(i._zod.parent=t),i}function w(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 KE(t){let e;return new Proxy({},{get(n,i,r){return e??(e=t()),Reflect.get(e,i,r)},set(n,i,r,o){return e??(e=t()),Reflect.set(e,i,r,o)},has(n,i){return e??(e=t()),Reflect.has(e,i)},deleteProperty(n,i){return e??(e=t()),Reflect.deleteProperty(e,i)},ownKeys(n){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(n,i){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(n,i,r){return e??(e=t()),Reflect.defineProperty(e,i,r)}})}function b(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function ic(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function YE(t,e){let n=t._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=$t(t._zod.def,{get shape(){let s={};for(let a in e){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(s[a]=n.shape[a])}return Dt(this,"shape",s),s},checks:[]});return Ie(t,o)}function XE(t,e){let n=t._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=$t(t._zod.def,{get shape(){let s={...t._zod.def.shape};for(let a in e){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete s[a]}return Dt(this,"shape",s),s},checks:[]});return Ie(t,o)}function QE(t,e){if(!Lt(e))throw new Error("Invalid input to extend: expected a plain object");let n=t._zod.def.checks;if(n&&n.length>0){let o=t._zod.def.shape;for(let s in e)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=$t(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return Dt(this,"shape",o),o}});return Ie(t,r)}function eI(t,e){if(!Lt(e))throw new Error("Invalid input to safeExtend: expected a plain object");let n=$t(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e};return Dt(this,"shape",i),i}});return Ie(t,n)}function tI(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=$t(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e._zod.def.shape};return Dt(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Ie(t,n)}function rI(t,e,n){let r=e._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=$t(e._zod.def,{get shape(){let a=e._zod.def.shape,u={...a};if(n)for(let c in n){if(!(c in a))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(u[c]=t?new t({type:"optional",innerType:a[c]}):a[c])}else for(let c in a)u[c]=t?new t({type:"optional",innerType:a[c]}):a[c];return Dt(this,"shape",u),u},checks:[]});return Ie(e,s)}function nI(t,e,n){let i=$t(e._zod.def,{get shape(){let r=e._zod.def.shape,o={...r};if(n)for(let s in n){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(o[s]=new t({type:"nonoptional",innerType:r[s]}))}else for(let s in r)o[s]=new t({type:"nonoptional",innerType:r[s]});return Dt(this,"shape",o),o}});return Ie(e,i)}function Ut(t,e=0){if(t.aborted===!0)return!0;for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue!==!0)return!0;return!1}function ac(t,e=0){if(t.aborted===!0)return!0;for(let n=e;n<t.issues.length;n++)if(t.issues[n]?.continue===!1)return!0;return!1}function ze(t,e){return e.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(t),n})}function Bn(t){return typeof t=="string"?t:t?.message}function Te(t,e,n){let i=t.message?t.message:Bn(t.inst?._zod.def?.error?.(t))??Bn(e?.error?.(t))??Bn(n.customError?.(t))??Bn(n.localeError?.(t))??"Invalid input",{inst:r,continue:o,input:s,...a}=t;return a.path??(a.path=[]),a.message=i,e?.reportInput&&(a.input=s),a}function Hn(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function Jn(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function $(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 n=t;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return e}function Lr(...t){let[e,n,i]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:i}:{...e}}function iI(t){return Object.entries(t).filter(([e,n])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Jg(t){let e=atob(t),n=new Uint8Array(e.length);for(let i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return n}function Kg(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}function oI(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-e.length%4)%4);return Jg(e+n)}function sI(t){return Kg(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function aI(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)n[i/2]=Number.parseInt(e.slice(i,i+2),16);return n}function uI(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var Hg,So,tc,JE,qn,nc,oc,sc,Xu,z=v(()=>{ir();Hg=Symbol("evaluating");So="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};tc=Dr(()=>{if(nr.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});JE=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}`)}},qn=new Set(["string","number","symbol"]),nc=new Set(["string","number","bigint","boolean","symbol","undefined"]);oc={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]},sc={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};Xu=class{constructor(...e){}}});function Yn(t,e=n=>n.message){let n={},i=[];for(let r of t.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(e(r))):i.push(e(r));return{formErrors:i,fieldErrors:n}}function Xn(t,e=n=>n.message){let n={_errors:[]},i=(r,o=[])=>{for(let s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>i({issues:a},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let a=[...o,...s.path];if(a.length===0)n._errors.push(e(s));else{let u=n,c=0;for(;c<a.length;){let l=a[c];c===a.length-1?(u[l]=u[l]||{_errors:[]},u[l]._errors.push(e(s))):u[l]=u[l]||{_errors:[]},u=u[l],c++}}}};return i(t),n}function uc(t,e=n=>n.message){let n={errors:[]},i=(r,o=[])=>{var s,a;for(let u of r.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(c=>i({issues:c},[...o,...u.path]));else if(u.code==="invalid_key")i({issues:u.issues},[...o,...u.path]);else if(u.code==="invalid_element")i({issues:u.issues},[...o,...u.path]);else{let c=[...o,...u.path];if(c.length===0){n.errors.push(e(u));continue}let l=n,d=0;for(;d<c.length;){let h=c[d],f=d===c.length-1;typeof h=="string"?(l.properties??(l.properties={}),(s=l.properties)[h]??(s[h]={errors:[]}),l=l.properties[h]):(l.items??(l.items=[]),(a=l.items)[h]??(a[h]={errors:[]}),l=l.items[h]),f&&l.errors.push(e(u)),d++}}};return i(t),n}function Xg(t){let e=[],n=t.map(i=>typeof i=="object"?i.key:i);for(let i of n)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 cc(t){let e=[],n=[...t.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${Xg(i.path)}`);return e.join(`
4
+ `)}var Yg,Kn,Ne,lc=v(()=>{ir();z();Yg=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,Nr,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},Kn=m("$ZodError",Yg),Ne=m("$ZodError",Yg,{Parent:Error})});var Ur,ko,jr,Eo,Mr,dc,Fr,hc,Io,lI,To,dI,Oo,hI,Ao,fI,Po,pI,Co,mI,Ro,gI,zo,vI,fc=v(()=>{ir();lc();z();Ur=t=>(e,n,i,r)=>{let o=i?{...i,async:!1}:{async:!1},s=e._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new ot;if(s.issues.length){let a=new(r?.Err??t)(s.issues.map(u=>Te(u,o,oe())));throw So(a,r?.callee),a}return s.value},ko=Ur(Ne),jr=t=>async(e,n,i,r)=>{let o=i?{...i,async:!0}:{async:!0},s=e._zod.run({value:n,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(r?.Err??t)(s.issues.map(u=>Te(u,o,oe())));throw So(a,r?.callee),a}return s.value},Eo=jr(Ne),Mr=t=>(e,n,i)=>{let r=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new ot;return o.issues.length?{success:!1,error:new(t??Kn)(o.issues.map(s=>Te(s,r,oe())))}:{success:!0,data:o.value}},dc=Mr(Ne),Fr=t=>async(e,n,i)=>{let r=i?{...i,async:!0}:{async:!0},o=e._zod.run({value:n,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new t(o.issues.map(s=>Te(s,r,oe())))}:{success:!0,data:o.value}},hc=Fr(Ne),Io=t=>(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Ur(t)(e,n,r)},lI=Io(Ne),To=t=>(e,n,i)=>Ur(t)(e,n,i),dI=To(Ne),Oo=t=>async(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return jr(t)(e,n,r)},hI=Oo(Ne),Ao=t=>async(e,n,i)=>jr(t)(e,n,i),fI=Ao(Ne),Po=t=>(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Mr(t)(e,n,r)},pI=Po(Ne),Co=t=>(e,n,i)=>Mr(t)(e,n,i),mI=Co(Ne),Ro=t=>async(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Fr(t)(e,n,r)},gI=Ro(Ne),zo=t=>async(e,n,i)=>Fr(t)(e,n,i),vI=zo(Ne)});var Ve={};He(Ve,{base64:()=>Oc,base64url:()=>No,bigint:()=>Dc,boolean:()=>Uc,browserEmail:()=>kI,cidrv4:()=>Ic,cidrv6:()=>Tc,cuid:()=>pc,cuid2:()=>mc,date:()=>Cc,datetime:()=>zc,domain:()=>TI,duration:()=>bc,e164:()=>Pc,email:()=>xc,emoji:()=>wc,extendedDuration:()=>yI,guid:()=>$c,hex:()=>OI,hostname:()=>II,html5Email:()=>xI,httpProtocol:()=>Ac,idnEmail:()=>SI,integer:()=>Lc,ipv4:()=>Sc,ipv6:()=>kc,ksuid:()=>yc,lowercase:()=>Fc,mac:()=>Ec,md5_base64:()=>PI,md5_base64url:()=>CI,md5_hex:()=>AI,nanoid:()=>_c,null:()=>jc,number:()=>Do,rfc5322Email:()=>wI,sha1_base64:()=>zI,sha1_base64url:()=>NI,sha1_hex:()=>RI,sha256_base64:()=>LI,sha256_base64url:()=>UI,sha256_hex:()=>DI,sha384_base64:()=>MI,sha384_base64url:()=>FI,sha384_hex:()=>jI,sha512_base64:()=>ZI,sha512_base64url:()=>BI,sha512_hex:()=>VI,string:()=>Nc,time:()=>Rc,ulid:()=>gc,undefined:()=>Mc,unicodeEmail:()=>Qg,uppercase:()=>Vc,uuid:()=>sr,uuid4:()=>_I,uuid6:()=>bI,uuid7:()=>$I,xid:()=>vc});function wc(){return new RegExp(EI,"u")}function tv(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 Rc(t){return new RegExp(`^${tv(t)}$`)}function zc(t){let e=tv({precision:t.precision}),n=["Z"];t.local&&n.push(""),t.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${e}(?:${n.join("|")})`;return new RegExp(`^${ev}T(?:${i})$`)}function Qn(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function ei(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var pc,mc,gc,vc,yc,_c,bc,yI,$c,sr,_I,bI,$I,xc,xI,wI,Qg,SI,kI,EI,Sc,kc,Ec,Ic,Tc,Oc,No,II,TI,Ac,Pc,ev,Cc,Nc,Dc,Lc,Do,Uc,jc,Mc,Fc,Vc,OI,AI,PI,CI,RI,zI,NI,DI,LI,UI,jI,MI,FI,VI,ZI,BI,Lo=v(()=>{z();pc=/^[cC][0-9a-z]{6,}$/,mc=/^[0-9a-z]+$/,gc=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,vc=/^[0-9a-vA-V]{20}$/,yc=/^[A-Za-z0-9]{27}$/,_c=/^[a-zA-Z0-9_-]{21}$/,bc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,yI=/^[-+]?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)?)??$/,$c=/^([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})$/,sr=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)$/,_I=sr(4),bI=sr(6),$I=sr(7),xc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,xI=/^[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])?)*$/,wI=/^(([^<>()\[\]\\.,;:\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,}))$/,Qg=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,SI=Qg,kI=/^[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])?)*$/,EI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";Sc=/^(?:(?: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])$/,kc=/^(([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}|:))$/,Ec=t=>{let e=Ke(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},Ic=/^((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])$/,Tc=/^(([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])$/,Oc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,No=/^[A-Za-z0-9_-]*$/,II=/^(?=.{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])?)*\.?$/,TI=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Ac=/^https?$/,Pc=/^\+[1-9]\d{6,14}$/,ev="(?:(?:\\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])))",Cc=new RegExp(`^${ev}$`);Nc=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Dc=/^-?\d+n?$/,Lc=/^-?\d+$/,Do=/^-?\d+(?:\.\d+)?$/,Uc=/^(?:true|false)$/i,jc=/^null$/i,Mc=/^undefined$/i,Fc=/^[^A-Z]*$/,Vc=/^[^a-z]*$/,OI=/^[0-9a-fA-F]*$/;AI=/^[0-9a-fA-F]{32}$/,PI=Qn(22,"=="),CI=ei(22),RI=/^[0-9a-fA-F]{40}$/,zI=Qn(27,"="),NI=ei(27),DI=/^[0-9a-fA-F]{64}$/,LI=Qn(43,"="),UI=ei(43),jI=/^[0-9a-fA-F]{96}$/,MI=Qn(64,""),FI=ei(64),VI=/^[0-9a-fA-F]{128}$/,ZI=Qn(86,"=="),BI=ei(86)});function rv(t,e,n){t.issues.length&&e.issues.push(...ze(n,t.issues))}var X,nv,Uo,jo,Zc,Bc,Gc,Wc,qc,Hc,Jc,Kc,Yc,Vr,Xc,Qc,el,tl,rl,nl,il,ol,sl,Mo=v(()=>{ir();Lo();z();X=m("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),nv={number:"number",bigint:"bigint",object:"date"},Uo=m("$ZodCheckLessThan",(t,e)=>{X.init(t,e);let n=nv[typeof e.value];t._zod.onattach.push(i=>{let r=i._zod.bag,o=(e.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?r.maximum=e.value:r.exclusiveMaximum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:n,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),jo=m("$ZodCheckGreaterThan",(t,e)=>{X.init(t,e);let n=nv[typeof e.value];t._zod.onattach.push(i=>{let r=i._zod.bag,o=(e.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?r.minimum=e.value:r.exclusiveMinimum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:n,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Zc=m("$ZodCheckMultipleOf",(t,e)=>{X.init(t,e),t._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=e.value)}),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%e.value===BigInt(0):Qu(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),Bc=m("$ZodCheckNumberFormat",(t,e)=>{X.init(t,e),e.format=e.format||"float64";let n=e.format?.includes("int"),i=n?"int":"number",[r,o]=oc[e.format];t._zod.onattach.push(s=>{let a=s._zod.bag;a.format=e.format,a.minimum=r,a.maximum=o,n&&(a.pattern=Lc)}),t._zod.check=s=>{let a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?s.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:!0,continue:!e.abort}):s.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:!0,continue:!e.abort});return}}a<r&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!e.abort})}}),Gc=m("$ZodCheckBigIntFormat",(t,e)=>{X.init(t,e);let[n,i]=sc[e.format];t._zod.onattach.push(r=>{let o=r._zod.bag;o.format=e.format,o.minimum=n,o.maximum=i}),t._zod.check=r=>{let o=r.value;o<n&&r.issues.push({origin:"bigint",input:o,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!e.abort}),o>i&&r.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:t,continue:!e.abort})}}),Wc=m("$ZodCheckMaxSize",(t,e)=>{var n;X.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!Nt(r)&&r.size!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<r&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let r=i.value;r.size<=e.maximum||i.issues.push({origin:Hn(r),code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),qc=m("$ZodCheckMinSize",(t,e)=>{var n;X.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!Nt(r)&&r.size!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>r&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let r=i.value;r.size>=e.minimum||i.issues.push({origin:Hn(r),code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),Hc=m("$ZodCheckSizeEquals",(t,e)=>{var n;X.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!Nt(r)&&r.size!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag;r.minimum=e.size,r.maximum=e.size,r.size=e.size}),t._zod.check=i=>{let r=i.value,o=r.size;if(o===e.size)return;let s=o>e.size;i.issues.push({origin:Hn(r),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),Jc=m("$ZodCheckMaxLength",(t,e)=>{var n;X.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!Nt(r)&&r.length!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<r&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let r=i.value;if(r.length<=e.maximum)return;let s=Jn(r);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),Kc=m("$ZodCheckMinLength",(t,e)=>{var n;X.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!Nt(r)&&r.length!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>r&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let r=i.value;if(r.length>=e.minimum)return;let s=Jn(r);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),Yc=m("$ZodCheckLengthEquals",(t,e)=>{var n;X.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!Nt(r)&&r.length!==void 0}),t._zod.onattach.push(i=>{let r=i._zod.bag;r.minimum=e.length,r.maximum=e.length,r.length=e.length}),t._zod.check=i=>{let r=i.value,o=r.length;if(o===e.length)return;let s=Jn(r),a=o>e.length;i.issues.push({origin:s,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),Vr=m("$ZodCheckStringFormat",(t,e)=>{var n,i;X.init(t,e),t._zod.onattach.push(r=>{let o=r._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(n=t._zod).check??(n.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:e.format,input:r.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(i=t._zod).check??(i.check=()=>{})}),Xc=m("$ZodCheckRegex",(t,e)=>{Vr.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),Qc=m("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Fc),Vr.init(t,e)}),el=m("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Vc),Vr.init(t,e)}),tl=m("$ZodCheckIncludes",(t,e)=>{X.init(t,e);let n=Ke(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${n}`:n);e.pattern=i,t._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),t._zod.check=r=>{r.value.includes(e.includes,e.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:r.value,inst:t,continue:!e.abort})}}),rl=m("$ZodCheckStartsWith",(t,e)=>{X.init(t,e);let n=new RegExp(`^${Ke(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),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})}}),nl=m("$ZodCheckEndsWith",(t,e)=>{X.init(t,e);let n=new RegExp(`.*${Ke(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),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})}});il=m("$ZodCheckProperty",(t,e)=>{X.init(t,e),t._zod.check=n=>{let i=e.schema._zod.run({value:n.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(r=>rv(r,n,e.property));rv(i,n,e.property)}}),ol=m("$ZodCheckMimeType",(t,e)=>{X.init(t,e);let n=new Set(e.mime);t._zod.onattach.push(i=>{i._zod.bag.mime=e.mime}),t._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:t,continue:!e.abort})}}),sl=m("$ZodCheckOverwrite",(t,e)=>{X.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}})});var ti,al=v(()=>{ti=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(`
5
5
  `).filter(s=>s),r=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(r)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let e=Function,n=this?.args,r=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...n,r.join(`
6
- `))}}});var Kc,Yc=v(()=>{Kc={major:4,minor:4,patch:3}});function _l(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function fv(t){if(!To.test(t))return!1;let e=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return _l(n)}function hv(t,e=null){try{let n=t.split(".");if(n.length!==3)return!1;let[i]=n;if(!i)return!1;let r=JSON.parse(atob(i));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||e&&(!("alg"in r)||r.alg!==e))}catch{return!1}}function Xg(t,e,n){t.issues.length&&e.issues.push(...Re(n,t.issues)),e.value[n]=t.value}function Lo(t,e,n,i,r,o){let s=n in i;if(t.issues.length){if(r&&o&&!s)return;e.issues.push(...Re(n,t.issues))}if(!s&&!r){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}t.value===void 0?s&&(e.value[n]=void 0):e.value[n]=t.value}function pv(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 n=Wu(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}}function mv(t,e,n,i,r,o){let s=[],a=r.keySet,u=r.catchall._zod,c=u.def.type,l=u.optin==="optional",d=u.optout==="optional";for(let f in e){if(f==="__proto__"||a.has(f))continue;if(c==="never"){s.push(f);continue}let h=u.run({value:e[f],issues:[]},i);h instanceof Promise?t.push(h.then(p=>Lo(p,n,f,e,l,d))):Lo(h,n,f,e,l,d)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o}),t.length?Promise.all(t).then(()=>n):n}function Qg(t,e,n,i){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;let r=t.filter(o=>!Lt(o));return r.length===1?(e.value=r[0].value,r[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(o=>o.issues.map(s=>Ie(s,i,oe())))}),e)}function ev(t,e,n,i){let r=t.filter(o=>o.issues.length===0);return r.length===1?(e.value=r[0].value,e):(r.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(o=>o.issues.map(s=>Ie(s,i,oe())))}):e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:[],inclusive:!1}),e)}function Xc(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Dt(t)&&Dt(e)){let n=Object.keys(e),i=Object.keys(t).filter(o=>n.indexOf(o)!==-1),r={...t,...e};for(let o of i){let s=Xc(t[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r[o]=s.data}return{valid:!0,data:r}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i<t.length;i++){let r=t[i],o=e[i],s=Xc(r,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function tv(t,e,n){let i=new Map,r;for(let a of e.issues)if(a.code==="unrecognized_keys"){r??(r=a);for(let u of a.keys)i.has(u)||i.set(u,{}),i.get(u).l=!0}else t.issues.push(a);for(let a of n.issues)if(a.code==="unrecognized_keys")for(let u of a.keys)i.has(u)||i.set(u,{}),i.get(u).r=!0;else t.issues.push(a);let o=[...i].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&r&&t.issues.push({...r,keys:o}),Lt(t))return t;let s=Xc(e.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return t.value=s.data,t}function rv(t,e){for(let n=t.length-1;n>=0;n--)if(t[n]._zod[e]!=="optional")return n+1;return 0}function nv(t,e,n){t.issues.length&&e.issues.push(...Re(n,t.issues)),e.value[n]=t.value}function iv(t,e,n,i,r){for(let o=0;o<n.length;o++){let s=t[o],a=o<i.length;if(s.issues.length){if(!a&&o>=r){e.value.length=o;break}e.issues.push(...Re(o,s.issues))}e.value[o]=s.value}for(let o=e.value.length-1;o>=i.length&&(n[o]._zod.optout==="optional"&&e.value[o]===void 0);o--)e.value.length=o;return e}function ov(t,e,n,i,r,o,s){t.issues.length&&(Fn.has(typeof i)?n.issues.push(...Re(i,t.issues)):n.issues.push({code:"invalid_key",origin:"map",input:r,inst:o,issues:t.issues.map(a=>Ie(a,s,oe()))})),e.issues.length&&(Fn.has(typeof i)?n.issues.push(...Re(i,e.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:o,key:i,issues:e.issues.map(a=>Ie(a,s,oe()))})),n.value.set(t.value,e.value)}function sv(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}function av(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}function uv(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function cv(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}function Ro(t,e,n){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},n)}function No(t,e,n){if(t.issues.length)return t.aborted=!0,t;if((n.direction||"forward")==="forward"){let r=e.transform(t.value,t);return r instanceof Promise?r.then(o=>Do(t,o,e.out,n)):Do(t,r,e.out,n)}else{let r=e.reverseTransform(t.value,t);return r instanceof Promise?r.then(o=>Do(t,o,e.in,n)):Do(t,r,e.in,n)}}function Do(t,e,n,i){return t.issues.length?(t.aborted=!0,t):n._zod.run({value:e,issues:t.issues},i)}function lv(t){return t.value=Object.freeze(t.value),t}function dv(t,e,n,i){if(!t){let r={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(r.params=i._zod.def.params),e.issues.push(Dr(r))}}var L,ar,H,Qc,el,tl,rl,nl,il,ol,sl,al,ul,cl,ll,dl,fl,hl,pl,ml,gl,vl,yl,bl,$l,xl,wl,Sl,Uo,kl,Kn,jo,El,Il,Tl,Ol,Al,Pl,Cl,zl,Rl,Nl,gv,Dl,Yn,Ll,Ul,jl,Mo,Ml,Fl,Vl,Zl,Bl,Gl,Wl,Fo,ql,Hl,Jl,Kl,Yl,Xl,Ql,ed,Vo,Xn,td,rd,nd,id,od,sd,ad,ud=v(()=>{zo();ir();Jc();tc();Ao();R();Yc();R();L=m("$ZodType",(t,e)=>{var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Kc;let i=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&i.unshift(t);for(let r of i)for(let o of r._zod.onattach)o(t);if(i.length===0)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let r=(s,a,u)=>{let c=Lt(s),l;for(let d of a){if(d._zod.def.when){if(Ju(s)||!d._zod.def.when(s))continue}else if(c)continue;let f=s.issues.length,h=d._zod.check(s);if(h instanceof Promise&&u?.async===!1)throw new ot;if(l||h instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await h,s.issues.length!==f&&(c||(c=Lt(s,f)))});else{if(s.issues.length===f)continue;c||(c=Lt(s,f))}}return l?l.then(()=>s):s},o=(s,a,u)=>{if(Lt(s))return s.aborted=!0,s;let c=r(a,i,u);if(c instanceof Promise){if(u.async===!1)throw new ot;return c.then(l=>t._zod.parse(l,u))}return t._zod.parse(c,u)};t._zod.run=(s,a)=>{if(a.skipChecks)return t._zod.parse(s,a);if(a.direction==="backward"){let c=t._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return c instanceof Promise?c.then(l=>o(l,s,a)):o(c,s,a)}let u=t._zod.parse(s,a);if(u instanceof Promise){if(a.async===!1)throw new ot;return u.then(c=>r(c,i,a))}return r(u,i,a)}}V(t,"~standard",()=>({validate:r=>{try{let o=Qu(t,r);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return ec(t,r).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),ar=m("$ZodString",(t,e)=>{L.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??wc(t._zod.bag),t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),H=m("$ZodStringFormat",(t,e)=>{Fr.init(t,e),ar.init(t,e)}),Qc=m("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=cc),H.init(t,e)}),el=m("$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=sr(i))}else e.pattern??(e.pattern=sr());H.init(t,e)}),tl=m("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=lc),H.init(t,e)}),rl=m("$ZodURL",(t,e)=>{H.init(t,e),t._zod.check=n=>{try{let i=n.value.trim();if(!e.normalize&&e.protocol?.source===yc.source&&!/^https?:\/\//i.test(i)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:t,continue:!e.abort});return}let r=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:n.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:n.value,inst:t,continue:!e.abort})),e.normalize?n.value=r.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort})}}}),nl=m("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=dc()),H.init(t,e)}),il=m("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=ac),H.init(t,e)}),ol=m("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=rc),H.init(t,e)}),sl=m("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=nc),H.init(t,e)}),al=m("$ZodULID",(t,e)=>{e.pattern??(e.pattern=ic),H.init(t,e)}),ul=m("$ZodXID",(t,e)=>{e.pattern??(e.pattern=oc),H.init(t,e)}),cl=m("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=sc),H.init(t,e)}),ll=m("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=xc(e)),H.init(t,e)}),dl=m("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=bc),H.init(t,e)}),fl=m("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=$c(e)),H.init(t,e)}),hl=m("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=uc),H.init(t,e)}),pl=m("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=fc),H.init(t,e),t._zod.bag.format="ipv4"}),ml=m("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=hc),H.init(t,e),t._zod.bag.format="ipv6",t._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!e.abort})}}}),gl=m("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=pc(e.delimiter)),H.init(t,e),t._zod.bag.format="mac"}),vl=m("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=mc),H.init(t,e)}),yl=m("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=gc),H.init(t,e),t._zod.check=n=>{let i=n.value.split("/");try{if(i.length!==2)throw new Error;let[r,o]=i;if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!e.abort})}}});bl=m("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=vc),H.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=n=>{_l(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}});$l=m("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=To),H.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=n=>{fv(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),xl=m("$ZodE164",(t,e)=>{e.pattern??(e.pattern=_c),H.init(t,e)});wl=m("$ZodJWT",(t,e)=>{H.init(t,e),t._zod.check=n=>{hv(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),Sl=m("$ZodCustomStringFormat",(t,e)=>{H.init(t,e),t._zod.check=n=>{e.fn(n.value)||n.issues.push({code:"invalid_format",format:e.format,input:n.value,inst:t,continue:!e.abort})}}),Uo=m("$ZodNumber",(t,e)=>{L.init(t,e),t._zod.pattern=t._zod.bag.pattern??Oo,t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let o=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:t,...o?{received:o}:{}}),n}}),kl=m("$ZodNumberFormat",(t,e)=>{Cc.init(t,e),Uo.init(t,e)}),Kn=m("$ZodBoolean",(t,e)=>{L.init(t,e),t._zod.pattern=Ec,t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:t}),n}}),jo=m("$ZodBigInt",(t,e)=>{L.init(t,e),t._zod.pattern=Sc,t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:t}),n}}),El=m("$ZodBigIntFormat",(t,e)=>{zc.init(t,e),jo.init(t,e)}),Il=m("$ZodSymbol",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:t}),n}}),Tl=m("$ZodUndefined",(t,e)=>{L.init(t,e),t._zod.pattern=Tc,t._zod.values=new Set([void 0]),t._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:t}),n}}),Ol=m("$ZodNull",(t,e)=>{L.init(t,e),t._zod.pattern=Ic,t._zod.values=new Set([null]),t._zod.parse=(n,i)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:t}),n}}),Al=m("$ZodAny",(t,e)=>{L.init(t,e),t._zod.parse=n=>n}),Pl=m("$ZodUnknown",(t,e)=>{L.init(t,e),t._zod.parse=n=>n}),Cl=m("$ZodNever",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)}),zl=m("$ZodVoid",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:t}),n}}),Rl=m("$ZodDate",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=new Date(n.value)}catch{}let r=n.value,o=r instanceof Date;return o&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...o?{received:"Invalid Date"}:{},inst:t}),n}});Nl=m("$ZodArray",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:t}),n;n.value=Array(r.length);let o=[];for(let s=0;s<r.length;s++){let a=r[s],u=e.element._zod.run({value:a,issues:[]},i);u instanceof Promise?o.push(u.then(c=>Xg(c,n,s))):Xg(u,n,s)}return o.length?Promise.all(o).then(()=>n):n}});gv=m("$ZodObject",(t,e)=>{if(L.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let u={...a};return Object.defineProperty(e,"shape",{value:u}),u}})}let i=Nr(()=>pv(e));V(t._zod,"propValues",()=>{let a=e.shape,u={};for(let c in a){let l=a[c]._zod;if(l.values){u[c]??(u[c]=new Set);for(let d of l.values)u[c].add(d)}}return u});let r=or,o=e.catchall,s;t._zod.parse=(a,u)=>{s??(s=i.value);let c=a.value;if(!r(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:t}),a;a.value={};let l=[],d=s.shape;for(let f of s.keys){let h=d[f],p=h._zod.optin==="optional",_=h._zod.optout==="optional",S=h._zod.run({value:c[f],issues:[]},u);S instanceof Promise?l.push(S.then(k=>Lo(k,a,f,c,p,_))):Lo(S,a,f,c,p,_)}return o?mv(l,c,a,u,i.value,t):l.length?Promise.all(l).then(()=>a):a}}),Dl=m("$ZodObjectJIT",(t,e)=>{gv.init(t,e);let n=t._zod.parse,i=Nr(()=>pv(e)),r=f=>{let h=new Jn(["shape","payload","ctx"]),p=i.value,_=C=>{let E=go(C);return`shape[${E}]._zod.run({ value: input[${E}], issues: [] }, ctx)`};h.write("const input = payload.value;");let S=Object.create(null),k=0;for(let C of p.keys)S[C]=`key_${k++}`;h.write("const newResult = {};");for(let C of p.keys){let E=S[C],T=go(C),Z=f[C],F=Z?._zod?.optin==="optional",q=Z?._zod?.optout==="optional";h.write(`const ${E} = ${_(C)};`),F&&q?h.write(`
6
+ `))}}});var ul,cl=v(()=>{ul={major:4,minor:4,patch:3}});function Pl(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function _v(t){if(!No.test(t))return!1;let e=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return Pl(n)}function bv(t,e=null){try{let n=t.split(".");if(n.length!==3)return!1;let[i]=n;if(!i)return!1;let r=JSON.parse(atob(i));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||e&&(!("alg"in r)||r.alg!==e))}catch{return!1}}function ov(t,e,n){t.issues.length&&e.issues.push(...ze(n,t.issues)),e.value[n]=t.value}function Bo(t,e,n,i,r,o){let s=n in i;if(t.issues.length){if(r&&o&&!s)return;e.issues.push(...ze(n,t.issues))}if(!s&&!r){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}t.value===void 0?s&&(e.value[n]=void 0):e.value[n]=t.value}function $v(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 n=ic(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}}function xv(t,e,n,i,r,o){let s=[],a=r.keySet,u=r.catchall._zod,c=u.def.type,l=u.optin==="optional",d=u.optout==="optional";for(let h in e){if(h==="__proto__"||a.has(h))continue;if(c==="never"){s.push(h);continue}let f=u.run({value:e[h],issues:[]},i);f instanceof Promise?t.push(f.then(p=>Bo(p,n,h,e,l,d))):Bo(f,n,h,e,l,d)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o}),t.length?Promise.all(t).then(()=>n):n}function sv(t,e,n,i){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;let r=t.filter(o=>!Ut(o));return r.length===1?(e.value=r[0].value,r[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(o=>o.issues.map(s=>Te(s,i,oe())))}),e)}function av(t,e,n,i){let r=t.filter(o=>o.issues.length===0);return r.length===1?(e.value=r[0].value,e):(r.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(o=>o.issues.map(s=>Te(s,i,oe())))}):e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:[],inclusive:!1}),e)}function ll(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Lt(t)&&Lt(e)){let n=Object.keys(e),i=Object.keys(t).filter(o=>n.indexOf(o)!==-1),r={...t,...e};for(let o of i){let s=ll(t[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r[o]=s.data}return{valid:!0,data:r}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i<t.length;i++){let r=t[i],o=e[i],s=ll(r,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function uv(t,e,n){let i=new Map,r;for(let a of e.issues)if(a.code==="unrecognized_keys"){r??(r=a);for(let u of a.keys)i.has(u)||i.set(u,{}),i.get(u).l=!0}else t.issues.push(a);for(let a of n.issues)if(a.code==="unrecognized_keys")for(let u of a.keys)i.has(u)||i.set(u,{}),i.get(u).r=!0;else t.issues.push(a);let o=[...i].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&r&&t.issues.push({...r,keys:o}),Ut(t))return t;let s=ll(e.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return t.value=s.data,t}function cv(t,e){for(let n=t.length-1;n>=0;n--)if(t[n]._zod[e]!=="optional")return n+1;return 0}function lv(t,e,n){t.issues.length&&e.issues.push(...ze(n,t.issues)),e.value[n]=t.value}function dv(t,e,n,i,r){for(let o=0;o<n.length;o++){let s=t[o],a=o<i.length;if(s.issues.length){if(!a&&o>=r){e.value.length=o;break}e.issues.push(...ze(o,s.issues))}e.value[o]=s.value}for(let o=e.value.length-1;o>=i.length&&(n[o]._zod.optout==="optional"&&e.value[o]===void 0);o--)e.value.length=o;return e}function hv(t,e,n,i,r,o,s){t.issues.length&&(qn.has(typeof i)?n.issues.push(...ze(i,t.issues)):n.issues.push({code:"invalid_key",origin:"map",input:r,inst:o,issues:t.issues.map(a=>Te(a,s,oe()))})),e.issues.length&&(qn.has(typeof i)?n.issues.push(...ze(i,e.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:o,key:i,issues:e.issues.map(a=>Te(a,s,oe()))})),n.value.set(t.value,e.value)}function fv(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}function pv(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}function mv(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function gv(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}function Fo(t,e,n){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},n)}function Vo(t,e,n){if(t.issues.length)return t.aborted=!0,t;if((n.direction||"forward")==="forward"){let r=e.transform(t.value,t);return r instanceof Promise?r.then(o=>Zo(t,o,e.out,n)):Zo(t,r,e.out,n)}else{let r=e.reverseTransform(t.value,t);return r instanceof Promise?r.then(o=>Zo(t,o,e.in,n)):Zo(t,r,e.in,n)}}function Zo(t,e,n,i){return t.issues.length?(t.aborted=!0,t):n._zod.run({value:e,issues:t.issues},i)}function vv(t){return t.value=Object.freeze(t.value),t}function yv(t,e,n,i){if(!t){let r={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(r.params=i._zod.def.params),e.issues.push(Lr(r))}}var L,ar,H,dl,hl,fl,pl,ml,gl,vl,yl,_l,bl,$l,xl,wl,Sl,kl,El,Il,Tl,Ol,Al,Cl,Rl,zl,Nl,Dl,Go,Ll,ri,Wo,Ul,jl,Ml,Fl,Vl,Zl,Bl,Gl,Wl,ql,wv,Hl,ni,Jl,Kl,Yl,qo,Xl,Ql,ed,td,rd,nd,id,Ho,od,sd,ad,ud,cd,ld,dd,hd,Jo,ii,fd,pd,md,gd,vd,yd,_d,bd=v(()=>{Mo();ir();al();fc();Lo();z();cl();z();L=m("$ZodType",(t,e)=>{var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=ul;let i=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&i.unshift(t);for(let r of i)for(let o of r._zod.onattach)o(t);if(i.length===0)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let r=(s,a,u)=>{let c=Ut(s),l;for(let d of a){if(d._zod.def.when){if(ac(s)||!d._zod.def.when(s))continue}else if(c)continue;let h=s.issues.length,f=d._zod.check(s);if(f instanceof Promise&&u?.async===!1)throw new ot;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await f,s.issues.length!==h&&(c||(c=Ut(s,h)))});else{if(s.issues.length===h)continue;c||(c=Ut(s,h))}}return l?l.then(()=>s):s},o=(s,a,u)=>{if(Ut(s))return s.aborted=!0,s;let c=r(a,i,u);if(c instanceof Promise){if(u.async===!1)throw new ot;return c.then(l=>t._zod.parse(l,u))}return t._zod.parse(c,u)};t._zod.run=(s,a)=>{if(a.skipChecks)return t._zod.parse(s,a);if(a.direction==="backward"){let c=t._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return c instanceof Promise?c.then(l=>o(l,s,a)):o(c,s,a)}let u=t._zod.parse(s,a);if(u instanceof Promise){if(a.async===!1)throw new ot;return u.then(c=>r(c,i,a))}return r(u,i,a)}}V(t,"~standard",()=>({validate:r=>{try{let o=dc(t,r);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return hc(t,r).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),ar=m("$ZodString",(t,e)=>{L.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Nc(t._zod.bag),t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),H=m("$ZodStringFormat",(t,e)=>{Vr.init(t,e),ar.init(t,e)}),dl=m("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=$c),H.init(t,e)}),hl=m("$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=sr(i))}else e.pattern??(e.pattern=sr());H.init(t,e)}),fl=m("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=xc),H.init(t,e)}),pl=m("$ZodURL",(t,e)=>{H.init(t,e),t._zod.check=n=>{try{let i=n.value.trim();if(!e.normalize&&e.protocol?.source===Ac.source&&!/^https?:\/\//i.test(i)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:t,continue:!e.abort});return}let r=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:n.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:n.value,inst:t,continue:!e.abort})),e.normalize?n.value=r.href:n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort})}}}),ml=m("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=wc()),H.init(t,e)}),gl=m("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=_c),H.init(t,e)}),vl=m("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=pc),H.init(t,e)}),yl=m("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=mc),H.init(t,e)}),_l=m("$ZodULID",(t,e)=>{e.pattern??(e.pattern=gc),H.init(t,e)}),bl=m("$ZodXID",(t,e)=>{e.pattern??(e.pattern=vc),H.init(t,e)}),$l=m("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=yc),H.init(t,e)}),xl=m("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=zc(e)),H.init(t,e)}),wl=m("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Cc),H.init(t,e)}),Sl=m("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Rc(e)),H.init(t,e)}),kl=m("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=bc),H.init(t,e)}),El=m("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Sc),H.init(t,e),t._zod.bag.format="ipv4"}),Il=m("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=kc),H.init(t,e),t._zod.bag.format="ipv6",t._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!e.abort})}}}),Tl=m("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=Ec(e.delimiter)),H.init(t,e),t._zod.bag.format="mac"}),Ol=m("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Ic),H.init(t,e)}),Al=m("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Tc),H.init(t,e),t._zod.check=n=>{let i=n.value.split("/");try{if(i.length!==2)throw new Error;let[r,o]=i;if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!e.abort})}}});Cl=m("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Oc),H.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=n=>{Pl(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}});Rl=m("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=No),H.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=n=>{_v(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),zl=m("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Pc),H.init(t,e)});Nl=m("$ZodJWT",(t,e)=>{H.init(t,e),t._zod.check=n=>{bv(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),Dl=m("$ZodCustomStringFormat",(t,e)=>{H.init(t,e),t._zod.check=n=>{e.fn(n.value)||n.issues.push({code:"invalid_format",format:e.format,input:n.value,inst:t,continue:!e.abort})}}),Go=m("$ZodNumber",(t,e)=>{L.init(t,e),t._zod.pattern=t._zod.bag.pattern??Do,t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let o=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:t,...o?{received:o}:{}}),n}}),Ll=m("$ZodNumberFormat",(t,e)=>{Bc.init(t,e),Go.init(t,e)}),ri=m("$ZodBoolean",(t,e)=>{L.init(t,e),t._zod.pattern=Uc,t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:t}),n}}),Wo=m("$ZodBigInt",(t,e)=>{L.init(t,e),t._zod.pattern=Dc,t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:t}),n}}),Ul=m("$ZodBigIntFormat",(t,e)=>{Gc.init(t,e),Wo.init(t,e)}),jl=m("$ZodSymbol",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:t}),n}}),Ml=m("$ZodUndefined",(t,e)=>{L.init(t,e),t._zod.pattern=Mc,t._zod.values=new Set([void 0]),t._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:t}),n}}),Fl=m("$ZodNull",(t,e)=>{L.init(t,e),t._zod.pattern=jc,t._zod.values=new Set([null]),t._zod.parse=(n,i)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:t}),n}}),Vl=m("$ZodAny",(t,e)=>{L.init(t,e),t._zod.parse=n=>n}),Zl=m("$ZodUnknown",(t,e)=>{L.init(t,e),t._zod.parse=n=>n}),Bl=m("$ZodNever",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)}),Gl=m("$ZodVoid",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:t}),n}}),Wl=m("$ZodDate",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=new Date(n.value)}catch{}let r=n.value,o=r instanceof Date;return o&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...o?{received:"Invalid Date"}:{},inst:t}),n}});ql=m("$ZodArray",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:t}),n;n.value=Array(r.length);let o=[];for(let s=0;s<r.length;s++){let a=r[s],u=e.element._zod.run({value:a,issues:[]},i);u instanceof Promise?o.push(u.then(c=>ov(c,n,s))):ov(u,n,s)}return o.length?Promise.all(o).then(()=>n):n}});wv=m("$ZodObject",(t,e)=>{if(L.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let u={...a};return Object.defineProperty(e,"shape",{value:u}),u}})}let i=Dr(()=>$v(e));V(t._zod,"propValues",()=>{let a=e.shape,u={};for(let c in a){let l=a[c]._zod;if(l.values){u[c]??(u[c]=new Set);for(let d of l.values)u[c].add(d)}}return u});let r=or,o=e.catchall,s;t._zod.parse=(a,u)=>{s??(s=i.value);let c=a.value;if(!r(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:t}),a;a.value={};let l=[],d=s.shape;for(let h of s.keys){let f=d[h],p=f._zod.optin==="optional",_=f._zod.optout==="optional",S=f._zod.run({value:c[h],issues:[]},u);S instanceof Promise?l.push(S.then(k=>Bo(k,a,h,c,p,_))):Bo(S,a,h,c,p,_)}return o?xv(l,c,a,u,i.value,t):l.length?Promise.all(l).then(()=>a):a}}),Hl=m("$ZodObjectJIT",(t,e)=>{wv.init(t,e);let n=t._zod.parse,i=Dr(()=>$v(e)),r=h=>{let f=new ti(["shape","payload","ctx"]),p=i.value,_=C=>{let E=wo(C);return`shape[${E}]._zod.run({ value: input[${E}], issues: [] }, ctx)`};f.write("const input = payload.value;");let S=Object.create(null),k=0;for(let C of p.keys)S[C]=`key_${k++}`;f.write("const newResult = {};");for(let C of p.keys){let E=S[C],T=wo(C),Z=h[C],F=Z?._zod?.optin==="optional",q=Z?._zod?.optout==="optional";f.write(`const ${E} = ${_(C)};`),F&&q?f.write(`
7
7
  if (${E}.issues.length) {
8
8
  if (${T} in input) {
9
9
  payload.issues = payload.issues.concat(${E}.issues.map(iss => ({
@@ -21,7 +21,7 @@ var wE=Object.create;var Ru=Object.defineProperty;var SE=Object.getOwnPropertyDe
21
21
  newResult[${T}] = ${E}.value;
22
22
  }
23
23
 
24
- `):F?h.write(`
24
+ `):F?f.write(`
25
25
  if (${E}.issues.length) {
26
26
  payload.issues = payload.issues.concat(${E}.issues.map(iss => ({
27
27
  ...iss,
@@ -37,7 +37,7 @@ var wE=Object.create;var Ru=Object.defineProperty;var SE=Object.getOwnPropertyDe
37
37
  newResult[${T}] = ${E}.value;
38
38
  }
39
39
 
40
- `):h.write(`
40
+ `):f.write(`
41
41
  const ${E}_present = ${T} in input;
42
42
  if (${E}.issues.length) {
43
43
  payload.issues = payload.issues.concat(${E}.issues.map(iss => ({
@@ -62,20 +62,26 @@ var wE=Object.create;var Ru=Object.defineProperty;var SE=Object.getOwnPropertyDe
62
62
  }
63
63
  }
64
64
 
65
- `)}h.write("payload.value = newResult;"),h.write("return payload;");let P=h.compile();return(C,E)=>P(f,C,E)},o,s=or,a=!nr.jitless,c=a&&Zu.value,l=e.catchall,d;t._zod.parse=(f,h)=>{d??(d=i.value);let p=f.value;return s(p)?a&&c&&h?.async===!1&&h.jitless!==!0?(o||(o=r(e.shape)),f=o(f,h),l?mv([],p,f,h,d,t):f):n(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:p,inst:t}),f)}});Yn=m("$ZodUnion",(t,e)=>{L.init(t,e),V(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),V(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),V(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),V(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(r=>r._zod.pattern);return new RegExp(`^(${i.map(r=>Mn(r.source)).join("|")})$`)}});let n=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1,s=[];for(let a of e.options){let u=a._zod.run({value:i.value,issues:[]},r);if(u instanceof Promise)s.push(u),o=!0;else{if(u.issues.length===0)return u;s.push(u)}}return o?Promise.all(s).then(a=>Qg(a,i,t,r)):Qg(s,i,t,r)}});Ll=m("$ZodXor",(t,e)=>{Yn.init(t,e),e.inclusive=!1;let n=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1,s=[];for(let a of e.options){let u=a._zod.run({value:i.value,issues:[]},r);u instanceof Promise?(s.push(u),o=!0):s.push(u)}return o?Promise.all(s).then(a=>ev(a,i,t,r)):ev(s,i,t,r)}}),Ul=m("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Yn.init(t,e);let n=t._zod.parse;V(t._zod,"propValues",()=>{let r={};for(let o of e.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[a,u]of Object.entries(s)){r[a]||(r[a]=new Set);for(let c of u)r[a].add(c)}}return r});let i=Nr(()=>{let r=e.options,o=new Map;for(let s of r){let a=s._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let u of a){if(o.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,s)}}return o});t._zod.parse=(r,o)=>{let s=r.value;if(!or(s))return r.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),r;let a=i.value.get(s?.[e.discriminator]);return a?a._zod.run(r,o):e.unionFallback||o.direction==="backward"?n(r,o):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(i.value.keys()),input:s,path:[e.discriminator],inst:t}),r)}}),jl=m("$ZodIntersection",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{let r=n.value,o=e.left._zod.run({value:r,issues:[]},i),s=e.right._zod.run({value:r,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([u,c])=>tv(n,u,c)):tv(n,o,s)}});Mo=m("$ZodTuple",(t,e)=>{L.init(t,e);let n=e.items;t._zod.parse=(i,r)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:t,expected:"tuple",code:"invalid_type"}),i;i.value=[];let s=[],a=rv(n,"optin"),u=rv(n,"optout");if(!e.rest){if(o.length<a)return i.issues.push({code:"too_small",minimum:a,inclusive:!0,input:o,inst:t,origin:"array"}),i;o.length>n.length&&i.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:o,inst:t,origin:"array"})}let c=new Array(n.length);for(let l=0;l<n.length;l++){let d=n[l]._zod.run({value:o[l],issues:[]},r);d instanceof Promise?s.push(d.then(f=>{c[l]=f})):c[l]=d}if(e.rest){let l=n.length-1,d=o.slice(n.length);for(let f of d){l++;let h=e.rest._zod.run({value:f,issues:[]},r);h instanceof Promise?s.push(h.then(p=>nv(p,i,l))):nv(h,i,l)}}return s.length?Promise.all(s).then(()=>iv(c,i,n,o,u)):iv(c,i,n,o,u)}});Ml=m("$ZodRecord",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!Dt(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:t}),n;let o=[],s=e.keyType._zod.values;if(s){n.value={};let a=new Set;for(let c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){a.add(typeof c=="number"?c.toString():c);let l=e.keyType._zod.run({value:c,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(h=>Ie(h,i,oe())),input:c,path:[c],inst:t});continue}let d=l.value,f=e.valueType._zod.run({value:r[c],issues:[]},i);f instanceof Promise?o.push(f.then(h=>{h.issues.length&&n.issues.push(...Re(c,h.issues)),n.value[d]=h.value})):(f.issues.length&&n.issues.push(...Re(c,f.issues)),n.value[d]=f.value)}let u;for(let c in r)a.has(c)||(u=u??[],u.push(c));u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:r,inst:t,keys:u})}else{n.value={};for(let a of Reflect.ownKeys(r)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(r,a))continue;let u=e.keyType._zod.run({value:a,issues:[]},i);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Oo.test(a)&&u.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&&(u=d)}if(u.issues.length){e.mode==="loose"?n.value[a]=r[a]:n.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(d=>Ie(d,i,oe())),input:a,path:[a],inst:t});continue}let l=e.valueType._zod.run({value:r[a],issues:[]},i);l instanceof Promise?o.push(l.then(d=>{d.issues.length&&n.issues.push(...Re(a,d.issues)),n.value[u.value]=d.value})):(l.issues.length&&n.issues.push(...Re(a,l.issues)),n.value[u.value]=l.value)}}return o.length?Promise.all(o).then(()=>n):n}}),Fl=m("$ZodMap",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!(r instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:r,inst:t}),n;let o=[];n.value=new Map;for(let[s,a]of r){let u=e.keyType._zod.run({value:s,issues:[]},i),c=e.valueType._zod.run({value:a,issues:[]},i);u instanceof Promise||c instanceof Promise?o.push(Promise.all([u,c]).then(([l,d])=>{ov(l,d,n,s,r,t,i)})):ov(u,c,n,s,r,t,i)}return o.length?Promise.all(o).then(()=>n):n}});Vl=m("$ZodSet",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:t,expected:"set",code:"invalid_type"}),n;let o=[];n.value=new Set;for(let s of r){let a=e.valueType._zod.run({value:s,issues:[]},i);a instanceof Promise?o.push(a.then(u=>sv(u,n))):sv(a,n)}return o.length?Promise.all(o).then(()=>n):n}});Zl=m("$ZodEnum",(t,e)=>{L.init(t,e);let n=jn(e.entries),i=new Set(n);t._zod.values=i,t._zod.pattern=new RegExp(`^(${n.filter(r=>Fn.has(typeof r)).map(r=>typeof r=="string"?Ke(r):r.toString()).join("|")})$`),t._zod.parse=(r,o)=>{let s=r.value;return i.has(s)||r.issues.push({code:"invalid_value",values:n,input:s,inst:t}),r}}),Bl=m("$ZodLiteral",(t,e)=>{if(L.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let n=new Set(e.values);t._zod.values=n,t._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?Ke(i):i?Ke(i.toString()):String(i)).join("|")})$`),t._zod.parse=(i,r)=>{let o=i.value;return n.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),i}}),Gl=m("$ZodFile",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:t}),n}}),Wl=m("$ZodTransform",(t,e)=>{L.init(t,e),t._zod.optin="optional",t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new zt(t.constructor.name);let r=e.transform(n.value,n);if(i.async)return(r instanceof Promise?r:Promise.resolve(r)).then(s=>(n.value=s,n.fallback=!0,n));if(r instanceof Promise)throw new ot;return n.value=r,n.fallback=!0,n}});Fo=m("$ZodOptional",(t,e)=>{L.init(t,e),t._zod.optin="optional",t._zod.optout="optional",V(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),V(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${Mn(n.source)})?$`):void 0}),t._zod.parse=(n,i)=>{if(e.innerType._zod.optin==="optional"){let r=n.value,o=e.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>av(s,r)):av(o,r)}return n.value===void 0?n:e.innerType._zod.run(n,i)}}),ql=m("$ZodExactOptional",(t,e)=>{Fo.init(t,e),V(t._zod,"values",()=>e.innerType._zod.values),V(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(n,i)=>e.innerType._zod.run(n,i)}),Hl=m("$ZodNullable",(t,e)=>{L.init(t,e),V(t._zod,"optin",()=>e.innerType._zod.optin),V(t._zod,"optout",()=>e.innerType._zod.optout),V(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${Mn(n.source)}|null)$`):void 0}),V(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(n,i)=>n.value===null?n:e.innerType._zod.run(n,i)}),Jl=m("$ZodDefault",(t,e)=>{L.init(t,e),t._zod.optin="optional",V(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);if(n.value===void 0)return n.value=e.defaultValue,n;let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>uv(o,e)):uv(r,e)}});Kl=m("$ZodPrefault",(t,e)=>{L.init(t,e),t._zod.optin="optional",V(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,i))}),Yl=m("$ZodNonOptional",(t,e)=>{L.init(t,e),V(t._zod,"values",()=>{let n=e.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),t._zod.parse=(n,i)=>{let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>cv(o,t)):cv(r,t)}});Xl=m("$ZodSuccess",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new zt("ZodSuccess");let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>(n.value=o.issues.length===0,n)):(n.value=r.issues.length===0,n)}}),Ql=m("$ZodCatch",(t,e)=>{L.init(t,e),t._zod.optin="optional",V(t._zod,"optout",()=>e.innerType._zod.optout),V(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>(n.value=o.value,o.issues.length&&(n.value=e.catchValue({...n,error:{issues:o.issues.map(s=>Ie(s,i,oe()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=r.value,r.issues.length&&(n.value=e.catchValue({...n,error:{issues:r.issues.map(o=>Ie(o,i,oe()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),ed=m("$ZodNaN",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:t,expected:"nan",code:"invalid_type"}),n)}),Vo=m("$ZodPipe",(t,e)=>{L.init(t,e),V(t._zod,"values",()=>e.in._zod.values),V(t._zod,"optin",()=>e.in._zod.optin),V(t._zod,"optout",()=>e.out._zod.optout),V(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(n,i)=>{if(i.direction==="backward"){let o=e.out._zod.run(n,i);return o instanceof Promise?o.then(s=>Ro(s,e.in,i)):Ro(o,e.in,i)}let r=e.in._zod.run(n,i);return r instanceof Promise?r.then(o=>Ro(o,e.out,i)):Ro(r,e.out,i)}});Xn=m("$ZodCodec",(t,e)=>{L.init(t,e),V(t._zod,"values",()=>e.in._zod.values),V(t._zod,"optin",()=>e.in._zod.optin),V(t._zod,"optout",()=>e.out._zod.optout),V(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(n,i)=>{if((i.direction||"forward")==="forward"){let o=e.in._zod.run(n,i);return o instanceof Promise?o.then(s=>No(s,e,i)):No(o,e,i)}else{let o=e.out._zod.run(n,i);return o instanceof Promise?o.then(s=>No(s,e,i)):No(o,e,i)}}});td=m("$ZodPreprocess",(t,e)=>{Vo.init(t,e)}),rd=m("$ZodReadonly",(t,e)=>{L.init(t,e),V(t._zod,"propValues",()=>e.innerType._zod.propValues),V(t._zod,"values",()=>e.innerType._zod.values),V(t._zod,"optin",()=>e.innerType?._zod?.optin),V(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(lv):lv(r)}});nd=m("$ZodTemplateLiteral",(t,e)=>{L.init(t,e);let n=[];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 r=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!r)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=r.startsWith("^")?1:0,s=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(o,s))}else if(i===null||Gu.has(typeof i))n.push(Ke(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);t._zod.pattern=new RegExp(`^${n.join("")}$`),t._zod.parse=(i,r)=>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)}),id=m("$ZodFunction",(t,e)=>(L.init(t,e),t._def=e,t._zod.def=e,t.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return function(...i){let r=t._def.input?yo(t._def.input,i):i,o=Reflect.apply(n,this,r);return t._def.output?yo(t._def.output,o):o}},t.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let r=t._def.input?await _o(t._def.input,i):i,o=await Reflect.apply(n,this,r);return t._def.output?await _o(t._def.output,o):o}},t._zod.parse=(n,i)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:t}),n):(t._def.output&&t._def.output._zod.def.type==="promise"?n.value=t.implementAsync(n.value):n.value=t.implement(n.value),n),t.input=(...n)=>{let i=t.constructor;return Array.isArray(n[0])?new i({type:"function",input:new Mo({type:"tuple",items:n[0],rest:n[1]}),output:t._def.output}):new i({type:"function",input:n[0],output:t._def.output})},t.output=n=>{let i=t.constructor;return new i({type:"function",input:t._def.input,output:n})},t)),od=m("$ZodPromise",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>Promise.resolve(n.value).then(r=>e.innerType._zod.run({value:r,issues:[]},i))}),sd=m("$ZodLazy",(t,e)=>{L.init(t,e),V(t._zod,"innerType",()=>{let n=e;return n._cachedInner||(n._cachedInner=e.getter()),n._cachedInner}),V(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),V(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),V(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),V(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(n,i)=>t._zod.innerType._zod.run(n,i)}),ad=m("$ZodCustom",(t,e)=>{X.init(t,e),L.init(t,e),t._zod.parse=(n,i)=>n,t._zod.check=n=>{let i=n.value,r=e.fn(i);if(r instanceof Promise)return r.then(o=>dv(o,n,i,t));dv(r,n,i,t)}})});function vv(){return{localeError:UI()}}var UI,yv=v(()=>{R();UI=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.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 ${r.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 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":return r.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 ${b(r.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: ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${r.maximum.toString()} ${s.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 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${r.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.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 "${r.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${r.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${r.keys.length>1?"\u0629":""}: ${g(r.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.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 ${r.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}}});function _v(){return{localeError:jI()}}var jI,bv=v(()=>{R();jI=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${r.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${a}`}case"invalid_value":return r.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${b(r.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${o}${r.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[o.format]??r.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${r.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${r.keys.length>1?"lar":""}: ${g(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${r.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}}});function $v(t,e,n,i){let r=Math.abs(t),o=r%10,s=r%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?n:i}function xv(){return{localeError:MI()}}var MI,wv=v(()=>{R();MI=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${r.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 ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":return r.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 ${b(r.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 ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);if(s){let a=Number(r.maximum),u=$v(a,s.unit.one,s.unit.few,s.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 ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${r.maximum.toString()} ${u}`}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 ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);if(s){let a=Number(r.minimum),u=$v(a,s.unit.one,s.unit.few,s.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 ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${r.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${r.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${g(r.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${r.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 ${r.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}}});function Sv(){return{localeError:FI()}}var FI,kv=v(()=>{R();FI=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${r.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 ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${b(r.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 ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${r.maximum.toString()} ${s.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 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${r.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;if(o.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 "${o.prefix}"`;if(o.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 "${o.suffix}"`;if(o.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 "${o.includes}"`;if(o.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 ${o.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${r.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u043E\u0432\u0435":""}: ${g(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${r.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 ${r.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}}});function Ev(){return{localeError:VI()}}var VI,Iv=v(()=>{R();VI=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${r.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${a}`}case"invalid_value":return r.values.length===1?`Valor inv\xE0lid: s'esperava ${b(r.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${g(r.values," o ")}`;case"too_big":{let o=r.inclusive?"com a m\xE0xim":"menys de",s=e(r.origin);return s?`Massa gran: s'esperava que ${r.origin??"el valor"} contingu\xE9s ${o} ${r.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"com a m\xEDnim":"m\xE9s de",s=e(r.origin);return s?`Massa petit: s'esperava que ${r.origin} contingu\xE9s ${o} ${r.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${r.origin} fos ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${g(r.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${r.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${r.origin}`;default:return"Entrada inv\xE0lida"}}}});function Tv(){return{localeError:ZI()}}var ZI,Ov=v(()=>{R();ZI=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${r.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${a}`}case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${b(r.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${o}${r.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${o}${r.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${n[o.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${g(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}}});function Av(){return{localeError:BI()}}var BI,Pv=v(()=>{R();BI=()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldigt input: forventede instanceof ${r.expected}, fik ${a}`:`Ugyldigt input: forventede ${o}, fik ${a}`}case"invalid_value":return r.values.length===1?`Ugyldig v\xE6rdi: forventede ${b(r.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin),a=i[r.origin]??r.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${o} ${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin),a=i[r.origin]??r.origin;return s?`For lille: forventede ${a} ${s.verb} ${o} ${r.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${g(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${r.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${r.origin}`;default:return"Ugyldigt input"}}}});function Cv(){return{localeError:GI()}}var GI,zv=v(()=>{R();GI=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${r.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${a}`}case"invalid_value":return r.values.length===1?`Ung\xFCltige Eingabe: erwartet ${b(r.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${o}${r.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${o}${r.maximum.toString()} ist`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Zu klein: erwartet, dass ${r.origin} ${o}${r.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${r.origin} ${o}${r.minimum.toString()} ist`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${n[o.format]??r.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${g(r.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${r.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${r.origin}`;default:return"Ung\xFCltige Eingabe"}}}});function Rv(){return{localeError:WI()}}var WI,Nv=v(()=>{R();WI=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return typeof r.expected=="string"&&/^[A-Z]/.test(r.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 ${r.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 ${o}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`}case"invalid_value":return r.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 ${b(r.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 ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${r.maximum.toString()} ${s.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 ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${r.minimum.toString()} ${s.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${r.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${r.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${g(r.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${r.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 ${r.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}}});function Zo(){return{localeError:qI()}}var qI,cd=v(()=>{R();qI=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${b(r.values[0])}`:`Invalid option: expected one of ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Too big: expected ${r.origin??"value"} to have ${o}${r.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${r.origin??"value"} to be ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Too small: expected ${r.origin} to have ${o}${r.minimum.toString()} ${s.unit}`:`Too small: expected ${r.origin} to be ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${n[o.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${g(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`Invalid discriminator value. Expected ${r.options.map(s=>`'${s}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}}});function Dv(){return{localeError:HI()}}var HI,Lv=v(()=>{R();HI=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${r.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${a}`}case"invalid_value":return r.values.length===1?`Nevalida enigo: atendi\u011Dis ${b(r.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${o}${r.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Tro malgranda: atendi\u011Dis ke ${r.origin} havu ${o}${r.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${r.origin} estu ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${n[o.format]??r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} \u015Dlosilo${r.keys.length>1?"j":""}: ${g(r.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}}});function Uv(){return{localeError:JI()}}var JI,jv=v(()=>{R();JI=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${r.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${a}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: se esperaba ${b(r.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin),a=i[r.origin]??r.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${o}${r.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin),a=i[r.origin]??r.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${o}${r.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${g(r.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[r.origin]??r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[r.origin]??r.origin}`;default:return"Entrada inv\xE1lida"}}}});function Mv(){return{localeError:KI()}}var KI,Fv=v(()=>{R();KI=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${r.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 ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return r.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${b(r.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 ${g(r.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[o.format]??r.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 ${r.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${r.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${g(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${r.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 ${r.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}}});function Vv(){return{localeError:YI()}}var YI,Zv=v(()=>{R();YI=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Virheellinen tyyppi: odotettiin instanceof ${r.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${a}`}case"invalid_value":return r.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${b(r.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${r.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${r.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${n[o.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${g(r.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 Bv(){return{localeError:XI()}}var XI,Gv=v(()=>{R();XI=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : instanceof ${r.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${a} re\xE7u`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : ${b(r.values[0])} attendu`:`Option invalide : une valeur parmi ${g(r.values,"|")} attendue`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Trop grand : ${i[r.origin]??"valeur"} doit ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i[r.origin]??"valeur"} doit \xEAtre ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Trop petit : ${i[r.origin]??"valeur"} doit ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Trop petit : ${i[r.origin]??"valeur"} doit \xEAtre ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${n[o.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${g(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}}});function Wv(){return{localeError:QI()}}var QI,qv=v(()=>{R();QI=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : attendu instanceof ${r.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${a}`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : attendu ${b(r.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"\u2264":"<",s=e(r.origin);return s?`Trop grand : attendu que ${r.origin??"la valeur"} ait ${o}${r.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${r.origin??"la valeur"} soit ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"\u2265":">",s=e(r.origin);return s?`Trop petit : attendu que ${r.origin} ait ${o}${r.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${r.origin} soit ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${n[o.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${g(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}}});function Hv(){return{localeError:e1()}}var e1,Jv=v(()=>{R();e1=()=>{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"}},n=c=>c?t[c]:void 0,i=c=>{let l=n(c);return l?l.label:c??t.unknown.label},r=c=>`\u05D4${i(c)}`,o=c=>(n(c)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=c=>c?e[c]??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"}},u={nan:"NaN"};return c=>{switch(c.code){case"invalid_type":{let l=c.expected,d=u[l??""]??i(l),f=$(c.input),h=u[f]??t[f]?.label??f;return/^[A-Z]/.test(c.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${c.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`}case"invalid_value":{if(c.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 ${b(c.values[0])}`;let l=c.values.map(h=>b(h));if(c.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 ${l[0]} \u05D0\u05D5 ${l[1]}`;let d=l[l.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 ${l.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let l=s(c.origin),d=r(c.origin??"value");if(c.origin==="string")return`${l?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.maximum.toString()} ${l?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(c.origin==="number"){let p=c.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${c.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}`}if(c.origin==="array"||c.origin==="set"){let p=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",_=c.inclusive?`${c.maximum} ${l?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${c.maximum} ${l?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${p} \u05DC\u05D4\u05DB\u05D9\u05DC ${_}`.trim()}let f=c.inclusive?"<=":"<",h=o(c.origin??"value");return l?.unit?`${l.longLabel} \u05DE\u05D3\u05D9: ${d} ${h} ${f}${c.maximum.toString()} ${l.unit}`:`${l?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${h} ${f}${c.maximum.toString()}`}case"too_small":{let l=s(c.origin),d=r(c.origin??"value");if(c.origin==="string")return`${l?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.minimum.toString()} ${l?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(c.origin==="number"){let p=c.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${c.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}`}if(c.origin==="array"||c.origin==="set"){let p=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(c.minimum===1&&c.inclusive){let S=(c.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${p} \u05DC\u05D4\u05DB\u05D9\u05DC ${S}`}let _=c.inclusive?`${c.minimum} ${l?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${c.minimum} ${l?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${p} \u05DC\u05D4\u05DB\u05D9\u05DC ${_}`.trim()}let f=c.inclusive?">=":">",h=o(c.origin??"value");return l?.unit?`${l.shortLabel} \u05DE\u05D3\u05D9: ${d} ${h} ${f}${c.minimum.toString()} ${l.unit}`:`${l?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${h} ${f}${c.minimum.toString()}`}case"invalid_format":{let l=c;if(l.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${l.prefix}"`;if(l.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${l.suffix}"`;if(l.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${l.includes}"`;if(l.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 ${l.pattern}`;let d=a[l.format],f=d?.label??l.format,p=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${p}`}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 ${c.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${c.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${c.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${g(c.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${r(c.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}}});function Kv(){return{localeError:t1()}}var t1,Yv=v(()=>{R();t1=()=>{let t={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function e(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${r.expected}, a primljeno je ${a}`:`Neispravan unos: o\u010Dekuje se ${o}, a primljeno je ${a}`}case"invalid_value":return r.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${b(r.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin),a=i[r.origin]??r.origin;return s?`Preveliko: o\u010Dekivano da ${a??"vrijednost"} ima ${o}${r.maximum.toString()} ${s.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${a??"vrijednost"} bude ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin),a=i[r.origin]??r.origin;return s?`Premalo: o\u010Dekivano da ${a} ima ${o}${r.minimum.toString()} ${s.unit}`:`Premalo: o\u010Dekivano da ${a} bude ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${o.prefix}"`:o.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${o.suffix}"`:o.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${o.includes}"`:o.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${o.pattern}`:`Neispravna ${n[o.format]??r.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${r.divisor}`;case"unrecognized_keys":return`Neprepoznat${r.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${g(r.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${i[r.origin]??r.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${i[r.origin]??r.origin}`;default:return"Neispravan unos"}}}});function Xv(){return{localeError:r1()}}var r1,Qv=v(()=>{R();r1=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${r.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return r.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${b(r.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`T\xFAl nagy: ${r.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${r.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${r.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} m\xE9rete t\xFAl kicsi ${o}${r.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} t\xFAl kicsi ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[o.format]??r.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${r.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${g(r.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${r.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${r.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}}});function ey(t,e,n){return Math.abs(t)===1?e:n}function Vr(t){if(!t)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],n=t[t.length-1];return t+(e.includes(n)?"\u0576":"\u0568")}function ty(){return{localeError:n1()}}var n1,ry=v(()=>{R();n1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.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 ${r.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 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":return r.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 ${b(r.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 ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);if(s){let a=Number(r.maximum),u=ey(a,s.unit.one,s.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 ${Vr(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.maximum.toString()} ${u}`}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 ${Vr(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);if(s){let a=Number(r.minimum),u=ey(a,s.unit.one,s.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 ${Vr(r.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.minimum.toString()} ${u}`}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 ${Vr(r.origin)} \u056C\u056B\u0576\u056B ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.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 ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${n[o.format]??r.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 ${r.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${r.keys.length>1?"\u0576\u0565\u0580":""}. ${g(r.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Vr(r.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 ${Vr(r.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}}});function ny(){return{localeError:i1()}}var i1,iy=v(()=>{R();i1=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input tidak valid: diharapkan instanceof ${r.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${o}, diterima ${a}`}case"invalid_value":return r.values.length===1?`Input tidak valid: diharapkan ${b(r.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${o}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Terlalu kecil: diharapkan ${r.origin} memiliki ${o}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${r.origin} menjadi ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${n[o.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${g(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}}});function oy(){return{localeError:o1()}}var o1,sy=v(()=>{R();o1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${r.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return r.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${b(r.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} hafi ${o}${r.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} s\xE9 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} hafi ${o}${r.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} s\xE9 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${n[o.format]??r.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${r.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${r.keys.length>1?"ir lyklar":"ur lykill"}: ${g(r.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${r.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${r.origin}`;default:return"Rangt gildi"}}}});function ay(){return{localeError:s1()}}var s1,uy=v(()=>{R();s1=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input non valido: atteso instanceof ${r.expected}, ricevuto ${a}`:`Input non valido: atteso ${o}, ricevuto ${a}`}case"invalid_value":return r.values.length===1?`Input non valido: atteso ${b(r.values[0])}`:`Opzione non valida: atteso uno tra ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Troppo grande: ${r.origin??"valore"} deve avere ${o}${r.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${r.origin??"valore"} deve essere ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Troppo piccolo: ${r.origin} deve avere ${o}${r.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${r.origin} deve essere ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Input non valido: ${n[o.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${g(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}}});function cy(){return{localeError:a1()}}var a1,ly=v(()=>{R();a1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${r.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: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return r.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${b(r.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${g(r.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=r.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=e(r.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=r.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=e(r.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[o.format]??r.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${r.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${r.keys.length>1?"\u7FA4":""}: ${g(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}}});function dy(){return{localeError:u1()}}var u1,fy=v(()=>{R();u1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.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 ${r.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 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":return r.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 ${b(r.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 ${g(r.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\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 ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.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 ${r.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.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 "${o.prefix}"-\u10D8\u10D7`:o.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 "${o.suffix}"-\u10D8\u10D7`:o.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 "${o.includes}"-\u10E1`:o.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 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${n[o.format]??r.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 ${r.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${r.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${g(r.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${r.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 ${r.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}}});function Bo(){return{localeError:c1()}}var c1,ld=v(()=>{R();c1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.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 ${r.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 ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":return r.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 ${b(r.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 ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${r.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${o} ${r.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${g(r.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 ${r.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 ${r.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 hy(){return Bo()}var py=v(()=>{ld()});function my(){return{localeError:l1()}}var l1,gy=v(()=>{R();l1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${r.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return r.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${b(r.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${g(r.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=r.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(r.origin),u=a?.unit??"\uC694\uC18C";return a?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${u} ${o}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${o}${s}`}case"too_small":{let o=r.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(r.origin),u=a?.unit??"\uC694\uC18C";return a?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${u} ${o}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[o.format]??r.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${r.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${g(r.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${r.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${r.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}}});function vy(t){let e=Math.abs(t),n=e%10,i=e%100;return i>=11&&i<=19||n===0?"many":n===1?"one":"few"}function yy(){return{localeError:d1()}}var Qn,d1,_y=v(()=>{R();Qn=t=>t.charAt(0).toUpperCase()+t.slice(1);d1=()=>{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(r,o,s,a){let u=t[r]??null;return u===null?u:{unit:u.unit[o],verb:u.verb[a][s?"inclusive":"notInclusive"]}}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${r.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${o}`}case"invalid_value":return r.values.length===1?`Privalo b\u016Bti ${b(r.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${g(r.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[r.origin]??r.origin,s=e(r.origin,vy(Number(r.maximum)),r.inclusive??!1,"smaller");if(s?.verb)return`${Qn(o??r.origin??"reik\u0161m\u0117")} ${s.verb} ${r.maximum.toString()} ${s.unit??"element\u0173"}`;let a=r.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Qn(o??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${r.maximum.toString()} ${s?.unit}`}case"too_small":{let o=i[r.origin]??r.origin,s=e(r.origin,vy(Number(r.minimum)),r.inclusive??!1,"bigger");if(s?.verb)return`${Qn(o??r.origin??"reik\u0161m\u0117")} ${s.verb} ${r.minimum.toString()} ${s.unit??"element\u0173"}`;let a=r.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Qn(o??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${r.minimum.toString()} ${s?.unit}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${n[o.format]??r.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${r.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${r.keys.length>1?"i":"as"} rakt${r.keys.length>1?"ai":"as"}: ${g(r.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=i[r.origin]??r.origin;return`${Qn(o??r.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}}});function by(){return{localeError:f1()}}var f1,$y=v(()=>{R();f1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${r.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 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${b(r.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 ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${r.maximum.toString()} ${s.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 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${r.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`Invalid ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`${r.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"}: ${g(r.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${r.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 ${r.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}}});function xy(){return{localeError:h1()}}var h1,wy=v(()=>{R();h1=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input tidak sah: dijangka instanceof ${r.expected}, diterima ${a}`:`Input tidak sah: dijangka ${o}, diterima ${a}`}case"invalid_value":return r.values.length===1?`Input tidak sah: dijangka ${b(r.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Terlalu besar: dijangka ${r.origin??"nilai"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Terlalu kecil: dijangka ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${r.origin} adalah ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${n[o.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${g(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}}});function Sy(){return{localeError:p1()}}var p1,ky=v(()=>{R();p1=()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ongeldige invoer: verwacht instanceof ${r.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${o}, ontving ${a}`}case"invalid_value":return r.values.length===1?`Ongeldige invoer: verwacht ${b(r.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin),a=r.origin==="date"?"laat":r.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${r.origin??"waarde"} ${o}${r.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${r.origin??"waarde"} ${o}${r.maximum.toString()} is`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin),a=r.origin==="date"?"vroeg":r.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${r.origin} ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${r.origin} ${o}${r.minimum.toString()} is`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${n[o.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${g(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}}});function Ey(){return{localeError:m1()}}var m1,Iy=v(()=>{R();m1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldig input: forventet instanceof ${r.expected}, fikk ${a}`:`Ugyldig input: forventet ${o}, fikk ${a}`}case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventet ${b(r.values[0])}`:`Ugyldig valg: forventet en av ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`For lite(n): forventet ${r.origin} til \xE5 ha ${o}${r.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${r.origin} til \xE5 ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${g(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}}});function Ty(){return{localeError:g1()}}var g1,Oy=v(()=>{R();g1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`F\xE2sit giren: umulan instanceof ${r.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${a}`}case"invalid_value":return r.values.length===1?`F\xE2sit giren: umulan ${b(r.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${o}${r.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${o}${r.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${o}${r.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${o}${r.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=r;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[o.format]??r.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${r.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${r.keys.length>1?"s":""}: ${g(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${r.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}}});function Ay(){return{localeError:v1()}}var v1,Py=v(()=>{R();v1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${r.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 ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return r.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${b(r.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${g(r.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} \u0648\u064A`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[o.format]??r.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${r.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${r.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${g(r.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${r.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 ${r.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}}});function Cy(){return{localeError:y1()}}var y1,zy=v(()=>{R();y1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${r.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${a}`}case"invalid_value":return r.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${b(r.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${r.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${r.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[o.format]??r.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${g(r.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${r.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${r.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}}});function Ry(){return{localeError:_1()}}var _1,Ny=v(()=>{R();_1=()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Tipo inv\xE1lido: esperado instanceof ${r.expected}, recebido ${a}`:`Tipo inv\xE1lido: esperado ${o}, recebido ${a}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: esperado ${b(r.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Muito grande: esperado que ${r.origin??"valor"} tivesse ${o}${r.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${r.origin??"valor"} fosse ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Muito pequeno: esperado que ${r.origin} tivesse ${o}${r.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${r.origin} fosse ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${n[o.format]??r.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${g(r.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${r.origin}`;default:return"Campo inv\xE1lido"}}}});function Dy(){return{localeError:b1()}}var b1,Ly=v(()=>{R();b1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return`Intrare invalid\u0103: a\u0219teptat ${o}, primit ${a}`}case"invalid_value":return r.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${b(r.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} s\u0103 fie ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Prea mic: a\u0219teptat ca ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Prea mic: a\u0219teptat ca ${r.origin} s\u0103 fie ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${o.prefix}"`:o.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${o.suffix}"`:o.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${o.includes}"`:o.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${o.pattern}`:`Format invalid: ${n[o.format]??r.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${r.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${g(r.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${r.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${r.origin}`;default:return"Intrare invalid\u0103"}}}});function Uy(t,e,n,i){let r=Math.abs(t),o=r%10,s=r%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?n:i}function jy(){return{localeError:$1()}}var $1,My=v(()=>{R();$1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${r.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 ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${b(r.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 ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);if(s){let a=Number(r.maximum),u=Uy(a,s.unit.one,s.unit.few,s.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 ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${r.maximum.toString()} ${u}`}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 ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);if(s){let a=Number(r.minimum),u=Uy(a,s.unit.one,s.unit.few,s.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 ${r.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${r.minimum.toString()} ${u}`}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 ${r.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${r.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0438":""}: ${g(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${r.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 ${r.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 Fy(){return{localeError:x1()}}var x1,Vy=v(()=>{R();x1=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${r.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${a}`}case"invalid_value":return r.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${b(r.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} imelo ${o}${r.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${r.origin} imelo ${o}${r.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${n[o.format]??r.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${g(r.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}}});function Zy(){return{localeError:w1()}}var w1,By=v(()=>{R();w1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${r.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${a}`}case"invalid_value":return r.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${b(r.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${r.origin??"v\xE4rdet"} att ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${n[o.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${g(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${r.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}}});function Gy(){return{localeError:S1()}}var S1,Wy=v(()=>{R();S1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.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 ${r.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 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":return r.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 ${b(r.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 ${g(r.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\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 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${r.maximum.toString()} ${s.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 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${r.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\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 ${r.origin} ${o}${r.minimum.toString()} ${s.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 ${r.origin} ${o}${r.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.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 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${r.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${r.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${g(r.keys,", ")}`;case"invalid_key":return`${r.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`${r.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 qy(){return{localeError:k1()}}var k1,Hy=v(()=>{R();k1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.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 ${r.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 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":return r.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${b(r.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 ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=e(r.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=e(r.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.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 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[o.format]??r.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 ${r.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: ${g(r.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.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 ${r.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}}});function Jy(){return{localeError:E1()}}var E1,Ky=v(()=>{R();E1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${r.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${a}`}case"invalid_value":return r.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${b(r.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${o}${r.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${n[o.format]??r.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${r.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${r.keys.length>1?"lar":""}: ${g(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${r.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}}});function Go(){return{localeError:I1()}}var I1,dd=v(()=>{R();I1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.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 ${r.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 ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":return r.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 ${b(r.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 ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\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 ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${r.maximum.toString()} ${s.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 ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} \u0431\u0443\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0456":""}: ${g(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${r.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 ${r.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 Yy(){return Go()}var Xy=v(()=>{dd()});function Qy(){return{localeError:T1()}}var T1,e_=v(()=>{R();T1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${r.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: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return r.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${b(r.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${g(r.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${r.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u06D2 ${o}${r.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u0627 ${o}${r.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${r.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${r.keys.length>1?"\u0632":""}: ${g(r.keys,"\u060C ")}`;case"invalid_key":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}}});function t_(){return{localeError:O1()}}var O1,r_=v(()=>{R();O1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${r.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${a}`}case"invalid_value":return r.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${b(r.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Juda katta: kutilgan ${r.origin??"qiymat"} ${o}${r.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${r.origin??"qiymat"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Juda kichik: kutilgan ${r.origin} ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${n[o.format]??r.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${r.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${r.keys.length>1?"lar":""}: ${g(r.keys,", ")}`;case"invalid_key":return`${r.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${r.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}}});function n_(){return{localeError:A1()}}var A1,i_=v(()=>{R();A1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${r.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return r.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${b(r.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${g(r.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.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 ${r.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}}});function o_(){return{localeError:P1()}}var P1,s_=v(()=>{R();P1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${r.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return r.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${b(r.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${o}${r.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${n[o.format]??r.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${r.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${g(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${r.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}}});function a_(){return{localeError:C1()}}var C1,u_=v(()=>{R();C1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${r.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return r.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${b(r.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${o}${r.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${o}${r.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${r.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${r.keys.length>1?"\u5011":""}\uFF1A${g(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}}});function c_(){return{localeError:z1()}}var z1,l_=v(()=>{R();z1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${r.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return r.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${b(r.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin??"iye"} ${s.verb} ${o}${r.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${r.maximum}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin} ${s.verb} ${o}${r.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${r.minimum}`}case"invalid_format":{let o=r;return o.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 "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${g(r.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.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 ${r.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}}});var ei={};He(ei,{ar:()=>vv,az:()=>_v,be:()=>xv,bg:()=>Sv,ca:()=>Ev,cs:()=>Tv,da:()=>Av,de:()=>Cv,el:()=>Rv,en:()=>Zo,eo:()=>Dv,es:()=>Uv,fa:()=>Mv,fi:()=>Vv,fr:()=>Bv,frCA:()=>Wv,he:()=>Hv,hr:()=>Kv,hu:()=>Xv,hy:()=>ty,id:()=>ny,is:()=>oy,it:()=>ay,ja:()=>cy,ka:()=>dy,kh:()=>hy,km:()=>Bo,ko:()=>my,lt:()=>yy,mk:()=>by,ms:()=>xy,nl:()=>Sy,no:()=>Ey,ota:()=>Ty,pl:()=>Cy,ps:()=>Ay,pt:()=>Ry,ro:()=>Dy,ru:()=>jy,sl:()=>Fy,sv:()=>Zy,ta:()=>Gy,th:()=>qy,tr:()=>Jy,ua:()=>Yy,uk:()=>Go,ur:()=>Qy,uz:()=>t_,vi:()=>n_,yo:()=>c_,zhCN:()=>o_,zhTW:()=>a_});var fd=v(()=>{yv();bv();wv();kv();Iv();Ov();Pv();zv();Nv();cd();Lv();jv();Fv();Zv();Gv();qv();Jv();Yv();Qv();ry();iy();sy();uy();ly();fy();py();ld();gy();_y();$y();wy();ky();Iy();Oy();Py();zy();Ny();Ly();My();Vy();By();Wy();Hy();Ky();Xy();dd();e_();r_();i_();s_();u_();l_()});function qo(){return new Wo}var d_,hd,pd,Wo,ve,ti=v(()=>{hd=Symbol("ZodOutput"),pd=Symbol("ZodInput"),Wo=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...n){let i=n[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 n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){let n=e._zod.parent;if(n){let i={...this.get(n)??{}};delete i.id;let r={...i,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};(d_=globalThis).__zod_globalRegistry??(d_.__zod_globalRegistry=qo());ve=globalThis.__zod_globalRegistry});function md(t,e){return new t({type:"string",...w(e)})}function gd(t,e){return new t({type:"string",coerce:!0,...w(e)})}function Ho(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...w(e)})}function ri(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...w(e)})}function Jo(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...w(e)})}function Ko(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...w(e)})}function Yo(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...w(e)})}function Xo(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...w(e)})}function ni(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...w(e)})}function Qo(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...w(e)})}function es(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...w(e)})}function ts(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...w(e)})}function rs(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...w(e)})}function ns(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...w(e)})}function is(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...w(e)})}function os(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...w(e)})}function ss(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...w(e)})}function as(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...w(e)})}function vd(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...w(e)})}function us(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...w(e)})}function cs(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...w(e)})}function ls(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...w(e)})}function ds(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...w(e)})}function fs(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...w(e)})}function hs(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...w(e)})}function _d(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...w(e)})}function bd(t,e){return new t({type:"string",format:"date",check:"string_format",...w(e)})}function $d(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...w(e)})}function xd(t,e){return new t({type:"string",format:"duration",check:"string_format",...w(e)})}function wd(t,e){return new t({type:"number",checks:[],...w(e)})}function Sd(t,e){return new t({type:"number",coerce:!0,checks:[],...w(e)})}function kd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...w(e)})}function Ed(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...w(e)})}function Id(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...w(e)})}function Td(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...w(e)})}function Od(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...w(e)})}function Ad(t,e){return new t({type:"boolean",...w(e)})}function Pd(t,e){return new t({type:"boolean",coerce:!0,...w(e)})}function Cd(t,e){return new t({type:"bigint",...w(e)})}function zd(t,e){return new t({type:"bigint",coerce:!0,...w(e)})}function Rd(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...w(e)})}function Nd(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...w(e)})}function Dd(t,e){return new t({type:"symbol",...w(e)})}function Ld(t,e){return new t({type:"undefined",...w(e)})}function Ud(t,e){return new t({type:"null",...w(e)})}function jd(t){return new t({type:"any"})}function Md(t){return new t({type:"unknown"})}function Fd(t,e){return new t({type:"never",...w(e)})}function Vd(t,e){return new t({type:"void",...w(e)})}function Zd(t,e){return new t({type:"date",...w(e)})}function Bd(t,e){return new t({type:"date",coerce:!0,...w(e)})}function Gd(t,e){return new t({type:"nan",...w(e)})}function lt(t,e){return new Po({check:"less_than",...w(e),value:t,inclusive:!1})}function Ve(t,e){return new Po({check:"less_than",...w(e),value:t,inclusive:!0})}function dt(t,e){return new Co({check:"greater_than",...w(e),value:t,inclusive:!1})}function Te(t,e){return new Co({check:"greater_than",...w(e),value:t,inclusive:!0})}function ps(t){return dt(0,t)}function ms(t){return lt(0,t)}function gs(t){return Ve(0,t)}function vs(t){return Te(0,t)}function Ut(t,e){return new Pc({check:"multiple_of",...w(e),value:t})}function jt(t,e){return new Rc({check:"max_size",...w(e),maximum:t})}function ft(t,e){return new Nc({check:"min_size",...w(e),minimum:t})}function ur(t,e){return new Dc({check:"size_equals",...w(e),size:t})}function cr(t,e){return new Lc({check:"max_length",...w(e),maximum:t})}function $t(t,e){return new Uc({check:"min_length",...w(e),minimum:t})}function lr(t,e){return new jc({check:"length_equals",...w(e),length:t})}function Zr(t,e){return new Mc({check:"string_format",format:"regex",...w(e),pattern:t})}function Br(t){return new Fc({check:"string_format",format:"lowercase",...w(t)})}function Gr(t){return new Vc({check:"string_format",format:"uppercase",...w(t)})}function Wr(t,e){return new Zc({check:"string_format",format:"includes",...w(e),includes:t})}function qr(t,e){return new Bc({check:"string_format",format:"starts_with",...w(e),prefix:t})}function Hr(t,e){return new Gc({check:"string_format",format:"ends_with",...w(e),suffix:t})}function ys(t,e,n){return new Wc({check:"property",property:t,schema:e,...w(n)})}function Jr(t,e){return new qc({check:"mime_type",mime:t,...w(e)})}function st(t){return new Hc({check:"overwrite",tx:t})}function Kr(t){return st(e=>e.normalize(t))}function Yr(){return st(t=>t.trim())}function Xr(){return st(t=>t.toLowerCase())}function Qr(){return st(t=>t.toUpperCase())}function en(){return st(t=>Vu(t))}function Wd(t,e,n){return new t({type:"array",element:e,...w(n)})}function N1(t,e,n){return new t({type:"union",options:e,...w(n)})}function D1(t,e,n){return new t({type:"union",options:e,inclusive:!1,...w(n)})}function L1(t,e,n,i){return new t({type:"union",options:n,discriminator:e,...w(i)})}function U1(t,e,n){return new t({type:"intersection",left:e,right:n})}function j1(t,e,n,i){let r=n instanceof L,o=r?i:n,s=r?n:null;return new t({type:"tuple",items:e,rest:s,...w(o)})}function M1(t,e,n,i){return new t({type:"record",keyType:e,valueType:n,...w(i)})}function F1(t,e,n,i){return new t({type:"map",keyType:e,valueType:n,...w(i)})}function V1(t,e,n){return new t({type:"set",valueType:e,...w(n)})}function Z1(t,e,n){let i=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new t({type:"enum",entries:i,...w(n)})}function B1(t,e,n){return new t({type:"enum",entries:e,...w(n)})}function G1(t,e,n){return new t({type:"literal",values:Array.isArray(e)?e:[e],...w(n)})}function qd(t,e){return new t({type:"file",...w(e)})}function W1(t,e){return new t({type:"transform",transform:e})}function q1(t,e){return new t({type:"optional",innerType:e})}function H1(t,e){return new t({type:"nullable",innerType:e})}function J1(t,e,n){return new t({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():Bu(n)}})}function K1(t,e,n){return new t({type:"nonoptional",innerType:e,...w(n)})}function Y1(t,e){return new t({type:"success",innerType:e})}function X1(t,e,n){return new t({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}function Q1(t,e,n){return new t({type:"pipe",in:e,out:n})}function eT(t,e){return new t({type:"readonly",innerType:e})}function tT(t,e,n){return new t({type:"template_literal",parts:e,...w(n)})}function rT(t,e){return new t({type:"lazy",getter:e})}function nT(t,e){return new t({type:"promise",innerType:e})}function Hd(t,e,n){let i=w(n);return i.abort??(i.abort=!0),new t({type:"custom",check:"custom",fn:e,...i})}function Jd(t,e,n){return new t({type:"custom",check:"custom",fn:e,...w(n)})}function Kd(t,e){let n=f_(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(Dr(r,i.value,n._zod.def));else{let o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=i.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),i.issues.push(Dr(o))}},t(i.value,i)),e);return n}function f_(t,e){let n=new X({check:"custom",...w(e)});return n._zod.check=t,n}function Yd(t){let e=new X({check:"describe"});return e._zod.onattach=[n=>{let i=ve.get(n)??{};ve.add(n,{...i,description:t})}],e._zod.check=()=>{},e}function Xd(t){let e=new X({check:"meta"});return e._zod.onattach=[n=>{let i=ve.get(n)??{};ve.add(n,{...i,...t})}],e._zod.check=()=>{},e}function Qd(t,e){let n=w(e),i=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(i=i.map(h=>typeof h=="string"?h.toLowerCase():h),r=r.map(h=>typeof h=="string"?h.toLowerCase():h));let o=new Set(i),s=new Set(r),a=t.Codec??Xn,u=t.Boolean??Kn,c=t.String??ar,l=new c({type:"string",error:n.error}),d=new u({type:"boolean",error:n.error}),f=new a({type:"pipe",in:l,out:d,transform:((h,p)=>{let _=h;return n.case!=="sensitive"&&(_=_.toLowerCase()),o.has(_)?!0:s.has(_)?!1:(p.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:p.value,inst:f,continue:!1}),{})}),reverseTransform:((h,p)=>h===!0?i[0]||"true":r[0]||"false"),error:n.error});return f}function tn(t,e,n,i={}){let r=w(i),o={...w(i),check:"string_format",type:"string",format:e,fn:typeof n=="function"?n:a=>n.test(a),...r};return n instanceof RegExp&&(o.pattern=n),new t(o)}var yd,h_=v(()=>{zo();ti();ud();R();yd={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function Mt(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??ve,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 W(t,e,n={path:[],schemaPath:[]}){var i;let r=t._zod.def,o=e.seen.get(t);if(o)return o.count++,n.schemaPath.includes(t)&&(o.cycle=n.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:n.path};e.seen.set(t,s);let a=t._zod.toJSONSchema?.();if(a)s.schema=a;else{let l={...n,schemaPath:[...n.schemaPath,t],path:n.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,s.schema,l);else{let f=s.schema,h=e.processors[r.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);h(t,e,f,l)}let d=t._zod.parent;d&&(s.ref||(s.ref=d),W(d,e,l),e.seen.get(d).isParent=!0)}let u=e.metadataRegistry.get(t);return u&&Object.assign(s.schema,u),e.io==="input"&&Oe(t)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&"_prefault"in s.schema&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(t).schema}function Ft(t,e){let n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let s of t.seen.entries()){let a=t.metadataRegistry.get(s[0])?.id;if(a){let u=i.get(a);if(u&&u!==s[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,s[0])}}let r=s=>{let a=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(s[0])?.id,f=t.external.uri??(p=>p);if(d)return{ref:f(d)};let h=s[1].defId??s[1].schema.id??`schema${t.counter++}`;return s[1].defId=h,{defId:h,ref:`${f("__shared")}#/${a}/${h}`}}if(s[1]===n)return{ref:"#"};let c=`#/${a}/`,l=s[1].schema.id??`__schema${t.counter++}`;return{defId:l,ref:c+l}},o=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:u,defId:c}=r(s);a.def={...a.schema},c&&(a.defId=c);let l=a.schema;for(let d in l)delete l[d];l.$ref=u};if(t.cycles==="throw")for(let s of t.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
65
+ `)}f.write("payload.value = newResult;"),f.write("return payload;");let P=f.compile();return(C,E)=>P(h,C,E)},o,s=or,a=!nr.jitless,c=a&&tc.value,l=e.catchall,d;t._zod.parse=(h,f)=>{d??(d=i.value);let p=h.value;return s(p)?a&&c&&f?.async===!1&&f.jitless!==!0?(o||(o=r(e.shape)),h=o(h,f),l?xv([],p,h,f,d,t):h):n(h,f):(h.issues.push({expected:"object",code:"invalid_type",input:p,inst:t}),h)}});ni=m("$ZodUnion",(t,e)=>{L.init(t,e),V(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),V(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),V(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),V(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(r=>r._zod.pattern);return new RegExp(`^(${i.map(r=>Wn(r.source)).join("|")})$`)}});let n=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1,s=[];for(let a of e.options){let u=a._zod.run({value:i.value,issues:[]},r);if(u instanceof Promise)s.push(u),o=!0;else{if(u.issues.length===0)return u;s.push(u)}}return o?Promise.all(s).then(a=>sv(a,i,t,r)):sv(s,i,t,r)}});Jl=m("$ZodXor",(t,e)=>{ni.init(t,e),e.inclusive=!1;let n=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1,s=[];for(let a of e.options){let u=a._zod.run({value:i.value,issues:[]},r);u instanceof Promise?(s.push(u),o=!0):s.push(u)}return o?Promise.all(s).then(a=>av(a,i,t,r)):av(s,i,t,r)}}),Kl=m("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,ni.init(t,e);let n=t._zod.parse;V(t._zod,"propValues",()=>{let r={};for(let o of e.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[a,u]of Object.entries(s)){r[a]||(r[a]=new Set);for(let c of u)r[a].add(c)}}return r});let i=Dr(()=>{let r=e.options,o=new Map;for(let s of r){let a=s._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let u of a){if(o.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,s)}}return o});t._zod.parse=(r,o)=>{let s=r.value;if(!or(s))return r.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),r;let a=i.value.get(s?.[e.discriminator]);return a?a._zod.run(r,o):e.unionFallback||o.direction==="backward"?n(r,o):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(i.value.keys()),input:s,path:[e.discriminator],inst:t}),r)}}),Yl=m("$ZodIntersection",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{let r=n.value,o=e.left._zod.run({value:r,issues:[]},i),s=e.right._zod.run({value:r,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([u,c])=>uv(n,u,c)):uv(n,o,s)}});qo=m("$ZodTuple",(t,e)=>{L.init(t,e);let n=e.items;t._zod.parse=(i,r)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:t,expected:"tuple",code:"invalid_type"}),i;i.value=[];let s=[],a=cv(n,"optin"),u=cv(n,"optout");if(!e.rest){if(o.length<a)return i.issues.push({code:"too_small",minimum:a,inclusive:!0,input:o,inst:t,origin:"array"}),i;o.length>n.length&&i.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:o,inst:t,origin:"array"})}let c=new Array(n.length);for(let l=0;l<n.length;l++){let d=n[l]._zod.run({value:o[l],issues:[]},r);d instanceof Promise?s.push(d.then(h=>{c[l]=h})):c[l]=d}if(e.rest){let l=n.length-1,d=o.slice(n.length);for(let h of d){l++;let f=e.rest._zod.run({value:h,issues:[]},r);f instanceof Promise?s.push(f.then(p=>lv(p,i,l))):lv(f,i,l)}}return s.length?Promise.all(s).then(()=>dv(c,i,n,o,u)):dv(c,i,n,o,u)}});Xl=m("$ZodRecord",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!Lt(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:t}),n;let o=[],s=e.keyType._zod.values;if(s){n.value={};let a=new Set;for(let c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){a.add(typeof c=="number"?c.toString():c);let l=e.keyType._zod.run({value:c,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(f=>Te(f,i,oe())),input:c,path:[c],inst:t});continue}let d=l.value,h=e.valueType._zod.run({value:r[c],issues:[]},i);h instanceof Promise?o.push(h.then(f=>{f.issues.length&&n.issues.push(...ze(c,f.issues)),n.value[d]=f.value})):(h.issues.length&&n.issues.push(...ze(c,h.issues)),n.value[d]=h.value)}let u;for(let c in r)a.has(c)||(u=u??[],u.push(c));u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:r,inst:t,keys:u})}else{n.value={};for(let a of Reflect.ownKeys(r)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(r,a))continue;let u=e.keyType._zod.run({value:a,issues:[]},i);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Do.test(a)&&u.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&&(u=d)}if(u.issues.length){e.mode==="loose"?n.value[a]=r[a]:n.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(d=>Te(d,i,oe())),input:a,path:[a],inst:t});continue}let l=e.valueType._zod.run({value:r[a],issues:[]},i);l instanceof Promise?o.push(l.then(d=>{d.issues.length&&n.issues.push(...ze(a,d.issues)),n.value[u.value]=d.value})):(l.issues.length&&n.issues.push(...ze(a,l.issues)),n.value[u.value]=l.value)}}return o.length?Promise.all(o).then(()=>n):n}}),Ql=m("$ZodMap",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!(r instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:r,inst:t}),n;let o=[];n.value=new Map;for(let[s,a]of r){let u=e.keyType._zod.run({value:s,issues:[]},i),c=e.valueType._zod.run({value:a,issues:[]},i);u instanceof Promise||c instanceof Promise?o.push(Promise.all([u,c]).then(([l,d])=>{hv(l,d,n,s,r,t,i)})):hv(u,c,n,s,r,t,i)}return o.length?Promise.all(o).then(()=>n):n}});ed=m("$ZodSet",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:t,expected:"set",code:"invalid_type"}),n;let o=[];n.value=new Set;for(let s of r){let a=e.valueType._zod.run({value:s,issues:[]},i);a instanceof Promise?o.push(a.then(u=>fv(u,n))):fv(a,n)}return o.length?Promise.all(o).then(()=>n):n}});td=m("$ZodEnum",(t,e)=>{L.init(t,e);let n=Gn(e.entries),i=new Set(n);t._zod.values=i,t._zod.pattern=new RegExp(`^(${n.filter(r=>qn.has(typeof r)).map(r=>typeof r=="string"?Ke(r):r.toString()).join("|")})$`),t._zod.parse=(r,o)=>{let s=r.value;return i.has(s)||r.issues.push({code:"invalid_value",values:n,input:s,inst:t}),r}}),rd=m("$ZodLiteral",(t,e)=>{if(L.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let n=new Set(e.values);t._zod.values=n,t._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?Ke(i):i?Ke(i.toString()):String(i)).join("|")})$`),t._zod.parse=(i,r)=>{let o=i.value;return n.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),i}}),nd=m("$ZodFile",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:t}),n}}),id=m("$ZodTransform",(t,e)=>{L.init(t,e),t._zod.optin="optional",t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new zt(t.constructor.name);let r=e.transform(n.value,n);if(i.async)return(r instanceof Promise?r:Promise.resolve(r)).then(s=>(n.value=s,n.fallback=!0,n));if(r instanceof Promise)throw new ot;return n.value=r,n.fallback=!0,n}});Ho=m("$ZodOptional",(t,e)=>{L.init(t,e),t._zod.optin="optional",t._zod.optout="optional",V(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),V(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${Wn(n.source)})?$`):void 0}),t._zod.parse=(n,i)=>{if(e.innerType._zod.optin==="optional"){let r=n.value,o=e.innerType._zod.run(n,i);return o instanceof Promise?o.then(s=>pv(s,r)):pv(o,r)}return n.value===void 0?n:e.innerType._zod.run(n,i)}}),od=m("$ZodExactOptional",(t,e)=>{Ho.init(t,e),V(t._zod,"values",()=>e.innerType._zod.values),V(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(n,i)=>e.innerType._zod.run(n,i)}),sd=m("$ZodNullable",(t,e)=>{L.init(t,e),V(t._zod,"optin",()=>e.innerType._zod.optin),V(t._zod,"optout",()=>e.innerType._zod.optout),V(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${Wn(n.source)}|null)$`):void 0}),V(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(n,i)=>n.value===null?n:e.innerType._zod.run(n,i)}),ad=m("$ZodDefault",(t,e)=>{L.init(t,e),t._zod.optin="optional",V(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);if(n.value===void 0)return n.value=e.defaultValue,n;let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>mv(o,e)):mv(r,e)}});ud=m("$ZodPrefault",(t,e)=>{L.init(t,e),t._zod.optin="optional",V(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,i)=>(i.direction==="backward"||n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,i))}),cd=m("$ZodNonOptional",(t,e)=>{L.init(t,e),V(t._zod,"values",()=>{let n=e.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),t._zod.parse=(n,i)=>{let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>gv(o,t)):gv(r,t)}});ld=m("$ZodSuccess",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new zt("ZodSuccess");let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>(n.value=o.issues.length===0,n)):(n.value=r.issues.length===0,n)}}),dd=m("$ZodCatch",(t,e)=>{L.init(t,e),t._zod.optin="optional",V(t._zod,"optout",()=>e.innerType._zod.optout),V(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>(n.value=o.value,o.issues.length&&(n.value=e.catchValue({...n,error:{issues:o.issues.map(s=>Te(s,i,oe()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=r.value,r.issues.length&&(n.value=e.catchValue({...n,error:{issues:r.issues.map(o=>Te(o,i,oe()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),hd=m("$ZodNaN",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:t,expected:"nan",code:"invalid_type"}),n)}),Jo=m("$ZodPipe",(t,e)=>{L.init(t,e),V(t._zod,"values",()=>e.in._zod.values),V(t._zod,"optin",()=>e.in._zod.optin),V(t._zod,"optout",()=>e.out._zod.optout),V(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(n,i)=>{if(i.direction==="backward"){let o=e.out._zod.run(n,i);return o instanceof Promise?o.then(s=>Fo(s,e.in,i)):Fo(o,e.in,i)}let r=e.in._zod.run(n,i);return r instanceof Promise?r.then(o=>Fo(o,e.out,i)):Fo(r,e.out,i)}});ii=m("$ZodCodec",(t,e)=>{L.init(t,e),V(t._zod,"values",()=>e.in._zod.values),V(t._zod,"optin",()=>e.in._zod.optin),V(t._zod,"optout",()=>e.out._zod.optout),V(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(n,i)=>{if((i.direction||"forward")==="forward"){let o=e.in._zod.run(n,i);return o instanceof Promise?o.then(s=>Vo(s,e,i)):Vo(o,e,i)}else{let o=e.out._zod.run(n,i);return o instanceof Promise?o.then(s=>Vo(s,e,i)):Vo(o,e,i)}}});fd=m("$ZodPreprocess",(t,e)=>{Jo.init(t,e)}),pd=m("$ZodReadonly",(t,e)=>{L.init(t,e),V(t._zod,"propValues",()=>e.innerType._zod.propValues),V(t._zod,"values",()=>e.innerType._zod.values),V(t._zod,"optin",()=>e.innerType?._zod?.optin),V(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(n,i)=>{if(i.direction==="backward")return e.innerType._zod.run(n,i);let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(vv):vv(r)}});md=m("$ZodTemplateLiteral",(t,e)=>{L.init(t,e);let n=[];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 r=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!r)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=r.startsWith("^")?1:0,s=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(o,s))}else if(i===null||nc.has(typeof i))n.push(Ke(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);t._zod.pattern=new RegExp(`^${n.join("")}$`),t._zod.parse=(i,r)=>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)}),gd=m("$ZodFunction",(t,e)=>(L.init(t,e),t._def=e,t._zod.def=e,t.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return function(...i){let r=t._def.input?ko(t._def.input,i):i,o=Reflect.apply(n,this,r);return t._def.output?ko(t._def.output,o):o}},t.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let r=t._def.input?await Eo(t._def.input,i):i,o=await Reflect.apply(n,this,r);return t._def.output?await Eo(t._def.output,o):o}},t._zod.parse=(n,i)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:t}),n):(t._def.output&&t._def.output._zod.def.type==="promise"?n.value=t.implementAsync(n.value):n.value=t.implement(n.value),n),t.input=(...n)=>{let i=t.constructor;return Array.isArray(n[0])?new i({type:"function",input:new qo({type:"tuple",items:n[0],rest:n[1]}),output:t._def.output}):new i({type:"function",input:n[0],output:t._def.output})},t.output=n=>{let i=t.constructor;return new i({type:"function",input:t._def.input,output:n})},t)),vd=m("$ZodPromise",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>Promise.resolve(n.value).then(r=>e.innerType._zod.run({value:r,issues:[]},i))}),yd=m("$ZodLazy",(t,e)=>{L.init(t,e),V(t._zod,"innerType",()=>{let n=e;return n._cachedInner||(n._cachedInner=e.getter()),n._cachedInner}),V(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),V(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),V(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),V(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(n,i)=>t._zod.innerType._zod.run(n,i)}),_d=m("$ZodCustom",(t,e)=>{X.init(t,e),L.init(t,e),t._zod.parse=(n,i)=>n,t._zod.check=n=>{let i=n.value,r=e.fn(i);if(r instanceof Promise)return r.then(o=>yv(o,n,i,t));yv(r,n,i,t)}})});function Sv(){return{localeError:WI()}}var WI,kv=v(()=>{z();WI=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.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 ${r.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 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":return r.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 ${b(r.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: ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${r.maximum.toString()} ${s.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 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${r.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.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 "${r.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${r.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${r.keys.length>1?"\u0629":""}: ${g(r.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.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 ${r.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}}});function Ev(){return{localeError:qI()}}var qI,Iv=v(()=>{z();qI=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${r.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${a}`}case"invalid_value":return r.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${b(r.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${o}${r.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[o.format]??r.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${r.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${r.keys.length>1?"lar":""}: ${g(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${r.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}}});function Tv(t,e,n,i){let r=Math.abs(t),o=r%10,s=r%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?n:i}function Ov(){return{localeError:HI()}}var HI,Av=v(()=>{z();HI=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${r.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 ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":return r.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 ${b(r.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 ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);if(s){let a=Number(r.maximum),u=Tv(a,s.unit.one,s.unit.few,s.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 ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${r.maximum.toString()} ${u}`}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 ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);if(s){let a=Number(r.minimum),u=Tv(a,s.unit.one,s.unit.few,s.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 ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${r.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${r.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${g(r.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${r.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 ${r.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}}});function Pv(){return{localeError:JI()}}var JI,Cv=v(()=>{z();JI=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${r.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 ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${b(r.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 ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${r.maximum.toString()} ${s.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 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${r.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;if(o.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 "${o.prefix}"`;if(o.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 "${o.suffix}"`;if(o.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 "${o.includes}"`;if(o.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 ${o.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${r.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u043E\u0432\u0435":""}: ${g(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${r.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 ${r.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}}});function Rv(){return{localeError:KI()}}var KI,zv=v(()=>{z();KI=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${r.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${a}`}case"invalid_value":return r.values.length===1?`Valor inv\xE0lid: s'esperava ${b(r.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${g(r.values," o ")}`;case"too_big":{let o=r.inclusive?"com a m\xE0xim":"menys de",s=e(r.origin);return s?`Massa gran: s'esperava que ${r.origin??"el valor"} contingu\xE9s ${o} ${r.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"com a m\xEDnim":"m\xE9s de",s=e(r.origin);return s?`Massa petit: s'esperava que ${r.origin} contingu\xE9s ${o} ${r.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${r.origin} fos ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${g(r.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${r.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${r.origin}`;default:return"Entrada inv\xE0lida"}}}});function Nv(){return{localeError:YI()}}var YI,Dv=v(()=>{z();YI=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${r.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${a}`}case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${b(r.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${o}${r.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${o}${r.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${n[o.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${g(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}}});function Lv(){return{localeError:XI()}}var XI,Uv=v(()=>{z();XI=()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldigt input: forventede instanceof ${r.expected}, fik ${a}`:`Ugyldigt input: forventede ${o}, fik ${a}`}case"invalid_value":return r.values.length===1?`Ugyldig v\xE6rdi: forventede ${b(r.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin),a=i[r.origin]??r.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${o} ${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin),a=i[r.origin]??r.origin;return s?`For lille: forventede ${a} ${s.verb} ${o} ${r.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${g(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${r.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${r.origin}`;default:return"Ugyldigt input"}}}});function jv(){return{localeError:QI()}}var QI,Mv=v(()=>{z();QI=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${r.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${a}`}case"invalid_value":return r.values.length===1?`Ung\xFCltige Eingabe: erwartet ${b(r.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${o}${r.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${o}${r.maximum.toString()} ist`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Zu klein: erwartet, dass ${r.origin} ${o}${r.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${r.origin} ${o}${r.minimum.toString()} ist`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${n[o.format]??r.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${g(r.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${r.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${r.origin}`;default:return"Ung\xFCltige Eingabe"}}}});function Fv(){return{localeError:e1()}}var e1,Vv=v(()=>{z();e1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return typeof r.expected=="string"&&/^[A-Z]/.test(r.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 ${r.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 ${o}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`}case"invalid_value":return r.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 ${b(r.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 ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${r.maximum.toString()} ${s.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 ${r.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${r.minimum.toString()} ${s.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${r.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${r.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${r.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${g(r.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${r.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 ${r.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}}});function Ko(){return{localeError:t1()}}var t1,$d=v(()=>{z();t1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${b(r.values[0])}`:`Invalid option: expected one of ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Too big: expected ${r.origin??"value"} to have ${o}${r.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${r.origin??"value"} to be ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Too small: expected ${r.origin} to have ${o}${r.minimum.toString()} ${s.unit}`:`Too small: expected ${r.origin} to be ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${n[o.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${g(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return r.options&&Array.isArray(r.options)&&r.options.length>0?`Invalid discriminator value. Expected ${r.options.map(s=>`'${s}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}}});function Zv(){return{localeError:r1()}}var r1,Bv=v(()=>{z();r1=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${r.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${a}`}case"invalid_value":return r.values.length===1?`Nevalida enigo: atendi\u011Dis ${b(r.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${o}${r.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Tro malgranda: atendi\u011Dis ke ${r.origin} havu ${o}${r.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${r.origin} estu ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${n[o.format]??r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} \u015Dlosilo${r.keys.length>1?"j":""}: ${g(r.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}}});function Gv(){return{localeError:n1()}}var n1,Wv=v(()=>{z();n1=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${r.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${a}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: se esperaba ${b(r.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin),a=i[r.origin]??r.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${o}${r.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin),a=i[r.origin]??r.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${o}${r.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${n[o.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${g(r.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[r.origin]??r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[r.origin]??r.origin}`;default:return"Entrada inv\xE1lida"}}}});function qv(){return{localeError:i1()}}var i1,Hv=v(()=>{z();i1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${r.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 ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return r.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${b(r.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 ${g(r.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[o.format]??r.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 ${r.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${r.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${g(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${r.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 ${r.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}}});function Jv(){return{localeError:o1()}}var o1,Kv=v(()=>{z();o1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Virheellinen tyyppi: odotettiin instanceof ${r.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${a}`}case"invalid_value":return r.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${b(r.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${r.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${r.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${n[o.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${g(r.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 Yv(){return{localeError:s1()}}var s1,Xv=v(()=>{z();s1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : instanceof ${r.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${a} re\xE7u`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : ${b(r.values[0])} attendu`:`Option invalide : une valeur parmi ${g(r.values,"|")} attendue`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Trop grand : ${i[r.origin]??"valeur"} doit ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i[r.origin]??"valeur"} doit \xEAtre ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Trop petit : ${i[r.origin]??"valeur"} doit ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Trop petit : ${i[r.origin]??"valeur"} doit \xEAtre ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${n[o.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${g(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}}});function Qv(){return{localeError:a1()}}var a1,ey=v(()=>{z();a1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : attendu instanceof ${r.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${a}`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : attendu ${b(r.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"\u2264":"<",s=e(r.origin);return s?`Trop grand : attendu que ${r.origin??"la valeur"} ait ${o}${r.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${r.origin??"la valeur"} soit ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"\u2265":">",s=e(r.origin);return s?`Trop petit : attendu que ${r.origin} ait ${o}${r.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${r.origin} soit ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${n[o.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${g(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}}});function ty(){return{localeError:u1()}}var u1,ry=v(()=>{z();u1=()=>{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"}},n=c=>c?t[c]:void 0,i=c=>{let l=n(c);return l?l.label:c??t.unknown.label},r=c=>`\u05D4${i(c)}`,o=c=>(n(c)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=c=>c?e[c]??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"}},u={nan:"NaN"};return c=>{switch(c.code){case"invalid_type":{let l=c.expected,d=u[l??""]??i(l),h=$(c.input),f=u[h]??t[h]?.label??h;return/^[A-Z]/.test(c.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${c.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${f}`}case"invalid_value":{if(c.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 ${b(c.values[0])}`;let l=c.values.map(f=>b(f));if(c.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 ${l[0]} \u05D0\u05D5 ${l[1]}`;let d=l[l.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 ${l.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let l=s(c.origin),d=r(c.origin??"value");if(c.origin==="string")return`${l?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.maximum.toString()} ${l?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(c.origin==="number"){let p=c.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${c.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}`}if(c.origin==="array"||c.origin==="set"){let p=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",_=c.inclusive?`${c.maximum} ${l?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${c.maximum} ${l?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${p} \u05DC\u05D4\u05DB\u05D9\u05DC ${_}`.trim()}let h=c.inclusive?"<=":"<",f=o(c.origin??"value");return l?.unit?`${l.longLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${h}${c.maximum.toString()} ${l.unit}`:`${l?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${f} ${h}${c.maximum.toString()}`}case"too_small":{let l=s(c.origin),d=r(c.origin??"value");if(c.origin==="string")return`${l?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.minimum.toString()} ${l?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(c.origin==="number"){let p=c.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${c.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}`}if(c.origin==="array"||c.origin==="set"){let p=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(c.minimum===1&&c.inclusive){let S=(c.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${p} \u05DC\u05D4\u05DB\u05D9\u05DC ${S}`}let _=c.inclusive?`${c.minimum} ${l?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${c.minimum} ${l?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${p} \u05DC\u05D4\u05DB\u05D9\u05DC ${_}`.trim()}let h=c.inclusive?">=":">",f=o(c.origin??"value");return l?.unit?`${l.shortLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${h}${c.minimum.toString()} ${l.unit}`:`${l?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${f} ${h}${c.minimum.toString()}`}case"invalid_format":{let l=c;if(l.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${l.prefix}"`;if(l.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${l.suffix}"`;if(l.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${l.includes}"`;if(l.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 ${l.pattern}`;let d=a[l.format],h=d?.label??l.format,p=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${h} \u05DC\u05D0 ${p}`}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 ${c.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${c.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${c.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${g(c.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${r(c.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}}});function ny(){return{localeError:c1()}}var c1,iy=v(()=>{z();c1=()=>{let t={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function e(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${r.expected}, a primljeno je ${a}`:`Neispravan unos: o\u010Dekuje se ${o}, a primljeno je ${a}`}case"invalid_value":return r.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${b(r.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin),a=i[r.origin]??r.origin;return s?`Preveliko: o\u010Dekivano da ${a??"vrijednost"} ima ${o}${r.maximum.toString()} ${s.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${a??"vrijednost"} bude ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin),a=i[r.origin]??r.origin;return s?`Premalo: o\u010Dekivano da ${a} ima ${o}${r.minimum.toString()} ${s.unit}`:`Premalo: o\u010Dekivano da ${a} bude ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${o.prefix}"`:o.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${o.suffix}"`:o.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${o.includes}"`:o.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${o.pattern}`:`Neispravna ${n[o.format]??r.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${r.divisor}`;case"unrecognized_keys":return`Neprepoznat${r.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${g(r.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${i[r.origin]??r.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${i[r.origin]??r.origin}`;default:return"Neispravan unos"}}}});function oy(){return{localeError:l1()}}var l1,sy=v(()=>{z();l1=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${r.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return r.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${b(r.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`T\xFAl nagy: ${r.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${r.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${r.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} m\xE9rete t\xFAl kicsi ${o}${r.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} t\xFAl kicsi ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[o.format]??r.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${r.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${g(r.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${r.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${r.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}}});function ay(t,e,n){return Math.abs(t)===1?e:n}function Zr(t){if(!t)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],n=t[t.length-1];return t+(e.includes(n)?"\u0576":"\u0568")}function uy(){return{localeError:d1()}}var d1,cy=v(()=>{z();d1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.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 ${r.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 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":return r.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 ${b(r.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 ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);if(s){let a=Number(r.maximum),u=ay(a,s.unit.one,s.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 ${Zr(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.maximum.toString()} ${u}`}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 ${Zr(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);if(s){let a=Number(r.minimum),u=ay(a,s.unit.one,s.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 ${Zr(r.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.minimum.toString()} ${u}`}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 ${Zr(r.origin)} \u056C\u056B\u0576\u056B ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.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 ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${n[o.format]??r.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 ${r.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${r.keys.length>1?"\u0576\u0565\u0580":""}. ${g(r.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Zr(r.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 ${Zr(r.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}}});function ly(){return{localeError:h1()}}var h1,dy=v(()=>{z();h1=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input tidak valid: diharapkan instanceof ${r.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${o}, diterima ${a}`}case"invalid_value":return r.values.length===1?`Input tidak valid: diharapkan ${b(r.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${o}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Terlalu kecil: diharapkan ${r.origin} memiliki ${o}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${r.origin} menjadi ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${n[o.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${g(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}}});function hy(){return{localeError:f1()}}var f1,fy=v(()=>{z();f1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${r.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return r.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${b(r.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} hafi ${o}${r.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} s\xE9 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} hafi ${o}${r.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} s\xE9 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${n[o.format]??r.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${r.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${r.keys.length>1?"ir lyklar":"ur lykill"}: ${g(r.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${r.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${r.origin}`;default:return"Rangt gildi"}}}});function py(){return{localeError:p1()}}var p1,my=v(()=>{z();p1=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input non valido: atteso instanceof ${r.expected}, ricevuto ${a}`:`Input non valido: atteso ${o}, ricevuto ${a}`}case"invalid_value":return r.values.length===1?`Input non valido: atteso ${b(r.values[0])}`:`Opzione non valida: atteso uno tra ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Troppo grande: ${r.origin??"valore"} deve avere ${o}${r.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${r.origin??"valore"} deve essere ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Troppo piccolo: ${r.origin} deve avere ${o}${r.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${r.origin} deve essere ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Input non valido: ${n[o.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${g(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}}});function gy(){return{localeError:m1()}}var m1,vy=v(()=>{z();m1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${r.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: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return r.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${b(r.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${g(r.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=r.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=e(r.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=r.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=e(r.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[o.format]??r.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${r.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${r.keys.length>1?"\u7FA4":""}: ${g(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}}});function yy(){return{localeError:g1()}}var g1,_y=v(()=>{z();g1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.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 ${r.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 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":return r.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 ${b(r.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 ${g(r.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\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 ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.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 ${r.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.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 "${o.prefix}"-\u10D8\u10D7`:o.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 "${o.suffix}"-\u10D8\u10D7`:o.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 "${o.includes}"-\u10E1`:o.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 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${n[o.format]??r.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 ${r.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${r.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${g(r.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${r.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 ${r.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}}});function Yo(){return{localeError:v1()}}var v1,xd=v(()=>{z();v1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.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 ${r.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 ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":return r.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 ${b(r.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 ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${r.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${o} ${r.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${g(r.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 ${r.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 ${r.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 by(){return Yo()}var $y=v(()=>{xd()});function xy(){return{localeError:y1()}}var y1,wy=v(()=>{z();y1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${r.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return r.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${b(r.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${g(r.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=r.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(r.origin),u=a?.unit??"\uC694\uC18C";return a?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${u} ${o}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${o}${s}`}case"too_small":{let o=r.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(r.origin),u=a?.unit??"\uC694\uC18C";return a?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${u} ${o}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[o.format]??r.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${r.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${g(r.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${r.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${r.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}}});function Sy(t){let e=Math.abs(t),n=e%10,i=e%100;return i>=11&&i<=19||n===0?"many":n===1?"one":"few"}function ky(){return{localeError:_1()}}var oi,_1,Ey=v(()=>{z();oi=t=>t.charAt(0).toUpperCase()+t.slice(1);_1=()=>{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(r,o,s,a){let u=t[r]??null;return u===null?u:{unit:u.unit[o],verb:u.verb[a][s?"inclusive":"notInclusive"]}}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${r.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${o}`}case"invalid_value":return r.values.length===1?`Privalo b\u016Bti ${b(r.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${g(r.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[r.origin]??r.origin,s=e(r.origin,Sy(Number(r.maximum)),r.inclusive??!1,"smaller");if(s?.verb)return`${oi(o??r.origin??"reik\u0161m\u0117")} ${s.verb} ${r.maximum.toString()} ${s.unit??"element\u0173"}`;let a=r.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${oi(o??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${r.maximum.toString()} ${s?.unit}`}case"too_small":{let o=i[r.origin]??r.origin,s=e(r.origin,Sy(Number(r.minimum)),r.inclusive??!1,"bigger");if(s?.verb)return`${oi(o??r.origin??"reik\u0161m\u0117")} ${s.verb} ${r.minimum.toString()} ${s.unit??"element\u0173"}`;let a=r.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${oi(o??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${r.minimum.toString()} ${s?.unit}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${n[o.format]??r.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${r.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${r.keys.length>1?"i":"as"} rakt${r.keys.length>1?"ai":"as"}: ${g(r.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=i[r.origin]??r.origin;return`${oi(o??r.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}}});function Iy(){return{localeError:b1()}}var b1,Ty=v(()=>{z();b1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${r.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 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${b(r.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 ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${r.maximum.toString()} ${s.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 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${r.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`Invalid ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`${r.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"}: ${g(r.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${r.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 ${r.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}}});function Oy(){return{localeError:$1()}}var $1,Ay=v(()=>{z();$1=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Input tidak sah: dijangka instanceof ${r.expected}, diterima ${a}`:`Input tidak sah: dijangka ${o}, diterima ${a}`}case"invalid_value":return r.values.length===1?`Input tidak sah: dijangka ${b(r.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Terlalu besar: dijangka ${r.origin??"nilai"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Terlalu kecil: dijangka ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${r.origin} adalah ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${n[o.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${g(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}}});function Py(){return{localeError:x1()}}var x1,Cy=v(()=>{z();x1=()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ongeldige invoer: verwacht instanceof ${r.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${o}, ontving ${a}`}case"invalid_value":return r.values.length===1?`Ongeldige invoer: verwacht ${b(r.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin),a=r.origin==="date"?"laat":r.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${r.origin??"waarde"} ${o}${r.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${r.origin??"waarde"} ${o}${r.maximum.toString()} is`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin),a=r.origin==="date"?"vroeg":r.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${r.origin} ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${r.origin} ${o}${r.minimum.toString()} is`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${n[o.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${g(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}}});function Ry(){return{localeError:w1()}}var w1,zy=v(()=>{z();w1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldig input: forventet instanceof ${r.expected}, fikk ${a}`:`Ugyldig input: forventet ${o}, fikk ${a}`}case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventet ${b(r.values[0])}`:`Ugyldig valg: forventet en av ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`For lite(n): forventet ${r.origin} til \xE5 ha ${o}${r.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${r.origin} til \xE5 ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${n[o.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${g(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}}});function Ny(){return{localeError:S1()}}var S1,Dy=v(()=>{z();S1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`F\xE2sit giren: umulan instanceof ${r.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${a}`}case"invalid_value":return r.values.length===1?`F\xE2sit giren: umulan ${b(r.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${o}${r.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${o}${r.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${o}${r.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${o}${r.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=r;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[o.format]??r.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${r.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${r.keys.length>1?"s":""}: ${g(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${r.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}}});function Ly(){return{localeError:k1()}}var k1,Uy=v(()=>{z();k1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${r.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 ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return r.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${b(r.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${g(r.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${r.maximum.toString()} \u0648\u064A`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${o}${r.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[o.format]??r.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${r.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${r.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${g(r.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${r.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 ${r.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}}});function jy(){return{localeError:E1()}}var E1,My=v(()=>{z();E1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${r.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${a}`}case"invalid_value":return r.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${b(r.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${r.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${r.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[o.format]??r.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${g(r.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${r.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${r.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}}});function Fy(){return{localeError:I1()}}var I1,Vy=v(()=>{z();I1=()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Tipo inv\xE1lido: esperado instanceof ${r.expected}, recebido ${a}`:`Tipo inv\xE1lido: esperado ${o}, recebido ${a}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: esperado ${b(r.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Muito grande: esperado que ${r.origin??"valor"} tivesse ${o}${r.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${r.origin??"valor"} fosse ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Muito pequeno: esperado que ${r.origin} tivesse ${o}${r.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${r.origin} fosse ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${n[o.format]??r.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${g(r.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${r.origin}`;default:return"Campo inv\xE1lido"}}}});function Zy(){return{localeError:T1()}}var T1,By=v(()=>{z();T1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return`Intrare invalid\u0103: a\u0219teptat ${o}, primit ${a}`}case"invalid_value":return r.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${b(r.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${r.origin??"valoarea"} s\u0103 fie ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Prea mic: a\u0219teptat ca ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Prea mic: a\u0219teptat ca ${r.origin} s\u0103 fie ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${o.prefix}"`:o.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${o.suffix}"`:o.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${o.includes}"`:o.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${o.pattern}`:`Format invalid: ${n[o.format]??r.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${r.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${g(r.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${r.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${r.origin}`;default:return"Intrare invalid\u0103"}}}});function Gy(t,e,n,i){let r=Math.abs(t),o=r%10,s=r%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?n:i}function Wy(){return{localeError:O1()}}var O1,qy=v(()=>{z();O1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${r.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 ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${b(r.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 ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);if(s){let a=Number(r.maximum),u=Gy(a,s.unit.one,s.unit.few,s.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 ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${r.maximum.toString()} ${u}`}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 ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);if(s){let a=Number(r.minimum),u=Gy(a,s.unit.one,s.unit.few,s.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 ${r.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${r.minimum.toString()} ${u}`}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 ${r.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${r.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0438":""}: ${g(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${r.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 ${r.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 Hy(){return{localeError:A1()}}var A1,Jy=v(()=>{z();A1=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${r.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${a}`}case"invalid_value":return r.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${b(r.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} imelo ${o}${r.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${r.origin} imelo ${o}${r.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${n[o.format]??r.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${g(r.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}}});function Ky(){return{localeError:P1()}}var P1,Yy=v(()=>{z();P1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${r.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${a}`}case"invalid_value":return r.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${b(r.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${r.origin??"v\xE4rdet"} att ha ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${n[o.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${g(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${r.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}}});function Xy(){return{localeError:C1()}}var C1,Qy=v(()=>{z();C1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.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 ${r.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 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":return r.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 ${b(r.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 ${g(r.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\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 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${r.maximum.toString()} ${s.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 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${r.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\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 ${r.origin} ${o}${r.minimum.toString()} ${s.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 ${r.origin} ${o}${r.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.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 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${r.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${r.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${g(r.keys,", ")}`;case"invalid_key":return`${r.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`${r.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 e_(){return{localeError:R1()}}var R1,t_=v(()=>{z();R1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.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 ${r.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 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":return r.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${b(r.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 ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=e(r.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=e(r.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.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 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[o.format]??r.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 ${r.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: ${g(r.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.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 ${r.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}}});function r_(){return{localeError:z1()}}var z1,n_=v(()=>{z();z1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${r.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${a}`}case"invalid_value":return r.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${b(r.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${o}${r.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${n[o.format]??r.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${r.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${r.keys.length>1?"lar":""}: ${g(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${r.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}}});function Xo(){return{localeError:N1()}}var N1,wd=v(()=>{z();N1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.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 ${r.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 ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":return r.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 ${b(r.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 ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\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 ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${r.maximum.toString()} ${s.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 ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} \u0431\u0443\u0434\u0435 ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0456":""}: ${g(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${r.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 ${r.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 i_(){return Xo()}var o_=v(()=>{wd()});function s_(){return{localeError:D1()}}var D1,a_=v(()=>{z();D1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${r.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: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return r.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${b(r.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${g(r.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${r.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u06D2 ${o}${r.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u0627 ${o}${r.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${r.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${r.keys.length>1?"\u0632":""}: ${g(r.keys,"\u060C ")}`;case"invalid_key":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}}});function u_(){return{localeError:L1()}}var L1,c_=v(()=>{z();L1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${r.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${a}`}case"invalid_value":return r.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${b(r.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Juda katta: kutilgan ${r.origin??"qiymat"} ${o}${r.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${r.origin??"qiymat"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Juda kichik: kutilgan ${r.origin} ${o}${r.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${n[o.format]??r.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${r.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${r.keys.length>1?"lar":""}: ${g(r.keys,", ")}`;case"invalid_key":return`${r.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${r.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}}});function l_(){return{localeError:U1()}}var U1,d_=v(()=>{z();U1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${r.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return r.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${b(r.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${r.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${s.verb} ${o}${r.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${g(r.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.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 ${r.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}}});function h_(){return{localeError:j1()}}var j1,f_=v(()=>{z();j1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${r.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return r.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${b(r.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${o}${r.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${o}${r.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${n[o.format]??r.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${r.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${g(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${r.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}}});function p_(){return{localeError:M1()}}var M1,m_=v(()=>{z();M1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${r.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return r.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${b(r.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${o}${r.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${o}${r.maximum.toString()}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${o}${r.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${o}${r.minimum.toString()}`}case"invalid_format":{let o=r;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${n[o.format]??r.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${r.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${r.keys.length>1?"\u5011":""}\uFF1A${g(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}}});function g_(){return{localeError:F1()}}var F1,v_=v(()=>{z();F1=()=>{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(r){return t[r]??null}let n={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 r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=$(r.input),a=i[s]??s;return/^[A-Z]/.test(r.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${r.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return r.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${b(r.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${g(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin??"iye"} ${s.verb} ${o}${r.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${r.maximum}`}case"too_small":{let o=r.inclusive?">=":">",s=e(r.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin} ${s.verb} ${o}${r.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${r.minimum}`}case"invalid_format":{let o=r;return o.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 "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${n[o.format]??r.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 ${r.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${g(r.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.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 ${r.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}}});var si={};He(si,{ar:()=>Sv,az:()=>Ev,be:()=>Ov,bg:()=>Pv,ca:()=>Rv,cs:()=>Nv,da:()=>Lv,de:()=>jv,el:()=>Fv,en:()=>Ko,eo:()=>Zv,es:()=>Gv,fa:()=>qv,fi:()=>Jv,fr:()=>Yv,frCA:()=>Qv,he:()=>ty,hr:()=>ny,hu:()=>oy,hy:()=>uy,id:()=>ly,is:()=>hy,it:()=>py,ja:()=>gy,ka:()=>yy,kh:()=>by,km:()=>Yo,ko:()=>xy,lt:()=>ky,mk:()=>Iy,ms:()=>Oy,nl:()=>Py,no:()=>Ry,ota:()=>Ny,pl:()=>jy,ps:()=>Ly,pt:()=>Fy,ro:()=>Zy,ru:()=>Wy,sl:()=>Hy,sv:()=>Ky,ta:()=>Xy,th:()=>e_,tr:()=>r_,ua:()=>i_,uk:()=>Xo,ur:()=>s_,uz:()=>u_,vi:()=>l_,yo:()=>g_,zhCN:()=>h_,zhTW:()=>p_});var Sd=v(()=>{kv();Iv();Av();Cv();zv();Dv();Uv();Mv();Vv();$d();Bv();Wv();Hv();Kv();Xv();ey();ry();iy();sy();cy();dy();fy();my();vy();_y();$y();xd();wy();Ey();Ty();Ay();Cy();zy();Dy();Uy();My();Vy();By();qy();Jy();Yy();Qy();t_();n_();o_();wd();a_();c_();d_();f_();m_();v_()});function es(){return new Qo}var y_,kd,Ed,Qo,ve,ai=v(()=>{kd=Symbol("ZodOutput"),Ed=Symbol("ZodInput"),Qo=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...n){let i=n[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 n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){let n=e._zod.parent;if(n){let i={...this.get(n)??{}};delete i.id;let r={...i,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};(y_=globalThis).__zod_globalRegistry??(y_.__zod_globalRegistry=es());ve=globalThis.__zod_globalRegistry});function Id(t,e){return new t({type:"string",...w(e)})}function Td(t,e){return new t({type:"string",coerce:!0,...w(e)})}function ts(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...w(e)})}function ui(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...w(e)})}function rs(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...w(e)})}function ns(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...w(e)})}function is(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...w(e)})}function os(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...w(e)})}function ci(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...w(e)})}function ss(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...w(e)})}function as(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...w(e)})}function us(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...w(e)})}function cs(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...w(e)})}function ls(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...w(e)})}function ds(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...w(e)})}function hs(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...w(e)})}function fs(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...w(e)})}function ps(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...w(e)})}function Od(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...w(e)})}function ms(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...w(e)})}function gs(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...w(e)})}function vs(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...w(e)})}function ys(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...w(e)})}function _s(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...w(e)})}function bs(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...w(e)})}function Pd(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...w(e)})}function Cd(t,e){return new t({type:"string",format:"date",check:"string_format",...w(e)})}function Rd(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...w(e)})}function zd(t,e){return new t({type:"string",format:"duration",check:"string_format",...w(e)})}function Nd(t,e){return new t({type:"number",checks:[],...w(e)})}function Dd(t,e){return new t({type:"number",coerce:!0,checks:[],...w(e)})}function Ld(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...w(e)})}function Ud(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...w(e)})}function jd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...w(e)})}function Md(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...w(e)})}function Fd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...w(e)})}function Vd(t,e){return new t({type:"boolean",...w(e)})}function Zd(t,e){return new t({type:"boolean",coerce:!0,...w(e)})}function Bd(t,e){return new t({type:"bigint",...w(e)})}function Gd(t,e){return new t({type:"bigint",coerce:!0,...w(e)})}function Wd(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...w(e)})}function qd(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...w(e)})}function Hd(t,e){return new t({type:"symbol",...w(e)})}function Jd(t,e){return new t({type:"undefined",...w(e)})}function Kd(t,e){return new t({type:"null",...w(e)})}function Yd(t){return new t({type:"any"})}function Xd(t){return new t({type:"unknown"})}function Qd(t,e){return new t({type:"never",...w(e)})}function eh(t,e){return new t({type:"void",...w(e)})}function th(t,e){return new t({type:"date",...w(e)})}function rh(t,e){return new t({type:"date",coerce:!0,...w(e)})}function nh(t,e){return new t({type:"nan",...w(e)})}function lt(t,e){return new Uo({check:"less_than",...w(e),value:t,inclusive:!1})}function Ze(t,e){return new Uo({check:"less_than",...w(e),value:t,inclusive:!0})}function dt(t,e){return new jo({check:"greater_than",...w(e),value:t,inclusive:!1})}function Oe(t,e){return new jo({check:"greater_than",...w(e),value:t,inclusive:!0})}function $s(t){return dt(0,t)}function xs(t){return lt(0,t)}function ws(t){return Ze(0,t)}function Ss(t){return Oe(0,t)}function jt(t,e){return new Zc({check:"multiple_of",...w(e),value:t})}function Mt(t,e){return new Wc({check:"max_size",...w(e),maximum:t})}function ht(t,e){return new qc({check:"min_size",...w(e),minimum:t})}function ur(t,e){return new Hc({check:"size_equals",...w(e),size:t})}function cr(t,e){return new Jc({check:"max_length",...w(e),maximum:t})}function xt(t,e){return new Kc({check:"min_length",...w(e),minimum:t})}function lr(t,e){return new Yc({check:"length_equals",...w(e),length:t})}function Br(t,e){return new Xc({check:"string_format",format:"regex",...w(e),pattern:t})}function Gr(t){return new Qc({check:"string_format",format:"lowercase",...w(t)})}function Wr(t){return new el({check:"string_format",format:"uppercase",...w(t)})}function qr(t,e){return new tl({check:"string_format",format:"includes",...w(e),includes:t})}function Hr(t,e){return new rl({check:"string_format",format:"starts_with",...w(e),prefix:t})}function Jr(t,e){return new nl({check:"string_format",format:"ends_with",...w(e),suffix:t})}function ks(t,e,n){return new il({check:"property",property:t,schema:e,...w(n)})}function Kr(t,e){return new ol({check:"mime_type",mime:t,...w(e)})}function st(t){return new sl({check:"overwrite",tx:t})}function Yr(t){return st(e=>e.normalize(t))}function Xr(){return st(t=>t.trim())}function Qr(){return st(t=>t.toLowerCase())}function en(){return st(t=>t.toUpperCase())}function tn(){return st(t=>ec(t))}function ih(t,e,n){return new t({type:"array",element:e,...w(n)})}function Z1(t,e,n){return new t({type:"union",options:e,...w(n)})}function B1(t,e,n){return new t({type:"union",options:e,inclusive:!1,...w(n)})}function G1(t,e,n,i){return new t({type:"union",options:n,discriminator:e,...w(i)})}function W1(t,e,n){return new t({type:"intersection",left:e,right:n})}function q1(t,e,n,i){let r=n instanceof L,o=r?i:n,s=r?n:null;return new t({type:"tuple",items:e,rest:s,...w(o)})}function H1(t,e,n,i){return new t({type:"record",keyType:e,valueType:n,...w(i)})}function J1(t,e,n,i){return new t({type:"map",keyType:e,valueType:n,...w(i)})}function K1(t,e,n){return new t({type:"set",valueType:e,...w(n)})}function Y1(t,e,n){let i=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new t({type:"enum",entries:i,...w(n)})}function X1(t,e,n){return new t({type:"enum",entries:e,...w(n)})}function Q1(t,e,n){return new t({type:"literal",values:Array.isArray(e)?e:[e],...w(n)})}function oh(t,e){return new t({type:"file",...w(e)})}function eT(t,e){return new t({type:"transform",transform:e})}function tT(t,e){return new t({type:"optional",innerType:e})}function rT(t,e){return new t({type:"nullable",innerType:e})}function nT(t,e,n){return new t({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():rc(n)}})}function iT(t,e,n){return new t({type:"nonoptional",innerType:e,...w(n)})}function oT(t,e){return new t({type:"success",innerType:e})}function sT(t,e,n){return new t({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}function aT(t,e,n){return new t({type:"pipe",in:e,out:n})}function uT(t,e){return new t({type:"readonly",innerType:e})}function cT(t,e,n){return new t({type:"template_literal",parts:e,...w(n)})}function lT(t,e){return new t({type:"lazy",getter:e})}function dT(t,e){return new t({type:"promise",innerType:e})}function sh(t,e,n){let i=w(n);return i.abort??(i.abort=!0),new t({type:"custom",check:"custom",fn:e,...i})}function ah(t,e,n){return new t({type:"custom",check:"custom",fn:e,...w(n)})}function uh(t,e){let n=__(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(Lr(r,i.value,n._zod.def));else{let o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=i.value),o.inst??(o.inst=n),o.continue??(o.continue=!n._zod.def.abort),i.issues.push(Lr(o))}},t(i.value,i)),e);return n}function __(t,e){let n=new X({check:"custom",...w(e)});return n._zod.check=t,n}function ch(t){let e=new X({check:"describe"});return e._zod.onattach=[n=>{let i=ve.get(n)??{};ve.add(n,{...i,description:t})}],e._zod.check=()=>{},e}function lh(t){let e=new X({check:"meta"});return e._zod.onattach=[n=>{let i=ve.get(n)??{};ve.add(n,{...i,...t})}],e._zod.check=()=>{},e}function dh(t,e){let n=w(e),i=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(i=i.map(f=>typeof f=="string"?f.toLowerCase():f),r=r.map(f=>typeof f=="string"?f.toLowerCase():f));let o=new Set(i),s=new Set(r),a=t.Codec??ii,u=t.Boolean??ri,c=t.String??ar,l=new c({type:"string",error:n.error}),d=new u({type:"boolean",error:n.error}),h=new a({type:"pipe",in:l,out:d,transform:((f,p)=>{let _=f;return n.case!=="sensitive"&&(_=_.toLowerCase()),o.has(_)?!0:s.has(_)?!1:(p.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:p.value,inst:h,continue:!1}),{})}),reverseTransform:((f,p)=>f===!0?i[0]||"true":r[0]||"false"),error:n.error});return h}function rn(t,e,n,i={}){let r=w(i),o={...w(i),check:"string_format",type:"string",format:e,fn:typeof n=="function"?n:a=>n.test(a),...r};return n instanceof RegExp&&(o.pattern=n),new t(o)}var Ad,b_=v(()=>{Mo();ai();bd();z();Ad={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function Ft(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??ve,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 W(t,e,n={path:[],schemaPath:[]}){var i;let r=t._zod.def,o=e.seen.get(t);if(o)return o.count++,n.schemaPath.includes(t)&&(o.cycle=n.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:n.path};e.seen.set(t,s);let a=t._zod.toJSONSchema?.();if(a)s.schema=a;else{let l={...n,schemaPath:[...n.schemaPath,t],path:n.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,s.schema,l);else{let h=s.schema,f=e.processors[r.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);f(t,e,h,l)}let d=t._zod.parent;d&&(s.ref||(s.ref=d),W(d,e,l),e.seen.get(d).isParent=!0)}let u=e.metadataRegistry.get(t);return u&&Object.assign(s.schema,u),e.io==="input"&&Ae(t)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&"_prefault"in s.schema&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(t).schema}function Vt(t,e){let n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let s of t.seen.entries()){let a=t.metadataRegistry.get(s[0])?.id;if(a){let u=i.get(a);if(u&&u!==s[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,s[0])}}let r=s=>{let a=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(s[0])?.id,h=t.external.uri??(p=>p);if(d)return{ref:h(d)};let f=s[1].defId??s[1].schema.id??`schema${t.counter++}`;return s[1].defId=f,{defId:f,ref:`${h("__shared")}#/${a}/${f}`}}if(s[1]===n)return{ref:"#"};let c=`#/${a}/`,l=s[1].schema.id??`__schema${t.counter++}`;return{defId:l,ref:c+l}},o=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:u,defId:c}=r(s);a.def={...a.schema},c&&(a.defId=c);let l=a.schema;for(let d in l)delete l[d];l.$ref=u};if(t.cycles==="throw")for(let s of t.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
66
66
 
67
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of t.seen.entries()){let a=s[1];if(e===s[0]){o(s);continue}if(t.external){let c=t.external.registry.get(s[0])?.id;if(e!==s[0]&&c){o(s);continue}}if(t.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}if(a.count>1&&t.reused==="ref"){o(s);continue}}}function Vt(t,e){let n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=a=>{let u=t.seen.get(a);if(u.ref===null)return;let c=u.def??u.schema,l={...c},d=u.ref;if(u.ref=null,d){i(d);let h=t.seen.get(d),p=h.schema;if(p.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(p)):Object.assign(c,p),Object.assign(c,l),a._zod.parent===d)for(let S in c)S==="$ref"||S==="allOf"||S in l||delete c[S];if(p.$ref&&h.def)for(let S in c)S==="$ref"||S==="allOf"||S in h.def&&JSON.stringify(c[S])===JSON.stringify(h.def[S])&&delete c[S]}let f=a._zod.parent;if(f&&f!==d){i(f);let h=t.seen.get(f);if(h?.schema.$ref&&(c.$ref=h.schema.$ref,h.def))for(let p in c)p==="$ref"||p==="allOf"||p in h.def&&JSON.stringify(c[p])===JSON.stringify(h.def[p])&&delete c[p]}t.override({zodSchema:a,jsonSchema:c,path:u.path??[]})};for(let a of[...t.seen.entries()].reverse())i(a[0]);let r={};if(t.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?r.$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");r.$id=t.external.uri(a)}Object.assign(r,n.def??n.schema);let o=t.metadataRegistry.get(e)?.id;o!==void 0&&r.id===o&&delete r.id;let s=t.external?.defs??{};for(let a of t.seen.entries()){let u=a[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,s[u.defId]=u.def)}t.external||Object.keys(s).length>0&&(t.target==="draft-2020-12"?r.$defs=s:r.definitions=s);try{let a=JSON.parse(JSON.stringify(r));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:rn(e,"input",t.processors),output:rn(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Oe(t,e){let n=e??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let i=t._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Oe(i.element,n);if(i.type==="set")return Oe(i.valueType,n);if(i.type==="lazy")return Oe(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return Oe(i.innerType,n);if(i.type==="intersection")return Oe(i.left,n)||Oe(i.right,n);if(i.type==="record"||i.type==="map")return Oe(i.keyType,n)||Oe(i.valueType,n);if(i.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Oe(i.in,n)||Oe(i.out,n);if(i.type==="object"){for(let r in i.shape)if(Oe(i.shape[r],n))return!0;return!1}if(i.type==="union"){for(let r of i.options)if(Oe(r,n))return!0;return!1}if(i.type==="tuple"){for(let r of i.items)if(Oe(r,n))return!0;return!!(i.rest&&Oe(i.rest,n))}return!1}var ef,rn,ii=v(()=>{ti();ef=(t,e={})=>n=>{let i=Mt({...n,processors:e});return W(t,i),Ft(i,t),Vt(i,t)},rn=(t,e,n={})=>i=>{let{libraryOptions:r,target:o}=i??{},s=Mt({...r??{},target:o,io:e,processors:n});return W(t,s),Ft(s,t),Vt(s,t)}});function xs(t,e){if("_idmap"in t){let i=t,r=Mt({...e,processors:_s}),o={};for(let u of i._idmap.entries()){let[c,l]=u;W(l,r)}let s={},a={registry:i,uri:e?.uri,defs:o};r.external=a;for(let u of i._idmap.entries()){let[c,l]=u;Ft(r,l),s[c]=Vt(r,l)}if(Object.keys(o).length>0){let u=r.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[u]:o}}return{schemas:s}}let n=Mt({...e,processors:_s});return W(t,n),Ft(n,t),Vt(n,t)}var iT,tf,rf,nf,of,sf,af,uf,cf,lf,df,ff,hf,pf,mf,gf,vf,yf,_f,bf,$f,xf,wf,Sf,kf,Ef,bs,If,Tf,Of,Af,Pf,Cf,zf,Rf,Nf,Df,Lf,$s,Uf,_s,oi=v(()=>{ii();R();iT={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},tf=(t,e,n,i)=>{let r=n;r.type="string";let{minimum:o,maximum:s,format:a,patterns:u,contentEncoding:c}=t._zod.bag;if(typeof o=="number"&&(r.minLength=o),typeof s=="number"&&(r.maxLength=s),a&&(r.format=iT[a]??a,r.format===""&&delete r.format,a==="time"&&delete r.format),c&&(r.contentEncoding=c),u&&u.size>0){let l=[...u];l.length===1?r.pattern=l[0].source:l.length>1&&(r.allOf=[...l.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},rf=(t,e,n,i)=>{let r=n,{minimum:o,maximum:s,format:a,multipleOf:u,exclusiveMaximum:c,exclusiveMinimum:l}=t._zod.bag;typeof a=="string"&&a.includes("int")?r.type="integer":r.type="number";let d=typeof l=="number"&&l>=(o??Number.NEGATIVE_INFINITY),f=typeof c=="number"&&c<=(s??Number.POSITIVE_INFINITY),h=e.target==="draft-04"||e.target==="openapi-3.0";d?h?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l:typeof o=="number"&&(r.minimum=o),f?h?(r.maximum=c,r.exclusiveMaximum=!0):r.exclusiveMaximum=c:typeof s=="number"&&(r.maximum=s),typeof u=="number"&&(r.multipleOf=u)},nf=(t,e,n,i)=>{n.type="boolean"},of=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},sf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},af=(t,e,n,i)=>{e.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},uf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},cf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},lf=(t,e,n,i)=>{n.not={}},df=(t,e,n,i)=>{},ff=(t,e,n,i)=>{},hf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},pf=(t,e,n,i)=>{let r=t._zod.def,o=jn(r.entries);o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),n.enum=o},mf=(t,e,n,i)=>{let r=t._zod.def,o=[];for(let s of r.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];n.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?n.enum=[s]:n.const=s}else o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),o.every(s=>typeof s=="boolean")&&(n.type="boolean"),o.every(s=>s===null)&&(n.type="null"),n.enum=o},gf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},vf=(t,e,n,i)=>{let r=n,o=t._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=o.source},yf=(t,e,n,i)=>{let r=n,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:u}=t._zod.bag;s!==void 0&&(o.minLength=s),a!==void 0&&(o.maxLength=a),u?u.length===1?(o.contentMediaType=u[0],Object.assign(r,o)):(Object.assign(r,o),r.anyOf=u.map(c=>({contentMediaType:c}))):Object.assign(r,o)},_f=(t,e,n,i)=>{n.type="boolean"},bf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},$f=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},xf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},wf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Sf=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},kf=(t,e,n,i)=>{let r=n,o=t._zod.def,{minimum:s,maximum:a}=t._zod.bag;typeof s=="number"&&(r.minItems=s),typeof a=="number"&&(r.maxItems=a),r.type="array",r.items=W(o.element,e,{...i,path:[...i.path,"items"]})},Ef=(t,e,n,i)=>{let r=n,o=t._zod.def;r.type="object",r.properties={};let s=o.shape;for(let c in s)r.properties[c]=W(s[c],e,{...i,path:[...i.path,"properties",c]});let a=new Set(Object.keys(s)),u=new Set([...a].filter(c=>{let l=o.shape[c]._zod;return e.io==="input"?l.optin===void 0:l.optout===void 0}));u.size>0&&(r.required=Array.from(u)),o.catchall?._zod.def.type==="never"?r.additionalProperties=!1:o.catchall?o.catchall&&(r.additionalProperties=W(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(r.additionalProperties=!1)},bs=(t,e,n,i)=>{let r=t._zod.def,o=r.inclusive===!1,s=r.options.map((a,u)=>W(a,e,{...i,path:[...i.path,o?"oneOf":"anyOf",u]}));o?n.oneOf=s:n.anyOf=s},If=(t,e,n,i)=>{let r=t._zod.def,o=W(r.left,e,{...i,path:[...i.path,"allOf",0]}),s=W(r.right,e,{...i,path:[...i.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,u=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];n.allOf=u},Tf=(t,e,n,i)=>{let r=n,o=t._zod.def;r.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",u=o.items.map((f,h)=>W(f,e,{...i,path:[...i.path,s,h]})),c=o.rest?W(o.rest,e,{...i,path:[...i.path,a,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null;e.target==="draft-2020-12"?(r.prefixItems=u,c&&(r.items=c)):e.target==="openapi-3.0"?(r.items={anyOf:u},c&&r.items.anyOf.push(c),r.minItems=u.length,c||(r.maxItems=u.length)):(r.items=u,c&&(r.additionalItems=c));let{minimum:l,maximum:d}=t._zod.bag;typeof l=="number"&&(r.minItems=l),typeof d=="number"&&(r.maxItems=d)},Of=(t,e,n,i)=>{let r=n,o=t._zod.def;r.type="object";let s=o.keyType,u=s._zod.bag?.patterns;if(o.mode==="loose"&&u&&u.size>0){let l=W(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});r.patternProperties={};for(let d of u)r.patternProperties[d.source]=l}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(r.propertyNames=W(o.keyType,e,{...i,path:[...i.path,"propertyNames"]})),r.additionalProperties=W(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]});let c=s._zod.values;if(c){let l=[...c].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(r.required=l)}},Af=(t,e,n,i)=>{let r=t._zod.def,o=W(r.innerType,e,i),s=e.seen.get(t);e.target==="openapi-3.0"?(s.ref=r.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},Pf=(t,e,n,i)=>{let r=t._zod.def;W(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},Cf=(t,e,n,i)=>{let r=t._zod.def;W(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType,n.default=JSON.parse(JSON.stringify(r.defaultValue))},zf=(t,e,n,i)=>{let r=t._zod.def;W(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType,e.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},Rf=(t,e,n,i)=>{let r=t._zod.def;W(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType;let s;try{s=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s},Nf=(t,e,n,i)=>{let r=t._zod.def,o=r.in._zod.traits.has("$ZodTransform"),s=e.io==="input"?o?r.out:r.in:r.out;W(s,e,i);let a=e.seen.get(t);a.ref=s},Df=(t,e,n,i)=>{let r=t._zod.def;W(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType,n.readOnly=!0},Lf=(t,e,n,i)=>{let r=t._zod.def;W(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},$s=(t,e,n,i)=>{let r=t._zod.def;W(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},Uf=(t,e,n,i)=>{let r=t._zod.innerType;W(r,e,i);let o=e.seen.get(t);o.ref=r},_s={string:tf,number:rf,boolean:nf,bigint:of,symbol:sf,null:af,undefined:uf,void:cf,never:lf,any:df,unknown:ff,date:hf,enum:pf,literal:mf,nan:gf,template_literal:vf,file:yf,success:_f,custom:bf,function:$f,transform:xf,map:wf,set:Sf,array:kf,object:Ef,union:bs,intersection:If,tuple:Tf,record:Of,nullable:Af,nonoptional:Pf,default:Cf,prefault:zf,catch:Rf,pipe:Nf,readonly:Df,promise:Lf,optional:$s,lazy:Uf}});var ws,p_=v(()=>{oi();ii();ws=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 n=e?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=Mt({processors:_s,target:n,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,n={path:[],schemaPath:[]}){return W(e,this.ctx,n)}emit(e,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),Ft(this.ctx,e);let i=Vt(this.ctx,e),{"~standard":r,...o}=i;return o}}});var m_={};var g_=v(()=>{});var xt={};He(xt,{$ZodAny:()=>Al,$ZodArray:()=>Nl,$ZodAsyncError:()=>ot,$ZodBase64:()=>bl,$ZodBase64URL:()=>$l,$ZodBigInt:()=>jo,$ZodBigIntFormat:()=>El,$ZodBoolean:()=>Kn,$ZodCIDRv4:()=>vl,$ZodCIDRv6:()=>yl,$ZodCUID:()=>ol,$ZodCUID2:()=>sl,$ZodCatch:()=>Ql,$ZodCheck:()=>X,$ZodCheckBigIntFormat:()=>zc,$ZodCheckEndsWith:()=>Gc,$ZodCheckGreaterThan:()=>Co,$ZodCheckIncludes:()=>Zc,$ZodCheckLengthEquals:()=>jc,$ZodCheckLessThan:()=>Po,$ZodCheckLowerCase:()=>Fc,$ZodCheckMaxLength:()=>Lc,$ZodCheckMaxSize:()=>Rc,$ZodCheckMimeType:()=>qc,$ZodCheckMinLength:()=>Uc,$ZodCheckMinSize:()=>Nc,$ZodCheckMultipleOf:()=>Pc,$ZodCheckNumberFormat:()=>Cc,$ZodCheckOverwrite:()=>Hc,$ZodCheckProperty:()=>Wc,$ZodCheckRegex:()=>Mc,$ZodCheckSizeEquals:()=>Dc,$ZodCheckStartsWith:()=>Bc,$ZodCheckStringFormat:()=>Fr,$ZodCheckUpperCase:()=>Vc,$ZodCodec:()=>Xn,$ZodCustom:()=>ad,$ZodCustomStringFormat:()=>Sl,$ZodDate:()=>Rl,$ZodDefault:()=>Jl,$ZodDiscriminatedUnion:()=>Ul,$ZodE164:()=>xl,$ZodEmail:()=>tl,$ZodEmoji:()=>nl,$ZodEncodeError:()=>zt,$ZodEnum:()=>Zl,$ZodError:()=>Bn,$ZodExactOptional:()=>ql,$ZodFile:()=>Gl,$ZodFunction:()=>id,$ZodGUID:()=>Qc,$ZodIPv4:()=>pl,$ZodIPv6:()=>ml,$ZodISODate:()=>dl,$ZodISODateTime:()=>ll,$ZodISODuration:()=>hl,$ZodISOTime:()=>fl,$ZodIntersection:()=>jl,$ZodJWT:()=>wl,$ZodKSUID:()=>cl,$ZodLazy:()=>sd,$ZodLiteral:()=>Bl,$ZodMAC:()=>gl,$ZodMap:()=>Fl,$ZodNaN:()=>ed,$ZodNanoID:()=>il,$ZodNever:()=>Cl,$ZodNonOptional:()=>Yl,$ZodNull:()=>Ol,$ZodNullable:()=>Hl,$ZodNumber:()=>Uo,$ZodNumberFormat:()=>kl,$ZodObject:()=>gv,$ZodObjectJIT:()=>Dl,$ZodOptional:()=>Fo,$ZodPipe:()=>Vo,$ZodPrefault:()=>Kl,$ZodPreprocess:()=>td,$ZodPromise:()=>od,$ZodReadonly:()=>rd,$ZodRealError:()=>Ne,$ZodRecord:()=>Ml,$ZodRegistry:()=>Wo,$ZodSet:()=>Vl,$ZodString:()=>ar,$ZodStringFormat:()=>H,$ZodSuccess:()=>Xl,$ZodSymbol:()=>Il,$ZodTemplateLiteral:()=>nd,$ZodTransform:()=>Wl,$ZodTuple:()=>Mo,$ZodType:()=>L,$ZodULID:()=>al,$ZodURL:()=>rl,$ZodUUID:()=>el,$ZodUndefined:()=>Tl,$ZodUnion:()=>Yn,$ZodUnknown:()=>Pl,$ZodVoid:()=>zl,$ZodXID:()=>ul,$ZodXor:()=>Ll,$brand:()=>Uu,$constructor:()=>m,$input:()=>pd,$output:()=>hd,Doc:()=>Jn,JSONSchema:()=>m_,JSONSchemaGenerator:()=>ws,NEVER:()=>Lu,TimePrecision:()=>yd,_any:()=>jd,_array:()=>Wd,_base64:()=>ls,_base64url:()=>ds,_bigint:()=>Cd,_boolean:()=>Ad,_catch:()=>X1,_check:()=>f_,_cidrv4:()=>us,_cidrv6:()=>cs,_coercedBigint:()=>zd,_coercedBoolean:()=>Pd,_coercedDate:()=>Bd,_coercedNumber:()=>Sd,_coercedString:()=>gd,_cuid:()=>ts,_cuid2:()=>rs,_custom:()=>Hd,_date:()=>Zd,_decode:()=>$o,_decodeAsync:()=>wo,_default:()=>J1,_discriminatedUnion:()=>L1,_e164:()=>fs,_email:()=>Ho,_emoji:()=>Qo,_encode:()=>bo,_encodeAsync:()=>xo,_endsWith:()=>Hr,_enum:()=>Z1,_file:()=>qd,_float32:()=>Ed,_float64:()=>Id,_gt:()=>dt,_gte:()=>Te,_guid:()=>ri,_includes:()=>Wr,_int:()=>kd,_int32:()=>Td,_int64:()=>Rd,_intersection:()=>U1,_ipv4:()=>ss,_ipv6:()=>as,_isoDate:()=>bd,_isoDateTime:()=>_d,_isoDuration:()=>xd,_isoTime:()=>$d,_jwt:()=>hs,_ksuid:()=>os,_lazy:()=>rT,_length:()=>lr,_literal:()=>G1,_lowercase:()=>Br,_lt:()=>lt,_lte:()=>Ve,_mac:()=>vd,_map:()=>F1,_max:()=>Ve,_maxLength:()=>cr,_maxSize:()=>jt,_mime:()=>Jr,_min:()=>Te,_minLength:()=>$t,_minSize:()=>ft,_multipleOf:()=>Ut,_nan:()=>Gd,_nanoid:()=>es,_nativeEnum:()=>B1,_negative:()=>ms,_never:()=>Fd,_nonnegative:()=>vs,_nonoptional:()=>K1,_nonpositive:()=>gs,_normalize:()=>Kr,_null:()=>Ud,_nullable:()=>H1,_number:()=>wd,_optional:()=>q1,_overwrite:()=>st,_parse:()=>Lr,_parseAsync:()=>Ur,_pipe:()=>Q1,_positive:()=>ps,_promise:()=>nT,_property:()=>ys,_readonly:()=>eT,_record:()=>M1,_refine:()=>Jd,_regex:()=>Zr,_safeDecode:()=>ko,_safeDecodeAsync:()=>Io,_safeEncode:()=>So,_safeEncodeAsync:()=>Eo,_safeParse:()=>jr,_safeParseAsync:()=>Mr,_set:()=>V1,_size:()=>ur,_slugify:()=>en,_startsWith:()=>qr,_string:()=>md,_stringFormat:()=>tn,_stringbool:()=>Qd,_success:()=>Y1,_superRefine:()=>Kd,_symbol:()=>Dd,_templateLiteral:()=>tT,_toLowerCase:()=>Xr,_toUpperCase:()=>Qr,_transform:()=>W1,_trim:()=>Yr,_tuple:()=>j1,_uint32:()=>Od,_uint64:()=>Nd,_ulid:()=>ns,_undefined:()=>Ld,_union:()=>N1,_unknown:()=>Md,_uppercase:()=>Gr,_url:()=>ni,_uuid:()=>Jo,_uuidv4:()=>Ko,_uuidv6:()=>Yo,_uuidv7:()=>Xo,_void:()=>Vd,_xid:()=>is,_xor:()=>D1,clone:()=>Ee,config:()=>oe,createStandardJSONSchemaMethod:()=>rn,createToJSONSchemaMethod:()=>ef,decode:()=>nI,decodeAsync:()=>oI,describe:()=>Yd,encode:()=>rI,encodeAsync:()=>iI,extractDefs:()=>Ft,finalize:()=>Vt,flattenError:()=>Gn,formatError:()=>Wn,globalConfig:()=>nr,globalRegistry:()=>ve,initializeContext:()=>Mt,isValidBase64:()=>_l,isValidBase64URL:()=>fv,isValidJWT:()=>hv,locales:()=>ei,meta:()=>Xd,parse:()=>yo,parseAsync:()=>_o,prettifyError:()=>Yu,process:()=>W,regexes:()=>Fe,registry:()=>qo,safeDecode:()=>aI,safeDecodeAsync:()=>cI,safeEncode:()=>sI,safeEncodeAsync:()=>uI,safeParse:()=>Qu,safeParseAsync:()=>ec,toDotPath:()=>Gg,toJSONSchema:()=>xs,treeifyError:()=>Ku,util:()=>x,version:()=>Kc});var Ze=v(()=>{ir();tc();Xu();ud();zo();Yc();R();Ao();fd();ti();Jc();h_();ii();oi();p_();g_()});var Ss={};He(Ss,{endsWith:()=>Hr,gt:()=>dt,gte:()=>Te,includes:()=>Wr,length:()=>lr,lowercase:()=>Br,lt:()=>lt,lte:()=>Ve,maxLength:()=>cr,maxSize:()=>jt,mime:()=>Jr,minLength:()=>$t,minSize:()=>ft,multipleOf:()=>Ut,negative:()=>ms,nonnegative:()=>vs,nonpositive:()=>gs,normalize:()=>Kr,overwrite:()=>st,positive:()=>ps,property:()=>ys,regex:()=>Zr,size:()=>ur,slugify:()=>en,startsWith:()=>qr,toLowerCase:()=>Xr,toUpperCase:()=>Qr,trim:()=>Yr,uppercase:()=>Gr});var ks=v(()=>{Ze()});var nn={};He(nn,{ZodISODate:()=>Is,ZodISODateTime:()=>Es,ZodISODuration:()=>Os,ZodISOTime:()=>Ts,date:()=>Mf,datetime:()=>jf,duration:()=>Vf,time:()=>Ff});function jf(t){return _d(Es,t)}function Mf(t){return bd(Is,t)}function Ff(t){return $d(Ts,t)}function Vf(t){return xd(Os,t)}var Es,Is,Ts,Os,si=v(()=>{Ze();ui();Es=m("ZodISODateTime",(t,e)=>{ll.init(t,e),J.init(t,e)});Is=m("ZodISODate",(t,e)=>{dl.init(t,e),J.init(t,e)});Ts=m("ZodISOTime",(t,e)=>{fl.init(t,e),J.init(t,e)});Os=m("ZodISODuration",(t,e)=>{hl.init(t,e),J.init(t,e)})});var v_,sT,De,Zf=v(()=>{Ze();Ze();R();v_=(t,e)=>{Bn.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>Wn(t,n)},flatten:{value:n=>Gn(t,n)},addIssue:{value:n=>{t.issues.push(n),t.message=JSON.stringify(t.issues,Rr,2)}},addIssues:{value:n=>{t.issues.push(...n),t.message=JSON.stringify(t.issues,Rr,2)}},isEmpty:{get(){return t.issues.length===0}}})},sT=m("ZodError",v_),De=m("ZodError",v_,{Parent:Error})});var Bf,Gf,Wf,qf,Hf,Jf,Kf,Yf,Xf,Qf,eh,th,rh=v(()=>{Ze();Zf();Bf=Lr(De),Gf=Ur(De),Wf=jr(De),qf=Mr(De),Hf=bo(De),Jf=$o(De),Kf=xo(De),Yf=wo(De),Xf=So(De),Qf=ko(De),eh=Eo(De),th=Io(De)});var ai={};He(ai,{ZodAny:()=>lh,ZodArray:()=>ph,ZodBase64:()=>Gs,ZodBase64URL:()=>Ws,ZodBigInt:()=>dn,ZodBigIntFormat:()=>Js,ZodBoolean:()=>ln,ZodCIDRv4:()=>Zs,ZodCIDRv6:()=>Bs,ZodCUID:()=>Ds,ZodCUID2:()=>Ls,ZodCatch:()=>Dh,ZodCodec:()=>bi,ZodCustom:()=>$i,ZodCustomStringFormat:()=>un,ZodDate:()=>mi,ZodDefault:()=>Ah,ZodDiscriminatedUnion:()=>gh,ZodE164:()=>qs,ZodEmail:()=>zs,ZodEmoji:()=>Rs,ZodEnum:()=>sn,ZodExactOptional:()=>Ih,ZodFile:()=>kh,ZodFunction:()=>Wh,ZodGUID:()=>li,ZodIPv4:()=>Fs,ZodIPv6:()=>Vs,ZodIntersection:()=>vh,ZodJWT:()=>Hs,ZodKSUID:()=>Ms,ZodLazy:()=>Zh,ZodLiteral:()=>Sh,ZodMAC:()=>nh,ZodMap:()=>xh,ZodNaN:()=>Uh,ZodNanoID:()=>Ns,ZodNever:()=>fh,ZodNonOptional:()=>ta,ZodNull:()=>uh,ZodNullable:()=>Oh,ZodNumber:()=>cn,ZodNumberFormat:()=>fr,ZodObject:()=>vi,ZodOptional:()=>ea,ZodPipe:()=>_i,ZodPrefault:()=>Ch,ZodPreprocess:()=>jh,ZodPromise:()=>Gh,ZodReadonly:()=>Mh,ZodRecord:()=>on,ZodSet:()=>wh,ZodString:()=>an,ZodStringFormat:()=>J,ZodSuccess:()=>Nh,ZodSymbol:()=>sh,ZodTemplateLiteral:()=>Vh,ZodTransform:()=>Eh,ZodTuple:()=>_h,ZodType:()=>j,ZodULID:()=>Us,ZodURL:()=>pi,ZodUUID:()=>ht,ZodUndefined:()=>ah,ZodUnion:()=>yi,ZodUnknown:()=>dh,ZodVoid:()=>hh,ZodXID:()=>js,ZodXor:()=>mh,_ZodString:()=>Cs,_default:()=>Ph,_function:()=>kb,any:()=>rb,array:()=>gi,base64:()=>j_,base64url:()=>M_,bigint:()=>Y_,boolean:()=>oh,catch:()=>Lh,check:()=>Eb,cidrv4:()=>L_,cidrv6:()=>U_,codec:()=>$b,cuid:()=>O_,cuid2:()=>A_,custom:()=>Ib,date:()=>ib,describe:()=>Tb,discriminatedUnion:()=>lb,e164:()=>F_,email:()=>__,emoji:()=>I_,enum:()=>Xs,exactOptional:()=>Th,file:()=>vb,float32:()=>q_,float64:()=>H_,function:()=>kb,guid:()=>b_,hash:()=>W_,hex:()=>G_,hostname:()=>B_,httpUrl:()=>E_,instanceof:()=>Ab,int:()=>As,int32:()=>J_,int64:()=>X_,intersection:()=>yh,invertCodec:()=>xb,ipv4:()=>R_,ipv6:()=>D_,json:()=>Cb,jwt:()=>V_,keyof:()=>ob,ksuid:()=>z_,lazy:()=>Bh,literal:()=>gb,looseObject:()=>ub,looseRecord:()=>fb,mac:()=>N_,map:()=>hb,meta:()=>Ob,nan:()=>bb,nanoid:()=>T_,nativeEnum:()=>mb,never:()=>Ks,nonoptional:()=>Rh,null:()=>ch,nullable:()=>fi,nullish:()=>yb,number:()=>ih,object:()=>sb,optional:()=>di,partialRecord:()=>db,pipe:()=>Ps,prefault:()=>zh,preprocess:()=>zb,promise:()=>Sb,readonly:()=>Fh,record:()=>$h,refine:()=>qh,set:()=>pb,strictObject:()=>ab,string:()=>ci,stringFormat:()=>Z_,stringbool:()=>Pb,success:()=>_b,superRefine:()=>Hh,symbol:()=>eb,templateLiteral:()=>wb,transform:()=>Qs,tuple:()=>bh,uint32:()=>K_,uint64:()=>Q_,ulid:()=>P_,undefined:()=>tb,union:()=>Ys,unknown:()=>dr,url:()=>k_,uuid:()=>$_,uuidv4:()=>x_,uuidv6:()=>w_,uuidv7:()=>S_,void:()=>nb,xid:()=>C_,xor:()=>cb});function hi(t,e,n){let i=Object.getPrototypeOf(t),r=y_.get(i);if(r||(r=new Set,y_.set(i,r)),!r.has(e)){r.add(e);for(let o in n){let s=n[o];Object.defineProperty(i,o,{configurable:!0,enumerable:!1,get(){let a=s.bind(this);return Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}function ci(t){return md(an,t)}function __(t){return Ho(zs,t)}function b_(t){return ri(li,t)}function $_(t){return Jo(ht,t)}function x_(t){return Ko(ht,t)}function w_(t){return Yo(ht,t)}function S_(t){return Xo(ht,t)}function k_(t){return ni(pi,t)}function E_(t){return ni(pi,{protocol:Fe.httpProtocol,hostname:Fe.domain,...x.normalizeParams(t)})}function I_(t){return Qo(Rs,t)}function T_(t){return es(Ns,t)}function O_(t){return ts(Ds,t)}function A_(t){return rs(Ls,t)}function P_(t){return ns(Us,t)}function C_(t){return is(js,t)}function z_(t){return os(Ms,t)}function R_(t){return ss(Fs,t)}function N_(t){return vd(nh,t)}function D_(t){return as(Vs,t)}function L_(t){return us(Zs,t)}function U_(t){return cs(Bs,t)}function j_(t){return ls(Gs,t)}function M_(t){return ds(Ws,t)}function F_(t){return fs(qs,t)}function V_(t){return hs(Hs,t)}function Z_(t,e,n={}){return tn(un,t,e,n)}function B_(t){return tn(un,"hostname",Fe.hostname,t)}function G_(t){return tn(un,"hex",Fe.hex,t)}function W_(t,e){let n=e?.enc??"hex",i=`${t}_${n}`,r=Fe[i];if(!r)throw new Error(`Unrecognized hash format: ${i}`);return tn(un,i,r,e)}function ih(t){return wd(cn,t)}function As(t){return kd(fr,t)}function q_(t){return Ed(fr,t)}function H_(t){return Id(fr,t)}function J_(t){return Td(fr,t)}function K_(t){return Od(fr,t)}function oh(t){return Ad(ln,t)}function Y_(t){return Cd(dn,t)}function X_(t){return Rd(Js,t)}function Q_(t){return Nd(Js,t)}function eb(t){return Dd(sh,t)}function tb(t){return Ld(ah,t)}function ch(t){return Ud(uh,t)}function rb(){return jd(lh)}function dr(){return Md(dh)}function Ks(t){return Fd(fh,t)}function nb(t){return Vd(hh,t)}function ib(t){return Zd(mi,t)}function gi(t,e){return Wd(ph,t,e)}function ob(t){let e=t._zod.def.shape;return Xs(Object.keys(e))}function sb(t,e){let n={type:"object",shape:t??{},...x.normalizeParams(e)};return new vi(n)}function ab(t,e){return new vi({type:"object",shape:t,catchall:Ks(),...x.normalizeParams(e)})}function ub(t,e){return new vi({type:"object",shape:t,catchall:dr(),...x.normalizeParams(e)})}function Ys(t,e){return new yi({type:"union",options:t,...x.normalizeParams(e)})}function cb(t,e){return new mh({type:"union",options:t,inclusive:!1,...x.normalizeParams(e)})}function lb(t,e,n){return new gh({type:"union",options:e,discriminator:t,...x.normalizeParams(n)})}function yh(t,e){return new vh({type:"intersection",left:t,right:e})}function bh(t,e,n){let i=e instanceof L,r=i?n:e,o=i?e:null;return new _h({type:"tuple",items:t,rest:o,...x.normalizeParams(r)})}function $h(t,e,n){return!e||!e._zod?new on({type:"record",keyType:ci(),valueType:t,...x.normalizeParams(e)}):new on({type:"record",keyType:t,valueType:e,...x.normalizeParams(n)})}function db(t,e,n){let i=Ee(t);return i._zod.values=void 0,new on({type:"record",keyType:i,valueType:e,...x.normalizeParams(n)})}function fb(t,e,n){return new on({type:"record",keyType:t,valueType:e,mode:"loose",...x.normalizeParams(n)})}function hb(t,e,n){return new xh({type:"map",keyType:t,valueType:e,...x.normalizeParams(n)})}function pb(t,e){return new wh({type:"set",valueType:t,...x.normalizeParams(e)})}function Xs(t,e){let n=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new sn({type:"enum",entries:n,...x.normalizeParams(e)})}function mb(t,e){return new sn({type:"enum",entries:t,...x.normalizeParams(e)})}function gb(t,e){return new Sh({type:"literal",values:Array.isArray(t)?t:[t],...x.normalizeParams(e)})}function vb(t){return qd(kh,t)}function Qs(t){return new Eh({type:"transform",transform:t})}function di(t){return new ea({type:"optional",innerType:t})}function Th(t){return new Ih({type:"optional",innerType:t})}function fi(t){return new Oh({type:"nullable",innerType:t})}function yb(t){return di(fi(t))}function Ph(t,e){return new Ah({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():x.shallowClone(e)}})}function zh(t,e){return new Ch({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():x.shallowClone(e)}})}function Rh(t,e){return new ta({type:"nonoptional",innerType:t,...x.normalizeParams(e)})}function _b(t){return new Nh({type:"success",innerType:t})}function Lh(t,e){return new Dh({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function bb(t){return Gd(Uh,t)}function Ps(t,e){return new _i({type:"pipe",in:t,out:e})}function $b(t,e,n){return new bi({type:"pipe",in:t,out:e,transform:n.decode,reverseTransform:n.encode})}function xb(t){let e=t._zod.def;return new bi({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}function Fh(t){return new Mh({type:"readonly",innerType:t})}function wb(t,e){return new Vh({type:"template_literal",parts:t,...x.normalizeParams(e)})}function Bh(t){return new Zh({type:"lazy",getter:t})}function Sb(t){return new Gh({type:"promise",innerType:t})}function kb(t){return new Wh({type:"function",input:Array.isArray(t?.input)?bh(t?.input):t?.input??gi(dr()),output:t?.output??dr()})}function Eb(t){let e=new X({check:"custom"});return e._zod.check=t,e}function Ib(t,e){return Hd($i,t??(()=>!0),e)}function qh(t,e={}){return Jd($i,t,e)}function Hh(t,e){return Kd(t,e)}function Ab(t,e={}){let n=new $i({type:"custom",check:"custom",fn:i=>i instanceof t,abort:!0,...x.normalizeParams(e)});return n._zod.bag.Class=t,n._zod.check=i=>{i.value instanceof t||i.issues.push({code:"invalid_type",expected:t.name,input:i.value,inst:n,path:[...n._zod.def.path??[]]})},n}function Cb(t){let e=Bh(()=>Ys([ci(t),ih(),oh(),ch(),gi(e),$h(ci(),e)]));return e}function zb(t,e){return new jh({type:"pipe",in:Qs(t),out:e})}var y_,j,Cs,an,J,zs,li,ht,pi,Rs,Ns,Ds,Ls,Us,js,Ms,Fs,nh,Vs,Zs,Bs,Gs,Ws,qs,Hs,un,cn,fr,ln,dn,Js,sh,ah,uh,lh,dh,fh,hh,mi,ph,vi,yi,mh,gh,vh,_h,on,xh,wh,sn,Sh,kh,Eh,ea,Ih,Oh,Ah,Ch,ta,Nh,Dh,Uh,_i,bi,jh,Mh,Vh,Zh,Gh,Wh,$i,Tb,Ob,Pb,ui=v(()=>{Ze();Ze();oi();ii();ks();si();rh();y_=new WeakMap;j=m("ZodType",(t,e)=>(L.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:rn(t,"input"),output:rn(t,"output")}}),t.toJSONSchema=ef(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(n,i)=>Bf(t,n,i,{callee:t.parse}),t.safeParse=(n,i)=>Wf(t,n,i),t.parseAsync=async(n,i)=>Gf(t,n,i,{callee:t.parseAsync}),t.safeParseAsync=async(n,i)=>qf(t,n,i),t.spa=t.safeParseAsync,t.encode=(n,i)=>Hf(t,n,i),t.decode=(n,i)=>Jf(t,n,i),t.encodeAsync=async(n,i)=>Kf(t,n,i),t.decodeAsync=async(n,i)=>Yf(t,n,i),t.safeEncode=(n,i)=>Xf(t,n,i),t.safeDecode=(n,i)=>Qf(t,n,i),t.safeEncodeAsync=async(n,i)=>eh(t,n,i),t.safeDecodeAsync=async(n,i)=>th(t,n,i),hi(t,"ZodType",{check(...n){let i=this.def;return this.clone(x.mergeDefs(i,{checks:[...i.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,i){return Ee(this,n,i)},brand(){return this},register(n,i){return n.add(this,i),this},refine(n,i){return this.check(qh(n,i))},superRefine(n,i){return this.check(Hh(n,i))},overwrite(n){return this.check(st(n))},optional(){return di(this)},exactOptional(){return Th(this)},nullable(){return fi(this)},nullish(){return di(fi(this))},nonoptional(n){return Rh(this,n)},array(){return gi(this)},or(n){return Ys([this,n])},and(n){return yh(this,n)},transform(n){return Ps(this,Qs(n))},default(n){return Ph(this,n)},prefault(n){return zh(this,n)},catch(n){return Lh(this,n)},pipe(n){return Ps(this,n)},readonly(){return Fh(this)},describe(n){let i=this.clone();return ve.add(i,{description:n}),i},meta(...n){if(n.length===0)return ve.get(this);let i=this.clone();return ve.add(i,n[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(t,"description",{get(){return ve.get(t)?.description},configurable:!0}),t)),Cs=m("_ZodString",(t,e)=>{ar.init(t,e),j.init(t,e),t._zod.processJSONSchema=(i,r,o)=>tf(t,i,r,o);let n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,hi(t,"_ZodString",{regex(...i){return this.check(Zr(...i))},includes(...i){return this.check(Wr(...i))},startsWith(...i){return this.check(qr(...i))},endsWith(...i){return this.check(Hr(...i))},min(...i){return this.check($t(...i))},max(...i){return this.check(cr(...i))},length(...i){return this.check(lr(...i))},nonempty(...i){return this.check($t(1,...i))},lowercase(i){return this.check(Br(i))},uppercase(i){return this.check(Gr(i))},trim(){return this.check(Yr())},normalize(...i){return this.check(Kr(...i))},toLowerCase(){return this.check(Xr())},toUpperCase(){return this.check(Qr())},slugify(){return this.check(en())}})}),an=m("ZodString",(t,e)=>{ar.init(t,e),Cs.init(t,e),t.email=n=>t.check(Ho(zs,n)),t.url=n=>t.check(ni(pi,n)),t.jwt=n=>t.check(hs(Hs,n)),t.emoji=n=>t.check(Qo(Rs,n)),t.guid=n=>t.check(ri(li,n)),t.uuid=n=>t.check(Jo(ht,n)),t.uuidv4=n=>t.check(Ko(ht,n)),t.uuidv6=n=>t.check(Yo(ht,n)),t.uuidv7=n=>t.check(Xo(ht,n)),t.nanoid=n=>t.check(es(Ns,n)),t.guid=n=>t.check(ri(li,n)),t.cuid=n=>t.check(ts(Ds,n)),t.cuid2=n=>t.check(rs(Ls,n)),t.ulid=n=>t.check(ns(Us,n)),t.base64=n=>t.check(ls(Gs,n)),t.base64url=n=>t.check(ds(Ws,n)),t.xid=n=>t.check(is(js,n)),t.ksuid=n=>t.check(os(Ms,n)),t.ipv4=n=>t.check(ss(Fs,n)),t.ipv6=n=>t.check(as(Vs,n)),t.cidrv4=n=>t.check(us(Zs,n)),t.cidrv6=n=>t.check(cs(Bs,n)),t.e164=n=>t.check(fs(qs,n)),t.datetime=n=>t.check(jf(n)),t.date=n=>t.check(Mf(n)),t.time=n=>t.check(Ff(n)),t.duration=n=>t.check(Vf(n))});J=m("ZodStringFormat",(t,e)=>{H.init(t,e),Cs.init(t,e)}),zs=m("ZodEmail",(t,e)=>{tl.init(t,e),J.init(t,e)});li=m("ZodGUID",(t,e)=>{Qc.init(t,e),J.init(t,e)});ht=m("ZodUUID",(t,e)=>{el.init(t,e),J.init(t,e)});pi=m("ZodURL",(t,e)=>{rl.init(t,e),J.init(t,e)});Rs=m("ZodEmoji",(t,e)=>{nl.init(t,e),J.init(t,e)});Ns=m("ZodNanoID",(t,e)=>{il.init(t,e),J.init(t,e)});Ds=m("ZodCUID",(t,e)=>{ol.init(t,e),J.init(t,e)});Ls=m("ZodCUID2",(t,e)=>{sl.init(t,e),J.init(t,e)});Us=m("ZodULID",(t,e)=>{al.init(t,e),J.init(t,e)});js=m("ZodXID",(t,e)=>{ul.init(t,e),J.init(t,e)});Ms=m("ZodKSUID",(t,e)=>{cl.init(t,e),J.init(t,e)});Fs=m("ZodIPv4",(t,e)=>{pl.init(t,e),J.init(t,e)});nh=m("ZodMAC",(t,e)=>{gl.init(t,e),J.init(t,e)});Vs=m("ZodIPv6",(t,e)=>{ml.init(t,e),J.init(t,e)});Zs=m("ZodCIDRv4",(t,e)=>{vl.init(t,e),J.init(t,e)});Bs=m("ZodCIDRv6",(t,e)=>{yl.init(t,e),J.init(t,e)});Gs=m("ZodBase64",(t,e)=>{bl.init(t,e),J.init(t,e)});Ws=m("ZodBase64URL",(t,e)=>{$l.init(t,e),J.init(t,e)});qs=m("ZodE164",(t,e)=>{xl.init(t,e),J.init(t,e)});Hs=m("ZodJWT",(t,e)=>{wl.init(t,e),J.init(t,e)});un=m("ZodCustomStringFormat",(t,e)=>{Sl.init(t,e),J.init(t,e)});cn=m("ZodNumber",(t,e)=>{Uo.init(t,e),j.init(t,e),t._zod.processJSONSchema=(i,r,o)=>rf(t,i,r,o),hi(t,"ZodNumber",{gt(i,r){return this.check(dt(i,r))},gte(i,r){return this.check(Te(i,r))},min(i,r){return this.check(Te(i,r))},lt(i,r){return this.check(lt(i,r))},lte(i,r){return this.check(Ve(i,r))},max(i,r){return this.check(Ve(i,r))},int(i){return this.check(As(i))},safe(i){return this.check(As(i))},positive(i){return this.check(dt(0,i))},nonnegative(i){return this.check(Te(0,i))},negative(i){return this.check(lt(0,i))},nonpositive(i){return this.check(Ve(0,i))},multipleOf(i,r){return this.check(Ut(i,r))},step(i,r){return this.check(Ut(i,r))},finite(){return this}});let n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null});fr=m("ZodNumberFormat",(t,e)=>{kl.init(t,e),cn.init(t,e)});ln=m("ZodBoolean",(t,e)=>{Kn.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>nf(t,n,i,r)});dn=m("ZodBigInt",(t,e)=>{jo.init(t,e),j.init(t,e),t._zod.processJSONSchema=(i,r,o)=>of(t,i,r,o),t.gte=(i,r)=>t.check(Te(i,r)),t.min=(i,r)=>t.check(Te(i,r)),t.gt=(i,r)=>t.check(dt(i,r)),t.gte=(i,r)=>t.check(Te(i,r)),t.min=(i,r)=>t.check(Te(i,r)),t.lt=(i,r)=>t.check(lt(i,r)),t.lte=(i,r)=>t.check(Ve(i,r)),t.max=(i,r)=>t.check(Ve(i,r)),t.positive=i=>t.check(dt(BigInt(0),i)),t.negative=i=>t.check(lt(BigInt(0),i)),t.nonpositive=i=>t.check(Ve(BigInt(0),i)),t.nonnegative=i=>t.check(Te(BigInt(0),i)),t.multipleOf=(i,r)=>t.check(Ut(i,r));let n=t._zod.bag;t.minValue=n.minimum??null,t.maxValue=n.maximum??null,t.format=n.format??null});Js=m("ZodBigIntFormat",(t,e)=>{El.init(t,e),dn.init(t,e)});sh=m("ZodSymbol",(t,e)=>{Il.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>sf(t,n,i,r)});ah=m("ZodUndefined",(t,e)=>{Tl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>uf(t,n,i,r)});uh=m("ZodNull",(t,e)=>{Ol.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>af(t,n,i,r)});lh=m("ZodAny",(t,e)=>{Al.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>df(t,n,i,r)});dh=m("ZodUnknown",(t,e)=>{Pl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>ff(t,n,i,r)});fh=m("ZodNever",(t,e)=>{Cl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>lf(t,n,i,r)});hh=m("ZodVoid",(t,e)=>{zl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>cf(t,n,i,r)});mi=m("ZodDate",(t,e)=>{Rl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(i,r,o)=>hf(t,i,r,o),t.min=(i,r)=>t.check(Te(i,r)),t.max=(i,r)=>t.check(Ve(i,r));let n=t._zod.bag;t.minDate=n.minimum?new Date(n.minimum):null,t.maxDate=n.maximum?new Date(n.maximum):null});ph=m("ZodArray",(t,e)=>{Nl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>kf(t,n,i,r),t.element=e.element,hi(t,"ZodArray",{min(n,i){return this.check($t(n,i))},nonempty(n){return this.check($t(1,n))},max(n,i){return this.check(cr(n,i))},length(n,i){return this.check(lr(n,i))},unwrap(){return this.element}})});vi=m("ZodObject",(t,e)=>{Dl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ef(t,n,i,r),x.defineLazy(t,"shape",()=>e.shape),hi(t,"ZodObject",{keyof(){return Xs(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:dr()})},loose(){return this.clone({...this._zod.def,catchall:dr()})},strict(){return this.clone({...this._zod.def,catchall:Ks()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return x.extend(this,n)},safeExtend(n){return x.safeExtend(this,n)},merge(n){return x.merge(this,n)},pick(n){return x.pick(this,n)},omit(n){return x.omit(this,n)},partial(...n){return x.partial(ea,this,n[0])},required(...n){return x.required(ta,this,n[0])}})});yi=m("ZodUnion",(t,e)=>{Yn.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>bs(t,n,i,r),t.options=e.options});mh=m("ZodXor",(t,e)=>{yi.init(t,e),Ll.init(t,e),t._zod.processJSONSchema=(n,i,r)=>bs(t,n,i,r),t.options=e.options});gh=m("ZodDiscriminatedUnion",(t,e)=>{yi.init(t,e),Ul.init(t,e)});vh=m("ZodIntersection",(t,e)=>{jl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>If(t,n,i,r)});_h=m("ZodTuple",(t,e)=>{Mo.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Tf(t,n,i,r),t.rest=n=>t.clone({...t._zod.def,rest:n})});on=m("ZodRecord",(t,e)=>{Ml.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Of(t,n,i,r),t.keyType=e.keyType,t.valueType=e.valueType});xh=m("ZodMap",(t,e)=>{Fl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>wf(t,n,i,r),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...n)=>t.check(ft(...n)),t.nonempty=n=>t.check(ft(1,n)),t.max=(...n)=>t.check(jt(...n)),t.size=(...n)=>t.check(ur(...n))});wh=m("ZodSet",(t,e)=>{Vl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Sf(t,n,i,r),t.min=(...n)=>t.check(ft(...n)),t.nonempty=n=>t.check(ft(1,n)),t.max=(...n)=>t.check(jt(...n)),t.size=(...n)=>t.check(ur(...n))});sn=m("ZodEnum",(t,e)=>{Zl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(i,r,o)=>pf(t,i,r,o),t.enum=e.entries,t.options=Object.values(e.entries);let n=new Set(Object.keys(e.entries));t.extract=(i,r)=>{let o={};for(let s of i)if(n.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new sn({...e,checks:[],...x.normalizeParams(r),entries:o})},t.exclude=(i,r)=>{let o={...e.entries};for(let s of i)if(n.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new sn({...e,checks:[],...x.normalizeParams(r),entries:o})}});Sh=m("ZodLiteral",(t,e)=>{Bl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>mf(t,n,i,r),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]}})});kh=m("ZodFile",(t,e)=>{Gl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>yf(t,n,i,r),t.min=(n,i)=>t.check(ft(n,i)),t.max=(n,i)=>t.check(jt(n,i)),t.mime=(n,i)=>t.check(Jr(Array.isArray(n)?n:[n],i))});Eh=m("ZodTransform",(t,e)=>{Wl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>xf(t,n,i,r),t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new zt(t.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(x.issue(o,n.value,e));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),n.issues.push(x.issue(s))}};let r=e.transform(n.value,n);return r instanceof Promise?r.then(o=>(n.value=o,n.fallback=!0,n)):(n.value=r,n.fallback=!0,n)}});ea=m("ZodOptional",(t,e)=>{Fo.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>$s(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});Ih=m("ZodExactOptional",(t,e)=>{ql.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>$s(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});Oh=m("ZodNullable",(t,e)=>{Hl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Af(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});Ah=m("ZodDefault",(t,e)=>{Jl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Cf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});Ch=m("ZodPrefault",(t,e)=>{Kl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>zf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});ta=m("ZodNonOptional",(t,e)=>{Yl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Pf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});Nh=m("ZodSuccess",(t,e)=>{Xl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>_f(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});Dh=m("ZodCatch",(t,e)=>{Ql.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Rf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});Uh=m("ZodNaN",(t,e)=>{ed.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>gf(t,n,i,r)});_i=m("ZodPipe",(t,e)=>{Vo.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Nf(t,n,i,r),t.in=e.in,t.out=e.out});bi=m("ZodCodec",(t,e)=>{_i.init(t,e),Xn.init(t,e)});jh=m("ZodPreprocess",(t,e)=>{_i.init(t,e),td.init(t,e)}),Mh=m("ZodReadonly",(t,e)=>{rd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Df(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});Vh=m("ZodTemplateLiteral",(t,e)=>{nd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>vf(t,n,i,r)});Zh=m("ZodLazy",(t,e)=>{sd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Uf(t,n,i,r),t.unwrap=()=>t._zod.def.getter()});Gh=m("ZodPromise",(t,e)=>{od.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Lf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});Wh=m("ZodFunction",(t,e)=>{id.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>$f(t,n,i,r)});$i=m("ZodCustom",(t,e)=>{ad.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>bf(t,n,i,r)});Tb=Yd,Ob=Xd;Pb=(...t)=>Qd({Codec:bi,Boolean:ln,String:an},...t)});function cT(t){oe({customError:t})}function lT(){return oe().customError}var uT,Jh,Rb=v(()=>{Ze();uT={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"};Jh||(Jh={})});function fT(t,e){let n=t.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function hT(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=t.slice(1).split("/").filter(Boolean);if(n.length===0)return e.rootSchema;let i=e.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===i){let r=n[1];if(!r||!e.defs[r])throw new Error(`Reference not found: ${t}`);return e.defs[r]}throw new Error(`Reference not found: ${t}`)}function Nb(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return I.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 r=t.$ref;if(e.refs.has(r))return e.refs.get(r);if(e.processing.has(r))return I.lazy(()=>{if(!e.refs.has(r))throw new Error(`Circular reference not resolved: ${r}`);return e.refs.get(r)});e.processing.add(r);let o=hT(r,e),s=xe(o,e);return e.refs.set(r,s),e.processing.delete(r),s}if(t.enum!==void 0){let r=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&r.length===1&&r[0]===null)return I.null();if(r.length===0)return I.never();if(r.length===1)return I.literal(r[0]);if(r.every(s=>typeof s=="string"))return I.enum(r);let o=r.map(s=>I.literal(s));return o.length<2?o[0]:I.union([o[0],o[1],...o.slice(2)])}if(t.const!==void 0)return I.literal(t.const);let n=t.type;if(Array.isArray(n)){let r=n.map(o=>{let s={...t,type:o};return Nb(s,e)});return r.length===0?I.never():r.length===1?r[0]:I.union(r)}if(!n)return I.any();let i;switch(n){case"string":{let r=I.string();if(t.format){let o=t.format;o==="email"?r=r.check(I.email()):o==="uri"||o==="uri-reference"?r=r.check(I.url()):o==="uuid"||o==="guid"?r=r.check(I.uuid()):o==="date-time"?r=r.check(I.iso.datetime()):o==="date"?r=r.check(I.iso.date()):o==="time"?r=r.check(I.iso.time()):o==="duration"?r=r.check(I.iso.duration()):o==="ipv4"?r=r.check(I.ipv4()):o==="ipv6"?r=r.check(I.ipv6()):o==="mac"?r=r.check(I.mac()):o==="cidr"?r=r.check(I.cidrv4()):o==="cidr-v6"?r=r.check(I.cidrv6()):o==="base64"?r=r.check(I.base64()):o==="base64url"?r=r.check(I.base64url()):o==="e164"?r=r.check(I.e164()):o==="jwt"?r=r.check(I.jwt()):o==="emoji"?r=r.check(I.emoji()):o==="nanoid"?r=r.check(I.nanoid()):o==="cuid"?r=r.check(I.cuid()):o==="cuid2"?r=r.check(I.cuid2()):o==="ulid"?r=r.check(I.ulid()):o==="xid"?r=r.check(I.xid()):o==="ksuid"&&(r=r.check(I.ksuid()))}typeof t.minLength=="number"&&(r=r.min(t.minLength)),typeof t.maxLength=="number"&&(r=r.max(t.maxLength)),t.pattern&&(r=r.regex(new RegExp(t.pattern))),i=r;break}case"number":case"integer":{let r=n==="integer"?I.number().int():I.number();typeof t.minimum=="number"&&(r=r.min(t.minimum)),typeof t.maximum=="number"&&(r=r.max(t.maximum)),typeof t.exclusiveMinimum=="number"?r=r.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(r=r.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?r=r.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(r=r.lt(t.maximum)),typeof t.multipleOf=="number"&&(r=r.multipleOf(t.multipleOf)),i=r;break}case"boolean":{i=I.boolean();break}case"null":{i=I.null();break}case"object":{let r={},o=t.properties||{},s=new Set(t.required||[]);for(let[u,c]of Object.entries(o)){let l=xe(c,e);r[u]=s.has(u)?l:l.optional()}if(t.propertyNames){let u=xe(t.propertyNames,e),c=t.additionalProperties&&typeof t.additionalProperties=="object"?xe(t.additionalProperties,e):I.any();if(Object.keys(r).length===0){i=I.record(u,c);break}let l=I.object(r).passthrough(),d=I.looseRecord(u,c);i=I.intersection(l,d);break}if(t.patternProperties){let u=t.patternProperties,c=Object.keys(u),l=[];for(let f of c){let h=xe(u[f],e),p=I.string().regex(new RegExp(f));l.push(I.looseRecord(p,h))}let d=[];if(Object.keys(r).length>0&&d.push(I.object(r).passthrough()),d.push(...l),d.length===0)i=I.object({}).passthrough();else if(d.length===1)i=d[0];else{let f=I.intersection(d[0],d[1]);for(let h=2;h<d.length;h++)f=I.intersection(f,d[h]);i=f}break}let a=I.object(r);t.additionalProperties===!1?i=a.strict():typeof t.additionalProperties=="object"?i=a.catchall(xe(t.additionalProperties,e)):i=a.passthrough();break}case"array":{let r=t.prefixItems,o=t.items;if(r&&Array.isArray(r)){let s=r.map(u=>xe(u,e)),a=o&&typeof o=="object"&&!Array.isArray(o)?xe(o,e):void 0;a?i=I.tuple(s).rest(a):i=I.tuple(s),typeof t.minItems=="number"&&(i=i.check(I.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(I.maxLength(t.maxItems)))}else if(Array.isArray(o)){let s=o.map(u=>xe(u,e)),a=t.additionalItems&&typeof t.additionalItems=="object"?xe(t.additionalItems,e):void 0;a?i=I.tuple(s).rest(a):i=I.tuple(s),typeof t.minItems=="number"&&(i=i.check(I.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(I.maxLength(t.maxItems)))}else if(o!==void 0){let s=xe(o,e),a=I.array(s);typeof t.minItems=="number"&&(a=a.min(t.minItems)),typeof t.maxItems=="number"&&(a=a.max(t.maxItems)),i=a}else i=I.array(I.any());break}default:throw new Error(`Unsupported type: ${n}`)}return i}function xe(t,e){if(typeof t=="boolean")return t?I.any():I.never();let n=Nb(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(c=>xe(c,e)),u=I.union(a);n=i?I.intersection(n,u):u}if(t.oneOf&&Array.isArray(t.oneOf)){let a=t.oneOf.map(c=>xe(c,e)),u=I.xor(a);n=i?I.intersection(n,u):u}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)n=i?n:I.any();else{let a=i?n:xe(t.allOf[0],e),u=i?0:1;for(let c=u;c<t.allOf.length;c++)a=I.intersection(a,xe(t.allOf[c],e));n=a}t.nullable===!0&&e.version==="openapi-3.0"&&(n=I.nullable(n)),t.readOnly===!0&&(n=I.readonly(n)),t.default!==void 0&&(n=n.default(t.default));let r={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of o)a in t&&(r[a]=t[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in t&&(r[a]=t[a]);for(let a of Object.keys(t))dT.has(a)||(r[a]=t[a]);return Object.keys(r).length>0&&e.registry.add(n,r),t.description&&(n=n.describe(t.description)),n}function Db(t,e){if(typeof t=="boolean")return t?I.any():I.never();let n;try{n=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=fT(n,e?.defaultTarget),r=n.$defs||n.definitions||{},o={version:i,defs:r,refs:new Map,processing:new Set,rootSchema:n,registry:e?.registry??ve};return xe(n,o)}var I,dT,Lb=v(()=>{ti();ks();si();ui();I={...ai,...Ss,iso:nn},dT=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"])});var Kh={};He(Kh,{bigint:()=>vT,boolean:()=>gT,date:()=>yT,number:()=>mT,string:()=>pT});function pT(t){return gd(an,t)}function mT(t){return Sd(cn,t)}function gT(t){return Pd(ln,t)}function vT(t){return zd(dn,t)}function yT(t){return Bd(mi,t)}var Ub=v(()=>{Ze();ui()});var me={};He(me,{$brand:()=>Uu,$input:()=>pd,$output:()=>hd,NEVER:()=>Lu,TimePrecision:()=>yd,ZodAny:()=>lh,ZodArray:()=>ph,ZodBase64:()=>Gs,ZodBase64URL:()=>Ws,ZodBigInt:()=>dn,ZodBigIntFormat:()=>Js,ZodBoolean:()=>ln,ZodCIDRv4:()=>Zs,ZodCIDRv6:()=>Bs,ZodCUID:()=>Ds,ZodCUID2:()=>Ls,ZodCatch:()=>Dh,ZodCodec:()=>bi,ZodCustom:()=>$i,ZodCustomStringFormat:()=>un,ZodDate:()=>mi,ZodDefault:()=>Ah,ZodDiscriminatedUnion:()=>gh,ZodE164:()=>qs,ZodEmail:()=>zs,ZodEmoji:()=>Rs,ZodEnum:()=>sn,ZodError:()=>sT,ZodExactOptional:()=>Ih,ZodFile:()=>kh,ZodFirstPartyTypeKind:()=>Jh,ZodFunction:()=>Wh,ZodGUID:()=>li,ZodIPv4:()=>Fs,ZodIPv6:()=>Vs,ZodISODate:()=>Is,ZodISODateTime:()=>Es,ZodISODuration:()=>Os,ZodISOTime:()=>Ts,ZodIntersection:()=>vh,ZodIssueCode:()=>uT,ZodJWT:()=>Hs,ZodKSUID:()=>Ms,ZodLazy:()=>Zh,ZodLiteral:()=>Sh,ZodMAC:()=>nh,ZodMap:()=>xh,ZodNaN:()=>Uh,ZodNanoID:()=>Ns,ZodNever:()=>fh,ZodNonOptional:()=>ta,ZodNull:()=>uh,ZodNullable:()=>Oh,ZodNumber:()=>cn,ZodNumberFormat:()=>fr,ZodObject:()=>vi,ZodOptional:()=>ea,ZodPipe:()=>_i,ZodPrefault:()=>Ch,ZodPreprocess:()=>jh,ZodPromise:()=>Gh,ZodReadonly:()=>Mh,ZodRealError:()=>De,ZodRecord:()=>on,ZodSet:()=>wh,ZodString:()=>an,ZodStringFormat:()=>J,ZodSuccess:()=>Nh,ZodSymbol:()=>sh,ZodTemplateLiteral:()=>Vh,ZodTransform:()=>Eh,ZodTuple:()=>_h,ZodType:()=>j,ZodULID:()=>Us,ZodURL:()=>pi,ZodUUID:()=>ht,ZodUndefined:()=>ah,ZodUnion:()=>yi,ZodUnknown:()=>dh,ZodVoid:()=>hh,ZodXID:()=>js,ZodXor:()=>mh,_ZodString:()=>Cs,_default:()=>Ph,_function:()=>kb,any:()=>rb,array:()=>gi,base64:()=>j_,base64url:()=>M_,bigint:()=>Y_,boolean:()=>oh,catch:()=>Lh,check:()=>Eb,cidrv4:()=>L_,cidrv6:()=>U_,clone:()=>Ee,codec:()=>$b,coerce:()=>Kh,config:()=>oe,core:()=>xt,cuid:()=>O_,cuid2:()=>A_,custom:()=>Ib,date:()=>ib,decode:()=>Jf,decodeAsync:()=>Yf,describe:()=>Tb,discriminatedUnion:()=>lb,e164:()=>F_,email:()=>__,emoji:()=>I_,encode:()=>Hf,encodeAsync:()=>Kf,endsWith:()=>Hr,enum:()=>Xs,exactOptional:()=>Th,file:()=>vb,flattenError:()=>Gn,float32:()=>q_,float64:()=>H_,formatError:()=>Wn,fromJSONSchema:()=>Db,function:()=>kb,getErrorMap:()=>lT,globalRegistry:()=>ve,gt:()=>dt,gte:()=>Te,guid:()=>b_,hash:()=>W_,hex:()=>G_,hostname:()=>B_,httpUrl:()=>E_,includes:()=>Wr,instanceof:()=>Ab,int:()=>As,int32:()=>J_,int64:()=>X_,intersection:()=>yh,invertCodec:()=>xb,ipv4:()=>R_,ipv6:()=>D_,iso:()=>nn,json:()=>Cb,jwt:()=>V_,keyof:()=>ob,ksuid:()=>z_,lazy:()=>Bh,length:()=>lr,literal:()=>gb,locales:()=>ei,looseObject:()=>ub,looseRecord:()=>fb,lowercase:()=>Br,lt:()=>lt,lte:()=>Ve,mac:()=>N_,map:()=>hb,maxLength:()=>cr,maxSize:()=>jt,meta:()=>Ob,mime:()=>Jr,minLength:()=>$t,minSize:()=>ft,multipleOf:()=>Ut,nan:()=>bb,nanoid:()=>T_,nativeEnum:()=>mb,negative:()=>ms,never:()=>Ks,nonnegative:()=>vs,nonoptional:()=>Rh,nonpositive:()=>gs,normalize:()=>Kr,null:()=>ch,nullable:()=>fi,nullish:()=>yb,number:()=>ih,object:()=>sb,optional:()=>di,overwrite:()=>st,parse:()=>Bf,parseAsync:()=>Gf,partialRecord:()=>db,pipe:()=>Ps,positive:()=>ps,prefault:()=>zh,preprocess:()=>zb,prettifyError:()=>Yu,promise:()=>Sb,property:()=>ys,readonly:()=>Fh,record:()=>$h,refine:()=>qh,regex:()=>Zr,regexes:()=>Fe,registry:()=>qo,safeDecode:()=>Qf,safeDecodeAsync:()=>th,safeEncode:()=>Xf,safeEncodeAsync:()=>eh,safeParse:()=>Wf,safeParseAsync:()=>qf,set:()=>pb,setErrorMap:()=>cT,size:()=>ur,slugify:()=>en,startsWith:()=>qr,strictObject:()=>ab,string:()=>ci,stringFormat:()=>Z_,stringbool:()=>Pb,success:()=>_b,superRefine:()=>Hh,symbol:()=>eb,templateLiteral:()=>wb,toJSONSchema:()=>xs,toLowerCase:()=>Xr,toUpperCase:()=>Qr,transform:()=>Qs,treeifyError:()=>Ku,trim:()=>Yr,tuple:()=>bh,uint32:()=>K_,uint64:()=>Q_,ulid:()=>P_,undefined:()=>tb,union:()=>Ys,unknown:()=>dr,uppercase:()=>Gr,url:()=>k_,util:()=>x,uuid:()=>$_,uuidv4:()=>x_,uuidv6:()=>w_,uuidv7:()=>S_,void:()=>nb,xid:()=>C_,xor:()=>cb});var Yh=v(()=>{Ze();ui();ks();Zf();rh();Rb();Ze();cd();Ze();oi();Lb();fd();si();si();Ub();oe(Zo())});var jb=v(()=>{Yh();Yh()});var _T,ra,hr,Mb=v(()=>{"use strict";jb();_T=me.enum(["debug","info","warn","error"]),ra=me.object({provider:me.string(),model:me.string(),gateway:me.string().nullable().optional()}),hr=me.object({version:me.number().default(1),routes:me.object({stt:ra.optional(),tts:ra.optional(),text:ra.optional(),embedding:ra.optional()}).optional(),secrets:me.record(me.string(),me.string()).optional(),defaults:me.object({logLevel:_T.default("info"),modality:me.enum(["voice","text"]).default("voice")}).default({logLevel:"info",modality:"voice"}),upgrade:me.object({auto:me.boolean().default(!1)}).default({auto:!1})})});var Ae=v(()=>{"use strict";Lg();Ug();Du();Mb()});import{mkdirSync as bT}from"node:fs";import{homedir as $T}from"node:os";import{join as Fb,resolve as xT}from"node:path";var Xh,Be,pr=v(()=>{"use strict";Du();Xh=class{dirName=".jarvis";dir(){let e=process.env[jg]?.trim();return e?xT(e):Fb($T(),this.dirName)}resolve(...e){return Fb(this.dir(),...e)}ensureDir(){let e=this.dir();return bT(e,{recursive:!0,mode:448}),e}},Be=new Xh});import{chmodSync as wT,existsSync as ST,readFileSync as kT,writeFileSync as ET}from"node:fs";function Zb(t){switch(t){case"debug":case"info":case"warn":case"error":return t;default:return}}var Vb,mr,Qh=v(()=>{"use strict";Ae();pr();Vb="config.json",mr=class t{home;config;constructor(e=Be){this.home=e,this.config=this.load()}configPath(){return this.home.resolve(Vb)}load(){let e=this.configPath(),n=ST(e)?this.readFile(e):{},i=hr.safeParse(n);if(!i.success)throw new Error(`invalid Jarvis config at ${e}: ${i.error.message}`);return i.data}readFile(e){let n;try{n=kT(e,"utf8")}catch(i){throw new Error(`could not read Jarvis config at ${e}`,{cause:i})}try{return JSON.parse(n)}catch(i){throw new Error(`Jarvis config at ${e} is not valid JSON`,{cause:i})}}resolved(){return this.config}get logLevel(){return Zb(process.env.JARVIS_LOG_LEVEL)??Zb(process.env.LOG_LEVEL)??this.config.defaults.logLevel}secret(e){return this.config.secrets?.[e]}save(e){t.persist(this.home,e)}static persist(e,n){let i=hr.parse(n);e.ensureDir();let r=e.resolve(Vb);ET(r,JSON.stringify(i,null,2)+`
68
- `,{mode:384}),wT(r,384)}}});function PT(t,e){let n=t;for(let i of e){if(n===null||typeof n!="object")return;n=n[i]}return n}function CT(t,e,n){let i=t;for(let r=0;r<e.length-1;r++){let o=e[r],s=i[o];(s===null||typeof s!="object")&&(i[o]={}),i=i[o]}i[e[e.length-1]]=n}function zT(t,e){let n=t;for(let r=0;r<e.length-1;r++){let o=n[e[r]];if(o===null||typeof o!="object")return!1;n=o}let i=e[e.length-1];return i in n?(delete n[i],!0):!1}var IT,TT,OT,AT,Ge,ep=v(()=>{"use strict";Ae();pr();Qh();IT="<set>",TT=new Set(["upgrade.auto"]),OT=new Set(["version"]),AT=new Set(["__proto__","prototype","constructor"]),Ge=class{home;constructor(e=Be){this.home=e}freshResolver(){return new mr(this.home)}resolved(){return this.freshResolver().resolved()}list(){return this.redact(this.freshResolver().resolved())}get(e){return PT(this.list(),this.parsePath(e))}set(e,n){let i=this.parsePath(e);this.assertMutable(e);let r=this.freshResolver(),o=structuredClone(r.resolved());CT(o,i,this.coerce(e,n)),r.save(this.validate(o,e))}unset(e){let n=this.parsePath(e);this.assertMutable(e);let i=this.freshResolver(),r=structuredClone(i.resolved());if(!zT(r,n))throw new Error(`nothing to unset: '${e}' is not set`);i.save(this.validate(r,e))}write(e){mr.persist(this.home,e)}validate(e,n){let i=hr.safeParse(e);if(i.success)return i.data;let r=i.error.issues.map(s=>`${s.path.join(".")}: ${s.message}`).join("; "),o=n.startsWith("routes.")?" A route needs both a provider and a model - run 'jarvis init' to configure one.":"";throw new Error(`'${n}' would make the config invalid (${r}).${o}`)}coerce(e,n){if(TT.has(e)){if(n==="true")return!0;if(n==="false")return!1;throw new Error(`'${e}' expects 'true' or 'false', got '${n}'`)}return n}assertMutable(e){if(OT.has(e))throw new Error(`'${e}' is managed by Jarvis and cannot be changed`)}parsePath(e){let n=e.split(".");if(e.length===0||n.some(i=>i.length===0||AT.has(i)))throw new Error(`invalid config path: '${e}'`);return n}redact(e){let n=structuredClone(e);if(n.secrets)for(let i of Object.keys(n.secrets))n.secrets[i]=IT;return n}}});async function*Gb(t,e={}){let{signal:n,idleTimeoutMs:i}=e,r=t.getReader(),o=new TextDecoder,s="",a=[];try{for(;;){let{value:u,done:c}=await RT(r,n,i);if(c)break;s+=o.decode(u,{stream:!0});let l;for(;(l=s.indexOf(`
67
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of t.seen.entries()){let a=s[1];if(e===s[0]){o(s);continue}if(t.external){let c=t.external.registry.get(s[0])?.id;if(e!==s[0]&&c){o(s);continue}}if(t.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}if(a.count>1&&t.reused==="ref"){o(s);continue}}}function Zt(t,e){let n=t.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=a=>{let u=t.seen.get(a);if(u.ref===null)return;let c=u.def??u.schema,l={...c},d=u.ref;if(u.ref=null,d){i(d);let f=t.seen.get(d),p=f.schema;if(p.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(p)):Object.assign(c,p),Object.assign(c,l),a._zod.parent===d)for(let S in c)S==="$ref"||S==="allOf"||S in l||delete c[S];if(p.$ref&&f.def)for(let S in c)S==="$ref"||S==="allOf"||S in f.def&&JSON.stringify(c[S])===JSON.stringify(f.def[S])&&delete c[S]}let h=a._zod.parent;if(h&&h!==d){i(h);let f=t.seen.get(h);if(f?.schema.$ref&&(c.$ref=f.schema.$ref,f.def))for(let p in c)p==="$ref"||p==="allOf"||p in f.def&&JSON.stringify(c[p])===JSON.stringify(f.def[p])&&delete c[p]}t.override({zodSchema:a,jsonSchema:c,path:u.path??[]})};for(let a of[...t.seen.entries()].reverse())i(a[0]);let r={};if(t.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?r.$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");r.$id=t.external.uri(a)}Object.assign(r,n.def??n.schema);let o=t.metadataRegistry.get(e)?.id;o!==void 0&&r.id===o&&delete r.id;let s=t.external?.defs??{};for(let a of t.seen.entries()){let u=a[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,s[u.defId]=u.def)}t.external||Object.keys(s).length>0&&(t.target==="draft-2020-12"?r.$defs=s:r.definitions=s);try{let a=JSON.parse(JSON.stringify(r));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:nn(e,"input",t.processors),output:nn(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Ae(t,e){let n=e??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let i=t._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Ae(i.element,n);if(i.type==="set")return Ae(i.valueType,n);if(i.type==="lazy")return Ae(i.getter(),n);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return Ae(i.innerType,n);if(i.type==="intersection")return Ae(i.left,n)||Ae(i.right,n);if(i.type==="record"||i.type==="map")return Ae(i.keyType,n)||Ae(i.valueType,n);if(i.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Ae(i.in,n)||Ae(i.out,n);if(i.type==="object"){for(let r in i.shape)if(Ae(i.shape[r],n))return!0;return!1}if(i.type==="union"){for(let r of i.options)if(Ae(r,n))return!0;return!1}if(i.type==="tuple"){for(let r of i.items)if(Ae(r,n))return!0;return!!(i.rest&&Ae(i.rest,n))}return!1}var hh,nn,li=v(()=>{ai();hh=(t,e={})=>n=>{let i=Ft({...n,processors:e});return W(t,i),Vt(i,t),Zt(i,t)},nn=(t,e,n={})=>i=>{let{libraryOptions:r,target:o}=i??{},s=Ft({...r??{},target:o,io:e,processors:n});return W(t,s),Vt(s,t),Zt(s,t)}});function Os(t,e){if("_idmap"in t){let i=t,r=Ft({...e,processors:Es}),o={};for(let u of i._idmap.entries()){let[c,l]=u;W(l,r)}let s={},a={registry:i,uri:e?.uri,defs:o};r.external=a;for(let u of i._idmap.entries()){let[c,l]=u;Vt(r,l),s[c]=Zt(r,l)}if(Object.keys(o).length>0){let u=r.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[u]:o}}return{schemas:s}}let n=Ft({...e,processors:Es});return W(t,n),Vt(n,t),Zt(n,t)}var hT,fh,ph,mh,gh,vh,yh,_h,bh,$h,xh,wh,Sh,kh,Eh,Ih,Th,Oh,Ah,Ph,Ch,Rh,zh,Nh,Dh,Lh,Is,Uh,jh,Mh,Fh,Vh,Zh,Bh,Gh,Wh,qh,Hh,Ts,Jh,Es,di=v(()=>{li();z();hT={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},fh=(t,e,n,i)=>{let r=n;r.type="string";let{minimum:o,maximum:s,format:a,patterns:u,contentEncoding:c}=t._zod.bag;if(typeof o=="number"&&(r.minLength=o),typeof s=="number"&&(r.maxLength=s),a&&(r.format=hT[a]??a,r.format===""&&delete r.format,a==="time"&&delete r.format),c&&(r.contentEncoding=c),u&&u.size>0){let l=[...u];l.length===1?r.pattern=l[0].source:l.length>1&&(r.allOf=[...l.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},ph=(t,e,n,i)=>{let r=n,{minimum:o,maximum:s,format:a,multipleOf:u,exclusiveMaximum:c,exclusiveMinimum:l}=t._zod.bag;typeof a=="string"&&a.includes("int")?r.type="integer":r.type="number";let d=typeof l=="number"&&l>=(o??Number.NEGATIVE_INFINITY),h=typeof c=="number"&&c<=(s??Number.POSITIVE_INFINITY),f=e.target==="draft-04"||e.target==="openapi-3.0";d?f?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l:typeof o=="number"&&(r.minimum=o),h?f?(r.maximum=c,r.exclusiveMaximum=!0):r.exclusiveMaximum=c:typeof s=="number"&&(r.maximum=s),typeof u=="number"&&(r.multipleOf=u)},mh=(t,e,n,i)=>{n.type="boolean"},gh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},vh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},yh=(t,e,n,i)=>{e.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},_h=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},bh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},$h=(t,e,n,i)=>{n.not={}},xh=(t,e,n,i)=>{},wh=(t,e,n,i)=>{},Sh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},kh=(t,e,n,i)=>{let r=t._zod.def,o=Gn(r.entries);o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),n.enum=o},Eh=(t,e,n,i)=>{let r=t._zod.def,o=[];for(let s of r.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];n.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?n.enum=[s]:n.const=s}else o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),o.every(s=>typeof s=="boolean")&&(n.type="boolean"),o.every(s=>s===null)&&(n.type="null"),n.enum=o},Ih=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Th=(t,e,n,i)=>{let r=n,o=t._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=o.source},Oh=(t,e,n,i)=>{let r=n,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:u}=t._zod.bag;s!==void 0&&(o.minLength=s),a!==void 0&&(o.maxLength=a),u?u.length===1?(o.contentMediaType=u[0],Object.assign(r,o)):(Object.assign(r,o),r.anyOf=u.map(c=>({contentMediaType:c}))):Object.assign(r,o)},Ah=(t,e,n,i)=>{n.type="boolean"},Ph=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Ch=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Rh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},zh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Nh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Dh=(t,e,n,i)=>{let r=n,o=t._zod.def,{minimum:s,maximum:a}=t._zod.bag;typeof s=="number"&&(r.minItems=s),typeof a=="number"&&(r.maxItems=a),r.type="array",r.items=W(o.element,e,{...i,path:[...i.path,"items"]})},Lh=(t,e,n,i)=>{let r=n,o=t._zod.def;r.type="object",r.properties={};let s=o.shape;for(let c in s)r.properties[c]=W(s[c],e,{...i,path:[...i.path,"properties",c]});let a=new Set(Object.keys(s)),u=new Set([...a].filter(c=>{let l=o.shape[c]._zod;return e.io==="input"?l.optin===void 0:l.optout===void 0}));u.size>0&&(r.required=Array.from(u)),o.catchall?._zod.def.type==="never"?r.additionalProperties=!1:o.catchall?o.catchall&&(r.additionalProperties=W(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(r.additionalProperties=!1)},Is=(t,e,n,i)=>{let r=t._zod.def,o=r.inclusive===!1,s=r.options.map((a,u)=>W(a,e,{...i,path:[...i.path,o?"oneOf":"anyOf",u]}));o?n.oneOf=s:n.anyOf=s},Uh=(t,e,n,i)=>{let r=t._zod.def,o=W(r.left,e,{...i,path:[...i.path,"allOf",0]}),s=W(r.right,e,{...i,path:[...i.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,u=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];n.allOf=u},jh=(t,e,n,i)=>{let r=n,o=t._zod.def;r.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",u=o.items.map((h,f)=>W(h,e,{...i,path:[...i.path,s,f]})),c=o.rest?W(o.rest,e,{...i,path:[...i.path,a,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null;e.target==="draft-2020-12"?(r.prefixItems=u,c&&(r.items=c)):e.target==="openapi-3.0"?(r.items={anyOf:u},c&&r.items.anyOf.push(c),r.minItems=u.length,c||(r.maxItems=u.length)):(r.items=u,c&&(r.additionalItems=c));let{minimum:l,maximum:d}=t._zod.bag;typeof l=="number"&&(r.minItems=l),typeof d=="number"&&(r.maxItems=d)},Mh=(t,e,n,i)=>{let r=n,o=t._zod.def;r.type="object";let s=o.keyType,u=s._zod.bag?.patterns;if(o.mode==="loose"&&u&&u.size>0){let l=W(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});r.patternProperties={};for(let d of u)r.patternProperties[d.source]=l}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(r.propertyNames=W(o.keyType,e,{...i,path:[...i.path,"propertyNames"]})),r.additionalProperties=W(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]});let c=s._zod.values;if(c){let l=[...c].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(r.required=l)}},Fh=(t,e,n,i)=>{let r=t._zod.def,o=W(r.innerType,e,i),s=e.seen.get(t);e.target==="openapi-3.0"?(s.ref=r.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},Vh=(t,e,n,i)=>{let r=t._zod.def;W(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},Zh=(t,e,n,i)=>{let r=t._zod.def;W(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType,n.default=JSON.parse(JSON.stringify(r.defaultValue))},Bh=(t,e,n,i)=>{let r=t._zod.def;W(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType,e.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},Gh=(t,e,n,i)=>{let r=t._zod.def;W(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType;let s;try{s=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s},Wh=(t,e,n,i)=>{let r=t._zod.def,o=r.in._zod.traits.has("$ZodTransform"),s=e.io==="input"?o?r.out:r.in:r.out;W(s,e,i);let a=e.seen.get(t);a.ref=s},qh=(t,e,n,i)=>{let r=t._zod.def;W(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType,n.readOnly=!0},Hh=(t,e,n,i)=>{let r=t._zod.def;W(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},Ts=(t,e,n,i)=>{let r=t._zod.def;W(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},Jh=(t,e,n,i)=>{let r=t._zod.innerType;W(r,e,i);let o=e.seen.get(t);o.ref=r},Es={string:fh,number:ph,boolean:mh,bigint:gh,symbol:vh,null:yh,undefined:_h,void:bh,never:$h,any:xh,unknown:wh,date:Sh,enum:kh,literal:Eh,nan:Ih,template_literal:Th,file:Oh,success:Ah,custom:Ph,function:Ch,transform:Rh,map:zh,set:Nh,array:Dh,object:Lh,union:Is,intersection:Uh,tuple:jh,record:Mh,nullable:Fh,nonoptional:Vh,default:Zh,prefault:Bh,catch:Gh,pipe:Wh,readonly:qh,promise:Hh,optional:Ts,lazy:Jh}});var As,$_=v(()=>{di();li();As=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 n=e?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=Ft({processors:Es,target:n,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,n={path:[],schemaPath:[]}){return W(e,this.ctx,n)}emit(e,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),Vt(this.ctx,e);let i=Zt(this.ctx,e),{"~standard":r,...o}=i;return o}}});var x_={};var w_=v(()=>{});var wt={};He(wt,{$ZodAny:()=>Vl,$ZodArray:()=>ql,$ZodAsyncError:()=>ot,$ZodBase64:()=>Cl,$ZodBase64URL:()=>Rl,$ZodBigInt:()=>Wo,$ZodBigIntFormat:()=>Ul,$ZodBoolean:()=>ri,$ZodCIDRv4:()=>Ol,$ZodCIDRv6:()=>Al,$ZodCUID:()=>vl,$ZodCUID2:()=>yl,$ZodCatch:()=>dd,$ZodCheck:()=>X,$ZodCheckBigIntFormat:()=>Gc,$ZodCheckEndsWith:()=>nl,$ZodCheckGreaterThan:()=>jo,$ZodCheckIncludes:()=>tl,$ZodCheckLengthEquals:()=>Yc,$ZodCheckLessThan:()=>Uo,$ZodCheckLowerCase:()=>Qc,$ZodCheckMaxLength:()=>Jc,$ZodCheckMaxSize:()=>Wc,$ZodCheckMimeType:()=>ol,$ZodCheckMinLength:()=>Kc,$ZodCheckMinSize:()=>qc,$ZodCheckMultipleOf:()=>Zc,$ZodCheckNumberFormat:()=>Bc,$ZodCheckOverwrite:()=>sl,$ZodCheckProperty:()=>il,$ZodCheckRegex:()=>Xc,$ZodCheckSizeEquals:()=>Hc,$ZodCheckStartsWith:()=>rl,$ZodCheckStringFormat:()=>Vr,$ZodCheckUpperCase:()=>el,$ZodCodec:()=>ii,$ZodCustom:()=>_d,$ZodCustomStringFormat:()=>Dl,$ZodDate:()=>Wl,$ZodDefault:()=>ad,$ZodDiscriminatedUnion:()=>Kl,$ZodE164:()=>zl,$ZodEmail:()=>fl,$ZodEmoji:()=>ml,$ZodEncodeError:()=>zt,$ZodEnum:()=>td,$ZodError:()=>Kn,$ZodExactOptional:()=>od,$ZodFile:()=>nd,$ZodFunction:()=>gd,$ZodGUID:()=>dl,$ZodIPv4:()=>El,$ZodIPv6:()=>Il,$ZodISODate:()=>wl,$ZodISODateTime:()=>xl,$ZodISODuration:()=>kl,$ZodISOTime:()=>Sl,$ZodIntersection:()=>Yl,$ZodJWT:()=>Nl,$ZodKSUID:()=>$l,$ZodLazy:()=>yd,$ZodLiteral:()=>rd,$ZodMAC:()=>Tl,$ZodMap:()=>Ql,$ZodNaN:()=>hd,$ZodNanoID:()=>gl,$ZodNever:()=>Bl,$ZodNonOptional:()=>cd,$ZodNull:()=>Fl,$ZodNullable:()=>sd,$ZodNumber:()=>Go,$ZodNumberFormat:()=>Ll,$ZodObject:()=>wv,$ZodObjectJIT:()=>Hl,$ZodOptional:()=>Ho,$ZodPipe:()=>Jo,$ZodPrefault:()=>ud,$ZodPreprocess:()=>fd,$ZodPromise:()=>vd,$ZodReadonly:()=>pd,$ZodRealError:()=>Ne,$ZodRecord:()=>Xl,$ZodRegistry:()=>Qo,$ZodSet:()=>ed,$ZodString:()=>ar,$ZodStringFormat:()=>H,$ZodSuccess:()=>ld,$ZodSymbol:()=>jl,$ZodTemplateLiteral:()=>md,$ZodTransform:()=>id,$ZodTuple:()=>qo,$ZodType:()=>L,$ZodULID:()=>_l,$ZodURL:()=>pl,$ZodUUID:()=>hl,$ZodUndefined:()=>Ml,$ZodUnion:()=>ni,$ZodUnknown:()=>Zl,$ZodVoid:()=>Gl,$ZodXID:()=>bl,$ZodXor:()=>Jl,$brand:()=>Ku,$constructor:()=>m,$input:()=>Ed,$output:()=>kd,Doc:()=>ti,JSONSchema:()=>x_,JSONSchemaGenerator:()=>As,NEVER:()=>Ju,TimePrecision:()=>Ad,_any:()=>Yd,_array:()=>ih,_base64:()=>vs,_base64url:()=>ys,_bigint:()=>Bd,_boolean:()=>Vd,_catch:()=>sT,_check:()=>__,_cidrv4:()=>ms,_cidrv6:()=>gs,_coercedBigint:()=>Gd,_coercedBoolean:()=>Zd,_coercedDate:()=>rh,_coercedNumber:()=>Dd,_coercedString:()=>Td,_cuid:()=>us,_cuid2:()=>cs,_custom:()=>sh,_date:()=>th,_decode:()=>To,_decodeAsync:()=>Ao,_default:()=>nT,_discriminatedUnion:()=>G1,_e164:()=>_s,_email:()=>ts,_emoji:()=>ss,_encode:()=>Io,_encodeAsync:()=>Oo,_endsWith:()=>Jr,_enum:()=>Y1,_file:()=>oh,_float32:()=>Ud,_float64:()=>jd,_gt:()=>dt,_gte:()=>Oe,_guid:()=>ui,_includes:()=>qr,_int:()=>Ld,_int32:()=>Md,_int64:()=>Wd,_intersection:()=>W1,_ipv4:()=>fs,_ipv6:()=>ps,_isoDate:()=>Cd,_isoDateTime:()=>Pd,_isoDuration:()=>zd,_isoTime:()=>Rd,_jwt:()=>bs,_ksuid:()=>hs,_lazy:()=>lT,_length:()=>lr,_literal:()=>Q1,_lowercase:()=>Gr,_lt:()=>lt,_lte:()=>Ze,_mac:()=>Od,_map:()=>J1,_max:()=>Ze,_maxLength:()=>cr,_maxSize:()=>Mt,_mime:()=>Kr,_min:()=>Oe,_minLength:()=>xt,_minSize:()=>ht,_multipleOf:()=>jt,_nan:()=>nh,_nanoid:()=>as,_nativeEnum:()=>X1,_negative:()=>xs,_never:()=>Qd,_nonnegative:()=>Ss,_nonoptional:()=>iT,_nonpositive:()=>ws,_normalize:()=>Yr,_null:()=>Kd,_nullable:()=>rT,_number:()=>Nd,_optional:()=>tT,_overwrite:()=>st,_parse:()=>Ur,_parseAsync:()=>jr,_pipe:()=>aT,_positive:()=>$s,_promise:()=>dT,_property:()=>ks,_readonly:()=>uT,_record:()=>H1,_refine:()=>ah,_regex:()=>Br,_safeDecode:()=>Co,_safeDecodeAsync:()=>zo,_safeEncode:()=>Po,_safeEncodeAsync:()=>Ro,_safeParse:()=>Mr,_safeParseAsync:()=>Fr,_set:()=>K1,_size:()=>ur,_slugify:()=>tn,_startsWith:()=>Hr,_string:()=>Id,_stringFormat:()=>rn,_stringbool:()=>dh,_success:()=>oT,_superRefine:()=>uh,_symbol:()=>Hd,_templateLiteral:()=>cT,_toLowerCase:()=>Qr,_toUpperCase:()=>en,_transform:()=>eT,_trim:()=>Xr,_tuple:()=>q1,_uint32:()=>Fd,_uint64:()=>qd,_ulid:()=>ls,_undefined:()=>Jd,_union:()=>Z1,_unknown:()=>Xd,_uppercase:()=>Wr,_url:()=>ci,_uuid:()=>rs,_uuidv4:()=>ns,_uuidv6:()=>is,_uuidv7:()=>os,_void:()=>eh,_xid:()=>ds,_xor:()=>B1,clone:()=>Ie,config:()=>oe,createStandardJSONSchemaMethod:()=>nn,createToJSONSchemaMethod:()=>hh,decode:()=>dI,decodeAsync:()=>fI,describe:()=>ch,encode:()=>lI,encodeAsync:()=>hI,extractDefs:()=>Vt,finalize:()=>Zt,flattenError:()=>Yn,formatError:()=>Xn,globalConfig:()=>nr,globalRegistry:()=>ve,initializeContext:()=>Ft,isValidBase64:()=>Pl,isValidBase64URL:()=>_v,isValidJWT:()=>bv,locales:()=>si,meta:()=>lh,parse:()=>ko,parseAsync:()=>Eo,prettifyError:()=>cc,process:()=>W,regexes:()=>Ve,registry:()=>es,safeDecode:()=>mI,safeDecodeAsync:()=>vI,safeEncode:()=>pI,safeEncodeAsync:()=>gI,safeParse:()=>dc,safeParseAsync:()=>hc,toDotPath:()=>Xg,toJSONSchema:()=>Os,treeifyError:()=>uc,util:()=>x,version:()=>ul});var Be=v(()=>{ir();fc();lc();bd();Mo();cl();z();Lo();Sd();ai();al();b_();li();di();$_();w_()});var Ps={};He(Ps,{endsWith:()=>Jr,gt:()=>dt,gte:()=>Oe,includes:()=>qr,length:()=>lr,lowercase:()=>Gr,lt:()=>lt,lte:()=>Ze,maxLength:()=>cr,maxSize:()=>Mt,mime:()=>Kr,minLength:()=>xt,minSize:()=>ht,multipleOf:()=>jt,negative:()=>xs,nonnegative:()=>Ss,nonpositive:()=>ws,normalize:()=>Yr,overwrite:()=>st,positive:()=>$s,property:()=>ks,regex:()=>Br,size:()=>ur,slugify:()=>tn,startsWith:()=>Hr,toLowerCase:()=>Qr,toUpperCase:()=>en,trim:()=>Xr,uppercase:()=>Wr});var Cs=v(()=>{Be()});var on={};He(on,{ZodISODate:()=>zs,ZodISODateTime:()=>Rs,ZodISODuration:()=>Ds,ZodISOTime:()=>Ns,date:()=>Yh,datetime:()=>Kh,duration:()=>Qh,time:()=>Xh});function Kh(t){return Pd(Rs,t)}function Yh(t){return Cd(zs,t)}function Xh(t){return Rd(Ns,t)}function Qh(t){return zd(Ds,t)}var Rs,zs,Ns,Ds,hi=v(()=>{Be();pi();Rs=m("ZodISODateTime",(t,e)=>{xl.init(t,e),J.init(t,e)});zs=m("ZodISODate",(t,e)=>{wl.init(t,e),J.init(t,e)});Ns=m("ZodISOTime",(t,e)=>{Sl.init(t,e),J.init(t,e)});Ds=m("ZodISODuration",(t,e)=>{kl.init(t,e),J.init(t,e)})});var S_,pT,De,ef=v(()=>{Be();Be();z();S_=(t,e)=>{Kn.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>Xn(t,n)},flatten:{value:n=>Yn(t,n)},addIssue:{value:n=>{t.issues.push(n),t.message=JSON.stringify(t.issues,Nr,2)}},addIssues:{value:n=>{t.issues.push(...n),t.message=JSON.stringify(t.issues,Nr,2)}},isEmpty:{get(){return t.issues.length===0}}})},pT=m("ZodError",S_),De=m("ZodError",S_,{Parent:Error})});var tf,rf,nf,of,sf,af,uf,cf,lf,df,hf,ff,pf=v(()=>{Be();ef();tf=Ur(De),rf=jr(De),nf=Mr(De),of=Fr(De),sf=Io(De),af=To(De),uf=Oo(De),cf=Ao(De),lf=Po(De),df=Co(De),hf=Ro(De),ff=zo(De)});var fi={};He(fi,{ZodAny:()=>xf,ZodArray:()=>Ef,ZodBase64:()=>Xs,ZodBase64URL:()=>Qs,ZodBigInt:()=>hn,ZodBigIntFormat:()=>ra,ZodBoolean:()=>dn,ZodCIDRv4:()=>Ks,ZodCIDRv6:()=>Ys,ZodCUID:()=>Zs,ZodCUID2:()=>Bs,ZodCatch:()=>Hf,ZodCodec:()=>Ei,ZodCustom:()=>Ii,ZodCustomStringFormat:()=>cn,ZodDate:()=>$i,ZodDefault:()=>Vf,ZodDiscriminatedUnion:()=>Tf,ZodE164:()=>ea,ZodEmail:()=>Ms,ZodEmoji:()=>Fs,ZodEnum:()=>an,ZodExactOptional:()=>jf,ZodFile:()=>Lf,ZodFunction:()=>ip,ZodGUID:()=>gi,ZodIPv4:()=>Hs,ZodIPv6:()=>Js,ZodIntersection:()=>Of,ZodJWT:()=>ta,ZodKSUID:()=>qs,ZodLazy:()=>tp,ZodLiteral:()=>Df,ZodMAC:()=>mf,ZodMap:()=>zf,ZodNaN:()=>Kf,ZodNanoID:()=>Vs,ZodNever:()=>Sf,ZodNonOptional:()=>ua,ZodNull:()=>bf,ZodNullable:()=>Ff,ZodNumber:()=>ln,ZodNumberFormat:()=>hr,ZodObject:()=>wi,ZodOptional:()=>aa,ZodPipe:()=>ki,ZodPrefault:()=>Bf,ZodPreprocess:()=>Yf,ZodPromise:()=>np,ZodReadonly:()=>Xf,ZodRecord:()=>sn,ZodSet:()=>Nf,ZodString:()=>un,ZodStringFormat:()=>J,ZodSuccess:()=>qf,ZodSymbol:()=>yf,ZodTemplateLiteral:()=>ep,ZodTransform:()=>Uf,ZodTuple:()=>Pf,ZodType:()=>j,ZodULID:()=>Gs,ZodURL:()=>bi,ZodUUID:()=>ft,ZodUndefined:()=>_f,ZodUnion:()=>Si,ZodUnknown:()=>wf,ZodVoid:()=>kf,ZodXID:()=>Ws,ZodXor:()=>If,_ZodString:()=>js,_default:()=>Zf,_function:()=>Cb,any:()=>cb,array:()=>xi,base64:()=>W_,base64url:()=>q_,bigint:()=>ib,boolean:()=>vf,catch:()=>Jf,check:()=>Rb,cidrv4:()=>B_,cidrv6:()=>G_,codec:()=>Tb,cuid:()=>D_,cuid2:()=>L_,custom:()=>zb,date:()=>db,describe:()=>Nb,discriminatedUnion:()=>vb,e164:()=>H_,email:()=>E_,emoji:()=>z_,enum:()=>oa,exactOptional:()=>Mf,file:()=>Sb,float32:()=>eb,float64:()=>tb,function:()=>Cb,guid:()=>I_,hash:()=>Q_,hex:()=>X_,hostname:()=>Y_,httpUrl:()=>R_,instanceof:()=>Lb,int:()=>Ls,int32:()=>rb,int64:()=>ob,intersection:()=>Af,invertCodec:()=>Ob,ipv4:()=>F_,ipv6:()=>Z_,json:()=>jb,jwt:()=>J_,keyof:()=>hb,ksuid:()=>M_,lazy:()=>rp,literal:()=>wb,looseObject:()=>mb,looseRecord:()=>_b,mac:()=>V_,map:()=>bb,meta:()=>Db,nan:()=>Ib,nanoid:()=>N_,nativeEnum:()=>xb,never:()=>na,nonoptional:()=>Wf,null:()=>$f,nullable:()=>yi,nullish:()=>kb,number:()=>gf,object:()=>fb,optional:()=>vi,partialRecord:()=>yb,pipe:()=>Us,prefault:()=>Gf,preprocess:()=>Mb,promise:()=>Pb,readonly:()=>Qf,record:()=>Rf,refine:()=>op,set:()=>$b,strictObject:()=>pb,string:()=>mi,stringFormat:()=>K_,stringbool:()=>Ub,success:()=>Eb,superRefine:()=>sp,symbol:()=>ab,templateLiteral:()=>Ab,transform:()=>sa,tuple:()=>Cf,uint32:()=>nb,uint64:()=>sb,ulid:()=>U_,undefined:()=>ub,union:()=>ia,unknown:()=>dr,url:()=>C_,uuid:()=>T_,uuidv4:()=>O_,uuidv6:()=>A_,uuidv7:()=>P_,void:()=>lb,xid:()=>j_,xor:()=>gb});function _i(t,e,n){let i=Object.getPrototypeOf(t),r=k_.get(i);if(r||(r=new Set,k_.set(i,r)),!r.has(e)){r.add(e);for(let o in n){let s=n[o];Object.defineProperty(i,o,{configurable:!0,enumerable:!1,get(){let a=s.bind(this);return Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,o,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}function mi(t){return Id(un,t)}function E_(t){return ts(Ms,t)}function I_(t){return ui(gi,t)}function T_(t){return rs(ft,t)}function O_(t){return ns(ft,t)}function A_(t){return is(ft,t)}function P_(t){return os(ft,t)}function C_(t){return ci(bi,t)}function R_(t){return ci(bi,{protocol:Ve.httpProtocol,hostname:Ve.domain,...x.normalizeParams(t)})}function z_(t){return ss(Fs,t)}function N_(t){return as(Vs,t)}function D_(t){return us(Zs,t)}function L_(t){return cs(Bs,t)}function U_(t){return ls(Gs,t)}function j_(t){return ds(Ws,t)}function M_(t){return hs(qs,t)}function F_(t){return fs(Hs,t)}function V_(t){return Od(mf,t)}function Z_(t){return ps(Js,t)}function B_(t){return ms(Ks,t)}function G_(t){return gs(Ys,t)}function W_(t){return vs(Xs,t)}function q_(t){return ys(Qs,t)}function H_(t){return _s(ea,t)}function J_(t){return bs(ta,t)}function K_(t,e,n={}){return rn(cn,t,e,n)}function Y_(t){return rn(cn,"hostname",Ve.hostname,t)}function X_(t){return rn(cn,"hex",Ve.hex,t)}function Q_(t,e){let n=e?.enc??"hex",i=`${t}_${n}`,r=Ve[i];if(!r)throw new Error(`Unrecognized hash format: ${i}`);return rn(cn,i,r,e)}function gf(t){return Nd(ln,t)}function Ls(t){return Ld(hr,t)}function eb(t){return Ud(hr,t)}function tb(t){return jd(hr,t)}function rb(t){return Md(hr,t)}function nb(t){return Fd(hr,t)}function vf(t){return Vd(dn,t)}function ib(t){return Bd(hn,t)}function ob(t){return Wd(ra,t)}function sb(t){return qd(ra,t)}function ab(t){return Hd(yf,t)}function ub(t){return Jd(_f,t)}function $f(t){return Kd(bf,t)}function cb(){return Yd(xf)}function dr(){return Xd(wf)}function na(t){return Qd(Sf,t)}function lb(t){return eh(kf,t)}function db(t){return th($i,t)}function xi(t,e){return ih(Ef,t,e)}function hb(t){let e=t._zod.def.shape;return oa(Object.keys(e))}function fb(t,e){let n={type:"object",shape:t??{},...x.normalizeParams(e)};return new wi(n)}function pb(t,e){return new wi({type:"object",shape:t,catchall:na(),...x.normalizeParams(e)})}function mb(t,e){return new wi({type:"object",shape:t,catchall:dr(),...x.normalizeParams(e)})}function ia(t,e){return new Si({type:"union",options:t,...x.normalizeParams(e)})}function gb(t,e){return new If({type:"union",options:t,inclusive:!1,...x.normalizeParams(e)})}function vb(t,e,n){return new Tf({type:"union",options:e,discriminator:t,...x.normalizeParams(n)})}function Af(t,e){return new Of({type:"intersection",left:t,right:e})}function Cf(t,e,n){let i=e instanceof L,r=i?n:e,o=i?e:null;return new Pf({type:"tuple",items:t,rest:o,...x.normalizeParams(r)})}function Rf(t,e,n){return!e||!e._zod?new sn({type:"record",keyType:mi(),valueType:t,...x.normalizeParams(e)}):new sn({type:"record",keyType:t,valueType:e,...x.normalizeParams(n)})}function yb(t,e,n){let i=Ie(t);return i._zod.values=void 0,new sn({type:"record",keyType:i,valueType:e,...x.normalizeParams(n)})}function _b(t,e,n){return new sn({type:"record",keyType:t,valueType:e,mode:"loose",...x.normalizeParams(n)})}function bb(t,e,n){return new zf({type:"map",keyType:t,valueType:e,...x.normalizeParams(n)})}function $b(t,e){return new Nf({type:"set",valueType:t,...x.normalizeParams(e)})}function oa(t,e){let n=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new an({type:"enum",entries:n,...x.normalizeParams(e)})}function xb(t,e){return new an({type:"enum",entries:t,...x.normalizeParams(e)})}function wb(t,e){return new Df({type:"literal",values:Array.isArray(t)?t:[t],...x.normalizeParams(e)})}function Sb(t){return oh(Lf,t)}function sa(t){return new Uf({type:"transform",transform:t})}function vi(t){return new aa({type:"optional",innerType:t})}function Mf(t){return new jf({type:"optional",innerType:t})}function yi(t){return new Ff({type:"nullable",innerType:t})}function kb(t){return vi(yi(t))}function Zf(t,e){return new Vf({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():x.shallowClone(e)}})}function Gf(t,e){return new Bf({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():x.shallowClone(e)}})}function Wf(t,e){return new ua({type:"nonoptional",innerType:t,...x.normalizeParams(e)})}function Eb(t){return new qf({type:"success",innerType:t})}function Jf(t,e){return new Hf({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function Ib(t){return nh(Kf,t)}function Us(t,e){return new ki({type:"pipe",in:t,out:e})}function Tb(t,e,n){return new Ei({type:"pipe",in:t,out:e,transform:n.decode,reverseTransform:n.encode})}function Ob(t){let e=t._zod.def;return new Ei({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}function Qf(t){return new Xf({type:"readonly",innerType:t})}function Ab(t,e){return new ep({type:"template_literal",parts:t,...x.normalizeParams(e)})}function rp(t){return new tp({type:"lazy",getter:t})}function Pb(t){return new np({type:"promise",innerType:t})}function Cb(t){return new ip({type:"function",input:Array.isArray(t?.input)?Cf(t?.input):t?.input??xi(dr()),output:t?.output??dr()})}function Rb(t){let e=new X({check:"custom"});return e._zod.check=t,e}function zb(t,e){return sh(Ii,t??(()=>!0),e)}function op(t,e={}){return ah(Ii,t,e)}function sp(t,e){return uh(t,e)}function Lb(t,e={}){let n=new Ii({type:"custom",check:"custom",fn:i=>i instanceof t,abort:!0,...x.normalizeParams(e)});return n._zod.bag.Class=t,n._zod.check=i=>{i.value instanceof t||i.issues.push({code:"invalid_type",expected:t.name,input:i.value,inst:n,path:[...n._zod.def.path??[]]})},n}function jb(t){let e=rp(()=>ia([mi(t),gf(),vf(),$f(),xi(e),Rf(mi(),e)]));return e}function Mb(t,e){return new Yf({type:"pipe",in:sa(t),out:e})}var k_,j,js,un,J,Ms,gi,ft,bi,Fs,Vs,Zs,Bs,Gs,Ws,qs,Hs,mf,Js,Ks,Ys,Xs,Qs,ea,ta,cn,ln,hr,dn,hn,ra,yf,_f,bf,xf,wf,Sf,kf,$i,Ef,wi,Si,If,Tf,Of,Pf,sn,zf,Nf,an,Df,Lf,Uf,aa,jf,Ff,Vf,Bf,ua,qf,Hf,Kf,ki,Ei,Yf,Xf,ep,tp,np,ip,Ii,Nb,Db,Ub,pi=v(()=>{Be();Be();di();li();Cs();hi();pf();k_=new WeakMap;j=m("ZodType",(t,e)=>(L.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:nn(t,"input"),output:nn(t,"output")}}),t.toJSONSchema=hh(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(n,i)=>tf(t,n,i,{callee:t.parse}),t.safeParse=(n,i)=>nf(t,n,i),t.parseAsync=async(n,i)=>rf(t,n,i,{callee:t.parseAsync}),t.safeParseAsync=async(n,i)=>of(t,n,i),t.spa=t.safeParseAsync,t.encode=(n,i)=>sf(t,n,i),t.decode=(n,i)=>af(t,n,i),t.encodeAsync=async(n,i)=>uf(t,n,i),t.decodeAsync=async(n,i)=>cf(t,n,i),t.safeEncode=(n,i)=>lf(t,n,i),t.safeDecode=(n,i)=>df(t,n,i),t.safeEncodeAsync=async(n,i)=>hf(t,n,i),t.safeDecodeAsync=async(n,i)=>ff(t,n,i),_i(t,"ZodType",{check(...n){let i=this.def;return this.clone(x.mergeDefs(i,{checks:[...i.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,i){return Ie(this,n,i)},brand(){return this},register(n,i){return n.add(this,i),this},refine(n,i){return this.check(op(n,i))},superRefine(n,i){return this.check(sp(n,i))},overwrite(n){return this.check(st(n))},optional(){return vi(this)},exactOptional(){return Mf(this)},nullable(){return yi(this)},nullish(){return vi(yi(this))},nonoptional(n){return Wf(this,n)},array(){return xi(this)},or(n){return ia([this,n])},and(n){return Af(this,n)},transform(n){return Us(this,sa(n))},default(n){return Zf(this,n)},prefault(n){return Gf(this,n)},catch(n){return Jf(this,n)},pipe(n){return Us(this,n)},readonly(){return Qf(this)},describe(n){let i=this.clone();return ve.add(i,{description:n}),i},meta(...n){if(n.length===0)return ve.get(this);let i=this.clone();return ve.add(i,n[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(t,"description",{get(){return ve.get(t)?.description},configurable:!0}),t)),js=m("_ZodString",(t,e)=>{ar.init(t,e),j.init(t,e),t._zod.processJSONSchema=(i,r,o)=>fh(t,i,r,o);let n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,_i(t,"_ZodString",{regex(...i){return this.check(Br(...i))},includes(...i){return this.check(qr(...i))},startsWith(...i){return this.check(Hr(...i))},endsWith(...i){return this.check(Jr(...i))},min(...i){return this.check(xt(...i))},max(...i){return this.check(cr(...i))},length(...i){return this.check(lr(...i))},nonempty(...i){return this.check(xt(1,...i))},lowercase(i){return this.check(Gr(i))},uppercase(i){return this.check(Wr(i))},trim(){return this.check(Xr())},normalize(...i){return this.check(Yr(...i))},toLowerCase(){return this.check(Qr())},toUpperCase(){return this.check(en())},slugify(){return this.check(tn())}})}),un=m("ZodString",(t,e)=>{ar.init(t,e),js.init(t,e),t.email=n=>t.check(ts(Ms,n)),t.url=n=>t.check(ci(bi,n)),t.jwt=n=>t.check(bs(ta,n)),t.emoji=n=>t.check(ss(Fs,n)),t.guid=n=>t.check(ui(gi,n)),t.uuid=n=>t.check(rs(ft,n)),t.uuidv4=n=>t.check(ns(ft,n)),t.uuidv6=n=>t.check(is(ft,n)),t.uuidv7=n=>t.check(os(ft,n)),t.nanoid=n=>t.check(as(Vs,n)),t.guid=n=>t.check(ui(gi,n)),t.cuid=n=>t.check(us(Zs,n)),t.cuid2=n=>t.check(cs(Bs,n)),t.ulid=n=>t.check(ls(Gs,n)),t.base64=n=>t.check(vs(Xs,n)),t.base64url=n=>t.check(ys(Qs,n)),t.xid=n=>t.check(ds(Ws,n)),t.ksuid=n=>t.check(hs(qs,n)),t.ipv4=n=>t.check(fs(Hs,n)),t.ipv6=n=>t.check(ps(Js,n)),t.cidrv4=n=>t.check(ms(Ks,n)),t.cidrv6=n=>t.check(gs(Ys,n)),t.e164=n=>t.check(_s(ea,n)),t.datetime=n=>t.check(Kh(n)),t.date=n=>t.check(Yh(n)),t.time=n=>t.check(Xh(n)),t.duration=n=>t.check(Qh(n))});J=m("ZodStringFormat",(t,e)=>{H.init(t,e),js.init(t,e)}),Ms=m("ZodEmail",(t,e)=>{fl.init(t,e),J.init(t,e)});gi=m("ZodGUID",(t,e)=>{dl.init(t,e),J.init(t,e)});ft=m("ZodUUID",(t,e)=>{hl.init(t,e),J.init(t,e)});bi=m("ZodURL",(t,e)=>{pl.init(t,e),J.init(t,e)});Fs=m("ZodEmoji",(t,e)=>{ml.init(t,e),J.init(t,e)});Vs=m("ZodNanoID",(t,e)=>{gl.init(t,e),J.init(t,e)});Zs=m("ZodCUID",(t,e)=>{vl.init(t,e),J.init(t,e)});Bs=m("ZodCUID2",(t,e)=>{yl.init(t,e),J.init(t,e)});Gs=m("ZodULID",(t,e)=>{_l.init(t,e),J.init(t,e)});Ws=m("ZodXID",(t,e)=>{bl.init(t,e),J.init(t,e)});qs=m("ZodKSUID",(t,e)=>{$l.init(t,e),J.init(t,e)});Hs=m("ZodIPv4",(t,e)=>{El.init(t,e),J.init(t,e)});mf=m("ZodMAC",(t,e)=>{Tl.init(t,e),J.init(t,e)});Js=m("ZodIPv6",(t,e)=>{Il.init(t,e),J.init(t,e)});Ks=m("ZodCIDRv4",(t,e)=>{Ol.init(t,e),J.init(t,e)});Ys=m("ZodCIDRv6",(t,e)=>{Al.init(t,e),J.init(t,e)});Xs=m("ZodBase64",(t,e)=>{Cl.init(t,e),J.init(t,e)});Qs=m("ZodBase64URL",(t,e)=>{Rl.init(t,e),J.init(t,e)});ea=m("ZodE164",(t,e)=>{zl.init(t,e),J.init(t,e)});ta=m("ZodJWT",(t,e)=>{Nl.init(t,e),J.init(t,e)});cn=m("ZodCustomStringFormat",(t,e)=>{Dl.init(t,e),J.init(t,e)});ln=m("ZodNumber",(t,e)=>{Go.init(t,e),j.init(t,e),t._zod.processJSONSchema=(i,r,o)=>ph(t,i,r,o),_i(t,"ZodNumber",{gt(i,r){return this.check(dt(i,r))},gte(i,r){return this.check(Oe(i,r))},min(i,r){return this.check(Oe(i,r))},lt(i,r){return this.check(lt(i,r))},lte(i,r){return this.check(Ze(i,r))},max(i,r){return this.check(Ze(i,r))},int(i){return this.check(Ls(i))},safe(i){return this.check(Ls(i))},positive(i){return this.check(dt(0,i))},nonnegative(i){return this.check(Oe(0,i))},negative(i){return this.check(lt(0,i))},nonpositive(i){return this.check(Ze(0,i))},multipleOf(i,r){return this.check(jt(i,r))},step(i,r){return this.check(jt(i,r))},finite(){return this}});let n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null});hr=m("ZodNumberFormat",(t,e)=>{Ll.init(t,e),ln.init(t,e)});dn=m("ZodBoolean",(t,e)=>{ri.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>mh(t,n,i,r)});hn=m("ZodBigInt",(t,e)=>{Wo.init(t,e),j.init(t,e),t._zod.processJSONSchema=(i,r,o)=>gh(t,i,r,o),t.gte=(i,r)=>t.check(Oe(i,r)),t.min=(i,r)=>t.check(Oe(i,r)),t.gt=(i,r)=>t.check(dt(i,r)),t.gte=(i,r)=>t.check(Oe(i,r)),t.min=(i,r)=>t.check(Oe(i,r)),t.lt=(i,r)=>t.check(lt(i,r)),t.lte=(i,r)=>t.check(Ze(i,r)),t.max=(i,r)=>t.check(Ze(i,r)),t.positive=i=>t.check(dt(BigInt(0),i)),t.negative=i=>t.check(lt(BigInt(0),i)),t.nonpositive=i=>t.check(Ze(BigInt(0),i)),t.nonnegative=i=>t.check(Oe(BigInt(0),i)),t.multipleOf=(i,r)=>t.check(jt(i,r));let n=t._zod.bag;t.minValue=n.minimum??null,t.maxValue=n.maximum??null,t.format=n.format??null});ra=m("ZodBigIntFormat",(t,e)=>{Ul.init(t,e),hn.init(t,e)});yf=m("ZodSymbol",(t,e)=>{jl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>vh(t,n,i,r)});_f=m("ZodUndefined",(t,e)=>{Ml.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>_h(t,n,i,r)});bf=m("ZodNull",(t,e)=>{Fl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>yh(t,n,i,r)});xf=m("ZodAny",(t,e)=>{Vl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>xh(t,n,i,r)});wf=m("ZodUnknown",(t,e)=>{Zl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>wh(t,n,i,r)});Sf=m("ZodNever",(t,e)=>{Bl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>$h(t,n,i,r)});kf=m("ZodVoid",(t,e)=>{Gl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>bh(t,n,i,r)});$i=m("ZodDate",(t,e)=>{Wl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(i,r,o)=>Sh(t,i,r,o),t.min=(i,r)=>t.check(Oe(i,r)),t.max=(i,r)=>t.check(Ze(i,r));let n=t._zod.bag;t.minDate=n.minimum?new Date(n.minimum):null,t.maxDate=n.maximum?new Date(n.maximum):null});Ef=m("ZodArray",(t,e)=>{ql.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Dh(t,n,i,r),t.element=e.element,_i(t,"ZodArray",{min(n,i){return this.check(xt(n,i))},nonempty(n){return this.check(xt(1,n))},max(n,i){return this.check(cr(n,i))},length(n,i){return this.check(lr(n,i))},unwrap(){return this.element}})});wi=m("ZodObject",(t,e)=>{Hl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Lh(t,n,i,r),x.defineLazy(t,"shape",()=>e.shape),_i(t,"ZodObject",{keyof(){return oa(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:dr()})},loose(){return this.clone({...this._zod.def,catchall:dr()})},strict(){return this.clone({...this._zod.def,catchall:na()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return x.extend(this,n)},safeExtend(n){return x.safeExtend(this,n)},merge(n){return x.merge(this,n)},pick(n){return x.pick(this,n)},omit(n){return x.omit(this,n)},partial(...n){return x.partial(aa,this,n[0])},required(...n){return x.required(ua,this,n[0])}})});Si=m("ZodUnion",(t,e)=>{ni.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Is(t,n,i,r),t.options=e.options});If=m("ZodXor",(t,e)=>{Si.init(t,e),Jl.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Is(t,n,i,r),t.options=e.options});Tf=m("ZodDiscriminatedUnion",(t,e)=>{Si.init(t,e),Kl.init(t,e)});Of=m("ZodIntersection",(t,e)=>{Yl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Uh(t,n,i,r)});Pf=m("ZodTuple",(t,e)=>{qo.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>jh(t,n,i,r),t.rest=n=>t.clone({...t._zod.def,rest:n})});sn=m("ZodRecord",(t,e)=>{Xl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Mh(t,n,i,r),t.keyType=e.keyType,t.valueType=e.valueType});zf=m("ZodMap",(t,e)=>{Ql.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>zh(t,n,i,r),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...n)=>t.check(ht(...n)),t.nonempty=n=>t.check(ht(1,n)),t.max=(...n)=>t.check(Mt(...n)),t.size=(...n)=>t.check(ur(...n))});Nf=m("ZodSet",(t,e)=>{ed.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Nh(t,n,i,r),t.min=(...n)=>t.check(ht(...n)),t.nonempty=n=>t.check(ht(1,n)),t.max=(...n)=>t.check(Mt(...n)),t.size=(...n)=>t.check(ur(...n))});an=m("ZodEnum",(t,e)=>{td.init(t,e),j.init(t,e),t._zod.processJSONSchema=(i,r,o)=>kh(t,i,r,o),t.enum=e.entries,t.options=Object.values(e.entries);let n=new Set(Object.keys(e.entries));t.extract=(i,r)=>{let o={};for(let s of i)if(n.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new an({...e,checks:[],...x.normalizeParams(r),entries:o})},t.exclude=(i,r)=>{let o={...e.entries};for(let s of i)if(n.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new an({...e,checks:[],...x.normalizeParams(r),entries:o})}});Df=m("ZodLiteral",(t,e)=>{rd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Eh(t,n,i,r),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]}})});Lf=m("ZodFile",(t,e)=>{nd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Oh(t,n,i,r),t.min=(n,i)=>t.check(ht(n,i)),t.max=(n,i)=>t.check(Mt(n,i)),t.mime=(n,i)=>t.check(Kr(Array.isArray(n)?n:[n],i))});Uf=m("ZodTransform",(t,e)=>{id.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Rh(t,n,i,r),t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new zt(t.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(x.issue(o,n.value,e));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),n.issues.push(x.issue(s))}};let r=e.transform(n.value,n);return r instanceof Promise?r.then(o=>(n.value=o,n.fallback=!0,n)):(n.value=r,n.fallback=!0,n)}});aa=m("ZodOptional",(t,e)=>{Ho.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ts(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});jf=m("ZodExactOptional",(t,e)=>{od.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ts(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});Ff=m("ZodNullable",(t,e)=>{sd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Fh(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});Vf=m("ZodDefault",(t,e)=>{ad.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Zh(t,n,i,r),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});Bf=m("ZodPrefault",(t,e)=>{ud.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Bh(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});ua=m("ZodNonOptional",(t,e)=>{cd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Vh(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});qf=m("ZodSuccess",(t,e)=>{ld.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ah(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});Hf=m("ZodCatch",(t,e)=>{dd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Gh(t,n,i,r),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});Kf=m("ZodNaN",(t,e)=>{hd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ih(t,n,i,r)});ki=m("ZodPipe",(t,e)=>{Jo.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Wh(t,n,i,r),t.in=e.in,t.out=e.out});Ei=m("ZodCodec",(t,e)=>{ki.init(t,e),ii.init(t,e)});Yf=m("ZodPreprocess",(t,e)=>{ki.init(t,e),fd.init(t,e)}),Xf=m("ZodReadonly",(t,e)=>{pd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>qh(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});ep=m("ZodTemplateLiteral",(t,e)=>{md.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Th(t,n,i,r)});tp=m("ZodLazy",(t,e)=>{yd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Jh(t,n,i,r),t.unwrap=()=>t._zod.def.getter()});np=m("ZodPromise",(t,e)=>{vd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Hh(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});ip=m("ZodFunction",(t,e)=>{gd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ch(t,n,i,r)});Ii=m("ZodCustom",(t,e)=>{_d.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ph(t,n,i,r)});Nb=ch,Db=lh;Ub=(...t)=>dh({Codec:Ei,Boolean:dn,String:un},...t)});function vT(t){oe({customError:t})}function yT(){return oe().customError}var gT,ap,Fb=v(()=>{Be();gT={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"};ap||(ap={})});function bT(t,e){let n=t.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function $T(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=t.slice(1).split("/").filter(Boolean);if(n.length===0)return e.rootSchema;let i=e.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===i){let r=n[1];if(!r||!e.defs[r])throw new Error(`Reference not found: ${t}`);return e.defs[r]}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 I.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 r=t.$ref;if(e.refs.has(r))return e.refs.get(r);if(e.processing.has(r))return I.lazy(()=>{if(!e.refs.has(r))throw new Error(`Circular reference not resolved: ${r}`);return e.refs.get(r)});e.processing.add(r);let o=$T(r,e),s=xe(o,e);return e.refs.set(r,s),e.processing.delete(r),s}if(t.enum!==void 0){let r=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&r.length===1&&r[0]===null)return I.null();if(r.length===0)return I.never();if(r.length===1)return I.literal(r[0]);if(r.every(s=>typeof s=="string"))return I.enum(r);let o=r.map(s=>I.literal(s));return o.length<2?o[0]:I.union([o[0],o[1],...o.slice(2)])}if(t.const!==void 0)return I.literal(t.const);let n=t.type;if(Array.isArray(n)){let r=n.map(o=>{let s={...t,type:o};return Vb(s,e)});return r.length===0?I.never():r.length===1?r[0]:I.union(r)}if(!n)return I.any();let i;switch(n){case"string":{let r=I.string();if(t.format){let o=t.format;o==="email"?r=r.check(I.email()):o==="uri"||o==="uri-reference"?r=r.check(I.url()):o==="uuid"||o==="guid"?r=r.check(I.uuid()):o==="date-time"?r=r.check(I.iso.datetime()):o==="date"?r=r.check(I.iso.date()):o==="time"?r=r.check(I.iso.time()):o==="duration"?r=r.check(I.iso.duration()):o==="ipv4"?r=r.check(I.ipv4()):o==="ipv6"?r=r.check(I.ipv6()):o==="mac"?r=r.check(I.mac()):o==="cidr"?r=r.check(I.cidrv4()):o==="cidr-v6"?r=r.check(I.cidrv6()):o==="base64"?r=r.check(I.base64()):o==="base64url"?r=r.check(I.base64url()):o==="e164"?r=r.check(I.e164()):o==="jwt"?r=r.check(I.jwt()):o==="emoji"?r=r.check(I.emoji()):o==="nanoid"?r=r.check(I.nanoid()):o==="cuid"?r=r.check(I.cuid()):o==="cuid2"?r=r.check(I.cuid2()):o==="ulid"?r=r.check(I.ulid()):o==="xid"?r=r.check(I.xid()):o==="ksuid"&&(r=r.check(I.ksuid()))}typeof t.minLength=="number"&&(r=r.min(t.minLength)),typeof t.maxLength=="number"&&(r=r.max(t.maxLength)),t.pattern&&(r=r.regex(new RegExp(t.pattern))),i=r;break}case"number":case"integer":{let r=n==="integer"?I.number().int():I.number();typeof t.minimum=="number"&&(r=r.min(t.minimum)),typeof t.maximum=="number"&&(r=r.max(t.maximum)),typeof t.exclusiveMinimum=="number"?r=r.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(r=r.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?r=r.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(r=r.lt(t.maximum)),typeof t.multipleOf=="number"&&(r=r.multipleOf(t.multipleOf)),i=r;break}case"boolean":{i=I.boolean();break}case"null":{i=I.null();break}case"object":{let r={},o=t.properties||{},s=new Set(t.required||[]);for(let[u,c]of Object.entries(o)){let l=xe(c,e);r[u]=s.has(u)?l:l.optional()}if(t.propertyNames){let u=xe(t.propertyNames,e),c=t.additionalProperties&&typeof t.additionalProperties=="object"?xe(t.additionalProperties,e):I.any();if(Object.keys(r).length===0){i=I.record(u,c);break}let l=I.object(r).passthrough(),d=I.looseRecord(u,c);i=I.intersection(l,d);break}if(t.patternProperties){let u=t.patternProperties,c=Object.keys(u),l=[];for(let h of c){let f=xe(u[h],e),p=I.string().regex(new RegExp(h));l.push(I.looseRecord(p,f))}let d=[];if(Object.keys(r).length>0&&d.push(I.object(r).passthrough()),d.push(...l),d.length===0)i=I.object({}).passthrough();else if(d.length===1)i=d[0];else{let h=I.intersection(d[0],d[1]);for(let f=2;f<d.length;f++)h=I.intersection(h,d[f]);i=h}break}let a=I.object(r);t.additionalProperties===!1?i=a.strict():typeof t.additionalProperties=="object"?i=a.catchall(xe(t.additionalProperties,e)):i=a.passthrough();break}case"array":{let r=t.prefixItems,o=t.items;if(r&&Array.isArray(r)){let s=r.map(u=>xe(u,e)),a=o&&typeof o=="object"&&!Array.isArray(o)?xe(o,e):void 0;a?i=I.tuple(s).rest(a):i=I.tuple(s),typeof t.minItems=="number"&&(i=i.check(I.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(I.maxLength(t.maxItems)))}else if(Array.isArray(o)){let s=o.map(u=>xe(u,e)),a=t.additionalItems&&typeof t.additionalItems=="object"?xe(t.additionalItems,e):void 0;a?i=I.tuple(s).rest(a):i=I.tuple(s),typeof t.minItems=="number"&&(i=i.check(I.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(I.maxLength(t.maxItems)))}else if(o!==void 0){let s=xe(o,e),a=I.array(s);typeof t.minItems=="number"&&(a=a.min(t.minItems)),typeof t.maxItems=="number"&&(a=a.max(t.maxItems)),i=a}else i=I.array(I.any());break}default:throw new Error(`Unsupported type: ${n}`)}return i}function xe(t,e){if(typeof t=="boolean")return t?I.any():I.never();let n=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(c=>xe(c,e)),u=I.union(a);n=i?I.intersection(n,u):u}if(t.oneOf&&Array.isArray(t.oneOf)){let a=t.oneOf.map(c=>xe(c,e)),u=I.xor(a);n=i?I.intersection(n,u):u}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)n=i?n:I.any();else{let a=i?n:xe(t.allOf[0],e),u=i?0:1;for(let c=u;c<t.allOf.length;c++)a=I.intersection(a,xe(t.allOf[c],e));n=a}t.nullable===!0&&e.version==="openapi-3.0"&&(n=I.nullable(n)),t.readOnly===!0&&(n=I.readonly(n)),t.default!==void 0&&(n=n.default(t.default));let r={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of o)a in t&&(r[a]=t[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in t&&(r[a]=t[a]);for(let a of Object.keys(t))_T.has(a)||(r[a]=t[a]);return Object.keys(r).length>0&&e.registry.add(n,r),t.description&&(n=n.describe(t.description)),n}function Zb(t,e){if(typeof t=="boolean")return t?I.any():I.never();let n;try{n=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=bT(n,e?.defaultTarget),r=n.$defs||n.definitions||{},o={version:i,defs:r,refs:new Map,processing:new Set,rootSchema:n,registry:e?.registry??ve};return xe(n,o)}var I,_T,Bb=v(()=>{ai();Cs();hi();pi();I={...fi,...Ps,iso:on},_T=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"])});var up={};He(up,{bigint:()=>kT,boolean:()=>ST,date:()=>ET,number:()=>wT,string:()=>xT});function xT(t){return Td(un,t)}function wT(t){return Dd(ln,t)}function ST(t){return Zd(dn,t)}function kT(t){return Gd(hn,t)}function ET(t){return rh($i,t)}var Gb=v(()=>{Be();pi()});var de={};He(de,{$brand:()=>Ku,$input:()=>Ed,$output:()=>kd,NEVER:()=>Ju,TimePrecision:()=>Ad,ZodAny:()=>xf,ZodArray:()=>Ef,ZodBase64:()=>Xs,ZodBase64URL:()=>Qs,ZodBigInt:()=>hn,ZodBigIntFormat:()=>ra,ZodBoolean:()=>dn,ZodCIDRv4:()=>Ks,ZodCIDRv6:()=>Ys,ZodCUID:()=>Zs,ZodCUID2:()=>Bs,ZodCatch:()=>Hf,ZodCodec:()=>Ei,ZodCustom:()=>Ii,ZodCustomStringFormat:()=>cn,ZodDate:()=>$i,ZodDefault:()=>Vf,ZodDiscriminatedUnion:()=>Tf,ZodE164:()=>ea,ZodEmail:()=>Ms,ZodEmoji:()=>Fs,ZodEnum:()=>an,ZodError:()=>pT,ZodExactOptional:()=>jf,ZodFile:()=>Lf,ZodFirstPartyTypeKind:()=>ap,ZodFunction:()=>ip,ZodGUID:()=>gi,ZodIPv4:()=>Hs,ZodIPv6:()=>Js,ZodISODate:()=>zs,ZodISODateTime:()=>Rs,ZodISODuration:()=>Ds,ZodISOTime:()=>Ns,ZodIntersection:()=>Of,ZodIssueCode:()=>gT,ZodJWT:()=>ta,ZodKSUID:()=>qs,ZodLazy:()=>tp,ZodLiteral:()=>Df,ZodMAC:()=>mf,ZodMap:()=>zf,ZodNaN:()=>Kf,ZodNanoID:()=>Vs,ZodNever:()=>Sf,ZodNonOptional:()=>ua,ZodNull:()=>bf,ZodNullable:()=>Ff,ZodNumber:()=>ln,ZodNumberFormat:()=>hr,ZodObject:()=>wi,ZodOptional:()=>aa,ZodPipe:()=>ki,ZodPrefault:()=>Bf,ZodPreprocess:()=>Yf,ZodPromise:()=>np,ZodReadonly:()=>Xf,ZodRealError:()=>De,ZodRecord:()=>sn,ZodSet:()=>Nf,ZodString:()=>un,ZodStringFormat:()=>J,ZodSuccess:()=>qf,ZodSymbol:()=>yf,ZodTemplateLiteral:()=>ep,ZodTransform:()=>Uf,ZodTuple:()=>Pf,ZodType:()=>j,ZodULID:()=>Gs,ZodURL:()=>bi,ZodUUID:()=>ft,ZodUndefined:()=>_f,ZodUnion:()=>Si,ZodUnknown:()=>wf,ZodVoid:()=>kf,ZodXID:()=>Ws,ZodXor:()=>If,_ZodString:()=>js,_default:()=>Zf,_function:()=>Cb,any:()=>cb,array:()=>xi,base64:()=>W_,base64url:()=>q_,bigint:()=>ib,boolean:()=>vf,catch:()=>Jf,check:()=>Rb,cidrv4:()=>B_,cidrv6:()=>G_,clone:()=>Ie,codec:()=>Tb,coerce:()=>up,config:()=>oe,core:()=>wt,cuid:()=>D_,cuid2:()=>L_,custom:()=>zb,date:()=>db,decode:()=>af,decodeAsync:()=>cf,describe:()=>Nb,discriminatedUnion:()=>vb,e164:()=>H_,email:()=>E_,emoji:()=>z_,encode:()=>sf,encodeAsync:()=>uf,endsWith:()=>Jr,enum:()=>oa,exactOptional:()=>Mf,file:()=>Sb,flattenError:()=>Yn,float32:()=>eb,float64:()=>tb,formatError:()=>Xn,fromJSONSchema:()=>Zb,function:()=>Cb,getErrorMap:()=>yT,globalRegistry:()=>ve,gt:()=>dt,gte:()=>Oe,guid:()=>I_,hash:()=>Q_,hex:()=>X_,hostname:()=>Y_,httpUrl:()=>R_,includes:()=>qr,instanceof:()=>Lb,int:()=>Ls,int32:()=>rb,int64:()=>ob,intersection:()=>Af,invertCodec:()=>Ob,ipv4:()=>F_,ipv6:()=>Z_,iso:()=>on,json:()=>jb,jwt:()=>J_,keyof:()=>hb,ksuid:()=>M_,lazy:()=>rp,length:()=>lr,literal:()=>wb,locales:()=>si,looseObject:()=>mb,looseRecord:()=>_b,lowercase:()=>Gr,lt:()=>lt,lte:()=>Ze,mac:()=>V_,map:()=>bb,maxLength:()=>cr,maxSize:()=>Mt,meta:()=>Db,mime:()=>Kr,minLength:()=>xt,minSize:()=>ht,multipleOf:()=>jt,nan:()=>Ib,nanoid:()=>N_,nativeEnum:()=>xb,negative:()=>xs,never:()=>na,nonnegative:()=>Ss,nonoptional:()=>Wf,nonpositive:()=>ws,normalize:()=>Yr,null:()=>$f,nullable:()=>yi,nullish:()=>kb,number:()=>gf,object:()=>fb,optional:()=>vi,overwrite:()=>st,parse:()=>tf,parseAsync:()=>rf,partialRecord:()=>yb,pipe:()=>Us,positive:()=>$s,prefault:()=>Gf,preprocess:()=>Mb,prettifyError:()=>cc,promise:()=>Pb,property:()=>ks,readonly:()=>Qf,record:()=>Rf,refine:()=>op,regex:()=>Br,regexes:()=>Ve,registry:()=>es,safeDecode:()=>df,safeDecodeAsync:()=>ff,safeEncode:()=>lf,safeEncodeAsync:()=>hf,safeParse:()=>nf,safeParseAsync:()=>of,set:()=>$b,setErrorMap:()=>vT,size:()=>ur,slugify:()=>tn,startsWith:()=>Hr,strictObject:()=>pb,string:()=>mi,stringFormat:()=>K_,stringbool:()=>Ub,success:()=>Eb,superRefine:()=>sp,symbol:()=>ab,templateLiteral:()=>Ab,toJSONSchema:()=>Os,toLowerCase:()=>Qr,toUpperCase:()=>en,transform:()=>sa,treeifyError:()=>uc,trim:()=>Xr,tuple:()=>Cf,uint32:()=>nb,uint64:()=>sb,ulid:()=>U_,undefined:()=>ub,union:()=>ia,unknown:()=>dr,uppercase:()=>Wr,url:()=>C_,util:()=>x,uuid:()=>T_,uuidv4:()=>O_,uuidv6:()=>A_,uuidv7:()=>P_,void:()=>lb,xid:()=>j_,xor:()=>gb});var cp=v(()=>{Be();pi();Cs();ef();pf();Fb();Be();$d();Be();di();Bb();Sd();hi();hi();Gb();oe(Ko())});var Wb=v(()=>{cp();cp()});function OT(t){try{return new URL(t).protocol}catch{return null}}var IT,TT,ca,fr,qb=v(()=>{"use strict";Wb();IT=de.enum(["debug","info","warn","error"]),TT=de.string().superRefine((t,e)=>{let n=OT(t);if(n===null){e.addIssue({code:"custom",message:"must be a valid ws:// or wss:// URL"});return}n!=="ws:"&&n!=="wss:"&&e.addIssue({code:"custom",message:`must use the ws:// or wss:// scheme (got '${n}//' - this is a WebSocket endpoint, not HTTP)`})});ca=de.object({provider:de.string(),model:de.string(),gateway:de.string().nullable().optional(),url:TT.optional()}),fr=de.object({version:de.number().default(1),routes:de.object({stt:ca.optional(),tts:ca.optional(),text:ca.optional(),embedding:ca.optional()}).optional(),secrets:de.record(de.string(),de.string()).optional(),defaults:de.object({logLevel:IT.default("info"),modality:de.enum(["voice","text"]).default("voice")}).default({logLevel:"info",modality:"voice"}),upgrade:de.object({auto:de.boolean().default(!1)}).default({auto:!1})})});var we=v(()=>{"use strict";Bg();Gg();Hu();qb()});import{mkdirSync as AT}from"node:fs";import{homedir as PT}from"node:os";import{join as Hb,resolve as CT}from"node:path";var lp,Ge,pr=v(()=>{"use strict";Hu();lp=class{dirName=".jarvis";dir(){let e=process.env[Wg]?.trim();return e?CT(e):Hb(PT(),this.dirName)}resolve(...e){return Hb(this.dir(),...e)}ensureDir(){let e=this.dir();return AT(e,{recursive:!0,mode:448}),e}},Ge=new lp});import{chmodSync as RT,existsSync as zT,readFileSync as NT,writeFileSync as DT}from"node:fs";function Kb(t){switch(t){case"debug":case"info":case"warn":case"error":return t;default:return}}var Jb,mr,dp=v(()=>{"use strict";we();pr();Jb="config.json",mr=class t{home;config;constructor(e=Ge){this.home=e,this.config=this.load()}configPath(){return this.home.resolve(Jb)}load(){let e=this.configPath(),n=zT(e)?this.readFile(e):{},i=fr.safeParse(n);if(!i.success)throw new Error(`invalid Jarvis config at ${e}: ${i.error.message}`);return i.data}readFile(e){let n;try{n=NT(e,"utf8")}catch(i){throw new Error(`could not read Jarvis config at ${e}`,{cause:i})}try{return JSON.parse(n)}catch(i){throw new Error(`Jarvis config at ${e} is not valid JSON`,{cause:i})}}resolved(){return this.config}get logLevel(){return Kb(process.env.JARVIS_LOG_LEVEL)??Kb(process.env.LOG_LEVEL)??this.config.defaults.logLevel}secret(e){return this.config.secrets?.[e]}save(e){t.persist(this.home,e)}static persist(e,n){let i=fr.parse(n);e.ensureDir();let r=e.resolve(Jb);DT(r,JSON.stringify(i,null,2)+`
68
+ `,{mode:384}),RT(r,384)}}});function FT(t,e){let n=t;for(let i of e){if(n===null||typeof n!="object")return;n=n[i]}return n}function VT(t,e,n){let i=t;for(let r=0;r<e.length-1;r++){let o=e[r],s=i[o];(s===null||typeof s!="object")&&(i[o]={}),i=i[o]}i[e[e.length-1]]=n}function ZT(t,e){let n=t;for(let r=0;r<e.length-1;r++){let o=n[e[r]];if(o===null||typeof o!="object")return!1;n=o}let i=e[e.length-1];return i in n?(delete n[i],!0):!1}var LT,UT,jT,MT,We,hp=v(()=>{"use strict";we();pr();dp();LT="<set>",UT=new Set(["upgrade.auto"]),jT=new Set(["version"]),MT=new Set(["__proto__","prototype","constructor"]),We=class{home;constructor(e=Ge){this.home=e}freshResolver(){return new mr(this.home)}resolved(){return this.freshResolver().resolved()}list(){return this.redact(this.freshResolver().resolved())}get(e){return FT(this.list(),this.parsePath(e))}set(e,n){let i=this.parsePath(e);this.assertMutable(e);let r=this.freshResolver(),o=structuredClone(r.resolved());VT(o,i,this.coerce(e,n)),r.save(this.validate(o,e))}unset(e){let n=this.parsePath(e);this.assertMutable(e);let i=this.freshResolver(),r=structuredClone(i.resolved());if(!ZT(r,n))throw new Error(`nothing to unset: '${e}' is not set`);i.save(this.validate(r,e))}write(e){mr.persist(this.home,e)}validate(e,n){let i=fr.safeParse(e);if(i.success)return i.data;let r=i.error.issues.map(s=>`${s.path.join(".")}: ${s.message}`).join("; "),o=n.startsWith("routes.")?" A route needs both a provider and a model - run 'jarvis init' to configure one.":"";throw new Error(`'${n}' would make the config invalid (${r}).${o}`)}coerce(e,n){if(UT.has(e)){if(n==="true")return!0;if(n==="false")return!1;throw new Error(`'${e}' expects 'true' or 'false', got '${n}'`)}return n}assertMutable(e){if(jT.has(e))throw new Error(`'${e}' is managed by Jarvis and cannot be changed`)}parsePath(e){let n=e.split(".");if(e.length===0||n.some(i=>i.length===0||MT.has(i)))throw new Error(`invalid config path: '${e}'`);return n}redact(e){let n=structuredClone(e);if(n.secrets)for(let i of Object.keys(n.secrets))n.secrets[i]=LT;return n}}});async function*Xb(t,e={}){let{signal:n,idleTimeoutMs:i}=e,r=t.getReader(),o=new TextDecoder,s="",a=[];try{for(;;){let{value:u,done:c}=await BT(r,n,i);if(c)break;s+=o.decode(u,{stream:!0});let l;for(;(l=s.indexOf(`
69
69
  `))!==-1;){let d=s.slice(0,l);if(s=s.slice(l+1),d.endsWith("\r")&&(d=d.slice(0,-1)),d===""){a.length>0&&(yield a.join(`
70
- `),a=[]);continue}if(d.startsWith(":"))continue;let f=d.indexOf(":");if((f===-1?d:d.slice(0,f))!=="data")continue;let p=f===-1?"":d.slice(f+1);p.startsWith(" ")&&(p=p.slice(1)),a.push(p)}}}finally{r.cancel().catch(()=>{})}}function RT(t,e,n){return e?.aborted?Promise.reject(Bb(e)):new Promise((i,r)=>{let o=!1,s=c=>{o||(o=!0,u!==void 0&&clearTimeout(u),e?.removeEventListener("abort",a),c())},a=()=>s(()=>r(Bb(e))),u=n!==void 0?setTimeout(()=>s(()=>r(new na(n))),n):void 0;e?.addEventListener("abort",a,{once:!0}),t.read().then(c=>s(()=>i(c)),c=>s(()=>r(NT(c))))})}function Bb(t){let e=t?.reason;return e instanceof Error?e:new Error("text stream aborted")}function NT(t){return t instanceof Error?t:new Error(String(t))}var na,tp=v(()=>{"use strict";na=class extends Error{constructor(e){super(`text stream idle for ${e}ms`),this.name="IdleTimeoutError"}}});var Zt,rp=v(()=>{"use strict";Zt=class extends Error{status;constructor(e,n){super(e),this.status=n,this.name="TextAdapterError"}}});function Wb(t){try{return JSON.parse(t)}catch{return}}function fn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0}function MT(t){return Array.isArray(t)?t:void 0}function qb(t){let e=fn(t)?.message;return typeof e=="string"?e:"unknown error"}var oa,DT,LT,UT,jT,ia,xi,wi,np=v(()=>{"use strict";tp();rp();oa=3e4,DT=4096,LT="https://api.anthropic.com/v1/messages",UT="2023-06-01",jT="https://api.openai.com/v1/chat/completions",ia=class{key;fetchImpl;idleTimeoutMs;constructor(e,n=fetch,i=oa){this.key=e,this.fetchImpl=n,this.idleTimeoutMs=i}async*stream(e){let{url:n,init:i}=this.buildRequest(e),r=await this.fetchImpl(n,{...i,signal:e.signal});if(!r.ok)throw new Zt(`text provider request failed (HTTP ${r.status})`,r.status);if(!r.body)throw new Zt("text provider response had no body");for await(let o of Gb(r.body,{signal:e.signal,idleTimeoutMs:this.idleTimeoutMs})){if(this.isDone(o))return;let s=this.decode(o);s&&(yield s)}}},xi=class extends ia{buildRequest(e){let n={model:e.model,max_tokens:DT,stream:!0,messages:e.messages.map(i=>({role:i.role,content:i.content})),...e.system!==void 0&&{system:e.system}};return{url:LT,init:{method:"POST",headers:{"x-api-key":this.key,"anthropic-version":UT,"content-type":"application/json"},body:JSON.stringify(n)}}}isDone(){return!1}decode(e){let n=fn(Wb(e));if(!n)return null;if(n.type==="error")throw new Zt(`anthropic stream error: ${qb(n.error)}`);if(n.type==="content_block_delta"){let i=fn(n.delta);if(i?.type==="text_delta"&&typeof i.text=="string")return{type:"text",text:i.text}}return null}},wi=class extends ia{buildRequest(e){let n=e.system!==void 0?[{role:"system",content:e.system},...e.messages]:e.messages,i={model:e.model,stream:!0,messages:n};return{url:jT,init:{method:"POST",headers:{Authorization:`Bearer ${this.key}`,"content-type":"application/json"},body:JSON.stringify(i)}}}isDone(e){return e==="[DONE]"}decode(e){let n=fn(Wb(e));if(!n)return null;if(n.error)throw new Zt(`openai stream error: ${qb(n.error)}`);let i=MT(n.choices),r=i?fn(i[0])?.delta:void 0,o=fn(r)?.content;return typeof o=="string"&&o.length>0?{type:"text",text:o}:null}}});var Si,ip=v(()=>{"use strict";np();Si=class{fetchImpl;idleTimeoutMs;constructor(e=fetch,n=oa){this.fetchImpl=e,this.idleTimeoutMs=n}textAdapter(e,n){switch(e.provider){case"anthropic":return new xi(n,this.fetchImpl,this.idleTimeoutMs);case"openai":return new wi(n,this.fetchImpl,this.idleTimeoutMs);default:throw new Error(`no text adapter for provider '${e.provider}'`)}}}});var Le,Hb=v(()=>{"use strict";Le=class extends Error{commandId;reason;constructor(e,n,i){super(i??`send rejected (${n}) for command ${e}`),this.commandId=e,this.reason=n,this.name="SessionSendError"}}});var Jb=v(()=>{"use strict"});var ki=v(()=>{"use strict";Hb();Jb()});var Kb,Yb,Ei,op=v(()=>{"use strict";Kb="You are Jarvis, a voice-first personal agent and a continuous, trusted collaborator - not a disposable chat assistant. You help with software engineering work. Be concise, direct, and technical; skip filler and preamble. When you are unsure, say so plainly rather than guessing. You reason and explain; you do not yet take actions or use tools, so propose the next steps for the human to run rather than claiming to have run them.",Yb=`This conversation is spoken aloud. Follow the voice register:
70
+ `),a=[]);continue}if(d.startsWith(":"))continue;let h=d.indexOf(":");if((h===-1?d:d.slice(0,h))!=="data")continue;let p=h===-1?"":d.slice(h+1);p.startsWith(" ")&&(p=p.slice(1)),a.push(p)}}}finally{r.cancel().catch(()=>{})}}function BT(t,e,n){return e?.aborted?Promise.reject(Yb(e)):new Promise((i,r)=>{let o=!1,s=c=>{o||(o=!0,u!==void 0&&clearTimeout(u),e?.removeEventListener("abort",a),c())},a=()=>s(()=>r(Yb(e))),u=n!==void 0?setTimeout(()=>s(()=>r(new la(n))),n):void 0;e?.addEventListener("abort",a,{once:!0}),t.read().then(c=>s(()=>i(c)),c=>s(()=>r(GT(c))))})}function Yb(t){let e=t?.reason;return e instanceof Error?e:new Error("text stream aborted")}function GT(t){return t instanceof Error?t:new Error(String(t))}var la,fp=v(()=>{"use strict";la=class extends Error{constructor(e){super(`text stream idle for ${e}ms`),this.name="IdleTimeoutError"}}});var Bt,pp=v(()=>{"use strict";Bt=class extends Error{status;constructor(e,n){super(e),this.status=n,this.name="TextAdapterError"}}});function Qb(t){try{return JSON.parse(t)}catch{return}}function fn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0}function KT(t){return Array.isArray(t)?t:void 0}function e$(t){let e=fn(t)?.message;return typeof e=="string"?e:"unknown error"}var ha,WT,qT,HT,JT,da,Ti,Oi,mp=v(()=>{"use strict";fp();pp();ha=3e4,WT=4096,qT="https://api.anthropic.com/v1/messages",HT="2023-06-01",JT="https://api.openai.com/v1/chat/completions",da=class{key;fetchImpl;idleTimeoutMs;constructor(e,n=fetch,i=ha){this.key=e,this.fetchImpl=n,this.idleTimeoutMs=i}async*stream(e){let{url:n,init:i}=this.buildRequest(e),r=await this.fetchImpl(n,{...i,signal:e.signal});if(!r.ok)throw new Bt(`text provider request failed (HTTP ${r.status})`,r.status);if(!r.body)throw new Bt("text provider response had no body");for await(let o of Xb(r.body,{signal:e.signal,idleTimeoutMs:this.idleTimeoutMs})){if(this.isDone(o))return;let s=this.decode(o);s&&(yield s)}}},Ti=class extends da{buildRequest(e){let n={model:e.model,max_tokens:WT,stream:!0,messages:e.messages.map(i=>({role:i.role,content:i.content})),...e.system!==void 0&&{system:e.system}};return{url:qT,init:{method:"POST",headers:{"x-api-key":this.key,"anthropic-version":HT,"content-type":"application/json"},body:JSON.stringify(n)}}}isDone(){return!1}decode(e){let n=fn(Qb(e));if(!n)return null;if(n.type==="error")throw new Bt(`anthropic stream error: ${e$(n.error)}`);if(n.type==="content_block_delta"){let i=fn(n.delta);if(i?.type==="text_delta"&&typeof i.text=="string")return{type:"text",text:i.text}}return null}},Oi=class extends da{buildRequest(e){let n=e.system!==void 0?[{role:"system",content:e.system},...e.messages]:e.messages,i={model:e.model,stream:!0,messages:n};return{url:JT,init:{method:"POST",headers:{Authorization:`Bearer ${this.key}`,"content-type":"application/json"},body:JSON.stringify(i)}}}isDone(e){return e==="[DONE]"}decode(e){let n=fn(Qb(e));if(!n)return null;if(n.error)throw new Bt(`openai stream error: ${e$(n.error)}`);let i=KT(n.choices),r=i?fn(i[0])?.delta:void 0,o=fn(r)?.content;return typeof o=="string"&&o.length>0?{type:"text",text:o}:null}}});var Ai,gp=v(()=>{"use strict";mp();Ai=class{fetchImpl;idleTimeoutMs;constructor(e=fetch,n=ha){this.fetchImpl=e,this.idleTimeoutMs=n}textAdapter(e,n){switch(e.provider){case"anthropic":return new Ti(n,this.fetchImpl,this.idleTimeoutMs);case"openai":return new Oi(n,this.fetchImpl,this.idleTimeoutMs);default:throw new Error(`no text adapter for provider '${e.provider}'`)}}}});var Le,t$=v(()=>{"use strict";Le=class extends Error{commandId;reason;constructor(e,n,i){super(i??`send rejected (${n}) for command ${e}`),this.commandId=e,this.reason=n,this.name="SessionSendError"}}});var r$=v(()=>{"use strict"});var Pi=v(()=>{"use strict";t$();r$()});var gr,fa=v(()=>{"use strict";gr=class{nextId=1;timers=new Map;now(){return Date.now()}setTimer(e,n){let i=this.nextId++,r=setTimeout(()=>{this.timers.delete(i),n()},e);return this.timers.set(i,r),i}clearTimer(e){let n=this.timers.get(e);n!==void 0&&(clearTimeout(n),this.timers.delete(e))}}});function pt(t,e){let n=Math.floor(t.byteLength/2);if(n===0)return!1;let i=new DataView(t.buffer,t.byteOffset,t.byteLength),r=0;for(let o=0;o<n;o++){let s=i.getInt16(o*2,!0)/32768;r+=s*s}return Math.sqrt(r/n)>=e}function YT(t){let e=t.byteLength>>1,n=new DataView(t.buffer,t.byteOffset,t.byteLength),i=new Int16Array(e);for(let r=0;r<e;r++)i[r]=n.getInt16(r*2,!0);return i}var pn,Ci,Ri,mn=v(()=>{"use strict";we();pn=.02;Ci=class{threshold;constructor(e){this.threshold=e}classify(e,n){n(pt(e,this.threshold))}},Ri=class{vad;speechThreshold;energyThreshold;log;degraded=!1;announced=!1;disposed=!1;constructor(e,n={}){this.vad=e,this.speechThreshold=n.speechThreshold??.5,this.energyThreshold=n.energyThreshold??pn,this.log=n.log??B}classify(e,n){if(this.degraded){this.announce("energy (fallback)"),n(pt(e,this.energyThreshold));return}this.vad.process(YT(e)).then(i=>{if(!this.disposed){this.announce("silero");for(let r of i)n(r>=this.speechThreshold)}},i=>{this.disposed||(this.degrade(i),this.announce("energy (fallback)"),n(pt(e,this.energyThreshold)))})}reset(){!this.degraded&&!this.disposed&&this.vad.reset()}prewarm(){this.degraded||this.disposed||this.vad.load().then(()=>{},e=>this.degrade(e))}dispose(){return this.disposed=!0,this.vad.dispose()}degrade(e){this.degraded||this.disposed||(this.degraded=!0,this.log.debug("frame classifier DEGRADED to energy (fallback) - silero vad failed; turn-end classifies on RMS energy for the rest of the session",{error:e instanceof Error?e.message:String(e)}))}announce(e){this.announced||(this.announced=!0,this.log.debug(`frame classifier: ${e}`))}}});function gn(t){try{let e=JSON.parse(t);return typeof e=="object"&&e!==null?e:void 0}catch{return}}function zi(t){return typeof t=="string"?t:""}function pa(t){let e=t.message_type;return typeof e=="string"&&(XT.has(e)||e.endsWith("_error"))?e:typeof t.error=="string"&&t.error.length>0?"error":null}function n$(t){return Buffer.from(t).toString("base64")}function i$(t){return new Uint8Array(Buffer.from(t,"base64"))}function vn(t,e){return new Error(`${t} connection error: ${e.message}`)}var XT,ma=v(()=>{"use strict";XT=new Set(["error","auth_error","quota_exceeded","rate_limited"])});function a$(t,e){let n=new Uint8Array(e),i=0;for(let r of t)n.set(r,i),i+=r.byteLength;return n}function eO(t){if(t.message.length>0)return t.message;if(t instanceof AggregateError){let e=t.errors.find(n=>n instanceof Error&&n.message.length>0);if(e)return e.message}return t.name.length>0?t.name:"connection failed"}function tO(t){let e=Math.floor(t.byteLength/2),n=new DataView(t.buffer,t.byteOffset,e*2),i=new Float32Array(e);for(let r=0;r<e;r+=1)i[r]=n.getInt16(r*2,!0)/32768;return i}var ga,o$,s$,QT,Ni,vp,va=v(()=>{"use strict";we();fa();mn();ma();ga="ws://localhost:6007",o$=1e3,s$=10240,QT=1e4,Ni=class{socketFactory;url;clock;id="sherpa-onnx";partialStability="redecode";constructor(e,n=ga,i=new gr){this.socketFactory=e,this.url=n,this.clock=i}open(e){return e.biasTerms!==void 0&&e.biasTerms.length>0&&B.debug("sherpa ASR: biasTerms are not mappable on this engine (the TDT export ships no hotword vocab; watch k2-fsa/sherpa-onnx#3573) - proceeding unbiased",{count:e.biasTerms.length}),new vp(this.socketFactory,this.url,this.clock,e)}},vp=class{clock;opts;socket;opened=!1;aborted=!1;closed=!1;endRequested=!1;buffered=[];bufferedBytes=0;inFlightDecode=null;speechSinceLastDecode=!1;pendingReply=null;staleReplies=0;lastDecodeAtMs=-1/0;lastEmittedPartial=null;transcriptCb;errorCb;endPending=null;constructor(e,n,i,r){this.clock=i,this.opts=r,this.socket=e(n,{}),this.socket.onOpen(()=>this.handleOpen()),this.socket.onMessage(o=>this.handleMessage(o)),this.socket.onError(o=>this.handleError(o)),this.socket.onClose(()=>this.handleClose())}pushAudio(e){this.aborted||this.closed||this.endRequested||(this.buffered.push(e.slice()),this.bufferedBytes+=e.byteLength,!this.speechSinceLastDecode&&pt(e,pn)&&(this.speechSinceLastDecode=!0),this.opened&&this.opts.emitPartials&&this.maybeRedecodeTick())}onTranscript(e){this.transcriptCb=e}onError(e){this.errorCb=e}end(){return this.aborted?Promise.reject(new Error("ASR stream already aborted")):this.closed?Promise.reject(new Error("ASR stream already closed")):this.endPending?Promise.reject(new Error("ASR end() already in progress")):new Promise((e,n)=>{this.endPending={resolve:e,reject:n},this.endRequested=!0,this.opened&&this.runFinalDecode()})}abort(){if(this.aborted=!0,this.endPending){let{reject:e}=this.endPending;this.endPending=null,e(new Error("ASR stream aborted"))}return this.teardown(),Promise.resolve()}handleOpen(){this.aborted||this.closed||(this.opened=!0,this.endRequested&&this.runFinalDecode())}handleMessage(e){if(this.aborted||this.closed)return;let n=gn(e);if(n){if(this.staleReplies>0){this.staleReplies-=1;return}if(this.pendingReply){let{resolve:i,timer:r}=this.pendingReply;this.pendingReply=null,this.clock.clearTimer(r),i(zi(n.text))}}}handleError(e){if(this.closed)return;let n=vn("sherpa ASR",new Error(eO(e)));this.failStream(n)}handleClose(){this.closed||(this.closed=!0,this.settleFailure(new Error("sherpa ASR connection closed unexpectedly")))}failStream(e){this.settleFailure(e),this.teardown()}settleFailure(e){if(this.endPending){let{reject:n}=this.endPending;this.endPending=null,n(e)}this.rejectPendingReply(e),this.errorCb?.(e)}rejectPendingReply(e){if(!this.pendingReply)return;let{reject:n,timer:i}=this.pendingReply;this.pendingReply=null,this.clock.clearTimer(i),n(e)}maybeRedecodeTick(){if(this.inFlightDecode!==null||!this.speechSinceLastDecode||this.bufferedBytes<this.opts.sampleRate*2*(o$/1e3))return;let e=this.clock.now();e-this.lastDecodeAtMs<o$||(this.lastDecodeAtMs=e,this.speechSinceLastDecode=!1,this.inFlightDecode=this.decodeFullBuffer().then(n=>{this.aborted||this.closed||this.endRequested||n!==this.lastEmittedPartial&&(this.lastEmittedPartial=n,this.transcriptCb?.({text:n,isFinal:!1,startMs:0}))}).catch(()=>{}).finally(()=>{this.inFlightDecode=null}))}async runFinalDecode(){if(this.inFlightDecode!==null&&await this.inFlightDecode,this.aborted||this.closed||this.endPending===null)return;if(this.bufferedBytes===0){this.resolveEnd("");return}let e;try{e=await this.decodeFullBuffer()}catch(n){if(this.aborted||this.closed)return;this.failStream(n instanceof Error?n:new Error(String(n)));return}this.aborted||this.closed||this.resolveEnd(e)}resolveEnd(e){if(!this.endPending)return;let n={text:e.trim(),isFinal:!0,startMs:0};this.transcriptCb?.(n);let{resolve:i}=this.endPending;this.endPending=null,this.socket.send("Done"),this.teardown(),i(n)}decodeFullBuffer(){let e=tO(a$(this.buffered,this.bufferedBytes)),n=new Uint8Array(e.buffer,0,e.byteLength),i=new Uint8Array(8),r=new DataView(i.buffer);r.setUint32(0,this.opts.sampleRate,!0),r.setUint32(4,n.byteLength,!0);let o=a$([i,n],i.byteLength+n.byteLength),s=new Promise((a,u)=>{let c=this.clock.setTimer(this.decodeReplyTimeoutMs(),()=>{this.pendingReply&&(this.pendingReply=null,this.staleReplies+=1,u(new Error("sherpa ASR decode timed out")))});this.pendingReply={resolve:a,reject:u,timer:c}});try{for(let a=0;a<o.byteLength;a+=s$)this.socket.send(o.subarray(a,Math.min(a+s$,o.byteLength)))}catch(a){this.rejectPendingReply(a instanceof Error?a:new Error(String(a)))}return s}decodeReplyTimeoutMs(){let e=this.bufferedBytes/2/this.opts.sampleRate*1e3;return QT+Math.ceil(e)}teardown(){this.closed||(this.closed=!0,this.rejectPendingReply(new Error("sherpa ASR stream closed")),this.socket.close())}}});var St=R((WU,l$)=>{"use strict";var u$=["nodebuffer","arraybuffer","fragments"],c$=typeof Blob<"u";c$&&u$.push("blob");l$.exports={BINARY_TYPES:u$,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:c$,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Di=R((qU,ya)=>{"use strict";var{EMPTY_BUFFER:rO}=St(),yp=Buffer[Symbol.species];function nO(t,e){if(t.length===0)return rO;if(t.length===1)return t[0];let n=Buffer.allocUnsafe(e),i=0;for(let r=0;r<t.length;r++){let o=t[r];n.set(o,i),i+=o.length}return i<e?new yp(n.buffer,n.byteOffset,i):n}function d$(t,e,n,i,r){for(let o=0;o<r;o++)n[i+o]=t[o]^e[o&3]}function h$(t,e){for(let n=0;n<t.length;n++)t[n]^=e[n&3]}function iO(t){return t.length===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.length)}function _p(t){if(_p.readOnly=!0,Buffer.isBuffer(t))return t;let e;return t instanceof ArrayBuffer?e=new yp(t):ArrayBuffer.isView(t)?e=new yp(t.buffer,t.byteOffset,t.byteLength):(e=Buffer.from(t),_p.readOnly=!1),e}ya.exports={concat:nO,mask:d$,toArrayBuffer:iO,toBuffer:_p,unmask:h$};if(!process.env.WS_NO_BUFFER_UTIL)try{let t=ae("bufferutil");ya.exports.mask=function(e,n,i,r,o){o<48?d$(e,n,i,r,o):t.mask(e,n,i,r,o)},ya.exports.unmask=function(e,n){e.length<32?h$(e,n):t.unmask(e,n)}}catch{}});var m$=R((HU,p$)=>{"use strict";var f$=Symbol("kDone"),bp=Symbol("kRun"),$p=class{constructor(e){this[f$]=()=>{this.pending--,this[bp]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[bp]()}[bp](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[f$])}}};p$.exports=$p});var bn=R((JU,_$)=>{"use strict";var Li=ae("zlib"),g$=Di(),oO=m$(),{kStatusCode:v$}=St(),sO=Buffer[Symbol.species],aO=Buffer.from([0,0,255,255]),ba=Symbol("permessage-deflate"),kt=Symbol("total-length"),yn=Symbol("callback"),Gt=Symbol("buffers"),_n=Symbol("error"),_a,xp=class{constructor(e){if(this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!_a){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;_a=new oO(n)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[yn];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let n=this._options,i=e.find(r=>!(n.serverNoContextTakeover===!1&&r.server_no_context_takeover||r.server_max_window_bits&&(n.serverMaxWindowBits===!1||typeof n.serverMaxWindowBits=="number"&&n.serverMaxWindowBits>r.server_max_window_bits)||typeof n.clientMaxWindowBits=="number"&&!r.client_max_window_bits));if(!i)throw new Error("None of the extension offers can be accepted");return n.serverNoContextTakeover&&(i.server_no_context_takeover=!0),n.clientNoContextTakeover&&(i.client_no_context_takeover=!0),typeof n.serverMaxWindowBits=="number"&&(i.server_max_window_bits=n.serverMaxWindowBits),typeof n.clientMaxWindowBits=="number"?i.client_max_window_bits=n.clientMaxWindowBits:(i.client_max_window_bits===!0||n.clientMaxWindowBits===!1)&&delete i.client_max_window_bits,i}acceptAsClient(e){let n=e[0];if(this._options.clientNoContextTakeover===!1&&n.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!n.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(n.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&n.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return n}normalizeParams(e){return e.forEach(n=>{Object.keys(n).forEach(i=>{let r=n[i];if(r.length>1)throw new Error(`Parameter "${i}" must have only a single value`);if(r=r[0],i==="client_max_window_bits"){if(r!==!0){let o=+r;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${i}": ${r}`);r=o}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${i}": ${r}`)}else if(i==="server_max_window_bits"){let o=+r;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${i}": ${r}`);r=o}else if(i==="client_no_context_takeover"||i==="server_no_context_takeover"){if(r!==!0)throw new TypeError(`Invalid value for parameter "${i}": ${r}`)}else throw new Error(`Unknown parameter "${i}"`);n[i]=r})}),e}decompress(e,n,i){_a.add(r=>{this._decompress(e,n,(o,s)=>{r(),i(o,s)})})}compress(e,n,i){_a.add(r=>{this._compress(e,n,(o,s)=>{r(),i(o,s)})})}_decompress(e,n,i){let r=this._isServer?"client":"server";if(!this._inflate){let o=`${r}_max_window_bits`,s=typeof this.params[o]!="number"?Li.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=Li.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[ba]=this,this._inflate[kt]=0,this._inflate[Gt]=[],this._inflate.on("error",cO),this._inflate.on("data",y$)}this._inflate[yn]=i,this._inflate.write(e),n&&this._inflate.write(aO),this._inflate.flush(()=>{let o=this._inflate[_n];if(o){this._inflate.close(),this._inflate=null,i(o);return}let s=g$.concat(this._inflate[Gt],this._inflate[kt]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[kt]=0,this._inflate[Gt]=[],n&&this.params[`${r}_no_context_takeover`]&&this._inflate.reset()),i(null,s)})}_compress(e,n,i){let r=this._isServer?"server":"client";if(!this._deflate){let o=`${r}_max_window_bits`,s=typeof this.params[o]!="number"?Li.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=Li.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[kt]=0,this._deflate[Gt]=[],this._deflate.on("data",uO)}this._deflate[yn]=i,this._deflate.write(e),this._deflate.flush(Li.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=g$.concat(this._deflate[Gt],this._deflate[kt]);n&&(o=new sO(o.buffer,o.byteOffset,o.length-4)),this._deflate[yn]=null,this._deflate[kt]=0,this._deflate[Gt]=[],n&&this.params[`${r}_no_context_takeover`]&&this._deflate.reset(),i(null,o)})}};_$.exports=xp;function uO(t){this[Gt].push(t),this[kt]+=t.length}function y$(t){if(this[kt]+=t.length,this[ba]._maxPayload<1||this[kt]<=this[ba]._maxPayload){this[Gt].push(t);return}this[_n]=new RangeError("Max payload size exceeded"),this[_n].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[_n][v$]=1009,this.removeListener("data",y$),this.reset()}function cO(t){if(this[ba]._inflate=null,this[_n]){this[yn](this[_n]);return}t[v$]=1007,this[yn](t)}});var $n=R((KU,$a)=>{"use strict";var{isUtf8:b$}=ae("buffer"),{hasBlob:lO}=St(),dO=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function hO(t){return t>=1e3&&t<=1014&&t!==1004&&t!==1005&&t!==1006||t>=3e3&&t<=4999}function wp(t){let e=t.length,n=0;for(;n<e;)if((t[n]&128)===0)n++;else if((t[n]&224)===192){if(n+1===e||(t[n+1]&192)!==128||(t[n]&254)===192)return!1;n+=2}else if((t[n]&240)===224){if(n+2>=e||(t[n+1]&192)!==128||(t[n+2]&192)!==128||t[n]===224&&(t[n+1]&224)===128||t[n]===237&&(t[n+1]&224)===160)return!1;n+=3}else if((t[n]&248)===240){if(n+3>=e||(t[n+1]&192)!==128||(t[n+2]&192)!==128||(t[n+3]&192)!==128||t[n]===240&&(t[n+1]&240)===128||t[n]===244&&t[n+1]>143||t[n]>244)return!1;n+=4}else return!1;return!0}function fO(t){return lO&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&(t[Symbol.toStringTag]==="Blob"||t[Symbol.toStringTag]==="File")}$a.exports={isBlob:fO,isValidStatusCode:hO,isValidUTF8:wp,tokenChars:dO};if(b$)$a.exports.isValidUTF8=function(t){return t.length<24?wp(t):b$(t)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let t=ae("utf-8-validate");$a.exports.isValidUTF8=function(e){return e.length<32?wp(e):t(e)}}catch{}});var Tp=R((YU,I$)=>{"use strict";var{Writable:pO}=ae("stream"),$$=bn(),{BINARY_TYPES:mO,EMPTY_BUFFER:x$,kStatusCode:gO,kWebSocket:vO}=St(),{concat:Sp,toArrayBuffer:yO,unmask:_O}=Di(),{isValidStatusCode:bO,isValidUTF8:w$}=$n(),xa=Buffer[Symbol.species],Ye=0,S$=1,k$=2,E$=3,kp=4,Ep=5,wa=6,Ip=class extends pO{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||mO[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxBufferedChunks=e.maxBufferedChunks|0,this._maxFragments=e.maxFragments|0,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[vO]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=Ye}_write(e,n,i){if(this._opcode===8&&this._state==Ye)return i();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){i(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(i)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let i=this._buffers[0];return this._buffers[0]=new xa(i.buffer,i.byteOffset+e,i.length-e),new xa(i.buffer,i.byteOffset,e)}let n=Buffer.allocUnsafe(e);do{let i=this._buffers[0],r=n.length-e;e>=i.length?n.set(this._buffers.shift(),r):(n.set(new Uint8Array(i.buffer,i.byteOffset,e),r),this._buffers[0]=new xa(i.buffer,i.byteOffset+e,i.length-e)),e-=i.length}while(e>0);return n}startLoop(e){this._loop=!0;do switch(this._state){case Ye:this.getInfo(e);break;case S$:this.getPayloadLength16(e);break;case k$:this.getPayloadLength64(e);break;case E$:this.getMask();break;case kp:this.getData(e);break;case Ep:case wa:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let n=this.consume(2);if((n[0]&48)!==0){let r=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(r);return}let i=(n[0]&64)===64;if(i&&!this._extensions[$$.extensionName]){let r=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(r);return}if(this._fin=(n[0]&128)===128,this._opcode=n[0]&15,this._payloadLength=n[1]&127,this._opcode===0){if(i){let r=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(r);return}if(!this._fragmented){let r=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(r);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let r=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(r);return}this._compressed=i}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let r=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(r);return}if(i){let r=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(r);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let r=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(r);return}}else{let r=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(r);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(n[1]&128)===128,this._isServer){if(!this._masked){let r=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(r);return}}else if(this._masked){let r=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(r);return}this._payloadLength===126?this._state=S$:this._payloadLength===127?this._state=k$:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let n=this.consume(8),i=n.readUInt32BE(0);if(i>Math.pow(2,21)-1){let r=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(r);return}this._payloadLength=i*Math.pow(2,32)+n.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let n=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(n);return}this._masked?this._state=E$:this._state=kp}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=kp}getData(e){let n=x$;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}n=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&_O(n,this._mask)}if(this._opcode>7){this.controlMessage(n,e);return}if(this._compressed){this._state=Ep,this.decompress(n,e);return}if(n.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let i=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");e(i);return}this._messageLength=this._totalPayloadLength,this._fragments.push(n)}this.dataMessage(e)}decompress(e,n){this._extensions[$$.extensionName].decompress(e,this._fin,(r,o)=>{if(r)return n(r);if(o.length){if(this._messageLength+=o.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let s=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");n(s);return}if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let s=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");n(s);return}this._fragments.push(o)}this.dataMessage(n),this._state===Ye&&this.startLoop(n)})}dataMessage(e){if(!this._fin){this._state=Ye;return}let n=this._messageLength,i=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let r;this._binaryType==="nodebuffer"?r=Sp(i,n):this._binaryType==="arraybuffer"?r=yO(Sp(i,n)):this._binaryType==="blob"?r=new Blob(i):r=i,this._allowSynchronousEvents?(this.emit("message",r,!0),this._state=Ye):(this._state=wa,setImmediate(()=>{this.emit("message",r,!0),this._state=Ye,this.startLoop(e)}))}else{let r=Sp(i,n);if(!this._skipUTF8Validation&&!w$(r)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(o);return}this._state===Ep||this._allowSynchronousEvents?(this.emit("message",r,!1),this._state=Ye):(this._state=wa,setImmediate(()=>{this.emit("message",r,!1),this._state=Ye,this.startLoop(e)}))}}controlMessage(e,n){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,x$),this.end();else{let i=e.readUInt16BE(0);if(!bO(i)){let o=this.createError(RangeError,`invalid status code ${i}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");n(o);return}let r=new xa(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!w$(r)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");n(o);return}this._loop=!1,this.emit("conclude",i,r),this.end()}this._state=Ye;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=Ye):(this._state=wa,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=Ye,this.startLoop(n)}))}createError(e,n,i,r,o){this._loop=!1,this._errored=!0;let s=new e(i?`Invalid WebSocket frame: ${n}`:n);return Error.captureStackTrace(s,this.createError),s.code=o,s[gO]=r,s}};I$.exports=Ip});var Pp=R((QU,A$)=>{"use strict";var{Duplex:XU}=ae("stream"),{randomFillSync:$O}=ae("crypto"),{types:{isUint8Array:xO}}=ae("util"),T$=bn(),{EMPTY_BUFFER:wO,kWebSocket:SO,NOOP:kO}=St(),{isBlob:xn,isValidStatusCode:EO}=$n(),{mask:O$,toBuffer:vr}=Di(),Xe=Symbol("kByteLength"),IO=Buffer.alloc(4),Sa=8*1024,yr,wn=Sa,at=0,TO=1,OO=2,Op=class t{constructor(e,n,i){this._extensions=n||{},i&&(this._generateMask=i,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=at,this.onerror=kO,this[SO]=void 0}static frame(e,n){let i,r=!1,o=2,s=!1;n.mask&&(i=n.maskBuffer||IO,n.generateMask?n.generateMask(i):(wn===Sa&&(yr===void 0&&(yr=Buffer.alloc(Sa)),$O(yr,0,Sa),wn=0),i[0]=yr[wn++],i[1]=yr[wn++],i[2]=yr[wn++],i[3]=yr[wn++]),s=(i[0]|i[1]|i[2]|i[3])===0,o=6);let a;typeof e=="string"?(!n.mask||s)&&n[Xe]!==void 0?a=n[Xe]:(e=Buffer.from(e),a=e.length):(a=e.length,r=n.mask&&n.readOnly&&!s);let u=a;a>=65536?(o+=8,u=127):a>125&&(o+=2,u=126);let c=Buffer.allocUnsafe(r?a+o:o);return c[0]=n.fin?n.opcode|128:n.opcode,n.rsv1&&(c[0]|=64),c[1]=u,u===126?c.writeUInt16BE(a,2):u===127&&(c[2]=c[3]=0,c.writeUIntBE(a,4,6)),n.mask?(c[1]|=128,c[o-4]=i[0],c[o-3]=i[1],c[o-2]=i[2],c[o-1]=i[3],s?[c,e]:r?(O$(e,i,c,o,a),[c]):(O$(e,i,e,0,a),[c,e])):[c,e]}close(e,n,i,r){let o;if(e===void 0)o=wO;else{if(typeof e!="number"||!EO(e))throw new TypeError("First argument must be a valid error code number");if(n===void 0||!n.length)o=Buffer.allocUnsafe(2),o.writeUInt16BE(e,0);else{let a=Buffer.byteLength(n);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");if(o=Buffer.allocUnsafe(2+a),o.writeUInt16BE(e,0),typeof n=="string")o.write(n,2);else if(xO(n))o.set(n,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let s={[Xe]:o.length,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==at?this.enqueue([this.dispatch,o,!1,s,r]):this.sendFrame(t.frame(o,s),r)}ping(e,n,i){let r,o;if(typeof e=="string"?(r=Buffer.byteLength(e),o=!1):xn(e)?(r=e.size,o=!1):(e=vr(e),r=e.length,o=vr.readOnly),r>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[Xe]:r,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};xn(e)?this._state!==at?this.enqueue([this.getBlobData,e,!1,s,i]):this.getBlobData(e,!1,s,i):this._state!==at?this.enqueue([this.dispatch,e,!1,s,i]):this.sendFrame(t.frame(e,s),i)}pong(e,n,i){let r,o;if(typeof e=="string"?(r=Buffer.byteLength(e),o=!1):xn(e)?(r=e.size,o=!1):(e=vr(e),r=e.length,o=vr.readOnly),r>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[Xe]:r,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};xn(e)?this._state!==at?this.enqueue([this.getBlobData,e,!1,s,i]):this.getBlobData(e,!1,s,i):this._state!==at?this.enqueue([this.dispatch,e,!1,s,i]):this.sendFrame(t.frame(e,s),i)}send(e,n,i){let r=this._extensions[T$.extensionName],o=n.binary?2:1,s=n.compress,a,u;typeof e=="string"?(a=Buffer.byteLength(e),u=!1):xn(e)?(a=e.size,u=!1):(e=vr(e),a=e.length,u=vr.readOnly),this._firstFragment?(this._firstFragment=!1,s&&r&&r.params[r._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(s=a>=r._threshold),this._compress=s):(s=!1,o=0),n.fin&&(this._firstFragment=!0);let c={[Xe]:a,fin:n.fin,generateMask:this._generateMask,mask:n.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:u,rsv1:s};xn(e)?this._state!==at?this.enqueue([this.getBlobData,e,this._compress,c,i]):this.getBlobData(e,this._compress,c,i):this._state!==at?this.enqueue([this.dispatch,e,this._compress,c,i]):this.dispatch(e,this._compress,c,i)}getBlobData(e,n,i,r){this._bufferedBytes+=i[Xe],this._state=OO,e.arrayBuffer().then(o=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Ap,this,a,r);return}this._bufferedBytes-=i[Xe];let s=vr(o);n?this.dispatch(s,n,i,r):(this._state=at,this.sendFrame(t.frame(s,i),r),this.dequeue())}).catch(o=>{process.nextTick(AO,this,o,r)})}dispatch(e,n,i,r){if(!n){this.sendFrame(t.frame(e,i),r);return}let o=this._extensions[T$.extensionName];this._bufferedBytes+=i[Xe],this._state=TO,o.compress(e,i.fin,(s,a)=>{if(this._socket.destroyed){let u=new Error("The socket was closed while data was being compressed");Ap(this,u,r);return}this._bufferedBytes-=i[Xe],this._state=at,i.readOnly=!1,this.sendFrame(t.frame(a,i),r),this.dequeue()})}dequeue(){for(;this._state===at&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][Xe],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][Xe],this._queue.push(e)}sendFrame(e,n){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],n),this._socket.uncork()):this._socket.write(e[0],n)}};A$.exports=Op;function Ap(t,e,n){typeof n=="function"&&n(e);for(let i=0;i<t._queue.length;i++){let r=t._queue[i],o=r[r.length-1];typeof o=="function"&&o(e)}}function AO(t,e,n){Ap(t,e,n),t.onerror(e)}});var j$=R((ej,U$)=>{"use strict";var{kForOnEventAttribute:Ui,kListener:Cp}=St(),P$=Symbol("kCode"),C$=Symbol("kData"),R$=Symbol("kError"),z$=Symbol("kMessage"),N$=Symbol("kReason"),Sn=Symbol("kTarget"),D$=Symbol("kType"),L$=Symbol("kWasClean"),Et=class{constructor(e){this[Sn]=null,this[D$]=e}get target(){return this[Sn]}get type(){return this[D$]}};Object.defineProperty(Et.prototype,"target",{enumerable:!0});Object.defineProperty(Et.prototype,"type",{enumerable:!0});var _r=class extends Et{constructor(e,n={}){super(e),this[P$]=n.code===void 0?0:n.code,this[N$]=n.reason===void 0?"":n.reason,this[L$]=n.wasClean===void 0?!1:n.wasClean}get code(){return this[P$]}get reason(){return this[N$]}get wasClean(){return this[L$]}};Object.defineProperty(_r.prototype,"code",{enumerable:!0});Object.defineProperty(_r.prototype,"reason",{enumerable:!0});Object.defineProperty(_r.prototype,"wasClean",{enumerable:!0});var kn=class extends Et{constructor(e,n={}){super(e),this[R$]=n.error===void 0?null:n.error,this[z$]=n.message===void 0?"":n.message}get error(){return this[R$]}get message(){return this[z$]}};Object.defineProperty(kn.prototype,"error",{enumerable:!0});Object.defineProperty(kn.prototype,"message",{enumerable:!0});var ji=class extends Et{constructor(e,n={}){super(e),this[C$]=n.data===void 0?null:n.data}get data(){return this[C$]}};Object.defineProperty(ji.prototype,"data",{enumerable:!0});var PO={addEventListener(t,e,n={}){for(let r of this.listeners(t))if(!n[Ui]&&r[Cp]===e&&!r[Ui])return;let i;if(t==="message")i=function(o,s){let a=new ji("message",{data:s?o:o.toString()});a[Sn]=this,ka(e,this,a)};else if(t==="close")i=function(o,s){let a=new _r("close",{code:o,reason:s.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[Sn]=this,ka(e,this,a)};else if(t==="error")i=function(o){let s=new kn("error",{error:o,message:o.message});s[Sn]=this,ka(e,this,s)};else if(t==="open")i=function(){let o=new Et("open");o[Sn]=this,ka(e,this,o)};else return;i[Ui]=!!n[Ui],i[Cp]=e,n.once?this.once(t,i):this.on(t,i)},removeEventListener(t,e){for(let n of this.listeners(t))if(n[Cp]===e&&!n[Ui]){this.removeListener(t,n);break}}};U$.exports={CloseEvent:_r,ErrorEvent:kn,Event:Et,EventTarget:PO,MessageEvent:ji};function ka(t,e,n){typeof t=="object"&&t.handleEvent?t.handleEvent.call(t,n):t.call(e,n)}});var Ea=R((tj,M$)=>{"use strict";var{tokenChars:Mi}=$n();function mt(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}function CO(t){let e=Object.create(null),n=Object.create(null),i=!1,r=!1,o=!1,s,a,u=-1,c=-1,l=-1,d=0;for(;d<t.length;d++)if(c=t.charCodeAt(d),s===void 0)if(l===-1&&Mi[c]===1)u===-1&&(u=d);else if(d!==0&&(c===32||c===9))l===-1&&u!==-1&&(l=d);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d);let f=t.slice(u,l);c===44?(mt(e,f,n),n=Object.create(null)):s=f,u=l=-1}else throw new SyntaxError(`Unexpected character at index ${d}`);else if(a===void 0)if(l===-1&&Mi[c]===1)u===-1&&(u=d);else if(c===32||c===9)l===-1&&u!==-1&&(l=d);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d),mt(n,t.slice(u,l),!0),c===44&&(mt(e,s,n),n=Object.create(null),s=void 0),u=l=-1}else if(c===61&&u!==-1&&l===-1)a=t.slice(u,d),u=l=-1;else throw new SyntaxError(`Unexpected character at index ${d}`);else if(r){if(Mi[c]!==1)throw new SyntaxError(`Unexpected character at index ${d}`);u===-1?u=d:i||(i=!0),r=!1}else if(o)if(Mi[c]===1)u===-1&&(u=d);else if(c===34&&u!==-1)o=!1,l=d;else if(c===92)r=!0;else throw new SyntaxError(`Unexpected character at index ${d}`);else if(c===34&&t.charCodeAt(d-1)===61)o=!0;else if(l===-1&&Mi[c]===1)u===-1&&(u=d);else if(u!==-1&&(c===32||c===9))l===-1&&(l=d);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d);let f=t.slice(u,l);i&&(f=f.replace(/\\/g,""),i=!1),mt(n,a,f),c===44&&(mt(e,s,n),n=Object.create(null),s=void 0),a=void 0,u=l=-1}else throw new SyntaxError(`Unexpected character at index ${d}`);if(u===-1||o||c===32||c===9)throw new SyntaxError("Unexpected end of input");l===-1&&(l=d);let h=t.slice(u,l);return s===void 0?mt(e,h,n):(a===void 0?mt(n,h,!0):i?mt(n,a,h.replace(/\\/g,"")):mt(n,a,h),mt(e,s,n)),e}function RO(t){return Object.keys(t).map(e=>{let n=t[e];return Array.isArray(n)||(n=[n]),n.map(i=>[e].concat(Object.keys(i).map(r=>{let o=i[r];return Array.isArray(o)||(o=[o]),o.map(s=>s===!0?r:`${r}=${s}`).join("; ")})).join("; ")).join(", ")}).join(", ")}M$.exports={format:RO,parse:CO}});var Aa=R((ij,X$)=>{"use strict";var zO=ae("events"),NO=ae("https"),DO=ae("http"),Z$=ae("net"),LO=ae("tls"),{randomBytes:UO,createHash:jO}=ae("crypto"),{Duplex:rj,Readable:nj}=ae("stream"),{URL:Rp}=ae("url"),Wt=bn(),MO=Tp(),FO=Pp(),{isBlob:VO}=$n(),{BINARY_TYPES:F$,CLOSE_TIMEOUT:ZO,EMPTY_BUFFER:Ia,GUID:BO,kForOnEventAttribute:zp,kListener:GO,kStatusCode:WO,kWebSocket:ge,NOOP:B$}=St(),{EventTarget:{addEventListener:qO,removeEventListener:HO}}=j$(),{format:JO,parse:KO}=Ea(),{toBuffer:YO}=Di(),G$=Symbol("kAborted"),Np=[8,13],It=["CONNECTING","OPEN","CLOSING","CLOSED"],XO=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,re=class t extends zO{constructor(e,n,i){super(),this._binaryType=F$[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Ia,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=t.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,n===void 0?n=[]:Array.isArray(n)||(typeof n=="object"&&n!==null?(i=n,n=[]):n=[n]),W$(this,e,n,i)):(this._autoPong=i.autoPong,this._closeTimeout=i.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){F$.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,n,i){let r=new MO({allowSynchronousEvents:i.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:i.maxBufferedChunks,maxFragments:i.maxFragments,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation}),o=new FO(e,this._extensions,i.generateMask);this._receiver=r,this._sender=o,this._socket=e,r[ge]=this,o[ge]=this,e[ge]=this,r.on("conclude",tA),r.on("drain",rA),r.on("error",nA),r.on("message",iA),r.on("ping",oA),r.on("pong",sA),o.onerror=aA,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),n.length>0&&e.unshift(n),e.on("close",J$),e.on("data",Oa),e.on("end",K$),e.on("error",Y$),this._readyState=t.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Wt.extensionName]&&this._extensions[Wt.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,n){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){qe(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===t.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=t.CLOSING,this._sender.close(e,n,!this._isServer,i=>{i||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),H$(this)}}pause(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,n,i){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(i=e,e=n=void 0):typeof n=="function"&&(i=n,n=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Dp(this,e,i);return}n===void 0&&(n=!this._isServer),this._sender.ping(e||Ia,n,i)}pong(e,n,i){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(i=e,e=n=void 0):typeof n=="function"&&(i=n,n=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Dp(this,e,i);return}n===void 0&&(n=!this._isServer),this._sender.pong(e||Ia,n,i)}resume(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,n,i){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof n=="function"&&(i=n,n={}),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Dp(this,e,i);return}let r={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...n};this._extensions[Wt.extensionName]||(r.compress=!1),this._sender.send(e||Ia,r,i)}terminate(){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){qe(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=t.CLOSING,this._socket.destroy())}}};Object.defineProperty(re,"CONNECTING",{enumerable:!0,value:It.indexOf("CONNECTING")});Object.defineProperty(re.prototype,"CONNECTING",{enumerable:!0,value:It.indexOf("CONNECTING")});Object.defineProperty(re,"OPEN",{enumerable:!0,value:It.indexOf("OPEN")});Object.defineProperty(re.prototype,"OPEN",{enumerable:!0,value:It.indexOf("OPEN")});Object.defineProperty(re,"CLOSING",{enumerable:!0,value:It.indexOf("CLOSING")});Object.defineProperty(re.prototype,"CLOSING",{enumerable:!0,value:It.indexOf("CLOSING")});Object.defineProperty(re,"CLOSED",{enumerable:!0,value:It.indexOf("CLOSED")});Object.defineProperty(re.prototype,"CLOSED",{enumerable:!0,value:It.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(t=>{Object.defineProperty(re.prototype,t,{enumerable:!0})});["open","error","close","message"].forEach(t=>{Object.defineProperty(re.prototype,`on${t}`,{enumerable:!0,get(){for(let e of this.listeners(t))if(e[zp])return e[GO];return null},set(e){for(let n of this.listeners(t))if(n[zp]){this.removeListener(t,n);break}typeof e=="function"&&this.addEventListener(t,e,{[zp]:!0})}})});re.prototype.addEventListener=qO;re.prototype.removeEventListener=HO;X$.exports=re;function W$(t,e,n,i){let r={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:ZO,protocolVersion:Np[1],maxBufferedChunks:1048576,maxFragments:131072,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...i,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(t._autoPong=r.autoPong,t._closeTimeout=r.closeTimeout,!Np.includes(r.protocolVersion))throw new RangeError(`Unsupported protocol version: ${r.protocolVersion} (supported versions: ${Np.join(", ")})`);let o;if(e instanceof Rp)o=e;else try{o=new Rp(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}o.protocol==="http:"?o.protocol="ws:":o.protocol==="https:"&&(o.protocol="wss:"),t._url=o.href;let s=o.protocol==="wss:",a=o.protocol==="ws+unix:",u;if(o.protocol!=="ws:"&&!s&&!a?u=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!o.pathname?u="The URL's pathname is empty":o.hash&&(u="The URL contains a fragment identifier"),u){let _=new SyntaxError(u);if(t._redirects===0)throw _;Ta(t,_);return}let c=s?443:80,l=UO(16).toString("base64"),d=s?NO.request:DO.request,h=new Set,f;if(r.createConnection=r.createConnection||(s?eA:QO),r.defaultPort=r.defaultPort||c,r.port=o.port||c,r.host=o.hostname.startsWith("[")?o.hostname.slice(1,-1):o.hostname,r.headers={...r.headers,"Sec-WebSocket-Version":r.protocolVersion,"Sec-WebSocket-Key":l,Connection:"Upgrade",Upgrade:"websocket"},r.path=o.pathname+o.search,r.timeout=r.handshakeTimeout,r.perMessageDeflate&&(f=new Wt({...r.perMessageDeflate,isServer:!1,maxPayload:r.maxPayload}),r.headers["Sec-WebSocket-Extensions"]=JO({[Wt.extensionName]:f.offer()})),n.length){for(let _ of n){if(typeof _!="string"||!XO.test(_)||h.has(_))throw new SyntaxError("An invalid or duplicated subprotocol was specified");h.add(_)}r.headers["Sec-WebSocket-Protocol"]=n.join(",")}if(r.origin&&(r.protocolVersion<13?r.headers["Sec-WebSocket-Origin"]=r.origin:r.headers.Origin=r.origin),(o.username||o.password)&&(r.auth=`${o.username}:${o.password}`),a){let _=r.path.split(":");r.socketPath=_[0],r.path=_[1]}let p;if(r.followRedirects){if(t._redirects===0){t._originalIpc=a,t._originalSecure=s,t._originalHostOrSocketPath=a?r.socketPath:o.host;let _=i&&i.headers;if(i={...i,headers:{}},_)for(let[S,k]of Object.entries(_))i.headers[S.toLowerCase()]=k}else if(t.listenerCount("redirect")===0){let _=a?t._originalIpc?r.socketPath===t._originalHostOrSocketPath:!1:t._originalIpc?!1:o.host===t._originalHostOrSocketPath;(!_||t._originalSecure&&!s)&&(delete r.headers.authorization,delete r.headers.cookie,_||delete r.headers.host,r.auth=void 0)}r.auth&&!i.headers.authorization&&(i.headers.authorization="Basic "+Buffer.from(r.auth).toString("base64")),p=t._req=d(r),t._redirects&&t.emit("redirect",t.url,p)}else p=t._req=d(r);r.timeout&&p.on("timeout",()=>{qe(t,p,"Opening handshake has timed out")}),p.on("error",_=>{p===null||p[G$]||(p=t._req=null,Ta(t,_))}),p.on("response",_=>{let S=_.headers.location,k=_.statusCode;if(S&&r.followRedirects&&k>=300&&k<400){if(++t._redirects>r.maxRedirects){qe(t,p,"Maximum redirects exceeded");return}p.abort();let P;try{P=new Rp(S,e)}catch{let E=new SyntaxError(`Invalid URL: ${S}`);Ta(t,E);return}W$(t,P,n,i)}else t.emit("unexpected-response",p,_)||qe(t,p,`Unexpected server response: ${_.statusCode}`)}),p.on("upgrade",(_,S,k)=>{if(t.emit("upgrade",_),t.readyState!==re.CONNECTING)return;p=t._req=null;let P=_.headers.upgrade;if(P===void 0||P.toLowerCase()!=="websocket"){qe(t,S,"Invalid Upgrade header");return}let C=jO("sha1").update(l+BO).digest("base64");if(_.headers["sec-websocket-accept"]!==C){qe(t,S,"Invalid Sec-WebSocket-Accept header");return}let E=_.headers["sec-websocket-protocol"],T;if(E!==void 0?h.size?h.has(E)||(T="Server sent an invalid subprotocol"):T="Server sent a subprotocol but none was requested":h.size&&(T="Server sent no subprotocol"),T){qe(t,S,T);return}E&&(t._protocol=E);let Z=_.headers["sec-websocket-extensions"];if(Z!==void 0){if(!f){qe(t,S,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let F;try{F=KO(Z)}catch{qe(t,S,"Invalid Sec-WebSocket-Extensions header");return}let q=Object.keys(F);if(q.length!==1||q[0]!==Wt.extensionName){qe(t,S,"Server indicated an extension that was not requested");return}try{f.accept(F[Wt.extensionName])}catch{qe(t,S,"Invalid Sec-WebSocket-Extensions header");return}t._extensions[Wt.extensionName]=f}t.setSocket(S,k,{allowSynchronousEvents:r.allowSynchronousEvents,generateMask:r.generateMask,maxBufferedChunks:r.maxBufferedChunks,maxFragments:r.maxFragments,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation})}),r.finishRequest?r.finishRequest(p,t):p.end()}function Ta(t,e){t._readyState=re.CLOSING,t._errorEmitted=!0,t.emit("error",e),t.emitClose()}function QO(t){return t.path=t.socketPath,Z$.connect(t)}function eA(t){return t.path=void 0,!t.servername&&t.servername!==""&&(t.servername=Z$.isIP(t.host)?"":t.host),LO.connect(t)}function qe(t,e,n){t._readyState=re.CLOSING;let i=new Error(n);Error.captureStackTrace(i,qe),e.setHeader?(e[G$]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Ta,t,i)):(e.destroy(i),e.once("error",t.emit.bind(t,"error")),e.once("close",t.emitClose.bind(t)))}function Dp(t,e,n){if(e){let i=VO(e)?e.size:YO(e).length;t._socket?t._sender._bufferedBytes+=i:t._bufferedAmount+=i}if(n){let i=new Error(`WebSocket is not open: readyState ${t.readyState} (${It[t.readyState]})`);process.nextTick(n,i)}}function tA(t,e){let n=this[ge];n._closeFrameReceived=!0,n._closeMessage=e,n._closeCode=t,n._socket[ge]!==void 0&&(n._socket.removeListener("data",Oa),process.nextTick(q$,n._socket),t===1005?n.close():n.close(t,e))}function rA(){let t=this[ge];t.isPaused||t._socket.resume()}function nA(t){let e=this[ge];e._socket[ge]!==void 0&&(e._socket.removeListener("data",Oa),process.nextTick(q$,e._socket),e.close(t[WO])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t))}function V$(){this[ge].emitClose()}function iA(t,e){this[ge].emit("message",t,e)}function oA(t){let e=this[ge];e._autoPong&&e.pong(t,!this._isServer,B$),e.emit("ping",t)}function sA(t){this[ge].emit("pong",t)}function q$(t){t.resume()}function aA(t){let e=this[ge];e.readyState!==re.CLOSED&&(e.readyState===re.OPEN&&(e._readyState=re.CLOSING,H$(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t)))}function H$(t){t._closeTimer=setTimeout(t._socket.destroy.bind(t._socket),t._closeTimeout)}function J$(){let t=this[ge];if(this.removeListener("close",J$),this.removeListener("data",Oa),this.removeListener("end",K$),t._readyState=re.CLOSING,!this._readableState.endEmitted&&!t._closeFrameReceived&&!t._receiver._writableState.errorEmitted&&this._readableState.length!==0){let e=this.read(this._readableState.length);t._receiver.write(e)}t._receiver.end(),this[ge]=void 0,clearTimeout(t._closeTimer),t._receiver._writableState.finished||t._receiver._writableState.errorEmitted?t.emitClose():(t._receiver.on("error",V$),t._receiver.on("finish",V$))}function Oa(t){this[ge]._receiver.write(t)||this.pause()}function K$(){let t=this[ge];t._readyState=re.CLOSING,t._receiver.end(),this.end()}function Y$(){let t=this[ge];this.removeListener("error",Y$),this.on("error",B$),t&&(t._readyState=re.CLOSING,this.destroy())}});var rx=R((sj,tx)=>{"use strict";var oj=Aa(),{Duplex:uA}=ae("stream");function Q$(t){t.emit("close")}function cA(){!this.destroyed&&this._writableState.finished&&this.destroy()}function ex(t){this.removeListener("error",ex),this.destroy(),this.listenerCount("error")===0&&this.emit("error",t)}function lA(t,e){let n=!0,i=new uA({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return t.on("message",function(o,s){let a=!s&&i._readableState.objectMode?o.toString():o;i.push(a)||t.pause()}),t.once("error",function(o){i.destroyed||(n=!1,i.destroy(o))}),t.once("close",function(){i.destroyed||i.push(null)}),i._destroy=function(r,o){if(t.readyState===t.CLOSED){o(r),process.nextTick(Q$,i);return}let s=!1;t.once("error",function(u){s=!0,o(u)}),t.once("close",function(){s||o(r),process.nextTick(Q$,i)}),n&&t.terminate()},i._final=function(r){if(t.readyState===t.CONNECTING){t.once("open",function(){i._final(r)});return}t._socket!==null&&(t._socket._writableState.finished?(r(),i._readableState.endEmitted&&i.destroy()):(t._socket.once("finish",function(){r()}),t.close()))},i._read=function(){t.isPaused&&t.resume()},i._write=function(r,o,s){if(t.readyState===t.CONNECTING){t.once("open",function(){i._write(r,o,s)});return}t.send(r,s)},i.on("end",cA),i.on("error",ex),i}tx.exports=lA});var Lp=R((aj,nx)=>{"use strict";var{tokenChars:dA}=$n();function hA(t){let e=new Set,n=-1,i=-1,r=0;for(r;r<t.length;r++){let s=t.charCodeAt(r);if(i===-1&&dA[s]===1)n===-1&&(n=r);else if(r!==0&&(s===32||s===9))i===-1&&n!==-1&&(i=r);else if(s===44){if(n===-1)throw new SyntaxError(`Unexpected character at index ${r}`);i===-1&&(i=r);let a=t.slice(n,i);if(e.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);e.add(a),n=i=-1}else throw new SyntaxError(`Unexpected character at index ${r}`)}if(n===-1||i!==-1)throw new SyntaxError("Unexpected end of input");let o=t.slice(n,r);if(e.has(o))throw new SyntaxError(`The "${o}" subprotocol is duplicated`);return e.add(o),e}nx.exports={parse:hA}});var lx=R((cj,cx)=>{"use strict";var fA=ae("events"),Pa=ae("http"),{Duplex:uj}=ae("stream"),{createHash:pA}=ae("crypto"),ix=Ea(),br=bn(),mA=Lp(),gA=Aa(),{CLOSE_TIMEOUT:vA,GUID:yA,kWebSocket:_A}=St(),bA=/^[+/0-9A-Za-z]{22}==$/,ox=0,sx=1,ux=2,Up=class extends fA{constructor(e,n){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:1024*1024,maxFragments:128*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:vA,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:gA,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=Pa.createServer((i,r)=>{let o=Pa.STATUS_CODES[426];r.writeHead(426,{"Content-Length":o.length,"Content-Type":"text/plain"}),r.end(o)}),this._server.listen(e.port,e.host,e.backlog,n)):e.server&&(this._server=e.server),this._server){let i=this.emit.bind(this,"connection");this._removeListeners=$A(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(r,o,s)=>{this.handleUpgrade(r,o,s,i)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=ox}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===ux){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Fi,this);return}if(e&&this.once("close",e),this._state!==sx)if(this._state=sx,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(Fi,this):process.nextTick(Fi,this);else{let n=this._server;this._removeListeners(),this._removeListeners=this._server=null,n.close(()=>{Fi(this)})}}shouldHandle(e){if(this.options.path){let n=e.url.indexOf("?");if((n!==-1?e.url.slice(0,n):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,n,i,r){n.on("error",ax);let o=e.headers["sec-websocket-key"],s=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){$r(this,e,n,405,"Invalid HTTP method");return}if(s===void 0||s.toLowerCase()!=="websocket"){$r(this,e,n,400,"Invalid Upgrade header");return}if(o===void 0||!bA.test(o)){$r(this,e,n,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){$r(this,e,n,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){Vi(n,400);return}let u=e.headers["sec-websocket-protocol"],c=new Set;if(u!==void 0)try{c=mA.parse(u)}catch{$r(this,e,n,400,"Invalid Sec-WebSocket-Protocol header");return}let l=e.headers["sec-websocket-extensions"],d={};if(this.options.perMessageDeflate&&l!==void 0){let h=new br({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let f=ix.parse(l);f[br.extensionName]&&(h.accept(f[br.extensionName]),d[br.extensionName]=h)}catch{$r(this,e,n,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let h={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(h,(f,p,_,S)=>{if(!f)return Vi(n,p||401,_,S);this.completeUpgrade(d,o,c,e,n,i,r)});return}if(!this.options.verifyClient(h))return Vi(n,401)}this.completeUpgrade(d,o,c,e,n,i,r)}completeUpgrade(e,n,i,r,o,s,a){if(!o.readable||!o.writable)return o.destroy();if(o[_A])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>ox)return Vi(o,503);let c=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${pA("sha1").update(n+yA).digest("base64")}`],l=new this.options.WebSocket(null,void 0,this.options);if(i.size){let d=this.options.handleProtocols?this.options.handleProtocols(i,r):i.values().next().value;d&&(c.push(`Sec-WebSocket-Protocol: ${d}`),l._protocol=d)}if(e[br.extensionName]){let d=e[br.extensionName].params,h=ix.format({[br.extensionName]:[d]});c.push(`Sec-WebSocket-Extensions: ${h}`),l._extensions=e}this.emit("headers",c,r),o.write(c.concat(`\r
71
+ `).join(`\r
72
+ `)),o.removeListener("error",ax),l.setSocket(o,s,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(l),l.on("close",()=>{this.clients.delete(l),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Fi,this)})),a(l,r)}};cx.exports=Up;function $A(t,e){for(let n of Object.keys(e))t.on(n,e[n]);return function(){for(let i of Object.keys(e))t.removeListener(i,e[i])}}function Fi(t){t._state=ux,t.emit("close")}function ax(){this.destroy()}function Vi(t,e,n,i){n=n||Pa.STATUS_CODES[e],i={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(n),...i},t.once("finish",t.destroy),t.end(`HTTP/1.1 ${e} ${Pa.STATUS_CODES[e]}\r
73
+ `+Object.keys(i).map(r=>`${r}: ${i[r]}`).join(`\r
74
+ `)+`\r
75
+ \r
76
+ `+n)}function $r(t,e,n,i,r,o){if(t.listenerCount("wsClientError")){let s=new Error(r);Error.captureStackTrace(s,$r),t.emit("wsClientError",s,n,e)}else Vi(n,i,r,o)}});var xA,wA,SA,kA,EA,IA,jp,TA,dx=v(()=>{xA=Je(rx(),1),wA=Je(Ea(),1),SA=Je(bn(),1),kA=Je(Tp(),1),EA=Je(Pp(),1),IA=Je(Lp(),1),jp=Je(Aa(),1),TA=Je(lx(),1)});function OA(t){return Array.isArray(t)?Buffer.concat(t).toString("utf8"):Buffer.isBuffer(t)?t.toString("utf8"):Buffer.from(t).toString("utf8")}var En,Ca=v(()=>{"use strict";dx();En=(t,e)=>{let n=new jp.default(t,{headers:e});return{send:i=>n.send(i),close:()=>n.close(),onOpen:i=>{n.on("open",i)},onMessage:i=>{n.on("message",r=>i(OA(r)))},onError:i=>{n.on("error",i)},onClose:i=>{n.on("close",()=>i())}}}});function za(t){return t>=200&&t<300?{ok:!0,status:"valid"}:t===401||t===403?{ok:!1,status:"invalid",detail:`key rejected (HTTP ${t})`}:{ok:!1,status:"unreachable",detail:`unexpected response (HTTP ${t})`}}function Ra(t){return t instanceof Error?t.name==="TimeoutError"||t.name==="AbortError"?"request timed out":t.message:"network error"}function In(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}async function Mp(t,e,n,i){let r=await n(t,{headers:e,signal:i});if(!r.ok)throw new Error(`HTTP ${r.status}`);try{return await r.json()}catch{throw new Error("invalid JSON response")}}function Fp(t){let e={};for(let[n,i]of Object.entries(t))i!==void 0&&i.length>0&&(e[n]=i);if(Object.keys(e).length===0)throw new Error("catalogue curated to nothing");return e}function LA(t){return!/^gpt-(4\.1|4o|5)/.test(t)&&!/^o\d/.test(t)||DA.test(t)?!1:!/-(audio|realtime|transcribe|tts|image|search|codex|chat-latest|instruct|deep-research|pro)\b/.test(t)}function Zi(t){let e=Vp[t];return e===void 0||e.keyEnv!==void 0}var AA,PA,CA,RA,zA,NA,DA,UA,jA,Vp,Tn,Na=v(()=>{"use strict";va();Ca();AA=async(t,e,n)=>{let i=await e("https://api.openai.com/v1/models",{headers:{Authorization:`Bearer ${t}`},signal:n});return za(i.status)},PA=async(t,e,n)=>{let i=await e("https://api.anthropic.com/v1/models",{headers:{"x-api-key":t,"anthropic-version":"2023-06-01"},signal:n});return za(i.status)},CA=async(t,e,n)=>{let i=await e("https://api.deepgram.com/v1/projects",{headers:{Authorization:`Token ${t}`},signal:n});return za(i.status)},RA=async(t,e,n)=>{let i=await e("https://api.elevenlabs.io/v1/user",{headers:{"xi-api-key":t},signal:n});return i.status===401||i.status===403?{ok:!1,status:"unverifiable",detail:"an ElevenLabs key scoped to the voice endpoints cannot reach a free validation endpoint; it will be confirmed at first use"}:za(i.status)},zA=(t,e,n,i)=>new Promise(r=>{let o=!1,s=null,a=l=>{o||(o=!0,s?.close(),r(l))};if(n.aborted){a({ok:!1,status:"unreachable",detail:"request timed out"});return}n.addEventListener("abort",()=>a({ok:!1,status:"unreachable",detail:"request timed out"}),{once:!0});let u=i?.url??ga,c=i?.socketFactory??En;try{let l=c(u,{});s=l,l.onOpen(()=>a({ok:!0,status:"valid",detail:`server reachable at ${u}`})),l.onError(d=>a({ok:!1,status:"unreachable",detail:Ra(d)})),l.onClose(()=>a({ok:!1,status:"unreachable",detail:"connection closed before open"}))}catch(l){a({ok:!1,status:"unreachable",detail:Ra(l)})}});NA=async(t,e,n)=>{if(!t)throw new Error("API key required");let i=await Mp("https://api.anthropic.com/v1/models?limit=100",{"x-api-key":t,"anthropic-version":"2023-06-01"},e,n),r=In(i)&&Array.isArray(i.data)?i.data:[],o=[];for(let s of r){if(!In(s)||typeof s.id!="string")continue;let a=typeof s.display_name=="string"?s.display_name:void 0;o.push(a===void 0?{id:s.id}:{id:s.id,label:a})}return Fp({text:o})},DA=/-\d{4}-\d{2}-\d{2}$/;UA=async(t,e,n)=>{if(!t)throw new Error("API key required");let i=await Mp("https://api.openai.com/v1/models",{Authorization:`Bearer ${t}`},e,n),r=In(i)&&Array.isArray(i.data)?i.data:[],o=[];for(let a of r)In(a)&&typeof a.id=="string"&&o.push(a.id);o.sort();let s=a=>o.filter(a).map(u=>({id:u}));return Fp({text:s(LA),stt:s(a=>a==="whisper-1"||a.endsWith("-transcribe")),tts:s(a=>/^tts-1(-hd)?$/.test(a)||a.endsWith("-tts")),embedding:s(a=>a.startsWith("text-embedding-3-"))})},jA=async(t,e,n)=>{let i=await Mp("https://api.deepgram.com/v1/models",{},e,n),r=In(i)&&Array.isArray(i.stt)?i.stt:[],o=new Set,s=[];for(let a of r){if(!In(a)||a.streaming!==!0)continue;let{canonical_name:u,architecture:c}=a;typeof u!="string"||typeof c!="string"||c.startsWith("nova-")&&(o.has(u)||(o.add(u),s.push({id:u,architecture:c})))}return s.sort((a,u)=>a.architecture===u.architecture?a.id.localeCompare(u.id,"en"):u.architecture.localeCompare(a.architecture,"en",{numeric:!0})),Fp({stt:s.map(({id:a})=>({id:a}))})},Vp={elevenlabs:{capabilities:["stt","tts"],defaultModel:{stt:"scribe_v2_realtime",tts:"eleven_flash_v2_5"},keyEnv:"ELEVENLABS_API_KEY",probe:RA},anthropic:{capabilities:["text"],defaultModel:{text:"claude-opus-4-8"},fastModel:{text:"claude-sonnet-5"},keyEnv:"ANTHROPIC_API_KEY",probe:PA,listModels:NA},openai:{capabilities:["text","stt","tts","embedding"],defaultModel:{text:"gpt-4o",stt:"whisper-1",tts:"tts-1",embedding:"text-embedding-3-small"},fastModel:{text:"gpt-4o-mini"},keyEnv:"OPENAI_API_KEY",probe:AA,listModels:UA},deepgram:{capabilities:["stt"],defaultModel:{stt:"nova-3-general"},keyEnv:"DEEPGRAM_API_KEY",probe:CA,listModels:jA,keylessLister:!0},"sherpa-onnx":{capabilities:["stt"],defaultModel:{stt:"parakeet-tdt-0.6b-v3"},probe:zA}};Tn=class{fetchImpl;socketFactory;timeoutMs=3e3;providers;constructor(e=fetch,n=En){this.fetchImpl=e,this.socketFactory=n,this.providers=Vp}async probe(e,n,i){let r=this.providers[e]?.probe;if(!r)return{ok:!1,status:"unimplemented",detail:`no probe for provider '${e}'`};let o=i?.signal??AbortSignal.timeout(this.timeoutMs),s={socketFactory:this.socketFactory,...i?.url!==void 0&&{url:i.url}};try{return await r(n,this.fetchImpl,o,s)}catch(a){return{ok:!1,status:"unreachable",detail:Ra(a)}}}providersFor(e){return Object.keys(this.providers).filter(n=>this.providers[n].capabilities.includes(e))}defaultModel(e,n){return this.providers[e]?.defaultModel[n]}requiresKey(e){return Zi(e)}}});var hx,fx,Bi,Zp=v(()=>{"use strict";hx="You are Jarvis, a voice-first personal agent and a continuous, trusted collaborator - not a disposable chat assistant. You help with software engineering work. Be concise, direct, and technical; skip filler and preamble. When you are unsure, say so plainly rather than guessing. You reason and explain; you do not yet take actions or use tools, so propose the next steps for the human to run rather than claiming to have run them.",fx=`This conversation is spoken aloud. Follow the voice register:
71
77
  - Lead with the answer. Add reasoning only after it, and only if it earns its airtime.
72
78
  - Speak plainly: no lists, no headings, no markdown, no emphasis markers - formatting is read aloud as noise.
73
79
  - Keep replies to about fifteen seconds of speech - a few sentences. Go longer only when explicitly asked to go deeper or walk through something.
74
80
  - Ask at most one question, and only when you need the answer to proceed.
75
- - The transcript of a single user turn may contain a pause request ("give me a second", "let me think") followed by the user's continued thought: the pause already happened. Respond to the completed thought; never offer to wait for a pause that is already over.`,Ei=class{adapter;model;systemPrompt;history=[];constructor(e,n,i=Kb){this.adapter=e,this.model=n,this.systemPrompt=i}async*run(e,n,i){if(e.trim()==="")return;let r=this.assemble(e),o=i?.register==="voice"?`${this.systemPrompt}
81
+ - The transcript of a single user turn may contain a pause request ("give me a second", "let me think") followed by the user's continued thought: the pause already happened. Respond to the completed thought; never offer to wait for a pause that is already over.`,Bi=class{adapter;model;systemPrompt;history=[];constructor(e,n,i=hx){this.adapter=e,this.model=n,this.systemPrompt=i}async*run(e,n,i){if(e.trim()==="")return;let r=this.assemble(e),o=i?.register==="voice"?`${this.systemPrompt}
76
82
 
77
- ${Yb}`:this.systemPrompt,s="";for await(let a of this.adapter.stream({model:this.model,system:o,messages:r,...n!==void 0&&{signal:n}}))s+=a.text,yield a;this.history.push({role:"user",content:e},{role:"assistant",content:s})}historySnapshot(){return[...this.history]}assemble(e){return[...this.history,{role:"user",content:e}]}}});var sa,Xb=v(()=>{"use strict";sa=class{buffer=[];pending=null;closed=!1;push(e){if(this.closed)return;let n=this.pending;if(n){this.pending=null,n({value:e,done:!1});return}this.buffer.push(e)}close(){if(this.closed)return;this.closed=!0;let e=this.pending;e&&(this.pending=null,e({value:void 0,done:!0}))}async*drain(){for(;;){if(this.buffer.length>0){yield this.buffer.shift();continue}if(this.closed)return;let e=await new Promise(n=>{this.pending=n});if(e.done)return;yield e.value}}}});function qT(t){let e=[];if(t.recentTurns.length>0){e.push("Recent conversation:");for(let n of t.recentTurns)e.push(`${n.role==="assistant"?"Assistant":"User"}: ${n.text}`)}else e.push("Recent conversation: (none)");return e.push(""),e.push("Committed utterance (what the user just said):"),e.push(JSON.stringify(t.utterance)),e.join(`
78
- `)}function HT(t){let e=sp(t)?.content,n=(Array.isArray(e)?e:[]).map(l=>sp(l)).filter(l=>l?.type==="text").map(l=>typeof l?.text=="string"?l.text:"").join(""),i=Qb+n;i.includes("}")||(i+="}");let r=i.indexOf("{"),o=i.lastIndexOf("}");if(r===-1||o<=r)throw new Bt("addressee evaluator reply carried no JSON object");let s;try{s=JSON.parse(i.slice(r,o+1))}catch{throw new Bt("addressee evaluator reply was not valid JSON")}let a=sp(s),u=a?.verdict;if(typeof u!="string"||!GT.includes(u))throw new Bt("addressee evaluator reply carried an unknown verdict");let c=a?.confidence;if(typeof c!="number"||!Number.isFinite(c)||c<0||c>1)throw new Bt("addressee evaluator confidence missing or out of range");return{verdict:u,confidence:c}}function sp(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0}var FT,VT,ZT,Qb,BT,GT,WT,Bt,hn,aa=v(()=>{"use strict";FT="claude-haiku-4-5-20251001",VT="https://api.anthropic.com/v1/messages",ZT="2023-06-01",Qb='{"verdict":"',BT=["}"],GT=["to_jarvis","to_other","self_talk"],WT=`You are the addressee evaluator inside a real-time voice assistant's
83
+ ${fx}`:this.systemPrompt,s="";for await(let a of this.adapter.stream({model:this.model,system:o,messages:r,...n!==void 0&&{signal:n}}))s+=a.text,yield a;this.history.push({role:"user",content:e},{role:"assistant",content:s})}historySnapshot(){return[...this.history]}assemble(e){return[...this.history,{role:"user",content:e}]}}});var Da,px=v(()=>{"use strict";Da=class{buffer=[];pending=null;closed=!1;push(e){if(this.closed)return;let n=this.pending;if(n){this.pending=null,n({value:e,done:!1});return}this.buffer.push(e)}close(){if(this.closed)return;this.closed=!0;let e=this.pending;e&&(this.pending=null,e({value:void 0,done:!0}))}async*drain(){for(;;){if(this.buffer.length>0){yield this.buffer.shift();continue}if(this.closed)return;let e=await new Promise(n=>{this.pending=n});if(e.done)return;yield e.value}}}});function WA(t){let e=[];if(t.recentTurns.length>0){e.push("Recent conversation:");for(let n of t.recentTurns)e.push(`${n.role==="assistant"?"Assistant":"User"}: ${n.text}`)}else e.push("Recent conversation: (none)");return e.push(""),e.push("Committed utterance (what the user just said):"),e.push(JSON.stringify(t.utterance)),e.join(`
84
+ `)}function qA(t){let e=Bp(t)?.content,n=(Array.isArray(e)?e:[]).map(l=>Bp(l)).filter(l=>l?.type==="text").map(l=>typeof l?.text=="string"?l.text:"").join(""),i=mx+n;i.includes("}")||(i+="}");let r=i.indexOf("{"),o=i.lastIndexOf("}");if(r===-1||o<=r)throw new qt("addressee evaluator reply carried no JSON object");let s;try{s=JSON.parse(i.slice(r,o+1))}catch{throw new qt("addressee evaluator reply was not valid JSON")}let a=Bp(s),u=a?.verdict;if(typeof u!="string"||!BA.includes(u))throw new qt("addressee evaluator reply carried an unknown verdict");let c=a?.confidence;if(typeof c!="number"||!Number.isFinite(c)||c<0||c>1)throw new qt("addressee evaluator confidence missing or out of range");return{verdict:u,confidence:c}}function Bp(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0}var MA,FA,VA,mx,ZA,BA,GA,qt,On,La=v(()=>{"use strict";MA="claude-haiku-4-5-20251001",FA="https://api.anthropic.com/v1/messages",VA="2023-06-01",mx='{"verdict":"',ZA=["}"],BA=["to_jarvis","to_other","self_talk"],GA=`You are the addressee evaluator inside a real-time voice assistant's
79
85
  turn-taking system. The assistant is in an active voice session with its
80
86
  user; an open microphone commits everything the user says, but not
81
87
  everything the user says is FOR the assistant. Your only job is to judge
@@ -135,9 +141,9 @@ Rules:
135
141
  Output exactly one line of strict JSON and nothing else:
136
142
  {"verdict":"to_jarvis"|"to_other"|"self_talk","confidence":<number 0..1>}
137
143
  confidence is your certainty in the verdict.
138
- `,Bt=class extends Error{status;constructor(e,n){super(e),this.status=n,this.name="AddresseeEvaluatorError"}},hn=class{key;fetchImpl;timeoutMs;constructor(e,n=fetch,i=1200){this.key=e,this.fetchImpl=n,this.timeoutMs=i}async evaluate(e,n,i){let r={model:FT,max_tokens:64,temperature:0,stop_sequences:BT,system:WT,messages:[{role:"user",content:qT(e)},{role:"assistant",content:Qb}]},o=await this.fetchImpl(VT,{method:"POST",headers:{"x-api-key":this.key,"anthropic-version":ZT,"content-type":"application/json"},body:JSON.stringify(r),signal:AbortSignal.any([n,AbortSignal.timeout(i?.timeoutMs??this.timeoutMs)])});if(!o.ok)throw new Bt(`addressee evaluator request failed (HTTP ${o.status})`,o.status);let s;try{s=await o.json()}catch{throw new Bt("addressee evaluator response body was not JSON")}return HT(s)}}});var JT,KT,e$,Ii,ap=v(()=>{"use strict";JT=new Set([".","!","?"]),KT=new Set([",",";",":"]),e$={minClauseLength:12},Ii=class{buffer="";minClauseLength;constructor(e=e$){this.minClauseLength=e.minClauseLength}push(e){this.buffer+=e;let n=[];for(let i=this.findBoundary();i!==-1;i=this.findBoundary()){let r=this.buffer.slice(0,i+1).trim();this.buffer=this.buffer.slice(i+1).replace(/^\s+/,""),r.length>0&&n.push(r)}return n}flush(){let e=this.buffer.trim();return this.buffer="",e.length>0?[e]:[]}findBoundary(){for(let e=0;e<this.buffer.length;e++){let n=this.buffer[e];if(n===`
139
- `)return e;let i=e+1<this.buffer.length?this.buffer[e+1]:"";if(i!==""&&/\s/.test(i)&&(JT.has(n)||KT.has(n)&&e+1>=this.minClauseLength))return e}return-1}}});var Ti,up=v(()=>{"use strict";Ti=class{nextId=1;timers=new Map;now(){return Date.now()}setTimer(e,n){let i=this.nextId++,r=setTimeout(()=>{this.timers.delete(i),n()},e);return this.timers.set(i,r),i}clearTimer(e){let n=this.timers.get(e);n!==void 0&&(clearTimeout(n),this.timers.delete(e))}}});function Gt(t,e){let n=Math.floor(t.byteLength/2);if(n===0)return!1;let i=new DataView(t.buffer,t.byteOffset,t.byteLength),r=0;for(let o=0;o<n;o++){let s=i.getInt16(o*2,!0)/32768;r+=s*s}return Math.sqrt(r/n)>=e}function YT(t){let e=t.byteLength>>1,n=new DataView(t.buffer,t.byteOffset,t.byteLength),i=new Int16Array(e);for(let r=0;r<e;r++)i[r]=n.getInt16(r*2,!0);return i}var ua,Oi,Ai,Pi=v(()=>{"use strict";Ae();ua=.02;Oi=class{threshold;constructor(e){this.threshold=e}classify(e,n){n(Gt(e,this.threshold))}},Ai=class{vad;speechThreshold;energyThreshold;log;degraded=!1;announced=!1;disposed=!1;constructor(e,n={}){this.vad=e,this.speechThreshold=n.speechThreshold??.5,this.energyThreshold=n.energyThreshold??ua,this.log=n.log??B}classify(e,n){if(this.degraded){this.announce("energy (fallback)"),n(Gt(e,this.energyThreshold));return}this.vad.process(YT(e)).then(i=>{if(!this.disposed){this.announce("silero");for(let r of i)n(r>=this.speechThreshold)}},i=>{this.disposed||(this.degrade(i),this.announce("energy (fallback)"),n(Gt(e,this.energyThreshold)))})}reset(){!this.degraded&&!this.disposed&&this.vad.reset()}prewarm(){this.degraded||this.disposed||this.vad.load().then(()=>{},e=>this.degrade(e))}dispose(){return this.disposed=!0,this.vad.dispose()}degrade(e){this.degraded||this.disposed||(this.degraded=!0,this.log.debug("frame classifier DEGRADED to energy (fallback) - silero vad failed; turn-end classifies on RMS energy for the rest of the session",{error:e instanceof Error?e.message:String(e)}))}announce(e){this.announced||(this.announced=!0,this.log.debug(`frame classifier: ${e}`))}}});var ca,gr,pn,XT,t$,cp=v(()=>{ca=new Map,gr=[],pn=(t,e,n)=>{if(e&&typeof e.init=="function"&&typeof e.createInferenceSessionHandler=="function"){let i=ca.get(t);if(i===void 0)ca.set(t,{backend:e,priority:n});else{if(i.priority>n)return;if(i.priority===n&&i.backend!==e)throw new Error(`cannot register backend "${t}" using priority ${n}`)}if(n>=0){let r=gr.indexOf(t);r!==-1&&gr.splice(r,1);for(let o=0;o<gr.length;o++)if(ca.get(gr[o]).priority<=n){gr.splice(o,0,t);return}gr.push(t)}return}throw new TypeError("not a valid backend")},XT=async t=>{let e=ca.get(t);if(!e)return"backend not found.";if(e.initialized)return e.backend;if(e.aborted)return e.error;{let n=!!e.initPromise;try{return n||(e.initPromise=e.backend.init(t)),await e.initPromise,e.initialized=!0,e.backend}catch(i){return n||(e.error=`${i}`,e.aborted=!0),e.error}finally{delete e.initPromise}}},t$=async t=>{let e=t.executionProviders||[],n=e.map(u=>typeof u=="string"?u:u.name),i=n.length===0?gr:n,r,o=[],s=new Set;for(let u of i){let c=await XT(u);typeof c=="string"?o.push({name:u,err:c}):(r||(r=c),r===c&&s.add(u))}if(!r)throw new Error(`no available backend found. ERR: ${o.map(u=>`[${u.name}] ${u.err}`).join(", ")}`);for(let{name:u,err:c}of o)n.includes(u)&&console.warn(`removing requested execution provider "${u}" from session options because it is not available: ${c}`);let a=e.filter(u=>s.has(typeof u=="string"?u:u.name));return[r,new Proxy(t,{get:(u,c)=>c==="executionProviders"?a:Reflect.get(u,c)})]}});var r$=v(()=>{cp()});var n$,i$=v(()=>{n$="1.26.0"});var o$,de,lp=v(()=>{i$();o$="warning",de={wasm:{},webgl:{},webgpu:{},versions:{common:n$},set logLevel(t){if(t!==void 0){if(typeof t!="string"||["verbose","info","warning","error","fatal"].indexOf(t)===-1)throw new Error(`Unsupported logging level: ${t}`);o$=t}},get logLevel(){return o$}};Object.defineProperty(de,"logLevel",{enumerable:!0})});var ie,s$=v(()=>{lp();ie=de});var a$,u$,c$=v(()=>{a$=(t,e)=>{let n=typeof document<"u"?document.createElement("canvas"):new OffscreenCanvas(1,1);n.width=t.dims[3],n.height=t.dims[2];let i=n.getContext("2d");if(i!=null){let r,o;e?.tensorLayout!==void 0&&e.tensorLayout==="NHWC"?(r=t.dims[2],o=t.dims[3]):(r=t.dims[3],o=t.dims[2]);let s=e?.format!==void 0?e.format:"RGB",a=e?.norm,u,c;a===void 0||a.mean===void 0?u=[255,255,255,255]:typeof a.mean=="number"?u=[a.mean,a.mean,a.mean,a.mean]:(u=[a.mean[0],a.mean[1],a.mean[2],0],a.mean[3]!==void 0&&(u[3]=a.mean[3])),a===void 0||a.bias===void 0?c=[0,0,0,0]:typeof a.bias=="number"?c=[a.bias,a.bias,a.bias,a.bias]:(c=[a.bias[0],a.bias[1],a.bias[2],0],a.bias[3]!==void 0&&(c[3]=a.bias[3]));let l=o*r,d=0,f=l,h=l*2,p=-1;s==="RGBA"?(d=0,f=l,h=l*2,p=l*3):s==="RGB"?(d=0,f=l,h=l*2):s==="RBG"&&(d=0,h=l,f=l*2);for(let _=0;_<o;_++)for(let S=0;S<r;S++){let k=(t.data[d++]-c[0])*u[0],P=(t.data[f++]-c[1])*u[1],C=(t.data[h++]-c[2])*u[2],E=p===-1?255:(t.data[p++]-c[3])*u[3];i.fillStyle="rgba("+k+","+P+","+C+","+E+")",i.fillRect(S,_,1,1)}if("toDataURL"in n)return n.toDataURL();throw new Error("toDataURL is not supported")}else throw new Error("Can not access image data")},u$=(t,e)=>{let n=typeof document<"u"?document.createElement("canvas").getContext("2d"):new OffscreenCanvas(1,1).getContext("2d"),i;if(n!=null){let r,o,s;e?.tensorLayout!==void 0&&e.tensorLayout==="NHWC"?(r=t.dims[2],o=t.dims[1],s=t.dims[3]):(r=t.dims[3],o=t.dims[2],s=t.dims[1]);let a=e!==void 0&&e.format!==void 0?e.format:"RGB",u=e?.norm,c,l;u===void 0||u.mean===void 0?c=[255,255,255,255]:typeof u.mean=="number"?c=[u.mean,u.mean,u.mean,u.mean]:(c=[u.mean[0],u.mean[1],u.mean[2],255],u.mean[3]!==void 0&&(c[3]=u.mean[3])),u===void 0||u.bias===void 0?l=[0,0,0,0]:typeof u.bias=="number"?l=[u.bias,u.bias,u.bias,u.bias]:(l=[u.bias[0],u.bias[1],u.bias[2],0],u.bias[3]!==void 0&&(l[3]=u.bias[3]));let d=o*r;if(e!==void 0&&(e.format!==void 0&&s===4&&e.format!=="RGBA"||s===3&&e.format!=="RGB"&&e.format!=="BGR"))throw new Error("Tensor format doesn't match input tensor dims");let f=4,h=0,p=1,_=2,S=3,k=0,P=d,C=d*2,E=-1;a==="RGBA"?(k=0,P=d,C=d*2,E=d*3):a==="RGB"?(k=0,P=d,C=d*2):a==="RBG"&&(k=0,C=d,P=d*2),i=n.createImageData(r,o);for(let T=0;T<o*r;h+=f,p+=f,_+=f,S+=f,T++)i.data[h]=(t.data[k++]-l[0])*c[0],i.data[p]=(t.data[P++]-l[1])*c[1],i.data[_]=(t.data[C++]-l[2])*c[2],i.data[S]=E===-1?255:(t.data[E++]-l[3])*c[3]}else throw new Error("Can not access image data");return i}});var dp,l$,d$,f$,h$,p$,m$=v(()=>{la();dp=(t,e)=>{if(t===void 0)throw new Error("Image buffer must be defined");if(e.height===void 0||e.width===void 0)throw new Error("Image height and width must be defined");if(e.tensorLayout==="NHWC")throw new Error("NHWC Tensor layout is not supported yet");let{height:n,width:i}=e,r=e.norm??{mean:255,bias:0},o,s;typeof r.mean=="number"?o=[r.mean,r.mean,r.mean,r.mean]:o=[r.mean[0],r.mean[1],r.mean[2],r.mean[3]??255],typeof r.bias=="number"?s=[r.bias,r.bias,r.bias,r.bias]:s=[r.bias[0],r.bias[1],r.bias[2],r.bias[3]??0];let a=e.format!==void 0?e.format:"RGBA",u=e.tensorFormat!==void 0&&e.tensorFormat!==void 0?e.tensorFormat:"RGB",c=n*i,l=u==="RGBA"?new Float32Array(c*4):new Float32Array(c*3),d=4,f=0,h=1,p=2,_=3,S=0,k=c,P=c*2,C=-1;a==="RGB"&&(d=3,f=0,h=1,p=2,_=-1),u==="RGBA"?C=c*3:u==="RBG"?(S=0,P=c,k=c*2):u==="BGR"&&(P=0,k=c,S=c*2);for(let T=0;T<c;T++,f+=d,p+=d,h+=d,_+=d)l[S++]=(t[f]+s[0])/o[0],l[k++]=(t[h]+s[1])/o[1],l[P++]=(t[p]+s[2])/o[2],C!==-1&&_!==-1&&(l[C++]=(t[_]+s[3])/o[3]);return u==="RGBA"?new ye("float32",l,[1,4,n,i]):new ye("float32",l,[1,3,n,i])},l$=async(t,e)=>{let n=typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement,i=typeof ImageData<"u"&&t instanceof ImageData,r=typeof ImageBitmap<"u"&&t instanceof ImageBitmap,o=typeof t=="string",s,a=e??{},u=()=>{if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);throw new Error("Canvas is not supported")},c=l=>typeof HTMLCanvasElement<"u"&&l instanceof HTMLCanvasElement||l instanceof OffscreenCanvas?l.getContext("2d"):null;if(n){let l=u();l.width=t.width,l.height=t.height;let d=c(l);if(d!=null){let f=t.height,h=t.width;if(e!==void 0&&e.resizedHeight!==void 0&&e.resizedWidth!==void 0&&(f=e.resizedHeight,h=e.resizedWidth),e!==void 0){if(a=e,e.tensorFormat!==void 0)throw new Error("Image input config format must be RGBA for HTMLImageElement");a.tensorFormat="RGBA",a.height=f,a.width=h}else a.tensorFormat="RGBA",a.height=f,a.width=h;d.drawImage(t,0,0),s=d.getImageData(0,0,h,f).data}else throw new Error("Can not access image data")}else if(i){let l,d;if(e!==void 0&&e.resizedWidth!==void 0&&e.resizedHeight!==void 0?(l=e.resizedHeight,d=e.resizedWidth):(l=t.height,d=t.width),e!==void 0&&(a=e),a.format="RGBA",a.height=l,a.width=d,e!==void 0){let f=u();f.width=d,f.height=l;let h=c(f);if(h!=null)h.putImageData(t,0,0),s=h.getImageData(0,0,d,l).data;else throw new Error("Can not access image data")}else s=t.data}else if(r){if(e===void 0)throw new Error("Please provide image config with format for Imagebitmap");let l=u();l.width=t.width,l.height=t.height;let d=c(l);if(d!=null){let f=t.height,h=t.width;return d.drawImage(t,0,0,h,f),s=d.getImageData(0,0,h,f).data,a.height=f,a.width=h,dp(s,a)}else throw new Error("Can not access image data")}else{if(o)return new Promise((l,d)=>{let f=u(),h=c(f);if(!t||!h)return d();let p=new Image;p.crossOrigin="Anonymous",p.src=t,p.onload=()=>{f.width=p.width,f.height=p.height,h.drawImage(p,0,0,f.width,f.height);let _=h.getImageData(0,0,f.width,f.height);a.height=f.height,a.width=f.width,l(dp(_.data,a))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(s!==void 0)return dp(s,a);throw new Error("Input data provided is not supported - aborted tensor creation")},d$=(t,e)=>{let{width:n,height:i,download:r,dispose:o}=e,s=[1,i,n,4];return new ye({location:"texture",type:"float32",texture:t,dims:s,download:r,dispose:o})},f$=(t,e)=>{let{dataType:n,dims:i,download:r,dispose:o}=e;return new ye({location:"gpu-buffer",type:n??"float32",gpuBuffer:t,dims:i,download:r,dispose:o})},h$=(t,e)=>{let{dataType:n,dims:i,download:r,dispose:o}=e;return new ye({location:"ml-tensor",type:n??"float32",mlTensor:t,dims:i,download:r,dispose:o})},p$=(t,e,n)=>new ye({location:"cpu-pinned",type:t,data:e,dims:n??[e.length]})});var vr,Ci,g$,v$,y$=v(()=>{vr=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),Ci=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]),g$=!1,v$=()=>{if(!g$){g$=!0;let t=typeof BigInt64Array<"u"&&BigInt64Array.from,e=typeof BigUint64Array<"u"&&BigUint64Array.from,n=globalThis.Float16Array,i=typeof n<"u"&&n.from;t&&(vr.set("int64",BigInt64Array),Ci.set(BigInt64Array,"int64")),e&&(vr.set("uint64",BigUint64Array),Ci.set(BigUint64Array,"uint64")),i?(vr.set("float16",n),Ci.set(n,"float16")):vr.set("float16",Uint16Array)}}});var _$,b$,$$=v(()=>{la();_$=t=>{let e=1;for(let n=0;n<t.length;n++){let i=t[n];if(typeof i!="number"||!Number.isSafeInteger(i))throw new TypeError(`dims[${n}] must be an integer, got: ${i}`);if(i<0)throw new RangeError(`dims[${n}] must be a non-negative integer, got: ${i}`);e*=i}return e},b$=(t,e)=>{switch(t.location){case"cpu":return new ye(t.type,t.data,e);case"cpu-pinned":return new ye({location:"cpu-pinned",data:t.data,type:t.type,dims:e});case"texture":return new ye({location:"texture",texture:t.texture,type:t.type,dims:e});case"gpu-buffer":return new ye({location:"gpu-buffer",gpuBuffer:t.gpuBuffer,type:t.type,dims:e});case"ml-tensor":return new ye({location:"ml-tensor",mlTensor:t.mlTensor,type:t.type,dims:e});default:throw new Error(`tensorReshape: tensor location ${t.location} is not supported`)}}});var ye,la=v(()=>{c$();m$();y$();$$();ye=class{constructor(e,n,i){v$();let r,o;if(typeof e=="object"&&"location"in e)switch(this.dataLocation=e.location,r=e.type,o=e.dims,e.location){case"cpu-pinned":{let a=vr.get(r);if(!a)throw new TypeError(`unsupported type "${r}" to create tensor from pinned buffer`);if(!(e.data instanceof a))throw new TypeError(`buffer should be of type ${a.name}`);this.cpuData=e.data;break}case"texture":{if(r!=="float32")throw new TypeError(`unsupported type "${r}" to create tensor from texture`);this.gpuTextureData=e.texture,this.downloader=e.download,this.disposer=e.dispose;break}case"gpu-buffer":{if(r!=="float32"&&r!=="float16"&&r!=="int32"&&r!=="int64"&&r!=="uint32"&&r!=="uint8"&&r!=="bool"&&r!=="uint4"&&r!=="int4")throw new TypeError(`unsupported type "${r}" to create tensor from gpu buffer`);this.gpuBufferData=e.gpuBuffer,this.downloader=e.download,this.disposer=e.dispose;break}case"ml-tensor":{if(r!=="float32"&&r!=="float16"&&r!=="int32"&&r!=="int64"&&r!=="uint32"&&r!=="uint64"&&r!=="int8"&&r!=="uint8"&&r!=="bool"&&r!=="uint4"&&r!=="int4")throw new TypeError(`unsupported type "${r}" to create tensor from MLTensor`);this.mlTensorData=e.mlTensor,this.downloader=e.download,this.disposer=e.dispose;break}default:throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let a,u;if(typeof e=="string")if(r=e,u=i,e==="string"){if(!Array.isArray(n))throw new TypeError("A string tensor's data must be a string array.");a=n}else{let c=vr.get(e);if(c===void 0)throw new TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(n)){if(e==="float16"&&c===Uint16Array||e==="uint4"||e==="int4")throw new TypeError(`Creating a ${e} tensor from number array is not supported. Please use ${c.name} as data.`);e==="uint64"||e==="int64"?a=c.from(n,BigInt):a=c.from(n)}else if(n instanceof c)a=n;else if(n instanceof Uint8ClampedArray)if(e==="uint8")a=Uint8Array.from(n);else throw new TypeError("A Uint8ClampedArray tensor's data must be type of uint8");else if(e==="float16"&&n instanceof Uint16Array&&c!==Uint16Array)a=new globalThis.Float16Array(n.buffer,n.byteOffset,n.length);else throw new TypeError(`A ${r} tensor's data must be type of ${c}`)}else if(u=n,Array.isArray(e)){if(e.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");let c=typeof e[0];if(c==="string")r="string",a=e;else if(c==="boolean")r="bool",a=Uint8Array.from(e);else throw new TypeError(`Invalid element type of data array: ${c}.`)}else if(e instanceof Uint8ClampedArray)r="uint8",a=Uint8Array.from(e);else{let c=Ci.get(e.constructor);if(c===void 0)throw new TypeError(`Unsupported type for tensor data: ${e.constructor}.`);r=c,a=e}if(u===void 0)u=[a.length];else if(!Array.isArray(u))throw new TypeError("A tensor's dims must be a number array");o=u,this.cpuData=a,this.dataLocation="cpu"}let s=_$(o);if(this.cpuData&&s!==this.cpuData.length&&!((r==="uint4"||r==="int4")&&Math.ceil(s/2)===this.cpuData.length))throw new Error(`Tensor's size(${s}) does not match data length(${this.cpuData.length}).`);this.type=r,this.dims=o,this.size=s}static async fromImage(e,n){return l$(e,n)}static fromTexture(e,n){return d$(e,n)}static fromGpuBuffer(e,n){return f$(e,n)}static fromMLTensor(e,n){return h$(e,n)}static fromPinnedBuffer(e,n,i){return p$(e,n,i)}toDataURL(e){return a$(this,e)}toImageData(e){return u$(this,e)}get data(){if(this.ensureValid(),!this.cpuData)throw new Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw new Error("The data is not stored as a WebGL texture.");return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw new Error("The data is not stored as a WebGPU buffer.");return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw new Error("The data is not stored as a WebNN MLTensor.");return this.mlTensorData}async getData(e){switch(this.ensureValid(),this.dataLocation){case"cpu":case"cpu-pinned":return this.data;case"texture":case"gpu-buffer":case"ml-tensor":{if(!this.downloader)throw new Error("The current tensor is not created with a specified data downloader.");if(this.isDownloading)throw new Error("The current tensor is being downloaded.");try{this.isDownloading=!0;let n=await this.downloader();return this.downloader=void 0,this.dataLocation="cpu",this.cpuData=n,e&&this.disposer&&(this.disposer(),this.disposer=void 0),n}finally{this.isDownloading=!1}}default:throw new Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw new Error("The current tensor is being downloaded.");this.disposer&&(this.disposer(),this.disposer=void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation="none"}ensureValid(){if(this.dataLocation==="none")throw new Error("The tensor is disposed.")}reshape(e){if(this.ensureValid(),this.downloader||this.disposer)throw new Error("Cannot reshape a tensor that owns GPU resource.");return b$(this,e)}}});var Ye,fp=v(()=>{la();Ye=ye});var hp,x$,Wt,qt,Ht,Jt,pp=v(()=>{lp();hp=(t,e)=>{(typeof de.trace>"u"?!de.wasm.trace:!de.trace)||console.timeStamp(`${t}::ORT::${e}`)},x$=(t,e)=>{let n=new Error().stack?.split(/\r\n|\r|\n/g)||[],i=!1;for(let r=0;r<n.length;r++){if(i&&!n[r].includes("TRACE_FUNC")){let o=`FUNC_${t}::${n[r].trim().split(" ")[1]}`;e&&(o+=`::${e}`),hp("CPU",o);return}n[r].includes("TRACE_FUNC")&&(i=!0)}},Wt=t=>{(typeof de.trace>"u"?!de.wasm.trace:!de.trace)||x$("BEGIN",t)},qt=t=>{(typeof de.trace>"u"?!de.wasm.trace:!de.trace)||x$("END",t)},Ht=t=>{(typeof de.trace>"u"?!de.wasm.trace:!de.trace)||console.time(`ORT::${t}`)},Jt=t=>{(typeof de.trace>"u"?!de.wasm.trace:!de.trace)||console.timeEnd(`ORT::${t}`)}});var da,w$=v(()=>{cp();fp();pp();da=class t{constructor(e){this.handler=e}async run(e,n,i){Wt(),Ht("InferenceSession.run");let r={},o={};if(typeof e!="object"||e===null||e instanceof Ye||Array.isArray(e))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let s=!0;if(typeof n=="object"){if(n===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(n instanceof Ye)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(n)){if(n.length===0)throw new TypeError("'fetches' cannot be an empty array.");s=!1;for(let c of n){if(typeof c!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(c)===-1)throw new RangeError(`'fetches' contains invalid output name: ${c}.`);r[c]=null}if(typeof i=="object"&&i!==null)o=i;else if(typeof i<"u")throw new TypeError("'options' must be an object.")}else{let c=!1,l=Object.getOwnPropertyNames(n);for(let d of this.outputNames)if(l.indexOf(d)!==-1){let f=n[d];(f===null||f instanceof Ye)&&(c=!0,s=!1,r[d]=f)}if(c){if(typeof i=="object"&&i!==null)o=i;else if(typeof i<"u")throw new TypeError("'options' must be an object.")}else o=n}}else if(typeof n<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(let c of this.inputNames)if(typeof e[c]>"u")throw new Error(`input '${c}' is missing in 'feeds'.`);if(s)for(let c of this.outputNames)r[c]=null;let a=await this.handler.run(e,r,o),u={};for(let c in a)if(Object.hasOwnProperty.call(a,c)){let l=a[c];l instanceof Ye?u[c]=l:u[c]=new Ye(l.type,l.data,l.dims)}return Jt("InferenceSession.run"),qt(),u}async release(){return this.handler.dispose()}static async create(e,n,i,r){Wt(),Ht("InferenceSession.create");let o,s={};if(typeof e=="string"){if(o=e,typeof n=="object"&&n!==null)s=n;else if(typeof n<"u")throw new TypeError("'options' must be an object.")}else if(e instanceof Uint8Array){if(o=e,typeof n=="object"&&n!==null)s=n;else if(typeof n<"u")throw new TypeError("'options' must be an object.")}else if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer){let l=e,d=0,f=e.byteLength;if(typeof n=="object"&&n!==null)s=n;else if(typeof n=="number"){if(d=n,!Number.isSafeInteger(d))throw new RangeError("'byteOffset' must be an integer.");if(d<0||d>=l.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${l.byteLength}).`);if(f=e.byteLength-d,typeof i=="number"){if(f=i,!Number.isSafeInteger(f))throw new RangeError("'byteLength' must be an integer.");if(f<=0||d+f>l.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${l.byteLength-d}].`);if(typeof r=="object"&&r!==null)s=r;else if(typeof r<"u")throw new TypeError("'options' must be an object.")}else if(typeof i<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof n<"u")throw new TypeError("'options' must be an object.");o=new Uint8Array(l,d,f)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");let[a,u]=await t$(s),c=await a.createInferenceSessionHandler(o,u);return Jt("InferenceSession.create"),qt(),new t(c)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}}});var S$,k$=v(()=>{w$();S$=da});var E$=v(()=>{});var I$=v(()=>{});var T$=v(()=>{});var O$=v(()=>{});var mp={};He(mp,{InferenceSession:()=>S$,TRACE:()=>hp,TRACE_EVENT_BEGIN:()=>Ht,TRACE_EVENT_END:()=>Jt,TRACE_FUNC_BEGIN:()=>Wt,TRACE_FUNC_END:()=>qt,Tensor:()=>Ye,env:()=>ie,registerBackend:()=>pn});var Kt=v(()=>{r$();s$();k$();fp();E$();I$();pp();T$();O$()});var bx={};He(bx,{InferenceSession:()=>S$,TRACE:()=>hp,TRACE_EVENT_BEGIN:()=>Ht,TRACE_EVENT_END:()=>Jt,TRACE_FUNC_BEGIN:()=>Wt,TRACE_FUNC_END:()=>qt,Tensor:()=>Ye,default:()=>fO,env:()=>ie,registerBackend:()=>pn});import{createRequire as QT}from"module";var mn,Ap,eO,tO,rO,Ep,Xe,nO,iO,oO,yn,Pp,gp,A$,P$,wt,W$,vp,C$,z$,R$,N$,yp,q$,H$,_p,fa,zi,bp,D$,L$,U$,J$,ee,Ri,at,ma,K,Cp,K$,sO,j$,M$,F$,yr,V$,Y$,aO,gn,pa,vn,X$,Q$,zp,Rp,ex,tx,ga,rx,Z$,nx,ix,_r,B$,$p,Ip,ox,sx,xp,ax,ux,uO,ha,wp,Sp,cx,lx,dx,fx,hx,px,mx,gx,kp,G$,vx,cO,yx,Tp,Op,_x,lO,dO,fO,$x=v(()=>{Kt();Kt();Kt();Kt();Kt();Kt();Kt();mn=QT(import.meta.url),Ap=Object.defineProperty,eO=Object.getOwnPropertyDescriptor,tO=Object.getOwnPropertyNames,rO=Object.prototype.hasOwnProperty,Ep=(t=>typeof mn<"u"?mn:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof mn<"u"?mn:e)[n]}):t)(function(t){if(typeof mn<"u")return mn.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),Xe=(t,e)=>()=>(t&&(e=t(t=0)),e),nO=(t,e)=>{for(var n in e)Ap(t,n,{get:e[n],enumerable:!0})},iO=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of tO(e))!rO.call(t,r)&&r!==n&&Ap(t,r,{get:()=>e[r],enumerable:!(i=eO(e,r))||i.enumerable});return t},oO=t=>iO(Ap({},"__esModule",{value:!0}),t),Pp=Xe(()=>{"use strict";yn=!!(typeof process<"u"&&process.versions&&process.versions.node)}),H$=Xe(()=>{"use strict";Pp(),gp=yn||typeof location>"u"?void 0:location.origin,A$=import.meta.url>"file:"&&import.meta.url<"file;",P$=()=>{if(!yn){if(A$){let t=URL;return new URL(new t("ort.node.min.mjs",import.meta.url).href,gp).href}return import.meta.url}},wt=P$(),W$=()=>{if(wt&&!wt.startsWith("blob:"))return wt.substring(0,wt.lastIndexOf("/")+1)},vp=(t,e)=>{try{let n=e??wt;return(n?new URL(t,n):new URL(t)).origin===gp}catch{return!1}},C$=(t,e)=>{let n=e??wt;try{return(n?new URL(t,n):new URL(t)).href}catch{return}},z$=(t,e)=>`${e??"./"}${t}`,R$=async t=>{let e=await(await fetch(t,{credentials:"same-origin"})).blob();return URL.createObjectURL(e)},N$=async t=>(await import(t)).default,yp=void 0,q$=async(t,e,n,i)=>{let r=yp&&!(t||e);if(r)if(wt)r=vp(wt)||i&&!n;else if(i&&!n)r=!0;else throw new Error("cannot determine the script source URL.");if(r)return[void 0,yp];{let o="ort-wasm-simd-threaded.mjs",s=t??C$(o,e),a=!yn&&n&&s&&!vp(s,e),u=a?await R$(s):s??z$(o,e);return[a?u:void 0,await N$(u)]}}}),Ri=Xe(()=>{"use strict";H$(),fa=!1,zi=!1,bp=!1,D$=()=>{if(typeof SharedArrayBuffer>"u")return!1;try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch{return!1}},L$=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch{return!1}},U$=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,19,1,17,0,65,1,253,15,65,2,253,15,65,3,253,15,253,147,2,11]))}catch{return!1}},J$=async t=>{if(fa)return Promise.resolve();if(zi)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(bp)throw new Error("previous call to 'initializeWebAssembly()' failed.");zi=!0;let e=t.initTimeout,n=t.numThreads;if(t.simd!==!1){if(t.simd==="relaxed"){if(!U$())throw new Error("Relaxed WebAssembly SIMD is not supported in the current environment.")}else if(!L$())throw new Error("WebAssembly SIMD is not supported in the current environment.")}let i=D$();n>1&&!i&&(typeof self<"u"&&!self.crossOriginIsolated&&console.warn("env.wasm.numThreads is set to "+n+", but this will not work unless you enable crossOriginIsolated mode. See https://web.dev/cross-origin-isolation-guide/ for more info."),console.warn("WebAssembly multi-threading is not supported in the current environment. Falling back to single-threading."),t.numThreads=n=1);let r=t.wasmPaths,o=typeof r=="string"?r:void 0,s=r?.mjs,a=s?.href??s,u=r?.wasm,c=u?.href??u,l=t.wasmBinary,[d,f]=await q$(a,o,n>1,!!l||!!c),h=!1,p=[];if(e>0&&p.push(new Promise(_=>{setTimeout(()=>{h=!0,_()},e)})),p.push(new Promise((_,S)=>{let k={numThreads:n};if(l)k.wasmBinary=l,k.locateFile=P=>P;else if(c||o)k.locateFile=P=>c??o+P;else if(a&&a.indexOf("blob:")!==0)k.locateFile=P=>new URL(P,a).href;else if(d){let P=W$();P&&(k.locateFile=C=>P+C)}f(k).then(P=>{zi=!1,fa=!0,_p=P,_(),d&&URL.revokeObjectURL(d)},P=>{zi=!1,bp=!0,S(P)})})),await Promise.race(p),h)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},ee=()=>{if(fa&&_p)return _p;throw new Error("WebAssembly is not initialized yet.")}}),Cp=Xe(()=>{"use strict";Ri(),at=(t,e)=>{let n=ee(),i=n.lengthBytesUTF8(t)+1,r=n._malloc(i);return n.stringToUTF8(t,r,i),e.push(r),r},ma=(t,e,n,i)=>{if(typeof t=="object"&&t!==null){if(n.has(t))throw new Error("Circular reference in options");n.add(t)}Object.entries(t).forEach(([r,o])=>{let s=e?e+r:r;if(typeof o=="object")ma(o,s+".",n,i);else if(typeof o=="string"||typeof o=="number")i(s,o.toString());else if(typeof o=="boolean")i(s,o?"1":"0");else throw new Error(`Can't handle extra config type: ${typeof o}`)})},K=t=>{let e=ee(),n=e.stackSave();try{let i=e.PTR_SIZE,r=e.stackAlloc(2*i);e._OrtGetLastError(r,r+i);let o=Number(e.getValue(r,i===4?"i32":"i64")),s=e.getValue(r+i,"*"),a=s?e.UTF8ToString(s):"";throw new Error(`${t} ERROR_CODE: ${o}, ERROR_MESSAGE: ${a}`)}finally{e.stackRestore(n)}}}),sO=Xe(()=>{"use strict";Ri(),Cp(),K$=t=>{let e=ee(),n=0,i=[],r=t||{};try{if(t?.logSeverityLevel===void 0)r.logSeverityLevel=2;else if(typeof t.logSeverityLevel!="number"||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log severity level is not valid: ${t.logSeverityLevel}`);if(t?.logVerbosityLevel===void 0)r.logVerbosityLevel=0;else if(typeof t.logVerbosityLevel!="number"||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);t?.terminate===void 0&&(r.terminate=!1);let o=0;return t?.tag!==void 0&&(o=at(t.tag,i)),n=e._OrtCreateRunOptions(r.logSeverityLevel,r.logVerbosityLevel,!!r.terminate,o),n===0&&K("Can't create run options."),t?.extra!==void 0&&ma(t.extra,"",new WeakSet,(s,a)=>{let u=at(s,i),c=at(a,i);e._OrtAddRunConfigEntry(n,u,c)!==0&&K(`Can't set a run config entry: ${s} - ${a}.`)}),[n,i]}catch(o){throw n!==0&&e._OrtReleaseRunOptions(n),i.forEach(s=>e._free(s)),o}}}),aO=Xe(()=>{"use strict";Ri(),Cp(),j$=t=>{switch(t){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"layout":return 3;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${t}`)}},M$=t=>{switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}},F$=t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});let e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly="1"),t.executionProviders&&t.executionProviders.some(n=>(typeof n=="string"?n:n.name)==="webgpu")&&(t.enableMemPattern=!1)},yr=(t,e,n,i)=>{let r=at(e,i),o=at(n,i);ee()._OrtAddSessionConfigEntry(t,r,o)!==0&&K(`Can't set a session config entry: ${e} - ${n}.`)},V$=async(t,e,n)=>{let i=e.executionProviders;for(let r of i){let o=typeof r=="string"?r:r.name,s=[];switch(o){case"webnn":if(o="WEBNN",yr(t,"session.disable_quant_qdq","1",n),yr(t,"session.disable_qdq_constant_folding","1",n),typeof r!="string"){let d=r?.deviceType;d&&yr(t,"deviceType",d,n)}break;case"webgpu":if(o="JS",typeof r!="string"){let d=r;if(d?.preferredLayout){if(d.preferredLayout!=="NCHW"&&d.preferredLayout!=="NHWC")throw new Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${d.preferredLayout}`);yr(t,"preferredLayout",d.preferredLayout,n)}}break;case"wasm":case"cpu":continue;default:throw new Error(`not supported execution provider: ${o}`)}let a=at(o,n),u=s.length,c=0,l=0;if(u>0){c=ee()._malloc(u*ee().PTR_SIZE),n.push(c),l=ee()._malloc(u*ee().PTR_SIZE),n.push(l);for(let d=0;d<u;d++)ee().setValue(c+d*ee().PTR_SIZE,s[d][0],"*"),ee().setValue(l+d*ee().PTR_SIZE,s[d][1],"*")}await ee()._OrtAppendExecutionProvider(t,a,c,l,u)!==0&&K(`Can't append execution provider: ${o}.`)}},Y$=async t=>{let e=ee(),n=0,i=[],r=t||{};F$(r);try{let o=j$(r.graphOptimizationLevel??"all"),s=M$(r.executionMode??"sequential"),a=typeof r.logId=="string"?at(r.logId,i):0,u=r.logSeverityLevel??2;if(!Number.isInteger(u)||u<0||u>4)throw new Error(`log severity level is not valid: ${u}`);let c=r.logVerbosityLevel??0;if(!Number.isInteger(c)||c<0||c>4)throw new Error(`log verbosity level is not valid: ${c}`);let l=typeof r.optimizedModelFilePath=="string"?at(r.optimizedModelFilePath,i):0;if(n=e._OrtCreateSessionOptions(o,!!r.enableCpuMemArena,!!r.enableMemPattern,s,!!r.enableProfiling,0,a,u,c,l),n===0&&K("Can't create session options."),r.executionProviders&&await V$(n,r,i),r.enableGraphCapture!==void 0){if(typeof r.enableGraphCapture!="boolean")throw new Error(`enableGraphCapture must be a boolean value: ${r.enableGraphCapture}`);yr(n,"enableGraphCapture",r.enableGraphCapture.toString(),i)}if(r.freeDimensionOverrides)for(let[d,f]of Object.entries(r.freeDimensionOverrides)){if(typeof d!="string")throw new Error(`free dimension override name must be a string: ${d}`);if(typeof f!="number"||!Number.isInteger(f)||f<0)throw new Error(`free dimension override value must be a non-negative integer: ${f}`);let h=at(d,i);e._OrtAddFreeDimensionOverride(n,h,f)!==0&&K(`Can't set a free dimension override: ${d} - ${f}.`)}return r.extra!==void 0&&ma(r.extra,"",new WeakSet,(d,f)=>{yr(n,d,f,i)}),[n,i]}catch(o){throw n!==0&&e._OrtReleaseSessionOptions(n)!==0&&K("Can't release session options."),i.forEach(s=>e._free(s)),o}}}),tx=Xe(()=>{"use strict";gn=t=>{switch(t){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float16":return 10;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;case"int4":return 22;case"uint4":return 21;default:throw new Error(`unsupported data type: ${t}`)}},pa=t=>{switch(t){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 10:return"float16";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";case 22:return"int4";case 21:return"uint4";default:throw new Error(`unsupported data type: ${t}`)}},vn=(t,e)=>{let n=[-1,4,1,1,2,2,4,8,-1,1,2,8,4,8,-1,-1,-1,-1,-1,-1,-1,.5,.5][t],i=typeof e=="number"?e:e.reduce((r,o)=>r*o,1);return n>0?Math.ceil(i*n):void 0},X$=t=>{switch(t){case"float16":return typeof Float16Array<"u"&&Float16Array.from?Float16Array:Uint16Array;case"float32":return Float32Array;case"uint8":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"bool":return Uint8Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}},Q$=t=>{switch(t){case"verbose":return 0;case"info":return 1;case"warning":return 2;case"error":return 3;case"fatal":return 4;default:throw new Error(`unsupported logging level: ${t}`)}},zp=t=>t==="float32"||t==="float16"||t==="int32"||t==="int64"||t==="uint32"||t==="uint8"||t==="bool"||t==="uint4"||t==="int4",Rp=t=>t==="float32"||t==="float16"||t==="int32"||t==="int64"||t==="uint32"||t==="uint64"||t==="int8"||t==="uint8"||t==="bool"||t==="uint4"||t==="int4",ex=t=>{switch(t){case"none":return 0;case"cpu":return 1;case"cpu-pinned":return 2;case"texture":return 3;case"gpu-buffer":return 4;case"ml-tensor":return 5;default:throw new Error(`unsupported data location: ${t}`)}}}),rx=Xe(()=>{"use strict";Pp(),ga=async t=>{if(typeof t=="string")if(yn)try{let{readFile:e}=Ep("node:fs/promises");return new Uint8Array(await e(t))}catch(e){if(e.code==="ERR_FS_FILE_TOO_LARGE"){let{createReadStream:n}=Ep("node:fs"),i=n(t),r=[];for await(let o of i)r.push(o);return new Uint8Array(Buffer.concat(r))}throw e}else{let e=await fetch(t);if(!e.ok)throw new Error(`failed to load external data file: ${t}`);let n=e.headers.get("Content-Length"),i=n?parseInt(n,10):0;if(i<1073741824)return new Uint8Array(await e.arrayBuffer());{if(!e.body)throw new Error(`failed to load external data file: ${t}, no response body.`);let r=e.body.getReader(),o;try{o=new ArrayBuffer(i)}catch(a){if(a instanceof RangeError){let u=Math.ceil(i/65536);o=new WebAssembly.Memory({initial:u,maximum:u}).buffer}else throw a}let s=0;for(;;){let{done:a,value:u}=await r.read();if(a)break;let c=u.byteLength;new Uint8Array(o,s,c).set(u),s+=c}return new Uint8Array(o,0,i)}}else return t instanceof Blob?new Uint8Array(await t.arrayBuffer()):t instanceof Uint8Array?t:new Uint8Array(t)}}),uO=Xe(()=>{"use strict";sO(),aO(),tx(),Ri(),Cp(),rx(),Z$=(t,e)=>{ee()._OrtInit(t,e)!==0&&K("Can't initialize onnxruntime.")},nx=async t=>{Z$(t.wasm.numThreads,Q$(t.logLevel))},ix=async(t,e)=>{ee().asyncInit?.();let n=t.webgpu.adapter;if(e==="webgpu"){if(typeof navigator>"u"||!navigator.gpu)throw new Error("WebGPU is not supported in current environment");if(n){if(typeof n.limits!="object"||typeof n.features!="object"||typeof n.requestDevice!="function")throw new Error("Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.")}else{let i=t.webgpu.powerPreference;if(i!==void 0&&i!=="low-power"&&i!=="high-performance")throw new Error(`Invalid powerPreference setting: "${i}"`);let r=t.webgpu.forceFallbackAdapter;if(r!==void 0&&typeof r!="boolean")throw new Error(`Invalid forceFallbackAdapter setting: "${r}"`);if(n=await navigator.gpu.requestAdapter({powerPreference:i,forceFallbackAdapter:r}),!n)throw new Error('Failed to get GPU adapter. You may need to enable flag "--enable-unsafe-webgpu" if you are using Chrome.')}}if(e==="webnn"&&(typeof navigator>"u"||!navigator.ml))throw new Error("WebNN is not supported in current environment")},_r=new Map,B$=t=>{let e=ee(),n=e.stackSave();try{let i=e.PTR_SIZE,r=e.stackAlloc(2*i);e._OrtGetInputOutputCount(t,r,r+i)!==0&&K("Can't get session input/output count.");let o=i===4?"i32":"i64";return[Number(e.getValue(r,o)),Number(e.getValue(r+i,o))]}finally{e.stackRestore(n)}},$p=(t,e)=>{let n=ee(),i=n.stackSave(),r=0;try{let o=n.PTR_SIZE,s=n.stackAlloc(2*o);n._OrtGetInputOutputMetadata(t,e,s,s+o)!==0&&K("Can't get session input/output metadata.");let a=Number(n.getValue(s,"*"));r=Number(n.getValue(s+o,"*"));let u=n.HEAP32[r/4];if(u===0)return[a,0];let c=n.HEAPU32[r/4+1],l=[];for(let d=0;d<c;d++){let f=Number(n.getValue(r+8+d*o,"*"));l.push(f!==0?n.UTF8ToString(f):Number(n.getValue(r+8+(d+c)*o,"*")))}return[a,u,l]}finally{n.stackRestore(i),r!==0&&n._OrtFree(r)}},Ip=t=>{let e=ee(),n=e._malloc(t.byteLength);if(n===0)throw new Error(`Can't create a session. failed to allocate a buffer of size ${t.byteLength}.`);return e.HEAPU8.set(t,n),[n,t.byteLength]},ox=async(t,e)=>{let n,i,r=ee();Array.isArray(t)?[n,i]=t:t.buffer===r.HEAPU8.buffer?[n,i]=[t.byteOffset,t.byteLength]:[n,i]=Ip(t);let o=0,s=0,a=0,u=[],c=[],l=[];try{if([s,u]=await Y$(e),e?.externalData&&r.mountExternalData){let C=[];for(let E of e.externalData){let T=typeof E=="string"?E:E.path;C.push(ga(typeof E=="string"?E:E.data).then(Z=>{r.mountExternalData(T,Z)}))}await Promise.all(C)}for(let C of e?.executionProviders??[])if((typeof C=="string"?C:C.name)==="webnn"){if(r.shouldTransferToMLTensor=!1,typeof C!="string"){let E=C,T=E?.context,Z=E?.gpuDevice,F=E?.deviceType,q=E?.powerPreference;T?r.currentContext=T:Z?r.currentContext=await r.webnnCreateMLContext(Z):r.currentContext=await r.webnnCreateMLContext({deviceType:F,powerPreference:q})}else r.currentContext=await r.webnnCreateMLContext();break}o=await r._OrtCreateSession(n,i,s),r.webgpuOnCreateSession?.(o),o===0&&K("Can't create a session."),r.jsepOnCreateSession?.(),r.currentContext&&(r.webnnRegisterMLContext(o,r.currentContext),r.currentContext=void 0,r.shouldTransferToMLTensor=!0);let[d,f]=B$(o),h=!!e?.enableGraphCapture,p=[],_=[],S=[],k=[],P=[];for(let C=0;C<d;C++){let[E,T,Z]=$p(o,C);E===0&&K("Can't get an input name."),c.push(E);let F=r.UTF8ToString(E);p.push(F),S.push(T===0?{name:F,isTensor:!1}:{name:F,isTensor:!0,type:pa(T),shape:Z})}for(let C=0;C<f;C++){let[E,T,Z]=$p(o,C+d);E===0&&K("Can't get an output name."),l.push(E);let F=r.UTF8ToString(E);_.push(F),k.push(T===0?{name:F,isTensor:!1}:{name:F,isTensor:!0,type:pa(T),shape:Z})}return _r.set(o,[o,c,l,null,h,!1]),[o,p,_,S,k]}catch(d){throw c.forEach(f=>r._OrtFree(f)),l.forEach(f=>r._OrtFree(f)),a!==0&&r._OrtReleaseBinding(a)!==0&&K("Can't release IO binding."),o!==0&&r._OrtReleaseSession(o)!==0&&K("Can't release session."),d}finally{r._free(n),s!==0&&r._OrtReleaseSessionOptions(s)!==0&&K("Can't release session options."),u.forEach(d=>r._free(d)),r.unmountExternalData?.()}},sx=t=>{let e=ee(),n=_r.get(t);if(!n)throw new Error(`cannot release session. invalid session id: ${t}`);let[i,r,o,s,a]=n;s&&(a&&e._OrtClearBoundOutputs(s.handle)!==0&&K("Can't clear bound outputs."),e._OrtReleaseBinding(s.handle)!==0&&K("Can't release IO binding.")),e.jsepOnReleaseSession?.(t),e.webnnOnReleaseSession?.(t),e.webgpuOnReleaseSession?.(t),r.forEach(u=>e._OrtFree(u)),o.forEach(u=>e._OrtFree(u)),e._OrtReleaseSession(i)!==0&&K("Can't release session."),_r.delete(t)},xp=async(t,e,n,i,r,o,s=!1)=>{if(!t){e.push(0);return}let a=ee(),u=a.PTR_SIZE,c=t[0],l=t[1],d=t[3],f=d,h,p;if(c==="string"&&(d==="gpu-buffer"||d==="ml-tensor"))throw new Error("String tensor is not supported on GPU.");if(s&&d!=="gpu-buffer")throw new Error(`External buffer must be provided for input/output index ${o} when enableGraphCapture is true.`);if(d==="gpu-buffer"){let k=t[2].gpuBuffer;p=vn(gn(c),l);{let P=a.jsepRegisterBuffer;if(!P)throw new Error('Tensor location "gpu-buffer" is not supported without using WebGPU.');h=P(i,o,k,p)}}else if(d==="ml-tensor"){let k=t[2].mlTensor;p=vn(gn(c),l);let P=a.webnnRegisterMLTensor;if(!P)throw new Error('Tensor location "ml-tensor" is not supported without using WebNN.');h=P(i,k,gn(c),l)}else{let k=t[2];if(Array.isArray(k)){p=u*k.length,h=a._malloc(p),n.push(h);for(let P=0;P<k.length;P++){if(typeof k[P]!="string")throw new TypeError(`tensor data at index ${P} is not a string`);a.setValue(h+P*u,at(k[P],n),"*")}}else{let P=a.webnnIsGraphInput,C=a.webnnIsGraphOutput;if(c!=="string"&&P&&C){let E=a.UTF8ToString(r);if(P(i,E)||C(i,E)){let T=gn(c);p=vn(T,l),f="ml-tensor";let Z=a.webnnCreateTemporaryTensor,F=a.webnnUploadTensor;if(!Z||!F)throw new Error('Tensor location "ml-tensor" is not supported without using WebNN.');let q=await Z(i,T,l);F(q,new Uint8Array(k.buffer,k.byteOffset,k.byteLength)),h=q}else p=k.byteLength,h=a._malloc(p),n.push(h),a.HEAPU8.set(new Uint8Array(k.buffer,k.byteOffset,p),h)}else p=k.byteLength,h=a._malloc(p),n.push(h),a.HEAPU8.set(new Uint8Array(k.buffer,k.byteOffset,p),h)}}let _=a.stackSave(),S=a.stackAlloc(4*l.length);try{l.forEach((P,C)=>a.setValue(S+C*u,P,u===4?"i32":"i64"));let k=a._OrtCreateTensor(gn(c),h,p,S,l.length,ex(f));k===0&&K(`Can't create tensor for input/output. session=${i}, index=${o}.`),e.push(k)}finally{a.stackRestore(_)}},ax=async(t,e,n,i,r,o)=>{let s=ee(),a=s.PTR_SIZE,u=_r.get(t);if(!u)throw new Error(`cannot run inference. invalid session id: ${t}`);let c=u[0],l=u[1],d=u[2],f=u[3],h=u[4],p=u[5],_=e.length,S=i.length,k=0,P=[],C=[],E=[],T=[],Z=[],F=s.stackSave(),q=s.stackAlloc(_*a),ne=s.stackAlloc(_*a),$e=s.stackAlloc(S*a),he=s.stackAlloc(S*a);try{[k,P]=K$(o),Ht("wasm prepareInputOutputTensor");for(let D=0;D<_;D++)await xp(n[D],C,T,t,l[e[D]],e[D],h);for(let D=0;D<S;D++)await xp(r[D],E,T,t,d[i[D]],_+i[D],h);Jt("wasm prepareInputOutputTensor");for(let D=0;D<_;D++)s.setValue(q+D*a,C[D],"*"),s.setValue(ne+D*a,l[e[D]],"*");for(let D=0;D<S;D++)s.setValue($e+D*a,E[D],"*"),s.setValue(he+D*a,d[i[D]],"*");s.jsepOnRunStart?.(c),s.webnnOnRunStart?.(c);let Se;Se=await s._OrtRun(c,ne,q,_,he,S,$e,k),Se!==0&&K("failed to call OrtRun().");let ke=[],Q=[];Ht("wasm ProcessOutputTensor");for(let D=0;D<S;D++){let ce=Number(s.getValue($e+D*a,"*"));if(ce===E[D]||Z.includes(E[D])){ke.push(r[D]),ce!==E[D]&&s._OrtReleaseTensor(ce)!==0&&K("Can't release tensor.");continue}let it=s.stackSave(),je=s.stackAlloc(4*a),zr=!1,le,Me=0;try{s._OrtGetTensorData(ce,je,je+a,je+2*a,je+3*a)!==0&&K(`Can't access output tensor data on index ${D}.`);let zu=a===4?"i32":"i64",mo=Number(s.getValue(je,zu));Me=s.getValue(je+a,"*");let Ng=s.getValue(je+a*2,"*"),bE=Number(s.getValue(je+a*3,zu)),Pt=[];for(let pe=0;pe<bE;pe++)Pt.push(Number(s.getValue(Ng+pe*a,zu)));s._OrtFree(Ng)!==0&&K("Can't free memory for tensor dims.");let Ct=Pt.reduce((pe,se)=>pe*se,1);le=pa(mo);let Ln=f?.outputPreferredLocations[i[D]];if(le==="string"){if(Ln==="gpu-buffer"||Ln==="ml-tensor")throw new Error("String tensor is not supported on GPU.");let pe=[];for(let se=0;se<Ct;se++){let _t=s.getValue(Me+se*a,"*"),$E=s.getValue(Me+(se+1)*a,"*"),xE=se===Ct-1?void 0:$E-_t;pe.push(s.UTF8ToString(_t,xE))}ke.push([le,Pt,pe,"cpu"])}else if(Ln==="gpu-buffer"&&Ct>0){let pe=s.jsepGetBuffer;if(!pe)throw new Error('preferredLocation "gpu-buffer" is not supported without using WebGPU.');let se=pe(Me),_t=vn(mo,Ct);if(_t===void 0||!zp(le))throw new Error(`Unsupported data type: ${le}`);zr=!0,ke.push([le,Pt,{gpuBuffer:se,download:s.jsepCreateDownloader(se,_t,le),dispose:()=>{s._OrtReleaseTensor(ce)!==0&&K("Can't release tensor.")}},"gpu-buffer"])}else if(Ln==="ml-tensor"&&Ct>0){let pe=s.webnnEnsureTensor,se=s.webnnIsGraphInputOutputTypeSupported;if(!pe||!se)throw new Error('preferredLocation "ml-tensor" is not supported without using WebNN.');if(vn(mo,Ct)===void 0||!Rp(le))throw new Error(`Unsupported data type: ${le}`);if(!se(t,le,!1))throw new Error(`preferredLocation "ml-tensor" for ${le} output is not supported by current WebNN Context.`);let _t=await pe(t,Me,mo,Pt,!1);zr=!0,ke.push([le,Pt,{mlTensor:_t,download:s.webnnCreateMLTensorDownloader(Me,le),dispose:()=>{s.webnnReleaseTensorId(Me),s._OrtReleaseTensor(ce)}},"ml-tensor"])}else if(Ln==="ml-tensor-cpu-output"&&Ct>0){let pe=s.webnnCreateMLTensorDownloader(Me,le)(),se=ke.length;zr=!0,Q.push((async()=>{let _t=[se,await pe];return s.webnnReleaseTensorId(Me),s._OrtReleaseTensor(ce),_t})()),ke.push([le,Pt,[],"cpu"])}else{let pe=X$(le),se=new pe(Ct);new Uint8Array(se.buffer,se.byteOffset,se.byteLength).set(s.HEAPU8.subarray(Me,Me+se.byteLength)),ke.push([le,Pt,se,"cpu"])}}finally{s.stackRestore(it),le==="string"&&Me&&s._free(Me),zr||s._OrtReleaseTensor(ce)}}f&&!h&&(s._OrtClearBoundOutputs(f.handle)!==0&&K("Can't clear bound outputs."),_r.set(t,[c,l,d,f,h,!1]));for(let[D,ce]of await Promise.all(Q))ke[D][2]=ce;return Jt("wasm ProcessOutputTensor"),ke}finally{s.webnnOnRunEnd?.(c),s.stackRestore(F),C.forEach(Se=>s._OrtReleaseTensor(Se)),E.forEach(Se=>s._OrtReleaseTensor(Se)),T.forEach(Se=>s._free(Se)),k!==0&&s._OrtReleaseRunOptions(k),P.forEach(Se=>s._free(Se))}},ux=t=>{let e=ee(),n=_r.get(t);if(!n)throw new Error("invalid session id");let i=n[0],r=e._OrtEndProfiling(i);r===0&&K("Can't get an profile file name."),e._OrtFree(r)}}),gx=Xe(()=>{"use strict";uO(),Ri(),H$(),ha=!1,wp=!1,Sp=!1,cx=async()=>{if(!wp){if(ha)throw new Error("multiple calls to 'initWasm()' detected.");if(Sp)throw new Error("previous call to 'initWasm()' failed.");ha=!0;try{await J$(ie.wasm),await nx(ie),wp=!0}catch(t){throw Sp=!0,t}finally{ha=!1}}},lx=async t=>{await ix(ie,t)},dx=async t=>Ip(t),fx=async(t,e)=>ox(t,e),hx=async t=>{sx(t)},px=async(t,e,n,i,r,o)=>ax(t,e,n,i,r,o),mx=async t=>{ux(t)}}),cO=Xe(()=>{"use strict";gx(),tx(),Pp(),rx(),kp=(t,e)=>{switch(t.location){case"cpu":return[t.type,t.dims,t.data,"cpu"];case"gpu-buffer":return[t.type,t.dims,{gpuBuffer:t.gpuBuffer},"gpu-buffer"];case"ml-tensor":return[t.type,t.dims,{mlTensor:t.mlTensor},"ml-tensor"];default:throw new Error(`invalid data location: ${t.location} for ${e()}`)}},G$=t=>{switch(t[3]){case"cpu":return new Ye(t[0],t[2],t[1]);case"gpu-buffer":{let e=t[0];if(!zp(e))throw new Error(`not supported data type: ${e} for deserializing GPU tensor`);let{gpuBuffer:n,download:i,dispose:r}=t[2];return Ye.fromGpuBuffer(n,{dataType:e,dims:t[1],download:i,dispose:r})}case"ml-tensor":{let e=t[0];if(!Rp(e))throw new Error(`not supported data type: ${e} for deserializing MLTensor tensor`);let{mlTensor:n,download:i,dispose:r}=t[2];return Ye.fromMLTensor(n,{dataType:e,dims:t[1],download:i,dispose:r})}default:throw new Error(`invalid data location: ${t[3]}`)}},vx=class{async fetchModelAndCopyToWasmMemory(t){return dx(await ga(t))}async loadModel(t,e){Wt();let n;typeof t=="string"?yn?n=await ga(t):n=await this.fetchModelAndCopyToWasmMemory(t):n=t,[this.sessionId,this.inputNames,this.outputNames,this.inputMetadata,this.outputMetadata]=await fx(n,e),qt()}async dispose(){return hx(this.sessionId)}async run(t,e,n){Wt();let i=[],r=[];Object.entries(t).forEach(d=>{let f=d[0],h=d[1],p=this.inputNames.indexOf(f);if(p===-1)throw new Error(`invalid input '${f}'`);i.push(h),r.push(p)});let o=[],s=[];Object.entries(e).forEach(d=>{let f=d[0],h=d[1],p=this.outputNames.indexOf(f);if(p===-1)throw new Error(`invalid output '${f}'`);o.push(h),s.push(p)});let a=i.map((d,f)=>kp(d,()=>`input "${this.inputNames[r[f]]}"`)),u=o.map((d,f)=>d?kp(d,()=>`output "${this.outputNames[s[f]]}"`):null),c=await px(this.sessionId,r,a,s,u,n),l={};for(let d=0;d<c.length;d++)l[this.outputNames[s[d]]]=o[d]??G$(c[d]);return qt(),l}startProfiling(){}endProfiling(){mx(this.sessionId)}}}),yx={};nO(yx,{OnnxruntimeWebAssemblyBackend:()=>Op,initializeFlags:()=>Tp,wasmBackend:()=>_x});lO=Xe(()=>{"use strict";gx(),cO(),Tp=()=>{(typeof ie.wasm.initTimeout!="number"||ie.wasm.initTimeout<0)&&(ie.wasm.initTimeout=0);let t=ie.wasm.simd;if(typeof t!="boolean"&&t!==void 0&&t!=="fixed"&&t!=="relaxed"&&(console.warn(`Property "env.wasm.simd" is set to unknown value "${t}". Reset it to \`false\` and ignore SIMD feature checking.`),ie.wasm.simd=!1),typeof ie.wasm.proxy!="boolean"&&(ie.wasm.proxy=!1),typeof ie.wasm.trace!="boolean"&&(ie.wasm.trace=!1),typeof ie.wasm.numThreads!="number"||!Number.isInteger(ie.wasm.numThreads)||ie.wasm.numThreads<=0)if(typeof self<"u"&&!self.crossOriginIsolated)ie.wasm.numThreads=1;else{let e=typeof navigator>"u"?Ep("node:os").cpus().length:navigator.hardwareConcurrency;ie.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},Op=class{async init(t){Tp(),await cx(),await lx(t)}async createInferenceSessionHandler(t,e){let n=new vx;return await n.loadModel(t,e),n}},_x=new Op}),dO="1.26.0",fO=mp;{let t=(lO(),oO(yx)).wasmBackend;pn("cpu",t,10),pn("wasm",t,10)}Object.defineProperty(ie.versions,"web",{value:dO,enumerable:!0})});import{existsSync as hO}from"node:fs";import{createRequire as pO}from"node:module";import{dirname as mO,join as gO,sep as xx}from"node:path";import{fileURLToPath as vO,pathToFileURL as yO}from"node:url";async function va(){let t=await Promise.resolve().then(()=>($x(),bx));return t.default??t}function ya(t,e){t.env.wasm.numThreads=1,t.env.wasm.wasmPaths=bO(e)}function _O(t){return[new URL("./",t),new URL("../",t)].map(e=>vO(e))}function bO(t=import.meta.url){let e=_O(t);try{e.push(mO(pO(t).resolve("onnxruntime-web")))}catch{}let n=null;for(let i of e){let r=wx.filter(o=>!hO(gO(i,o)));if(r.length===0)return $O(i);r.length<wx.length&&n===null&&(n={dir:i,missing:r})}throw n!==null?new Error(`ort-web WASM runtime at '${n.dir}' is missing '${n.missing.join("', '")}' - the .wasm and its .mjs glue must be copied together`):new Error(`ort-web WASM runtime ('${Sx}' + '${kx}') not found beside the bundle or in node_modules`)}function $O(t){return yO(t.endsWith(xx)?t:t+xx).href}var Sx,kx,wx,Np=v(()=>{"use strict";Sx="ort-wasm-simd-threaded.wasm",kx="ort-wasm-simd-threaded.mjs",wx=[Sx,kx]});import{existsSync as xO}from"node:fs";import{fileURLToPath as wO}from"node:url";function Dp(t,e){return[new URL(`../../assets/${t}`,e),new URL(`./assets/${t}`,e),new URL(`../assets/${t}`,e)].map(n=>wO(n))}function _a(t,e,n,i={}){let r=i.baseUrl??n,o=i.exists??xO,s="envPath"in i?i.envPath:process.env[e];if(s&&o(s))return s;let a=Dp(t,r);for(let u of a)if(o(u))return u;throw new Error(`model '${t}' not found. Tried: ${a.join(", ")}. Set ${e} to override.`)}var Lp=v(()=>{"use strict"});function Up(t={}){return _a(Ex,Ix,import.meta.url,t)}var Ex,Ix,jp=v(()=>{"use strict";Lp();Ex="silero_vad.onnx",Ix="JARVIS_SILERO_VAD_MODEL_PATH"});var _n,Ni,Tx,br,Mp=v(()=>{"use strict";Np();jp();_n=512,Ni=64,Tx=256,br=class{modelPath;sessionPromise=null;session=null;ort=null;disposed=!1;pending=new Int16Array(_n);pendingLen=0;state=new Float32Array(Tx);context=new Float32Array(Ni);chain=Promise.resolve();constructor(e={}){this.modelPath=e.modelPath}process(e){if(this.disposed)return Promise.reject(new Error("SileroVadRunner is disposed"));let n=this.chain.then(()=>this.runWindows(e));return this.chain=n.then(()=>{},()=>{}),n}reset(){this.chain=this.chain.then(()=>{this.pendingLen=0,this.state=new Float32Array(Tx),this.context.fill(0)})}load(){return this.disposed?Promise.reject(new Error("SileroVadRunner is disposed")):this.ensureSession().then(()=>{})}prewarm(){this.disposed||this.ensureSession().catch(()=>{})}async dispose(){this.disposed=!0,this.pendingLen=0;let e=this.session;this.session=null,this.sessionPromise=null,this.ort=null,e&&await e.release()}async runWindows(e){if(this.disposed)throw new Error("SileroVadRunner is disposed");if(e.length===0)return[];let n=await this.ensureSession(),i=this.ort;if(!i)throw new Error("onnxruntime-web failed to load");let r=[],o=0;for(;;){let s=Math.min(_n-this.pendingLen,e.length-o);if(s>0&&(this.pending.set(e.subarray(o,o+s),this.pendingLen),this.pendingLen+=s,o+=s),this.pendingLen<_n)break;this.pendingLen=0,r.push(await this.inferWindow(n,i))}return r}async inferWindow(e,n){let i=new Float32Array(Ni+_n);i.set(this.context,0);for(let a=0;a<_n;a++)i[Ni+a]=this.pending[a]/32768;let r=await e.run({input:new n.Tensor("float32",i,[1,i.length]),state:new n.Tensor("float32",this.state,[2,1,128]),sr:new n.Tensor("int64",BigInt64Array.from([16000n]),[])});if(this.disposed)throw new Error("SileroVadRunner is disposed");let o=r[e.outputNames[0]].data;this.state=r[e.outputNames[1]].data,this.context.set(i.subarray(i.length-Ni));let s=o[0];if(!Number.isFinite(s))throw new Error("silero vad produced a non-finite output");return s<0?0:s>1?1:s}ensureSession(){return this.sessionPromise?this.sessionPromise:(this.sessionPromise=this.loadSession(),this.sessionPromise)}async loadSession(){let e=await va();this.ort=e,ya(e);let n=this.modelPath??Up(),i=await e.InferenceSession.create(n,{executionProviders:["wasm"],graphOptimizationLevel:"all",executionMode:"sequential"});if(this.disposed)throw await i.release(),new Error("SileroVadRunner is disposed");return this.session=i,i}}});function SO(t){let e=1;for(;e<t;)e<<=1;return e}var Fp,ba,Ox=v(()=>{"use strict";Fp=class{size;rev;cos;sin;constructor(e){if(e<2||(e&e-1)!==0)throw new Error(`Radix2Fft size must be a power of two >= 2, got ${e}`);this.size=e;let n=Math.log2(e);this.rev=new Uint32Array(e);for(let r=0;r<e;r++){let o=0;for(let s=0;s<n;s++)o|=(r>>s&1)<<n-1-s;this.rev[r]=o}let i=e>>1;this.cos=new Float64Array(i),this.sin=new Float64Array(i);for(let r=0;r<i;r++){let o=2*Math.PI*r/e;this.cos[r]=Math.cos(o),this.sin[r]=Math.sin(o)}}transform(e,n,i){let r=this.size,o=this.rev;for(let s=0;s<r;s++){let a=o[s];if(a>s){let u=e[s];e[s]=e[a],e[a]=u;let c=n[s];n[s]=n[a],n[a]=c}}for(let s=2;s<=r;s<<=1){let a=s>>1,u=r/s;for(let c=0;c<r;c+=s)for(let l=0;l<a;l++){let d=l*u,f=this.cos[d],h=i?this.sin[d]:-this.sin[d],p=c+l,_=p+a,S=e[_]*f-n[_]*h,k=e[_]*h+n[_]*f;e[_]=e[p]-S,n[_]=n[p]-k,e[p]+=S,n[p]+=k}}if(i){let s=1/r;for(let a=0;a<r;a++)e[a]*=s,n[a]*=s}}};ba=class{n;bins;m;fft;chirpCos;chirpSin;bRe;bIm;aRe;aIm;constructor(e){if(e<2)throw new Error(`PowerSpectrum length must be >= 2, got ${e}`);this.n=e,this.bins=(e>>1)+1,this.m=SO(2*e-1),this.fft=new Fp(this.m),this.chirpCos=new Float64Array(e),this.chirpSin=new Float64Array(e);for(let n=0;n<e;n++){let i=n*n%(2*e),r=Math.PI*i/e;this.chirpCos[n]=Math.cos(r),this.chirpSin[n]=Math.sin(r)}this.bRe=new Float64Array(this.m),this.bIm=new Float64Array(this.m);for(let n=0;n<e;n++){let i=this.chirpCos[n],r=this.chirpSin[n];this.bRe[n]=i,this.bIm[n]=r,n!==0&&(this.bRe[this.m-n]=i,this.bIm[this.m-n]=r)}this.fft.transform(this.bRe,this.bIm,!1),this.aRe=new Float64Array(this.m),this.aIm=new Float64Array(this.m)}computePower(e,n){let{n:i,m:r,aRe:o,aIm:s}=this;o.fill(0),s.fill(0);for(let a=0;a<i;a++){let u=e[a];o[a]=u*this.chirpCos[a],s[a]=-u*this.chirpSin[a]}this.fft.transform(o,s,!1);for(let a=0;a<r;a++){let u=o[a],c=s[a],l=this.bRe[a],d=this.bIm[a];o[a]=u*l-c*d,s[a]=u*d+c*l}this.fft.transform(o,s,!0);for(let a=0;a<this.bins;a++){let u=o[a],c=s[a];n[a]=u*u+c*c}}}});function Cx(t){let i=27/Math.log(6.4);return t>=1e3?15+Math.log(t/1e3)*i:3*t/200}function IO(t){let i=Math.log(6.4)/27;return t>=15?1e3*Math.exp(i*(t-15)):200*t/3}function zx(t,e,n){let i=new Float64Array(n),r=n>1?(e-t)/(n-1):0;for(let o=0;o<n;o++)i[o]=t+o*r;return n>1&&(i[n-1]=e),i}function TO(){let t=Cx(0),e=Cx(Vp/2),n=zx(t,e,St+2),i=new Float64Array(St+2);for(let a=0;a<n.length;a++)i[a]=IO(n[a]);let r=zx(0,Vp/2,Di),o=new Float64Array(St+1);for(let a=0;a<St+1;a++)o[a]=i[a+1]-i[a];let s=[];for(let a=0;a<St;a++){let u=2/(i[a+2]-i[a]),c=new Float64Array(Di),l=Di,d=0;for(let f=0;f<Di;f++){let h=-(i[a]-r[f])/o[a],p=(i[a+2]-r[f])/o[a+1],_=Math.max(0,Math.min(h,p))*u;c[f]=_,_>0&&(f<l&&(l=f),d=f+1)}l>d&&(l=d=0),s.push({lo:l,hi:d,weights:c.slice(l,d)})}return s}function OO(){let t=new Float64Array(ut);for(let e=0;e<ut;e++)t[e]=.5-.5*Math.cos(2*Math.PI*e/ut);return t}var Vp,ut,kO,St,Di,Ax,EO,Px,Ue,$r,Zp,Li,$a=v(()=>{"use strict";Ox();Vp=16e3,ut=400,kO=160,St=80,Di=(ut>>1)+1,Ax=1e-10,EO=1e-7,Px=32768,Ue=Vp*8,$r=800,Zp=St;Li=class{hann=OO();filters=TO();spectrum=new ba(ut);padded=new Float64Array(Ue+ut);frame=new Float64Array(ut);power=new Float64Array(Di);logBuf=new Float64Array(St*$r);fromPcm16(e){return this.window(e),this.normalize(),this.reflectPad(),this.melSpectrogram()}window(e){let n=this.padded,i=ut/2,r=e.length;if(r>=Ue){let o=r-Ue;for(let s=0;s<Ue;s++)n[i+s]=e[o+s]/Px}else{let o=Ue-r;for(let s=0;s<o;s++)n[i+s]=0;for(let s=0;s<r;s++)n[i+o+s]=e[s]/Px}}normalize(){let e=this.padded,n=ut/2,i=Ue,r=0;for(let a=0;a<i;a++)r+=e[n+a];r/=i;let o=0;for(let a=0;a<i;a++){let u=e[n+a]-r;o+=u*u}o/=i;let s=1/Math.sqrt(o+EO);for(let a=0;a<i;a++)e[n+a]=(e[n+a]-r)*s}reflectPad(){let e=this.padded,n=ut/2,i=Ue;for(let r=0;r<n;r++)e[r]=e[n+(n-r)],e[n+i+r]=e[n+(i-2-r)]}melSpectrogram(){let{padded:e,frame:n,power:i,hann:r,filters:o,logBuf:s}=this;for(let l=0;l<$r;l++){let d=l*kO;for(let f=0;f<ut;f++)n[f]=e[d+f]*r[f];this.spectrum.computePower(n,i);for(let f=0;f<St;f++){let{lo:h,hi:p,weights:_}=o[f],S=0;for(let k=h;k<p;k++)S+=_[k-h]*i[k];s[f*$r+l]=Math.log10(S<Ax?Ax:S)}}let a=-1/0;for(let l of s)l>a&&(a=l);let u=a-8,c=new Float32Array(St*$r);for(let l=0;l<s.length;l++){let d=s[l]<u?u:s[l];c[l]=(d+4)/4}return c}}});function AO(t){return t.toLowerCase().replace(/[.,!?;:]+$/g,"").trim()}function Bp(t,e){return e.some(n=>Nx(t,n))}function Nx(t,e){if(!t.endsWith(e))return!1;let n=t.length-e.length-1;return n<0||t[n]===" "}function PO(t,e){let n=CO(t);return n===""?null:e.find(i=>zO(n,i))??null}function CO(t){let e=/^.*[.!?\u3002\uFF01\uFF1F]\s+/s.exec(t);return(e?t.slice(e[0].length):t).trim()}function zO(t,e){for(let n=t.indexOf(e);n!==-1;n=t.indexOf(e,n+1)){let i=n===0||!Rx(t[n-1]),r=n+e.length===t.length||!Rx(t[n+e.length]);if(i&&r)return!0}return!1}function Rx(t){return/[a-z0-9']/.test(t)}var xa,Gp,Ui,Wp=v(()=>{"use strict";Pi();Pi();xa={silenceEnergyThreshold:ua,shortSilenceMs:500,longSilenceMs:1400,reopenGraceMs:400,stopSecsMs:3e4,heldBudgetLadderMs:[4e3,8e3],heldCeilingMs:12e4,strongHoldCues:["hold on","hang on","give me a sec","give me a second","one moment","one sec","one second","let me think","let me see","let me look"],weakHoldCues:["actually","wait"],commitCues:["that's it","go ahead","what do you think"]},Gp="semantic",Ui=class{clock;config;classifier;telemetry=null;phase="listening";inSilence=!1;silenceStartedAt=null;firstSpeechAt=null;budgetOwner="baseline";armedBudgetMs=null;lastRawPartial="";lastNormPartial="";strongHoldCue=null;held=!1;heldLadderStep=0;heldCeilingDeadlineAtMs=null;commitCb;silenceTimer=null;graceTimer=null;stopTimer=null;ceilingTimer=null;constructor(e,n={},i){this.clock=e,this.config={...xa,...n},this.classifier=i??new Oi(this.config.silenceEnergyThreshold)}onAudioFrame(e){this.phase==="committed"||this.phase==="disposed"||this.classifier.classify(e,this.applyVerdict)}applyVerdict=e=>{this.phase==="committed"||this.phase==="disposed"||(e?this.handleSpeech():this.handleSilence())};onPartial(e){if(this.phase==="committed"||this.phase==="disposed")return;if(this.lastRawPartial=e.trim(),this.lastNormPartial=AO(e),Bp(this.lastNormPartial,this.config.commitCues)){this.commit("lexical");return}let n=this.strongHoldCue;if(this.strongHoldCue=PO(this.lastNormPartial,this.config.strongHoldCues),this.strongHoldCue!==null){if(this.strongHoldCue!==n){this.telemetry?.strongHoldRecognized(this.strongHoldCue),this.held||this.enterHeld(this.strongHoldCue);return}if(this.held)return;if(Nx(this.lastNormPartial,this.strongHoldCue)){this.enterHeld(this.strongHoldCue);return}this.holdFloor();return}if(Bp(this.lastNormPartial,this.config.weakHoldCues)){if(this.held)return;this.holdFloor()}}onCommit(e){this.commitCb=e}attachTelemetry(e){this.telemetry=e}dispose(){this.phase="disposed",this.clearAllTimers()}holdFloor(){this.clearSilenceTimer(),this.phase==="tentative"&&(this.clearGraceTimer(),this.phase="listening"),this.inSilence=!1}handleSpeech(){this.held?(this.inSilence&&(this.exitHeld("speech"),this.clearStopTimer(),this.stopTimer=this.clock.setTimer(this.config.stopSecsMs,()=>this.commit("stop_cap"))),this.firstSpeechAt??=this.clock.now()):this.firstSpeechAt===null&&(this.firstSpeechAt=this.clock.now(),this.stopTimer=this.clock.setTimer(this.config.stopSecsMs,()=>this.commit("stop_cap"))),this.clearSilenceTimer(),this.phase==="tentative"&&(this.clearGraceTimer(),this.phase="listening"),this.inSilence=!1}handleSilence(){this.firstSpeechAt===null||this.phase!=="listening"||this.inSilence||(this.inSilence=!0,this.silenceStartedAt=this.clock.now(),this.budgetOwner="baseline",this.armedBudgetMs=this.held?this.heldLadderBudgetMs():this.silenceBudgetMs(),this.silenceTimer=this.clock.setTimer(this.armedBudgetMs,()=>this.onSilenceBudgetElapsed()),this.onSilenceDetected())}silenceBudgetMs(){return this.isCompleteSounding()?this.config.shortSilenceMs:this.config.longSilenceMs}onSilenceDetected(){}canRefineBudget(){return this.phase==="listening"&&this.inSilence}canApplySemanticVerdict(){return(this.phase==="listening"||this.phase==="tentative")&&this.inSilence}isHeld(){return this.held}heldAllowanceExhausted(){return this.heldCeilingDeadlineAtMs!==null&&this.heldCeilingDeadlineAtMs-this.clock.now()<=0}livePartial(){return this.lastRawPartial}rearmSilence(e,n="smart_turn"){if(!this.inSilence||this.silenceStartedAt===null||this.phase!=="listening"&&this.phase!=="tentative"||this.held)return;let i=e-(this.clock.now()-this.silenceStartedAt);if(this.phase==="tentative"){if(i<=0)return;this.clearGraceTimer(),this.phase="listening"}e!==this.armedBudgetMs&&(this.budgetOwner=n),this.armedBudgetMs=e,this.clearSilenceTimer(),i<=0?this.onSilenceBudgetElapsed():this.silenceTimer=this.clock.setTimer(i,()=>this.onSilenceBudgetElapsed())}onSilenceBudgetElapsed(){if(this.silenceTimer=null,this.phase==="listening"){if(this.held){this.heldLadderStep+=1;let e=this.heldLadderBudgetMs();this.armedBudgetMs=e,this.silenceTimer=this.clock.setTimer(e,()=>this.onSilenceBudgetElapsed()),this.telemetry?.heldLadderRearmed(e);return}this.phase="tentative",this.graceTimer=this.clock.setTimer(this.config.reopenGraceMs,()=>{this.graceTimer=null,this.commit(this.budgetOwner)})}}isCompleteSounding(){return this.strongHoldCue!==null?!1:/[.!?\u3002\uFF01\uFF1F]$/.test(this.lastRawPartial)?!0:Bp(this.lastNormPartial,this.config.commitCues)}enterHeld(e){if(this.held)return;let n=this.clock.now();this.heldCeilingDeadlineAtMs??=n+this.config.heldCeilingMs;let i=this.heldCeilingDeadlineAtMs-n;if(!(i<=0&&e===Gp)){if(this.held=!0,this.heldLadderStep=0,this.clearStopTimer(),this.telemetry?.heldEntered(e),i<=0){this.commit("held_ceiling");return}this.ceilingTimer=this.clock.setTimer(i,()=>this.commit("held_ceiling")),this.holdFloor()}}resumeHeldSilence(){!this.held||this.phase!=="listening"||this.inSilence||this.firstSpeechAt===null||this.silenceStartedAt===null||(this.inSilence=!0,this.budgetOwner="baseline",this.armedBudgetMs=this.heldLadderBudgetMs(),this.silenceTimer=this.clock.setTimer(this.armedBudgetMs,()=>this.onSilenceBudgetElapsed()))}exitHeld(e){this.held=!1,this.clearCeilingTimer(),this.telemetry?.heldExited(e)}heldLadderBudgetMs(){let e=this.config.heldBudgetLadderMs;return e[Math.min(this.heldLadderStep,e.length-1)]??this.config.longSilenceMs}commit(e){this.phase==="committed"||this.phase==="disposed"||(this.held&&this.exitHeld(e==="held_ceiling"?"ceiling":"commit_cue"),this.phase="committed",this.clearAllTimers(),this.telemetry?.endpointerCommitted(e,this.inSilence?this.silenceStartedAt:null),this.commitCb?.())}clearSilenceTimer(){this.silenceTimer!==null&&(this.clock.clearTimer(this.silenceTimer),this.silenceTimer=null)}clearGraceTimer(){this.graceTimer!==null&&(this.clock.clearTimer(this.graceTimer),this.graceTimer=null)}clearStopTimer(){this.stopTimer!==null&&(this.clock.clearTimer(this.stopTimer),this.stopTimer=null)}clearCeilingTimer(){this.ceilingTimer!==null&&(this.clock.clearTimer(this.ceilingTimer),this.ceilingTimer=null)}clearAllTimers(){this.clearSilenceTimer(),this.clearGraceTimer(),this.clearStopTimer(),this.clearCeilingTimer()}}});var Dx,ji,qp=v(()=>{"use strict";$a();Wp();Dx={...xa,commitThreshold:.65,holdThreshold:.35},ji=class extends Ui{smartConfig;inference;buffer=new Int16Array(Ue*2);bufferLen=0;silenceEpoch=0;degraded=!1;smartDisposed=!1;semantics;evaluatedEpoch=0;evaluationAbort=new AbortController;constructor(e,n,i={},r,o){super(e,i,r),this.smartConfig={...Dx,...i},this.inference=n,o&&(this.semantics=o)}onAudioFrame(e){this.appendToBuffer(e),super.onAudioFrame(e)}dispose(){this.smartDisposed=!0,this.bufferLen=0,this.evaluationAbort.abort(),super.dispose()}onSilenceDetected(){if(this.silenceEpoch+=1,this.degraded||this.smartDisposed)return;let e=this.silenceEpoch,n=this.snapshotBuffer();this.runInference(n,e)}async runInference(e,n){let i=this.clock.now(),r;try{r=await this.inference.infer(e)}catch(s){let a=this.degraded;this.degraded=!0,!a&&!this.smartDisposed&&this.telemetry?.smartTurnDegraded(this.clock.now()-i,s);return}let o=this.clock.now()-i;if(this.smartDisposed||n!==this.silenceEpoch||!this.canRefineBudget()){this.telemetry?.smartTurnResolved(r,o,"stale");return}r>=this.smartConfig.commitThreshold?(this.telemetry?.smartTurnResolved(r,o,"shorten"),this.rearmSilence(this.smartConfig.shortSilenceMs),this.maybeEvaluateTurn(n,"shorten")):r<=this.smartConfig.holdThreshold?(this.telemetry?.smartTurnResolved(r,o,"extend"),this.rearmSilence(this.smartConfig.longSilenceMs)):(this.telemetry?.smartTurnResolved(r,o,"inconclusive"),this.maybeEvaluateTurn(n,"inconclusive"))}maybeEvaluateTurn(e,n){if(!this.semantics||this.evaluatedEpoch===e||this.isHeld())return;let i=this.livePartial();i!==""&&(this.evaluatedEpoch=e,this.runEvaluation(this.semantics,i,e,n))}async runEvaluation(e,n,i,r){this.telemetry?.evaluatorFired?.(r);let o=this.clock.now(),s;try{s=await e.evaluator.evaluate({recentTurns:e.recentTurns(),livePartial:n},this.evaluationAbort.signal)}catch(u){this.smartDisposed||this.telemetry?.evaluatorFailed?.(this.clock.now()-o,u);return}let a=this.clock.now()-o;if(this.smartDisposed||i!==this.silenceEpoch||!this.canApplySemanticVerdict()){this.telemetry?.evaluatorResolved?.(s.verdict,s.confidence,a,"stale");return}if(this.telemetry?.evaluatorResolved?.(s.verdict,s.confidence,a,"applied"),s.verdict==="done")this.rearmSilence(this.smartConfig.shortSilenceMs,"semantic");else if(s.verdict==="mid_thought")this.rearmSilence(this.smartConfig.longSilenceMs,"semantic");else{if(this.heldAllowanceExhausted())return;this.enterHeld(Gp),this.resumeHeldSilence()}}appendToBuffer(e){let n=e.byteLength>>1;if(n===0)return;let i=new DataView(e.buffer,e.byteOffset,e.byteLength),r=n>Ue?n-Ue:0,o=n-r;if(this.bufferLen+o>this.buffer.length){let s=Math.min(this.bufferLen,Ue);this.buffer.copyWithin(0,this.bufferLen-s,this.bufferLen),this.bufferLen=s}for(let s=r;s<n;s++)this.buffer[this.bufferLen++]=i.getInt16(s*2,!0)}snapshotBuffer(){let e=Math.max(0,this.bufferLen-Ue);return this.buffer.slice(e,this.bufferLen)}}});function Hp(t={}){return _a(Lx,Ux,import.meta.url,t)}var Lx,Ux,Jp=v(()=>{"use strict";Lp();Lx="smart-turn-v3.1-cpu.onnx",Ux="JARVIS_SMART_TURN_MODEL_PATH"});var Mi,Kp=v(()=>{"use strict";$a();Np();Jp();Mi=class{logMel;modelPath;sessionPromise=null;session=null;ort=null;disposed=!1;constructor(e={}){this.logMel=e.logMel??new Li,this.modelPath=e.modelPath}async infer(e){if(this.disposed)throw new Error("SmartTurnRunner is disposed");let n=await this.ensureSession(),i=this.ort;if(!i)throw new Error("onnxruntime-web failed to load");let r=this.logMel.fromPcm16(e),o=new i.Tensor("float32",r,[1,Zp,$r]),s=await n.run({input_features:o});if(this.disposed)throw new Error("SmartTurnRunner is disposed");let a=n.outputNames[0],c=s[a].data[0];if(!Number.isFinite(c))throw new Error("smart-turn produced a non-finite output");return c<0?0:c>1?1:c}prewarm(){this.disposed||this.ensureSession().catch(()=>{})}async dispose(){this.disposed=!0;let e=this.session;this.session=null,this.sessionPromise=null,this.ort=null,e&&await e.release()}ensureSession(){return this.sessionPromise?this.sessionPromise:(this.sessionPromise=this.load(),this.sessionPromise)}async load(){let e=await va();this.ort=e,ya(e);let n=this.modelPath??Hp(),i=await e.InferenceSession.create(n,{executionProviders:["wasm"],graphOptimizationLevel:"all",executionMode:"sequential"});if(this.disposed)throw await i.release(),new Error("SmartTurnRunner is disposed");return this.session=i,i}}});function MO(t){let e=[];if(t.recentTurns.length>0){e.push("Recent conversation:");for(let n of t.recentTurns)e.push(`${n.role==="assistant"?"Assistant":"User"}: ${n.text}`)}else e.push("Recent conversation: (none)");return e.push(""),e.push("Live partial transcript (the user is speaking right now):"),e.push(JSON.stringify(t.livePartial)),e.join(`
140
- `)}function FO(t){let e=Yp(t)?.content,n=(Array.isArray(e)?e:[]).map(l=>Yp(l)).filter(l=>l?.type==="text").map(l=>typeof l?.text=="string"?l.text:"").join(""),i=jx+n;i.includes("}")||(i+="}");let r=i.indexOf("{"),o=i.lastIndexOf("}");if(r===-1||o<=r)throw new Yt("turn evaluator reply carried no JSON object");let s;try{s=JSON.parse(i.slice(r,o+1))}catch{throw new Yt("turn evaluator reply was not valid JSON")}let a=Yp(s),u=a?.verdict;if(typeof u!="string"||!UO.includes(u))throw new Yt("turn evaluator reply carried an unknown verdict");let c=a?.confidence;if(typeof c!="number"||!Number.isFinite(c)||c<0||c>1)throw new Yt("turn evaluator confidence missing or out of range");return{verdict:u,confidence:c}}function Yp(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0}var RO,NO,DO,jx,LO,UO,jO,Yt,bn,Xp=v(()=>{"use strict";RO="claude-haiku-4-5-20251001",NO="https://api.anthropic.com/v1/messages",DO="2023-06-01",jx='{"verdict":"',LO=["}"],UO=["done","mid_thought","hold_floor"],jO=`You are the semantic turn evaluator inside a real-time voice assistant's
144
+ `,qt=class extends Error{status;constructor(e,n){super(e),this.status=n,this.name="AddresseeEvaluatorError"}},On=class{key;fetchImpl;timeoutMs;constructor(e,n=fetch,i=1200){this.key=e,this.fetchImpl=n,this.timeoutMs=i}async evaluate(e,n,i){let r={model:MA,max_tokens:64,temperature:0,stop_sequences:ZA,system:GA,messages:[{role:"user",content:WA(e)},{role:"assistant",content:mx}]},o=await this.fetchImpl(FA,{method:"POST",headers:{"x-api-key":this.key,"anthropic-version":VA,"content-type":"application/json"},body:JSON.stringify(r),signal:AbortSignal.any([n,AbortSignal.timeout(i?.timeoutMs??this.timeoutMs)])});if(!o.ok)throw new qt(`addressee evaluator request failed (HTTP ${o.status})`,o.status);let s;try{s=await o.json()}catch{throw new qt("addressee evaluator response body was not JSON")}return qA(s)}}});var HA,JA,gx,Gi,Gp=v(()=>{"use strict";HA=new Set([".","!","?"]),JA=new Set([",",";",":"]),gx={minClauseLength:12},Gi=class{buffer="";minClauseLength;constructor(e=gx){this.minClauseLength=e.minClauseLength}push(e){this.buffer+=e;let n=[];for(let i=this.findBoundary();i!==-1;i=this.findBoundary()){let r=this.buffer.slice(0,i+1).trim();this.buffer=this.buffer.slice(i+1).replace(/^\s+/,""),r.length>0&&n.push(r)}return n}flush(){let e=this.buffer.trim();return this.buffer="",e.length>0?[e]:[]}findBoundary(){for(let e=0;e<this.buffer.length;e++){let n=this.buffer[e];if(n===`
145
+ `)return e;let i=e+1<this.buffer.length?this.buffer[e+1]:"";if(i!==""&&/\s/.test(i)&&(HA.has(n)||JA.has(n)&&e+1>=this.minClauseLength))return e}return-1}}});var Ua,xr,An,KA,vx,Wp=v(()=>{Ua=new Map,xr=[],An=(t,e,n)=>{if(e&&typeof e.init=="function"&&typeof e.createInferenceSessionHandler=="function"){let i=Ua.get(t);if(i===void 0)Ua.set(t,{backend:e,priority:n});else{if(i.priority>n)return;if(i.priority===n&&i.backend!==e)throw new Error(`cannot register backend "${t}" using priority ${n}`)}if(n>=0){let r=xr.indexOf(t);r!==-1&&xr.splice(r,1);for(let o=0;o<xr.length;o++)if(Ua.get(xr[o]).priority<=n){xr.splice(o,0,t);return}xr.push(t)}return}throw new TypeError("not a valid backend")},KA=async t=>{let e=Ua.get(t);if(!e)return"backend not found.";if(e.initialized)return e.backend;if(e.aborted)return e.error;{let n=!!e.initPromise;try{return n||(e.initPromise=e.backend.init(t)),await e.initPromise,e.initialized=!0,e.backend}catch(i){return n||(e.error=`${i}`,e.aborted=!0),e.error}finally{delete e.initPromise}}},vx=async t=>{let e=t.executionProviders||[],n=e.map(u=>typeof u=="string"?u:u.name),i=n.length===0?xr:n,r,o=[],s=new Set;for(let u of i){let c=await KA(u);typeof c=="string"?o.push({name:u,err:c}):(r||(r=c),r===c&&s.add(u))}if(!r)throw new Error(`no available backend found. ERR: ${o.map(u=>`[${u.name}] ${u.err}`).join(", ")}`);for(let{name:u,err:c}of o)n.includes(u)&&console.warn(`removing requested execution provider "${u}" from session options because it is not available: ${c}`);let a=e.filter(u=>s.has(typeof u=="string"?u:u.name));return[r,new Proxy(t,{get:(u,c)=>c==="executionProviders"?a:Reflect.get(u,c)})]}});var yx=v(()=>{Wp()});var _x,bx=v(()=>{_x="1.26.0"});var $x,he,qp=v(()=>{bx();$x="warning",he={wasm:{},webgl:{},webgpu:{},versions:{common:_x},set logLevel(t){if(t!==void 0){if(typeof t!="string"||["verbose","info","warning","error","fatal"].indexOf(t)===-1)throw new Error(`Unsupported logging level: ${t}`);$x=t}},get logLevel(){return $x}};Object.defineProperty(he,"logLevel",{enumerable:!0})});var ie,xx=v(()=>{qp();ie=he});var wx,Sx,kx=v(()=>{wx=(t,e)=>{let n=typeof document<"u"?document.createElement("canvas"):new OffscreenCanvas(1,1);n.width=t.dims[3],n.height=t.dims[2];let i=n.getContext("2d");if(i!=null){let r,o;e?.tensorLayout!==void 0&&e.tensorLayout==="NHWC"?(r=t.dims[2],o=t.dims[3]):(r=t.dims[3],o=t.dims[2]);let s=e?.format!==void 0?e.format:"RGB",a=e?.norm,u,c;a===void 0||a.mean===void 0?u=[255,255,255,255]:typeof a.mean=="number"?u=[a.mean,a.mean,a.mean,a.mean]:(u=[a.mean[0],a.mean[1],a.mean[2],0],a.mean[3]!==void 0&&(u[3]=a.mean[3])),a===void 0||a.bias===void 0?c=[0,0,0,0]:typeof a.bias=="number"?c=[a.bias,a.bias,a.bias,a.bias]:(c=[a.bias[0],a.bias[1],a.bias[2],0],a.bias[3]!==void 0&&(c[3]=a.bias[3]));let l=o*r,d=0,h=l,f=l*2,p=-1;s==="RGBA"?(d=0,h=l,f=l*2,p=l*3):s==="RGB"?(d=0,h=l,f=l*2):s==="RBG"&&(d=0,f=l,h=l*2);for(let _=0;_<o;_++)for(let S=0;S<r;S++){let k=(t.data[d++]-c[0])*u[0],P=(t.data[h++]-c[1])*u[1],C=(t.data[f++]-c[2])*u[2],E=p===-1?255:(t.data[p++]-c[3])*u[3];i.fillStyle="rgba("+k+","+P+","+C+","+E+")",i.fillRect(S,_,1,1)}if("toDataURL"in n)return n.toDataURL();throw new Error("toDataURL is not supported")}else throw new Error("Can not access image data")},Sx=(t,e)=>{let n=typeof document<"u"?document.createElement("canvas").getContext("2d"):new OffscreenCanvas(1,1).getContext("2d"),i;if(n!=null){let r,o,s;e?.tensorLayout!==void 0&&e.tensorLayout==="NHWC"?(r=t.dims[2],o=t.dims[1],s=t.dims[3]):(r=t.dims[3],o=t.dims[2],s=t.dims[1]);let a=e!==void 0&&e.format!==void 0?e.format:"RGB",u=e?.norm,c,l;u===void 0||u.mean===void 0?c=[255,255,255,255]:typeof u.mean=="number"?c=[u.mean,u.mean,u.mean,u.mean]:(c=[u.mean[0],u.mean[1],u.mean[2],255],u.mean[3]!==void 0&&(c[3]=u.mean[3])),u===void 0||u.bias===void 0?l=[0,0,0,0]:typeof u.bias=="number"?l=[u.bias,u.bias,u.bias,u.bias]:(l=[u.bias[0],u.bias[1],u.bias[2],0],u.bias[3]!==void 0&&(l[3]=u.bias[3]));let d=o*r;if(e!==void 0&&(e.format!==void 0&&s===4&&e.format!=="RGBA"||s===3&&e.format!=="RGB"&&e.format!=="BGR"))throw new Error("Tensor format doesn't match input tensor dims");let h=4,f=0,p=1,_=2,S=3,k=0,P=d,C=d*2,E=-1;a==="RGBA"?(k=0,P=d,C=d*2,E=d*3):a==="RGB"?(k=0,P=d,C=d*2):a==="RBG"&&(k=0,C=d,P=d*2),i=n.createImageData(r,o);for(let T=0;T<o*r;f+=h,p+=h,_+=h,S+=h,T++)i.data[f]=(t.data[k++]-l[0])*c[0],i.data[p]=(t.data[P++]-l[1])*c[1],i.data[_]=(t.data[C++]-l[2])*c[2],i.data[S]=E===-1?255:(t.data[E++]-l[3])*c[3]}else throw new Error("Can not access image data");return i}});var Hp,Ex,Ix,Tx,Ox,Ax,Px=v(()=>{ja();Hp=(t,e)=>{if(t===void 0)throw new Error("Image buffer must be defined");if(e.height===void 0||e.width===void 0)throw new Error("Image height and width must be defined");if(e.tensorLayout==="NHWC")throw new Error("NHWC Tensor layout is not supported yet");let{height:n,width:i}=e,r=e.norm??{mean:255,bias:0},o,s;typeof r.mean=="number"?o=[r.mean,r.mean,r.mean,r.mean]:o=[r.mean[0],r.mean[1],r.mean[2],r.mean[3]??255],typeof r.bias=="number"?s=[r.bias,r.bias,r.bias,r.bias]:s=[r.bias[0],r.bias[1],r.bias[2],r.bias[3]??0];let a=e.format!==void 0?e.format:"RGBA",u=e.tensorFormat!==void 0&&e.tensorFormat!==void 0?e.tensorFormat:"RGB",c=n*i,l=u==="RGBA"?new Float32Array(c*4):new Float32Array(c*3),d=4,h=0,f=1,p=2,_=3,S=0,k=c,P=c*2,C=-1;a==="RGB"&&(d=3,h=0,f=1,p=2,_=-1),u==="RGBA"?C=c*3:u==="RBG"?(S=0,P=c,k=c*2):u==="BGR"&&(P=0,k=c,S=c*2);for(let T=0;T<c;T++,h+=d,p+=d,f+=d,_+=d)l[S++]=(t[h]+s[0])/o[0],l[k++]=(t[f]+s[1])/o[1],l[P++]=(t[p]+s[2])/o[2],C!==-1&&_!==-1&&(l[C++]=(t[_]+s[3])/o[3]);return u==="RGBA"?new ye("float32",l,[1,4,n,i]):new ye("float32",l,[1,3,n,i])},Ex=async(t,e)=>{let n=typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement,i=typeof ImageData<"u"&&t instanceof ImageData,r=typeof ImageBitmap<"u"&&t instanceof ImageBitmap,o=typeof t=="string",s,a=e??{},u=()=>{if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);throw new Error("Canvas is not supported")},c=l=>typeof HTMLCanvasElement<"u"&&l instanceof HTMLCanvasElement||l instanceof OffscreenCanvas?l.getContext("2d"):null;if(n){let l=u();l.width=t.width,l.height=t.height;let d=c(l);if(d!=null){let h=t.height,f=t.width;if(e!==void 0&&e.resizedHeight!==void 0&&e.resizedWidth!==void 0&&(h=e.resizedHeight,f=e.resizedWidth),e!==void 0){if(a=e,e.tensorFormat!==void 0)throw new Error("Image input config format must be RGBA for HTMLImageElement");a.tensorFormat="RGBA",a.height=h,a.width=f}else a.tensorFormat="RGBA",a.height=h,a.width=f;d.drawImage(t,0,0),s=d.getImageData(0,0,f,h).data}else throw new Error("Can not access image data")}else if(i){let l,d;if(e!==void 0&&e.resizedWidth!==void 0&&e.resizedHeight!==void 0?(l=e.resizedHeight,d=e.resizedWidth):(l=t.height,d=t.width),e!==void 0&&(a=e),a.format="RGBA",a.height=l,a.width=d,e!==void 0){let h=u();h.width=d,h.height=l;let f=c(h);if(f!=null)f.putImageData(t,0,0),s=f.getImageData(0,0,d,l).data;else throw new Error("Can not access image data")}else s=t.data}else if(r){if(e===void 0)throw new Error("Please provide image config with format for Imagebitmap");let l=u();l.width=t.width,l.height=t.height;let d=c(l);if(d!=null){let h=t.height,f=t.width;return d.drawImage(t,0,0,f,h),s=d.getImageData(0,0,f,h).data,a.height=h,a.width=f,Hp(s,a)}else throw new Error("Can not access image data")}else{if(o)return new Promise((l,d)=>{let h=u(),f=c(h);if(!t||!f)return d();let p=new Image;p.crossOrigin="Anonymous",p.src=t,p.onload=()=>{h.width=p.width,h.height=p.height,f.drawImage(p,0,0,h.width,h.height);let _=f.getImageData(0,0,h.width,h.height);a.height=h.height,a.width=h.width,l(Hp(_.data,a))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(s!==void 0)return Hp(s,a);throw new Error("Input data provided is not supported - aborted tensor creation")},Ix=(t,e)=>{let{width:n,height:i,download:r,dispose:o}=e,s=[1,i,n,4];return new ye({location:"texture",type:"float32",texture:t,dims:s,download:r,dispose:o})},Tx=(t,e)=>{let{dataType:n,dims:i,download:r,dispose:o}=e;return new ye({location:"gpu-buffer",type:n??"float32",gpuBuffer:t,dims:i,download:r,dispose:o})},Ox=(t,e)=>{let{dataType:n,dims:i,download:r,dispose:o}=e;return new ye({location:"ml-tensor",type:n??"float32",mlTensor:t,dims:i,download:r,dispose:o})},Ax=(t,e,n)=>new ye({location:"cpu-pinned",type:t,data:e,dims:n??[e.length]})});var wr,Wi,Cx,Rx,zx=v(()=>{wr=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),Wi=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]),Cx=!1,Rx=()=>{if(!Cx){Cx=!0;let t=typeof BigInt64Array<"u"&&BigInt64Array.from,e=typeof BigUint64Array<"u"&&BigUint64Array.from,n=globalThis.Float16Array,i=typeof n<"u"&&n.from;t&&(wr.set("int64",BigInt64Array),Wi.set(BigInt64Array,"int64")),e&&(wr.set("uint64",BigUint64Array),Wi.set(BigUint64Array,"uint64")),i?(wr.set("float16",n),Wi.set(n,"float16")):wr.set("float16",Uint16Array)}}});var Nx,Dx,Lx=v(()=>{ja();Nx=t=>{let e=1;for(let n=0;n<t.length;n++){let i=t[n];if(typeof i!="number"||!Number.isSafeInteger(i))throw new TypeError(`dims[${n}] must be an integer, got: ${i}`);if(i<0)throw new RangeError(`dims[${n}] must be a non-negative integer, got: ${i}`);e*=i}return e},Dx=(t,e)=>{switch(t.location){case"cpu":return new ye(t.type,t.data,e);case"cpu-pinned":return new ye({location:"cpu-pinned",data:t.data,type:t.type,dims:e});case"texture":return new ye({location:"texture",texture:t.texture,type:t.type,dims:e});case"gpu-buffer":return new ye({location:"gpu-buffer",gpuBuffer:t.gpuBuffer,type:t.type,dims:e});case"ml-tensor":return new ye({location:"ml-tensor",mlTensor:t.mlTensor,type:t.type,dims:e});default:throw new Error(`tensorReshape: tensor location ${t.location} is not supported`)}}});var ye,ja=v(()=>{kx();Px();zx();Lx();ye=class{constructor(e,n,i){Rx();let r,o;if(typeof e=="object"&&"location"in e)switch(this.dataLocation=e.location,r=e.type,o=e.dims,e.location){case"cpu-pinned":{let a=wr.get(r);if(!a)throw new TypeError(`unsupported type "${r}" to create tensor from pinned buffer`);if(!(e.data instanceof a))throw new TypeError(`buffer should be of type ${a.name}`);this.cpuData=e.data;break}case"texture":{if(r!=="float32")throw new TypeError(`unsupported type "${r}" to create tensor from texture`);this.gpuTextureData=e.texture,this.downloader=e.download,this.disposer=e.dispose;break}case"gpu-buffer":{if(r!=="float32"&&r!=="float16"&&r!=="int32"&&r!=="int64"&&r!=="uint32"&&r!=="uint8"&&r!=="bool"&&r!=="uint4"&&r!=="int4")throw new TypeError(`unsupported type "${r}" to create tensor from gpu buffer`);this.gpuBufferData=e.gpuBuffer,this.downloader=e.download,this.disposer=e.dispose;break}case"ml-tensor":{if(r!=="float32"&&r!=="float16"&&r!=="int32"&&r!=="int64"&&r!=="uint32"&&r!=="uint64"&&r!=="int8"&&r!=="uint8"&&r!=="bool"&&r!=="uint4"&&r!=="int4")throw new TypeError(`unsupported type "${r}" to create tensor from MLTensor`);this.mlTensorData=e.mlTensor,this.downloader=e.download,this.disposer=e.dispose;break}default:throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`)}else{let a,u;if(typeof e=="string")if(r=e,u=i,e==="string"){if(!Array.isArray(n))throw new TypeError("A string tensor's data must be a string array.");a=n}else{let c=wr.get(e);if(c===void 0)throw new TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(n)){if(e==="float16"&&c===Uint16Array||e==="uint4"||e==="int4")throw new TypeError(`Creating a ${e} tensor from number array is not supported. Please use ${c.name} as data.`);e==="uint64"||e==="int64"?a=c.from(n,BigInt):a=c.from(n)}else if(n instanceof c)a=n;else if(n instanceof Uint8ClampedArray)if(e==="uint8")a=Uint8Array.from(n);else throw new TypeError("A Uint8ClampedArray tensor's data must be type of uint8");else if(e==="float16"&&n instanceof Uint16Array&&c!==Uint16Array)a=new globalThis.Float16Array(n.buffer,n.byteOffset,n.length);else throw new TypeError(`A ${r} tensor's data must be type of ${c}`)}else if(u=n,Array.isArray(e)){if(e.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");let c=typeof e[0];if(c==="string")r="string",a=e;else if(c==="boolean")r="bool",a=Uint8Array.from(e);else throw new TypeError(`Invalid element type of data array: ${c}.`)}else if(e instanceof Uint8ClampedArray)r="uint8",a=Uint8Array.from(e);else{let c=Wi.get(e.constructor);if(c===void 0)throw new TypeError(`Unsupported type for tensor data: ${e.constructor}.`);r=c,a=e}if(u===void 0)u=[a.length];else if(!Array.isArray(u))throw new TypeError("A tensor's dims must be a number array");o=u,this.cpuData=a,this.dataLocation="cpu"}let s=Nx(o);if(this.cpuData&&s!==this.cpuData.length&&!((r==="uint4"||r==="int4")&&Math.ceil(s/2)===this.cpuData.length))throw new Error(`Tensor's size(${s}) does not match data length(${this.cpuData.length}).`);this.type=r,this.dims=o,this.size=s}static async fromImage(e,n){return Ex(e,n)}static fromTexture(e,n){return Ix(e,n)}static fromGpuBuffer(e,n){return Tx(e,n)}static fromMLTensor(e,n){return Ox(e,n)}static fromPinnedBuffer(e,n,i){return Ax(e,n,i)}toDataURL(e){return wx(this,e)}toImageData(e){return Sx(this,e)}get data(){if(this.ensureValid(),!this.cpuData)throw new Error("The data is not on CPU. Use `getData()` to download GPU data to CPU, or use `texture` or `gpuBuffer` property to access the GPU data directly.");return this.cpuData}get location(){return this.dataLocation}get texture(){if(this.ensureValid(),!this.gpuTextureData)throw new Error("The data is not stored as a WebGL texture.");return this.gpuTextureData}get gpuBuffer(){if(this.ensureValid(),!this.gpuBufferData)throw new Error("The data is not stored as a WebGPU buffer.");return this.gpuBufferData}get mlTensor(){if(this.ensureValid(),!this.mlTensorData)throw new Error("The data is not stored as a WebNN MLTensor.");return this.mlTensorData}async getData(e){switch(this.ensureValid(),this.dataLocation){case"cpu":case"cpu-pinned":return this.data;case"texture":case"gpu-buffer":case"ml-tensor":{if(!this.downloader)throw new Error("The current tensor is not created with a specified data downloader.");if(this.isDownloading)throw new Error("The current tensor is being downloaded.");try{this.isDownloading=!0;let n=await this.downloader();return this.downloader=void 0,this.dataLocation="cpu",this.cpuData=n,e&&this.disposer&&(this.disposer(),this.disposer=void 0),n}finally{this.isDownloading=!1}}default:throw new Error(`cannot get data from location: ${this.dataLocation}`)}}dispose(){if(this.isDownloading)throw new Error("The current tensor is being downloaded.");this.disposer&&(this.disposer(),this.disposer=void 0),this.cpuData=void 0,this.gpuTextureData=void 0,this.gpuBufferData=void 0,this.mlTensorData=void 0,this.downloader=void 0,this.isDownloading=void 0,this.dataLocation="none"}ensureValid(){if(this.dataLocation==="none")throw new Error("The tensor is disposed.")}reshape(e){if(this.ensureValid(),this.downloader||this.disposer)throw new Error("Cannot reshape a tensor that owns GPU resource.");return Dx(this,e)}}});var Qe,Jp=v(()=>{ja();Qe=ye});var Kp,Ux,Ht,Jt,Kt,Yt,Yp=v(()=>{qp();Kp=(t,e)=>{(typeof he.trace>"u"?!he.wasm.trace:!he.trace)||console.timeStamp(`${t}::ORT::${e}`)},Ux=(t,e)=>{let n=new Error().stack?.split(/\r\n|\r|\n/g)||[],i=!1;for(let r=0;r<n.length;r++){if(i&&!n[r].includes("TRACE_FUNC")){let o=`FUNC_${t}::${n[r].trim().split(" ")[1]}`;e&&(o+=`::${e}`),Kp("CPU",o);return}n[r].includes("TRACE_FUNC")&&(i=!0)}},Ht=t=>{(typeof he.trace>"u"?!he.wasm.trace:!he.trace)||Ux("BEGIN",t)},Jt=t=>{(typeof he.trace>"u"?!he.wasm.trace:!he.trace)||Ux("END",t)},Kt=t=>{(typeof he.trace>"u"?!he.wasm.trace:!he.trace)||console.time(`ORT::${t}`)},Yt=t=>{(typeof he.trace>"u"?!he.wasm.trace:!he.trace)||console.timeEnd(`ORT::${t}`)}});var Ma,jx=v(()=>{Wp();Jp();Yp();Ma=class t{constructor(e){this.handler=e}async run(e,n,i){Ht(),Kt("InferenceSession.run");let r={},o={};if(typeof e!="object"||e===null||e instanceof Qe||Array.isArray(e))throw new TypeError("'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.");let s=!0;if(typeof n=="object"){if(n===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(n instanceof Qe)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(n)){if(n.length===0)throw new TypeError("'fetches' cannot be an empty array.");s=!1;for(let c of n){if(typeof c!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(c)===-1)throw new RangeError(`'fetches' contains invalid output name: ${c}.`);r[c]=null}if(typeof i=="object"&&i!==null)o=i;else if(typeof i<"u")throw new TypeError("'options' must be an object.")}else{let c=!1,l=Object.getOwnPropertyNames(n);for(let d of this.outputNames)if(l.indexOf(d)!==-1){let h=n[d];(h===null||h instanceof Qe)&&(c=!0,s=!1,r[d]=h)}if(c){if(typeof i=="object"&&i!==null)o=i;else if(typeof i<"u")throw new TypeError("'options' must be an object.")}else o=n}}else if(typeof n<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(let c of this.inputNames)if(typeof e[c]>"u")throw new Error(`input '${c}' is missing in 'feeds'.`);if(s)for(let c of this.outputNames)r[c]=null;let a=await this.handler.run(e,r,o),u={};for(let c in a)if(Object.hasOwnProperty.call(a,c)){let l=a[c];l instanceof Qe?u[c]=l:u[c]=new Qe(l.type,l.data,l.dims)}return Yt("InferenceSession.run"),Jt(),u}async release(){return this.handler.dispose()}static async create(e,n,i,r){Ht(),Kt("InferenceSession.create");let o,s={};if(typeof e=="string"){if(o=e,typeof n=="object"&&n!==null)s=n;else if(typeof n<"u")throw new TypeError("'options' must be an object.")}else if(e instanceof Uint8Array){if(o=e,typeof n=="object"&&n!==null)s=n;else if(typeof n<"u")throw new TypeError("'options' must be an object.")}else if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer){let l=e,d=0,h=e.byteLength;if(typeof n=="object"&&n!==null)s=n;else if(typeof n=="number"){if(d=n,!Number.isSafeInteger(d))throw new RangeError("'byteOffset' must be an integer.");if(d<0||d>=l.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${l.byteLength}).`);if(h=e.byteLength-d,typeof i=="number"){if(h=i,!Number.isSafeInteger(h))throw new RangeError("'byteLength' must be an integer.");if(h<=0||d+h>l.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${l.byteLength-d}].`);if(typeof r=="object"&&r!==null)s=r;else if(typeof r<"u")throw new TypeError("'options' must be an object.")}else if(typeof i<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof n<"u")throw new TypeError("'options' must be an object.");o=new Uint8Array(l,d,h)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");let[a,u]=await vx(s),c=await a.createInferenceSessionHandler(o,u);return Yt("InferenceSession.create"),Jt(),new t(c)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}}});var Mx,Fx=v(()=>{jx();Mx=Ma});var Vx=v(()=>{});var Zx=v(()=>{});var Bx=v(()=>{});var Gx=v(()=>{});var Xp={};He(Xp,{InferenceSession:()=>Mx,TRACE:()=>Kp,TRACE_EVENT_BEGIN:()=>Kt,TRACE_EVENT_END:()=>Yt,TRACE_FUNC_BEGIN:()=>Ht,TRACE_FUNC_END:()=>Jt,Tensor:()=>Qe,env:()=>ie,registerBackend:()=>An});var Xt=v(()=>{yx();xx();Fx();Jp();Vx();Zx();Yp();Bx();Gx()});var Dw={};He(Dw,{InferenceSession:()=>Mx,TRACE:()=>Kp,TRACE_EVENT_BEGIN:()=>Kt,TRACE_EVENT_END:()=>Yt,TRACE_FUNC_BEGIN:()=>Ht,TRACE_FUNC_END:()=>Jt,Tensor:()=>Qe,default:()=>lP,env:()=>ie,registerBackend:()=>An});import{createRequire as YA}from"module";var Pn,fm,XA,QA,eP,cm,et,tP,rP,nP,zn,pm,Qp,Wx,qx,Tt,uw,em,Hx,Jx,Kx,Yx,tm,cw,lw,rm,Fa,qi,nm,Xx,Qx,ew,dw,ee,Hi,ut,Ba,K,mm,hw,iP,tw,rw,nw,Sr,iw,fw,oP,Cn,Za,Rn,pw,mw,gm,vm,gw,vw,Ga,yw,ow,_w,bw,kr,sw,im,lm,$w,xw,om,ww,Sw,sP,Va,sm,am,kw,Ew,Iw,Tw,Ow,Aw,Pw,Cw,um,aw,Rw,aP,zw,dm,hm,Nw,uP,cP,lP,Lw=v(()=>{Xt();Xt();Xt();Xt();Xt();Xt();Xt();Pn=YA(import.meta.url),fm=Object.defineProperty,XA=Object.getOwnPropertyDescriptor,QA=Object.getOwnPropertyNames,eP=Object.prototype.hasOwnProperty,cm=(t=>typeof Pn<"u"?Pn:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof Pn<"u"?Pn:e)[n]}):t)(function(t){if(typeof Pn<"u")return Pn.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),et=(t,e)=>()=>(t&&(e=t(t=0)),e),tP=(t,e)=>{for(var n in e)fm(t,n,{get:e[n],enumerable:!0})},rP=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of QA(e))!eP.call(t,r)&&r!==n&&fm(t,r,{get:()=>e[r],enumerable:!(i=XA(e,r))||i.enumerable});return t},nP=t=>rP(fm({},"__esModule",{value:!0}),t),pm=et(()=>{"use strict";zn=!!(typeof process<"u"&&process.versions&&process.versions.node)}),lw=et(()=>{"use strict";pm(),Qp=zn||typeof location>"u"?void 0:location.origin,Wx=import.meta.url>"file:"&&import.meta.url<"file;",qx=()=>{if(!zn){if(Wx){let t=URL;return new URL(new t("ort.node.min.mjs",import.meta.url).href,Qp).href}return import.meta.url}},Tt=qx(),uw=()=>{if(Tt&&!Tt.startsWith("blob:"))return Tt.substring(0,Tt.lastIndexOf("/")+1)},em=(t,e)=>{try{let n=e??Tt;return(n?new URL(t,n):new URL(t)).origin===Qp}catch{return!1}},Hx=(t,e)=>{let n=e??Tt;try{return(n?new URL(t,n):new URL(t)).href}catch{return}},Jx=(t,e)=>`${e??"./"}${t}`,Kx=async t=>{let e=await(await fetch(t,{credentials:"same-origin"})).blob();return URL.createObjectURL(e)},Yx=async t=>(await import(t)).default,tm=void 0,cw=async(t,e,n,i)=>{let r=tm&&!(t||e);if(r)if(Tt)r=em(Tt)||i&&!n;else if(i&&!n)r=!0;else throw new Error("cannot determine the script source URL.");if(r)return[void 0,tm];{let o="ort-wasm-simd-threaded.mjs",s=t??Hx(o,e),a=!zn&&n&&s&&!em(s,e),u=a?await Kx(s):s??Jx(o,e);return[a?u:void 0,await Yx(u)]}}}),Hi=et(()=>{"use strict";lw(),Fa=!1,qi=!1,nm=!1,Xx=()=>{if(typeof SharedArrayBuffer>"u")return!1;try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch{return!1}},Qx=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch{return!1}},ew=()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,19,1,17,0,65,1,253,15,65,2,253,15,65,3,253,15,253,147,2,11]))}catch{return!1}},dw=async t=>{if(Fa)return Promise.resolve();if(qi)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(nm)throw new Error("previous call to 'initializeWebAssembly()' failed.");qi=!0;let e=t.initTimeout,n=t.numThreads;if(t.simd!==!1){if(t.simd==="relaxed"){if(!ew())throw new Error("Relaxed WebAssembly SIMD is not supported in the current environment.")}else if(!Qx())throw new Error("WebAssembly SIMD is not supported in the current environment.")}let i=Xx();n>1&&!i&&(typeof self<"u"&&!self.crossOriginIsolated&&console.warn("env.wasm.numThreads is set to "+n+", but this will not work unless you enable crossOriginIsolated mode. See https://web.dev/cross-origin-isolation-guide/ for more info."),console.warn("WebAssembly multi-threading is not supported in the current environment. Falling back to single-threading."),t.numThreads=n=1);let r=t.wasmPaths,o=typeof r=="string"?r:void 0,s=r?.mjs,a=s?.href??s,u=r?.wasm,c=u?.href??u,l=t.wasmBinary,[d,h]=await cw(a,o,n>1,!!l||!!c),f=!1,p=[];if(e>0&&p.push(new Promise(_=>{setTimeout(()=>{f=!0,_()},e)})),p.push(new Promise((_,S)=>{let k={numThreads:n};if(l)k.wasmBinary=l,k.locateFile=P=>P;else if(c||o)k.locateFile=P=>c??o+P;else if(a&&a.indexOf("blob:")!==0)k.locateFile=P=>new URL(P,a).href;else if(d){let P=uw();P&&(k.locateFile=C=>P+C)}h(k).then(P=>{qi=!1,Fa=!0,rm=P,_(),d&&URL.revokeObjectURL(d)},P=>{qi=!1,nm=!0,S(P)})})),await Promise.race(p),f)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},ee=()=>{if(Fa&&rm)return rm;throw new Error("WebAssembly is not initialized yet.")}}),mm=et(()=>{"use strict";Hi(),ut=(t,e)=>{let n=ee(),i=n.lengthBytesUTF8(t)+1,r=n._malloc(i);return n.stringToUTF8(t,r,i),e.push(r),r},Ba=(t,e,n,i)=>{if(typeof t=="object"&&t!==null){if(n.has(t))throw new Error("Circular reference in options");n.add(t)}Object.entries(t).forEach(([r,o])=>{let s=e?e+r:r;if(typeof o=="object")Ba(o,s+".",n,i);else if(typeof o=="string"||typeof o=="number")i(s,o.toString());else if(typeof o=="boolean")i(s,o?"1":"0");else throw new Error(`Can't handle extra config type: ${typeof o}`)})},K=t=>{let e=ee(),n=e.stackSave();try{let i=e.PTR_SIZE,r=e.stackAlloc(2*i);e._OrtGetLastError(r,r+i);let o=Number(e.getValue(r,i===4?"i32":"i64")),s=e.getValue(r+i,"*"),a=s?e.UTF8ToString(s):"";throw new Error(`${t} ERROR_CODE: ${o}, ERROR_MESSAGE: ${a}`)}finally{e.stackRestore(n)}}}),iP=et(()=>{"use strict";Hi(),mm(),hw=t=>{let e=ee(),n=0,i=[],r=t||{};try{if(t?.logSeverityLevel===void 0)r.logSeverityLevel=2;else if(typeof t.logSeverityLevel!="number"||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log severity level is not valid: ${t.logSeverityLevel}`);if(t?.logVerbosityLevel===void 0)r.logVerbosityLevel=0;else if(typeof t.logVerbosityLevel!="number"||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);t?.terminate===void 0&&(r.terminate=!1);let o=0;return t?.tag!==void 0&&(o=ut(t.tag,i)),n=e._OrtCreateRunOptions(r.logSeverityLevel,r.logVerbosityLevel,!!r.terminate,o),n===0&&K("Can't create run options."),t?.extra!==void 0&&Ba(t.extra,"",new WeakSet,(s,a)=>{let u=ut(s,i),c=ut(a,i);e._OrtAddRunConfigEntry(n,u,c)!==0&&K(`Can't set a run config entry: ${s} - ${a}.`)}),[n,i]}catch(o){throw n!==0&&e._OrtReleaseRunOptions(n),i.forEach(s=>e._free(s)),o}}}),oP=et(()=>{"use strict";Hi(),mm(),tw=t=>{switch(t){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"layout":return 3;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${t}`)}},rw=t=>{switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}},nw=t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});let e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly="1"),t.executionProviders&&t.executionProviders.some(n=>(typeof n=="string"?n:n.name)==="webgpu")&&(t.enableMemPattern=!1)},Sr=(t,e,n,i)=>{let r=ut(e,i),o=ut(n,i);ee()._OrtAddSessionConfigEntry(t,r,o)!==0&&K(`Can't set a session config entry: ${e} - ${n}.`)},iw=async(t,e,n)=>{let i=e.executionProviders;for(let r of i){let o=typeof r=="string"?r:r.name,s=[];switch(o){case"webnn":if(o="WEBNN",Sr(t,"session.disable_quant_qdq","1",n),Sr(t,"session.disable_qdq_constant_folding","1",n),typeof r!="string"){let d=r?.deviceType;d&&Sr(t,"deviceType",d,n)}break;case"webgpu":if(o="JS",typeof r!="string"){let d=r;if(d?.preferredLayout){if(d.preferredLayout!=="NCHW"&&d.preferredLayout!=="NHWC")throw new Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${d.preferredLayout}`);Sr(t,"preferredLayout",d.preferredLayout,n)}}break;case"wasm":case"cpu":continue;default:throw new Error(`not supported execution provider: ${o}`)}let a=ut(o,n),u=s.length,c=0,l=0;if(u>0){c=ee()._malloc(u*ee().PTR_SIZE),n.push(c),l=ee()._malloc(u*ee().PTR_SIZE),n.push(l);for(let d=0;d<u;d++)ee().setValue(c+d*ee().PTR_SIZE,s[d][0],"*"),ee().setValue(l+d*ee().PTR_SIZE,s[d][1],"*")}await ee()._OrtAppendExecutionProvider(t,a,c,l,u)!==0&&K(`Can't append execution provider: ${o}.`)}},fw=async t=>{let e=ee(),n=0,i=[],r=t||{};nw(r);try{let o=tw(r.graphOptimizationLevel??"all"),s=rw(r.executionMode??"sequential"),a=typeof r.logId=="string"?ut(r.logId,i):0,u=r.logSeverityLevel??2;if(!Number.isInteger(u)||u<0||u>4)throw new Error(`log severity level is not valid: ${u}`);let c=r.logVerbosityLevel??0;if(!Number.isInteger(c)||c<0||c>4)throw new Error(`log verbosity level is not valid: ${c}`);let l=typeof r.optimizedModelFilePath=="string"?ut(r.optimizedModelFilePath,i):0;if(n=e._OrtCreateSessionOptions(o,!!r.enableCpuMemArena,!!r.enableMemPattern,s,!!r.enableProfiling,0,a,u,c,l),n===0&&K("Can't create session options."),r.executionProviders&&await iw(n,r,i),r.enableGraphCapture!==void 0){if(typeof r.enableGraphCapture!="boolean")throw new Error(`enableGraphCapture must be a boolean value: ${r.enableGraphCapture}`);Sr(n,"enableGraphCapture",r.enableGraphCapture.toString(),i)}if(r.freeDimensionOverrides)for(let[d,h]of Object.entries(r.freeDimensionOverrides)){if(typeof d!="string")throw new Error(`free dimension override name must be a string: ${d}`);if(typeof h!="number"||!Number.isInteger(h)||h<0)throw new Error(`free dimension override value must be a non-negative integer: ${h}`);let f=ut(d,i);e._OrtAddFreeDimensionOverride(n,f,h)!==0&&K(`Can't set a free dimension override: ${d} - ${h}.`)}return r.extra!==void 0&&Ba(r.extra,"",new WeakSet,(d,h)=>{Sr(n,d,h,i)}),[n,i]}catch(o){throw n!==0&&e._OrtReleaseSessionOptions(n)!==0&&K("Can't release session options."),i.forEach(s=>e._free(s)),o}}}),vw=et(()=>{"use strict";Cn=t=>{switch(t){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float16":return 10;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;case"int4":return 22;case"uint4":return 21;default:throw new Error(`unsupported data type: ${t}`)}},Za=t=>{switch(t){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 10:return"float16";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";case 22:return"int4";case 21:return"uint4";default:throw new Error(`unsupported data type: ${t}`)}},Rn=(t,e)=>{let n=[-1,4,1,1,2,2,4,8,-1,1,2,8,4,8,-1,-1,-1,-1,-1,-1,-1,.5,.5][t],i=typeof e=="number"?e:e.reduce((r,o)=>r*o,1);return n>0?Math.ceil(i*n):void 0},pw=t=>{switch(t){case"float16":return typeof Float16Array<"u"&&Float16Array.from?Float16Array:Uint16Array;case"float32":return Float32Array;case"uint8":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"bool":return Uint8Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}},mw=t=>{switch(t){case"verbose":return 0;case"info":return 1;case"warning":return 2;case"error":return 3;case"fatal":return 4;default:throw new Error(`unsupported logging level: ${t}`)}},gm=t=>t==="float32"||t==="float16"||t==="int32"||t==="int64"||t==="uint32"||t==="uint8"||t==="bool"||t==="uint4"||t==="int4",vm=t=>t==="float32"||t==="float16"||t==="int32"||t==="int64"||t==="uint32"||t==="uint64"||t==="int8"||t==="uint8"||t==="bool"||t==="uint4"||t==="int4",gw=t=>{switch(t){case"none":return 0;case"cpu":return 1;case"cpu-pinned":return 2;case"texture":return 3;case"gpu-buffer":return 4;case"ml-tensor":return 5;default:throw new Error(`unsupported data location: ${t}`)}}}),yw=et(()=>{"use strict";pm(),Ga=async t=>{if(typeof t=="string")if(zn)try{let{readFile:e}=cm("node:fs/promises");return new Uint8Array(await e(t))}catch(e){if(e.code==="ERR_FS_FILE_TOO_LARGE"){let{createReadStream:n}=cm("node:fs"),i=n(t),r=[];for await(let o of i)r.push(o);return new Uint8Array(Buffer.concat(r))}throw e}else{let e=await fetch(t);if(!e.ok)throw new Error(`failed to load external data file: ${t}`);let n=e.headers.get("Content-Length"),i=n?parseInt(n,10):0;if(i<1073741824)return new Uint8Array(await e.arrayBuffer());{if(!e.body)throw new Error(`failed to load external data file: ${t}, no response body.`);let r=e.body.getReader(),o;try{o=new ArrayBuffer(i)}catch(a){if(a instanceof RangeError){let u=Math.ceil(i/65536);o=new WebAssembly.Memory({initial:u,maximum:u}).buffer}else throw a}let s=0;for(;;){let{done:a,value:u}=await r.read();if(a)break;let c=u.byteLength;new Uint8Array(o,s,c).set(u),s+=c}return new Uint8Array(o,0,i)}}else return t instanceof Blob?new Uint8Array(await t.arrayBuffer()):t instanceof Uint8Array?t:new Uint8Array(t)}}),sP=et(()=>{"use strict";iP(),oP(),vw(),Hi(),mm(),yw(),ow=(t,e)=>{ee()._OrtInit(t,e)!==0&&K("Can't initialize onnxruntime.")},_w=async t=>{ow(t.wasm.numThreads,mw(t.logLevel))},bw=async(t,e)=>{ee().asyncInit?.();let n=t.webgpu.adapter;if(e==="webgpu"){if(typeof navigator>"u"||!navigator.gpu)throw new Error("WebGPU is not supported in current environment");if(n){if(typeof n.limits!="object"||typeof n.features!="object"||typeof n.requestDevice!="function")throw new Error("Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.")}else{let i=t.webgpu.powerPreference;if(i!==void 0&&i!=="low-power"&&i!=="high-performance")throw new Error(`Invalid powerPreference setting: "${i}"`);let r=t.webgpu.forceFallbackAdapter;if(r!==void 0&&typeof r!="boolean")throw new Error(`Invalid forceFallbackAdapter setting: "${r}"`);if(n=await navigator.gpu.requestAdapter({powerPreference:i,forceFallbackAdapter:r}),!n)throw new Error('Failed to get GPU adapter. You may need to enable flag "--enable-unsafe-webgpu" if you are using Chrome.')}}if(e==="webnn"&&(typeof navigator>"u"||!navigator.ml))throw new Error("WebNN is not supported in current environment")},kr=new Map,sw=t=>{let e=ee(),n=e.stackSave();try{let i=e.PTR_SIZE,r=e.stackAlloc(2*i);e._OrtGetInputOutputCount(t,r,r+i)!==0&&K("Can't get session input/output count.");let o=i===4?"i32":"i64";return[Number(e.getValue(r,o)),Number(e.getValue(r+i,o))]}finally{e.stackRestore(n)}},im=(t,e)=>{let n=ee(),i=n.stackSave(),r=0;try{let o=n.PTR_SIZE,s=n.stackAlloc(2*o);n._OrtGetInputOutputMetadata(t,e,s,s+o)!==0&&K("Can't get session input/output metadata.");let a=Number(n.getValue(s,"*"));r=Number(n.getValue(s+o,"*"));let u=n.HEAP32[r/4];if(u===0)return[a,0];let c=n.HEAPU32[r/4+1],l=[];for(let d=0;d<c;d++){let h=Number(n.getValue(r+8+d*o,"*"));l.push(h!==0?n.UTF8ToString(h):Number(n.getValue(r+8+(d+c)*o,"*")))}return[a,u,l]}finally{n.stackRestore(i),r!==0&&n._OrtFree(r)}},lm=t=>{let e=ee(),n=e._malloc(t.byteLength);if(n===0)throw new Error(`Can't create a session. failed to allocate a buffer of size ${t.byteLength}.`);return e.HEAPU8.set(t,n),[n,t.byteLength]},$w=async(t,e)=>{let n,i,r=ee();Array.isArray(t)?[n,i]=t:t.buffer===r.HEAPU8.buffer?[n,i]=[t.byteOffset,t.byteLength]:[n,i]=lm(t);let o=0,s=0,a=0,u=[],c=[],l=[];try{if([s,u]=await fw(e),e?.externalData&&r.mountExternalData){let C=[];for(let E of e.externalData){let T=typeof E=="string"?E:E.path;C.push(Ga(typeof E=="string"?E:E.data).then(Z=>{r.mountExternalData(T,Z)}))}await Promise.all(C)}for(let C of e?.executionProviders??[])if((typeof C=="string"?C:C.name)==="webnn"){if(r.shouldTransferToMLTensor=!1,typeof C!="string"){let E=C,T=E?.context,Z=E?.gpuDevice,F=E?.deviceType,q=E?.powerPreference;T?r.currentContext=T:Z?r.currentContext=await r.webnnCreateMLContext(Z):r.currentContext=await r.webnnCreateMLContext({deviceType:F,powerPreference:q})}else r.currentContext=await r.webnnCreateMLContext();break}o=await r._OrtCreateSession(n,i,s),r.webgpuOnCreateSession?.(o),o===0&&K("Can't create a session."),r.jsepOnCreateSession?.(),r.currentContext&&(r.webnnRegisterMLContext(o,r.currentContext),r.currentContext=void 0,r.shouldTransferToMLTensor=!0);let[d,h]=sw(o),f=!!e?.enableGraphCapture,p=[],_=[],S=[],k=[],P=[];for(let C=0;C<d;C++){let[E,T,Z]=im(o,C);E===0&&K("Can't get an input name."),c.push(E);let F=r.UTF8ToString(E);p.push(F),S.push(T===0?{name:F,isTensor:!1}:{name:F,isTensor:!0,type:Za(T),shape:Z})}for(let C=0;C<h;C++){let[E,T,Z]=im(o,C+d);E===0&&K("Can't get an output name."),l.push(E);let F=r.UTF8ToString(E);_.push(F),k.push(T===0?{name:F,isTensor:!1}:{name:F,isTensor:!0,type:Za(T),shape:Z})}return kr.set(o,[o,c,l,null,f,!1]),[o,p,_,S,k]}catch(d){throw c.forEach(h=>r._OrtFree(h)),l.forEach(h=>r._OrtFree(h)),a!==0&&r._OrtReleaseBinding(a)!==0&&K("Can't release IO binding."),o!==0&&r._OrtReleaseSession(o)!==0&&K("Can't release session."),d}finally{r._free(n),s!==0&&r._OrtReleaseSessionOptions(s)!==0&&K("Can't release session options."),u.forEach(d=>r._free(d)),r.unmountExternalData?.()}},xw=t=>{let e=ee(),n=kr.get(t);if(!n)throw new Error(`cannot release session. invalid session id: ${t}`);let[i,r,o,s,a]=n;s&&(a&&e._OrtClearBoundOutputs(s.handle)!==0&&K("Can't clear bound outputs."),e._OrtReleaseBinding(s.handle)!==0&&K("Can't release IO binding.")),e.jsepOnReleaseSession?.(t),e.webnnOnReleaseSession?.(t),e.webgpuOnReleaseSession?.(t),r.forEach(u=>e._OrtFree(u)),o.forEach(u=>e._OrtFree(u)),e._OrtReleaseSession(i)!==0&&K("Can't release session."),kr.delete(t)},om=async(t,e,n,i,r,o,s=!1)=>{if(!t){e.push(0);return}let a=ee(),u=a.PTR_SIZE,c=t[0],l=t[1],d=t[3],h=d,f,p;if(c==="string"&&(d==="gpu-buffer"||d==="ml-tensor"))throw new Error("String tensor is not supported on GPU.");if(s&&d!=="gpu-buffer")throw new Error(`External buffer must be provided for input/output index ${o} when enableGraphCapture is true.`);if(d==="gpu-buffer"){let k=t[2].gpuBuffer;p=Rn(Cn(c),l);{let P=a.jsepRegisterBuffer;if(!P)throw new Error('Tensor location "gpu-buffer" is not supported without using WebGPU.');f=P(i,o,k,p)}}else if(d==="ml-tensor"){let k=t[2].mlTensor;p=Rn(Cn(c),l);let P=a.webnnRegisterMLTensor;if(!P)throw new Error('Tensor location "ml-tensor" is not supported without using WebNN.');f=P(i,k,Cn(c),l)}else{let k=t[2];if(Array.isArray(k)){p=u*k.length,f=a._malloc(p),n.push(f);for(let P=0;P<k.length;P++){if(typeof k[P]!="string")throw new TypeError(`tensor data at index ${P} is not a string`);a.setValue(f+P*u,ut(k[P],n),"*")}}else{let P=a.webnnIsGraphInput,C=a.webnnIsGraphOutput;if(c!=="string"&&P&&C){let E=a.UTF8ToString(r);if(P(i,E)||C(i,E)){let T=Cn(c);p=Rn(T,l),h="ml-tensor";let Z=a.webnnCreateTemporaryTensor,F=a.webnnUploadTensor;if(!Z||!F)throw new Error('Tensor location "ml-tensor" is not supported without using WebNN.');let q=await Z(i,T,l);F(q,new Uint8Array(k.buffer,k.byteOffset,k.byteLength)),f=q}else p=k.byteLength,f=a._malloc(p),n.push(f),a.HEAPU8.set(new Uint8Array(k.buffer,k.byteOffset,p),f)}else p=k.byteLength,f=a._malloc(p),n.push(f),a.HEAPU8.set(new Uint8Array(k.buffer,k.byteOffset,p),f)}}let _=a.stackSave(),S=a.stackAlloc(4*l.length);try{l.forEach((P,C)=>a.setValue(S+C*u,P,u===4?"i32":"i64"));let k=a._OrtCreateTensor(Cn(c),f,p,S,l.length,gw(h));k===0&&K(`Can't create tensor for input/output. session=${i}, index=${o}.`),e.push(k)}finally{a.stackRestore(_)}},ww=async(t,e,n,i,r,o)=>{let s=ee(),a=s.PTR_SIZE,u=kr.get(t);if(!u)throw new Error(`cannot run inference. invalid session id: ${t}`);let c=u[0],l=u[1],d=u[2],h=u[3],f=u[4],p=u[5],_=e.length,S=i.length,k=0,P=[],C=[],E=[],T=[],Z=[],F=s.stackSave(),q=s.stackAlloc(_*a),ne=s.stackAlloc(_*a),$e=s.stackAlloc(S*a),pe=s.stackAlloc(S*a);try{[k,P]=hw(o),Kt("wasm prepareInputOutputTensor");for(let D=0;D<_;D++)await om(n[D],C,T,t,l[e[D]],e[D],f);for(let D=0;D<S;D++)await om(r[D],E,T,t,d[i[D]],_+i[D],f);Yt("wasm prepareInputOutputTensor");for(let D=0;D<_;D++)s.setValue(q+D*a,C[D],"*"),s.setValue(ne+D*a,l[e[D]],"*");for(let D=0;D<S;D++)s.setValue($e+D*a,E[D],"*"),s.setValue(pe+D*a,d[i[D]],"*");s.jsepOnRunStart?.(c),s.webnnOnRunStart?.(c);let ke;ke=await s._OrtRun(c,ne,q,_,pe,S,$e,k),ke!==0&&K("failed to call OrtRun().");let Ee=[],Q=[];Kt("wasm ProcessOutputTensor");for(let D=0;D<S;D++){let ce=Number(s.getValue($e+D*a,"*"));if(ce===E[D]||Z.includes(E[D])){Ee.push(r[D]),ce!==E[D]&&s._OrtReleaseTensor(ce)!==0&&K("Can't release tensor.");continue}let it=s.stackSave(),Me=s.stackAlloc(4*a),zr=!1,le,Fe=0;try{s._OrtGetTensorData(ce,Me,Me+a,Me+2*a,Me+3*a)!==0&&K(`Can't access output tensor data on index ${D}.`);let Gu=a===4?"i32":"i64",xo=Number(s.getValue(Me,Gu));Fe=s.getValue(Me+a,"*");let Vg=s.getValue(Me+a*2,"*"),TE=Number(s.getValue(Me+a*3,Gu)),Ct=[];for(let me=0;me<TE;me++)Ct.push(Number(s.getValue(Vg+me*a,Gu)));s._OrtFree(Vg)!==0&&K("Can't free memory for tensor dims.");let Rt=Ct.reduce((me,se)=>me*se,1);le=Za(xo);let Zn=h?.outputPreferredLocations[i[D]];if(le==="string"){if(Zn==="gpu-buffer"||Zn==="ml-tensor")throw new Error("String tensor is not supported on GPU.");let me=[];for(let se=0;se<Rt;se++){let bt=s.getValue(Fe+se*a,"*"),OE=s.getValue(Fe+(se+1)*a,"*"),AE=se===Rt-1?void 0:OE-bt;me.push(s.UTF8ToString(bt,AE))}Ee.push([le,Ct,me,"cpu"])}else if(Zn==="gpu-buffer"&&Rt>0){let me=s.jsepGetBuffer;if(!me)throw new Error('preferredLocation "gpu-buffer" is not supported without using WebGPU.');let se=me(Fe),bt=Rn(xo,Rt);if(bt===void 0||!gm(le))throw new Error(`Unsupported data type: ${le}`);zr=!0,Ee.push([le,Ct,{gpuBuffer:se,download:s.jsepCreateDownloader(se,bt,le),dispose:()=>{s._OrtReleaseTensor(ce)!==0&&K("Can't release tensor.")}},"gpu-buffer"])}else if(Zn==="ml-tensor"&&Rt>0){let me=s.webnnEnsureTensor,se=s.webnnIsGraphInputOutputTypeSupported;if(!me||!se)throw new Error('preferredLocation "ml-tensor" is not supported without using WebNN.');if(Rn(xo,Rt)===void 0||!vm(le))throw new Error(`Unsupported data type: ${le}`);if(!se(t,le,!1))throw new Error(`preferredLocation "ml-tensor" for ${le} output is not supported by current WebNN Context.`);let bt=await me(t,Fe,xo,Ct,!1);zr=!0,Ee.push([le,Ct,{mlTensor:bt,download:s.webnnCreateMLTensorDownloader(Fe,le),dispose:()=>{s.webnnReleaseTensorId(Fe),s._OrtReleaseTensor(ce)}},"ml-tensor"])}else if(Zn==="ml-tensor-cpu-output"&&Rt>0){let me=s.webnnCreateMLTensorDownloader(Fe,le)(),se=Ee.length;zr=!0,Q.push((async()=>{let bt=[se,await me];return s.webnnReleaseTensorId(Fe),s._OrtReleaseTensor(ce),bt})()),Ee.push([le,Ct,[],"cpu"])}else{let me=pw(le),se=new me(Rt);new Uint8Array(se.buffer,se.byteOffset,se.byteLength).set(s.HEAPU8.subarray(Fe,Fe+se.byteLength)),Ee.push([le,Ct,se,"cpu"])}}finally{s.stackRestore(it),le==="string"&&Fe&&s._free(Fe),zr||s._OrtReleaseTensor(ce)}}h&&!f&&(s._OrtClearBoundOutputs(h.handle)!==0&&K("Can't clear bound outputs."),kr.set(t,[c,l,d,h,f,!1]));for(let[D,ce]of await Promise.all(Q))Ee[D][2]=ce;return Yt("wasm ProcessOutputTensor"),Ee}finally{s.webnnOnRunEnd?.(c),s.stackRestore(F),C.forEach(ke=>s._OrtReleaseTensor(ke)),E.forEach(ke=>s._OrtReleaseTensor(ke)),T.forEach(ke=>s._free(ke)),k!==0&&s._OrtReleaseRunOptions(k),P.forEach(ke=>s._free(ke))}},Sw=t=>{let e=ee(),n=kr.get(t);if(!n)throw new Error("invalid session id");let i=n[0],r=e._OrtEndProfiling(i);r===0&&K("Can't get an profile file name."),e._OrtFree(r)}}),Cw=et(()=>{"use strict";sP(),Hi(),lw(),Va=!1,sm=!1,am=!1,kw=async()=>{if(!sm){if(Va)throw new Error("multiple calls to 'initWasm()' detected.");if(am)throw new Error("previous call to 'initWasm()' failed.");Va=!0;try{await dw(ie.wasm),await _w(ie),sm=!0}catch(t){throw am=!0,t}finally{Va=!1}}},Ew=async t=>{await bw(ie,t)},Iw=async t=>lm(t),Tw=async(t,e)=>$w(t,e),Ow=async t=>{xw(t)},Aw=async(t,e,n,i,r,o)=>ww(t,e,n,i,r,o),Pw=async t=>{Sw(t)}}),aP=et(()=>{"use strict";Cw(),vw(),pm(),yw(),um=(t,e)=>{switch(t.location){case"cpu":return[t.type,t.dims,t.data,"cpu"];case"gpu-buffer":return[t.type,t.dims,{gpuBuffer:t.gpuBuffer},"gpu-buffer"];case"ml-tensor":return[t.type,t.dims,{mlTensor:t.mlTensor},"ml-tensor"];default:throw new Error(`invalid data location: ${t.location} for ${e()}`)}},aw=t=>{switch(t[3]){case"cpu":return new Qe(t[0],t[2],t[1]);case"gpu-buffer":{let e=t[0];if(!gm(e))throw new Error(`not supported data type: ${e} for deserializing GPU tensor`);let{gpuBuffer:n,download:i,dispose:r}=t[2];return Qe.fromGpuBuffer(n,{dataType:e,dims:t[1],download:i,dispose:r})}case"ml-tensor":{let e=t[0];if(!vm(e))throw new Error(`not supported data type: ${e} for deserializing MLTensor tensor`);let{mlTensor:n,download:i,dispose:r}=t[2];return Qe.fromMLTensor(n,{dataType:e,dims:t[1],download:i,dispose:r})}default:throw new Error(`invalid data location: ${t[3]}`)}},Rw=class{async fetchModelAndCopyToWasmMemory(t){return Iw(await Ga(t))}async loadModel(t,e){Ht();let n;typeof t=="string"?zn?n=await Ga(t):n=await this.fetchModelAndCopyToWasmMemory(t):n=t,[this.sessionId,this.inputNames,this.outputNames,this.inputMetadata,this.outputMetadata]=await Tw(n,e),Jt()}async dispose(){return Ow(this.sessionId)}async run(t,e,n){Ht();let i=[],r=[];Object.entries(t).forEach(d=>{let h=d[0],f=d[1],p=this.inputNames.indexOf(h);if(p===-1)throw new Error(`invalid input '${h}'`);i.push(f),r.push(p)});let o=[],s=[];Object.entries(e).forEach(d=>{let h=d[0],f=d[1],p=this.outputNames.indexOf(h);if(p===-1)throw new Error(`invalid output '${h}'`);o.push(f),s.push(p)});let a=i.map((d,h)=>um(d,()=>`input "${this.inputNames[r[h]]}"`)),u=o.map((d,h)=>d?um(d,()=>`output "${this.outputNames[s[h]]}"`):null),c=await Aw(this.sessionId,r,a,s,u,n),l={};for(let d=0;d<c.length;d++)l[this.outputNames[s[d]]]=o[d]??aw(c[d]);return Jt(),l}startProfiling(){}endProfiling(){Pw(this.sessionId)}}}),zw={};tP(zw,{OnnxruntimeWebAssemblyBackend:()=>hm,initializeFlags:()=>dm,wasmBackend:()=>Nw});uP=et(()=>{"use strict";Cw(),aP(),dm=()=>{(typeof ie.wasm.initTimeout!="number"||ie.wasm.initTimeout<0)&&(ie.wasm.initTimeout=0);let t=ie.wasm.simd;if(typeof t!="boolean"&&t!==void 0&&t!=="fixed"&&t!=="relaxed"&&(console.warn(`Property "env.wasm.simd" is set to unknown value "${t}". Reset it to \`false\` and ignore SIMD feature checking.`),ie.wasm.simd=!1),typeof ie.wasm.proxy!="boolean"&&(ie.wasm.proxy=!1),typeof ie.wasm.trace!="boolean"&&(ie.wasm.trace=!1),typeof ie.wasm.numThreads!="number"||!Number.isInteger(ie.wasm.numThreads)||ie.wasm.numThreads<=0)if(typeof self<"u"&&!self.crossOriginIsolated)ie.wasm.numThreads=1;else{let e=typeof navigator>"u"?cm("node:os").cpus().length:navigator.hardwareConcurrency;ie.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},hm=class{async init(t){dm(),await kw(),await Ew(t)}async createInferenceSessionHandler(t,e){let n=new Rw;return await n.loadModel(t,e),n}},Nw=new hm}),cP="1.26.0",lP=Xp;{let t=(uP(),nP(zw)).wasmBackend;An("cpu",t,10),An("wasm",t,10)}Object.defineProperty(ie.versions,"web",{value:cP,enumerable:!0})});import{existsSync as dP}from"node:fs";import{createRequire as hP}from"node:module";import{dirname as fP,join as pP,sep as Uw}from"node:path";import{fileURLToPath as mP,pathToFileURL as gP}from"node:url";async function Wa(){let t=await Promise.resolve().then(()=>(Lw(),Dw));return t.default??t}function qa(t,e){t.env.wasm.numThreads=1,t.env.wasm.wasmPaths=yP(e)}function vP(t){return[new URL("./",t),new URL("../",t)].map(e=>mP(e))}function yP(t=import.meta.url){let e=vP(t);try{e.push(fP(hP(t).resolve("onnxruntime-web")))}catch{}let n=null;for(let i of e){let r=jw.filter(o=>!dP(pP(i,o)));if(r.length===0)return _P(i);r.length<jw.length&&n===null&&(n={dir:i,missing:r})}throw n!==null?new Error(`ort-web WASM runtime at '${n.dir}' is missing '${n.missing.join("', '")}' - the .wasm and its .mjs glue must be copied together`):new Error(`ort-web WASM runtime ('${Mw}' + '${Fw}') not found beside the bundle or in node_modules`)}function _P(t){return gP(t.endsWith(Uw)?t:t+Uw).href}var Mw,Fw,jw,ym=v(()=>{"use strict";Mw="ort-wasm-simd-threaded.wasm",Fw="ort-wasm-simd-threaded.mjs",jw=[Mw,Fw]});import{existsSync as bP}from"node:fs";import{fileURLToPath as $P}from"node:url";function _m(t,e){return[new URL(`../../assets/${t}`,e),new URL(`./assets/${t}`,e),new URL(`../assets/${t}`,e)].map(n=>$P(n))}function Ha(t,e,n,i={}){let r=i.baseUrl??n,o=i.exists??bP,s="envPath"in i?i.envPath:process.env[e];if(s&&o(s))return s;let a=_m(t,r);for(let u of a)if(o(u))return u;throw new Error(`model '${t}' not found. Tried: ${a.join(", ")}. Set ${e} to override.`)}var bm=v(()=>{"use strict"});function $m(t={}){return Ha(Vw,Zw,import.meta.url,t)}var Vw,Zw,xm=v(()=>{"use strict";bm();Vw="silero_vad.onnx",Zw="JARVIS_SILERO_VAD_MODEL_PATH"});var Nn,Ji,Bw,Er,wm=v(()=>{"use strict";ym();xm();Nn=512,Ji=64,Bw=256,Er=class{modelPath;sessionPromise=null;session=null;ort=null;disposed=!1;pending=new Int16Array(Nn);pendingLen=0;state=new Float32Array(Bw);context=new Float32Array(Ji);chain=Promise.resolve();constructor(e={}){this.modelPath=e.modelPath}process(e){if(this.disposed)return Promise.reject(new Error("SileroVadRunner is disposed"));let n=this.chain.then(()=>this.runWindows(e));return this.chain=n.then(()=>{},()=>{}),n}reset(){this.chain=this.chain.then(()=>{this.pendingLen=0,this.state=new Float32Array(Bw),this.context.fill(0)})}load(){return this.disposed?Promise.reject(new Error("SileroVadRunner is disposed")):this.ensureSession().then(()=>{})}prewarm(){this.disposed||this.ensureSession().catch(()=>{})}async dispose(){this.disposed=!0,this.pendingLen=0;let e=this.session;this.session=null,this.sessionPromise=null,this.ort=null,e&&await e.release()}async runWindows(e){if(this.disposed)throw new Error("SileroVadRunner is disposed");if(e.length===0)return[];let n=await this.ensureSession(),i=this.ort;if(!i)throw new Error("onnxruntime-web failed to load");let r=[],o=0;for(;;){let s=Math.min(Nn-this.pendingLen,e.length-o);if(s>0&&(this.pending.set(e.subarray(o,o+s),this.pendingLen),this.pendingLen+=s,o+=s),this.pendingLen<Nn)break;this.pendingLen=0,r.push(await this.inferWindow(n,i))}return r}async inferWindow(e,n){let i=new Float32Array(Ji+Nn);i.set(this.context,0);for(let a=0;a<Nn;a++)i[Ji+a]=this.pending[a]/32768;let r=await e.run({input:new n.Tensor("float32",i,[1,i.length]),state:new n.Tensor("float32",this.state,[2,1,128]),sr:new n.Tensor("int64",BigInt64Array.from([16000n]),[])});if(this.disposed)throw new Error("SileroVadRunner is disposed");let o=r[e.outputNames[0]].data;this.state=r[e.outputNames[1]].data,this.context.set(i.subarray(i.length-Ji));let s=o[0];if(!Number.isFinite(s))throw new Error("silero vad produced a non-finite output");return s<0?0:s>1?1:s}ensureSession(){return this.sessionPromise?this.sessionPromise:(this.sessionPromise=this.loadSession(),this.sessionPromise)}async loadSession(){let e=await Wa();this.ort=e,qa(e);let n=this.modelPath??$m(),i=await e.InferenceSession.create(n,{executionProviders:["wasm"],graphOptimizationLevel:"all",executionMode:"sequential"});if(this.disposed)throw await i.release(),new Error("SileroVadRunner is disposed");return this.session=i,i}}});function xP(t){let e=1;for(;e<t;)e<<=1;return e}var Sm,Ja,Gw=v(()=>{"use strict";Sm=class{size;rev;cos;sin;constructor(e){if(e<2||(e&e-1)!==0)throw new Error(`Radix2Fft size must be a power of two >= 2, got ${e}`);this.size=e;let n=Math.log2(e);this.rev=new Uint32Array(e);for(let r=0;r<e;r++){let o=0;for(let s=0;s<n;s++)o|=(r>>s&1)<<n-1-s;this.rev[r]=o}let i=e>>1;this.cos=new Float64Array(i),this.sin=new Float64Array(i);for(let r=0;r<i;r++){let o=2*Math.PI*r/e;this.cos[r]=Math.cos(o),this.sin[r]=Math.sin(o)}}transform(e,n,i){let r=this.size,o=this.rev;for(let s=0;s<r;s++){let a=o[s];if(a>s){let u=e[s];e[s]=e[a],e[a]=u;let c=n[s];n[s]=n[a],n[a]=c}}for(let s=2;s<=r;s<<=1){let a=s>>1,u=r/s;for(let c=0;c<r;c+=s)for(let l=0;l<a;l++){let d=l*u,h=this.cos[d],f=i?this.sin[d]:-this.sin[d],p=c+l,_=p+a,S=e[_]*h-n[_]*f,k=e[_]*f+n[_]*h;e[_]=e[p]-S,n[_]=n[p]-k,e[p]+=S,n[p]+=k}}if(i){let s=1/r;for(let a=0;a<r;a++)e[a]*=s,n[a]*=s}}};Ja=class{n;bins;m;fft;chirpCos;chirpSin;bRe;bIm;aRe;aIm;constructor(e){if(e<2)throw new Error(`PowerSpectrum length must be >= 2, got ${e}`);this.n=e,this.bins=(e>>1)+1,this.m=xP(2*e-1),this.fft=new Sm(this.m),this.chirpCos=new Float64Array(e),this.chirpSin=new Float64Array(e);for(let n=0;n<e;n++){let i=n*n%(2*e),r=Math.PI*i/e;this.chirpCos[n]=Math.cos(r),this.chirpSin[n]=Math.sin(r)}this.bRe=new Float64Array(this.m),this.bIm=new Float64Array(this.m);for(let n=0;n<e;n++){let i=this.chirpCos[n],r=this.chirpSin[n];this.bRe[n]=i,this.bIm[n]=r,n!==0&&(this.bRe[this.m-n]=i,this.bIm[this.m-n]=r)}this.fft.transform(this.bRe,this.bIm,!1),this.aRe=new Float64Array(this.m),this.aIm=new Float64Array(this.m)}computePower(e,n){let{n:i,m:r,aRe:o,aIm:s}=this;o.fill(0),s.fill(0);for(let a=0;a<i;a++){let u=e[a];o[a]=u*this.chirpCos[a],s[a]=-u*this.chirpSin[a]}this.fft.transform(o,s,!1);for(let a=0;a<r;a++){let u=o[a],c=s[a],l=this.bRe[a],d=this.bIm[a];o[a]=u*l-c*d,s[a]=u*d+c*l}this.fft.transform(o,s,!0);for(let a=0;a<this.bins;a++){let u=o[a],c=s[a];n[a]=u*u+c*c}}}});function Hw(t){let i=27/Math.log(6.4);return t>=1e3?15+Math.log(t/1e3)*i:3*t/200}function kP(t){let i=Math.log(6.4)/27;return t>=15?1e3*Math.exp(i*(t-15)):200*t/3}function Jw(t,e,n){let i=new Float64Array(n),r=n>1?(e-t)/(n-1):0;for(let o=0;o<n;o++)i[o]=t+o*r;return n>1&&(i[n-1]=e),i}function EP(){let t=Hw(0),e=Hw(km/2),n=Jw(t,e,Ot+2),i=new Float64Array(Ot+2);for(let a=0;a<n.length;a++)i[a]=kP(n[a]);let r=Jw(0,km/2,Ki),o=new Float64Array(Ot+1);for(let a=0;a<Ot+1;a++)o[a]=i[a+1]-i[a];let s=[];for(let a=0;a<Ot;a++){let u=2/(i[a+2]-i[a]),c=new Float64Array(Ki),l=Ki,d=0;for(let h=0;h<Ki;h++){let f=-(i[a]-r[h])/o[a],p=(i[a+2]-r[h])/o[a+1],_=Math.max(0,Math.min(f,p))*u;c[h]=_,_>0&&(h<l&&(l=h),d=h+1)}l>d&&(l=d=0),s.push({lo:l,hi:d,weights:c.slice(l,d)})}return s}function IP(){let t=new Float64Array(ct);for(let e=0;e<ct;e++)t[e]=.5-.5*Math.cos(2*Math.PI*e/ct);return t}var km,ct,wP,Ot,Ki,Ww,SP,qw,Ue,Ir,Em,Yi,Ka=v(()=>{"use strict";Gw();km=16e3,ct=400,wP=160,Ot=80,Ki=(ct>>1)+1,Ww=1e-10,SP=1e-7,qw=32768,Ue=km*8,Ir=800,Em=Ot;Yi=class{hann=IP();filters=EP();spectrum=new Ja(ct);padded=new Float64Array(Ue+ct);frame=new Float64Array(ct);power=new Float64Array(Ki);logBuf=new Float64Array(Ot*Ir);fromPcm16(e){return this.window(e),this.normalize(),this.reflectPad(),this.melSpectrogram()}window(e){let n=this.padded,i=ct/2,r=e.length;if(r>=Ue){let o=r-Ue;for(let s=0;s<Ue;s++)n[i+s]=e[o+s]/qw}else{let o=Ue-r;for(let s=0;s<o;s++)n[i+s]=0;for(let s=0;s<r;s++)n[i+o+s]=e[s]/qw}}normalize(){let e=this.padded,n=ct/2,i=Ue,r=0;for(let a=0;a<i;a++)r+=e[n+a];r/=i;let o=0;for(let a=0;a<i;a++){let u=e[n+a]-r;o+=u*u}o/=i;let s=1/Math.sqrt(o+SP);for(let a=0;a<i;a++)e[n+a]=(e[n+a]-r)*s}reflectPad(){let e=this.padded,n=ct/2,i=Ue;for(let r=0;r<n;r++)e[r]=e[n+(n-r)],e[n+i+r]=e[n+(i-2-r)]}melSpectrogram(){let{padded:e,frame:n,power:i,hann:r,filters:o,logBuf:s}=this;for(let l=0;l<Ir;l++){let d=l*wP;for(let h=0;h<ct;h++)n[h]=e[d+h]*r[h];this.spectrum.computePower(n,i);for(let h=0;h<Ot;h++){let{lo:f,hi:p,weights:_}=o[h],S=0;for(let k=f;k<p;k++)S+=_[k-f]*i[k];s[h*Ir+l]=Math.log10(S<Ww?Ww:S)}}let a=-1/0;for(let l of s)l>a&&(a=l);let u=a-8,c=new Float32Array(Ot*Ir);for(let l=0;l<s.length;l++){let d=s[l]<u?u:s[l];c[l]=(d+4)/4}return c}}});function TP(t){return t.toLowerCase().replace(/[.,!?;:]+$/g,"").trim()}function Ya(t,e){return e.some(n=>Yw(t,n))}function Yw(t,e){if(!t.endsWith(e))return!1;let n=t.length-e.length-1;return n<0||t[n]===" "}function OP(t,e){let n=AP(t);return n===""?null:e.find(i=>PP(n,i))??null}function AP(t){let e=/^.*[.!?\u3002\uFF01\uFF1F]\s+/s.exec(t);return(e?t.slice(e[0].length):t).trim()}function PP(t,e){for(let n=t.indexOf(e);n!==-1;n=t.indexOf(e,n+1)){let i=n===0||!Kw(t[n-1]),r=n+e.length===t.length||!Kw(t[n+e.length]);if(i&&r)return!0}return!1}function Kw(t){return/[a-z0-9']/.test(t)}var Xa,Im,Xi,Tm=v(()=>{"use strict";mn();mn();Xa={silenceEnergyThreshold:pn,shortSilenceMs:500,longSilenceMs:1400,reopenGraceMs:400,stopSecsMs:3e4,heldBudgetLadderMs:[4e3,8e3],heldCeilingMs:12e4,strongHoldCues:["hold on","hang on","give me a sec","give me a second","one moment","one sec","one second","let me think","let me see","let me look"],weakHoldCues:["actually","wait"],commitCues:["that's it","go ahead","what do you think"]},Im="semantic",Xi=class{clock;config;classifier;telemetry=null;phase="listening";inSilence=!1;silenceStartedAt=null;firstSpeechAt=null;budgetOwner="baseline";armedBudgetMs=null;lastRawPartial="";lastNormPartial="";strongHoldCue=null;partialStability="stable";pendingVetoClear=!1;held=!1;heldLadderStep=0;heldCeilingDeadlineAtMs=null;commitCb;silenceTimer=null;graceTimer=null;stopTimer=null;ceilingTimer=null;constructor(e,n={},i){this.clock=e,this.config={...Xa,...n},this.classifier=i??new Ci(this.config.silenceEnergyThreshold)}onAudioFrame(e){this.phase==="committed"||this.phase==="disposed"||this.classifier.classify(e,this.applyVerdict)}applyVerdict=e=>{this.phase==="committed"||this.phase==="disposed"||(e?this.handleSpeech():this.handleSilence())};onPartial(e){if(this.phase==="committed"||this.phase==="disposed")return;if(this.lastRawPartial=e.trim(),this.lastNormPartial=TP(e),Ya(this.lastNormPartial,this.config.commitCues)){this.commit("lexical");return}let n=this.strongHoldCue,i=OP(this.lastNormPartial,this.config.strongHoldCues);if(i===null&&n!==null&&this.partialStability==="redecode"&&!this.pendingVetoClear){this.pendingVetoClear=!0,this.telemetry?.strongHoldClearDebounced?.(n),Ya(this.lastNormPartial,this.config.weakHoldCues)&&(this.held||this.holdFloor());return}if(this.pendingVetoClear=!1,this.strongHoldCue=i,this.strongHoldCue!==null){if(this.strongHoldCue!==n){this.telemetry?.strongHoldRecognized(this.strongHoldCue),this.held||this.enterHeld(this.strongHoldCue);return}if(this.held)return;if(Yw(this.lastNormPartial,this.strongHoldCue)){this.enterHeld(this.strongHoldCue);return}this.holdFloor();return}if(Ya(this.lastNormPartial,this.config.weakHoldCues)){if(this.held)return;this.holdFloor()}}onCommit(e){this.commitCb=e}attachTelemetry(e){this.telemetry=e}setPartialStability(e){this.partialStability=e}dispose(){this.phase="disposed",this.clearAllTimers()}holdFloor(){this.clearSilenceTimer(),this.phase==="tentative"&&(this.clearGraceTimer(),this.phase="listening"),this.inSilence=!1}handleSpeech(){this.held?(this.inSilence&&(this.exitHeld("speech"),this.clearStopTimer(),this.stopTimer=this.clock.setTimer(this.config.stopSecsMs,()=>this.commit("stop_cap"))),this.firstSpeechAt??=this.clock.now()):this.firstSpeechAt===null&&(this.firstSpeechAt=this.clock.now(),this.stopTimer=this.clock.setTimer(this.config.stopSecsMs,()=>this.commit("stop_cap"))),this.clearSilenceTimer(),this.phase==="tentative"&&(this.clearGraceTimer(),this.phase="listening"),this.inSilence=!1}handleSilence(){this.firstSpeechAt===null||this.phase!=="listening"||this.inSilence||(this.inSilence=!0,this.silenceStartedAt=this.clock.now(),this.budgetOwner="baseline",this.armedBudgetMs=this.held?this.heldLadderBudgetMs():this.silenceBudgetMs(),this.silenceTimer=this.clock.setTimer(this.armedBudgetMs,()=>this.onSilenceBudgetElapsed()),this.onSilenceDetected())}silenceBudgetMs(){return this.isCompleteSounding()?this.config.shortSilenceMs:this.config.longSilenceMs}onSilenceDetected(){}canRefineBudget(){return this.phase==="listening"&&this.inSilence}canApplySemanticVerdict(){return(this.phase==="listening"||this.phase==="tentative")&&this.inSilence}isHeld(){return this.held}heldAllowanceExhausted(){return this.heldCeilingDeadlineAtMs!==null&&this.heldCeilingDeadlineAtMs-this.clock.now()<=0}livePartial(){return this.lastRawPartial}rearmSilence(e,n="smart_turn"){if(!this.inSilence||this.silenceStartedAt===null||this.phase!=="listening"&&this.phase!=="tentative"||this.held)return;let i=e-(this.clock.now()-this.silenceStartedAt);if(this.phase==="tentative"){if(i<=0)return;this.clearGraceTimer(),this.phase="listening"}e!==this.armedBudgetMs&&(this.budgetOwner=n),this.armedBudgetMs=e,this.clearSilenceTimer(),i<=0?this.onSilenceBudgetElapsed():this.silenceTimer=this.clock.setTimer(i,()=>this.onSilenceBudgetElapsed())}onSilenceBudgetElapsed(){if(this.silenceTimer=null,this.phase==="listening"){if(this.held){this.heldLadderStep+=1;let e=this.heldLadderBudgetMs();this.armedBudgetMs=e,this.silenceTimer=this.clock.setTimer(e,()=>this.onSilenceBudgetElapsed()),this.telemetry?.heldLadderRearmed(e);return}this.phase="tentative",this.graceTimer=this.clock.setTimer(this.config.reopenGraceMs,()=>{this.graceTimer=null,this.commit(this.budgetOwner)})}}isCompleteSounding(){return this.strongHoldCue!==null?!1:/[.!?\u3002\uFF01\uFF1F]$/.test(this.lastRawPartial)?!0:Ya(this.lastNormPartial,this.config.commitCues)}enterHeld(e){if(this.held)return;let n=this.clock.now();this.heldCeilingDeadlineAtMs??=n+this.config.heldCeilingMs;let i=this.heldCeilingDeadlineAtMs-n;if(!(i<=0&&e===Im)){if(this.held=!0,this.heldLadderStep=0,this.clearStopTimer(),this.telemetry?.heldEntered(e),i<=0){this.commit("held_ceiling");return}this.ceilingTimer=this.clock.setTimer(i,()=>this.commit("held_ceiling")),this.holdFloor()}}resumeHeldSilence(){!this.held||this.phase!=="listening"||this.inSilence||this.firstSpeechAt===null||this.silenceStartedAt===null||(this.inSilence=!0,this.budgetOwner="baseline",this.armedBudgetMs=this.heldLadderBudgetMs(),this.silenceTimer=this.clock.setTimer(this.armedBudgetMs,()=>this.onSilenceBudgetElapsed()))}exitHeld(e){this.held=!1,this.clearCeilingTimer(),this.telemetry?.heldExited(e)}heldLadderBudgetMs(){let e=this.config.heldBudgetLadderMs;return e[Math.min(this.heldLadderStep,e.length-1)]??this.config.longSilenceMs}commit(e){this.phase==="committed"||this.phase==="disposed"||(this.held&&this.exitHeld(e==="held_ceiling"?"ceiling":"commit_cue"),this.phase="committed",this.clearAllTimers(),this.telemetry?.endpointerCommitted(e,this.inSilence?this.silenceStartedAt:null),this.commitCb?.())}clearSilenceTimer(){this.silenceTimer!==null&&(this.clock.clearTimer(this.silenceTimer),this.silenceTimer=null)}clearGraceTimer(){this.graceTimer!==null&&(this.clock.clearTimer(this.graceTimer),this.graceTimer=null)}clearStopTimer(){this.stopTimer!==null&&(this.clock.clearTimer(this.stopTimer),this.stopTimer=null)}clearCeilingTimer(){this.ceilingTimer!==null&&(this.clock.clearTimer(this.ceilingTimer),this.ceilingTimer=null)}clearAllTimers(){this.clearSilenceTimer(),this.clearGraceTimer(),this.clearStopTimer(),this.clearCeilingTimer()}}});var Xw,Qi,Om=v(()=>{"use strict";Ka();Tm();Xw={...Xa,commitThreshold:.65,holdThreshold:.35},Qi=class extends Xi{smartConfig;inference;buffer=new Int16Array(Ue*2);bufferLen=0;silenceEpoch=0;degraded=!1;smartDisposed=!1;semantics;evaluatedEpoch=0;evaluationAbort=new AbortController;constructor(e,n,i={},r,o){super(e,i,r),this.smartConfig={...Xw,...i},this.inference=n,o&&(this.semantics=o)}onAudioFrame(e){this.appendToBuffer(e),super.onAudioFrame(e)}dispose(){this.smartDisposed=!0,this.bufferLen=0,this.evaluationAbort.abort(),super.dispose()}onSilenceDetected(){if(this.silenceEpoch+=1,this.degraded||this.smartDisposed)return;let e=this.silenceEpoch,n=this.snapshotBuffer();this.runInference(n,e)}async runInference(e,n){let i=this.clock.now(),r;try{r=await this.inference.infer(e)}catch(s){let a=this.degraded;this.degraded=!0,!a&&!this.smartDisposed&&this.telemetry?.smartTurnDegraded(this.clock.now()-i,s);return}let o=this.clock.now()-i;if(this.smartDisposed||n!==this.silenceEpoch||!this.canRefineBudget()){this.telemetry?.smartTurnResolved(r,o,"stale");return}r>=this.smartConfig.commitThreshold?(this.telemetry?.smartTurnResolved(r,o,"shorten"),this.rearmSilence(this.smartConfig.shortSilenceMs),this.maybeEvaluateTurn(n,"shorten")):r<=this.smartConfig.holdThreshold?(this.telemetry?.smartTurnResolved(r,o,"extend"),this.rearmSilence(this.smartConfig.longSilenceMs)):(this.telemetry?.smartTurnResolved(r,o,"inconclusive"),this.maybeEvaluateTurn(n,"inconclusive"))}maybeEvaluateTurn(e,n){if(!this.semantics||this.evaluatedEpoch===e||this.isHeld())return;let i=this.livePartial();i!==""&&(this.evaluatedEpoch=e,this.runEvaluation(this.semantics,i,e,n))}async runEvaluation(e,n,i,r){this.telemetry?.evaluatorFired?.(r);let o=this.clock.now(),s;try{s=await e.evaluator.evaluate({recentTurns:e.recentTurns(),livePartial:n},this.evaluationAbort.signal)}catch(u){this.smartDisposed||this.telemetry?.evaluatorFailed?.(this.clock.now()-o,u);return}let a=this.clock.now()-o;if(this.smartDisposed||i!==this.silenceEpoch||!this.canApplySemanticVerdict()){this.telemetry?.evaluatorResolved?.(s.verdict,s.confidence,a,"stale");return}if(this.telemetry?.evaluatorResolved?.(s.verdict,s.confidence,a,"applied"),s.verdict==="done")this.rearmSilence(this.smartConfig.shortSilenceMs,"semantic");else if(s.verdict==="mid_thought")this.rearmSilence(this.smartConfig.longSilenceMs,"semantic");else{if(this.heldAllowanceExhausted())return;this.enterHeld(Im),this.resumeHeldSilence()}}appendToBuffer(e){let n=e.byteLength>>1;if(n===0)return;let i=new DataView(e.buffer,e.byteOffset,e.byteLength),r=n>Ue?n-Ue:0,o=n-r;if(this.bufferLen+o>this.buffer.length){let s=Math.min(this.bufferLen,Ue);this.buffer.copyWithin(0,this.bufferLen-s,this.bufferLen),this.bufferLen=s}for(let s=r;s<n;s++)this.buffer[this.bufferLen++]=i.getInt16(s*2,!0)}snapshotBuffer(){let e=Math.max(0,this.bufferLen-Ue);return this.buffer.slice(e,this.bufferLen)}}});function Am(t={}){return Ha(Qw,eS,import.meta.url,t)}var Qw,eS,Pm=v(()=>{"use strict";bm();Qw="smart-turn-v3.1-cpu.onnx",eS="JARVIS_SMART_TURN_MODEL_PATH"});var eo,Cm=v(()=>{"use strict";Ka();ym();Pm();eo=class{logMel;modelPath;sessionPromise=null;session=null;ort=null;disposed=!1;constructor(e={}){this.logMel=e.logMel??new Yi,this.modelPath=e.modelPath}async infer(e){if(this.disposed)throw new Error("SmartTurnRunner is disposed");let n=await this.ensureSession(),i=this.ort;if(!i)throw new Error("onnxruntime-web failed to load");let r=this.logMel.fromPcm16(e),o=new i.Tensor("float32",r,[1,Em,Ir]),s=await n.run({input_features:o});if(this.disposed)throw new Error("SmartTurnRunner is disposed");let a=n.outputNames[0],c=s[a].data[0];if(!Number.isFinite(c))throw new Error("smart-turn produced a non-finite output");return c<0?0:c>1?1:c}prewarm(){this.disposed||this.ensureSession().catch(()=>{})}async dispose(){this.disposed=!0;let e=this.session;this.session=null,this.sessionPromise=null,this.ort=null,e&&await e.release()}ensureSession(){return this.sessionPromise?this.sessionPromise:(this.sessionPromise=this.load(),this.sessionPromise)}async load(){let e=await Wa();this.ort=e,qa(e);let n=this.modelPath??Am(),i=await e.InferenceSession.create(n,{executionProviders:["wasm"],graphOptimizationLevel:"all",executionMode:"sequential"});if(this.disposed)throw await i.release(),new Error("SmartTurnRunner is disposed");return this.session=i,i}}});function UP(t){let e=[];if(t.recentTurns.length>0){e.push("Recent conversation:");for(let n of t.recentTurns)e.push(`${n.role==="assistant"?"Assistant":"User"}: ${n.text}`)}else e.push("Recent conversation: (none)");return e.push(""),e.push("Live partial transcript (the user is speaking right now):"),e.push(JSON.stringify(t.livePartial)),e.join(`
146
+ `)}function jP(t){let e=Rm(t)?.content,n=(Array.isArray(e)?e:[]).map(l=>Rm(l)).filter(l=>l?.type==="text").map(l=>typeof l?.text=="string"?l.text:"").join(""),i=tS+n;i.includes("}")||(i+="}");let r=i.indexOf("{"),o=i.lastIndexOf("}");if(r===-1||o<=r)throw new Qt("turn evaluator reply carried no JSON object");let s;try{s=JSON.parse(i.slice(r,o+1))}catch{throw new Qt("turn evaluator reply was not valid JSON")}let a=Rm(s),u=a?.verdict;if(typeof u!="string"||!DP.includes(u))throw new Qt("turn evaluator reply carried an unknown verdict");let c=a?.confidence;if(typeof c!="number"||!Number.isFinite(c)||c<0||c>1)throw new Qt("turn evaluator confidence missing or out of range");return{verdict:u,confidence:c}}function Rm(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0}var CP,RP,zP,tS,NP,DP,LP,Qt,Dn,zm=v(()=>{"use strict";CP="claude-haiku-4-5-20251001",RP="https://api.anthropic.com/v1/messages",zP="2023-06-01",tS='{"verdict":"',NP=["}"],DP=["done","mid_thought","hold_floor"],LP=`You are the semantic turn evaluator inside a real-time voice assistant's
141
147
  turn-taking system. The user is speaking; a streaming ASR produces a live
142
148
  partial transcript. Your only job is to judge whether the user's turn reads
143
149
  as finished. You advise a policy layer; you never answer the user.
@@ -178,52 +184,46 @@ Rules:
178
184
  Output exactly one line of strict JSON and nothing else:
179
185
  {"verdict":"done"|"mid_thought"|"hold_floor","confidence":<number 0..1>}
180
186
  confidence is your certainty in the verdict.
181
- `,Yt=class extends Error{status;constructor(e,n){super(e),this.status=n,this.name="TurnEvaluatorError"}},bn=class{key;fetchImpl;timeoutMs;constructor(e,n=fetch,i=2e3){this.key=e,this.fetchImpl=n,this.timeoutMs=i}async evaluate(e,n){let i={model:RO,max_tokens:64,temperature:0,stop_sequences:LO,system:jO,messages:[{role:"user",content:MO(e)},{role:"assistant",content:jx}]},r=await this.fetchImpl(NO,{method:"POST",headers:{"x-api-key":this.key,"anthropic-version":DO,"content-type":"application/json"},body:JSON.stringify(i),signal:AbortSignal.any([n,AbortSignal.timeout(this.timeoutMs)])});if(!r.ok)throw new Yt(`turn evaluator request failed (HTTP ${r.status})`,r.status);let o;try{o=await r.json()}catch{throw new Yt("turn evaluator response body was not JSON")}return FO(o)}}});var Mx,Qp,em=v(()=>{"use strict";Mx="21m00Tcm4TlvDq8ikWAM",Qp={id:"jarvis-primary",engineVoice:{"elevenlabs-flash":{kind:"preset",voiceId:Mx}}}});var wa,Fx=v(()=>{"use strict";Ae();wa=class{turnId;openedAtMs;log;terminal=!1;heldOpen=!1;asideCommit=!1;decider=null;silenceOnsetAtMs=null;commitAtMs=null;asrFinalAtMs=null;transcriptLength=null;firstDeltaAtMs=null;firstAudioAtMs=null;constructor(e,n,i=B){this.turnId=e,this.openedAtMs=n,this.log=i}endpointerCommitted(e,n){this.decider===null&&(this.decider=e,this.silenceOnsetAtMs=n)}smartTurnResolved(e,n,i){this.log.debug("smart-turn P(complete)",{turnId:this.turnId,probability:e,inferenceMs:n,outcome:i})}smartTurnDegraded(e,n){this.log.debug("smart-turn DEGRADED to baseline - inference failed; this turn endpoints on baseline timers only",{turnId:this.turnId,inferenceMs:e,error:n instanceof Error?n.message:String(n)})}strongHoldRecognized(e){this.log.debug("lexical STRONG hold recognized - completeness vetoed, silence budget biases long",{turnId:this.turnId,cue:e})}heldEntered(e){this.heldOpen=!0,this.log.debug("floor-held mode entered - silence budgets escalate, stop cap suspended",{turnId:this.turnId,cue:e})}heldLadderRearmed(e){this.log.debug("held silence budget re-armed at the next ladder step",{turnId:this.turnId,budgetMs:e})}heldExited(e){this.heldOpen=!1,this.log.debug("floor-held mode exited",{turnId:this.turnId,reason:e})}evaluatorFired(e){this.log.debug("semantic evaluator fired - smart-turn resolved in a gated band during a live silence episode",{turnId:this.turnId,band:e})}evaluatorResolved(e,n,i,r){this.log.debug("semantic evaluator resolved",{turnId:this.turnId,verdict:e,confidence:n,latencyMs:i,outcome:r})}evaluatorFailed(e,n){this.log.debug("semantic evaluator failed - no signal; this episode endpoints as armed",{turnId:this.turnId,latencyMs:e,error:n instanceof Error?n.message:String(n)})}committed(e,n){this.commitAtMs===null&&(n==="ptt"&&this.heldOpen&&this.heldExited("ptt"),this.commitAtMs=e,n==="ptt"&&(this.decider??="ptt"))}asrFinalResolved(e,n){this.asrFinalAtMs===null&&(this.asrFinalAtMs=e,this.transcriptLength=n)}firstReasonerDelta(e){this.firstDeltaAtMs??=e}firstTtsAudio(e){this.firstAudioAtMs??=e}addresseeFired(){this.log.debug("addressee evaluator fired - racing the reply for the pre-audio veto",{turnId:this.turnId})}addresseeResolved(e,n,i,r){this.log.debug("addressee evaluator resolved",{turnId:this.turnId,verdict:e,confidence:n,latencyMs:i,outcome:r})}addresseeFailed(e,n){this.log.debug("addressee evaluator failed - no signal; the reply speaks",{turnId:this.turnId,latencyMs:e,error:n instanceof Error?n.message:String(n)})}markAsideCommit(){this.asideCommit=!0}confirmationFired(){this.log.debug("aside confirmation fired - the lexical wakeword opened the gate",{turnId:this.turnId})}confirmationResolved(e,n,i,r){this.log.debug("aside confirmation resolved",{turnId:this.turnId,verdict:e,confidence:n,latencyMs:i,outcome:r})}confirmationFailed(e,n){this.log.debug("aside confirmation failed - torn with the name spoken: resuming",{turnId:this.turnId,latencyMs:e,error:n instanceof Error?n.message:String(n)})}completed(e){this.terminal||(this.terminal=!0,this.log.debug("voice turn summary",{turnId:this.turnId,decider:this.decider,disposition:"dispatched",...this.asideCommit&&{floor:"aside"},silenceToCommitMs:this.spanMs(this.silenceOnsetAtMs,this.commitAtMs),commitToFinalMs:this.spanMs(this.commitAtMs,this.asrFinalAtMs),finalToFirstDeltaMs:this.spanMs(this.asrFinalAtMs,this.firstDeltaAtMs),firstDeltaToFirstAudioMs:this.spanMs(this.firstDeltaAtMs,this.firstAudioAtMs),totalMs:e-this.openedAtMs,transcriptLength:this.transcriptLength}))}absorbed(e){this.terminal||(this.terminal=!0,this.log.debug("voice turn absorbed - not addressed to Jarvis; no reply spoken",{turnId:this.turnId,decider:this.decider,disposition:"absorbed",silenceToCommitMs:this.spanMs(this.silenceOnsetAtMs,this.commitAtMs),commitToFinalMs:this.spanMs(this.commitAtMs,this.asrFinalAtMs),totalMs:e-this.openedAtMs,transcriptLength:this.transcriptLength}))}asideAbsorbed(e){this.terminal||(this.terminal=!0,this.log.debug("voice turn absorbed in the aside - no reply spoken",{turnId:this.turnId,decider:this.decider,disposition:"absorbed",floor:"aside",silenceToCommitMs:this.spanMs(this.silenceOnsetAtMs,this.commitAtMs),commitToFinalMs:this.spanMs(this.commitAtMs,this.asrFinalAtMs),totalMs:e-this.openedAtMs,transcriptLength:this.transcriptLength}))}blank(e){this.terminal||(this.terminal=!0,this.log.debug("voice turn blank - terminated silently (no transcribed speech)",{turnId:this.turnId,decider:this.decider,silenceToCommitMs:this.spanMs(this.silenceOnsetAtMs,this.commitAtMs),commitToFinalMs:this.spanMs(this.commitAtMs,this.asrFinalAtMs),totalMs:e-this.openedAtMs,transcriptLength:this.transcriptLength}))}spanMs(e,n){return e===null||n===null?null:n-e}}});function WO(t){return GO.test(t)}var Vx,Zx,ZO,BO,Sa,GO,ka,Bx=v(()=>{"use strict";aa();Fx();Vx=16e3,Zx="pcm_s16le",ZO="en",BO=["Jarvis"],Sa=.7,GO=/\bjarvis\b/i;ka=class{deps;asrStream;ttsStream=null;reasonAbort=new AbortController;phase="capturing";settled=!1;finalizing=!1;lastFrameAtMs;timeline;pendingDispatch=null;absorbPending=null;constructor(e){this.deps=e,this.lastFrameAtMs=e.startMs,this.timeline=new wa(e.turnId,e.clock.now()),e.controller.attachTelemetry?.(this.timeline),this.asrStream=e.asrEngine.open({sampleRate:Vx,encoding:Zx,language:ZO,biasTerms:BO,emitPartials:!0}),this.asrStream.onTranscript(n=>this.handleTranscript(n)),this.asrStream.onError(n=>this.finishError("turn_failed",n)),e.controller.onCommit(()=>this.finalize(this.lastFrameAtMs,"controller")),e.emit({type:"state",turnId:e.turnId,state:"processing"})}pushFrame(e,n){this.phase!=="capturing"||this.settled||(this.lastFrameAtMs=n,this.asrStream.pushAudio(e),this.deps.controller.onAudioFrame(e))}endAudio(e){this.finalize(e,"ptt")}cancel(){this.settled||(this.settled=!0,this.phase="cancelled",this.deps.controller.dispose(),this.reasonAbort.abort(),this.asrStream.abort(),this.ttsStream?.cancel(),this.deps.onComplete())}handleTranscript(e){this.phase!=="capturing"||this.settled||e.isFinal||(this.deps.emit({type:"transcript.partial",turnId:this.deps.turnId,text:e.text}),this.deps.controller.onPartial(e.text))}finalize(e,n){this.phase!=="capturing"||this.finalizing||this.settled||(this.finalizing=!0,this.timeline.committed(this.deps.clock.now(),n),this.deps.controller.dispose(),this.finalizeAndRespond(e,n))}async finalizeAndRespond(e,n){let i;try{i=await this.asrStream.end()}catch(s){if(this.settled)return;this.finishError("turn_failed",s);return}if(this.settled)return;this.timeline.asrFinalResolved(this.deps.clock.now(),i.text.length);let r=this.deps.addressee;if(n==="ptt"&&r?.floorState()==="aside")try{r.onFloorReleased("explicit")}catch{}if(i.text.trim()===""){this.finishBlank();return}this.phase="responding";let o=this.buildUserTurn(i.text,e);if(r?.floorState()==="aside")return this.runAside(o,r);r?(this.pendingDispatch={turn:o,deltas:[],audio:[]},this.fireAddressee(o)):this.emitDispatch(o);try{await this.respond(o.text)}catch(s){if(this.settled)return;if(this.absorbPending){this.finishAbsorbed();return}this.finishError("turn_failed",s);return}this.settled||this.finishDone()}async runAside(e,n){if(this.timeline.markAsideCommit(),!WO(e.text)){this.finishAsideAbsorbed(e,n);return}let i=this.deps.clock.now();this.timeline.confirmationFired();let r;try{r=await n.evaluator.evaluate({recentTurns:n.recentTurns(),utterance:e.text},this.reasonAbort.signal,{timeoutMs:3e3})}catch(s){if(this.settled)return;this.timeline.confirmationFailed(this.deps.clock.now()-i,s)}if(this.settled)return;let o=!0;if(r&&(o=!((r.verdict==="to_other"||r.verdict==="self_talk")&&r.confidence>=Sa),this.timeline.confirmationResolved(r.verdict,r.confidence,this.deps.clock.now()-i,o?"resumed":"stayed")),!o){this.finishAsideAbsorbed(e,n,r);return}try{n.onFloorReleased("resume")}catch{}this.emitDispatch(e);try{await this.respond(e.text)}catch(s){if(this.settled)return;this.finishError("turn_failed",s);return}this.settled||this.finishDone()}emitDispatch(e){this.deps.emit({type:"turn.final",turnId:this.deps.turnId,turn:e,...this.deps.commandId!==void 0&&{commandId:this.deps.commandId}}),this.deps.emit({type:"state",turnId:this.deps.turnId,state:"responding"})}resolveDispatched(){let e=this.pendingDispatch;if(e){this.pendingDispatch=null,this.emitDispatch(e.turn);for(let n of e.deltas)this.deps.emit({type:"response.delta",turnId:this.deps.turnId,text:n});for(let n of e.audio)this.deps.emit({type:"response.audio",turnId:this.deps.turnId,audio:n})}}fireAddressee(e){let n=this.deps.addressee;if(!n)return;let i=this.deps.clock.now();this.timeline.addresseeFired();try{n.evaluator.evaluate({recentTurns:n.recentTurns(),utterance:e.text},this.reasonAbort.signal).then(r=>this.onAddresseeVerdict(r.verdict,r.confidence,this.deps.clock.now()-i),r=>this.onAddresseeFailed(this.deps.clock.now()-i,r))}catch(r){this.onAddresseeFailed(this.deps.clock.now()-i,r)}}onAddresseeVerdict(e,n,i){if(this.settled||this.pendingDispatch===null){this.timeline.addresseeResolved(e,n,i,"late");return}if(!(e==="to_other"||e==="self_talk")||n<Sa){this.timeline.addresseeResolved(e,n,i,"agreed"),this.resolveDispatched();return}this.absorbPending={verdict:e,confidence:n,latencyMs:i},this.reasonAbort.abort()}onAddresseeFailed(e,n){this.settled||(this.timeline.addresseeFailed(e,n),this.resolveDispatched())}async respond(e){let n=!1,i=!1,r=this.deps.ttsEngine.speak({voice:this.deps.voice,sampleRate:Vx,encoding:Zx});this.ttsStream=r,r.onAudio(s=>{if(!this.settled){if(i||(i=!0,this.timeline.firstTtsAudio(this.deps.clock.now())),this.absorbPending){this.pendingDispatch?.audio.push(s);return}this.resolveDispatched(),this.deps.emit({type:"response.audio",turnId:this.deps.turnId,audio:s})}}),r.onError(s=>this.finishError("turn_failed",s));let o=this.deps.reasoner.run(e,this.reasonAbort.signal,{register:"voice"});for await(let s of o){if(this.settled)return;if(this.absorbPending){this.finishAbsorbed();return}n||(n=!0,this.timeline.firstReasonerDelta(this.deps.clock.now())),this.pendingDispatch?this.pendingDispatch.deltas.push(s.text):this.deps.emit({type:"response.delta",turnId:this.deps.turnId,text:s.text});for(let a of this.deps.segmenter.push(s.text))r.pushText(a)}if(!this.settled){if(this.absorbPending){let{verdict:s,confidence:a,latencyMs:u}=this.absorbPending;this.absorbPending=null,this.timeline.addresseeResolved(s,a,u,"late")}this.resolveDispatched();for(let s of this.deps.segmenter.flush())r.pushText(s);await r.end()}}finishBlank(){this.settled||(this.settled=!0,this.timeline.blank(this.deps.clock.now()),this.deps.onComplete())}finishAbsorbed(){if(this.settled)return;let e=this.pendingDispatch,n=this.absorbPending;if(!e||!n){this.finishError("turn_failed",new Error("absorb arbitration without a live veto"));return}this.settled=!0,this.phase="cancelled",this.pendingDispatch=null,this.absorbPending=null,this.reasonAbort.abort(),this.ttsStream?.cancel(),this.timeline.addresseeResolved(n.verdict,n.confidence,n.latencyMs,"vetoed"),this.timeline.absorbed(this.deps.clock.now()),this.deps.emit({type:"turn.final",turnId:this.deps.turnId,turn:{...e.turn,disposition:"absorbed"},...this.deps.commandId!==void 0&&{commandId:this.deps.commandId}}),this.deps.onComplete();try{this.deps.addressee?.onAbsorbed(e.turn.text,{verdict:n.verdict,confidence:n.confidence})}catch{}}finishAsideAbsorbed(e,n,i){if(!this.settled){this.settled=!0,this.phase="cancelled",this.timeline.asideAbsorbed(this.deps.clock.now()),this.deps.emit({type:"turn.final",turnId:this.deps.turnId,turn:{...e,disposition:"absorbed"},...this.deps.commandId!==void 0&&{commandId:this.deps.commandId}}),this.deps.onComplete();try{n.onAbsorbed(e.text,i)}catch{}}}finishDone(){this.settled||(this.settled=!0,this.timeline.completed(this.deps.clock.now()),this.deps.emit({type:"response.done",turnId:this.deps.turnId}),this.deps.onComplete())}finishError(e,n){this.settled||(this.settled=!0,this.absorbPending=null,this.resolveDispatched(),this.deps.controller.dispose(),this.reasonAbort.abort(),this.ttsStream?.cancel(),this.deps.emit({type:"error",turnId:this.deps.turnId,...this.deps.commandId!==void 0&&{commandId:this.deps.commandId},reason:e,message:n instanceof Error?n.message:String(n)}),this.deps.onComplete())}buildUserTurn(e,n){return{source:"voice",turnId:this.deps.turnId,sessionId:this.deps.sessionId,deviceId:this.deps.deviceId,text:e,startMs:this.deps.startMs,endMs:n,...this.deps.projectId!==void 0&&{projectId:this.deps.projectId}}}}});import{randomUUID as tm}from"node:crypto";var rm,nm,$n,Fi,Ea,Gx=v(()=>{"use strict";Ae();ki();op();Xb();aa();ap();up();Pi();Mp();qp();Kp();Xp();em();Bx();rm=6,nm=45e3,$n=class extends Error{constructor(e){super(e),this.name="ReasonerUnavailableError"}},Fi=class extends Error{constructor(e){super(e),this.name="VoiceUnavailableError"}},Ea=class{deps;sessionId;deviceId;projectId;queue=new sa;closed=!1;eventsConsumed=!1;inFlight=!1;reasoner=null;reasonerRoute=null;turnAbort=null;voiceTurn=null;voiceTurnFailed=!1;voiceEngines=null;clock;newTurnController;newSmartTurnInference;newFrameClassifier;newTurnEvaluator;newSegmenter;voiceIdentity;smartTurnInference=null;frameClassifier=null;turnEvaluator=void 0;newAddresseeEvaluator;addresseeEvaluator=void 0;absorbedFinals=[];floorState="engaged";asideDecayTimer=null;lastSpeechAtMs=0;constructor(e,n,i){this.deps=i,this.sessionId=e,this.deviceId=n.deviceId,this.projectId=n.projectId,this.clock=i.clock??new Ti,this.newSmartTurnInference=i.createSmartTurnInference??(()=>new Mi),this.newFrameClassifier=i.createFrameClassifier??(()=>new Ai(new br)),this.newTurnEvaluator=i.createTurnEvaluator??(r=>new bn(r)),this.newAddresseeEvaluator=i.createAddresseeEvaluator??(r=>new hn(r)),this.newTurnController=i.createTurnController??(r=>{let o=this.ensureFrameClassifier();return o.reset?.(),new ji(r,this.ensureSmartTurnInference(),{},this.speechObservingClassifier(o),this.semanticHook())}),this.newSegmenter=i.createSegmenter??(()=>new Ii),this.voiceIdentity=i.voiceIdentity??Qp,this.emit({type:"session.ready"})}async send(e){let{commandId:n}=e;if(this.closed)throw new Le(n,"closed");if(e.sessionId!==this.sessionId)throw new Le(n,"invalid","command sessionId does not match session");switch(e.type){case"input.text":this.acceptTextInput(e);return;case"input.audio.frame":this.acceptAudioFrame(e);return;case"input.audio.end":this.endAudioInput(e);return;case"turn.cancel":this.cancelTurn(e);return;case"session.close":return this.close();case"approval.resolve":throw new Le(n,"unsupported");default:throw new Le(n,"invalid")}}events(){if(this.eventsConsumed)throw new Error("CoreSession.events() supports a single consumer in v0.1");return this.eventsConsumed=!0,this.queue.drain()}close(){if(!this.closed){this.closed=!0,this.turnAbort?.abort(),this.voiceTurn?.cancel(),this.asideDecayTimer!==null&&(this.clock.clearTimer(this.asideDecayTimer),this.asideDecayTimer=null);let e=this.smartTurnInference;this.smartTurnInference=null;let n=this.frameClassifier;this.frameClassifier=null;let i=this.turnEvaluator;this.turnEvaluator=null;let r=this.addresseeEvaluator;this.addresseeEvaluator=null,this.queue.close();let o=[];if(e&&o.push(e.dispose().catch(()=>{})),n?.dispose&&o.push(n.dispose().catch(()=>{})),i?.dispose&&o.push(i.dispose().catch(()=>{})),r?.dispose&&o.push(r.dispose().catch(()=>{})),o.length>0)return Promise.all(o).then(()=>{})}return Promise.resolve()}acceptTextInput(e){if(e.text.trim().length===0)throw new Le(e.commandId,"invalid","input.text requires non-empty text");if(this.inFlight)throw new Le(e.commandId,"backpressured","a turn is already in progress (one turn at a time in v0.1)");this.inFlight=!0,this.exitAside("explicit");let n=tm();this.emit({type:"turn.accepted",turnId:n,clientTurnId:e.clientTurnId,source:"text",commandId:e.commandId}),this.emit({type:"turn.final",turnId:n,turn:this.toTextUserTurn(n,e),commandId:e.commandId}),this.runTextTurn(n,e)}async runTextTurn(e,n){let i=new AbortController;this.turnAbort=i;try{let r=this.ensureReasoner();this.emit({type:"state",turnId:e,state:"responding"});for await(let o of r.run(n.text,i.signal))this.emit({type:"response.delta",turnId:e,text:o.text});this.emit({type:"response.done",turnId:e})}catch(r){let o=r instanceof $n?"no_text_route":"turn_failed";this.emit({type:"error",turnId:e,commandId:n.commandId,reason:o,message:r instanceof Error?r.message:String(r)})}finally{this.inFlight=!1,this.turnAbort=null}}acceptAudioFrame(e){if(this.voiceTurn){this.voiceTurn.pushFrame(e.audio,e.atMs);return}if(this.voiceTurnFailed)return;if(this.inFlight)throw new Le(e.commandId,"backpressured","a turn is already in progress (one turn at a time in v0.1)");this.inFlight=!0;let n=tm();this.emit({type:"turn.accepted",turnId:n,clientTurnId:e.clientTurnId,source:"voice",commandId:e.commandId});let i=this.resolveVoicePipeline(n,e.commandId);if(!i){this.voiceTurnFailed=!0;return}let r=this.addresseeHook();this.voiceTurn=new ka({turnId:n,sessionId:this.sessionId,deviceId:this.deviceId,...this.projectId!==void 0&&{projectId:this.projectId},commandId:e.commandId,startMs:e.atMs,asrEngine:i.engines.asrEngine,ttsEngine:i.engines.ttsEngine,voice:this.voiceIdentity,reasoner:i.reasoner,controller:this.newTurnController(this.clock),segmenter:this.newSegmenter(),clock:this.clock,emit:o=>this.emit(o),...r!==void 0&&{addressee:r},onComplete:()=>this.completeVoiceTurn()}),this.smartTurnInference?.prewarm?.(),this.frameClassifier?.prewarm?.(),this.voiceTurn.pushFrame(e.audio,e.atMs)}endAudioInput(e){if(this.voiceTurnFailed){this.resetVoiceFailure();return}if(this.voiceTurn){this.voiceTurn.endAudio(e.atMs);return}this.exitAside("explicit")}cancelTurn(e){if(this.voiceTurnFailed){this.resetVoiceFailure();return}this.voiceTurn?.cancel()}completeVoiceTurn(){this.voiceTurn=null,this.inFlight=!1}resetVoiceFailure(){this.voiceTurnFailed=!1}resolveVoicePipeline(e,n){let i;try{i=this.ensureVoiceEngines()}catch(o){return this.emitTurnError(e,n,"no_voice_route",o),null}let r;try{r=this.ensureReasoner()}catch(o){let s=o instanceof $n?"no_text_route":"turn_failed";return this.emitTurnError(e,n,s,o),null}return{engines:i,reasoner:r}}ensureVoiceEngines(){if(this.voiceEngines)return this.voiceEngines;if(!this.deps.voiceRegistry)throw new Fi("voice is not available in this core build");let e=this.deps.configService.resolved(),n=e.routes?.stt,i=e.routes?.tts;if(!n||!i)throw new Fi("no voice route configured - run 'jarvis init' to set routes.stt and routes.tts");let r=e.secrets?.[n.provider],o=e.secrets?.[i.provider];if(!r||!o){let u=r?i.provider:n.provider;throw new Fi(`no API key for voice provider '${u}' - run 'jarvis init' to add it`)}let s=this.deps.voiceRegistry.asrEngine({provider:n.provider,model:n.model},r),a=this.deps.voiceRegistry.ttsEngine({provider:i.provider,model:i.model},o);return this.voiceEngines={asrEngine:s,ttsEngine:a},this.voiceEngines}ensureSmartTurnInference(){return this.smartTurnInference??=this.newSmartTurnInference(),this.smartTurnInference}ensureFrameClassifier(){return this.frameClassifier??=this.newFrameClassifier(),this.frameClassifier}semanticHook(){if(this.turnEvaluator===void 0){let n=this.reasonerRoute;this.turnEvaluator=n?.provider==="anthropic"?this.newTurnEvaluator(n.key):null}return this.turnEvaluator===null?void 0:{evaluator:this.turnEvaluator,recentTurns:()=>{let n=[];for(let i of this.reasoner?.historySnapshot()??[])(i.role==="user"||i.role==="assistant")&&n.push({role:i.role,text:i.content});return n.slice(-rm)}}}addresseeHook(){if(this.addresseeEvaluator===void 0){let n=this.reasonerRoute;try{this.addresseeEvaluator=n?.provider==="anthropic"?this.newAddresseeEvaluator(n.key):null}catch(i){this.addresseeEvaluator=null,B.debug("addressee evaluator construction failed - the layer is absent",{error:i instanceof Error?i.message:String(i)})}}return this.addresseeEvaluator===null?void 0:{evaluator:this.addresseeEvaluator,recentTurns:()=>this.addresseeContext(),onAbsorbed:(n,i)=>{this.recordAbsorbedFinal(n),this.noteSpeech(),i?.verdict==="to_other"&&i.confidence>=Sa&&this.enterAside(i.confidence)},floorState:()=>this.floorState,onFloorReleased:n=>this.exitAside(n)}}enterAside(e){this.floorState!=="aside"&&(this.floorState="aside",this.noteSpeech(),this.armAsideDecay(nm),B.debug("aside entered - confident to_other; utterances now absorb by default",{confidence:e}),this.emit({type:"state",state:"aside"}))}exitAside(e){this.floorState==="aside"&&(this.floorState="engaged",this.asideDecayTimer!==null&&(this.clock.clearTimer(this.asideDecayTimer),this.asideDecayTimer=null),B.debug("aside exited",{reason:e}))}armAsideDecay(e){this.asideDecayTimer!==null&&this.clock.clearTimer(this.asideDecayTimer),this.asideDecayTimer=this.clock.setTimer(e,()=>this.asideDecayElapsed())}asideDecayElapsed(){if(this.asideDecayTimer=null,this.floorState!=="aside")return;let e=this.clock.now()-this.lastSpeechAtMs;e>=nm?this.exitAside("decay"):this.armAsideDecay(nm-e)}noteSpeech(){this.lastSpeechAtMs=this.clock.now()}speechObservingClassifier(e){return{classify:(n,i)=>e.classify(n,r=>{r&&this.noteSpeech(),i(r)})}}addresseeContext(){let e=this.reasoner?.historySnapshot()??[],n=[],i=0;for(let r=0;r<=e.length;r++){for(;i<this.absorbedFinals.length&&this.absorbedFinals[i].afterHistoryLen===r;)n.push({role:"user",text:this.absorbedFinals[i].text}),i+=1;let o=e[r];o&&(o.role==="user"||o.role==="assistant")&&n.push({role:o.role,text:o.content})}return n.slice(-rm)}recordAbsorbedFinal(e){this.absorbedFinals.push({afterHistoryLen:this.reasoner?.historySnapshot().length??0,text:e}),this.absorbedFinals.length>rm&&this.absorbedFinals.shift()}ensureReasoner(){if(this.reasoner)return this.reasoner;let e=this.deps.configService.resolved(),n=e.routes?.text;if(!n)throw new $n("no text model is configured - run 'jarvis init' to set routes.text");let i=e.secrets?.[n.provider];if(!i)throw new $n(`no API key for text provider '${n.provider}' - run 'jarvis init' to add it`);let r=this.deps.registry.textAdapter({provider:n.provider,model:n.model},i);return this.reasoner=new Ei(r,n.model,this.deps.systemPrompt),this.reasonerRoute={provider:n.provider,key:i},this.reasoner}toTextUserTurn(e,n){return{source:"text",turnId:e,sessionId:this.sessionId,deviceId:this.deviceId,text:n.text,atMs:n.atMs,...this.projectId!==void 0&&{projectId:this.projectId}}}emitTurnError(e,n,i,r){this.emit({type:"error",turnId:e,commandId:n,reason:i,message:r instanceof Error?r.message:String(r)}),this.inFlight=!1}emit(e){this.queue.push({...e,sessionId:this.sessionId,eventId:tm(),atMs:Date.now()})}}});function Ia(t){try{let e=JSON.parse(t);return typeof e=="object"&&e!==null?e:void 0}catch{return}}function im(t){return typeof t=="string"?t:""}function Ta(t){let e=t.message_type;return typeof e=="string"&&(qO.has(e)||e.endsWith("_error"))?e:typeof t.error=="string"&&t.error.length>0?"error":null}function Wx(t){return Buffer.from(t).toString("base64")}function qx(t){return new Uint8Array(Buffer.from(t,"base64"))}function Oa(t,e){return new Error(`${t} connection error: ${e.message}`)}var qO,om=v(()=>{"use strict";qO=new Set(["error","auth_error","quota_exceeded","rate_limited"])});function HO(t,e,n){let i=new URL(t);i.searchParams.set("model_id",e),i.searchParams.set("audio_format",JO(n)),i.searchParams.set("commit_strategy","manual"),n.language&&i.searchParams.set("language_code",n.language);for(let r of n.biasTerms??[])i.searchParams.append("keyterms",r);return i.toString()}function JO(t){return t.encoding==="pcm_s16le"?`pcm_${t.sampleRate}`:"pcm_16000"}var Hx,Vi,sm,am=v(()=>{"use strict";om();Hx="wss://api.elevenlabs.io/v1/speech-to-text/realtime",Vi=class{apiKey;socketFactory;model;endpoint;id="elevenlabs-scribe";constructor(e,n,i,r=Hx){this.apiKey=e,this.socketFactory=n,this.model=i,this.endpoint=r}open(e){return new sm(this.apiKey,this.socketFactory,this.model,this.endpoint,e)}},sm=class{opts;socket;opened=!1;aborted=!1;closed=!1;pending=[];committed=[];transcriptCb;errorCb;endPending=null;commitRequested=!1;constructor(e,n,i,r,o){this.opts=o,this.socket=n(HO(r,i,o),{"xi-api-key":e}),this.socket.onOpen(()=>this.handleOpen()),this.socket.onMessage(s=>this.handleMessage(s)),this.socket.onError(s=>this.handleError(s)),this.socket.onClose(()=>this.handleClose())}pushAudio(e){if(!(this.aborted||this.closed||this.commitRequested)){if(!this.opened){this.pending.push(e);return}this.sendChunk(e,!1)}}onTranscript(e){this.transcriptCb=e}onError(e){this.errorCb=e}end(){return this.aborted?Promise.reject(new Error("ASR stream already aborted")):this.endPending?Promise.reject(new Error("ASR end() already in progress")):new Promise((e,n)=>{this.endPending={resolve:e,reject:n},this.commitRequested=!0,this.opened&&this.sendCommit()})}abort(){if(this.aborted=!0,this.endPending){let{reject:e}=this.endPending;this.endPending=null,e(new Error("ASR stream aborted"))}return this.teardown(),Promise.resolve()}handleOpen(){if(!(this.aborted||this.closed)){this.opened=!0;for(let e of this.pending)this.sendChunk(e,!1);this.pending.length=0,this.commitRequested&&this.sendCommit()}}handleMessage(e){if(this.aborted||this.closed)return;let n=Ia(e);if(!n)return;let i=Ta(n);if(i){this.handleError(new Error(`stream error (${i})`));return}let r=n.message_type;if(r==="partial_transcript"){this.opts.emitPartials&&this.transcriptCb?.({text:im(n.text),isFinal:!1,startMs:0});return}if(r==="committed_transcript"||r==="committed_transcript_with_timestamps"){let o=im(n.text);o.length>0&&this.committed.push(o),this.endPending&&this.resolveEnd()}}handleError(e){if(this.closed)return;let n=Oa("ElevenLabs ASR",e);if(this.endPending){let{reject:i}=this.endPending;this.endPending=null,i(n)}this.errorCb?.(n),this.teardown()}handleClose(){if(this.closed)return;this.closed=!0;let e=new Error("ElevenLabs ASR connection closed unexpectedly");if(this.endPending){let{reject:n}=this.endPending;this.endPending=null,n(e)}this.errorCb?.(e)}resolveEnd(){if(!this.endPending)return;let e={text:this.committed.join(" ").trim(),isFinal:!0,startMs:0};this.transcriptCb?.(e);let{resolve:n}=this.endPending;this.endPending=null,this.teardown(),n(e)}sendChunk(e,n){this.socket.send(JSON.stringify({message_type:"input_audio_chunk",audio_base_64:Wx(e),commit:n,sample_rate:this.opts.sampleRate}))}sendCommit(){this.sendChunk(new Uint8Array(0),!0)}teardown(){this.closed||(this.closed=!0,this.socket.close())}}});import{randomUUID as KO}from"node:crypto";function XO(t,e){let n=t.engineVoice[e];if(!n)throw new Error(`voice '${t.id}' has no '${e}' engineVoice mapping`);if(n.kind!=="preset")throw new Error(`the ${e} adapter needs a preset voiceId for '${t.id}', got kind '${n.kind}'`);return n.voiceId}function QO(t,e,n,i){let r=new URL(t.replace("{voice_id}",encodeURIComponent(e)));return r.searchParams.set("model_id",n),r.searchParams.set("output_format",eA(i)),r.searchParams.set("auto_mode","true"),r.toString()}function eA(t){return t.encoding==="pcm_s16le"?`pcm_${t.sampleRate}`:"pcm_16000"}var Jx,YO,Zi,um,cm=v(()=>{"use strict";om();Jx="wss://api.elevenlabs.io/v1/text-to-speech/{voice_id}/multi-stream-input",YO={stability:.5,similarity_boost:.75,use_speaker_boost:!0},Zi=class{apiKey;socketFactory;model;endpointTemplate;id="elevenlabs-flash";constructor(e,n,i,r=Jx){this.apiKey=e,this.socketFactory=n,this.model=i,this.endpointTemplate=r}speak(e){return new um(this.apiKey,this.socketFactory,this.model,this.endpointTemplate,this.id,e)}},um=class{socket;contextId=KO();opened=!1;cancelled=!1;closed=!1;endRequested=!1;closeContextSent=!1;pending=[];audioCb;errorCb;endPending=null;constructor(e,n,i,r,o,s){let a=XO(s.voice,o);this.socket=n(QO(r,a,i,s),{"xi-api-key":e}),this.socket.onOpen(()=>this.handleOpen()),this.socket.onMessage(u=>this.handleMessage(u)),this.socket.onError(u=>this.handleError(u)),this.socket.onClose(()=>this.handleClose())}pushText(e){if(!(this.cancelled||this.closed||this.endRequested)){if(!this.opened){this.pending.push(e);return}this.sendText(e)}}onAudio(e){this.audioCb=e}onError(e){this.errorCb=e}end(){return this.cancelled||this.closed?Promise.resolve():this.endPending?Promise.reject(new Error("TTS end() already in progress")):new Promise((e,n)=>{this.endPending={resolve:e,reject:n},this.endRequested=!0,this.opened&&this.sendEndOfContext()})}cancel(){if(this.cancelled||this.closed)return this.cancelled=!0,Promise.resolve();if(this.cancelled=!0,this.endPending){let{resolve:e}=this.endPending;this.endPending=null,e()}return this.opened&&this.sendCloseContext(),this.teardown(),Promise.resolve()}handleOpen(){if(!(this.cancelled||this.closed)){this.opened=!0,this.sendInit();for(let e of this.pending)this.sendText(e);this.pending.length=0,this.endRequested&&this.sendEndOfContext()}}handleMessage(e){if(this.cancelled||this.closed)return;let n=Ia(e);if(!n)return;let i=Ta(n);if(i){this.handleError(new Error(`stream error (${i})`));return}typeof n.audio=="string"&&n.audio.length>0&&this.audioCb?.(qx(n.audio)),(n.isFinal===!0||n.is_final===!0)&&this.resolveEnd()}handleError(e){if(this.closed)return;let n=Oa("ElevenLabs TTS",e);if(this.endPending){let{reject:i}=this.endPending;this.endPending=null,i(n)}this.errorCb?.(n),this.teardown()}handleClose(){if(this.closed)return;this.closed=!0;let e=new Error("ElevenLabs TTS connection closed unexpectedly");if(this.endPending){let{reject:n}=this.endPending;this.endPending=null,n(e)}this.errorCb?.(e)}resolveEnd(){if(!this.endPending)return;let{resolve:e}=this.endPending;this.endPending=null,this.teardown(),e()}sendInit(){this.socket.send(JSON.stringify({text:" ",voice_settings:YO,context_id:this.contextId}))}sendText(e){let n=e.endsWith(" ")?e:`${e} `;this.socket.send(JSON.stringify({text:n,context_id:this.contextId}))}sendEndOfContext(){this.sendFlush(),this.sendCloseContext()}sendFlush(){this.socket.send(JSON.stringify({context_id:this.contextId,text:"",flush:!0}))}sendCloseContext(){this.closeContextSent||(this.closeContextSent=!0,this.socket.send(JSON.stringify({context_id:this.contextId,close_context:!0})))}teardown(){this.closed||(this.closed=!0,this.socket.close())}}});var kt=z((E2,Xx)=>{"use strict";var Kx=["nodebuffer","arraybuffer","fragments"],Yx=typeof Blob<"u";Yx&&Kx.push("blob");Xx.exports={BINARY_TYPES:Kx,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Yx,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Bi=z((I2,Aa)=>{"use strict";var{EMPTY_BUFFER:tA}=kt(),lm=Buffer[Symbol.species];function rA(t,e){if(t.length===0)return tA;if(t.length===1)return t[0];let n=Buffer.allocUnsafe(e),i=0;for(let r=0;r<t.length;r++){let o=t[r];n.set(o,i),i+=o.length}return i<e?new lm(n.buffer,n.byteOffset,i):n}function Qx(t,e,n,i,r){for(let o=0;o<r;o++)n[i+o]=t[o]^e[o&3]}function ew(t,e){for(let n=0;n<t.length;n++)t[n]^=e[n&3]}function nA(t){return t.length===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.length)}function dm(t){if(dm.readOnly=!0,Buffer.isBuffer(t))return t;let e;return t instanceof ArrayBuffer?e=new lm(t):ArrayBuffer.isView(t)?e=new lm(t.buffer,t.byteOffset,t.byteLength):(e=Buffer.from(t),dm.readOnly=!1),e}Aa.exports={concat:rA,mask:Qx,toArrayBuffer:nA,toBuffer:dm,unmask:ew};if(!process.env.WS_NO_BUFFER_UTIL)try{let t=ae("bufferutil");Aa.exports.mask=function(e,n,i,r,o){o<48?Qx(e,n,i,r,o):t.mask(e,n,i,r,o)},Aa.exports.unmask=function(e,n){e.length<32?ew(e,n):t.unmask(e,n)}}catch{}});var nw=z((T2,rw)=>{"use strict";var tw=Symbol("kDone"),fm=Symbol("kRun"),hm=class{constructor(e){this[tw]=()=>{this.pending--,this[fm]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[fm]()}[fm](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[tw])}}};rw.exports=hm});var Sn=z((O2,aw)=>{"use strict";var Gi=ae("zlib"),iw=Bi(),iA=nw(),{kStatusCode:ow}=kt(),oA=Buffer[Symbol.species],sA=Buffer.from([0,0,255,255]),Ca=Symbol("permessage-deflate"),Et=Symbol("total-length"),xn=Symbol("callback"),Xt=Symbol("buffers"),wn=Symbol("error"),Pa,pm=class{constructor(e){if(this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!Pa){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Pa=new iA(n)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[xn];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let n=this._options,i=e.find(r=>!(n.serverNoContextTakeover===!1&&r.server_no_context_takeover||r.server_max_window_bits&&(n.serverMaxWindowBits===!1||typeof n.serverMaxWindowBits=="number"&&n.serverMaxWindowBits>r.server_max_window_bits)||typeof n.clientMaxWindowBits=="number"&&!r.client_max_window_bits));if(!i)throw new Error("None of the extension offers can be accepted");return n.serverNoContextTakeover&&(i.server_no_context_takeover=!0),n.clientNoContextTakeover&&(i.client_no_context_takeover=!0),typeof n.serverMaxWindowBits=="number"&&(i.server_max_window_bits=n.serverMaxWindowBits),typeof n.clientMaxWindowBits=="number"?i.client_max_window_bits=n.clientMaxWindowBits:(i.client_max_window_bits===!0||n.clientMaxWindowBits===!1)&&delete i.client_max_window_bits,i}acceptAsClient(e){let n=e[0];if(this._options.clientNoContextTakeover===!1&&n.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!n.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(n.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&n.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return n}normalizeParams(e){return e.forEach(n=>{Object.keys(n).forEach(i=>{let r=n[i];if(r.length>1)throw new Error(`Parameter "${i}" must have only a single value`);if(r=r[0],i==="client_max_window_bits"){if(r!==!0){let o=+r;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${i}": ${r}`);r=o}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${i}": ${r}`)}else if(i==="server_max_window_bits"){let o=+r;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${i}": ${r}`);r=o}else if(i==="client_no_context_takeover"||i==="server_no_context_takeover"){if(r!==!0)throw new TypeError(`Invalid value for parameter "${i}": ${r}`)}else throw new Error(`Unknown parameter "${i}"`);n[i]=r})}),e}decompress(e,n,i){Pa.add(r=>{this._decompress(e,n,(o,s)=>{r(),i(o,s)})})}compress(e,n,i){Pa.add(r=>{this._compress(e,n,(o,s)=>{r(),i(o,s)})})}_decompress(e,n,i){let r=this._isServer?"client":"server";if(!this._inflate){let o=`${r}_max_window_bits`,s=typeof this.params[o]!="number"?Gi.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=Gi.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[Ca]=this,this._inflate[Et]=0,this._inflate[Xt]=[],this._inflate.on("error",uA),this._inflate.on("data",sw)}this._inflate[xn]=i,this._inflate.write(e),n&&this._inflate.write(sA),this._inflate.flush(()=>{let o=this._inflate[wn];if(o){this._inflate.close(),this._inflate=null,i(o);return}let s=iw.concat(this._inflate[Xt],this._inflate[Et]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Et]=0,this._inflate[Xt]=[],n&&this.params[`${r}_no_context_takeover`]&&this._inflate.reset()),i(null,s)})}_compress(e,n,i){let r=this._isServer?"server":"client";if(!this._deflate){let o=`${r}_max_window_bits`,s=typeof this.params[o]!="number"?Gi.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=Gi.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[Et]=0,this._deflate[Xt]=[],this._deflate.on("data",aA)}this._deflate[xn]=i,this._deflate.write(e),this._deflate.flush(Gi.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=iw.concat(this._deflate[Xt],this._deflate[Et]);n&&(o=new oA(o.buffer,o.byteOffset,o.length-4)),this._deflate[xn]=null,this._deflate[Et]=0,this._deflate[Xt]=[],n&&this.params[`${r}_no_context_takeover`]&&this._deflate.reset(),i(null,o)})}};aw.exports=pm;function aA(t){this[Xt].push(t),this[Et]+=t.length}function sw(t){if(this[Et]+=t.length,this[Ca]._maxPayload<1||this[Et]<=this[Ca]._maxPayload){this[Xt].push(t);return}this[wn]=new RangeError("Max payload size exceeded"),this[wn].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[wn][ow]=1009,this.removeListener("data",sw),this.reset()}function uA(t){if(this[Ca]._inflate=null,this[wn]){this[xn](this[wn]);return}t[ow]=1007,this[xn](t)}});var kn=z((A2,za)=>{"use strict";var{isUtf8:uw}=ae("buffer"),{hasBlob:cA}=kt(),lA=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function dA(t){return t>=1e3&&t<=1014&&t!==1004&&t!==1005&&t!==1006||t>=3e3&&t<=4999}function mm(t){let e=t.length,n=0;for(;n<e;)if((t[n]&128)===0)n++;else if((t[n]&224)===192){if(n+1===e||(t[n+1]&192)!==128||(t[n]&254)===192)return!1;n+=2}else if((t[n]&240)===224){if(n+2>=e||(t[n+1]&192)!==128||(t[n+2]&192)!==128||t[n]===224&&(t[n+1]&224)===128||t[n]===237&&(t[n+1]&224)===160)return!1;n+=3}else if((t[n]&248)===240){if(n+3>=e||(t[n+1]&192)!==128||(t[n+2]&192)!==128||(t[n+3]&192)!==128||t[n]===240&&(t[n+1]&240)===128||t[n]===244&&t[n+1]>143||t[n]>244)return!1;n+=4}else return!1;return!0}function fA(t){return cA&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&(t[Symbol.toStringTag]==="Blob"||t[Symbol.toStringTag]==="File")}za.exports={isBlob:fA,isValidStatusCode:dA,isValidUTF8:mm,tokenChars:lA};if(uw)za.exports.isValidUTF8=function(t){return t.length<24?mm(t):uw(t)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let t=ae("utf-8-validate");za.exports.isValidUTF8=function(e){return e.length<32?mm(e):t(e)}}catch{}});var bm=z((P2,mw)=>{"use strict";var{Writable:hA}=ae("stream"),cw=Sn(),{BINARY_TYPES:pA,EMPTY_BUFFER:lw,kStatusCode:mA,kWebSocket:gA}=kt(),{concat:gm,toArrayBuffer:vA,unmask:yA}=Bi(),{isValidStatusCode:_A,isValidUTF8:dw}=kn(),Ra=Buffer[Symbol.species],Qe=0,fw=1,hw=2,pw=3,vm=4,ym=5,Na=6,_m=class extends hA{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||pA[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxBufferedChunks=e.maxBufferedChunks|0,this._maxFragments=e.maxFragments|0,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[gA]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=Qe}_write(e,n,i){if(this._opcode===8&&this._state==Qe)return i();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){i(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(i)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let i=this._buffers[0];return this._buffers[0]=new Ra(i.buffer,i.byteOffset+e,i.length-e),new Ra(i.buffer,i.byteOffset,e)}let n=Buffer.allocUnsafe(e);do{let i=this._buffers[0],r=n.length-e;e>=i.length?n.set(this._buffers.shift(),r):(n.set(new Uint8Array(i.buffer,i.byteOffset,e),r),this._buffers[0]=new Ra(i.buffer,i.byteOffset+e,i.length-e)),e-=i.length}while(e>0);return n}startLoop(e){this._loop=!0;do switch(this._state){case Qe:this.getInfo(e);break;case fw:this.getPayloadLength16(e);break;case hw:this.getPayloadLength64(e);break;case pw:this.getMask();break;case vm:this.getData(e);break;case ym:case Na:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let n=this.consume(2);if((n[0]&48)!==0){let r=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(r);return}let i=(n[0]&64)===64;if(i&&!this._extensions[cw.extensionName]){let r=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(r);return}if(this._fin=(n[0]&128)===128,this._opcode=n[0]&15,this._payloadLength=n[1]&127,this._opcode===0){if(i){let r=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(r);return}if(!this._fragmented){let r=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(r);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let r=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(r);return}this._compressed=i}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let r=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(r);return}if(i){let r=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(r);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let r=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(r);return}}else{let r=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(r);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(n[1]&128)===128,this._isServer){if(!this._masked){let r=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(r);return}}else if(this._masked){let r=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(r);return}this._payloadLength===126?this._state=fw:this._payloadLength===127?this._state=hw:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let n=this.consume(8),i=n.readUInt32BE(0);if(i>Math.pow(2,21)-1){let r=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(r);return}this._payloadLength=i*Math.pow(2,32)+n.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let n=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(n);return}this._masked?this._state=pw:this._state=vm}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=vm}getData(e){let n=lw;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}n=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&yA(n,this._mask)}if(this._opcode>7){this.controlMessage(n,e);return}if(this._compressed){this._state=ym,this.decompress(n,e);return}if(n.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let i=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");e(i);return}this._messageLength=this._totalPayloadLength,this._fragments.push(n)}this.dataMessage(e)}decompress(e,n){this._extensions[cw.extensionName].decompress(e,this._fin,(r,o)=>{if(r)return n(r);if(o.length){if(this._messageLength+=o.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let s=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");n(s);return}if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let s=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");n(s);return}this._fragments.push(o)}this.dataMessage(n),this._state===Qe&&this.startLoop(n)})}dataMessage(e){if(!this._fin){this._state=Qe;return}let n=this._messageLength,i=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let r;this._binaryType==="nodebuffer"?r=gm(i,n):this._binaryType==="arraybuffer"?r=vA(gm(i,n)):this._binaryType==="blob"?r=new Blob(i):r=i,this._allowSynchronousEvents?(this.emit("message",r,!0),this._state=Qe):(this._state=Na,setImmediate(()=>{this.emit("message",r,!0),this._state=Qe,this.startLoop(e)}))}else{let r=gm(i,n);if(!this._skipUTF8Validation&&!dw(r)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(o);return}this._state===ym||this._allowSynchronousEvents?(this.emit("message",r,!1),this._state=Qe):(this._state=Na,setImmediate(()=>{this.emit("message",r,!1),this._state=Qe,this.startLoop(e)}))}}controlMessage(e,n){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,lw),this.end();else{let i=e.readUInt16BE(0);if(!_A(i)){let o=this.createError(RangeError,`invalid status code ${i}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");n(o);return}let r=new Ra(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!dw(r)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");n(o);return}this._loop=!1,this.emit("conclude",i,r),this.end()}this._state=Qe;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=Qe):(this._state=Na,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=Qe,this.startLoop(n)}))}createError(e,n,i,r,o){this._loop=!1,this._errored=!0;let s=new e(i?`Invalid WebSocket frame: ${n}`:n);return Error.captureStackTrace(s,this.createError),s.code=o,s[mA]=r,s}};mw.exports=_m});var wm=z((z2,yw)=>{"use strict";var{Duplex:C2}=ae("stream"),{randomFillSync:bA}=ae("crypto"),{types:{isUint8Array:$A}}=ae("util"),gw=Sn(),{EMPTY_BUFFER:xA,kWebSocket:wA,NOOP:SA}=kt(),{isBlob:En,isValidStatusCode:kA}=kn(),{mask:vw,toBuffer:xr}=Bi(),et=Symbol("kByteLength"),EA=Buffer.alloc(4),Da=8*1024,wr,In=Da,ct=0,IA=1,TA=2,$m=class t{constructor(e,n,i){this._extensions=n||{},i&&(this._generateMask=i,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=ct,this.onerror=SA,this[wA]=void 0}static frame(e,n){let i,r=!1,o=2,s=!1;n.mask&&(i=n.maskBuffer||EA,n.generateMask?n.generateMask(i):(In===Da&&(wr===void 0&&(wr=Buffer.alloc(Da)),bA(wr,0,Da),In=0),i[0]=wr[In++],i[1]=wr[In++],i[2]=wr[In++],i[3]=wr[In++]),s=(i[0]|i[1]|i[2]|i[3])===0,o=6);let a;typeof e=="string"?(!n.mask||s)&&n[et]!==void 0?a=n[et]:(e=Buffer.from(e),a=e.length):(a=e.length,r=n.mask&&n.readOnly&&!s);let u=a;a>=65536?(o+=8,u=127):a>125&&(o+=2,u=126);let c=Buffer.allocUnsafe(r?a+o:o);return c[0]=n.fin?n.opcode|128:n.opcode,n.rsv1&&(c[0]|=64),c[1]=u,u===126?c.writeUInt16BE(a,2):u===127&&(c[2]=c[3]=0,c.writeUIntBE(a,4,6)),n.mask?(c[1]|=128,c[o-4]=i[0],c[o-3]=i[1],c[o-2]=i[2],c[o-1]=i[3],s?[c,e]:r?(vw(e,i,c,o,a),[c]):(vw(e,i,e,0,a),[c,e])):[c,e]}close(e,n,i,r){let o;if(e===void 0)o=xA;else{if(typeof e!="number"||!kA(e))throw new TypeError("First argument must be a valid error code number");if(n===void 0||!n.length)o=Buffer.allocUnsafe(2),o.writeUInt16BE(e,0);else{let a=Buffer.byteLength(n);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");if(o=Buffer.allocUnsafe(2+a),o.writeUInt16BE(e,0),typeof n=="string")o.write(n,2);else if($A(n))o.set(n,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let s={[et]:o.length,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==ct?this.enqueue([this.dispatch,o,!1,s,r]):this.sendFrame(t.frame(o,s),r)}ping(e,n,i){let r,o;if(typeof e=="string"?(r=Buffer.byteLength(e),o=!1):En(e)?(r=e.size,o=!1):(e=xr(e),r=e.length,o=xr.readOnly),r>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[et]:r,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};En(e)?this._state!==ct?this.enqueue([this.getBlobData,e,!1,s,i]):this.getBlobData(e,!1,s,i):this._state!==ct?this.enqueue([this.dispatch,e,!1,s,i]):this.sendFrame(t.frame(e,s),i)}pong(e,n,i){let r,o;if(typeof e=="string"?(r=Buffer.byteLength(e),o=!1):En(e)?(r=e.size,o=!1):(e=xr(e),r=e.length,o=xr.readOnly),r>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[et]:r,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};En(e)?this._state!==ct?this.enqueue([this.getBlobData,e,!1,s,i]):this.getBlobData(e,!1,s,i):this._state!==ct?this.enqueue([this.dispatch,e,!1,s,i]):this.sendFrame(t.frame(e,s),i)}send(e,n,i){let r=this._extensions[gw.extensionName],o=n.binary?2:1,s=n.compress,a,u;typeof e=="string"?(a=Buffer.byteLength(e),u=!1):En(e)?(a=e.size,u=!1):(e=xr(e),a=e.length,u=xr.readOnly),this._firstFragment?(this._firstFragment=!1,s&&r&&r.params[r._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(s=a>=r._threshold),this._compress=s):(s=!1,o=0),n.fin&&(this._firstFragment=!0);let c={[et]:a,fin:n.fin,generateMask:this._generateMask,mask:n.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:u,rsv1:s};En(e)?this._state!==ct?this.enqueue([this.getBlobData,e,this._compress,c,i]):this.getBlobData(e,this._compress,c,i):this._state!==ct?this.enqueue([this.dispatch,e,this._compress,c,i]):this.dispatch(e,this._compress,c,i)}getBlobData(e,n,i,r){this._bufferedBytes+=i[et],this._state=TA,e.arrayBuffer().then(o=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(xm,this,a,r);return}this._bufferedBytes-=i[et];let s=xr(o);n?this.dispatch(s,n,i,r):(this._state=ct,this.sendFrame(t.frame(s,i),r),this.dequeue())}).catch(o=>{process.nextTick(OA,this,o,r)})}dispatch(e,n,i,r){if(!n){this.sendFrame(t.frame(e,i),r);return}let o=this._extensions[gw.extensionName];this._bufferedBytes+=i[et],this._state=IA,o.compress(e,i.fin,(s,a)=>{if(this._socket.destroyed){let u=new Error("The socket was closed while data was being compressed");xm(this,u,r);return}this._bufferedBytes-=i[et],this._state=ct,i.readOnly=!1,this.sendFrame(t.frame(a,i),r),this.dequeue()})}dequeue(){for(;this._state===ct&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][et],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][et],this._queue.push(e)}sendFrame(e,n){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],n),this._socket.uncork()):this._socket.write(e[0],n)}};yw.exports=$m;function xm(t,e,n){typeof n=="function"&&n(e);for(let i=0;i<t._queue.length;i++){let r=t._queue[i],o=r[r.length-1];typeof o=="function"&&o(e)}}function OA(t,e,n){xm(t,e,n),t.onerror(e)}});var Iw=z((R2,Ew)=>{"use strict";var{kForOnEventAttribute:Wi,kListener:Sm}=kt(),_w=Symbol("kCode"),bw=Symbol("kData"),$w=Symbol("kError"),xw=Symbol("kMessage"),ww=Symbol("kReason"),Tn=Symbol("kTarget"),Sw=Symbol("kType"),kw=Symbol("kWasClean"),It=class{constructor(e){this[Tn]=null,this[Sw]=e}get target(){return this[Tn]}get type(){return this[Sw]}};Object.defineProperty(It.prototype,"target",{enumerable:!0});Object.defineProperty(It.prototype,"type",{enumerable:!0});var Sr=class extends It{constructor(e,n={}){super(e),this[_w]=n.code===void 0?0:n.code,this[ww]=n.reason===void 0?"":n.reason,this[kw]=n.wasClean===void 0?!1:n.wasClean}get code(){return this[_w]}get reason(){return this[ww]}get wasClean(){return this[kw]}};Object.defineProperty(Sr.prototype,"code",{enumerable:!0});Object.defineProperty(Sr.prototype,"reason",{enumerable:!0});Object.defineProperty(Sr.prototype,"wasClean",{enumerable:!0});var On=class extends It{constructor(e,n={}){super(e),this[$w]=n.error===void 0?null:n.error,this[xw]=n.message===void 0?"":n.message}get error(){return this[$w]}get message(){return this[xw]}};Object.defineProperty(On.prototype,"error",{enumerable:!0});Object.defineProperty(On.prototype,"message",{enumerable:!0});var qi=class extends It{constructor(e,n={}){super(e),this[bw]=n.data===void 0?null:n.data}get data(){return this[bw]}};Object.defineProperty(qi.prototype,"data",{enumerable:!0});var AA={addEventListener(t,e,n={}){for(let r of this.listeners(t))if(!n[Wi]&&r[Sm]===e&&!r[Wi])return;let i;if(t==="message")i=function(o,s){let a=new qi("message",{data:s?o:o.toString()});a[Tn]=this,La(e,this,a)};else if(t==="close")i=function(o,s){let a=new Sr("close",{code:o,reason:s.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[Tn]=this,La(e,this,a)};else if(t==="error")i=function(o){let s=new On("error",{error:o,message:o.message});s[Tn]=this,La(e,this,s)};else if(t==="open")i=function(){let o=new It("open");o[Tn]=this,La(e,this,o)};else return;i[Wi]=!!n[Wi],i[Sm]=e,n.once?this.once(t,i):this.on(t,i)},removeEventListener(t,e){for(let n of this.listeners(t))if(n[Sm]===e&&!n[Wi]){this.removeListener(t,n);break}}};Ew.exports={CloseEvent:Sr,ErrorEvent:On,Event:It,EventTarget:AA,MessageEvent:qi};function La(t,e,n){typeof t=="object"&&t.handleEvent?t.handleEvent.call(t,n):t.call(e,n)}});var Ua=z((N2,Tw)=>{"use strict";var{tokenChars:Hi}=kn();function pt(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}function PA(t){let e=Object.create(null),n=Object.create(null),i=!1,r=!1,o=!1,s,a,u=-1,c=-1,l=-1,d=0;for(;d<t.length;d++)if(c=t.charCodeAt(d),s===void 0)if(l===-1&&Hi[c]===1)u===-1&&(u=d);else if(d!==0&&(c===32||c===9))l===-1&&u!==-1&&(l=d);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d);let h=t.slice(u,l);c===44?(pt(e,h,n),n=Object.create(null)):s=h,u=l=-1}else throw new SyntaxError(`Unexpected character at index ${d}`);else if(a===void 0)if(l===-1&&Hi[c]===1)u===-1&&(u=d);else if(c===32||c===9)l===-1&&u!==-1&&(l=d);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d),pt(n,t.slice(u,l),!0),c===44&&(pt(e,s,n),n=Object.create(null),s=void 0),u=l=-1}else if(c===61&&u!==-1&&l===-1)a=t.slice(u,d),u=l=-1;else throw new SyntaxError(`Unexpected character at index ${d}`);else if(r){if(Hi[c]!==1)throw new SyntaxError(`Unexpected character at index ${d}`);u===-1?u=d:i||(i=!0),r=!1}else if(o)if(Hi[c]===1)u===-1&&(u=d);else if(c===34&&u!==-1)o=!1,l=d;else if(c===92)r=!0;else throw new SyntaxError(`Unexpected character at index ${d}`);else if(c===34&&t.charCodeAt(d-1)===61)o=!0;else if(l===-1&&Hi[c]===1)u===-1&&(u=d);else if(u!==-1&&(c===32||c===9))l===-1&&(l=d);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d);let h=t.slice(u,l);i&&(h=h.replace(/\\/g,""),i=!1),pt(n,a,h),c===44&&(pt(e,s,n),n=Object.create(null),s=void 0),a=void 0,u=l=-1}else throw new SyntaxError(`Unexpected character at index ${d}`);if(u===-1||o||c===32||c===9)throw new SyntaxError("Unexpected end of input");l===-1&&(l=d);let f=t.slice(u,l);return s===void 0?pt(e,f,n):(a===void 0?pt(n,f,!0):i?pt(n,a,f.replace(/\\/g,"")):pt(n,a,f),pt(e,s,n)),e}function CA(t){return Object.keys(t).map(e=>{let n=t[e];return Array.isArray(n)||(n=[n]),n.map(i=>[e].concat(Object.keys(i).map(r=>{let o=i[r];return Array.isArray(o)||(o=[o]),o.map(s=>s===!0?r:`${r}=${s}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Tw.exports={format:CA,parse:PA}});var Va=z((U2,Mw)=>{"use strict";var zA=ae("events"),RA=ae("https"),NA=ae("http"),Pw=ae("net"),DA=ae("tls"),{randomBytes:LA,createHash:UA}=ae("crypto"),{Duplex:D2,Readable:L2}=ae("stream"),{URL:km}=ae("url"),Qt=Sn(),jA=bm(),MA=wm(),{isBlob:FA}=kn(),{BINARY_TYPES:Ow,CLOSE_TIMEOUT:VA,EMPTY_BUFFER:ja,GUID:ZA,kForOnEventAttribute:Em,kListener:BA,kStatusCode:GA,kWebSocket:ge,NOOP:Cw}=kt(),{EventTarget:{addEventListener:WA,removeEventListener:qA}}=Iw(),{format:HA,parse:JA}=Ua(),{toBuffer:KA}=Bi(),zw=Symbol("kAborted"),Im=[8,13],Tt=["CONNECTING","OPEN","CLOSING","CLOSED"],YA=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,re=class t extends zA{constructor(e,n,i){super(),this._binaryType=Ow[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=ja,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=t.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,n===void 0?n=[]:Array.isArray(n)||(typeof n=="object"&&n!==null?(i=n,n=[]):n=[n]),Rw(this,e,n,i)):(this._autoPong=i.autoPong,this._closeTimeout=i.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Ow.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,n,i){let r=new jA({allowSynchronousEvents:i.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:i.maxBufferedChunks,maxFragments:i.maxFragments,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation}),o=new MA(e,this._extensions,i.generateMask);this._receiver=r,this._sender=o,this._socket=e,r[ge]=this,o[ge]=this,e[ge]=this,r.on("conclude",eP),r.on("drain",tP),r.on("error",rP),r.on("message",nP),r.on("ping",iP),r.on("pong",oP),o.onerror=sP,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),n.length>0&&e.unshift(n),e.on("close",Lw),e.on("data",Fa),e.on("end",Uw),e.on("error",jw),this._readyState=t.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Qt.extensionName]&&this._extensions[Qt.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,n){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){We(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===t.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=t.CLOSING,this._sender.close(e,n,!this._isServer,i=>{i||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Dw(this)}}pause(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,n,i){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(i=e,e=n=void 0):typeof n=="function"&&(i=n,n=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Tm(this,e,i);return}n===void 0&&(n=!this._isServer),this._sender.ping(e||ja,n,i)}pong(e,n,i){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(i=e,e=n=void 0):typeof n=="function"&&(i=n,n=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Tm(this,e,i);return}n===void 0&&(n=!this._isServer),this._sender.pong(e||ja,n,i)}resume(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,n,i){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof n=="function"&&(i=n,n={}),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Tm(this,e,i);return}let r={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...n};this._extensions[Qt.extensionName]||(r.compress=!1),this._sender.send(e||ja,r,i)}terminate(){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){We(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=t.CLOSING,this._socket.destroy())}}};Object.defineProperty(re,"CONNECTING",{enumerable:!0,value:Tt.indexOf("CONNECTING")});Object.defineProperty(re.prototype,"CONNECTING",{enumerable:!0,value:Tt.indexOf("CONNECTING")});Object.defineProperty(re,"OPEN",{enumerable:!0,value:Tt.indexOf("OPEN")});Object.defineProperty(re.prototype,"OPEN",{enumerable:!0,value:Tt.indexOf("OPEN")});Object.defineProperty(re,"CLOSING",{enumerable:!0,value:Tt.indexOf("CLOSING")});Object.defineProperty(re.prototype,"CLOSING",{enumerable:!0,value:Tt.indexOf("CLOSING")});Object.defineProperty(re,"CLOSED",{enumerable:!0,value:Tt.indexOf("CLOSED")});Object.defineProperty(re.prototype,"CLOSED",{enumerable:!0,value:Tt.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(t=>{Object.defineProperty(re.prototype,t,{enumerable:!0})});["open","error","close","message"].forEach(t=>{Object.defineProperty(re.prototype,`on${t}`,{enumerable:!0,get(){for(let e of this.listeners(t))if(e[Em])return e[BA];return null},set(e){for(let n of this.listeners(t))if(n[Em]){this.removeListener(t,n);break}typeof e=="function"&&this.addEventListener(t,e,{[Em]:!0})}})});re.prototype.addEventListener=WA;re.prototype.removeEventListener=qA;Mw.exports=re;function Rw(t,e,n,i){let r={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:VA,protocolVersion:Im[1],maxBufferedChunks:1048576,maxFragments:131072,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...i,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(t._autoPong=r.autoPong,t._closeTimeout=r.closeTimeout,!Im.includes(r.protocolVersion))throw new RangeError(`Unsupported protocol version: ${r.protocolVersion} (supported versions: ${Im.join(", ")})`);let o;if(e instanceof km)o=e;else try{o=new km(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}o.protocol==="http:"?o.protocol="ws:":o.protocol==="https:"&&(o.protocol="wss:"),t._url=o.href;let s=o.protocol==="wss:",a=o.protocol==="ws+unix:",u;if(o.protocol!=="ws:"&&!s&&!a?u=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!o.pathname?u="The URL's pathname is empty":o.hash&&(u="The URL contains a fragment identifier"),u){let _=new SyntaxError(u);if(t._redirects===0)throw _;Ma(t,_);return}let c=s?443:80,l=LA(16).toString("base64"),d=s?RA.request:NA.request,f=new Set,h;if(r.createConnection=r.createConnection||(s?QA:XA),r.defaultPort=r.defaultPort||c,r.port=o.port||c,r.host=o.hostname.startsWith("[")?o.hostname.slice(1,-1):o.hostname,r.headers={...r.headers,"Sec-WebSocket-Version":r.protocolVersion,"Sec-WebSocket-Key":l,Connection:"Upgrade",Upgrade:"websocket"},r.path=o.pathname+o.search,r.timeout=r.handshakeTimeout,r.perMessageDeflate&&(h=new Qt({...r.perMessageDeflate,isServer:!1,maxPayload:r.maxPayload}),r.headers["Sec-WebSocket-Extensions"]=HA({[Qt.extensionName]:h.offer()})),n.length){for(let _ of n){if(typeof _!="string"||!YA.test(_)||f.has(_))throw new SyntaxError("An invalid or duplicated subprotocol was specified");f.add(_)}r.headers["Sec-WebSocket-Protocol"]=n.join(",")}if(r.origin&&(r.protocolVersion<13?r.headers["Sec-WebSocket-Origin"]=r.origin:r.headers.Origin=r.origin),(o.username||o.password)&&(r.auth=`${o.username}:${o.password}`),a){let _=r.path.split(":");r.socketPath=_[0],r.path=_[1]}let p;if(r.followRedirects){if(t._redirects===0){t._originalIpc=a,t._originalSecure=s,t._originalHostOrSocketPath=a?r.socketPath:o.host;let _=i&&i.headers;if(i={...i,headers:{}},_)for(let[S,k]of Object.entries(_))i.headers[S.toLowerCase()]=k}else if(t.listenerCount("redirect")===0){let _=a?t._originalIpc?r.socketPath===t._originalHostOrSocketPath:!1:t._originalIpc?!1:o.host===t._originalHostOrSocketPath;(!_||t._originalSecure&&!s)&&(delete r.headers.authorization,delete r.headers.cookie,_||delete r.headers.host,r.auth=void 0)}r.auth&&!i.headers.authorization&&(i.headers.authorization="Basic "+Buffer.from(r.auth).toString("base64")),p=t._req=d(r),t._redirects&&t.emit("redirect",t.url,p)}else p=t._req=d(r);r.timeout&&p.on("timeout",()=>{We(t,p,"Opening handshake has timed out")}),p.on("error",_=>{p===null||p[zw]||(p=t._req=null,Ma(t,_))}),p.on("response",_=>{let S=_.headers.location,k=_.statusCode;if(S&&r.followRedirects&&k>=300&&k<400){if(++t._redirects>r.maxRedirects){We(t,p,"Maximum redirects exceeded");return}p.abort();let P;try{P=new km(S,e)}catch{let E=new SyntaxError(`Invalid URL: ${S}`);Ma(t,E);return}Rw(t,P,n,i)}else t.emit("unexpected-response",p,_)||We(t,p,`Unexpected server response: ${_.statusCode}`)}),p.on("upgrade",(_,S,k)=>{if(t.emit("upgrade",_),t.readyState!==re.CONNECTING)return;p=t._req=null;let P=_.headers.upgrade;if(P===void 0||P.toLowerCase()!=="websocket"){We(t,S,"Invalid Upgrade header");return}let C=UA("sha1").update(l+ZA).digest("base64");if(_.headers["sec-websocket-accept"]!==C){We(t,S,"Invalid Sec-WebSocket-Accept header");return}let E=_.headers["sec-websocket-protocol"],T;if(E!==void 0?f.size?f.has(E)||(T="Server sent an invalid subprotocol"):T="Server sent a subprotocol but none was requested":f.size&&(T="Server sent no subprotocol"),T){We(t,S,T);return}E&&(t._protocol=E);let Z=_.headers["sec-websocket-extensions"];if(Z!==void 0){if(!h){We(t,S,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let F;try{F=JA(Z)}catch{We(t,S,"Invalid Sec-WebSocket-Extensions header");return}let q=Object.keys(F);if(q.length!==1||q[0]!==Qt.extensionName){We(t,S,"Server indicated an extension that was not requested");return}try{h.accept(F[Qt.extensionName])}catch{We(t,S,"Invalid Sec-WebSocket-Extensions header");return}t._extensions[Qt.extensionName]=h}t.setSocket(S,k,{allowSynchronousEvents:r.allowSynchronousEvents,generateMask:r.generateMask,maxBufferedChunks:r.maxBufferedChunks,maxFragments:r.maxFragments,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation})}),r.finishRequest?r.finishRequest(p,t):p.end()}function Ma(t,e){t._readyState=re.CLOSING,t._errorEmitted=!0,t.emit("error",e),t.emitClose()}function XA(t){return t.path=t.socketPath,Pw.connect(t)}function QA(t){return t.path=void 0,!t.servername&&t.servername!==""&&(t.servername=Pw.isIP(t.host)?"":t.host),DA.connect(t)}function We(t,e,n){t._readyState=re.CLOSING;let i=new Error(n);Error.captureStackTrace(i,We),e.setHeader?(e[zw]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Ma,t,i)):(e.destroy(i),e.once("error",t.emit.bind(t,"error")),e.once("close",t.emitClose.bind(t)))}function Tm(t,e,n){if(e){let i=FA(e)?e.size:KA(e).length;t._socket?t._sender._bufferedBytes+=i:t._bufferedAmount+=i}if(n){let i=new Error(`WebSocket is not open: readyState ${t.readyState} (${Tt[t.readyState]})`);process.nextTick(n,i)}}function eP(t,e){let n=this[ge];n._closeFrameReceived=!0,n._closeMessage=e,n._closeCode=t,n._socket[ge]!==void 0&&(n._socket.removeListener("data",Fa),process.nextTick(Nw,n._socket),t===1005?n.close():n.close(t,e))}function tP(){let t=this[ge];t.isPaused||t._socket.resume()}function rP(t){let e=this[ge];e._socket[ge]!==void 0&&(e._socket.removeListener("data",Fa),process.nextTick(Nw,e._socket),e.close(t[GA])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t))}function Aw(){this[ge].emitClose()}function nP(t,e){this[ge].emit("message",t,e)}function iP(t){let e=this[ge];e._autoPong&&e.pong(t,!this._isServer,Cw),e.emit("ping",t)}function oP(t){this[ge].emit("pong",t)}function Nw(t){t.resume()}function sP(t){let e=this[ge];e.readyState!==re.CLOSED&&(e.readyState===re.OPEN&&(e._readyState=re.CLOSING,Dw(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t)))}function Dw(t){t._closeTimer=setTimeout(t._socket.destroy.bind(t._socket),t._closeTimeout)}function Lw(){let t=this[ge];if(this.removeListener("close",Lw),this.removeListener("data",Fa),this.removeListener("end",Uw),t._readyState=re.CLOSING,!this._readableState.endEmitted&&!t._closeFrameReceived&&!t._receiver._writableState.errorEmitted&&this._readableState.length!==0){let e=this.read(this._readableState.length);t._receiver.write(e)}t._receiver.end(),this[ge]=void 0,clearTimeout(t._closeTimer),t._receiver._writableState.finished||t._receiver._writableState.errorEmitted?t.emitClose():(t._receiver.on("error",Aw),t._receiver.on("finish",Aw))}function Fa(t){this[ge]._receiver.write(t)||this.pause()}function Uw(){let t=this[ge];t._readyState=re.CLOSING,t._receiver.end(),this.end()}function jw(){let t=this[ge];this.removeListener("error",jw),this.on("error",Cw),t&&(t._readyState=re.CLOSING,this.destroy())}});var Bw=z((M2,Zw)=>{"use strict";var j2=Va(),{Duplex:aP}=ae("stream");function Fw(t){t.emit("close")}function uP(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Vw(t){this.removeListener("error",Vw),this.destroy(),this.listenerCount("error")===0&&this.emit("error",t)}function cP(t,e){let n=!0,i=new aP({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return t.on("message",function(o,s){let a=!s&&i._readableState.objectMode?o.toString():o;i.push(a)||t.pause()}),t.once("error",function(o){i.destroyed||(n=!1,i.destroy(o))}),t.once("close",function(){i.destroyed||i.push(null)}),i._destroy=function(r,o){if(t.readyState===t.CLOSED){o(r),process.nextTick(Fw,i);return}let s=!1;t.once("error",function(u){s=!0,o(u)}),t.once("close",function(){s||o(r),process.nextTick(Fw,i)}),n&&t.terminate()},i._final=function(r){if(t.readyState===t.CONNECTING){t.once("open",function(){i._final(r)});return}t._socket!==null&&(t._socket._writableState.finished?(r(),i._readableState.endEmitted&&i.destroy()):(t._socket.once("finish",function(){r()}),t.close()))},i._read=function(){t.isPaused&&t.resume()},i._write=function(r,o,s){if(t.readyState===t.CONNECTING){t.once("open",function(){i._write(r,o,s)});return}t.send(r,s)},i.on("end",uP),i.on("error",Vw),i}Zw.exports=cP});var Om=z((F2,Gw)=>{"use strict";var{tokenChars:lP}=kn();function dP(t){let e=new Set,n=-1,i=-1,r=0;for(r;r<t.length;r++){let s=t.charCodeAt(r);if(i===-1&&lP[s]===1)n===-1&&(n=r);else if(r!==0&&(s===32||s===9))i===-1&&n!==-1&&(i=r);else if(s===44){if(n===-1)throw new SyntaxError(`Unexpected character at index ${r}`);i===-1&&(i=r);let a=t.slice(n,i);if(e.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);e.add(a),n=i=-1}else throw new SyntaxError(`Unexpected character at index ${r}`)}if(n===-1||i!==-1)throw new SyntaxError("Unexpected end of input");let o=t.slice(n,r);if(e.has(o))throw new SyntaxError(`The "${o}" subprotocol is duplicated`);return e.add(o),e}Gw.exports={parse:dP}});var Xw=z((Z2,Yw)=>{"use strict";var fP=ae("events"),Za=ae("http"),{Duplex:V2}=ae("stream"),{createHash:hP}=ae("crypto"),Ww=Ua(),kr=Sn(),pP=Om(),mP=Va(),{CLOSE_TIMEOUT:gP,GUID:vP,kWebSocket:yP}=kt(),_P=/^[+/0-9A-Za-z]{22}==$/,qw=0,Hw=1,Kw=2,Am=class extends fP{constructor(e,n){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:1024*1024,maxFragments:128*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:gP,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:mP,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=Za.createServer((i,r)=>{let o=Za.STATUS_CODES[426];r.writeHead(426,{"Content-Length":o.length,"Content-Type":"text/plain"}),r.end(o)}),this._server.listen(e.port,e.host,e.backlog,n)):e.server&&(this._server=e.server),this._server){let i=this.emit.bind(this,"connection");this._removeListeners=bP(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(r,o,s)=>{this.handleUpgrade(r,o,s,i)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=qw}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===Kw){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Ji,this);return}if(e&&this.once("close",e),this._state!==Hw)if(this._state=Hw,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(Ji,this):process.nextTick(Ji,this);else{let n=this._server;this._removeListeners(),this._removeListeners=this._server=null,n.close(()=>{Ji(this)})}}shouldHandle(e){if(this.options.path){let n=e.url.indexOf("?");if((n!==-1?e.url.slice(0,n):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,n,i,r){n.on("error",Jw);let o=e.headers["sec-websocket-key"],s=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){Er(this,e,n,405,"Invalid HTTP method");return}if(s===void 0||s.toLowerCase()!=="websocket"){Er(this,e,n,400,"Invalid Upgrade header");return}if(o===void 0||!_P.test(o)){Er(this,e,n,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){Er(this,e,n,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){Ki(n,400);return}let u=e.headers["sec-websocket-protocol"],c=new Set;if(u!==void 0)try{c=pP.parse(u)}catch{Er(this,e,n,400,"Invalid Sec-WebSocket-Protocol header");return}let l=e.headers["sec-websocket-extensions"],d={};if(this.options.perMessageDeflate&&l!==void 0){let f=new kr({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let h=Ww.parse(l);h[kr.extensionName]&&(f.accept(h[kr.extensionName]),d[kr.extensionName]=f)}catch{Er(this,e,n,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let f={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(f,(h,p,_,S)=>{if(!h)return Ki(n,p||401,_,S);this.completeUpgrade(d,o,c,e,n,i,r)});return}if(!this.options.verifyClient(f))return Ki(n,401)}this.completeUpgrade(d,o,c,e,n,i,r)}completeUpgrade(e,n,i,r,o,s,a){if(!o.readable||!o.writable)return o.destroy();if(o[yP])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>qw)return Ki(o,503);let c=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${hP("sha1").update(n+vP).digest("base64")}`],l=new this.options.WebSocket(null,void 0,this.options);if(i.size){let d=this.options.handleProtocols?this.options.handleProtocols(i,r):i.values().next().value;d&&(c.push(`Sec-WebSocket-Protocol: ${d}`),l._protocol=d)}if(e[kr.extensionName]){let d=e[kr.extensionName].params,f=Ww.format({[kr.extensionName]:[d]});c.push(`Sec-WebSocket-Extensions: ${f}`),l._extensions=e}this.emit("headers",c,r),o.write(c.concat(`\r
182
- `).join(`\r
183
- `)),o.removeListener("error",Jw),l.setSocket(o,s,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(l),l.on("close",()=>{this.clients.delete(l),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Ji,this)})),a(l,r)}};Yw.exports=Am;function bP(t,e){for(let n of Object.keys(e))t.on(n,e[n]);return function(){for(let i of Object.keys(e))t.removeListener(i,e[i])}}function Ji(t){t._state=Kw,t.emit("close")}function Jw(){this.destroy()}function Ki(t,e,n,i){n=n||Za.STATUS_CODES[e],i={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(n),...i},t.once("finish",t.destroy),t.end(`HTTP/1.1 ${e} ${Za.STATUS_CODES[e]}\r
184
- `+Object.keys(i).map(r=>`${r}: ${i[r]}`).join(`\r
185
- `)+`\r
186
- \r
187
- `+n)}function Er(t,e,n,i,r,o){if(t.listenerCount("wsClientError")){let s=new Error(r);Error.captureStackTrace(s,Er),t.emit("wsClientError",s,n,e)}else Ki(n,i,r,o)}});var $P,xP,wP,SP,kP,EP,Pm,IP,Qw=v(()=>{$P=Je(Bw(),1),xP=Je(Ua(),1),wP=Je(Sn(),1),SP=Je(bm(),1),kP=Je(wm(),1),EP=Je(Om(),1),Pm=Je(Va(),1),IP=Je(Xw(),1)});function TP(t){return Array.isArray(t)?Buffer.concat(t).toString("utf8"):Buffer.isBuffer(t)?t.toString("utf8"):Buffer.from(t).toString("utf8")}var Cm,zm=v(()=>{"use strict";Qw();Cm=(t,e)=>{let n=new Pm.default(t,{headers:e});return{send:i=>n.send(i),close:()=>n.close(),onOpen:i=>{n.on("open",i)},onMessage:i=>{n.on("message",r=>i(TP(r)))},onError:i=>{n.on("error",i)},onClose:i=>{n.on("close",()=>i())}}}});var Yi,Rm=v(()=>{"use strict";am();cm();zm();Yi=class{socketFactory;constructor(e=Cm){this.socketFactory=e}asrEngine(e,n){if(e.provider==="elevenlabs")return new Vi(n,this.socketFactory,e.model);throw new Error(`no stt adapter for provider '${e.provider}'`)}ttsEngine(e,n){if(e.provider==="elevenlabs")return new Zi(n,this.socketFactory,e.model);throw new Error(`no tts adapter for provider '${e.provider}'`)}}});import{randomUUID as OP}from"node:crypto";function Dm(t={}){let e=new mr;B.setLevel(e.logLevel),B.debug("core created",{logLevel:e.logLevel});let{fetchImpl:n}=t,i={configService:t.configService??new Ge,registry:t.registry??new Si(n),voiceRegistry:t.voiceRegistry??new Yi(t.voiceSocketFactory),createTurnEvaluator:t.createTurnEvaluator??(r=>new bn(r,n)),createAddresseeEvaluator:t.createAddresseeEvaluator??(r=>new hn(r,n)),...t.systemPrompt!==void 0&&{systemPrompt:t.systemPrompt},...t.voiceIdentity!==void 0&&{voiceIdentity:t.voiceIdentity},...t.createTurnController!==void 0&&{createTurnController:t.createTurnController},...t.createSmartTurnInference!==void 0&&{createSmartTurnInference:t.createSmartTurnInference},...t.createFrameClassifier!==void 0&&{createFrameClassifier:t.createFrameClassifier},...t.createSegmenter!==void 0&&{createSegmenter:t.createSegmenter},...t.clock!==void 0&&{clock:t.clock}};return new Nm(i)}var AP,PP,Nm,eS=v(()=>{"use strict";Ae();Qh();ep();ip();Gx();aa();Xp();Rm();AP="jarvis-core",PP="0.1.0-dev",Nm=class{deps;constructor(e){this.deps=e}describe(){return Promise.resolve({name:AP,version:PP})}openSession(e){let n=OP();return B.debug("core opened session",{sessionId:n,capabilities:e.clientCapabilities}),Promise.resolve(new Ea(n,e,this.deps))}}});function Ba(t){return t>=200&&t<300?{ok:!0,status:"valid"}:t===401||t===403?{ok:!1,status:"invalid",detail:`key rejected (HTTP ${t})`}:{ok:!1,status:"unreachable",detail:`unexpected response (HTTP ${t})`}}function tS(t){return t instanceof Error?t.name==="TimeoutError"||t.name==="AbortError"?"request timed out":t.message:"network error"}function An(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}async function Lm(t,e,n,i){let r=await n(t,{headers:e,signal:i});if(!r.ok)throw new Error(`HTTP ${r.status}`);try{return await r.json()}catch{throw new Error("invalid JSON response")}}function Um(t){let e={};for(let[n,i]of Object.entries(t))i!==void 0&&i.length>0&&(e[n]=i);if(Object.keys(e).length===0)throw new Error("catalogue curated to nothing");return e}function UP(t){return!/^gpt-(4\.1|4o|5)/.test(t)&&!/^o\d/.test(t)||LP.test(t)?!1:!/-(audio|realtime|transcribe|tts|image|search|codex|chat-latest|instruct|deep-research|pro)\b/.test(t)}var CP,zP,RP,NP,DP,LP,jP,MP,rS,Pn,jm=v(()=>{"use strict";CP=async(t,e,n)=>{let i=await e("https://api.openai.com/v1/models",{headers:{Authorization:`Bearer ${t}`},signal:n});return Ba(i.status)},zP=async(t,e,n)=>{let i=await e("https://api.anthropic.com/v1/models",{headers:{"x-api-key":t,"anthropic-version":"2023-06-01"},signal:n});return Ba(i.status)},RP=async(t,e,n)=>{let i=await e("https://api.deepgram.com/v1/projects",{headers:{Authorization:`Token ${t}`},signal:n});return Ba(i.status)},NP=async(t,e,n)=>{let i=await e("https://api.elevenlabs.io/v1/user",{headers:{"xi-api-key":t},signal:n});return i.status===401||i.status===403?{ok:!1,status:"unverifiable",detail:"an ElevenLabs key scoped to the voice endpoints cannot reach a free validation endpoint; it will be confirmed at first use"}:Ba(i.status)};DP=async(t,e,n)=>{if(!t)throw new Error("API key required");let i=await Lm("https://api.anthropic.com/v1/models?limit=100",{"x-api-key":t,"anthropic-version":"2023-06-01"},e,n),r=An(i)&&Array.isArray(i.data)?i.data:[],o=[];for(let s of r){if(!An(s)||typeof s.id!="string")continue;let a=typeof s.display_name=="string"?s.display_name:void 0;o.push(a===void 0?{id:s.id}:{id:s.id,label:a})}return Um({text:o})},LP=/-\d{4}-\d{2}-\d{2}$/;jP=async(t,e,n)=>{if(!t)throw new Error("API key required");let i=await Lm("https://api.openai.com/v1/models",{Authorization:`Bearer ${t}`},e,n),r=An(i)&&Array.isArray(i.data)?i.data:[],o=[];for(let a of r)An(a)&&typeof a.id=="string"&&o.push(a.id);o.sort();let s=a=>o.filter(a).map(u=>({id:u}));return Um({text:s(UP),stt:s(a=>a==="whisper-1"||a.endsWith("-transcribe")),tts:s(a=>/^tts-1(-hd)?$/.test(a)||a.endsWith("-tts")),embedding:s(a=>a.startsWith("text-embedding-3-"))})},MP=async(t,e,n)=>{let i=await Lm("https://api.deepgram.com/v1/models",{},e,n),r=An(i)&&Array.isArray(i.stt)?i.stt:[],o=new Set,s=[];for(let a of r){if(!An(a)||a.streaming!==!0)continue;let{canonical_name:u,architecture:c}=a;typeof u!="string"||typeof c!="string"||c.startsWith("nova-")&&(o.has(u)||(o.add(u),s.push({id:u,architecture:c})))}return s.sort((a,u)=>a.architecture===u.architecture?a.id.localeCompare(u.id,"en"):u.architecture.localeCompare(a.architecture,"en",{numeric:!0})),Um({stt:s.map(({id:a})=>({id:a}))})},rS={elevenlabs:{capabilities:["stt","tts"],defaultModel:{stt:"scribe_v2_realtime",tts:"eleven_flash_v2_5"},keyEnv:"ELEVENLABS_API_KEY",probe:NP},anthropic:{capabilities:["text"],defaultModel:{text:"claude-opus-4-8"},fastModel:{text:"claude-sonnet-5"},keyEnv:"ANTHROPIC_API_KEY",probe:zP,listModels:DP},openai:{capabilities:["text","stt","tts","embedding"],defaultModel:{text:"gpt-4o",stt:"whisper-1",tts:"tts-1",embedding:"text-embedding-3-small"},fastModel:{text:"gpt-4o-mini"},keyEnv:"OPENAI_API_KEY",probe:CP,listModels:jP},deepgram:{capabilities:["stt"],defaultModel:{stt:"nova-3-general"},keyEnv:"DEEPGRAM_API_KEY",probe:RP,listModels:MP,keylessLister:!0}},Pn=class{fetchImpl;timeoutMs=3e3;providers;constructor(e=fetch){this.fetchImpl=e,this.providers=rS}async probe(e,n,i){let r=this.providers[e]?.probe;if(!r)return{ok:!1,status:"unimplemented",detail:`no probe for provider '${e}'`};let o=i?.signal??AbortSignal.timeout(this.timeoutMs);try{return await r(n,this.fetchImpl,o)}catch(s){return{ok:!1,status:"unreachable",detail:tS(s)}}}providersFor(e){return Object.keys(this.providers).filter(n=>this.providers[n].capabilities.includes(e))}defaultModel(e,n){return this.providers[e]?.defaultModel[n]}}});var FP,VP,lM,nS=v(()=>{"use strict";pr();jm();FP=1440*60*1e3,VP={stt:!0,tts:!0,text:!0,embedding:!0},lM=Object.keys(VP)});var Ga=v(()=>{"use strict";eS();ep();jm();nS();ip();np();op();rp();tp();zm();am();cm();Rm();em();Wp();qp();Kp();Pi();Mp();jp();$a();Jp();ap();up()});var Rn=z((yF,uS)=>{"use strict";var XP="2.0.0",QP=Number.MAX_SAFE_INTEGER||9007199254740991,eC=16,tC=250,rC=["major","premajor","minor","preminor","patch","prepatch","prerelease"];uS.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:eC,MAX_SAFE_BUILD_LENGTH:tC,MAX_SAFE_INTEGER:QP,RELEASE_TYPES:rC,SEMVER_SPEC_VERSION:XP,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var eo=z((_F,cS)=>{"use strict";var nC=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};cS.exports=nC});var Nn=z((gt,lS)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Vm,MAX_SAFE_BUILD_LENGTH:iC,MAX_LENGTH:oC}=Rn(),sC=eo();gt=lS.exports={};var aC=gt.re=[],uC=gt.safeRe=[],O=gt.src=[],cC=gt.safeSrc=[],A=gt.t={},lC=0,Zm="[a-zA-Z0-9-]",dC=[["\\s",1],["\\d",oC],[Zm,iC]],fC=t=>{for(let[e,n]of dC)t=t.split(`${e}*`).join(`${e}{0,${n}}`).split(`${e}+`).join(`${e}{1,${n}}`);return t},U=(t,e,n)=>{let i=fC(e),r=lC++;sC(t,r,e),A[t]=r,O[r]=e,cC[r]=i,aC[r]=new RegExp(e,n?"g":void 0),uC[r]=new RegExp(i,n?"g":void 0)};U("NUMERICIDENTIFIER","0|[1-9]\\d*");U("NUMERICIDENTIFIERLOOSE","\\d+");U("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Zm}*`);U("MAINVERSION",`(${O[A.NUMERICIDENTIFIER]})\\.(${O[A.NUMERICIDENTIFIER]})\\.(${O[A.NUMERICIDENTIFIER]})`);U("MAINVERSIONLOOSE",`(${O[A.NUMERICIDENTIFIERLOOSE]})\\.(${O[A.NUMERICIDENTIFIERLOOSE]})\\.(${O[A.NUMERICIDENTIFIERLOOSE]})`);U("PRERELEASEIDENTIFIER",`(?:${O[A.NONNUMERICIDENTIFIER]}|${O[A.NUMERICIDENTIFIER]})`);U("PRERELEASEIDENTIFIERLOOSE",`(?:${O[A.NONNUMERICIDENTIFIER]}|${O[A.NUMERICIDENTIFIERLOOSE]})`);U("PRERELEASE",`(?:-(${O[A.PRERELEASEIDENTIFIER]}(?:\\.${O[A.PRERELEASEIDENTIFIER]})*))`);U("PRERELEASELOOSE",`(?:-?(${O[A.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${O[A.PRERELEASEIDENTIFIERLOOSE]})*))`);U("BUILDIDENTIFIER",`${Zm}+`);U("BUILD",`(?:\\+(${O[A.BUILDIDENTIFIER]}(?:\\.${O[A.BUILDIDENTIFIER]})*))`);U("FULLPLAIN",`v?${O[A.MAINVERSION]}${O[A.PRERELEASE]}?${O[A.BUILD]}?`);U("FULL",`^${O[A.FULLPLAIN]}$`);U("LOOSEPLAIN",`[v=\\s]*${O[A.MAINVERSIONLOOSE]}${O[A.PRERELEASELOOSE]}?${O[A.BUILD]}?`);U("LOOSE",`^${O[A.LOOSEPLAIN]}$`);U("GTLT","((?:<|>)?=?)");U("XRANGEIDENTIFIERLOOSE",`${O[A.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);U("XRANGEIDENTIFIER",`${O[A.NUMERICIDENTIFIER]}|x|X|\\*`);U("XRANGEPLAIN",`[v=\\s]*(${O[A.XRANGEIDENTIFIER]})(?:\\.(${O[A.XRANGEIDENTIFIER]})(?:\\.(${O[A.XRANGEIDENTIFIER]})(?:${O[A.PRERELEASE]})?${O[A.BUILD]}?)?)?`);U("XRANGEPLAINLOOSE",`[v=\\s]*(${O[A.XRANGEIDENTIFIERLOOSE]})(?:\\.(${O[A.XRANGEIDENTIFIERLOOSE]})(?:\\.(${O[A.XRANGEIDENTIFIERLOOSE]})(?:${O[A.PRERELEASELOOSE]})?${O[A.BUILD]}?)?)?`);U("XRANGE",`^${O[A.GTLT]}\\s*${O[A.XRANGEPLAIN]}$`);U("XRANGELOOSE",`^${O[A.GTLT]}\\s*${O[A.XRANGEPLAINLOOSE]}$`);U("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Vm}})(?:\\.(\\d{1,${Vm}}))?(?:\\.(\\d{1,${Vm}}))?`);U("COERCE",`${O[A.COERCEPLAIN]}(?:$|[^\\d])`);U("COERCEFULL",O[A.COERCEPLAIN]+`(?:${O[A.PRERELEASE]})?(?:${O[A.BUILD]})?(?:$|[^\\d])`);U("COERCERTL",O[A.COERCE],!0);U("COERCERTLFULL",O[A.COERCEFULL],!0);U("LONETILDE","(?:~>?)");U("TILDETRIM",`(\\s*)${O[A.LONETILDE]}\\s+`,!0);gt.tildeTrimReplace="$1~";U("TILDE",`^${O[A.LONETILDE]}${O[A.XRANGEPLAIN]}$`);U("TILDELOOSE",`^${O[A.LONETILDE]}${O[A.XRANGEPLAINLOOSE]}$`);U("LONECARET","(?:\\^)");U("CARETTRIM",`(\\s*)${O[A.LONECARET]}\\s+`,!0);gt.caretTrimReplace="$1^";U("CARET",`^${O[A.LONECARET]}${O[A.XRANGEPLAIN]}$`);U("CARETLOOSE",`^${O[A.LONECARET]}${O[A.XRANGEPLAINLOOSE]}$`);U("COMPARATORLOOSE",`^${O[A.GTLT]}\\s*(${O[A.LOOSEPLAIN]})$|^$`);U("COMPARATOR",`^${O[A.GTLT]}\\s*(${O[A.FULLPLAIN]})$|^$`);U("COMPARATORTRIM",`(\\s*)${O[A.GTLT]}\\s*(${O[A.LOOSEPLAIN]}|${O[A.XRANGEPLAIN]})`,!0);gt.comparatorTrimReplace="$1$2$3";U("HYPHENRANGE",`^\\s*(${O[A.XRANGEPLAIN]})\\s+-\\s+(${O[A.XRANGEPLAIN]})\\s*$`);U("HYPHENRANGELOOSE",`^\\s*(${O[A.XRANGEPLAINLOOSE]})\\s+-\\s+(${O[A.XRANGEPLAINLOOSE]})\\s*$`);U("STAR","(<|>)?=?\\s*\\*");U("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");U("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Ka=z((bF,dS)=>{"use strict";var hC=Object.freeze({loose:!0}),pC=Object.freeze({}),mC=t=>t?typeof t!="object"?hC:t:pC;dS.exports=mC});var Bm=z(($F,pS)=>{"use strict";var fS=/^[0-9]+$/,hS=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let n=fS.test(t),i=fS.test(e);return n&&i&&(t=+t,e=+e),t===e?0:n&&!i?-1:i&&!n?1:t<e?-1:1},gC=(t,e)=>hS(e,t);pS.exports={compareIdentifiers:hS,rcompareIdentifiers:gC}});var _e=z((xF,gS)=>{"use strict";var Ya=eo(),{MAX_LENGTH:mS,MAX_SAFE_INTEGER:Xa}=Rn(),{safeRe:Qa,t:eu}=Nn(),vC=Ka(),{compareIdentifiers:Gm}=Bm(),yC=(t,e)=>{let n=e.split(".");if(n.length>t.length)return!1;for(let i=0;i<n.length;i++)if(Gm(t[i],n[i])!==0)return!1;return!0},Wm=class t{constructor(e,n){if(n=vC(n),e instanceof t){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>mS)throw new TypeError(`version is longer than ${mS} characters`);Ya("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let i=e.trim().match(n.loose?Qa[eu.LOOSE]:Qa[eu.FULL]);if(!i)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>Xa||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Xa||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Xa||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(r=>{if(/^[0-9]+$/.test(r)){let o=+r;if(o>=0&&o<Xa)return o}return r}):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Ya("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{let i=this.prerelease[n],r=e.prerelease[n];if(Ya("prerelease compare",n,i,r),i===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(i===void 0)return-1;if(i===r)continue;return Gm(i,r)}while(++n)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let n=0;do{let i=this.build[n],r=e.build[n];if(Ya("build compare",n,i,r),i===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(i===void 0)return-1;if(i===r)continue;return Gm(i,r)}while(++n)}inc(e,n,i){if(e.startsWith("pre")){if(!n&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let r=`-${n}`.match(this.options.loose?Qa[eu.PRERELEASELOOSE]:Qa[eu.PRERELEASE]);if(!r||r[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,i),this.inc("pre",n,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,i),this.inc("pre",n,i);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let r=Number(i)?1:0;if(this.prerelease.length===0)this.prerelease=[r];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(n===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(n){let o=[n,r];if(i===!1&&(o=[n]),yC(this.prerelease,n)){let s=this.prerelease[n.split(".").length];isNaN(s)&&(this.prerelease=o)}else this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};gS.exports=Wm});var er=z((wF,yS)=>{"use strict";var vS=_e(),_C=(t,e,n=!1)=>{if(t instanceof vS)return t;try{return new vS(t,e)}catch(i){if(!n)return null;throw i}};yS.exports=_C});var bS=z((SF,_S)=>{"use strict";var bC=er(),$C=(t,e)=>{let n=bC(t,e);return n?n.version:null};_S.exports=$C});var xS=z((kF,$S)=>{"use strict";var xC=er(),wC=(t,e)=>{let n=xC(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};$S.exports=wC});var kS=z((EF,SS)=>{"use strict";var wS=_e(),SC=(t,e,n,i,r)=>{typeof n=="string"&&(r=i,i=n,n=void 0);try{return new wS(t instanceof wS?t.version:t,n).inc(e,i,r).version}catch{return null}};SS.exports=SC});var TS=z((IF,IS)=>{"use strict";var ES=er(),kC=(t,e)=>{let n=ES(t,null,!0),i=ES(e,null,!0),r=n.compare(i);if(r===0)return null;let o=r>0,s=o?n:i,a=o?i:n,u=!!s.prerelease.length;if(!!a.prerelease.length&&!u){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let l=u?"pre":"";return n.major!==i.major?l+"major":n.minor!==i.minor?l+"minor":n.patch!==i.patch?l+"patch":"prerelease"};IS.exports=kC});var AS=z((TF,OS)=>{"use strict";var EC=_e(),IC=(t,e)=>new EC(t,e).major;OS.exports=IC});var CS=z((OF,PS)=>{"use strict";var TC=_e(),OC=(t,e)=>new TC(t,e).minor;PS.exports=OC});var RS=z((AF,zS)=>{"use strict";var AC=_e(),PC=(t,e)=>new AC(t,e).patch;zS.exports=PC});var DS=z((PF,NS)=>{"use strict";var CC=er(),zC=(t,e)=>{let n=CC(t,e);return n&&n.prerelease.length?n.prerelease:null};NS.exports=zC});var tt=z((CF,US)=>{"use strict";var LS=_e(),RC=(t,e,n)=>new LS(t,n).compare(new LS(e,n));US.exports=RC});var MS=z((zF,jS)=>{"use strict";var NC=tt(),DC=(t,e,n)=>NC(e,t,n);jS.exports=DC});var VS=z((RF,FS)=>{"use strict";var LC=tt(),UC=(t,e)=>LC(t,e,!0);FS.exports=UC});var tu=z((NF,BS)=>{"use strict";var ZS=_e(),jC=(t,e,n)=>{let i=new ZS(t,n),r=new ZS(e,n);return i.compare(r)||i.compareBuild(r)};BS.exports=jC});var WS=z((DF,GS)=>{"use strict";var MC=tu(),FC=(t,e)=>t.sort((n,i)=>MC(n,i,e));GS.exports=FC});var HS=z((LF,qS)=>{"use strict";var VC=tu(),ZC=(t,e)=>t.sort((n,i)=>VC(i,n,e));qS.exports=ZC});var to=z((UF,JS)=>{"use strict";var BC=tt(),GC=(t,e,n)=>BC(t,e,n)>0;JS.exports=GC});var ru=z((jF,KS)=>{"use strict";var WC=tt(),qC=(t,e,n)=>WC(t,e,n)<0;KS.exports=qC});var qm=z((MF,YS)=>{"use strict";var HC=tt(),JC=(t,e,n)=>HC(t,e,n)===0;YS.exports=JC});var Hm=z((FF,XS)=>{"use strict";var KC=tt(),YC=(t,e,n)=>KC(t,e,n)!==0;XS.exports=YC});var nu=z((VF,QS)=>{"use strict";var XC=tt(),QC=(t,e,n)=>XC(t,e,n)>=0;QS.exports=QC});var iu=z((ZF,e0)=>{"use strict";var ez=tt(),tz=(t,e,n)=>ez(t,e,n)<=0;e0.exports=tz});var Jm=z((BF,t0)=>{"use strict";var rz=qm(),nz=Hm(),iz=to(),oz=nu(),sz=ru(),az=iu(),uz=(t,e,n,i)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return rz(t,n,i);case"!=":return nz(t,n,i);case">":return iz(t,n,i);case">=":return oz(t,n,i);case"<":return sz(t,n,i);case"<=":return az(t,n,i);default:throw new TypeError(`Invalid operator: ${e}`)}};t0.exports=uz});var n0=z((GF,r0)=>{"use strict";var cz=_e(),lz=er(),{safeRe:ou,t:su}=Nn(),dz=(t,e)=>{if(t instanceof cz)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(e.includePrerelease?ou[su.COERCEFULL]:ou[su.COERCE]);else{let u=e.includePrerelease?ou[su.COERCERTLFULL]:ou[su.COERCERTL],c;for(;(c=u.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||c.index+c[0].length!==n.index+n[0].length)&&(n=c),u.lastIndex=c.index+c[1].length+c[2].length;u.lastIndex=-1}if(n===null)return null;let i=n[2],r=n[3]||"0",o=n[4]||"0",s=e.includePrerelease&&n[5]?`-${n[5]}`:"",a=e.includePrerelease&&n[6]?`+${n[6]}`:"";return lz(`${i}.${r}.${o}${s}${a}`,e)};r0.exports=dz});var o0=z((WF,i0)=>{"use strict";var fz=er(),hz=Rn(),pz=_e(),mz=(t,e,n)=>{if(!hz.RELEASE_TYPES.includes(e))return null;let i=gz(t,n);return i&&vz(i,e)},gz=(t,e)=>{let n=t instanceof pz?t.version:t;return fz(n,e)},vz=(t,e)=>{if(yz(e))return t.version;switch(t.prerelease=[],e){case"major":t.minor=0,t.patch=0;break;case"minor":t.patch=0;break}return t.format()},yz=t=>t.startsWith("pre");i0.exports=mz});var a0=z((qF,s0)=>{"use strict";var Km=class{constructor(){this.max=1e3,this.map=new Map}get(e){let n=this.map.get(e);if(n!==void 0)return this.map.delete(e),this.map.set(e,n),n}delete(e){return this.map.delete(e)}set(e,n){if(!this.delete(e)&&n!==void 0){if(this.map.size>=this.max){let r=this.map.keys().next().value;this.delete(r)}this.map.set(e,n)}return this}};s0.exports=Km});var rt=z((HF,d0)=>{"use strict";var _z=/\s+/g,Ym=class t{constructor(e,n){if(n=$z(n),e instanceof t)return e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease?e:new t(e.raw,n);if(e instanceof Xm)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=e.trim().replace(_z," "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(r=>!c0(r[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let r of this.set)if(r.length===1&&Az(r[0])){this.set=[r];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let n=this.set[e];for(let i=0;i<n.length;i++)i>0&&(this.formatted+=" "),this.formatted+=n[i].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(Oz,"");let i=((this.options.includePrerelease&&Iz)|(this.options.loose&&Tz))+":"+e,r=u0.get(i);if(r)return r;let o=this.options.loose,s=o?Pe[be.HYPHENRANGELOOSE]:Pe[be.HYPHENRANGE];e=e.replace(s,Mz(this.options.includePrerelease)),te("hyphen replace",e),e=e.replace(Pe[be.COMPARATORTRIM],Sz),te("comparator trim",e),e=e.replace(Pe[be.TILDETRIM],kz),te("tilde trim",e),e=e.replace(Pe[be.CARETTRIM],Ez),te("caret trim",e);let a=e.split(" ").map(d=>Pz(d,this.options)).join(" ").split(/\s+/).map(d=>jz(d,this.options));o&&(a=a.filter(d=>(te("loose invalid filter",d,this.options),!!d.match(Pe[be.COMPARATORLOOSE])))),te("range list",a);let u=new Map,c=a.map(d=>new Xm(d,this.options));for(let d of c){if(c0(d))return[d];u.set(d.value,d)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return u0.set(i,l),l}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(i=>l0(i,n)&&e.set.some(r=>l0(r,n)&&i.every(o=>r.every(s=>o.intersects(s,n)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new xz(e,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(Fz(this.set[n],e,this.options))return!0;return!1}};d0.exports=Ym;var bz=a0(),u0=new bz,$z=Ka(),Xm=ro(),te=eo(),xz=_e(),{safeRe:Pe,src:wz,t:be,comparatorTrimReplace:Sz,tildeTrimReplace:kz,caretTrimReplace:Ez}=Nn(),{FLAG_INCLUDE_PRERELEASE:Iz,FLAG_LOOSE:Tz}=Rn(),Oz=new RegExp(wz[be.BUILD],"g"),c0=t=>t.value==="<0.0.0-0",Az=t=>t.value==="",l0=(t,e)=>{let n=!0,i=t.slice(),r=i.pop();for(;n&&i.length;)n=i.every(o=>r.intersects(o,e)),r=i.pop();return n},Pz=(t,e)=>(t=t.replace(Pe[be.BUILD],""),te("comp",t,e),t=Rz(t,e),te("caret",t),t=Cz(t,e),te("tildes",t),t=Dz(t,e),te("xrange",t),t=Uz(t,e),te("stars",t),t),Ce=t=>!t||t.toLowerCase()==="x"||t==="*",Cz=(t,e)=>t.trim().split(/\s+/).map(n=>zz(n,e)).join(" "),zz=(t,e)=>{let n=e.loose?Pe[be.TILDELOOSE]:Pe[be.TILDE];return t.replace(n,(i,r,o,s,a)=>{te("tilde",t,i,r,o,s,a);let u;return Ce(r)?u="":Ce(o)?u=`>=${r}.0.0 <${+r+1}.0.0-0`:Ce(s)?u=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:a?(te("replaceTilde pr",a),u=`>=${r}.${o}.${s}-${a} <${r}.${+o+1}.0-0`):u=`>=${r}.${o}.${s} <${r}.${+o+1}.0-0`,te("tilde return",u),u})},Rz=(t,e)=>t.trim().split(/\s+/).map(n=>Nz(n,e)).join(" "),Nz=(t,e)=>{te("caret",t,e);let n=e.loose?Pe[be.CARETLOOSE]:Pe[be.CARET],i=e.includePrerelease?"-0":"";return t.replace(n,(r,o,s,a,u)=>{te("caret",t,r,o,s,a,u);let c;return Ce(o)?c="":Ce(s)?c=`>=${o}.0.0${i} <${+o+1}.0.0-0`:Ce(a)?o==="0"?c=`>=${o}.${s}.0${i} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.0${i} <${+o+1}.0.0-0`:u?(te("replaceCaret pr",u),o==="0"?s==="0"?c=`>=${o}.${s}.${a}-${u} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}-${u} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a}-${u} <${+o+1}.0.0-0`):(te("no pr"),o==="0"?s==="0"?c=`>=${o}.${s}.${a}${i} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}${i} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),te("caret return",c),c})},Dz=(t,e)=>(te("replaceXRanges",t,e),t.split(/\s+/).map(n=>Lz(n,e)).join(" ")),Lz=(t,e)=>{t=t.trim();let n=e.loose?Pe[be.XRANGELOOSE]:Pe[be.XRANGE];return t.replace(n,(i,r,o,s,a,u)=>{te("xRange",t,i,r,o,s,a,u);let c=Ce(o),l=c||Ce(s),d=l||Ce(a),f=d;return r==="="&&f&&(r=""),u=e.includePrerelease?"-0":"",c?r===">"||r==="<"?i="<0.0.0-0":i="*":r&&f?(l&&(s=0),a=0,r===">"?(r=">=",l?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):r==="<="&&(r="<",l?o=+o+1:s=+s+1),r==="<"&&(u="-0"),i=`${r+o}.${s}.${a}${u}`):l?i=`>=${o}.0.0${u} <${+o+1}.0.0-0`:d&&(i=`>=${o}.${s}.0${u} <${o}.${+s+1}.0-0`),te("xRange return",i),i})},Uz=(t,e)=>(te("replaceStars",t,e),t.trim().replace(Pe[be.STAR],"")),jz=(t,e)=>(te("replaceGTE0",t,e),t.trim().replace(Pe[e.includePrerelease?be.GTE0PRE:be.GTE0],"")),Mz=t=>(e,n,i,r,o,s,a,u,c,l,d,f)=>(Ce(i)?n="":Ce(r)?n=`>=${i}.0.0${t?"-0":""}`:Ce(o)?n=`>=${i}.${r}.0${t?"-0":""}`:s?n=`>=${n}`:n=`>=${n}${t?"-0":""}`,Ce(c)?u="":Ce(l)?u=`<${+c+1}.0.0-0`:Ce(d)?u=`<${c}.${+l+1}.0-0`:f?u=`<=${c}.${l}.${d}-${f}`:t?u=`<${c}.${l}.${+d+1}-0`:u=`<=${u}`,`${n} ${u}`.trim()),Fz=(t,e,n)=>{for(let i=0;i<t.length;i++)if(!t[i].test(e))return!1;if(e.prerelease.length&&!n.includePrerelease){for(let i=0;i<t.length;i++)if(te(t[i].semver),t[i].semver!==Xm.ANY&&t[i].semver.prerelease.length>0){let r=t[i].semver;if(r.major===e.major&&r.minor===e.minor&&r.patch===e.patch)return!0}return!1}return!0}});var ro=z((JF,v0)=>{"use strict";var no=Symbol("SemVer ANY"),tg=class t{static get ANY(){return no}constructor(e,n){if(n=f0(n),e instanceof t){if(e.loose===!!n.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),eg("comparator",e,n),this.options=n,this.loose=!!n.loose,this.parse(e),this.semver===no?this.value="":this.value=this.operator+this.semver.version,eg("comp",this)}parse(e){let n=this.options.loose?h0[p0.COMPARATORLOOSE]:h0[p0.COMPARATOR],i=e.match(n);if(!i)throw new TypeError(`Invalid comparator: ${e}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new m0(i[2],this.options.loose):this.semver=no}toString(){return this.value}test(e){if(eg("Comparator.test",e,this.options.loose),this.semver===no||e===no)return!0;if(typeof e=="string")try{e=new m0(e,this.options)}catch{return!1}return Qm(e,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new g0(e.value,n).test(this.value):e.operator===""?e.value===""?!0:new g0(this.value,n).test(e.semver):(n=f0(n),n.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Qm(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Qm(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};v0.exports=tg;var f0=Ka(),{safeRe:h0,t:p0}=Nn(),Qm=Jm(),eg=eo(),m0=_e(),g0=rt()});var io=z((KF,y0)=>{"use strict";var Vz=rt(),Zz=(t,e,n)=>{try{e=new Vz(e,n)}catch{return!1}return e.test(t)};y0.exports=Zz});var b0=z((YF,_0)=>{"use strict";var Bz=rt(),Gz=(t,e)=>new Bz(t,e).set.map(n=>n.map(i=>i.value).join(" ").trim().split(" "));_0.exports=Gz});var x0=z((XF,$0)=>{"use strict";var Wz=_e(),qz=rt(),Hz=(t,e,n)=>{let i=null,r=null,o=null;try{o=new qz(e,n)}catch{return null}return t.forEach(s=>{o.test(s)&&(!i||r.compare(s)===-1)&&(i=s,r=new Wz(i,n))}),i};$0.exports=Hz});var S0=z((QF,w0)=>{"use strict";var Jz=_e(),Kz=rt(),Yz=(t,e,n)=>{let i=null,r=null,o=null;try{o=new Kz(e,n)}catch{return null}return t.forEach(s=>{o.test(s)&&(!i||r.compare(s)===1)&&(i=s,r=new Jz(i,n))}),i};w0.exports=Yz});var I0=z((eV,E0)=>{"use strict";var rg=_e(),Xz=rt(),k0=to(),Qz=(t,e)=>{t=new Xz(t,e);let n=new rg("0.0.0");if(t.test(n)||(n=new rg("0.0.0-0"),t.test(n)))return n;n=null;for(let i=0;i<t.set.length;++i){let r=t.set[i],o=null;r.forEach(s=>{let a=new rg(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||k0(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!n||k0(n,o))&&(n=o)}return n&&t.test(n)?n:null};E0.exports=Qz});var O0=z((tV,T0)=>{"use strict";var eR=rt(),tR=(t,e)=>{try{return new eR(t,e).range||"*"}catch{return null}};T0.exports=tR});var au=z((rV,z0)=>{"use strict";var rR=_e(),C0=ro(),{ANY:nR}=C0,iR=rt(),oR=io(),A0=to(),P0=ru(),sR=iu(),aR=nu(),uR=(t,e,n,i)=>{t=new rR(t,i),e=new iR(e,i);let r,o,s,a,u;switch(n){case">":r=A0,o=sR,s=P0,a=">",u=">=";break;case"<":r=P0,o=aR,s=A0,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(oR(t,e,i))return!1;for(let c=0;c<e.set.length;++c){let l=e.set[c],d=null,f=null;if(l.forEach(h=>{h.semver===nR&&(h=new C0(">=0.0.0")),d=d||h,f=f||h,r(h.semver,d.semver,i)?d=h:s(h.semver,f.semver,i)&&(f=h)}),d.operator===a||d.operator===u||(!f.operator||f.operator===a)&&o(t,f.semver))return!1;if(f.operator===u&&s(t,f.semver))return!1}return!0};z0.exports=uR});var N0=z((nV,R0)=>{"use strict";var cR=au(),lR=(t,e,n)=>cR(t,e,">",n);R0.exports=lR});var L0=z((iV,D0)=>{"use strict";var dR=au(),fR=(t,e,n)=>dR(t,e,"<",n);D0.exports=fR});var M0=z((oV,j0)=>{"use strict";var U0=rt(),hR=(t,e,n)=>(t=new U0(t,n),e=new U0(e,n),t.intersects(e,n));j0.exports=hR});var V0=z((sV,F0)=>{"use strict";var pR=io(),mR=tt();F0.exports=(t,e,n)=>{let i=[],r=null,o=null,s=t.sort((l,d)=>mR(l,d,n));for(let l of s)pR(l,e,n)?(o=l,r||(r=l)):(o&&i.push([r,o]),o=null,r=null);r&&i.push([r,null]);let a=[];for(let[l,d]of i)l===d?a.push(l):!d&&l===s[0]?a.push("*"):d?l===s[0]?a.push(`<=${d}`):a.push(`${l} - ${d}`):a.push(`>=${l}`);let u=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return u.length<c.length?u:e}});var H0=z((aV,q0)=>{"use strict";var Z0=rt(),og=ro(),{ANY:ng}=og,ig=io(),sg=tt(),gR=(t,e,n={})=>{if(t===e)return!0;t=new Z0(t,n),e=new Z0(e,n);let i=!1;e:for(let r of t.set){for(let o of e.set){let s=yR(r,o,n);if(i=i||s!==null,s)continue e}if(i)return!1}return!0},vR=[new og(">=0.0.0-0")],B0=[new og(">=0.0.0")],yR=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===ng){if(e.length===1&&e[0].semver===ng)return!0;n.includePrerelease?t=vR:t=B0}if(e.length===1&&e[0].semver===ng){if(n.includePrerelease)return!0;e=B0}let i=new Set,r,o;for(let h of t)h.operator===">"||h.operator===">="?r=G0(r,h,n):h.operator==="<"||h.operator==="<="?o=W0(o,h,n):i.add(h.semver);if(i.size>1)return null;let s;if(r&&o){if(s=sg(r.semver,o.semver,n),s>0)return null;if(s===0&&(r.operator!==">="||o.operator!=="<="))return null}for(let h of i){if(r&&!ig(h,String(r),n)||o&&!ig(h,String(o),n))return null;for(let p of e)if(!ig(h,String(p),n))return!1;return!0}let a,u,c,l,d=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1,f=r&&!n.includePrerelease&&r.semver.prerelease.length?r.semver:!1;d&&d.prerelease.length===1&&o.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let h of e){if(l=l||h.operator===">"||h.operator===">=",c=c||h.operator==="<"||h.operator==="<=",r){if(f&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch&&(f=!1),h.operator===">"||h.operator===">="){if(a=G0(r,h,n),a===h&&a!==r)return!1}else if(r.operator===">="&&!h.test(r.semver))return!1}if(o){if(d&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===d.major&&h.semver.minor===d.minor&&h.semver.patch===d.patch&&(d=!1),h.operator==="<"||h.operator==="<="){if(u=W0(o,h,n),u===h&&u!==o)return!1}else if(o.operator==="<="&&!h.test(o.semver))return!1}if(!h.operator&&(o||r)&&s!==0)return!1}return!(r&&c&&!o&&s!==0||o&&l&&!r&&s!==0||f||d)},G0=(t,e,n)=>{if(!t)return e;let i=sg(t.semver,e.semver,n);return i>0?t:i<0||e.operator===">"&&t.operator===">="?e:t},W0=(t,e,n)=>{if(!t)return e;let i=sg(t.semver,e.semver,n);return i<0?t:i>0||e.operator==="<"&&t.operator==="<="?e:t};q0.exports=gR});var X0=z((uV,Y0)=>{"use strict";var ag=Nn(),J0=Rn(),_R=_e(),K0=Bm(),bR=er(),$R=bS(),xR=xS(),wR=kS(),SR=TS(),kR=AS(),ER=CS(),IR=RS(),TR=DS(),OR=tt(),AR=MS(),PR=VS(),CR=tu(),zR=WS(),RR=HS(),NR=to(),DR=ru(),LR=qm(),UR=Hm(),jR=nu(),MR=iu(),FR=Jm(),VR=n0(),ZR=o0(),BR=ro(),GR=rt(),WR=io(),qR=b0(),HR=x0(),JR=S0(),KR=I0(),YR=O0(),XR=au(),QR=N0(),eN=L0(),tN=M0(),rN=V0(),nN=H0();Y0.exports={parse:bR,valid:$R,clean:xR,inc:wR,diff:SR,major:kR,minor:ER,patch:IR,prerelease:TR,compare:OR,rcompare:AR,compareLoose:PR,compareBuild:CR,sort:zR,rsort:RR,gt:NR,lt:DR,eq:LR,neq:UR,gte:jR,lte:MR,cmp:FR,coerce:VR,truncate:ZR,Comparator:BR,Range:GR,satisfies:WR,toComparators:qR,maxSatisfying:HR,minSatisfying:JR,minVersion:KR,validRange:YR,outside:XR,gtr:QR,ltr:eN,intersects:tN,simplifyRange:rN,subset:nN,SemVer:_R,re:ag.re,src:ag.src,tokens:ag.t,SEMVER_SPEC_VERSION:J0.SEMVER_SPEC_VERSION,RELEASE_TYPES:J0.RELEASE_TYPES,compareIdentifiers:K0.compareIdentifiers,rcompareIdentifiers:K0.rcompareIdentifiers}});var nk=z((vV,ug)=>{var lu=process||{},tk=lu.argv||[],cu=lu.env||{},aN=!(cu.NO_COLOR||tk.includes("--no-color"))&&(!!cu.FORCE_COLOR||tk.includes("--color")||lu.platform==="win32"||(lu.stdout||{}).isTTY&&cu.TERM!=="dumb"||!!cu.CI),uN=(t,e,n=t)=>i=>{let r=""+i,o=r.indexOf(e,t.length);return~o?t+cN(r,e,n,o)+e:t+r+e},cN=(t,e,n,i)=>{let r="",o=0;do r+=t.substring(o,i)+n,o=i+e.length,i=t.indexOf(e,o);while(~i);return r+t.substring(o)},rk=(t=aN)=>{let e=t?uN:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};ug.exports=rk();ug.exports.createColors=rk});var pg=z((ZV,xk)=>{"use strict";var hg={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let n="";return t<0?n+=`\x1B[${-t}D`:t>0&&(n+=`\x1B[${t}C`),e<0?n+=`\x1B[${-e}A`:e>0&&(n+=`\x1B[${e}B`),n},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},CN={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},zN={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let n=0;n<t;n++)e+=this.line+(n<t-1?hg.up():"");return t&&(e+=hg.left),e}};xk.exports={cursor:hg,scroll:CN,erase:zN,beep:"\x07"}});function fE(t,e){if(e<=1)return t;let n=Math.floor(t.length/e),i=new Int16Array(n);for(let r=0;r<n;r++){let o=0,s=r*e;for(let a=0;a<e;a++)o+=t[s+a];i[r]=Math.round(o/e)}return i}var Au,hE=v(()=>{"use strict";Au=class{step;pos=0;prev=0;primed=!1;constructor(e,n){if(e<=0||n<=0)throw new RangeError("resampler rates must be positive");this.step=e/n}process(e){if(e.length===0)return new Int16Array(0);let n=[],i=e.length-1,r=this.primed?this.pos:0;for(;;){let o=Math.floor(r);if(o+1>i)break;let s=o<0?this.prev:e[o],a=e[o+1];n.push(Math.round(s+(a-s)*(r-o))),r+=this.step}return this.prev=e[i],this.primed=!0,this.pos=r-e.length,Int16Array.from(n)}}});function mE(t){return t.byteLength/2/T4}function O4(t){let e=t.byteLength>>1,n=new DataView(t.buffer,t.byteOffset,t.byteLength),i=new Int16Array(e);for(let r=0;r<e;r++)i[r]=n.getInt16(r*2,!0);return i}var pE,T4,Pu,gE=v(()=>{"use strict";Ae();Ga();pE=32,T4=16,Pu=class{constructor(e,n,i={}){this.vad=e;this.onSpeech=n;this.speechThreshold=i.speechThreshold??.5,this.onsetMs=i.onsetMs??2*pE,this.holdoffMs=i.holdoffMs??300,this.energyThreshold=i.energyThreshold??.01,this.log=i.log??B}vad;onSpeech;speechThreshold;onsetMs;holdoffMs;energyThreshold;log;inSpeech=!1;speechRunMs=0;silenceRunMs=0;degraded=!1;closed=!1;feed(e){if(!(this.closed||e.byteLength===0)){if(this.degraded){this.applyVerdict(Gt(e,this.energyThreshold),mE(e));return}this.vad.process(O4(e)).then(n=>{if(!this.closed)for(let i of n)this.applyVerdict(i>=this.speechThreshold,pE)},n=>{this.closed||(this.degrade(n),this.applyVerdict(Gt(e,this.energyThreshold),mE(e)))})}}close(){this.closed=!0}applyVerdict(e,n){e?(this.silenceRunMs=0,this.speechRunMs+=n,!this.inSpeech&&this.speechRunMs>=this.onsetMs&&(this.inSpeech=!0,this.onSpeech())):(this.speechRunMs=0,this.inSpeech&&(this.silenceRunMs+=n,this.silenceRunMs>=this.holdoffMs&&(this.inSpeech=!1,this.silenceRunMs=0)))}degrade(e){this.degraded||(this.degraded=!0,this.log.debug("barge-in DEGRADED to energy onset - silero vad failed; speech onsets detect on RMS energy for the rest of the capture session",{error:e instanceof Error?e.message:String(e)}))}}});var zg={};He(zg,{DecibriCapture:()=>Pg,DecibriPlayback:()=>Cg,hasInputDevice:()=>C4});import{Microphone as A4,Speaker as P4,inputDevices as yE}from"decibri";function C4(){try{return yE().length>0}catch(t){return B.debug("audio input enumeration failed; treating as no microphone",{error:t}),!1}}function z4(){try{let t=yE(),e=t.find(n=>n.isDefault)??t[0];if(e&&e.defaultSampleRate>=1e3&&e.maxInputChannels>=1)return{sampleRate:Math.round(e.defaultSampleRate),channels:e.maxInputChannels}}catch(t){B.debug("could not read default input device; opening at 16k mono",{error:t})}return{sampleRate:po,channels:Cu}}function R4(t){return Math.max(64,Math.min(65536,Math.round(t/10)))}function N4(t,e,n){let i=new Uint8Array(t),r=new Int16Array(i.buffer,0,i.byteLength>>1),o=n.process(fE(r,e));return Buffer.from(o.buffer,o.byteOffset,o.byteLength)}function U4(t){return Buffer.from(t.buffer,t.byteOffset,t.byteLength)}var po,Cu,_E,vE,Pg,D4,L4,Cg,Rg=v(()=>{"use strict";Ae();Ga();hE();gE();po=16e3,Cu=1,_E="int16",vE=.01;Pg=class{constructor(e={}){this.deps=e}deps;mic=null;onData=null;onSpeech=null;onErr=null;vad=null;detector=null;async start(e){let{sampleRate:n,channels:i}=z4(),r=(this.deps.createVad??(()=>new br))(),o=null;try{await r.load(),o=new Pu(r,()=>e.onSpeechStart(),{energyThreshold:vE})}catch(u){B.debug("silero vad unavailable; barge-in falls back to decibri energy vad",{error:u}),r.dispose().catch(()=>{})}let s;try{s=await A4.open({sampleRate:n,channels:i,dtype:_E,...o?{vad:!1}:{vad:"energy",vadThreshold:vE},framesPerBuffer:R4(n)})}catch(u){throw o?.close(),o&&r.dispose().catch(()=>{}),u}this.vad=o?r:null,this.detector=o;let a=n===po&&i===Cu?null:new Au(n,po);this.onData=a?u=>{let c=N4(u,i,a);c.byteLength>0&&(this.detector?.feed(c),e.onFrame(c,Date.now()))}:u=>{this.detector?.feed(u),e.onFrame(u,Date.now())},this.onSpeech=()=>e.onSpeechStart(),this.onErr=u=>e.onError(u),s.on("data",this.onData),s.on("speech",this.onSpeech),s.on("error",this.onErr),this.mic=s}async stop(){let e=this.mic;this.mic=null,this.detector?.close(),this.detector=null,e&&(this.onData&&e.removeListener("data",this.onData),this.onSpeech&&e.removeListener("speech",this.onSpeech),this.onErr&&e.removeListener("error",this.onErr),e.on("error",()=>{}),e.stop()),this.onData=null,this.onSpeech=null,this.onErr=null;let n=this.vad;this.vad=null,n&&await n.dispose().catch(()=>{})}},D4=po*Cu*2/1e3,L4=250,Cg=class{speaker=null;writeChain=Promise.resolve();generation=0;closed=!1;playoutEndAtMs=0;drainWakes=new Set;play(e){if(this.closed)return;let n=this.generation;this.writeChain=this.writeChain.then(async()=>{if(!(this.closed||n!==this.generation))try{if(await this.ensureSpeaker().writeAsync(U4(e)),this.closed||n!==this.generation)return;this.playoutEndAtMs=Math.max(this.playoutEndAtMs,Date.now())+e.byteLength/D4}catch(i){B.debug("playback write skipped",{error:i})}})}flush(){this.generation++,this.playoutEndAtMs=0;let e=this.speaker;this.speaker=null,e?.stop();for(let n of[...this.drainWakes])n()}async drained(){await this.writeChain;let e=this.speaker;if(!e)return;let n=Promise.resolve().then(()=>e.drainAsync()).catch(s=>{B.debug("playback drain interrupted",{error:s})}),i=Math.max(0,this.playoutEndAtMs-Date.now())+L4,r=this.sleep(i);await Promise.race([n,r.done]),r.wake();let o=this.playoutEndAtMs-Date.now();o>0&&await this.sleep(o).done}sleep(e){let n;return{done:new Promise(r=>{let o=setTimeout(()=>n(),e);n=()=>{clearTimeout(o),this.drainWakes.delete(n),r()},this.drainWakes.add(n)}),wake:n}}close(){return this.closed=!0,this.flush(),Promise.resolve()}ensureSpeaker(){return this.speaker??=new P4({sampleRate:po,channels:Cu,dtype:_E}),this.speaker}}});Ae();Ga();ki();import{readFileSync as j4}from"node:fs";import{randomUUID as M4}from"node:crypto";var mt=class extends Error{constructor(e,n,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=n,this.exitCode=e,this.nestedError=void 0}},Ot=class extends mt{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var Xi=class{constructor(e,n){switch(this.description=n||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,n){return n===this.defaultValue||!Array.isArray(n)?[e]:(n.push(e),n)}default(e,n){return this.defaultValue=e,this.defaultValueDescription=n,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(n,i)=>{if(!this.argChoices.includes(n))throw new Ot(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(n,i):n},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Wa(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}import{EventEmitter as WP}from"node:events";import Fm from"node:child_process";import At from"node:path";import Ha from"node:fs";import G from"node:process";import{stripVTControlCharacters as qP}from"node:util";import{stripVTControlCharacters as ZP}from"node:util";var Qi=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let n=e.commands.filter(r=>!r._hidden),i=e._getHelpCommand();return i&&!i._hidden&&n.push(i),this.sortSubcommands&&n.sort((r,o)=>r.name().localeCompare(o.name())),n}compareOptions(e,n){let i=r=>r.short?r.short.replace(/^-/,""):r.long.replace(/^--/,"");return i(e).localeCompare(i(n))}visibleOptions(e){let n=e.options.filter(r=>!r.hidden),i=e._getHelpOption();if(i&&!i.hidden){let r=i.short&&e._findOption(i.short),o=i.long&&e._findOption(i.long);!r&&!o?n.push(i):i.long&&!o?n.push(e.createOption(i.long,i.description)):i.short&&!r&&n.push(e.createOption(i.short,i.description))}return this.sortOptions&&n.sort(this.compareOptions),n}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let n=[];for(let i=e.parent;i;i=i.parent){let r=i.options.filter(o=>!o.hidden);n.push(...r)}return this.sortOptions&&n.sort(this.compareOptions),n}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(n=>{n.description=n.description||e._argsDescription[n.name()]||""}),e.registeredArguments.find(n=>n.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(i=>Wa(i)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(n?" "+n:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,n){return n.visibleCommands(e).reduce((i,r)=>Math.max(i,this.displayWidth(n.styleSubcommandTerm(n.subcommandTerm(r)))),0)}longestOptionTermLength(e,n){return n.visibleOptions(e).reduce((i,r)=>Math.max(i,this.displayWidth(n.styleOptionTerm(n.optionTerm(r)))),0)}longestGlobalOptionTermLength(e,n){return n.visibleGlobalOptions(e).reduce((i,r)=>Math.max(i,this.displayWidth(n.styleOptionTerm(n.optionTerm(r)))),0)}longestArgumentTermLength(e,n){return n.visibleArguments(e).reduce((i,r)=>Math.max(i,this.displayWidth(n.styleArgumentTerm(n.argumentTerm(r)))),0)}commandUsage(e){let n=e._name;e._aliases[0]&&(n=n+"|"+e._aliases[0]);let i="";for(let r=e.parent;r;r=r.parent)i=r.name()+" "+i;return i+n+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let n=[];if(e.argChoices&&n.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&n.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&n.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&n.push(`env: ${e.envVar}`),n.length>0){let i=`(${n.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}argumentDescription(e){let n=[];if(e.argChoices&&n.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&n.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),n.length>0){let i=`(${n.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}formatItemList(e,n,i){return n.length===0?[]:[i.styleTitle(e),...n,""]}groupItems(e,n,i){let r=new Map;return e.forEach(o=>{let s=i(o);r.has(s)||r.set(s,[])}),n.forEach(o=>{let s=i(o);r.has(s)||r.set(s,[]),r.get(s).push(o)}),r}formatHelp(e,n){let i=n.padWidth(e,n),r=n.helpWidth??80;function o(d,f){return n.formatItem(d,i,f,n)}let s=[`${n.styleTitle("Usage:")} ${n.styleUsage(n.commandUsage(e))}`,""],a=n.commandDescription(e);a.length>0&&(s=s.concat([n.boxWrap(n.styleCommandDescription(a),r),""]));let u=n.visibleArguments(e).map(d=>o(n.styleArgumentTerm(n.argumentTerm(d)),n.styleArgumentDescription(n.argumentDescription(d))));if(s=s.concat(this.formatItemList("Arguments:",u,n)),this.groupItems(e.options,n.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,f)=>{let h=d.map(p=>o(n.styleOptionTerm(n.optionTerm(p)),n.styleOptionDescription(n.optionDescription(p))));s=s.concat(this.formatItemList(f,h,n))}),n.showGlobalOptions){let d=n.visibleGlobalOptions(e).map(f=>o(n.styleOptionTerm(n.optionTerm(f)),n.styleOptionDescription(n.optionDescription(f))));s=s.concat(this.formatItemList("Global Options:",d,n))}return this.groupItems(e.commands,n.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,f)=>{let h=d.map(p=>o(n.styleSubcommandTerm(n.subcommandTerm(p)),n.styleSubcommandDescription(n.subcommandDescription(p))));s=s.concat(this.formatItemList(f,h,n))}),s.join(`
188
- `)}displayWidth(e){return ZP(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(n=>n==="[options]"?this.styleOptionText(n):n==="[command]"?this.styleSubcommandText(n):n[0]==="["||n[0]==="<"?this.styleArgumentText(n):this.styleCommandText(n)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(n=>n==="[options]"?this.styleOptionText(n):n[0]==="["||n[0]==="<"?this.styleArgumentText(n):this.styleSubcommandText(n)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,n){return Math.max(n.longestOptionTermLength(e,n),n.longestGlobalOptionTermLength(e,n),n.longestSubcommandTermLength(e,n),n.longestArgumentTermLength(e,n))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,n,i,r){let s=" ".repeat(2);if(!i)return s+e;let a=e.padEnd(n+e.length-r.displayWidth(e)),u=2,l=(this.helpWidth??80)-n-u-2,d;return l<this.minWidthToWrap||r.preformatted(i)?d=i:d=r.boxWrap(i,l).replace(/\n/g,`
187
+ `,Qt=class extends Error{status;constructor(e,n){super(e),this.status=n,this.name="TurnEvaluatorError"}},Dn=class{key;fetchImpl;timeoutMs;constructor(e,n=fetch,i=2e3){this.key=e,this.fetchImpl=n,this.timeoutMs=i}async evaluate(e,n){let i={model:CP,max_tokens:64,temperature:0,stop_sequences:NP,system:LP,messages:[{role:"user",content:UP(e)},{role:"assistant",content:tS}]},r=await this.fetchImpl(RP,{method:"POST",headers:{"x-api-key":this.key,"anthropic-version":zP,"content-type":"application/json"},body:JSON.stringify(i),signal:AbortSignal.any([n,AbortSignal.timeout(this.timeoutMs)])});if(!r.ok)throw new Qt(`turn evaluator request failed (HTTP ${r.status})`,r.status);let o;try{o=await r.json()}catch{throw new Qt("turn evaluator response body was not JSON")}return jP(o)}}});var rS,Nm,Dm=v(()=>{"use strict";rS="21m00Tcm4TlvDq8ikWAM",Nm={id:"jarvis-primary",engineVoice:{"elevenlabs-flash":{kind:"preset",voiceId:rS}}}});var Qa,nS=v(()=>{"use strict";we();Qa=class{turnId;openedAtMs;log;terminal=!1;heldOpen=!1;asideCommit=!1;decider=null;silenceOnsetAtMs=null;commitAtMs=null;asrFinalAtMs=null;transcriptLength=null;firstDeltaAtMs=null;firstAudioAtMs=null;constructor(e,n,i=B){this.turnId=e,this.openedAtMs=n,this.log=i}endpointerCommitted(e,n){this.decider===null&&(this.decider=e,this.silenceOnsetAtMs=n)}smartTurnResolved(e,n,i){this.log.debug("smart-turn P(complete)",{turnId:this.turnId,probability:e,inferenceMs:n,outcome:i})}smartTurnDegraded(e,n){this.log.debug("smart-turn DEGRADED to baseline - inference failed; this turn endpoints on baseline timers only",{turnId:this.turnId,inferenceMs:e,error:n instanceof Error?n.message:String(n)})}strongHoldRecognized(e){this.log.debug("lexical STRONG hold recognized - completeness vetoed, silence budget biases long",{turnId:this.turnId,cue:e})}strongHoldClearDebounced(e){this.log.debug("strong hold clear debounced - cue absent from one re-decode partial; veto holds pending a second",{turnId:this.turnId,cue:e})}heldEntered(e){this.heldOpen=!0,this.log.debug("floor-held mode entered - silence budgets escalate, stop cap suspended",{turnId:this.turnId,cue:e})}heldLadderRearmed(e){this.log.debug("held silence budget re-armed at the next ladder step",{turnId:this.turnId,budgetMs:e})}heldExited(e){this.heldOpen=!1,this.log.debug("floor-held mode exited",{turnId:this.turnId,reason:e})}evaluatorFired(e){this.log.debug("semantic evaluator fired - smart-turn resolved in a gated band during a live silence episode",{turnId:this.turnId,band:e})}evaluatorResolved(e,n,i,r){this.log.debug("semantic evaluator resolved",{turnId:this.turnId,verdict:e,confidence:n,latencyMs:i,outcome:r})}evaluatorFailed(e,n){this.log.debug("semantic evaluator failed - no signal; this episode endpoints as armed",{turnId:this.turnId,latencyMs:e,error:n instanceof Error?n.message:String(n)})}committed(e,n){this.commitAtMs===null&&(n==="ptt"&&this.heldOpen&&this.heldExited("ptt"),this.commitAtMs=e,n==="ptt"&&(this.decider??="ptt"))}asrFinalResolved(e,n){this.asrFinalAtMs===null&&(this.asrFinalAtMs=e,this.transcriptLength=n)}firstReasonerDelta(e){this.firstDeltaAtMs??=e}firstTtsAudio(e){this.firstAudioAtMs??=e}addresseeFired(){this.log.debug("addressee evaluator fired - racing the reply for the pre-audio veto",{turnId:this.turnId})}addresseeResolved(e,n,i,r){this.log.debug("addressee evaluator resolved",{turnId:this.turnId,verdict:e,confidence:n,latencyMs:i,outcome:r})}addresseeFailed(e,n){this.log.debug("addressee evaluator failed - no signal; the reply speaks",{turnId:this.turnId,latencyMs:e,error:n instanceof Error?n.message:String(n)})}markAsideCommit(){this.asideCommit=!0}confirmationFired(){this.log.debug("aside confirmation fired - the lexical wakeword opened the gate",{turnId:this.turnId})}confirmationResolved(e,n,i,r){this.log.debug("aside confirmation resolved",{turnId:this.turnId,verdict:e,confidence:n,latencyMs:i,outcome:r})}confirmationFailed(e,n){this.log.debug("aside confirmation failed - torn with the name spoken: resuming",{turnId:this.turnId,latencyMs:e,error:n instanceof Error?n.message:String(n)})}completed(e){this.terminal||(this.terminal=!0,this.log.debug("voice turn summary",{turnId:this.turnId,decider:this.decider,disposition:"dispatched",...this.asideCommit&&{floor:"aside"},silenceToCommitMs:this.spanMs(this.silenceOnsetAtMs,this.commitAtMs),commitToFinalMs:this.spanMs(this.commitAtMs,this.asrFinalAtMs),finalToFirstDeltaMs:this.spanMs(this.asrFinalAtMs,this.firstDeltaAtMs),firstDeltaToFirstAudioMs:this.spanMs(this.firstDeltaAtMs,this.firstAudioAtMs),totalMs:e-this.openedAtMs,transcriptLength:this.transcriptLength}))}absorbed(e){this.terminal||(this.terminal=!0,this.log.debug("voice turn absorbed - not addressed to Jarvis; no reply spoken",{turnId:this.turnId,decider:this.decider,disposition:"absorbed",silenceToCommitMs:this.spanMs(this.silenceOnsetAtMs,this.commitAtMs),commitToFinalMs:this.spanMs(this.commitAtMs,this.asrFinalAtMs),totalMs:e-this.openedAtMs,transcriptLength:this.transcriptLength}))}asideAbsorbed(e){this.terminal||(this.terminal=!0,this.log.debug("voice turn absorbed in the aside - no reply spoken",{turnId:this.turnId,decider:this.decider,disposition:"absorbed",floor:"aside",silenceToCommitMs:this.spanMs(this.silenceOnsetAtMs,this.commitAtMs),commitToFinalMs:this.spanMs(this.commitAtMs,this.asrFinalAtMs),totalMs:e-this.openedAtMs,transcriptLength:this.transcriptLength}))}blank(e){this.terminal||(this.terminal=!0,this.log.debug("voice turn blank - terminated silently (no transcribed speech)",{turnId:this.turnId,decider:this.decider,silenceToCommitMs:this.spanMs(this.silenceOnsetAtMs,this.commitAtMs),commitToFinalMs:this.spanMs(this.commitAtMs,this.asrFinalAtMs),totalMs:e-this.openedAtMs,transcriptLength:this.transcriptLength}))}spanMs(e,n){return e===null||n===null?null:n-e}}});function BP(t){return ZP.test(t)}var iS,oS,FP,VP,eu,ZP,tu,sS=v(()=>{"use strict";La();nS();iS=16e3,oS="pcm_s16le",FP="en",VP=["Jarvis"],eu=.7,ZP=/\bjarvis\b/i;tu=class{deps;asrStream;ttsStream=null;reasonAbort=new AbortController;phase="capturing";settled=!1;finalizing=!1;lastFrameAtMs;timeline;pendingDispatch=null;absorbPending=null;constructor(e){this.deps=e,this.lastFrameAtMs=e.startMs,this.timeline=new Qa(e.turnId,e.clock.now()),e.controller.attachTelemetry?.(this.timeline),e.controller.setPartialStability?.(e.asrEngine.partialStability??"stable"),this.asrStream=e.asrEngine.open({sampleRate:iS,encoding:oS,language:FP,biasTerms:VP,emitPartials:!0}),this.asrStream.onTranscript(n=>this.handleTranscript(n)),this.asrStream.onError(n=>this.finishError("turn_failed",n)),e.controller.onCommit(()=>this.finalize(this.lastFrameAtMs,"controller")),e.emit({type:"state",turnId:e.turnId,state:"processing"})}pushFrame(e,n){this.phase!=="capturing"||this.settled||(this.lastFrameAtMs=n,this.asrStream.pushAudio(e),this.deps.controller.onAudioFrame(e))}endAudio(e){this.finalize(e,"ptt")}cancel(){this.settled||(this.settled=!0,this.phase="cancelled",this.deps.controller.dispose(),this.reasonAbort.abort(),this.asrStream.abort(),this.ttsStream?.cancel(),this.deps.onComplete())}handleTranscript(e){this.phase!=="capturing"||this.settled||e.isFinal||(this.deps.emit({type:"transcript.partial",turnId:this.deps.turnId,text:e.text}),this.deps.controller.onPartial(e.text))}finalize(e,n){this.phase!=="capturing"||this.finalizing||this.settled||(this.finalizing=!0,this.timeline.committed(this.deps.clock.now(),n),this.deps.controller.dispose(),this.finalizeAndRespond(e,n))}async finalizeAndRespond(e,n){let i;try{i=await this.asrStream.end()}catch(s){if(this.settled)return;this.finishError("turn_failed",s);return}if(this.settled)return;this.timeline.asrFinalResolved(this.deps.clock.now(),i.text.length);let r=this.deps.addressee;if(n==="ptt"&&r?.floorState()==="aside")try{r.onFloorReleased("explicit")}catch{}if(i.text.trim()===""){this.finishBlank();return}this.phase="responding";let o=this.buildUserTurn(i.text,e);if(r?.floorState()==="aside")return this.runAside(o,r);r?(this.pendingDispatch={turn:o,deltas:[],audio:[]},this.fireAddressee(o)):this.emitDispatch(o);try{await this.respond(o.text)}catch(s){if(this.settled)return;if(this.absorbPending){this.finishAbsorbed();return}this.finishError("turn_failed",s);return}this.settled||this.finishDone()}async runAside(e,n){if(this.timeline.markAsideCommit(),!BP(e.text)){this.finishAsideAbsorbed(e,n);return}let i=this.deps.clock.now();this.timeline.confirmationFired();let r;try{r=await n.evaluator.evaluate({recentTurns:n.recentTurns(),utterance:e.text},this.reasonAbort.signal,{timeoutMs:3e3})}catch(s){if(this.settled)return;this.timeline.confirmationFailed(this.deps.clock.now()-i,s)}if(this.settled)return;let o=!0;if(r&&(o=!((r.verdict==="to_other"||r.verdict==="self_talk")&&r.confidence>=eu),this.timeline.confirmationResolved(r.verdict,r.confidence,this.deps.clock.now()-i,o?"resumed":"stayed")),!o){this.finishAsideAbsorbed(e,n,r);return}try{n.onFloorReleased("resume")}catch{}this.emitDispatch(e);try{await this.respond(e.text)}catch(s){if(this.settled)return;this.finishError("turn_failed",s);return}this.settled||this.finishDone()}emitDispatch(e){this.deps.emit({type:"turn.final",turnId:this.deps.turnId,turn:e,...this.deps.commandId!==void 0&&{commandId:this.deps.commandId}}),this.deps.emit({type:"state",turnId:this.deps.turnId,state:"responding"})}resolveDispatched(){let e=this.pendingDispatch;if(e){this.pendingDispatch=null,this.emitDispatch(e.turn);for(let n of e.deltas)this.deps.emit({type:"response.delta",turnId:this.deps.turnId,text:n});for(let n of e.audio)this.deps.emit({type:"response.audio",turnId:this.deps.turnId,audio:n})}}fireAddressee(e){let n=this.deps.addressee;if(!n)return;let i=this.deps.clock.now();this.timeline.addresseeFired();try{n.evaluator.evaluate({recentTurns:n.recentTurns(),utterance:e.text},this.reasonAbort.signal).then(r=>this.onAddresseeVerdict(r.verdict,r.confidence,this.deps.clock.now()-i),r=>this.onAddresseeFailed(this.deps.clock.now()-i,r))}catch(r){this.onAddresseeFailed(this.deps.clock.now()-i,r)}}onAddresseeVerdict(e,n,i){if(this.settled||this.pendingDispatch===null){this.timeline.addresseeResolved(e,n,i,"late");return}if(!(e==="to_other"||e==="self_talk")||n<eu){this.timeline.addresseeResolved(e,n,i,"agreed"),this.resolveDispatched();return}this.absorbPending={verdict:e,confidence:n,latencyMs:i},this.reasonAbort.abort()}onAddresseeFailed(e,n){this.settled||(this.timeline.addresseeFailed(e,n),this.resolveDispatched())}async respond(e){let n=!1,i=!1,r=this.deps.ttsEngine.speak({voice:this.deps.voice,sampleRate:iS,encoding:oS});this.ttsStream=r,r.onAudio(s=>{if(!this.settled){if(i||(i=!0,this.timeline.firstTtsAudio(this.deps.clock.now())),this.absorbPending){this.pendingDispatch?.audio.push(s);return}this.resolveDispatched(),this.deps.emit({type:"response.audio",turnId:this.deps.turnId,audio:s})}}),r.onError(s=>this.finishError("turn_failed",s));let o=this.deps.reasoner.run(e,this.reasonAbort.signal,{register:"voice"});for await(let s of o){if(this.settled)return;if(this.absorbPending){this.finishAbsorbed();return}n||(n=!0,this.timeline.firstReasonerDelta(this.deps.clock.now())),this.pendingDispatch?this.pendingDispatch.deltas.push(s.text):this.deps.emit({type:"response.delta",turnId:this.deps.turnId,text:s.text});for(let a of this.deps.segmenter.push(s.text))r.pushText(a)}if(!this.settled){if(this.absorbPending){let{verdict:s,confidence:a,latencyMs:u}=this.absorbPending;this.absorbPending=null,this.timeline.addresseeResolved(s,a,u,"late")}this.resolveDispatched();for(let s of this.deps.segmenter.flush())r.pushText(s);await r.end()}}finishBlank(){this.settled||(this.settled=!0,this.timeline.blank(this.deps.clock.now()),this.deps.onComplete())}finishAbsorbed(){if(this.settled)return;let e=this.pendingDispatch,n=this.absorbPending;if(!e||!n){this.finishError("turn_failed",new Error("absorb arbitration without a live veto"));return}this.settled=!0,this.phase="cancelled",this.pendingDispatch=null,this.absorbPending=null,this.reasonAbort.abort(),this.ttsStream?.cancel(),this.timeline.addresseeResolved(n.verdict,n.confidence,n.latencyMs,"vetoed"),this.timeline.absorbed(this.deps.clock.now()),this.deps.emit({type:"turn.final",turnId:this.deps.turnId,turn:{...e.turn,disposition:"absorbed"},...this.deps.commandId!==void 0&&{commandId:this.deps.commandId}}),this.deps.onComplete();try{this.deps.addressee?.onAbsorbed(e.turn.text,{verdict:n.verdict,confidence:n.confidence})}catch{}}finishAsideAbsorbed(e,n,i){if(!this.settled){this.settled=!0,this.phase="cancelled",this.timeline.asideAbsorbed(this.deps.clock.now()),this.deps.emit({type:"turn.final",turnId:this.deps.turnId,turn:{...e,disposition:"absorbed"},...this.deps.commandId!==void 0&&{commandId:this.deps.commandId}}),this.deps.onComplete();try{n.onAbsorbed(e.text,i)}catch{}}}finishDone(){this.settled||(this.settled=!0,this.timeline.completed(this.deps.clock.now()),this.deps.emit({type:"response.done",turnId:this.deps.turnId}),this.deps.onComplete())}finishError(e,n){this.settled||(this.settled=!0,this.absorbPending=null,this.resolveDispatched(),this.deps.controller.dispose(),this.reasonAbort.abort(),this.ttsStream?.cancel(),this.deps.emit({type:"error",turnId:this.deps.turnId,...this.deps.commandId!==void 0&&{commandId:this.deps.commandId},reason:e,message:n instanceof Error?n.message:String(n)}),this.deps.onComplete())}buildUserTurn(e,n){return{source:"voice",turnId:this.deps.turnId,sessionId:this.deps.sessionId,deviceId:this.deps.deviceId,text:e,startMs:this.deps.startMs,endMs:n,...this.deps.projectId!==void 0&&{projectId:this.deps.projectId}}}}});import{randomUUID as Lm}from"node:crypto";var Um,jm,Ln,to,ru,aS=v(()=>{"use strict";we();Pi();Na();Zp();px();La();Gp();fa();mn();wm();Om();Cm();zm();Dm();sS();Um=6,jm=45e3,Ln=class extends Error{constructor(e){super(e),this.name="ReasonerUnavailableError"}},to=class extends Error{constructor(e){super(e),this.name="VoiceUnavailableError"}},ru=class{deps;sessionId;deviceId;projectId;queue=new Da;closed=!1;eventsConsumed=!1;inFlight=!1;reasoner=null;reasonerRoute=null;turnAbort=null;voiceTurn=null;voiceTurnFailed=!1;voiceEngines=null;clock;newTurnController;newSmartTurnInference;newFrameClassifier;newTurnEvaluator;newSegmenter;voiceIdentity;smartTurnInference=null;frameClassifier=null;turnEvaluator=void 0;newAddresseeEvaluator;addresseeEvaluator=void 0;absorbedFinals=[];floorState="engaged";asideDecayTimer=null;lastSpeechAtMs=0;constructor(e,n,i){this.deps=i,this.sessionId=e,this.deviceId=n.deviceId,this.projectId=n.projectId,this.clock=i.clock??new gr,this.newSmartTurnInference=i.createSmartTurnInference??(()=>new eo),this.newFrameClassifier=i.createFrameClassifier??(()=>new Ri(new Er)),this.newTurnEvaluator=i.createTurnEvaluator??(r=>new Dn(r)),this.newAddresseeEvaluator=i.createAddresseeEvaluator??(r=>new On(r)),this.newTurnController=i.createTurnController??(r=>{let o=this.ensureFrameClassifier();return o.reset?.(),new Qi(r,this.ensureSmartTurnInference(),{},this.speechObservingClassifier(o),this.semanticHook())}),this.newSegmenter=i.createSegmenter??(()=>new Gi),this.voiceIdentity=i.voiceIdentity??Nm,this.emit({type:"session.ready"})}async send(e){let{commandId:n}=e;if(this.closed)throw new Le(n,"closed");if(e.sessionId!==this.sessionId)throw new Le(n,"invalid","command sessionId does not match session");switch(e.type){case"input.text":this.acceptTextInput(e);return;case"input.audio.frame":this.acceptAudioFrame(e);return;case"input.audio.end":this.endAudioInput(e);return;case"turn.cancel":this.cancelTurn(e);return;case"session.close":return this.close();case"approval.resolve":throw new Le(n,"unsupported");default:throw new Le(n,"invalid")}}events(){if(this.eventsConsumed)throw new Error("CoreSession.events() supports a single consumer in v0.1");return this.eventsConsumed=!0,this.queue.drain()}close(){if(!this.closed){this.closed=!0,this.turnAbort?.abort(),this.voiceTurn?.cancel(),this.asideDecayTimer!==null&&(this.clock.clearTimer(this.asideDecayTimer),this.asideDecayTimer=null);let e=this.smartTurnInference;this.smartTurnInference=null;let n=this.frameClassifier;this.frameClassifier=null;let i=this.turnEvaluator;this.turnEvaluator=null;let r=this.addresseeEvaluator;this.addresseeEvaluator=null,this.queue.close();let o=[];if(e&&o.push(e.dispose().catch(()=>{})),n?.dispose&&o.push(n.dispose().catch(()=>{})),i?.dispose&&o.push(i.dispose().catch(()=>{})),r?.dispose&&o.push(r.dispose().catch(()=>{})),o.length>0)return Promise.all(o).then(()=>{})}return Promise.resolve()}acceptTextInput(e){if(e.text.trim().length===0)throw new Le(e.commandId,"invalid","input.text requires non-empty text");if(this.inFlight)throw new Le(e.commandId,"backpressured","a turn is already in progress (one turn at a time in v0.1)");this.inFlight=!0,this.exitAside("explicit");let n=Lm();this.emit({type:"turn.accepted",turnId:n,clientTurnId:e.clientTurnId,source:"text",commandId:e.commandId}),this.emit({type:"turn.final",turnId:n,turn:this.toTextUserTurn(n,e),commandId:e.commandId}),this.runTextTurn(n,e)}async runTextTurn(e,n){let i=new AbortController;this.turnAbort=i;try{let r=this.ensureReasoner();this.emit({type:"state",turnId:e,state:"responding"});for await(let o of r.run(n.text,i.signal))this.emit({type:"response.delta",turnId:e,text:o.text});this.emit({type:"response.done",turnId:e})}catch(r){let o=r instanceof Ln?"no_text_route":"turn_failed";this.emit({type:"error",turnId:e,commandId:n.commandId,reason:o,message:r instanceof Error?r.message:String(r)})}finally{this.inFlight=!1,this.turnAbort=null}}acceptAudioFrame(e){if(this.voiceTurn){this.voiceTurn.pushFrame(e.audio,e.atMs);return}if(this.voiceTurnFailed)return;if(this.inFlight)throw new Le(e.commandId,"backpressured","a turn is already in progress (one turn at a time in v0.1)");this.inFlight=!0;let n=Lm();this.emit({type:"turn.accepted",turnId:n,clientTurnId:e.clientTurnId,source:"voice",commandId:e.commandId});let i=this.resolveVoicePipeline(n,e.commandId);if(!i){this.voiceTurnFailed=!0;return}let r=this.addresseeHook();this.voiceTurn=new tu({turnId:n,sessionId:this.sessionId,deviceId:this.deviceId,...this.projectId!==void 0&&{projectId:this.projectId},commandId:e.commandId,startMs:e.atMs,asrEngine:i.engines.asrEngine,ttsEngine:i.engines.ttsEngine,voice:this.voiceIdentity,reasoner:i.reasoner,controller:this.newTurnController(this.clock),segmenter:this.newSegmenter(),clock:this.clock,emit:o=>this.emit(o),...r!==void 0&&{addressee:r},onComplete:()=>this.completeVoiceTurn()}),this.smartTurnInference?.prewarm?.(),this.frameClassifier?.prewarm?.(),this.voiceTurn.pushFrame(e.audio,e.atMs)}endAudioInput(e){if(this.voiceTurnFailed){this.resetVoiceFailure();return}if(this.voiceTurn){this.voiceTurn.endAudio(e.atMs);return}this.exitAside("explicit")}cancelTurn(e){if(this.voiceTurnFailed){this.resetVoiceFailure();return}this.voiceTurn?.cancel()}completeVoiceTurn(){this.voiceTurn=null,this.inFlight=!1}resetVoiceFailure(){this.voiceTurnFailed=!1}resolveVoicePipeline(e,n){let i;try{i=this.ensureVoiceEngines()}catch(o){return this.emitTurnError(e,n,"no_voice_route",o),null}let r;try{r=this.ensureReasoner()}catch(o){let s=o instanceof Ln?"no_text_route":"turn_failed";return this.emitTurnError(e,n,s,o),null}return{engines:i,reasoner:r}}ensureVoiceEngines(){if(this.voiceEngines)return this.voiceEngines;if(!this.deps.voiceRegistry)throw new to("voice is not available in this core build");let e=this.deps.configService.resolved(),n=e.routes?.stt,i=e.routes?.tts;if(!n||!i)throw new to("no voice route configured - run 'jarvis init' to set routes.stt and routes.tts");let r=!e.secrets?.[n.provider]&&Zi(n.provider),o=!e.secrets?.[i.provider]&&Zi(i.provider);if(r||o){let u=r?n.provider:i.provider;throw new to(`no API key for voice provider '${u}' - run 'jarvis init' to add it`)}let s=this.deps.voiceRegistry.asrEngine({provider:n.provider,model:n.model,...n.url!==void 0&&{url:n.url}},e.secrets?.[n.provider]??""),a=this.deps.voiceRegistry.ttsEngine({provider:i.provider,model:i.model},e.secrets?.[i.provider]??"");return this.voiceEngines={asrEngine:s,ttsEngine:a},this.voiceEngines}ensureSmartTurnInference(){return this.smartTurnInference??=this.newSmartTurnInference(),this.smartTurnInference}ensureFrameClassifier(){return this.frameClassifier??=this.newFrameClassifier(),this.frameClassifier}semanticHook(){if(this.turnEvaluator===void 0){let n=this.reasonerRoute;this.turnEvaluator=n?.provider==="anthropic"?this.newTurnEvaluator(n.key):null}return this.turnEvaluator===null?void 0:{evaluator:this.turnEvaluator,recentTurns:()=>{let n=[];for(let i of this.reasoner?.historySnapshot()??[])(i.role==="user"||i.role==="assistant")&&n.push({role:i.role,text:i.content});return n.slice(-Um)}}}addresseeHook(){if(this.addresseeEvaluator===void 0){let n=this.reasonerRoute;try{this.addresseeEvaluator=n?.provider==="anthropic"?this.newAddresseeEvaluator(n.key):null}catch(i){this.addresseeEvaluator=null,B.debug("addressee evaluator construction failed - the layer is absent",{error:i instanceof Error?i.message:String(i)})}}return this.addresseeEvaluator===null?void 0:{evaluator:this.addresseeEvaluator,recentTurns:()=>this.addresseeContext(),onAbsorbed:(n,i)=>{this.recordAbsorbedFinal(n),this.noteSpeech(),i?.verdict==="to_other"&&i.confidence>=eu&&this.enterAside(i.confidence)},floorState:()=>this.floorState,onFloorReleased:n=>this.exitAside(n)}}enterAside(e){this.floorState!=="aside"&&(this.floorState="aside",this.noteSpeech(),this.armAsideDecay(jm),B.debug("aside entered - confident to_other; utterances now absorb by default",{confidence:e}),this.emit({type:"state",state:"aside"}))}exitAside(e){this.floorState==="aside"&&(this.floorState="engaged",this.asideDecayTimer!==null&&(this.clock.clearTimer(this.asideDecayTimer),this.asideDecayTimer=null),B.debug("aside exited",{reason:e}))}armAsideDecay(e){this.asideDecayTimer!==null&&this.clock.clearTimer(this.asideDecayTimer),this.asideDecayTimer=this.clock.setTimer(e,()=>this.asideDecayElapsed())}asideDecayElapsed(){if(this.asideDecayTimer=null,this.floorState!=="aside")return;let e=this.clock.now()-this.lastSpeechAtMs;e>=jm?this.exitAside("decay"):this.armAsideDecay(jm-e)}noteSpeech(){this.lastSpeechAtMs=this.clock.now()}speechObservingClassifier(e){return{classify:(n,i)=>e.classify(n,r=>{r&&this.noteSpeech(),i(r)})}}addresseeContext(){let e=this.reasoner?.historySnapshot()??[],n=[],i=0;for(let r=0;r<=e.length;r++){for(;i<this.absorbedFinals.length&&this.absorbedFinals[i].afterHistoryLen===r;)n.push({role:"user",text:this.absorbedFinals[i].text}),i+=1;let o=e[r];o&&(o.role==="user"||o.role==="assistant")&&n.push({role:o.role,text:o.content})}return n.slice(-Um)}recordAbsorbedFinal(e){this.absorbedFinals.push({afterHistoryLen:this.reasoner?.historySnapshot().length??0,text:e}),this.absorbedFinals.length>Um&&this.absorbedFinals.shift()}ensureReasoner(){if(this.reasoner)return this.reasoner;let e=this.deps.configService.resolved(),n=e.routes?.text;if(!n)throw new Ln("no text model is configured - run 'jarvis init' to set routes.text");let i=e.secrets?.[n.provider];if(!i)throw new Ln(`no API key for text provider '${n.provider}' - run 'jarvis init' to add it`);let r=this.deps.registry.textAdapter({provider:n.provider,model:n.model},i);return this.reasoner=new Bi(r,n.model,this.deps.systemPrompt),this.reasonerRoute={provider:n.provider,key:i},this.reasoner}toTextUserTurn(e,n){return{source:"text",turnId:e,sessionId:this.sessionId,deviceId:this.deviceId,text:n.text,atMs:n.atMs,...this.projectId!==void 0&&{projectId:this.projectId}}}emitTurnError(e,n,i,r){this.emit({type:"error",turnId:e,commandId:n,reason:i,message:r instanceof Error?r.message:String(r)}),this.inFlight=!1}emit(e){this.queue.push({...e,sessionId:this.sessionId,eventId:Lm(),atMs:Date.now()})}}});function GP(t,e,n){let i=new URL(t);i.searchParams.set("model_id",e),i.searchParams.set("audio_format",WP(n)),i.searchParams.set("commit_strategy","manual"),n.language&&i.searchParams.set("language_code",n.language);for(let r of n.biasTerms??[])i.searchParams.append("keyterms",r);return i.toString()}function WP(t){return t.encoding==="pcm_s16le"?`pcm_${t.sampleRate}`:"pcm_16000"}var uS,ro,Mm,Fm=v(()=>{"use strict";ma();uS="wss://api.elevenlabs.io/v1/speech-to-text/realtime",ro=class{apiKey;socketFactory;model;endpoint;id="elevenlabs-scribe";constructor(e,n,i,r=uS){this.apiKey=e,this.socketFactory=n,this.model=i,this.endpoint=r}open(e){return new Mm(this.apiKey,this.socketFactory,this.model,this.endpoint,e)}},Mm=class{opts;socket;opened=!1;aborted=!1;closed=!1;pending=[];committed=[];transcriptCb;errorCb;endPending=null;commitRequested=!1;constructor(e,n,i,r,o){this.opts=o,this.socket=n(GP(r,i,o),{"xi-api-key":e}),this.socket.onOpen(()=>this.handleOpen()),this.socket.onMessage(s=>this.handleMessage(s)),this.socket.onError(s=>this.handleError(s)),this.socket.onClose(()=>this.handleClose())}pushAudio(e){if(!(this.aborted||this.closed||this.commitRequested)){if(!this.opened){this.pending.push(e);return}this.sendChunk(e,!1)}}onTranscript(e){this.transcriptCb=e}onError(e){this.errorCb=e}end(){return this.aborted?Promise.reject(new Error("ASR stream already aborted")):this.endPending?Promise.reject(new Error("ASR end() already in progress")):new Promise((e,n)=>{this.endPending={resolve:e,reject:n},this.commitRequested=!0,this.opened&&this.sendCommit()})}abort(){if(this.aborted=!0,this.endPending){let{reject:e}=this.endPending;this.endPending=null,e(new Error("ASR stream aborted"))}return this.teardown(),Promise.resolve()}handleOpen(){if(!(this.aborted||this.closed)){this.opened=!0;for(let e of this.pending)this.sendChunk(e,!1);this.pending.length=0,this.commitRequested&&this.sendCommit()}}handleMessage(e){if(this.aborted||this.closed)return;let n=gn(e);if(!n)return;let i=pa(n);if(i){this.handleError(new Error(`stream error (${i})`));return}let r=n.message_type;if(r==="partial_transcript"){this.opts.emitPartials&&this.transcriptCb?.({text:zi(n.text),isFinal:!1,startMs:0});return}if(r==="committed_transcript"||r==="committed_transcript_with_timestamps"){let o=zi(n.text);o.length>0&&this.committed.push(o),this.endPending&&this.resolveEnd()}}handleError(e){if(this.closed)return;let n=vn("ElevenLabs ASR",e);if(this.endPending){let{reject:i}=this.endPending;this.endPending=null,i(n)}this.errorCb?.(n),this.teardown()}handleClose(){if(this.closed)return;this.closed=!0;let e=new Error("ElevenLabs ASR connection closed unexpectedly");if(this.endPending){let{reject:n}=this.endPending;this.endPending=null,n(e)}this.errorCb?.(e)}resolveEnd(){if(!this.endPending)return;let e={text:this.committed.join(" ").trim(),isFinal:!0,startMs:0};this.transcriptCb?.(e);let{resolve:n}=this.endPending;this.endPending=null,this.teardown(),n(e)}sendChunk(e,n){this.socket.send(JSON.stringify({message_type:"input_audio_chunk",audio_base_64:n$(e),commit:n,sample_rate:this.opts.sampleRate}))}sendCommit(){this.sendChunk(new Uint8Array(0),!0)}teardown(){this.closed||(this.closed=!0,this.socket.close())}}});import{randomUUID as qP}from"node:crypto";function JP(t,e){let n=t.engineVoice[e];if(!n)throw new Error(`voice '${t.id}' has no '${e}' engineVoice mapping`);if(n.kind!=="preset")throw new Error(`the ${e} adapter needs a preset voiceId for '${t.id}', got kind '${n.kind}'`);return n.voiceId}function KP(t,e,n,i){let r=new URL(t.replace("{voice_id}",encodeURIComponent(e)));return r.searchParams.set("model_id",n),r.searchParams.set("output_format",YP(i)),r.searchParams.set("auto_mode","true"),r.toString()}function YP(t){return t.encoding==="pcm_s16le"?`pcm_${t.sampleRate}`:"pcm_16000"}var cS,HP,no,Vm,Zm=v(()=>{"use strict";ma();cS="wss://api.elevenlabs.io/v1/text-to-speech/{voice_id}/multi-stream-input",HP={stability:.5,similarity_boost:.75,use_speaker_boost:!0},no=class{apiKey;socketFactory;model;endpointTemplate;id="elevenlabs-flash";constructor(e,n,i,r=cS){this.apiKey=e,this.socketFactory=n,this.model=i,this.endpointTemplate=r}speak(e){return new Vm(this.apiKey,this.socketFactory,this.model,this.endpointTemplate,this.id,e)}},Vm=class{socket;contextId=qP();opened=!1;cancelled=!1;closed=!1;endRequested=!1;closeContextSent=!1;pending=[];audioCb;errorCb;endPending=null;constructor(e,n,i,r,o,s){let a=JP(s.voice,o);this.socket=n(KP(r,a,i,s),{"xi-api-key":e}),this.socket.onOpen(()=>this.handleOpen()),this.socket.onMessage(u=>this.handleMessage(u)),this.socket.onError(u=>this.handleError(u)),this.socket.onClose(()=>this.handleClose())}pushText(e){if(!(this.cancelled||this.closed||this.endRequested)){if(!this.opened){this.pending.push(e);return}this.sendText(e)}}onAudio(e){this.audioCb=e}onError(e){this.errorCb=e}end(){return this.cancelled||this.closed?Promise.resolve():this.endPending?Promise.reject(new Error("TTS end() already in progress")):new Promise((e,n)=>{this.endPending={resolve:e,reject:n},this.endRequested=!0,this.opened&&this.sendEndOfContext()})}cancel(){if(this.cancelled||this.closed)return this.cancelled=!0,Promise.resolve();if(this.cancelled=!0,this.endPending){let{resolve:e}=this.endPending;this.endPending=null,e()}return this.opened&&this.sendCloseContext(),this.teardown(),Promise.resolve()}handleOpen(){if(!(this.cancelled||this.closed)){this.opened=!0,this.sendInit();for(let e of this.pending)this.sendText(e);this.pending.length=0,this.endRequested&&this.sendEndOfContext()}}handleMessage(e){if(this.cancelled||this.closed)return;let n=gn(e);if(!n)return;let i=pa(n);if(i){this.handleError(new Error(`stream error (${i})`));return}typeof n.audio=="string"&&n.audio.length>0&&this.audioCb?.(i$(n.audio)),(n.isFinal===!0||n.is_final===!0)&&this.resolveEnd()}handleError(e){if(this.closed)return;let n=vn("ElevenLabs TTS",e);if(this.endPending){let{reject:i}=this.endPending;this.endPending=null,i(n)}this.errorCb?.(n),this.teardown()}handleClose(){if(this.closed)return;this.closed=!0;let e=new Error("ElevenLabs TTS connection closed unexpectedly");if(this.endPending){let{reject:n}=this.endPending;this.endPending=null,n(e)}this.errorCb?.(e)}resolveEnd(){if(!this.endPending)return;let{resolve:e}=this.endPending;this.endPending=null,this.teardown(),e()}sendInit(){this.socket.send(JSON.stringify({text:" ",voice_settings:HP,context_id:this.contextId}))}sendText(e){let n=e.endsWith(" ")?e:`${e} `;this.socket.send(JSON.stringify({text:n,context_id:this.contextId}))}sendEndOfContext(){this.sendFlush(),this.sendCloseContext()}sendFlush(){this.socket.send(JSON.stringify({context_id:this.contextId,text:"",flush:!0}))}sendCloseContext(){this.closeContextSent||(this.closeContextSent=!0,this.socket.send(JSON.stringify({context_id:this.contextId,close_context:!0})))}teardown(){this.closed||(this.closed=!0,this.socket.close())}}});var io,Bm=v(()=>{"use strict";Fm();Zm();va();Ca();io=class{socketFactory;constructor(e=En){this.socketFactory=e}asrEngine(e,n){switch(e.provider){case"elevenlabs":return new ro(n,this.socketFactory,e.model);case"sherpa-onnx":return new Ni(this.socketFactory,e.url);default:throw new Error(`no stt adapter for provider '${e.provider}'`)}}ttsEngine(e,n){if(e.provider==="elevenlabs")return new no(n,this.socketFactory,e.model);throw new Error(`no tts adapter for provider '${e.provider}'`)}}});import{randomUUID as XP}from"node:crypto";function Wm(t={}){let e=new mr;B.setLevel(e.logLevel),B.debug("core created",{logLevel:e.logLevel});let{fetchImpl:n}=t,i={configService:t.configService??new We,registry:t.registry??new Ai(n),voiceRegistry:t.voiceRegistry??new io(t.voiceSocketFactory),createTurnEvaluator:t.createTurnEvaluator??(r=>new Dn(r,n)),createAddresseeEvaluator:t.createAddresseeEvaluator??(r=>new On(r,n)),...t.systemPrompt!==void 0&&{systemPrompt:t.systemPrompt},...t.voiceIdentity!==void 0&&{voiceIdentity:t.voiceIdentity},...t.createTurnController!==void 0&&{createTurnController:t.createTurnController},...t.createSmartTurnInference!==void 0&&{createSmartTurnInference:t.createSmartTurnInference},...t.createFrameClassifier!==void 0&&{createFrameClassifier:t.createFrameClassifier},...t.createSegmenter!==void 0&&{createSegmenter:t.createSegmenter},...t.clock!==void 0&&{clock:t.clock}};return new Gm(i)}var QP,eC,Gm,lS=v(()=>{"use strict";we();dp();hp();gp();aS();La();zm();Bm();QP="jarvis-core",eC="0.1.0-dev",Gm=class{deps;constructor(e){this.deps=e}describe(){return Promise.resolve({name:QP,version:eC})}openSession(e){let n=XP();return B.debug("core opened session",{sessionId:n,capabilities:e.clientCapabilities}),Promise.resolve(new ru(n,e,this.deps))}}});var tC,rC,RM,dS=v(()=>{"use strict";pr();Na();tC=1440*60*1e3,rC={stt:!0,tts:!0,text:!0,embedding:!0},RM=Object.keys(rC)});var nu=v(()=>{"use strict";lS();hp();Na();dS();gp();mp();Zp();pp();fp();Ca();Fm();Zm();va();Bm();Dm();Tm();Om();Cm();mn();wm();xm();Ka();Pm();Gp();fa()});var Mn=R((VF,gS)=>{"use strict";var hC="2.0.0",fC=Number.MAX_SAFE_INTEGER||9007199254740991,pC=16,mC=250,gC=["major","premajor","minor","preminor","patch","prepatch","prerelease"];gS.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:pC,MAX_SAFE_BUILD_LENGTH:mC,MAX_SAFE_INTEGER:fC,RELEASE_TYPES:gC,SEMVER_SPEC_VERSION:hC,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var ao=R((ZF,vS)=>{"use strict";var vC=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};vS.exports=vC});var Fn=R((vt,yS)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Jm,MAX_SAFE_BUILD_LENGTH:yC,MAX_LENGTH:_C}=Mn(),bC=ao();vt=yS.exports={};var $C=vt.re=[],xC=vt.safeRe=[],O=vt.src=[],wC=vt.safeSrc=[],A=vt.t={},SC=0,Km="[a-zA-Z0-9-]",kC=[["\\s",1],["\\d",_C],[Km,yC]],EC=t=>{for(let[e,n]of kC)t=t.split(`${e}*`).join(`${e}{0,${n}}`).split(`${e}+`).join(`${e}{1,${n}}`);return t},U=(t,e,n)=>{let i=EC(e),r=SC++;bC(t,r,e),A[t]=r,O[r]=e,wC[r]=i,$C[r]=new RegExp(e,n?"g":void 0),xC[r]=new RegExp(i,n?"g":void 0)};U("NUMERICIDENTIFIER","0|[1-9]\\d*");U("NUMERICIDENTIFIERLOOSE","\\d+");U("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Km}*`);U("MAINVERSION",`(${O[A.NUMERICIDENTIFIER]})\\.(${O[A.NUMERICIDENTIFIER]})\\.(${O[A.NUMERICIDENTIFIER]})`);U("MAINVERSIONLOOSE",`(${O[A.NUMERICIDENTIFIERLOOSE]})\\.(${O[A.NUMERICIDENTIFIERLOOSE]})\\.(${O[A.NUMERICIDENTIFIERLOOSE]})`);U("PRERELEASEIDENTIFIER",`(?:${O[A.NONNUMERICIDENTIFIER]}|${O[A.NUMERICIDENTIFIER]})`);U("PRERELEASEIDENTIFIERLOOSE",`(?:${O[A.NONNUMERICIDENTIFIER]}|${O[A.NUMERICIDENTIFIERLOOSE]})`);U("PRERELEASE",`(?:-(${O[A.PRERELEASEIDENTIFIER]}(?:\\.${O[A.PRERELEASEIDENTIFIER]})*))`);U("PRERELEASELOOSE",`(?:-?(${O[A.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${O[A.PRERELEASEIDENTIFIERLOOSE]})*))`);U("BUILDIDENTIFIER",`${Km}+`);U("BUILD",`(?:\\+(${O[A.BUILDIDENTIFIER]}(?:\\.${O[A.BUILDIDENTIFIER]})*))`);U("FULLPLAIN",`v?${O[A.MAINVERSION]}${O[A.PRERELEASE]}?${O[A.BUILD]}?`);U("FULL",`^${O[A.FULLPLAIN]}$`);U("LOOSEPLAIN",`[v=\\s]*${O[A.MAINVERSIONLOOSE]}${O[A.PRERELEASELOOSE]}?${O[A.BUILD]}?`);U("LOOSE",`^${O[A.LOOSEPLAIN]}$`);U("GTLT","((?:<|>)?=?)");U("XRANGEIDENTIFIERLOOSE",`${O[A.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);U("XRANGEIDENTIFIER",`${O[A.NUMERICIDENTIFIER]}|x|X|\\*`);U("XRANGEPLAIN",`[v=\\s]*(${O[A.XRANGEIDENTIFIER]})(?:\\.(${O[A.XRANGEIDENTIFIER]})(?:\\.(${O[A.XRANGEIDENTIFIER]})(?:${O[A.PRERELEASE]})?${O[A.BUILD]}?)?)?`);U("XRANGEPLAINLOOSE",`[v=\\s]*(${O[A.XRANGEIDENTIFIERLOOSE]})(?:\\.(${O[A.XRANGEIDENTIFIERLOOSE]})(?:\\.(${O[A.XRANGEIDENTIFIERLOOSE]})(?:${O[A.PRERELEASELOOSE]})?${O[A.BUILD]}?)?)?`);U("XRANGE",`^${O[A.GTLT]}\\s*${O[A.XRANGEPLAIN]}$`);U("XRANGELOOSE",`^${O[A.GTLT]}\\s*${O[A.XRANGEPLAINLOOSE]}$`);U("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Jm}})(?:\\.(\\d{1,${Jm}}))?(?:\\.(\\d{1,${Jm}}))?`);U("COERCE",`${O[A.COERCEPLAIN]}(?:$|[^\\d])`);U("COERCEFULL",O[A.COERCEPLAIN]+`(?:${O[A.PRERELEASE]})?(?:${O[A.BUILD]})?(?:$|[^\\d])`);U("COERCERTL",O[A.COERCE],!0);U("COERCERTLFULL",O[A.COERCEFULL],!0);U("LONETILDE","(?:~>?)");U("TILDETRIM",`(\\s*)${O[A.LONETILDE]}\\s+`,!0);vt.tildeTrimReplace="$1~";U("TILDE",`^${O[A.LONETILDE]}${O[A.XRANGEPLAIN]}$`);U("TILDELOOSE",`^${O[A.LONETILDE]}${O[A.XRANGEPLAINLOOSE]}$`);U("LONECARET","(?:\\^)");U("CARETTRIM",`(\\s*)${O[A.LONECARET]}\\s+`,!0);vt.caretTrimReplace="$1^";U("CARET",`^${O[A.LONECARET]}${O[A.XRANGEPLAIN]}$`);U("CARETLOOSE",`^${O[A.LONECARET]}${O[A.XRANGEPLAINLOOSE]}$`);U("COMPARATORLOOSE",`^${O[A.GTLT]}\\s*(${O[A.LOOSEPLAIN]})$|^$`);U("COMPARATOR",`^${O[A.GTLT]}\\s*(${O[A.FULLPLAIN]})$|^$`);U("COMPARATORTRIM",`(\\s*)${O[A.GTLT]}\\s*(${O[A.LOOSEPLAIN]}|${O[A.XRANGEPLAIN]})`,!0);vt.comparatorTrimReplace="$1$2$3";U("HYPHENRANGE",`^\\s*(${O[A.XRANGEPLAIN]})\\s+-\\s+(${O[A.XRANGEPLAIN]})\\s*$`);U("HYPHENRANGELOOSE",`^\\s*(${O[A.XRANGEPLAINLOOSE]})\\s+-\\s+(${O[A.XRANGEPLAINLOOSE]})\\s*$`);U("STAR","(<|>)?=?\\s*\\*");U("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");U("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var uu=R((BF,_S)=>{"use strict";var IC=Object.freeze({loose:!0}),TC=Object.freeze({}),OC=t=>t?typeof t!="object"?IC:t:TC;_S.exports=OC});var Ym=R((GF,xS)=>{"use strict";var bS=/^[0-9]+$/,$S=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let n=bS.test(t),i=bS.test(e);return n&&i&&(t=+t,e=+e),t===e?0:n&&!i?-1:i&&!n?1:t<e?-1:1},AC=(t,e)=>$S(e,t);xS.exports={compareIdentifiers:$S,rcompareIdentifiers:AC}});var _e=R((WF,SS)=>{"use strict";var cu=ao(),{MAX_LENGTH:wS,MAX_SAFE_INTEGER:lu}=Mn(),{safeRe:du,t:hu}=Fn(),PC=uu(),{compareIdentifiers:Xm}=Ym(),CC=(t,e)=>{let n=e.split(".");if(n.length>t.length)return!1;for(let i=0;i<n.length;i++)if(Xm(t[i],n[i])!==0)return!1;return!0},Qm=class t{constructor(e,n){if(n=PC(n),e instanceof t){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>wS)throw new TypeError(`version is longer than ${wS} characters`);cu("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let i=e.trim().match(n.loose?du[hu.LOOSE]:du[hu.FULL]);if(!i)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>lu||this.major<0)throw new TypeError("Invalid major version");if(this.minor>lu||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>lu||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(r=>{if(/^[0-9]+$/.test(r)){let o=+r;if(o>=0&&o<lu)return o}return r}):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(cu("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{let i=this.prerelease[n],r=e.prerelease[n];if(cu("prerelease compare",n,i,r),i===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(i===void 0)return-1;if(i===r)continue;return Xm(i,r)}while(++n)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let n=0;do{let i=this.build[n],r=e.build[n];if(cu("build compare",n,i,r),i===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(i===void 0)return-1;if(i===r)continue;return Xm(i,r)}while(++n)}inc(e,n,i){if(e.startsWith("pre")){if(!n&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let r=`-${n}`.match(this.options.loose?du[hu.PRERELEASELOOSE]:du[hu.PRERELEASE]);if(!r||r[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,i),this.inc("pre",n,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,i),this.inc("pre",n,i);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let r=Number(i)?1:0;if(this.prerelease.length===0)this.prerelease=[r];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(n===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(n){let o=[n,r];if(i===!1&&(o=[n]),CC(this.prerelease,n)){let s=this.prerelease[n.split(".").length];isNaN(s)&&(this.prerelease=o)}else this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};SS.exports=Qm});var er=R((qF,ES)=>{"use strict";var kS=_e(),RC=(t,e,n=!1)=>{if(t instanceof kS)return t;try{return new kS(t,e)}catch(i){if(!n)return null;throw i}};ES.exports=RC});var TS=R((HF,IS)=>{"use strict";var zC=er(),NC=(t,e)=>{let n=zC(t,e);return n?n.version:null};IS.exports=NC});var AS=R((JF,OS)=>{"use strict";var DC=er(),LC=(t,e)=>{let n=DC(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};OS.exports=LC});var RS=R((KF,CS)=>{"use strict";var PS=_e(),UC=(t,e,n,i,r)=>{typeof n=="string"&&(r=i,i=n,n=void 0);try{return new PS(t instanceof PS?t.version:t,n).inc(e,i,r).version}catch{return null}};CS.exports=UC});var DS=R((YF,NS)=>{"use strict";var zS=er(),jC=(t,e)=>{let n=zS(t,null,!0),i=zS(e,null,!0),r=n.compare(i);if(r===0)return null;let o=r>0,s=o?n:i,a=o?i:n,u=!!s.prerelease.length;if(!!a.prerelease.length&&!u){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let l=u?"pre":"";return n.major!==i.major?l+"major":n.minor!==i.minor?l+"minor":n.patch!==i.patch?l+"patch":"prerelease"};NS.exports=jC});var US=R((XF,LS)=>{"use strict";var MC=_e(),FC=(t,e)=>new MC(t,e).major;LS.exports=FC});var MS=R((QF,jS)=>{"use strict";var VC=_e(),ZC=(t,e)=>new VC(t,e).minor;jS.exports=ZC});var VS=R((eV,FS)=>{"use strict";var BC=_e(),GC=(t,e)=>new BC(t,e).patch;FS.exports=GC});var BS=R((tV,ZS)=>{"use strict";var WC=er(),qC=(t,e)=>{let n=WC(t,e);return n&&n.prerelease.length?n.prerelease:null};ZS.exports=qC});var tt=R((rV,WS)=>{"use strict";var GS=_e(),HC=(t,e,n)=>new GS(t,n).compare(new GS(e,n));WS.exports=HC});var HS=R((nV,qS)=>{"use strict";var JC=tt(),KC=(t,e,n)=>JC(e,t,n);qS.exports=KC});var KS=R((iV,JS)=>{"use strict";var YC=tt(),XC=(t,e)=>YC(t,e,!0);JS.exports=XC});var fu=R((oV,XS)=>{"use strict";var YS=_e(),QC=(t,e,n)=>{let i=new YS(t,n),r=new YS(e,n);return i.compare(r)||i.compareBuild(r)};XS.exports=QC});var e0=R((sV,QS)=>{"use strict";var eR=fu(),tR=(t,e)=>t.sort((n,i)=>eR(n,i,e));QS.exports=tR});var r0=R((aV,t0)=>{"use strict";var rR=fu(),nR=(t,e)=>t.sort((n,i)=>rR(i,n,e));t0.exports=nR});var uo=R((uV,n0)=>{"use strict";var iR=tt(),oR=(t,e,n)=>iR(t,e,n)>0;n0.exports=oR});var pu=R((cV,i0)=>{"use strict";var sR=tt(),aR=(t,e,n)=>sR(t,e,n)<0;i0.exports=aR});var eg=R((lV,o0)=>{"use strict";var uR=tt(),cR=(t,e,n)=>uR(t,e,n)===0;o0.exports=cR});var tg=R((dV,s0)=>{"use strict";var lR=tt(),dR=(t,e,n)=>lR(t,e,n)!==0;s0.exports=dR});var mu=R((hV,a0)=>{"use strict";var hR=tt(),fR=(t,e,n)=>hR(t,e,n)>=0;a0.exports=fR});var gu=R((fV,u0)=>{"use strict";var pR=tt(),mR=(t,e,n)=>pR(t,e,n)<=0;u0.exports=mR});var rg=R((pV,c0)=>{"use strict";var gR=eg(),vR=tg(),yR=uo(),_R=mu(),bR=pu(),$R=gu(),xR=(t,e,n,i)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return gR(t,n,i);case"!=":return vR(t,n,i);case">":return yR(t,n,i);case">=":return _R(t,n,i);case"<":return bR(t,n,i);case"<=":return $R(t,n,i);default:throw new TypeError(`Invalid operator: ${e}`)}};c0.exports=xR});var d0=R((mV,l0)=>{"use strict";var wR=_e(),SR=er(),{safeRe:vu,t:yu}=Fn(),kR=(t,e)=>{if(t instanceof wR)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(e.includePrerelease?vu[yu.COERCEFULL]:vu[yu.COERCE]);else{let u=e.includePrerelease?vu[yu.COERCERTLFULL]:vu[yu.COERCERTL],c;for(;(c=u.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||c.index+c[0].length!==n.index+n[0].length)&&(n=c),u.lastIndex=c.index+c[1].length+c[2].length;u.lastIndex=-1}if(n===null)return null;let i=n[2],r=n[3]||"0",o=n[4]||"0",s=e.includePrerelease&&n[5]?`-${n[5]}`:"",a=e.includePrerelease&&n[6]?`+${n[6]}`:"";return SR(`${i}.${r}.${o}${s}${a}`,e)};l0.exports=kR});var f0=R((gV,h0)=>{"use strict";var ER=er(),IR=Mn(),TR=_e(),OR=(t,e,n)=>{if(!IR.RELEASE_TYPES.includes(e))return null;let i=AR(t,n);return i&&PR(i,e)},AR=(t,e)=>{let n=t instanceof TR?t.version:t;return ER(n,e)},PR=(t,e)=>{if(CR(e))return t.version;switch(t.prerelease=[],e){case"major":t.minor=0,t.patch=0;break;case"minor":t.patch=0;break}return t.format()},CR=t=>t.startsWith("pre");h0.exports=OR});var m0=R((vV,p0)=>{"use strict";var ng=class{constructor(){this.max=1e3,this.map=new Map}get(e){let n=this.map.get(e);if(n!==void 0)return this.map.delete(e),this.map.set(e,n),n}delete(e){return this.map.delete(e)}set(e,n){if(!this.delete(e)&&n!==void 0){if(this.map.size>=this.max){let r=this.map.keys().next().value;this.delete(r)}this.map.set(e,n)}return this}};p0.exports=ng});var rt=R((yV,_0)=>{"use strict";var RR=/\s+/g,ig=class t{constructor(e,n){if(n=NR(n),e instanceof t)return e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease?e:new t(e.raw,n);if(e instanceof og)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=e.trim().replace(RR," "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(r=>!v0(r[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let r of this.set)if(r.length===1&&BR(r[0])){this.set=[r];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let n=this.set[e];for(let i=0;i<n.length;i++)i>0&&(this.formatted+=" "),this.formatted+=n[i].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(ZR,"");let i=((this.options.includePrerelease&&FR)|(this.options.loose&&VR))+":"+e,r=g0.get(i);if(r)return r;let o=this.options.loose,s=o?Pe[be.HYPHENRANGELOOSE]:Pe[be.HYPHENRANGE];e=e.replace(s,ez(this.options.includePrerelease)),te("hyphen replace",e),e=e.replace(Pe[be.COMPARATORTRIM],UR),te("comparator trim",e),e=e.replace(Pe[be.TILDETRIM],jR),te("tilde trim",e),e=e.replace(Pe[be.CARETTRIM],MR),te("caret trim",e);let a=e.split(" ").map(d=>GR(d,this.options)).join(" ").split(/\s+/).map(d=>QR(d,this.options));o&&(a=a.filter(d=>(te("loose invalid filter",d,this.options),!!d.match(Pe[be.COMPARATORLOOSE])))),te("range list",a);let u=new Map,c=a.map(d=>new og(d,this.options));for(let d of c){if(v0(d))return[d];u.set(d.value,d)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return g0.set(i,l),l}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(i=>y0(i,n)&&e.set.some(r=>y0(r,n)&&i.every(o=>r.every(s=>o.intersects(s,n)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new DR(e,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(tz(this.set[n],e,this.options))return!0;return!1}};_0.exports=ig;var zR=m0(),g0=new zR,NR=uu(),og=co(),te=ao(),DR=_e(),{safeRe:Pe,src:LR,t:be,comparatorTrimReplace:UR,tildeTrimReplace:jR,caretTrimReplace:MR}=Fn(),{FLAG_INCLUDE_PRERELEASE:FR,FLAG_LOOSE:VR}=Mn(),ZR=new RegExp(LR[be.BUILD],"g"),v0=t=>t.value==="<0.0.0-0",BR=t=>t.value==="",y0=(t,e)=>{let n=!0,i=t.slice(),r=i.pop();for(;n&&i.length;)n=i.every(o=>r.intersects(o,e)),r=i.pop();return n},GR=(t,e)=>(t=t.replace(Pe[be.BUILD],""),te("comp",t,e),t=HR(t,e),te("caret",t),t=WR(t,e),te("tildes",t),t=KR(t,e),te("xrange",t),t=XR(t,e),te("stars",t),t),Ce=t=>!t||t.toLowerCase()==="x"||t==="*",WR=(t,e)=>t.trim().split(/\s+/).map(n=>qR(n,e)).join(" "),qR=(t,e)=>{let n=e.loose?Pe[be.TILDELOOSE]:Pe[be.TILDE];return t.replace(n,(i,r,o,s,a)=>{te("tilde",t,i,r,o,s,a);let u;return Ce(r)?u="":Ce(o)?u=`>=${r}.0.0 <${+r+1}.0.0-0`:Ce(s)?u=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:a?(te("replaceTilde pr",a),u=`>=${r}.${o}.${s}-${a} <${r}.${+o+1}.0-0`):u=`>=${r}.${o}.${s} <${r}.${+o+1}.0-0`,te("tilde return",u),u})},HR=(t,e)=>t.trim().split(/\s+/).map(n=>JR(n,e)).join(" "),JR=(t,e)=>{te("caret",t,e);let n=e.loose?Pe[be.CARETLOOSE]:Pe[be.CARET],i=e.includePrerelease?"-0":"";return t.replace(n,(r,o,s,a,u)=>{te("caret",t,r,o,s,a,u);let c;return Ce(o)?c="":Ce(s)?c=`>=${o}.0.0${i} <${+o+1}.0.0-0`:Ce(a)?o==="0"?c=`>=${o}.${s}.0${i} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.0${i} <${+o+1}.0.0-0`:u?(te("replaceCaret pr",u),o==="0"?s==="0"?c=`>=${o}.${s}.${a}-${u} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}-${u} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a}-${u} <${+o+1}.0.0-0`):(te("no pr"),o==="0"?s==="0"?c=`>=${o}.${s}.${a}${i} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}${i} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),te("caret return",c),c})},KR=(t,e)=>(te("replaceXRanges",t,e),t.split(/\s+/).map(n=>YR(n,e)).join(" ")),YR=(t,e)=>{t=t.trim();let n=e.loose?Pe[be.XRANGELOOSE]:Pe[be.XRANGE];return t.replace(n,(i,r,o,s,a,u)=>{te("xRange",t,i,r,o,s,a,u);let c=Ce(o),l=c||Ce(s),d=l||Ce(a),h=d;return r==="="&&h&&(r=""),u=e.includePrerelease?"-0":"",c?r===">"||r==="<"?i="<0.0.0-0":i="*":r&&h?(l&&(s=0),a=0,r===">"?(r=">=",l?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):r==="<="&&(r="<",l?o=+o+1:s=+s+1),r==="<"&&(u="-0"),i=`${r+o}.${s}.${a}${u}`):l?i=`>=${o}.0.0${u} <${+o+1}.0.0-0`:d&&(i=`>=${o}.${s}.0${u} <${o}.${+s+1}.0-0`),te("xRange return",i),i})},XR=(t,e)=>(te("replaceStars",t,e),t.trim().replace(Pe[be.STAR],"")),QR=(t,e)=>(te("replaceGTE0",t,e),t.trim().replace(Pe[e.includePrerelease?be.GTE0PRE:be.GTE0],"")),ez=t=>(e,n,i,r,o,s,a,u,c,l,d,h)=>(Ce(i)?n="":Ce(r)?n=`>=${i}.0.0${t?"-0":""}`:Ce(o)?n=`>=${i}.${r}.0${t?"-0":""}`:s?n=`>=${n}`:n=`>=${n}${t?"-0":""}`,Ce(c)?u="":Ce(l)?u=`<${+c+1}.0.0-0`:Ce(d)?u=`<${c}.${+l+1}.0-0`:h?u=`<=${c}.${l}.${d}-${h}`:t?u=`<${c}.${l}.${+d+1}-0`:u=`<=${u}`,`${n} ${u}`.trim()),tz=(t,e,n)=>{for(let i=0;i<t.length;i++)if(!t[i].test(e))return!1;if(e.prerelease.length&&!n.includePrerelease){for(let i=0;i<t.length;i++)if(te(t[i].semver),t[i].semver!==og.ANY&&t[i].semver.prerelease.length>0){let r=t[i].semver;if(r.major===e.major&&r.minor===e.minor&&r.patch===e.patch)return!0}return!1}return!0}});var co=R((_V,k0)=>{"use strict";var lo=Symbol("SemVer ANY"),ug=class t{static get ANY(){return lo}constructor(e,n){if(n=b0(n),e instanceof t){if(e.loose===!!n.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),ag("comparator",e,n),this.options=n,this.loose=!!n.loose,this.parse(e),this.semver===lo?this.value="":this.value=this.operator+this.semver.version,ag("comp",this)}parse(e){let n=this.options.loose?$0[x0.COMPARATORLOOSE]:$0[x0.COMPARATOR],i=e.match(n);if(!i)throw new TypeError(`Invalid comparator: ${e}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new w0(i[2],this.options.loose):this.semver=lo}toString(){return this.value}test(e){if(ag("Comparator.test",e,this.options.loose),this.semver===lo||e===lo)return!0;if(typeof e=="string")try{e=new w0(e,this.options)}catch{return!1}return sg(e,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new S0(e.value,n).test(this.value):e.operator===""?e.value===""?!0:new S0(this.value,n).test(e.semver):(n=b0(n),n.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||sg(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||sg(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};k0.exports=ug;var b0=uu(),{safeRe:$0,t:x0}=Fn(),sg=rg(),ag=ao(),w0=_e(),S0=rt()});var ho=R((bV,E0)=>{"use strict";var rz=rt(),nz=(t,e,n)=>{try{e=new rz(e,n)}catch{return!1}return e.test(t)};E0.exports=nz});var T0=R(($V,I0)=>{"use strict";var iz=rt(),oz=(t,e)=>new iz(t,e).set.map(n=>n.map(i=>i.value).join(" ").trim().split(" "));I0.exports=oz});var A0=R((xV,O0)=>{"use strict";var sz=_e(),az=rt(),uz=(t,e,n)=>{let i=null,r=null,o=null;try{o=new az(e,n)}catch{return null}return t.forEach(s=>{o.test(s)&&(!i||r.compare(s)===-1)&&(i=s,r=new sz(i,n))}),i};O0.exports=uz});var C0=R((wV,P0)=>{"use strict";var cz=_e(),lz=rt(),dz=(t,e,n)=>{let i=null,r=null,o=null;try{o=new lz(e,n)}catch{return null}return t.forEach(s=>{o.test(s)&&(!i||r.compare(s)===1)&&(i=s,r=new cz(i,n))}),i};P0.exports=dz});var N0=R((SV,z0)=>{"use strict";var cg=_e(),hz=rt(),R0=uo(),fz=(t,e)=>{t=new hz(t,e);let n=new cg("0.0.0");if(t.test(n)||(n=new cg("0.0.0-0"),t.test(n)))return n;n=null;for(let i=0;i<t.set.length;++i){let r=t.set[i],o=null;r.forEach(s=>{let a=new cg(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||R0(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!n||R0(n,o))&&(n=o)}return n&&t.test(n)?n:null};z0.exports=fz});var L0=R((kV,D0)=>{"use strict";var pz=rt(),mz=(t,e)=>{try{return new pz(t,e).range||"*"}catch{return null}};D0.exports=mz});var _u=R((EV,F0)=>{"use strict";var gz=_e(),M0=co(),{ANY:vz}=M0,yz=rt(),_z=ho(),U0=uo(),j0=pu(),bz=gu(),$z=mu(),xz=(t,e,n,i)=>{t=new gz(t,i),e=new yz(e,i);let r,o,s,a,u;switch(n){case">":r=U0,o=bz,s=j0,a=">",u=">=";break;case"<":r=j0,o=$z,s=U0,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(_z(t,e,i))return!1;for(let c=0;c<e.set.length;++c){let l=e.set[c],d=null,h=null;if(l.forEach(f=>{f.semver===vz&&(f=new M0(">=0.0.0")),d=d||f,h=h||f,r(f.semver,d.semver,i)?d=f:s(f.semver,h.semver,i)&&(h=f)}),d.operator===a||d.operator===u||(!h.operator||h.operator===a)&&o(t,h.semver))return!1;if(h.operator===u&&s(t,h.semver))return!1}return!0};F0.exports=xz});var Z0=R((IV,V0)=>{"use strict";var wz=_u(),Sz=(t,e,n)=>wz(t,e,">",n);V0.exports=Sz});var G0=R((TV,B0)=>{"use strict";var kz=_u(),Ez=(t,e,n)=>kz(t,e,"<",n);B0.exports=Ez});var H0=R((OV,q0)=>{"use strict";var W0=rt(),Iz=(t,e,n)=>(t=new W0(t,n),e=new W0(e,n),t.intersects(e,n));q0.exports=Iz});var K0=R((AV,J0)=>{"use strict";var Tz=ho(),Oz=tt();J0.exports=(t,e,n)=>{let i=[],r=null,o=null,s=t.sort((l,d)=>Oz(l,d,n));for(let l of s)Tz(l,e,n)?(o=l,r||(r=l)):(o&&i.push([r,o]),o=null,r=null);r&&i.push([r,null]);let a=[];for(let[l,d]of i)l===d?a.push(l):!d&&l===s[0]?a.push("*"):d?l===s[0]?a.push(`<=${d}`):a.push(`${l} - ${d}`):a.push(`>=${l}`);let u=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return u.length<c.length?u:e}});var rk=R((PV,tk)=>{"use strict";var Y0=rt(),hg=co(),{ANY:lg}=hg,dg=ho(),fg=tt(),Az=(t,e,n={})=>{if(t===e)return!0;t=new Y0(t,n),e=new Y0(e,n);let i=!1;e:for(let r of t.set){for(let o of e.set){let s=Cz(r,o,n);if(i=i||s!==null,s)continue e}if(i)return!1}return!0},Pz=[new hg(">=0.0.0-0")],X0=[new hg(">=0.0.0")],Cz=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===lg){if(e.length===1&&e[0].semver===lg)return!0;n.includePrerelease?t=Pz:t=X0}if(e.length===1&&e[0].semver===lg){if(n.includePrerelease)return!0;e=X0}let i=new Set,r,o;for(let f of t)f.operator===">"||f.operator===">="?r=Q0(r,f,n):f.operator==="<"||f.operator==="<="?o=ek(o,f,n):i.add(f.semver);if(i.size>1)return null;let s;if(r&&o){if(s=fg(r.semver,o.semver,n),s>0)return null;if(s===0&&(r.operator!==">="||o.operator!=="<="))return null}for(let f of i){if(r&&!dg(f,String(r),n)||o&&!dg(f,String(o),n))return null;for(let p of e)if(!dg(f,String(p),n))return!1;return!0}let a,u,c,l,d=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1,h=r&&!n.includePrerelease&&r.semver.prerelease.length?r.semver:!1;d&&d.prerelease.length===1&&o.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let f of e){if(l=l||f.operator===">"||f.operator===">=",c=c||f.operator==="<"||f.operator==="<=",r){if(h&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===h.major&&f.semver.minor===h.minor&&f.semver.patch===h.patch&&(h=!1),f.operator===">"||f.operator===">="){if(a=Q0(r,f,n),a===f&&a!==r)return!1}else if(r.operator===">="&&!f.test(r.semver))return!1}if(o){if(d&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch&&(d=!1),f.operator==="<"||f.operator==="<="){if(u=ek(o,f,n),u===f&&u!==o)return!1}else if(o.operator==="<="&&!f.test(o.semver))return!1}if(!f.operator&&(o||r)&&s!==0)return!1}return!(r&&c&&!o&&s!==0||o&&l&&!r&&s!==0||h||d)},Q0=(t,e,n)=>{if(!t)return e;let i=fg(t.semver,e.semver,n);return i>0?t:i<0||e.operator===">"&&t.operator===">="?e:t},ek=(t,e,n)=>{if(!t)return e;let i=fg(t.semver,e.semver,n);return i<0?t:i>0||e.operator==="<"&&t.operator==="<="?e:t};tk.exports=Az});var sk=R((CV,ok)=>{"use strict";var pg=Fn(),nk=Mn(),Rz=_e(),ik=Ym(),zz=er(),Nz=TS(),Dz=AS(),Lz=RS(),Uz=DS(),jz=US(),Mz=MS(),Fz=VS(),Vz=BS(),Zz=tt(),Bz=HS(),Gz=KS(),Wz=fu(),qz=e0(),Hz=r0(),Jz=uo(),Kz=pu(),Yz=eg(),Xz=tg(),Qz=mu(),eN=gu(),tN=rg(),rN=d0(),nN=f0(),iN=co(),oN=rt(),sN=ho(),aN=T0(),uN=A0(),cN=C0(),lN=N0(),dN=L0(),hN=_u(),fN=Z0(),pN=G0(),mN=H0(),gN=K0(),vN=rk();ok.exports={parse:zz,valid:Nz,clean:Dz,inc:Lz,diff:Uz,major:jz,minor:Mz,patch:Fz,prerelease:Vz,compare:Zz,rcompare:Bz,compareLoose:Gz,compareBuild:Wz,sort:qz,rsort:Hz,gt:Jz,lt:Kz,eq:Yz,neq:Xz,gte:Qz,lte:eN,cmp:tN,coerce:rN,truncate:nN,Comparator:iN,Range:oN,satisfies:sN,toComparators:aN,maxSatisfying:uN,minSatisfying:cN,minVersion:lN,validRange:dN,outside:hN,gtr:fN,ltr:pN,intersects:mN,simplifyRange:gN,subset:vN,SemVer:Rz,re:pg.re,src:pg.src,tokens:pg.t,SEMVER_SPEC_VERSION:nk.SEMVER_SPEC_VERSION,RELEASE_TYPES:nk.RELEASE_TYPES,compareIdentifiers:ik.compareIdentifiers,rcompareIdentifiers:ik.rcompareIdentifiers}});var dk=R((FV,mg)=>{var xu=process||{},ck=xu.argv||[],$u=xu.env||{},$N=!($u.NO_COLOR||ck.includes("--no-color"))&&(!!$u.FORCE_COLOR||ck.includes("--color")||xu.platform==="win32"||(xu.stdout||{}).isTTY&&$u.TERM!=="dumb"||!!$u.CI),xN=(t,e,n=t)=>i=>{let r=""+i,o=r.indexOf(e,t.length);return~o?t+wN(r,e,n,o)+e:t+r+e},wN=(t,e,n,i)=>{let r="",o=0;do r+=t.substring(o,i)+n,o=i+e.length,i=t.indexOf(e,o);while(~i);return r+t.substring(o)},lk=(t=$N)=>{let e=t?xN:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};mg.exports=lk();mg.exports.createColors=lk});var $g=R((fZ,Ak)=>{"use strict";var bg={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let n="";return t<0?n+=`\x1B[${-t}D`:t>0&&(n+=`\x1B[${t}C`),e<0?n+=`\x1B[${-e}A`:e>0&&(n+=`\x1B[${e}B`),n},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},WN={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},qN={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let n=0;n<t;n++)e+=this.line+(n<t-1?bg.up():"");return t&&(e+=bg.left),e}};Ak.exports={cursor:bg,scroll:WN,erase:qN,beep:"\x07"}});function bE(t,e){if(e<=1)return t;let n=Math.floor(t.length/e),i=new Int16Array(n);for(let r=0;r<n;r++){let o=0,s=r*e;for(let a=0;a<e;a++)o+=t[s+a];i[r]=Math.round(o/e)}return i}var Vu,$E=v(()=>{"use strict";Vu=class{step;pos=0;prev=0;primed=!1;constructor(e,n){if(e<=0||n<=0)throw new RangeError("resampler rates must be positive");this.step=e/n}process(e){if(e.length===0)return new Int16Array(0);let n=[],i=e.length-1,r=this.primed?this.pos:0;for(;;){let o=Math.floor(r);if(o+1>i)break;let s=o<0?this.prev:e[o],a=e[o+1];n.push(Math.round(s+(a-s)*(r-o))),r+=this.step}return this.prev=e[i],this.primed=!0,this.pos=r-e.length,Int16Array.from(n)}}});function wE(t){return t.byteLength/2/VD}function ZD(t){let e=t.byteLength>>1,n=new DataView(t.buffer,t.byteOffset,t.byteLength),i=new Int16Array(e);for(let r=0;r<e;r++)i[r]=n.getInt16(r*2,!0);return i}var xE,VD,Zu,SE=v(()=>{"use strict";we();nu();xE=32,VD=16,Zu=class{constructor(e,n,i={}){this.vad=e;this.onSpeech=n;this.speechThreshold=i.speechThreshold??.5,this.onsetMs=i.onsetMs??2*xE,this.holdoffMs=i.holdoffMs??300,this.energyThreshold=i.energyThreshold??.01,this.log=i.log??B}vad;onSpeech;speechThreshold;onsetMs;holdoffMs;energyThreshold;log;inSpeech=!1;speechRunMs=0;silenceRunMs=0;degraded=!1;closed=!1;feed(e){if(!(this.closed||e.byteLength===0)){if(this.degraded){this.applyVerdict(pt(e,this.energyThreshold),wE(e));return}this.vad.process(ZD(e)).then(n=>{if(!this.closed)for(let i of n)this.applyVerdict(i>=this.speechThreshold,xE)},n=>{this.closed||(this.degrade(n),this.applyVerdict(pt(e,this.energyThreshold),wE(e)))})}}close(){this.closed=!0}applyVerdict(e,n){e?(this.silenceRunMs=0,this.speechRunMs+=n,!this.inSpeech&&this.speechRunMs>=this.onsetMs&&(this.inSpeech=!0,this.onSpeech())):(this.speechRunMs=0,this.inSpeech&&(this.silenceRunMs+=n,this.silenceRunMs>=this.holdoffMs&&(this.inSpeech=!1,this.silenceRunMs=0)))}degrade(e){this.degraded||(this.degraded=!0,this.log.debug("barge-in DEGRADED to energy onset - silero vad failed; speech onsets detect on RMS energy for the rest of the capture session",{error:e instanceof Error?e.message:String(e)}))}}});var Mg={};He(Mg,{DecibriCapture:()=>Ug,DecibriPlayback:()=>jg,hasInputDevice:()=>WD});import{Microphone as BD,Speaker as GD,inputDevices as EE}from"decibri";function WD(){try{return EE().length>0}catch(t){return B.debug("audio input enumeration failed; treating as no microphone",{error:t}),!1}}function qD(){try{let t=EE(),e=t.find(n=>n.isDefault)??t[0];if(e&&e.defaultSampleRate>=1e3&&e.maxInputChannels>=1)return{sampleRate:Math.round(e.defaultSampleRate),channels:e.maxInputChannels}}catch(t){B.debug("could not read default input device; opening at 16k mono",{error:t})}return{sampleRate:$o,channels:Bu}}function HD(t){return Math.max(64,Math.min(65536,Math.round(t/10)))}function JD(t,e,n){let i=new Uint8Array(t),r=new Int16Array(i.buffer,0,i.byteLength>>1),o=n.process(bE(r,e));return Buffer.from(o.buffer,o.byteOffset,o.byteLength)}function XD(t){return Buffer.from(t.buffer,t.byteOffset,t.byteLength)}var $o,Bu,IE,kE,Ug,KD,YD,jg,Fg=v(()=>{"use strict";we();nu();$E();SE();$o=16e3,Bu=1,IE="int16",kE=.01;Ug=class{constructor(e={}){this.deps=e}deps;mic=null;onData=null;onSpeech=null;onErr=null;vad=null;detector=null;async start(e){let{sampleRate:n,channels:i}=qD(),r=(this.deps.createVad??(()=>new Er))(),o=null;try{await r.load(),o=new Zu(r,()=>e.onSpeechStart(),{energyThreshold:kE})}catch(u){B.debug("silero vad unavailable; barge-in falls back to decibri energy vad",{error:u}),r.dispose().catch(()=>{})}let s;try{s=await BD.open({sampleRate:n,channels:i,dtype:IE,...o?{vad:!1}:{vad:"energy",vadThreshold:kE},framesPerBuffer:HD(n)})}catch(u){throw o?.close(),o&&r.dispose().catch(()=>{}),u}this.vad=o?r:null,this.detector=o;let a=n===$o&&i===Bu?null:new Vu(n,$o);this.onData=a?u=>{let c=JD(u,i,a);c.byteLength>0&&(this.detector?.feed(c),e.onFrame(c,Date.now()))}:u=>{this.detector?.feed(u),e.onFrame(u,Date.now())},this.onSpeech=()=>e.onSpeechStart(),this.onErr=u=>e.onError(u),s.on("data",this.onData),s.on("speech",this.onSpeech),s.on("error",this.onErr),this.mic=s}async stop(){let e=this.mic;this.mic=null,this.detector?.close(),this.detector=null,e&&(this.onData&&e.removeListener("data",this.onData),this.onSpeech&&e.removeListener("speech",this.onSpeech),this.onErr&&e.removeListener("error",this.onErr),e.on("error",()=>{}),e.stop()),this.onData=null,this.onSpeech=null,this.onErr=null;let n=this.vad;this.vad=null,n&&await n.dispose().catch(()=>{})}},KD=$o*Bu*2/1e3,YD=250,jg=class{speaker=null;writeChain=Promise.resolve();generation=0;closed=!1;playoutEndAtMs=0;drainWakes=new Set;play(e){if(this.closed)return;let n=this.generation;this.writeChain=this.writeChain.then(async()=>{if(!(this.closed||n!==this.generation))try{if(await this.ensureSpeaker().writeAsync(XD(e)),this.closed||n!==this.generation)return;this.playoutEndAtMs=Math.max(this.playoutEndAtMs,Date.now())+e.byteLength/KD}catch(i){B.debug("playback write skipped",{error:i})}})}flush(){this.generation++,this.playoutEndAtMs=0;let e=this.speaker;this.speaker=null,e?.stop();for(let n of[...this.drainWakes])n()}async drained(){await this.writeChain;let e=this.speaker;if(!e)return;let n=Promise.resolve().then(()=>e.drainAsync()).catch(s=>{B.debug("playback drain interrupted",{error:s})}),i=Math.max(0,this.playoutEndAtMs-Date.now())+YD,r=this.sleep(i);await Promise.race([n,r.done]),r.wake();let o=this.playoutEndAtMs-Date.now();o>0&&await this.sleep(o).done}sleep(e){let n;return{done:new Promise(r=>{let o=setTimeout(()=>n(),e);n=()=>{clearTimeout(o),this.drainWakes.delete(n),r()},this.drainWakes.add(n)}),wake:n}}close(){return this.closed=!0,this.flush(),Promise.resolve()}ensureSpeaker(){return this.speaker??=new GD({sampleRate:$o,channels:Bu,dtype:IE}),this.speaker}}});we();nu();Pi();import{readFileSync as QD}from"node:fs";import{randomUUID as e4}from"node:crypto";var gt=class extends Error{constructor(e,n,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=n,this.exitCode=e,this.nestedError=void 0}},At=class extends gt{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var oo=class{constructor(e,n){switch(this.description=n||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,n){return n===this.defaultValue||!Array.isArray(n)?[e]:(n.push(e),n)}default(e,n){return this.defaultValue=e,this.defaultValueDescription=n,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(n,i)=>{if(!this.argChoices.includes(n))throw new At(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(n,i):n},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function iu(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}import{EventEmitter as sC}from"node:events";import Hm from"node:child_process";import Pt from"node:path";import su from"node:fs";import G from"node:process";import{stripVTControlCharacters as aC}from"node:util";import{stripVTControlCharacters as nC}from"node:util";var so=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let n=e.commands.filter(r=>!r._hidden),i=e._getHelpCommand();return i&&!i._hidden&&n.push(i),this.sortSubcommands&&n.sort((r,o)=>r.name().localeCompare(o.name())),n}compareOptions(e,n){let i=r=>r.short?r.short.replace(/^-/,""):r.long.replace(/^--/,"");return i(e).localeCompare(i(n))}visibleOptions(e){let n=e.options.filter(r=>!r.hidden),i=e._getHelpOption();if(i&&!i.hidden){let r=i.short&&e._findOption(i.short),o=i.long&&e._findOption(i.long);!r&&!o?n.push(i):i.long&&!o?n.push(e.createOption(i.long,i.description)):i.short&&!r&&n.push(e.createOption(i.short,i.description))}return this.sortOptions&&n.sort(this.compareOptions),n}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let n=[];for(let i=e.parent;i;i=i.parent){let r=i.options.filter(o=>!o.hidden);n.push(...r)}return this.sortOptions&&n.sort(this.compareOptions),n}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(n=>{n.description=n.description||e._argsDescription[n.name()]||""}),e.registeredArguments.find(n=>n.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(i=>iu(i)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(n?" "+n:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,n){return n.visibleCommands(e).reduce((i,r)=>Math.max(i,this.displayWidth(n.styleSubcommandTerm(n.subcommandTerm(r)))),0)}longestOptionTermLength(e,n){return n.visibleOptions(e).reduce((i,r)=>Math.max(i,this.displayWidth(n.styleOptionTerm(n.optionTerm(r)))),0)}longestGlobalOptionTermLength(e,n){return n.visibleGlobalOptions(e).reduce((i,r)=>Math.max(i,this.displayWidth(n.styleOptionTerm(n.optionTerm(r)))),0)}longestArgumentTermLength(e,n){return n.visibleArguments(e).reduce((i,r)=>Math.max(i,this.displayWidth(n.styleArgumentTerm(n.argumentTerm(r)))),0)}commandUsage(e){let n=e._name;e._aliases[0]&&(n=n+"|"+e._aliases[0]);let i="";for(let r=e.parent;r;r=r.parent)i=r.name()+" "+i;return i+n+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let n=[];if(e.argChoices&&n.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&n.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&n.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&n.push(`env: ${e.envVar}`),n.length>0){let i=`(${n.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}argumentDescription(e){let n=[];if(e.argChoices&&n.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&n.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),n.length>0){let i=`(${n.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}formatItemList(e,n,i){return n.length===0?[]:[i.styleTitle(e),...n,""]}groupItems(e,n,i){let r=new Map;return e.forEach(o=>{let s=i(o);r.has(s)||r.set(s,[])}),n.forEach(o=>{let s=i(o);r.has(s)||r.set(s,[]),r.get(s).push(o)}),r}formatHelp(e,n){let i=n.padWidth(e,n),r=n.helpWidth??80;function o(d,h){return n.formatItem(d,i,h,n)}let s=[`${n.styleTitle("Usage:")} ${n.styleUsage(n.commandUsage(e))}`,""],a=n.commandDescription(e);a.length>0&&(s=s.concat([n.boxWrap(n.styleCommandDescription(a),r),""]));let u=n.visibleArguments(e).map(d=>o(n.styleArgumentTerm(n.argumentTerm(d)),n.styleArgumentDescription(n.argumentDescription(d))));if(s=s.concat(this.formatItemList("Arguments:",u,n)),this.groupItems(e.options,n.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,h)=>{let f=d.map(p=>o(n.styleOptionTerm(n.optionTerm(p)),n.styleOptionDescription(n.optionDescription(p))));s=s.concat(this.formatItemList(h,f,n))}),n.showGlobalOptions){let d=n.visibleGlobalOptions(e).map(h=>o(n.styleOptionTerm(n.optionTerm(h)),n.styleOptionDescription(n.optionDescription(h))));s=s.concat(this.formatItemList("Global Options:",d,n))}return this.groupItems(e.commands,n.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,h)=>{let f=d.map(p=>o(n.styleSubcommandTerm(n.subcommandTerm(p)),n.styleSubcommandDescription(n.subcommandDescription(p))));s=s.concat(this.formatItemList(h,f,n))}),s.join(`
188
+ `)}displayWidth(e){return nC(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(n=>n==="[options]"?this.styleOptionText(n):n==="[command]"?this.styleSubcommandText(n):n[0]==="["||n[0]==="<"?this.styleArgumentText(n):this.styleCommandText(n)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(n=>n==="[options]"?this.styleOptionText(n):n[0]==="["||n[0]==="<"?this.styleArgumentText(n):this.styleSubcommandText(n)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,n){return Math.max(n.longestOptionTermLength(e,n),n.longestGlobalOptionTermLength(e,n),n.longestSubcommandTermLength(e,n),n.longestArgumentTermLength(e,n))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,n,i,r){let s=" ".repeat(2);if(!i)return s+e;let a=e.padEnd(n+e.length-r.displayWidth(e)),u=2,l=(this.helpWidth??80)-n-u-2,d;return l<this.minWidthToWrap||r.preformatted(i)?d=i:d=r.boxWrap(i,l).replace(/\n/g,`
189
189
  `+" ".repeat(n+u)),s+a+" ".repeat(u)+d.replace(/\n/g,`
190
- ${s}`)}boxWrap(e,n){if(n<this.minWidthToWrap)return e;let i=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,o=[];return i.forEach(s=>{let a=s.match(r);if(a===null){o.push("");return}let u=[a.shift()],c=this.displayWidth(u[0]);a.forEach(l=>{let d=this.displayWidth(l);if(c+d<=n){u.push(l),c+=d;return}o.push(u.join(""));let f=l.trimStart();u=[f],c=this.displayWidth(f)}),o.push(u.join(""))}),o.join(`
191
- `)}};var Cn=class{constructor(e,n){this.flags=e,this.description=n||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let i=BP(e);this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,n){return this.defaultValue=e,this.defaultValueDescription=n,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let n=e;return typeof e=="string"&&(n={[e]:!0}),this.implied=Object.assign(this.implied||{},n),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,n){return n===this.defaultValue||!Array.isArray(n)?[e]:(n.push(e),n)}choices(e){return this.argChoices=e.slice(),this.parseArg=(n,i)=>{if(!this.argChoices.includes(n))throw new Ot(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(n,i):n},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?iS(this.name().replace(/^no-/,"")):iS(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},qa=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(n=>{n.negate?this.negativeOptions.set(n.attributeName(),n):this.positiveOptions.set(n.attributeName(),n)}),this.negativeOptions.forEach((n,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i)})}valueFromOption(e,n){let i=n.attributeName();if(!this.dualOptions.has(i))return!0;let r=this.negativeOptions.get(i).presetArg,o=r!==void 0?r:!1;return n.negate===(o===e)}};function iS(t){return t.split("-").reduce((e,n)=>e+n[0].toUpperCase()+n.slice(1))}function BP(t){let e,n,i=/^-[^-]$/,r=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(i.test(o[0])&&(e=o.shift()),r.test(o[0])&&(n=o.shift()),!e&&i.test(o[0])&&(e=o.shift()),!e&&r.test(o[0])&&(e=n,n=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${t}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a}
190
+ ${s}`)}boxWrap(e,n){if(n<this.minWidthToWrap)return e;let i=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,o=[];return i.forEach(s=>{let a=s.match(r);if(a===null){o.push("");return}let u=[a.shift()],c=this.displayWidth(u[0]);a.forEach(l=>{let d=this.displayWidth(l);if(c+d<=n){u.push(l),c+=d;return}o.push(u.join(""));let h=l.trimStart();u=[h],c=this.displayWidth(h)}),o.push(u.join(""))}),o.join(`
191
+ `)}};var Un=class{constructor(e,n){this.flags=e,this.description=n||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let i=iC(e);this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,n){return this.defaultValue=e,this.defaultValueDescription=n,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let n=e;return typeof e=="string"&&(n={[e]:!0}),this.implied=Object.assign(this.implied||{},n),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,n){return n===this.defaultValue||!Array.isArray(n)?[e]:(n.push(e),n)}choices(e){return this.argChoices=e.slice(),this.parseArg=(n,i)=>{if(!this.argChoices.includes(n))throw new At(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(n,i):n},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?hS(this.name().replace(/^no-/,"")):hS(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},ou=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(n=>{n.negate?this.negativeOptions.set(n.attributeName(),n):this.positiveOptions.set(n.attributeName(),n)}),this.negativeOptions.forEach((n,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i)})}valueFromOption(e,n){let i=n.attributeName();if(!this.dualOptions.has(i))return!0;let r=this.negativeOptions.get(i).presetArg,o=r!==void 0?r:!1;return n.negate===(o===e)}};function hS(t){return t.split("-").reduce((e,n)=>e+n[0].toUpperCase()+n.slice(1))}function iC(t){let e,n,i=/^-[^-]$/,r=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(i.test(o[0])&&(e=o.shift()),r.test(o[0])&&(n=o.shift()),!e&&i.test(o[0])&&(e=o.shift()),!e&&r.test(o[0])&&(e=n,n=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${t}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a}
192
192
  - a short flag is a single dash and a single character
193
193
  - either use a single dash and a single character (for a short flag)
194
194
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):i.test(s)?new Error(`${a}
195
195
  - too many short flags`):r.test(s)?new Error(`${a}
196
196
  - too many long flags`):new Error(`${a}
197
- - unrecognised flag format`)}if(e===void 0&&n===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:n}}function GP(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let n=[];for(let i=0;i<=t.length;i++)n[i]=[i];for(let i=0;i<=e.length;i++)n[0][i]=i;for(let i=1;i<=e.length;i++)for(let r=1;r<=t.length;r++){let o;t[r-1]===e[i-1]?o=0:o=1,n[r][i]=Math.min(n[r-1][i]+1,n[r][i-1]+1,n[r-1][i-1]+o),r>1&&i>1&&t[r-1]===e[i-2]&&t[r-2]===e[i-1]&&(n[r][i]=Math.min(n[r][i],n[r-2][i-2]+1))}return n[t.length][e.length]}function Mm(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let n=t.startsWith("--");n&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let i=[],r=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=GP(t,s),u=Math.max(t.length,s.length);(u-a)/u>o&&(a<r?(r=a,i=[s]):a===r&&i.push(s))}),i.sort((s,a)=>s.localeCompare(a)),n&&(i=i.map(s=>`--${s}`)),i.length>1?`
197
+ - unrecognised flag format`)}if(e===void 0&&n===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:n}}function oC(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let n=[];for(let i=0;i<=t.length;i++)n[i]=[i];for(let i=0;i<=e.length;i++)n[0][i]=i;for(let i=1;i<=e.length;i++)for(let r=1;r<=t.length;r++){let o;t[r-1]===e[i-1]?o=0:o=1,n[r][i]=Math.min(n[r-1][i]+1,n[r][i-1]+1,n[r-1][i-1]+o),r>1&&i>1&&t[r-1]===e[i-2]&&t[r-2]===e[i-1]&&(n[r][i]=Math.min(n[r][i],n[r-2][i-2]+1))}return n[t.length][e.length]}function qm(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let n=t.startsWith("--");n&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let i=[],r=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=oC(t,s),u=Math.max(t.length,s.length);(u-a)/u>o&&(a<r?(r=a,i=[s]):a===r&&i.push(s))}),i.sort((s,a)=>s.localeCompare(a)),n&&(i=i.map(s=>`--${s}`)),i.length>1?`
198
198
  (Did you mean one of ${i.join(", ")}?)`:i.length===1?`
199
- (Did you mean ${i[0]}?)`:""}var zn=class t extends WP{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:n=>G.stdout.write(n),writeErr:n=>G.stderr.write(n),outputError:(n,i)=>i(n),getOutHelpWidth:()=>G.stdout.isTTY?G.stdout.columns:void 0,getErrHelpWidth:()=>G.stderr.isTTY?G.stderr.columns:void 0,getOutHasColors:()=>sS()??(G.stdout.isTTY&&G.stdout.hasColors?.()),getErrHasColors:()=>sS()??(G.stderr.isTTY&&G.stderr.hasColors?.()),stripColor:n=>qP(n)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let n=this;n;n=n.parent)e.push(n);return e}command(e,n,i){let r=n,o=i;typeof r=="object"&&r!==null&&(o=r,r=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(s);return r&&(u.description(r),u._executableHandler=!0),o.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(o.noHelp||o.hidden),u._executableFile=o.executableFile||null,a&&u.arguments(a),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),r?this:u}createCommand(e){return new t(e)}createHelp(){return Object.assign(new Qi,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,n){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
200
- - specify the name in Command constructor or using .name()`);return n=n||{},n.isDefault&&(this._defaultCommandName=e._name),(n.noHelp||n.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,n){return new Xi(e,n)}argument(e,n,i,r){let o=this.createArgument(e,n);return typeof i=="function"?o.default(r).argParser(i):o.default(i),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(n=>{this.argument(n)}),this}addArgument(e){let n=this.registeredArguments.slice(-1)[0];if(n?.variadic)throw new Error(`only the last argument can be variadic '${n.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,n){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let i=e??"help [command]",[,r,o]=i.match(/([^ ]+) *(.*)/),s=n??"display help for command",a=this.createCommand(r);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||n)&&this._initCommandGroup(a),this}addHelpCommand(e,n){return typeof e!="object"?(this.helpCommand(e,n),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,n){let i=["preSubcommand","preAction","postAction"];if(!i.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
201
- Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(n):this._lifeCycleHooks[e]=[n],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=n=>{if(n.code!=="commander.executeSubCommandAsync")throw n},this}_exit(e,n,i){this._exitCallback&&this._exitCallback(new mt(e,n,i)),G.exit(e)}action(e){let n=i=>{let r=this.registeredArguments.length,o=i.slice(0,r);return this._storeOptionsAsProperties?o[r]=this:o[r]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=n,this}createOption(e,n){return new Cn(e,n)}_callParseArg(e,n,i,r){try{return e.parseArg(n,i)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${r} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let n=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(n){let i=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'
202
- - already used by option '${n.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let n=r=>[r.name()].concat(r.aliases()),i=n(e).find(r=>this._findCommand(r));if(i){let r=n(this._findCommand(i)).join("|"),o=n(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${r}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let n=e.name(),i=e.attributeName();e.defaultValue!==void 0&&this.setOptionValueWithSource(i,e.defaultValue,"default");let r=(o,s,a)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let u=this.getOptionValue(i);o!==null&&e.parseArg?o=this._callParseArg(e,o,u,s):o!==null&&e.variadic&&(o=e._collectValue(o,u)),o==null&&(e.negate?o=!1:e.isBoolean()||e.optional?o=!0:o=""),this.setOptionValueWithSource(i,o,a)};return this.on("option:"+n,o=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;r(o,s,"cli")}),e.envVar&&this.on("optionEnv:"+n,o=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;r(o,s,"env")}),this}_optionEx(e,n,i,r,o){if(typeof n=="object"&&n instanceof Cn)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(n,i);if(s.makeOptionMandatory(!!e.mandatory),typeof r=="function")s.default(o).argParser(r);else if(r instanceof RegExp){let a=r;r=(u,c)=>{let l=a.exec(u);return l?l[0]:c},s.default(o).argParser(r)}else s.default(r);return this.addOption(s)}option(e,n,i,r){return this._optionEx({},e,n,i,r)}requiredOption(e,n,i,r){return this._optionEx({mandatory:!0},e,n,i,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,n){return this.setOptionValueWithSource(e,n,void 0)}setOptionValueWithSource(e,n,i){return this._storeOptionsAsProperties?this[e]=n:this._optionValues[e]=n,this._optionValueSources[e]=i,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let n;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(e)!==void 0&&(n=i.getOptionValueSource(e))}),n}_prepareUserArgs(e,n){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(n=n||{},e===void 0&&n.from===void 0){G.versions?.electron&&(n.from="electron");let r=G.execArgv??[];(r.includes("-e")||r.includes("--eval")||r.includes("-p")||r.includes("--print"))&&(n.from="eval")}e===void 0&&(e=G.argv),this.rawArgs=e.slice();let i;switch(n.from){case void 0:case"node":this._scriptPath=e[1],i=e.slice(2);break;case"electron":G.defaultApp?(this._scriptPath=e[1],i=e.slice(2)):i=e.slice(1);break;case"user":i=e.slice(0);break;case"eval":i=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${n.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(e,n){this._prepareForParse();let i=this._prepareUserArgs(e,n);return this._parseCommand([],i),this}async parseAsync(e,n){this._prepareForParse();let i=this._prepareUserArgs(e,n);return await this._parseCommand([],i),this}_prepareForParse(){this._savedState===null?(this.options.filter(e=>e.negate&&e.defaultValue===void 0&&this.getOptionValue(e.attributeName())===void 0).forEach(e=>{let n=e.long.replace(/^--no-/,"--");this._findOption(n)||this.setOptionValueWithSource(e.attributeName(),!0,"default")}),this.saveStateBeforeParse()):this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
203
- - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,n,i){if(Ha.existsSync(e))return;let r=n?`searched for local subcommand relative to directory '${n}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist
199
+ (Did you mean ${i[0]}?)`:""}var jn=class t extends sC{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:n=>G.stdout.write(n),writeErr:n=>G.stderr.write(n),outputError:(n,i)=>i(n),getOutHelpWidth:()=>G.stdout.isTTY?G.stdout.columns:void 0,getErrHelpWidth:()=>G.stderr.isTTY?G.stderr.columns:void 0,getOutHasColors:()=>pS()??(G.stdout.isTTY&&G.stdout.hasColors?.()),getErrHasColors:()=>pS()??(G.stderr.isTTY&&G.stderr.hasColors?.()),stripColor:n=>aC(n)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let n=this;n;n=n.parent)e.push(n);return e}command(e,n,i){let r=n,o=i;typeof r=="object"&&r!==null&&(o=r,r=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(s);return r&&(u.description(r),u._executableHandler=!0),o.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(o.noHelp||o.hidden),u._executableFile=o.executableFile||null,a&&u.arguments(a),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),r?this:u}createCommand(e){return new t(e)}createHelp(){return Object.assign(new so,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,n){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
200
+ - specify the name in Command constructor or using .name()`);return n=n||{},n.isDefault&&(this._defaultCommandName=e._name),(n.noHelp||n.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,n){return new oo(e,n)}argument(e,n,i,r){let o=this.createArgument(e,n);return typeof i=="function"?o.default(r).argParser(i):o.default(i),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(n=>{this.argument(n)}),this}addArgument(e){let n=this.registeredArguments.slice(-1)[0];if(n?.variadic)throw new Error(`only the last argument can be variadic '${n.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,n){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let i=e??"help [command]",[,r,o]=i.match(/([^ ]+) *(.*)/),s=n??"display help for command",a=this.createCommand(r);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||n)&&this._initCommandGroup(a),this}addHelpCommand(e,n){return typeof e!="object"?(this.helpCommand(e,n),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,n){let i=["preSubcommand","preAction","postAction"];if(!i.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
201
+ Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(n):this._lifeCycleHooks[e]=[n],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=n=>{if(n.code!=="commander.executeSubCommandAsync")throw n},this}_exit(e,n,i){this._exitCallback&&this._exitCallback(new gt(e,n,i)),G.exit(e)}action(e){let n=i=>{let r=this.registeredArguments.length,o=i.slice(0,r);return this._storeOptionsAsProperties?o[r]=this:o[r]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=n,this}createOption(e,n){return new Un(e,n)}_callParseArg(e,n,i,r){try{return e.parseArg(n,i)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${r} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let n=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(n){let i=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'
202
+ - already used by option '${n.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let n=r=>[r.name()].concat(r.aliases()),i=n(e).find(r=>this._findCommand(r));if(i){let r=n(this._findCommand(i)).join("|"),o=n(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${r}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let n=e.name(),i=e.attributeName();e.defaultValue!==void 0&&this.setOptionValueWithSource(i,e.defaultValue,"default");let r=(o,s,a)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let u=this.getOptionValue(i);o!==null&&e.parseArg?o=this._callParseArg(e,o,u,s):o!==null&&e.variadic&&(o=e._collectValue(o,u)),o==null&&(e.negate?o=!1:e.isBoolean()||e.optional?o=!0:o=""),this.setOptionValueWithSource(i,o,a)};return this.on("option:"+n,o=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;r(o,s,"cli")}),e.envVar&&this.on("optionEnv:"+n,o=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;r(o,s,"env")}),this}_optionEx(e,n,i,r,o){if(typeof n=="object"&&n instanceof Un)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(n,i);if(s.makeOptionMandatory(!!e.mandatory),typeof r=="function")s.default(o).argParser(r);else if(r instanceof RegExp){let a=r;r=(u,c)=>{let l=a.exec(u);return l?l[0]:c},s.default(o).argParser(r)}else s.default(r);return this.addOption(s)}option(e,n,i,r){return this._optionEx({},e,n,i,r)}requiredOption(e,n,i,r){return this._optionEx({mandatory:!0},e,n,i,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,n){return this.setOptionValueWithSource(e,n,void 0)}setOptionValueWithSource(e,n,i){return this._storeOptionsAsProperties?this[e]=n:this._optionValues[e]=n,this._optionValueSources[e]=i,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let n;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(e)!==void 0&&(n=i.getOptionValueSource(e))}),n}_prepareUserArgs(e,n){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(n=n||{},e===void 0&&n.from===void 0){G.versions?.electron&&(n.from="electron");let r=G.execArgv??[];(r.includes("-e")||r.includes("--eval")||r.includes("-p")||r.includes("--print"))&&(n.from="eval")}e===void 0&&(e=G.argv),this.rawArgs=e.slice();let i;switch(n.from){case void 0:case"node":this._scriptPath=e[1],i=e.slice(2);break;case"electron":G.defaultApp?(this._scriptPath=e[1],i=e.slice(2)):i=e.slice(1);break;case"user":i=e.slice(0);break;case"eval":i=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${n.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(e,n){this._prepareForParse();let i=this._prepareUserArgs(e,n);return this._parseCommand([],i),this}async parseAsync(e,n){this._prepareForParse();let i=this._prepareUserArgs(e,n);return await this._parseCommand([],i),this}_prepareForParse(){this._savedState===null?(this.options.filter(e=>e.negate&&e.defaultValue===void 0&&this.getOptionValue(e.attributeName())===void 0).forEach(e=>{let n=e.long.replace(/^--no-/,"--");this._findOption(n)||this.setOptionValueWithSource(e.attributeName(),!0,"default")}),this.saveStateBeforeParse()):this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
203
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,n,i){if(su.existsSync(e))return;let r=n?`searched for local subcommand relative to directory '${n}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist
204
204
  - if '${i}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
205
205
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
206
- - ${r}`;throw new Error(o)}_executeSubCommand(e,n){n=n.slice();let i=[".js",".ts",".tsx",".mjs",".cjs"];function r(l,d){let f=At.resolve(l,d);if(Ha.existsSync(f))return f;if(i.includes(At.extname(d)))return;let h=i.find(p=>Ha.existsSync(`${f}${p}`));if(h)return`${f}${h}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,s=this._executableDir||"";if(this._scriptPath){let l;try{l=Ha.realpathSync(this._scriptPath)}catch{l=this._scriptPath}s=At.resolve(At.dirname(l),s)}if(s){let l=r(s,o);if(!l&&!e._executableFile&&this._scriptPath){let d=At.basename(this._scriptPath,At.extname(this._scriptPath));d!==this._name&&(l=r(s,`${d}-${e._name}`))}o=l||o}let a=i.includes(At.extname(o)),u;G.platform!=="win32"?a?(n.unshift(o),n=oS(G.execArgv).concat(n),u=Fm.spawn(G.argv[0],n,{stdio:"inherit"})):u=Fm.spawn(o,n,{stdio:"inherit"}):(this._checkForMissingExecutable(o,s,e._name),n.unshift(o),n=oS(G.execArgv).concat(n),u=Fm.spawn(G.execPath,n,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{G.on(d,()=>{u.killed===!1&&u.exitCode===null&&u.kill(d)})});let c=this._exitCallback;u.on("close",l=>{l=l??1,c?c(new mt(l,"commander.executeSubCommandAsync","(close)")):G.exit(l)}),u.on("error",l=>{if(l.code==="ENOENT")this._checkForMissingExecutable(o,s,e._name);else if(l.code==="EACCES")throw new Error(`'${o}' not executable`);if(!c)G.exit(1);else{let d=new mt(1,"commander.executeSubCommandAsync","(error)");d.nestedError=l,c(d)}}),this.runningCommand=u}_dispatchSubcommand(e,n,i){let r=this._findCommand(e);r||this.help({error:!0}),r._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,r,"preSubcommand"),o=this._chainOrCall(o,()=>{if(r._executableHandler)this._executeSubCommand(r,n.concat(i));else return r._parseCommand(n,i)}),o}_dispatchHelpCommand(e){e||this.help();let n=this._findCommand(e);return n&&!n._executableHandler&&n.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,n)=>{e.required&&this.args[n]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(i,r,o)=>{let s=r;if(r!==null&&i.parseArg){let a=`error: command-argument value '${r}' is invalid for argument '${i.name()}'.`;s=this._callParseArg(i,r,o,a)}return s};this._checkNumberOfArguments();let n=[];this.registeredArguments.forEach((i,r)=>{let o=i.defaultValue;i.variadic?r<this.args.length?(o=this.args.slice(r),i.parseArg&&(o=o.reduce((s,a)=>e(i,a,s),i.defaultValue))):o===void 0&&(o=[]):r<this.args.length&&(o=this.args[r],i.parseArg&&(o=e(i,o,i.defaultValue))),n[r]=o}),this.processedArgs=n}_chainOrCall(e,n){return e?.then&&typeof e.then=="function"?e.then(()=>n()):n()}_chainOrCallHooks(e,n){let i=e,r=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[n]!==void 0).forEach(o=>{o._lifeCycleHooks[n].forEach(s=>{r.push({hookedCommand:o,callback:s})})}),n==="postAction"&&r.reverse(),r.forEach(o=>{i=this._chainOrCall(i,()=>o.callback(o.hookedCommand,this))}),i}_chainOrCallSubCommandHook(e,n,i){let r=e;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(o=>{r=this._chainOrCall(r,()=>o(this,n))}),r}_parseCommand(e,n){let i=this.parseOptions(n);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(i.operands),n=i.unknown,this.args=e.concat(n),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),n);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(n),this._dispatchSubcommand(this._defaultCommandName,e,n);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){r(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,e,n)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))r(),this._processArguments(),this.parent.emit(o,e,n);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,n);this.listenerCount("command:*")?this.emit("command:*",e,n):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(n=>n._name===e||n._aliases.includes(e))}_findOption(e){return this.options.find(n=>n.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(n=>{n.mandatory&&e.getOptionValue(n.attributeName())===void 0&&e.missingMandatoryOptionValue(n)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(i=>{let r=i.attributeName();return this.getOptionValue(r)===void 0?!1:this.getOptionValueSource(r)!=="default"});e.filter(i=>i.conflictsWith.length>0).forEach(i=>{let r=e.find(o=>i.conflictsWith.includes(o.attributeName()));r&&this._conflictingOption(i,r)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let n=[],i=[],r=n;function o(l){return l.length>1&&l[0]==="-"}let s=l=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(d=>d.options.map(f=>f.short).some(f=>/^-\d$/.test(f))):!1,a=null,u=null,c=0;for(;c<e.length||u;){let l=u??e[c++];if(u=null,l==="--"){r===i&&r.push(l),r.push(...e.slice(c));break}if(a&&(!o(l)||s(l))){this.emit(`option:${a.name()}`,l);continue}if(a=null,o(l)){let d=this._findOption(l);if(d){if(d.required){let f=e[c++];f===void 0&&this.optionMissingArgument(d),this.emit(`option:${d.name()}`,f)}else if(d.optional){let f=null;c<e.length&&(!o(e[c])||s(e[c]))&&(f=e[c++]),this.emit(`option:${d.name()}`,f)}else this.emit(`option:${d.name()}`);a=d.variadic?d:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let d=this._findOption(`-${l[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,l.slice(2)):(this.emit(`option:${d.name()}`),u=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let d=l.indexOf("="),f=this._findOption(l.slice(0,d));if(f&&(f.required||f.optional)){this.emit(`option:${f.name()}`,l.slice(d+1));continue}}if(r===n&&o(l)&&!(this.commands.length===0&&s(l))&&(r=i),(this._enablePositionalOptions||this._passThroughOptions)&&n.length===0&&i.length===0){if(this._findCommand(l)){n.push(l),i.push(...e.slice(c));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){n.push(l,...e.slice(c));break}else if(this._defaultCommandName){i.push(l,...e.slice(c));break}}if(this._passThroughOptions){r.push(l,...e.slice(c));break}r.push(l)}return{operands:n,unknown:i}}opts(){if(this._storeOptionsAsProperties){let e={},n=this.options.length;for(let i=0;i<n;i++){let r=this.options[i].attributeName();e[r]=r===this._versionOptionName?this._version:this[r]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,n)=>Object.assign(e,n.opts()),{})}error(e,n){this._outputConfiguration.outputError(`${e}
206
+ - ${r}`;throw new Error(o)}_executeSubCommand(e,n){n=n.slice();let i=[".js",".ts",".tsx",".mjs",".cjs"];function r(l,d){let h=Pt.resolve(l,d);if(su.existsSync(h))return h;if(i.includes(Pt.extname(d)))return;let f=i.find(p=>su.existsSync(`${h}${p}`));if(f)return`${h}${f}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,s=this._executableDir||"";if(this._scriptPath){let l;try{l=su.realpathSync(this._scriptPath)}catch{l=this._scriptPath}s=Pt.resolve(Pt.dirname(l),s)}if(s){let l=r(s,o);if(!l&&!e._executableFile&&this._scriptPath){let d=Pt.basename(this._scriptPath,Pt.extname(this._scriptPath));d!==this._name&&(l=r(s,`${d}-${e._name}`))}o=l||o}let a=i.includes(Pt.extname(o)),u;G.platform!=="win32"?a?(n.unshift(o),n=fS(G.execArgv).concat(n),u=Hm.spawn(G.argv[0],n,{stdio:"inherit"})):u=Hm.spawn(o,n,{stdio:"inherit"}):(this._checkForMissingExecutable(o,s,e._name),n.unshift(o),n=fS(G.execArgv).concat(n),u=Hm.spawn(G.execPath,n,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{G.on(d,()=>{u.killed===!1&&u.exitCode===null&&u.kill(d)})});let c=this._exitCallback;u.on("close",l=>{l=l??1,c?c(new gt(l,"commander.executeSubCommandAsync","(close)")):G.exit(l)}),u.on("error",l=>{if(l.code==="ENOENT")this._checkForMissingExecutable(o,s,e._name);else if(l.code==="EACCES")throw new Error(`'${o}' not executable`);if(!c)G.exit(1);else{let d=new gt(1,"commander.executeSubCommandAsync","(error)");d.nestedError=l,c(d)}}),this.runningCommand=u}_dispatchSubcommand(e,n,i){let r=this._findCommand(e);r||this.help({error:!0}),r._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,r,"preSubcommand"),o=this._chainOrCall(o,()=>{if(r._executableHandler)this._executeSubCommand(r,n.concat(i));else return r._parseCommand(n,i)}),o}_dispatchHelpCommand(e){e||this.help();let n=this._findCommand(e);return n&&!n._executableHandler&&n.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,n)=>{e.required&&this.args[n]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(i,r,o)=>{let s=r;if(r!==null&&i.parseArg){let a=`error: command-argument value '${r}' is invalid for argument '${i.name()}'.`;s=this._callParseArg(i,r,o,a)}return s};this._checkNumberOfArguments();let n=[];this.registeredArguments.forEach((i,r)=>{let o=i.defaultValue;i.variadic?r<this.args.length?(o=this.args.slice(r),i.parseArg&&(o=o.reduce((s,a)=>e(i,a,s),i.defaultValue))):o===void 0&&(o=[]):r<this.args.length&&(o=this.args[r],i.parseArg&&(o=e(i,o,i.defaultValue))),n[r]=o}),this.processedArgs=n}_chainOrCall(e,n){return e?.then&&typeof e.then=="function"?e.then(()=>n()):n()}_chainOrCallHooks(e,n){let i=e,r=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[n]!==void 0).forEach(o=>{o._lifeCycleHooks[n].forEach(s=>{r.push({hookedCommand:o,callback:s})})}),n==="postAction"&&r.reverse(),r.forEach(o=>{i=this._chainOrCall(i,()=>o.callback(o.hookedCommand,this))}),i}_chainOrCallSubCommandHook(e,n,i){let r=e;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(o=>{r=this._chainOrCall(r,()=>o(this,n))}),r}_parseCommand(e,n){let i=this.parseOptions(n);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(i.operands),n=i.unknown,this.args=e.concat(n),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),n);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(n),this._dispatchSubcommand(this._defaultCommandName,e,n);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){r(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,e,n)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))r(),this._processArguments(),this.parent.emit(o,e,n);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,n);this.listenerCount("command:*")?this.emit("command:*",e,n):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(n=>n._name===e||n._aliases.includes(e))}_findOption(e){return this.options.find(n=>n.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(n=>{n.mandatory&&e.getOptionValue(n.attributeName())===void 0&&e.missingMandatoryOptionValue(n)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(i=>{let r=i.attributeName();return this.getOptionValue(r)===void 0?!1:this.getOptionValueSource(r)!=="default"});e.filter(i=>i.conflictsWith.length>0).forEach(i=>{let r=e.find(o=>i.conflictsWith.includes(o.attributeName()));r&&this._conflictingOption(i,r)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let n=[],i=[],r=n;function o(l){return l.length>1&&l[0]==="-"}let s=l=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(d=>d.options.map(h=>h.short).some(h=>/^-\d$/.test(h))):!1,a=null,u=null,c=0;for(;c<e.length||u;){let l=u??e[c++];if(u=null,l==="--"){r===i&&r.push(l),r.push(...e.slice(c));break}if(a&&(!o(l)||s(l))){this.emit(`option:${a.name()}`,l);continue}if(a=null,o(l)){let d=this._findOption(l);if(d){if(d.required){let h=e[c++];h===void 0&&this.optionMissingArgument(d),this.emit(`option:${d.name()}`,h)}else if(d.optional){let h=null;c<e.length&&(!o(e[c])||s(e[c]))&&(h=e[c++]),this.emit(`option:${d.name()}`,h)}else this.emit(`option:${d.name()}`);a=d.variadic?d:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let d=this._findOption(`-${l[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,l.slice(2)):(this.emit(`option:${d.name()}`),u=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let d=l.indexOf("="),h=this._findOption(l.slice(0,d));if(h&&(h.required||h.optional)){this.emit(`option:${h.name()}`,l.slice(d+1));continue}}if(r===n&&o(l)&&!(this.commands.length===0&&s(l))&&(r=i),(this._enablePositionalOptions||this._passThroughOptions)&&n.length===0&&i.length===0){if(this._findCommand(l)){n.push(l),i.push(...e.slice(c));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){n.push(l,...e.slice(c));break}else if(this._defaultCommandName){i.push(l,...e.slice(c));break}}if(this._passThroughOptions){r.push(l,...e.slice(c));break}r.push(l)}return{operands:n,unknown:i}}opts(){if(this._storeOptionsAsProperties){let e={},n=this.options.length;for(let i=0;i<n;i++){let r=this.options[i].attributeName();e[r]=r===this._versionOptionName?this._version:this[r]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,n)=>Object.assign(e,n.opts()),{})}error(e,n){this._outputConfiguration.outputError(`${e}
207
207
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
208
208
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
209
- `),this.outputHelp({error:!0}));let i=n||{},r=i.exitCode||1,o=i.code||"commander.error";this._exit(r,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in G.env){let n=e.attributeName();(this.getOptionValue(n)===void 0||["default","config","env"].includes(this.getOptionValueSource(n)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,G.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new qa(this.options),n=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&n(i.attributeName())&&e.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(r=>!n(r)).forEach(r=>{this.setOptionValueWithSource(r,i.implied[r],"implied")})})}missingArgument(e){let n=`error: missing required argument '${e}'`;this.error(n,{code:"commander.missingArgument"})}optionMissingArgument(e){let n=`error: option '${e.flags}' argument missing`;this.error(n,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let n=`error: required option '${e.flags}' not specified`;this.error(n,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,n){let i=s=>{let a=s.attributeName(),u=this.getOptionValue(a),c=this.options.find(d=>d.negate&&a===d.attributeName()),l=this.options.find(d=>!d.negate&&a===d.attributeName());return c&&(c.presetArg===void 0&&u===!1||c.presetArg!==void 0&&u===c.presetArg)?c:l||s},r=s=>{let a=i(s),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${r(e)} cannot be used with ${r(n)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let n="";if(e.startsWith("--")&&this._showSuggestionAfterError){let r=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);r=r.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);n=Mm(e,r)}let i=`error: unknown option '${e}'${n}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let n=this.registeredArguments.length,i=n===1?"":"s",r=e.length,o=this.parent?` for '${this.name()}'`:"",s=e.join(", "),a=`error: too many arguments${o}. Expected ${n} argument${i} but got ${r}: ${s}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],n="";if(this._showSuggestionAfterError){let r=[];this.createHelp().visibleCommands(this).forEach(o=>{r.push(o.name()),o.alias()&&r.push(o.alias())}),n=Mm(e,r)}let i=`error: unknown command '${e}'${n}`;this.error(i,{code:"commander.unknownCommand"})}version(e,n,i){if(e===void 0)return this._version;this._version=e,n=n||"-V, --version",i=i||"output the version number";let r=this.createOption(n,i);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on("option:"+r.name(),()=>{this._outputConfiguration.writeOut(`${e}
210
- `),this._exit(0,"commander.version",e)}),this}description(e,n){return e===void 0&&n===void 0?this._description:(this._description=e,n&&(this._argsDescription=n),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let n=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(n=this.commands[this.commands.length-1]),e===n._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(e);if(i){let r=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${r}'`)}return n._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(n=>this.alias(n)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let n=this.registeredArguments.map(i=>Wa(i));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?n:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=At.basename(e,At.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let n=this.createHelp(),i=this._getOutputContext(e);n.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let r=n.formatHelp(this,n);return i.hasColors?r:this._outputConfiguration.stripColor(r)}_getOutputContext(e){e=e||{};let n=!!e.error,i,r,o;return n?(i=a=>this._outputConfiguration.writeErr(a),r=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(i=a=>this._outputConfiguration.writeOut(a),r=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:n,write:a=>(r||(a=this._outputConfiguration.stripColor(a)),i(a)),hasColors:r,helpWidth:o}}outputHelp(e){let n;typeof e=="function"&&(n=e,e=void 0);let i=this._getOutputContext(e),r={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",r)),this.emit("beforeHelp",r);let o=this.helpInformation({error:i.error});if(n&&(o=n(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",r),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",r))}helpOption(e,n){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",n??"display help for command"),(e||n)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let n=Number(G.exitCode??0);n===0&&e&&typeof e!="function"&&e.error&&(n=1),this._exit(n,"commander.help","(outputHelp)")}addHelpText(e,n){let i=["beforeAll","before","after","afterAll"];if(!i.includes(e))throw new Error(`Unexpected value for position to addHelpText.
209
+ `),this.outputHelp({error:!0}));let i=n||{},r=i.exitCode||1,o=i.code||"commander.error";this._exit(r,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in G.env){let n=e.attributeName();(this.getOptionValue(n)===void 0||["default","config","env"].includes(this.getOptionValueSource(n)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,G.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new ou(this.options),n=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&n(i.attributeName())&&e.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(r=>!n(r)).forEach(r=>{this.setOptionValueWithSource(r,i.implied[r],"implied")})})}missingArgument(e){let n=`error: missing required argument '${e}'`;this.error(n,{code:"commander.missingArgument"})}optionMissingArgument(e){let n=`error: option '${e.flags}' argument missing`;this.error(n,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let n=`error: required option '${e.flags}' not specified`;this.error(n,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,n){let i=s=>{let a=s.attributeName(),u=this.getOptionValue(a),c=this.options.find(d=>d.negate&&a===d.attributeName()),l=this.options.find(d=>!d.negate&&a===d.attributeName());return c&&(c.presetArg===void 0&&u===!1||c.presetArg!==void 0&&u===c.presetArg)?c:l||s},r=s=>{let a=i(s),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${r(e)} cannot be used with ${r(n)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let n="";if(e.startsWith("--")&&this._showSuggestionAfterError){let r=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);r=r.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);n=qm(e,r)}let i=`error: unknown option '${e}'${n}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let n=this.registeredArguments.length,i=n===1?"":"s",r=e.length,o=this.parent?` for '${this.name()}'`:"",s=e.join(", "),a=`error: too many arguments${o}. Expected ${n} argument${i} but got ${r}: ${s}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],n="";if(this._showSuggestionAfterError){let r=[];this.createHelp().visibleCommands(this).forEach(o=>{r.push(o.name()),o.alias()&&r.push(o.alias())}),n=qm(e,r)}let i=`error: unknown command '${e}'${n}`;this.error(i,{code:"commander.unknownCommand"})}version(e,n,i){if(e===void 0)return this._version;this._version=e,n=n||"-V, --version",i=i||"output the version number";let r=this.createOption(n,i);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on("option:"+r.name(),()=>{this._outputConfiguration.writeOut(`${e}
210
+ `),this._exit(0,"commander.version",e)}),this}description(e,n){return e===void 0&&n===void 0?this._description:(this._description=e,n&&(this._argsDescription=n),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let n=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(n=this.commands[this.commands.length-1]),e===n._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(e);if(i){let r=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${r}'`)}return n._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(n=>this.alias(n)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let n=this.registeredArguments.map(i=>iu(i));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?n:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=Pt.basename(e,Pt.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let n=this.createHelp(),i=this._getOutputContext(e);n.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let r=n.formatHelp(this,n);return i.hasColors?r:this._outputConfiguration.stripColor(r)}_getOutputContext(e){e=e||{};let n=!!e.error,i,r,o;return n?(i=a=>this._outputConfiguration.writeErr(a),r=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(i=a=>this._outputConfiguration.writeOut(a),r=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:n,write:a=>(r||(a=this._outputConfiguration.stripColor(a)),i(a)),hasColors:r,helpWidth:o}}outputHelp(e){let n;typeof e=="function"&&(n=e,e=void 0);let i=this._getOutputContext(e),r={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",r)),this.emit("beforeHelp",r);let o=this.helpInformation({error:i.error});if(n&&(o=n(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",r),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",r))}helpOption(e,n){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",n??"display help for command"),(e||n)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let n=Number(G.exitCode??0);n===0&&e&&typeof e!="function"&&e.error&&(n=1),this._exit(n,"commander.help","(outputHelp)")}addHelpText(e,n){let i=["beforeAll","before","after","afterAll"];if(!i.includes(e))throw new Error(`Unexpected value for position to addHelpText.
211
211
  Expecting one of '${i.join("', '")}'`);let r=`${e}Help`;return this.on(r,o=>{let s;typeof n=="function"?s=n({error:o.error,command:o.command}):s=n,s&&o.write(`${s}
212
- `)}),this}_outputHelpIfRequested(e){let n=this._getHelpOption();n&&e.find(r=>n.is(r))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function oS(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let n,i="127.0.0.1",r="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?n=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(n=o[1],/^\d+$/.test(o[3])?r=o[3]:i=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(n=o[1],i=o[3],r=o[4]),n&&r!=="0"?`${n}=${i}:${parseInt(r)+1}`:e})}function sS(){if(G.env.NO_COLOR||G.env.FORCE_COLOR==="0"||G.env.FORCE_COLOR==="false")return!1;if(G.env.FORCE_COLOR||G.env.CLICOLOR_FORCE!==void 0)return!0}var dF=new zn;Ae();var ue={out:t=>process.stdout.write(t),err:t=>process.stderr.write(t)};function HP(t){if(t==="debug"||t==="info"||t==="warn"||t==="error")return t;throw new Ot("expected one of debug|info|warn|error")}function Ja(t){return t.option("--log-level <level>","set log verbosity (debug|info|warn|error)",HP).option("--project <path>","approved project scope (default: cwd)").option("--text","force text-only operation").option("--no-voice","force text-only operation (disable voice)").option("--half-duplex","mute barge-in; mute the mic while jarvis speaks (no headphones)").option("--ptt","push-to-talk: press space to talk, again to send")}function JP(t){return t.text===!0||t.voice===!1}function KP(t,e,n,i=ue){let r=new zn;r.name("jarvis").description("jarvis - voice-first personal agent").configureOutput({writeOut:s=>i.out(s),writeErr:s=>i.err(s)}).showHelpAfterError().exitOverride().allowExcessArguments(!0).version(t,"-v, --version","print version"),Ja(r),r.hook("preAction",(s,a)=>{let u=a.optsWithGlobals();u.logLevel&&B.setLevel(u.logLevel)}),r.action(async(s,a)=>{if(a.args.length>0){a.error(`error: unknown command '${a.args[0]}'`,{exitCode:1,code:"commander.unknownCommand"});return}n.exitCode=await e.activate({project:s.project??process.cwd(),textOnly:JP(s),halfDuplex:s.halfDuplex===!0,ptt:s.ptt===!0})});let o=(s,a)=>{let u=r.command(s).description(a).allowExcessArguments(!1);return Ja(u)};return o("init","first-run setup (interactive wizard)").action(async()=>{n.exitCode=await e.init()}),o("start","start the local core service").action(()=>{n.exitCode=e.stub("start")}),o("stop","stop the local core service").action(()=>{n.exitCode=e.stub("stop")}),o("restart","restart the local core service").action(()=>{n.exitCode=e.stub("restart")}),o("status","show version and check for updates").action(async()=>{n.exitCode=await e.status()}),o("doctor","run diagnostics").action(async()=>{n.exitCode=await e.doctor()}),o("devices","list audio devices").action(()=>{n.exitCode=e.stub("devices")}),o("upgrade","upgrade the installed CLI to the latest published version").action(async()=>{n.exitCode=await e.upgrade()}),YP(r,e,n),r}function YP(t,e,n){let i=t.command("config").description("inspect and edit configuration").allowExcessArguments(!0);Ja(i),i.action((o,s)=>{if(s.args.length>0){s.error(`error: unknown command 'config ${s.args[0]}'`,{exitCode:1,code:"commander.unknownCommand"});return}s.outputHelp(),n.exitCode=0});let r=(o,s)=>{let a=i.command(o).description(s).allowExcessArguments(!1);return Ja(a)};r("list","print the resolved config (secrets redacted)").action(async()=>{n.exitCode=await e.configList()}),r("get <path>","print one config value by dotted path").action(async o=>{n.exitCode=await e.configGet(o)}),r("set <path> <value>","set one config value by dotted path").action(async(o,s)=>{n.exitCode=await e.configSet(o,s)}),r("unset <path>","remove one config value by dotted path").action(async o=>{n.exitCode=await e.configUnset(o)})}async function aS(t,e,n,i=ue){let r={exitCode:0},o=KP(e,n,r,i);try{return await o.parseAsync(t,{from:"user"}),r.exitCode}catch(s){if(s instanceof mt)return s.exitCode;throw s}}Ae();import{execSync as ek,spawnSync as iN}from"node:child_process";import{existsSync as oN}from"node:fs";import{join as sN}from"node:path";var uu=Je(X0(),1);function Ir(t,e){let n=Q0(t),i=Q0(e);return n===null||i===null?!1:uu.default.gt(n,i)}function Q0(t){return uu.default.valid(t)??uu.default.coerce(t)?.version??null}var Tr=class{constructor(e,n=ue){this.currentVersion=e;this.io=n}currentVersion;io;packageName="@neuvybe/jarvis";registryTimeoutMs=3e3;safeVersion=/^[0-9A-Za-z.\-+]+$/;npmCmd(){return process.platform==="win32"?"npm.cmd":"npm"}async fetchLatest(){try{let e=await fetch(`https://registry.npmjs.org/${this.packageName}/latest`,{headers:{accept:"application/json"},signal:AbortSignal.timeout(this.registryTimeoutMs)});if(!e.ok)return null;let n=await e.json();return typeof n.version=="string"?n.version:null}catch{return null}}async status(){this.io.out(`jarvis ${this.currentVersion}
212
+ `)}),this}_outputHelpIfRequested(e){let n=this._getHelpOption();n&&e.find(r=>n.is(r))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function fS(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let n,i="127.0.0.1",r="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?n=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(n=o[1],/^\d+$/.test(o[3])?r=o[3]:i=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(n=o[1],i=o[3],r=o[4]),n&&r!=="0"?`${n}=${i}:${parseInt(r)+1}`:e})}function pS(){if(G.env.NO_COLOR||G.env.FORCE_COLOR==="0"||G.env.FORCE_COLOR==="false")return!1;if(G.env.FORCE_COLOR||G.env.CLICOLOR_FORCE!==void 0)return!0}var NF=new jn;we();var ue={out:t=>process.stdout.write(t),err:t=>process.stderr.write(t)};function uC(t){if(t==="debug"||t==="info"||t==="warn"||t==="error")return t;throw new At("expected one of debug|info|warn|error")}function au(t){return t.option("--log-level <level>","set log verbosity (debug|info|warn|error)",uC).option("--project <path>","approved project scope (default: cwd)").option("--text","force text-only operation").option("--no-voice","force text-only operation (disable voice)").option("--half-duplex","mute barge-in; mute the mic while jarvis speaks (no headphones)").option("--ptt","push-to-talk: press space to talk, again to send")}function cC(t){return t.text===!0||t.voice===!1}function lC(t,e,n,i=ue){let r=new jn;r.name("jarvis").description("jarvis - voice-first personal agent").configureOutput({writeOut:s=>i.out(s),writeErr:s=>i.err(s)}).showHelpAfterError().exitOverride().allowExcessArguments(!0).version(t,"-v, --version","print version"),au(r),r.hook("preAction",(s,a)=>{let u=a.optsWithGlobals();u.logLevel&&B.setLevel(u.logLevel)}),r.action(async(s,a)=>{if(a.args.length>0){a.error(`error: unknown command '${a.args[0]}'`,{exitCode:1,code:"commander.unknownCommand"});return}n.exitCode=await e.activate({project:s.project??process.cwd(),textOnly:cC(s),halfDuplex:s.halfDuplex===!0,ptt:s.ptt===!0})});let o=(s,a)=>{let u=r.command(s).description(a).allowExcessArguments(!1);return au(u)};return o("init","first-run setup (interactive wizard)").action(async()=>{n.exitCode=await e.init()}),o("start","start the local core service").action(()=>{n.exitCode=e.stub("start")}),o("stop","stop the local core service").action(()=>{n.exitCode=e.stub("stop")}),o("restart","restart the local core service").action(()=>{n.exitCode=e.stub("restart")}),o("status","show version and check for updates").action(async()=>{n.exitCode=await e.status()}),o("doctor","run diagnostics").action(async()=>{n.exitCode=await e.doctor()}),o("devices","list audio devices").action(()=>{n.exitCode=e.stub("devices")}),o("upgrade","upgrade the installed CLI to the latest published version").action(async()=>{n.exitCode=await e.upgrade()}),dC(r,e,n),r}function dC(t,e,n){let i=t.command("config").description("inspect and edit configuration").allowExcessArguments(!0);au(i),i.action((o,s)=>{if(s.args.length>0){s.error(`error: unknown command 'config ${s.args[0]}'`,{exitCode:1,code:"commander.unknownCommand"});return}s.outputHelp(),n.exitCode=0});let r=(o,s)=>{let a=i.command(o).description(s).allowExcessArguments(!1);return au(a)};r("list","print the resolved config (secrets redacted)").action(async()=>{n.exitCode=await e.configList()}),r("get <path>","print one config value by dotted path").action(async o=>{n.exitCode=await e.configGet(o)}),r("set <path> <value>","set one config value by dotted path").action(async(o,s)=>{n.exitCode=await e.configSet(o,s)}),r("unset <path>","remove one config value by dotted path").action(async o=>{n.exitCode=await e.configUnset(o)})}async function mS(t,e,n,i=ue){let r={exitCode:0},o=lC(e,n,r,i);try{return await o.parseAsync(t,{from:"user"}),r.exitCode}catch(s){if(s instanceof gt)return s.exitCode;throw s}}we();import{execSync as uk,spawnSync as yN}from"node:child_process";import{existsSync as _N}from"node:fs";import{join as bN}from"node:path";var bu=Je(sk(),1);function Tr(t,e){let n=ak(t),i=ak(e);return n===null||i===null?!1:bu.default.gt(n,i)}function ak(t){return bu.default.valid(t)??bu.default.coerce(t)?.version??null}var Or=class{constructor(e,n=ue){this.currentVersion=e;this.io=n}currentVersion;io;packageName="@neuvybe/jarvis";registryTimeoutMs=3e3;safeVersion=/^[0-9A-Za-z.\-+]+$/;npmCmd(){return process.platform==="win32"?"npm.cmd":"npm"}async fetchLatest(){try{let e=await fetch(`https://registry.npmjs.org/${this.packageName}/latest`,{headers:{accept:"application/json"},signal:AbortSignal.timeout(this.registryTimeoutMs)});if(!e.ok)return null;let n=await e.json();return typeof n.version=="string"?n.version:null}catch{return null}}async status(){this.io.out(`jarvis ${this.currentVersion}
213
213
  `);let e=await this.fetchLatest();return e===null?this.io.out(`could not check for updates (offline?)
214
- `):Ir(e,this.currentVersion)?this.io.out(`upgrade available: ${this.currentVersion} -> ${e} (run: jarvis upgrade)
214
+ `):Tr(e,this.currentVersion)?this.io.out(`upgrade available: ${this.currentVersion} -> ${e} (run: jarvis upgrade)
215
215
  `):this.io.out(`up to date
216
216
  `),0}async upgrade(){this.io.err(`checking for updates...
217
217
  `);let e=await this.fetchLatest();if(e===null)return this.io.err(`could not reach the npm registry; try again later
218
- `),1;if(!Ir(e,this.currentVersion))return this.io.out(`already on the latest version (${this.currentVersion})
218
+ `),1;if(!Tr(e,this.currentVersion))return this.io.out(`already on the latest version (${this.currentVersion})
219
219
  `),0;if(!this.safeVersion.test(e))return this.io.err(`refusing to install unexpected version string: ${e}
220
220
  `),1;this.io.err(`upgrading ${this.currentVersion} -> ${e}...
221
- `),await this.stopCore();let n=`${this.npmCmd()} install -g ${this.packageName}@${e}`;try{ek(n,{stdio:"inherit"})}catch{return this.io.err(`upgrade failed; run manually: ${this.npmCmd()} install -g ${this.packageName}@latest
221
+ `),await this.stopCore();let n=`${this.npmCmd()} install -g ${this.packageName}@${e}`;try{uk(n,{stdio:"inherit"})}catch{return this.io.err(`upgrade failed; run manually: ${this.npmCmd()} install -g ${this.packageName}@latest
222
222
  `),1}let i=this.resolveFreshEntrypoint();return i===null?(this.io.out(`upgraded to ${e}. run "jarvis --version" to confirm.
223
223
  `),0):(this.io.err(`verifying the freshly installed jarvis...
224
- `),iN(process.execPath,[i,"--version"],{stdio:"inherit"}).status!==0?(this.io.err(`upgrade installed but the fresh entrypoint exited abnormally; run "jarvis --version" to confirm
224
+ `),yN(process.execPath,[i,"--version"],{stdio:"inherit"}).status!==0?(this.io.err(`upgrade installed but the fresh entrypoint exited abnormally; run "jarvis --version" to confirm
225
225
  `),0):(this.io.out(`upgraded to ${e}.
226
- `),0))}async stopCore(){return B.debug("stop-core hook: no daemon in v0.1; nothing to stop (proposal 0013 fills this in)"),Promise.resolve()}resolveFreshEntrypoint(){try{let e=ek(`${this.npmCmd()} root -g`,{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();if(!e)return null;let n=sN(e,this.packageName,"dist","index.js");return oN(n)?n:null}catch{return null}}};Ae();pr();import{spawn as lN}from"node:child_process";import{existsSync as dN,readFileSync as fN,writeFileSync as hN}from"node:fs";var Or=Je(nk(),1),N={dim:t=>Or.default.dim(t),bold:t=>Or.default.bold(t),ok:t=>Or.default.green(t),warn:t=>Or.default.yellow(t),fail:t=>Or.default.red(t),accent:t=>Or.default.cyan(t)};var du=class{constructor(e,n=Be){this.currentVersion=e;this.home=n}currentVersion;home;packageName="@neuvybe/jarvis";cacheFile="update-check.json";ttlMs=360*60*1e3;cachePath(){return this.home.resolve(this.cacheFile)}read(){let e=this.cachePath();if(!dN(e))return null;try{let n=JSON.parse(fN(e,"utf8"));return typeof n.lastCheckedAt=="number"&&typeof n.latestVersion=="string"?{lastCheckedAt:n.lastCheckedAt,latestVersion:n.latestVersion}:null}catch{return null}}write(e,n){let i={lastCheckedAt:n,latestVersion:e};try{this.home.ensureDir(),hN(this.cachePath(),JSON.stringify(i))}catch{}}isStale(e){let n=this.read();return!n||e-n.lastCheckedAt>this.ttlMs}notice(){let e=this.read();return!e||!Ir(e.latestVersion,this.currentVersion)?null:N.dim(`upgrade available: ${this.currentVersion} -> ${e.latestVersion} (run: jarvis upgrade)`)}refreshInBackground(){try{let e=this.cachePath();this.home.ensureDir();let n=`
226
+ `),0))}async stopCore(){return B.debug("stop-core hook: no daemon in v0.1; nothing to stop (proposal 0013 fills this in)"),Promise.resolve()}resolveFreshEntrypoint(){try{let e=uk(`${this.npmCmd()} root -g`,{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();if(!e)return null;let n=bN(e,this.packageName,"dist","index.js");return _N(n)?n:null}catch{return null}}};we();pr();import{spawn as SN}from"node:child_process";import{existsSync as kN,readFileSync as EN,writeFileSync as IN}from"node:fs";var Ar=Je(dk(),1),N={dim:t=>Ar.default.dim(t),bold:t=>Ar.default.bold(t),ok:t=>Ar.default.green(t),warn:t=>Ar.default.yellow(t),fail:t=>Ar.default.red(t),accent:t=>Ar.default.cyan(t)};var wu=class{constructor(e,n=Ge){this.currentVersion=e;this.home=n}currentVersion;home;packageName="@neuvybe/jarvis";cacheFile="update-check.json";ttlMs=360*60*1e3;cachePath(){return this.home.resolve(this.cacheFile)}read(){let e=this.cachePath();if(!kN(e))return null;try{let n=JSON.parse(EN(e,"utf8"));return typeof n.lastCheckedAt=="number"&&typeof n.latestVersion=="string"?{lastCheckedAt:n.lastCheckedAt,latestVersion:n.latestVersion}:null}catch{return null}}write(e,n){let i={lastCheckedAt:n,latestVersion:e};try{this.home.ensureDir(),IN(this.cachePath(),JSON.stringify(i))}catch{}}isStale(e){let n=this.read();return!n||e-n.lastCheckedAt>this.ttlMs}notice(){let e=this.read();return!e||!Tr(e.latestVersion,this.currentVersion)?null:N.dim(`upgrade available: ${this.currentVersion} -> ${e.latestVersion} (run: jarvis upgrade)`)}refreshInBackground(){try{let e=this.cachePath();this.home.ensureDir();let n=`
227
227
  import { writeFileSync } from 'node:fs';
228
228
  try {
229
229
  const res = await fetch('https://registry.npmjs.org/${this.packageName}/latest', {
@@ -240,132 +240,132 @@ try {
240
240
  }
241
241
  }
242
242
  } catch {}
243
- `;lN(process.execPath,["--input-type=module","-e",n],{detached:!0,stdio:"ignore"}).unref()}catch{B.debug("background update check skipped (could not refresh cache)")}}};var Ar=class{constructor(e,n=ue){this.config=e;this.io=n}config;io;list(){let e=ik(this.config.list());for(let[n,i]of e)this.io.out(`${N.accent(n)} = ${this.renderValue(n,i)}
244
- `);return 0}get(e){let n;try{n=this.config.get(e)}catch(i){return this.io.err(`error: ${cg(i)}
243
+ `;SN(process.execPath,["--input-type=module","-e",n],{detached:!0,stdio:"ignore"}).unref()}catch{B.debug("background update check skipped (could not refresh cache)")}}};var Pr=class{constructor(e,n=ue){this.config=e;this.io=n}config;io;list(){let e=hk(this.config.list());for(let[n,i]of e)this.io.out(`${N.accent(n)} = ${this.renderValue(n,i)}
244
+ `);return 0}get(e){let n;try{n=this.config.get(e)}catch(i){return this.io.err(`error: ${gg(i)}
245
245
  `),1}return n===void 0?(this.io.err(`config: '${e}' is not set
246
- `),1):(this.io.out(`${pN(n)}
247
- `),0)}set(e,n){try{this.config.set(e,n)}catch(i){return this.io.err(`error: ${cg(i)}
246
+ `),1):(this.io.out(`${TN(n)}
247
+ `),0)}set(e,n){try{this.config.set(e,n)}catch(i){return this.io.err(`error: ${gg(i)}
248
248
  `),1}return this.io.out(`${N.ok("set")} ${N.accent(e)}
249
- `),0}unset(e){try{this.config.unset(e)}catch(n){return this.io.err(`error: ${cg(n)}
249
+ `),0}unset(e){try{this.config.unset(e)}catch(n){return this.io.err(`error: ${gg(n)}
250
250
  `),1}return this.io.out(`${N.ok("unset")} ${N.accent(e)}
251
- `),0}renderValue(e,n){return e.startsWith("secrets.")?N.dim(String(n)):String(n)}};function ik(t,e=""){let n=[];for(let[i,r]of Object.entries(t)){let o=e?`${e}.${i}`:i;r!==null&&typeof r=="object"&&!Array.isArray(r)?n.push(...ik(r,o)):n.push([o,r])}return n}function pN(t){return t!==null&&typeof t=="object"?JSON.stringify(t,null,2):String(t)}function cg(t){return t instanceof Error?t.message:String(t)}pr();import{existsSync as ok,statSync as sk}from"node:fs";var ak=["text","stt","tts","embedding"],mN={text:"Brain",stt:"Voice",tts:"Voice",embedding:"Memory"},fu=class{config;probe;version;io;homeCheck;checkUpdate;constructor(e){this.config=e.config,this.probe=e.probe,this.version=e.version,this.io=e.io??ue,this.homeCheck=e.homeCheck??vN,this.checkUpdate=e.checkUpdate??(async()=>({latest:await new Tr(this.version).fetchLatest()}))}async run(){let e=[],n;try{n=this.config.resolved(),e.push({level:"ok",label:"config",detail:"valid"})}catch(r){e.push({level:"fail",label:"config",detail:`invalid - ${yN(r)}`})}e.push(this.homeLine()),n&&e.push(...await this.routeLines(n)),e.push(await this.versionLine()),e.push({level:"info",label:"project",detail:process.cwd()});let i=e.some(r=>r.level==="fail")?1:0;return this.render(e,i),i}homeLine(){let e=this.homeCheck();return e.permsOk===!1?{level:"fail",label:"home",detail:`${e.dir} - ${e.detail??"permissions wrong"}`}:e.exists?{level:"ok",label:"home",detail:`${e.dir} (${e.detail??"owner-only"})`}:{level:"info",label:"home",detail:`${e.dir} (${e.detail??"not created yet"})`}}async routeLines(e){let n=e.routes??{},i=new Map;for(let s of ak){let a=n[s],u=a&&e.secrets?.[a.provider];a&&u&&i.set(a.provider,u)}let r=new Map;await Promise.all([...i].map(async([s,a])=>{let u=await this.probe.probe(s,a);r.set(s,u.status)}));let o=[];for(let s of ak){let a=n[s];if(!a){o.push(this.unconfiguredLine(s));continue}let u=`${a.provider}/${a.model}`;if(!e.secrets?.[a.provider]){o.push({level:"fail",label:`${s} route`,detail:`${u} - key for '${a.provider}' is missing`});continue}o.push(this.probedLine(s,u,a.provider,r.get(a.provider)))}return o}unconfiguredLine(e){return e==="text"?{level:"fail",label:"text route",detail:"not configured - Jarvis cannot reason (run: jarvis init)"}:{level:"info",label:`${e} route`,detail:`not configured (optional, ${mN[e]})`}}probedLine(e,n,i,r){let o=`${e} route`,s=e==="text";switch(r){case"valid":return{level:"ok",label:o,detail:`${n} (key valid)`};case"invalid":return{level:s?"fail":"warn",label:o,detail:`${n} - key rejected by ${i}`};case"unreachable":return{level:"warn",label:o,detail:`${n} (key present; could not verify - offline/unreachable)`};case"unimplemented":return{level:"warn",label:o,detail:`${n} (key present; no probe for ${i})`};case"unverifiable":return{level:"warn",label:o,detail:`${n} (key present; reached ${i} but cannot verify this key here - confirmed at first use)`};default:return{level:"warn",label:o,detail:`${n} (key present; not verified)`}}}async versionLine(){let{latest:e}=await this.checkUpdate();return e===null?{level:"info",label:"version",detail:`${this.version} (could not check for updates)`}:Ir(e,this.version)?{level:"warn",label:"version",detail:`${this.version} -> ${e} available (run: jarvis upgrade)`}:{level:"ok",label:"version",detail:`${this.version} (up to date)`}}render(e,n){this.io.out(`
251
+ `),0}renderValue(e,n){return e.startsWith("secrets.")?N.dim(String(n)):String(n)}};function hk(t,e=""){let n=[];for(let[i,r]of Object.entries(t)){let o=e?`${e}.${i}`:i;r!==null&&typeof r=="object"&&!Array.isArray(r)?n.push(...hk(r,o)):n.push([o,r])}return n}function TN(t){return t!==null&&typeof t=="object"?JSON.stringify(t,null,2):String(t)}function gg(t){return t instanceof Error?t.message:String(t)}pr();import{existsSync as fk,statSync as pk}from"node:fs";var mk=["text","stt","tts","embedding"],ON={text:"Brain",stt:"Voice",tts:"Voice",embedding:"Memory"},Su=class{config;probe;version;io;homeCheck;checkUpdate;constructor(e){this.config=e.config,this.probe=e.probe,this.version=e.version,this.io=e.io??ue,this.homeCheck=e.homeCheck??PN,this.checkUpdate=e.checkUpdate??(async()=>({latest:await new Or(this.version).fetchLatest()}))}async run(){let e=[],n;try{n=this.config.resolved(),e.push({level:"ok",label:"config",detail:"valid"})}catch(r){e.push({level:"fail",label:"config",detail:`invalid - ${CN(r)}`})}e.push(this.homeLine()),n&&e.push(...await this.routeLines(n)),e.push(await this.versionLine()),e.push({level:"info",label:"project",detail:process.cwd()});let i=e.some(r=>r.level==="fail")?1:0;return this.render(e,i),i}homeLine(){let e=this.homeCheck();return e.permsOk===!1?{level:"fail",label:"home",detail:`${e.dir} - ${e.detail??"permissions wrong"}`}:e.exists?{level:"ok",label:"home",detail:`${e.dir} (${e.detail??"owner-only"})`}:{level:"info",label:"home",detail:`${e.dir} (${e.detail??"not created yet"})`}}async routeLines(e){let n=e.routes??{},i=new Map;for(let s of mk){let a=n[s];if(!a)continue;let u=e.secrets?.[a.provider];!u&&this.probe.requiresKey(a.provider)||i.set(a.provider,{key:u??"",...a.url!==void 0&&{url:a.url}})}let r=new Map;await Promise.all([...i].map(async([s,{key:a,url:u}])=>{let c=await this.probe.probe(s,a,{...u!==void 0&&{url:u}});r.set(s,c.status)}));let o=[];for(let s of mk){let a=n[s];if(!a){o.push(this.unconfiguredLine(s));continue}let u=`${a.provider}/${a.model}`,c=!this.probe.requiresKey(a.provider);if(!e.secrets?.[a.provider]&&!c){o.push({level:"fail",label:`${s} route`,detail:`${u} - key for '${a.provider}' is missing`});continue}o.push(this.probedLine(s,u,a.provider,r.get(a.provider),c))}return o}unconfiguredLine(e){return e==="text"?{level:"fail",label:"text route",detail:"not configured - Jarvis cannot reason (run: jarvis init)"}:{level:"info",label:`${e} route`,detail:`not configured (optional, ${ON[e]})`}}probedLine(e,n,i,r,o=!1){let s=`${e} route`,a=e==="text";if(o)return r==="valid"?{level:"ok",label:s,detail:`${n} (server reachable; no key needed)`}:{level:"warn",label:s,detail:`${n} (no key needed; server not reachable - is it running?)`};switch(r){case"valid":return{level:"ok",label:s,detail:`${n} (key valid)`};case"invalid":return{level:a?"fail":"warn",label:s,detail:`${n} - key rejected by ${i}`};case"unreachable":return{level:"warn",label:s,detail:`${n} (key present; could not verify - offline/unreachable)`};case"unimplemented":return{level:"warn",label:s,detail:`${n} (key present; no probe for ${i})`};case"unverifiable":return{level:"warn",label:s,detail:`${n} (key present; reached ${i} but cannot verify this key here - confirmed at first use)`};default:return{level:"warn",label:s,detail:`${n} (key present; not verified)`}}}async versionLine(){let{latest:e}=await this.checkUpdate();return e===null?{level:"info",label:"version",detail:`${this.version} (could not check for updates)`}:Tr(e,this.version)?{level:"warn",label:"version",detail:`${this.version} -> ${e} available (run: jarvis upgrade)`}:{level:"ok",label:"version",detail:`${this.version} (up to date)`}}render(e,n){this.io.out(`
252
252
  ${N.bold("jarvis doctor")}
253
253
 
254
- `);for(let i of e){let r=i.detail?`: ${i.detail}`:"";this.io.out(` ${gN(i.level)} ${i.label}${r}
254
+ `);for(let i of e){let r=i.detail?`: ${i.detail}`:"";this.io.out(` ${AN(i.level)} ${i.label}${r}
255
255
  `)}this.io.out(`
256
256
  `),n!==0?this.io.out(`${N.fail("not ready")} - resolve the failing checks above (start with: jarvis init)
257
257
  `):e.some(i=>i.level==="warn")?this.io.out(`${N.warn("ready, with warnings")}
258
258
  `):this.io.out(`${N.ok("all checks passed")}
259
- `)}};function gN(t){switch(t){case"ok":return N.ok("OK ");case"warn":return N.warn("WARN");case"fail":return N.fail("FAIL");case"info":return N.dim("INFO")}}function vN(){let t=Be.dir();if(!ok(t))return{dir:t,exists:!1,permsOk:"n/a",detail:"not created yet - run: jarvis init"};if(process.platform==="win32")return{dir:t,exists:!0,permsOk:"n/a",detail:"permissions not enforced on this platform"};let e=(sk(t).mode&63)===0,n=Be.resolve("config.json"),i=!ok(n)||(sk(n).mode&63)===0,r=e&&i;return{dir:t,exists:!0,permsOk:r,detail:r?"owner-only":"should be owner-only (chmod 700 ~/.jarvis; chmod 600 ~/.jarvis/config.json)"}}function yN(t){return t instanceof Error?t.message:String(t)}import{styleText as mg}from"node:util";import{stdout as vg,stdin as Sk}from"node:process";import*as tr from"node:readline";import RN from"node:readline";var uk=(()=>{let t=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return e=>{let n=0;for(t.lastIndex=0;t.test(e);)n+=1;return e.length-n}})(),ck=t=>t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510,lk=t=>t===8987||t===9001||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12771||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=19903||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t>=131072&&t<=196605||t>=196608&&t<=262141;var _N=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,bN=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,dk=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,$N=/\t{1,1000}/y,fk=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,xN=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,wN=/\p{M}+/gu,SN={limit:1/0,ellipsis:""},hk=(t,e={},n={})=>{let i=e.limit??1/0,r=e.ellipsis??"",o=e?.ellipsisWidth??(r?hk(r,SN,n).width:0),s=0,a=n.controlWidth??0,u=n.tabWidth??8,c=n.emojiWidth??2,l=2,d=n.regularWidth??1,f=n.wideWidth??l,h=[[xN,d],[_N,s],[bN,a],[$N,u],[fk,c],[dk,f]],p=0,_=0,S=t.length,k=0,P=!1,C=S,E=Math.max(0,i-o),T=0,Z=0,F=0,q=0;e:for(;;){if(Z>T||_>=S&&_>p){let ne=t.slice(T,Z)||t.slice(p,_);k=0;for(let $e of ne.replaceAll(wN,"")){let he=$e.codePointAt(0)||0;if(ck(he)?q=l:lk(he)?q=f:q=d,F+q>E&&(C=Math.min(C,Math.max(T,p)+k)),F+q>i){P=!0;break e}k+=$e.length,F+=q}T=Z=0}if(_>=S)break e;for(let ne=0,$e=h.length;ne<$e;ne++){let[he,Se]=h[ne];if(he.lastIndex=_,he.test(t)){if(k=he===dk?uk(t.slice(_,he.lastIndex)):he===fk?1:he.lastIndex-_,q=k*Se,F+q>E&&(C=Math.min(C,_+Math.floor((E-F)/Se))),F+q>i){P=!0;break e}F+=q,T=p,Z=_,_=p=he.lastIndex;continue e}}_+=1}return{width:P?E:F,index:P?C:S,truncated:P,ellipsed:P&&i>=o}},pk=hk;var kN={limit:1/0,ellipsis:"",ellipsisWidth:0},EN=(t,e={})=>pk(t,kN,e).width,ze=EN;var hu="\x1B",_k="\x9B",IN=39,dg="\x07",bk="[",TN="]",$k="m",fg=`${TN}8;;`,mk=new RegExp(`(?:\\${bk}(?<code>\\d+)m|\\${fg}(?<uri>.*)${dg})`,"y"),gk=t=>{if(t>=30&&t<=37||t>=90&&t<=97)return 39;if(t>=40&&t<=47||t>=100&&t<=107)return 49;if(t===1||t===2)return 22;if(t===3)return 23;if(t===4)return 24;if(t===7)return 27;if(t===8)return 28;if(t===9)return 29;if(t===0)return 0},vk=t=>`${hu}${bk}${t}${$k}`,yk=t=>`${hu}${fg}${t}${dg}`,lg=(t,e,n)=>{let i=e[Symbol.iterator](),r=!1,o=!1,s=t.at(-1),a=s===void 0?0:ze(s),u=i.next(),c=i.next(),l=0;for(;!u.done;){let d=u.value,f=ze(d);a+f<=n?t[t.length-1]+=d:(t.push(d),a=0),(d===hu||d===_k)&&(r=!0,o=e.startsWith(fg,l+1)),r?o?d===dg&&(r=!1,o=!1):d===$k&&(r=!1):(a+=f,a===n&&!c.done&&(t.push(""),a=0)),u=c,c=i.next(),l+=d.length}s=t.at(-1),!a&&s!==void 0&&s.length&&t.length>1&&(t[t.length-2]+=t.pop())},ON=t=>{let e=t.split(" "),n=e.length;for(;n&&!ze(e[n-1]);)n--;return n===e.length?t:e.slice(0,n).join(" ")+e.slice(n).join("")},AN=(t,e,n={})=>{if(n.trim!==!1&&t.trim()==="")return"";let i="",r,o,s=t.split(" "),a=[""],u=0;for(let d=0;d<s.length;d++){let f=s[d];if(n.trim!==!1){let p=a.at(-1)??"",_=p.trimStart();p.length!==_.length&&(a[a.length-1]=_,u=ze(_))}d!==0&&(u>=e&&(n.wordWrap===!1||n.trim===!1)&&(a.push(""),u=0),(u||n.trim===!1)&&(a[a.length-1]+=" ",u++));let h=ze(f);if(n.hard&&h>e){let p=e-u,_=1+Math.floor((h-p-1)/e);Math.floor((h-1)/e)<_&&a.push(""),lg(a,f,e),u=ze(a.at(-1)??"");continue}if(u+h>e&&u&&h){if(n.wordWrap===!1&&u<e){lg(a,f,e),u=ze(a.at(-1)??"");continue}a.push(""),u=0}if(u+h>e&&n.wordWrap===!1){lg(a,f,e),u=ze(a.at(-1)??"");continue}a[a.length-1]+=f,u+=h}n.trim!==!1&&(a=a.map(d=>ON(d)));let c=a.join(`
260
- `),l=!1;for(let d=0;d<c.length;d++){let f=c[d];if(i+=f,l)l=!1;else if(l=f>="\uD800"&&f<="\uDBFF",l)continue;if(f===hu||f===_k){mk.lastIndex=d+1;let p=mk.exec(c)?.groups;if(p?.code!==void 0){let _=Number.parseFloat(p.code);r=_===IN?void 0:_}else p?.uri!==void 0&&(o=p.uri.length===0?void 0:p.uri)}if(c[d+1]===`
261
- `){o&&(i+=yk(""));let h=r?gk(r):void 0;r&&h&&(i+=vk(h))}else f===`
262
- `&&(r&&gk(r)&&(i+=vk(r)),o&&(i+=yk(o)))}return i},PN=/\r?\n/;function vt(t,e,n){return String(t).normalize().split(PN).map(i=>AN(i,e,n)).join(`
263
- `)}var we=Je(pg(),1);import{ReadStream as wk}from"node:tty";function Pr(t,e,n){if(!n.some(s=>!s.disabled))return t;let i=t+e,r=Math.max(n.length-1,0),o=i<0?r:i>r?0:i;return n[o].disabled?Pr(o,e<0?-1:1,n):o}var NN=["up","down","left","right","space","enter","cancel"],DN=["January","February","March","April","May","June","July","August","September","October","November","December"],fe={actions:new Set(NN),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,date:{monthNames:[...DN],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(t,e)=>`There are only ${t} days in ${e}`,afterMin:t=>`Date must be on or after ${t.toISOString().slice(0,10)}`,beforeMax:t=>`Date must be on or before ${t.toISOString().slice(0,10)}`}}};function yg(t,e){if(typeof t=="string")return fe.aliases.get(t)===e;for(let n of t)if(n!==void 0&&yg(n,e))return!0;return!1}function LN(t,e){if(t===e)return;let n=t.split(`
259
+ `)}};function AN(t){switch(t){case"ok":return N.ok("OK ");case"warn":return N.warn("WARN");case"fail":return N.fail("FAIL");case"info":return N.dim("INFO")}}function PN(){let t=Ge.dir();if(!fk(t))return{dir:t,exists:!1,permsOk:"n/a",detail:"not created yet - run: jarvis init"};if(process.platform==="win32")return{dir:t,exists:!0,permsOk:"n/a",detail:"permissions not enforced on this platform"};let e=(pk(t).mode&63)===0,n=Ge.resolve("config.json"),i=!fk(n)||(pk(n).mode&63)===0,r=e&&i;return{dir:t,exists:!0,permsOk:r,detail:r?"owner-only":"should be owner-only (chmod 700 ~/.jarvis; chmod 600 ~/.jarvis/config.json)"}}function CN(t){return t instanceof Error?t.message:String(t)}import{styleText as xg}from"node:util";import{stdout as Sg,stdin as Ck}from"node:process";import*as tr from"node:readline";import HN from"node:readline";var gk=(()=>{let t=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return e=>{let n=0;for(t.lastIndex=0;t.test(e);)n+=1;return e.length-n}})(),vk=t=>t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510,yk=t=>t===8987||t===9001||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12771||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=19903||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t>=131072&&t<=196605||t>=196608&&t<=262141;var RN=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,zN=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,_k=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,NN=/\t{1,1000}/y,bk=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,DN=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,LN=/\p{M}+/gu,UN={limit:1/0,ellipsis:""},$k=(t,e={},n={})=>{let i=e.limit??1/0,r=e.ellipsis??"",o=e?.ellipsisWidth??(r?$k(r,UN,n).width:0),s=0,a=n.controlWidth??0,u=n.tabWidth??8,c=n.emojiWidth??2,l=2,d=n.regularWidth??1,h=n.wideWidth??l,f=[[DN,d],[RN,s],[zN,a],[NN,u],[bk,c],[_k,h]],p=0,_=0,S=t.length,k=0,P=!1,C=S,E=Math.max(0,i-o),T=0,Z=0,F=0,q=0;e:for(;;){if(Z>T||_>=S&&_>p){let ne=t.slice(T,Z)||t.slice(p,_);k=0;for(let $e of ne.replaceAll(LN,"")){let pe=$e.codePointAt(0)||0;if(vk(pe)?q=l:yk(pe)?q=h:q=d,F+q>E&&(C=Math.min(C,Math.max(T,p)+k)),F+q>i){P=!0;break e}k+=$e.length,F+=q}T=Z=0}if(_>=S)break e;for(let ne=0,$e=f.length;ne<$e;ne++){let[pe,ke]=f[ne];if(pe.lastIndex=_,pe.test(t)){if(k=pe===_k?gk(t.slice(_,pe.lastIndex)):pe===bk?1:pe.lastIndex-_,q=k*ke,F+q>E&&(C=Math.min(C,_+Math.floor((E-F)/ke))),F+q>i){P=!0;break e}F+=q,T=p,Z=_,_=p=pe.lastIndex;continue e}}_+=1}return{width:P?E:F,index:P?C:S,truncated:P,ellipsed:P&&i>=o}},xk=$k;var jN={limit:1/0,ellipsis:"",ellipsisWidth:0},MN=(t,e={})=>xk(t,jN,e).width,Re=MN;var ku="\x1B",Ik="\x9B",FN=39,yg="\x07",Tk="[",VN="]",Ok="m",_g=`${VN}8;;`,wk=new RegExp(`(?:\\${Tk}(?<code>\\d+)m|\\${_g}(?<uri>.*)${yg})`,"y"),Sk=t=>{if(t>=30&&t<=37||t>=90&&t<=97)return 39;if(t>=40&&t<=47||t>=100&&t<=107)return 49;if(t===1||t===2)return 22;if(t===3)return 23;if(t===4)return 24;if(t===7)return 27;if(t===8)return 28;if(t===9)return 29;if(t===0)return 0},kk=t=>`${ku}${Tk}${t}${Ok}`,Ek=t=>`${ku}${_g}${t}${yg}`,vg=(t,e,n)=>{let i=e[Symbol.iterator](),r=!1,o=!1,s=t.at(-1),a=s===void 0?0:Re(s),u=i.next(),c=i.next(),l=0;for(;!u.done;){let d=u.value,h=Re(d);a+h<=n?t[t.length-1]+=d:(t.push(d),a=0),(d===ku||d===Ik)&&(r=!0,o=e.startsWith(_g,l+1)),r?o?d===yg&&(r=!1,o=!1):d===Ok&&(r=!1):(a+=h,a===n&&!c.done&&(t.push(""),a=0)),u=c,c=i.next(),l+=d.length}s=t.at(-1),!a&&s!==void 0&&s.length&&t.length>1&&(t[t.length-2]+=t.pop())},ZN=t=>{let e=t.split(" "),n=e.length;for(;n&&!Re(e[n-1]);)n--;return n===e.length?t:e.slice(0,n).join(" ")+e.slice(n).join("")},BN=(t,e,n={})=>{if(n.trim!==!1&&t.trim()==="")return"";let i="",r,o,s=t.split(" "),a=[""],u=0;for(let d=0;d<s.length;d++){let h=s[d];if(n.trim!==!1){let p=a.at(-1)??"",_=p.trimStart();p.length!==_.length&&(a[a.length-1]=_,u=Re(_))}d!==0&&(u>=e&&(n.wordWrap===!1||n.trim===!1)&&(a.push(""),u=0),(u||n.trim===!1)&&(a[a.length-1]+=" ",u++));let f=Re(h);if(n.hard&&f>e){let p=e-u,_=1+Math.floor((f-p-1)/e);Math.floor((f-1)/e)<_&&a.push(""),vg(a,h,e),u=Re(a.at(-1)??"");continue}if(u+f>e&&u&&f){if(n.wordWrap===!1&&u<e){vg(a,h,e),u=Re(a.at(-1)??"");continue}a.push(""),u=0}if(u+f>e&&n.wordWrap===!1){vg(a,h,e),u=Re(a.at(-1)??"");continue}a[a.length-1]+=h,u+=f}n.trim!==!1&&(a=a.map(d=>ZN(d)));let c=a.join(`
260
+ `),l=!1;for(let d=0;d<c.length;d++){let h=c[d];if(i+=h,l)l=!1;else if(l=h>="\uD800"&&h<="\uDBFF",l)continue;if(h===ku||h===Ik){wk.lastIndex=d+1;let p=wk.exec(c)?.groups;if(p?.code!==void 0){let _=Number.parseFloat(p.code);r=_===FN?void 0:_}else p?.uri!==void 0&&(o=p.uri.length===0?void 0:p.uri)}if(c[d+1]===`
261
+ `){o&&(i+=Ek(""));let f=r?Sk(r):void 0;r&&f&&(i+=kk(f))}else h===`
262
+ `&&(r&&Sk(r)&&(i+=kk(r)),o&&(i+=Ek(o)))}return i},GN=/\r?\n/;function yt(t,e,n){return String(t).normalize().split(GN).map(i=>BN(i,e,n)).join(`
263
+ `)}var Se=Je($g(),1);import{ReadStream as Pk}from"node:tty";function Cr(t,e,n){if(!n.some(s=>!s.disabled))return t;let i=t+e,r=Math.max(n.length-1,0),o=i<0?r:i>r?0:i;return n[o].disabled?Cr(o,e<0?-1:1,n):o}var JN=["up","down","left","right","space","enter","cancel"],KN=["January","February","March","April","May","June","July","August","September","October","November","December"],fe={actions:new Set(JN),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,date:{monthNames:[...KN],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(t,e)=>`There are only ${t} days in ${e}`,afterMin:t=>`Date must be on or after ${t.toISOString().slice(0,10)}`,beforeMax:t=>`Date must be on or before ${t.toISOString().slice(0,10)}`}}};function kg(t,e){if(typeof t=="string")return fe.aliases.get(t)===e;for(let n of t)if(n!==void 0&&kg(n,e))return!0;return!1}function YN(t,e){if(t===e)return;let n=t.split(`
264
264
  `),i=e.split(`
265
- `),r=Math.max(n.length,i.length),o=[];for(let s=0;s<r;s++)n[s]!==i[s]&&o.push(s);return{lines:o,numLinesBefore:n.length,numLinesAfter:i.length,numLines:r}}var UN=globalThis.process.platform.startsWith("win"),gg=Symbol("clack:cancel");function _u(t){return t===gg}function pu(t,e){let n=t;n.isTTY&&n.setRawMode(e)}function kk({input:t=Sk,output:e=vg,overwrite:n=!0,hideCursor:i=!0}={}){let r=tr.createInterface({input:t,output:e,prompt:"",tabSize:1});tr.emitKeypressEvents(t,r),t instanceof wk&&t.isTTY&&t.setRawMode(!0);let o=(s,{name:a,sequence:u})=>{let c=String(s);if(yg([c,a,u],"cancel")){i&&e.write(we.cursor.show),process.exit(0);return}if(!n)return;tr.moveCursor(e,a==="return"?0:-1,a==="return"?-1:0,()=>{tr.clearLine(e,1,()=>{t.once("keypress",o)})})};return i&&e.write(we.cursor.hide),t.once("keypress",o),()=>{t.off("keypress",o),i&&e.write(we.cursor.show),t instanceof wk&&t.isTTY&&!UN&&t.setRawMode(!1),r.terminal=!1,r.close()}}var oo=t=>"columns"in t&&typeof t.columns=="number"?t.columns:80,_g=t=>"rows"in t&&typeof t.rows=="number"?t.rows:20;function rr(t,e,n,i=n,r=n,o){let s=oo(t??vg);return vt(e,s-n.length,{hard:!0,trim:!1}).split(`
265
+ `),r=Math.max(n.length,i.length),o=[];for(let s=0;s<r;s++)n[s]!==i[s]&&o.push(s);return{lines:o,numLinesBefore:n.length,numLinesAfter:i.length,numLines:r}}var XN=globalThis.process.platform.startsWith("win"),wg=Symbol("clack:cancel");function Pu(t){return t===wg}function Eu(t,e){let n=t;n.isTTY&&n.setRawMode(e)}function Rk({input:t=Ck,output:e=Sg,overwrite:n=!0,hideCursor:i=!0}={}){let r=tr.createInterface({input:t,output:e,prompt:"",tabSize:1});tr.emitKeypressEvents(t,r),t instanceof Pk&&t.isTTY&&t.setRawMode(!0);let o=(s,{name:a,sequence:u})=>{let c=String(s);if(kg([c,a,u],"cancel")){i&&e.write(Se.cursor.show),process.exit(0);return}if(!n)return;tr.moveCursor(e,a==="return"?0:-1,a==="return"?-1:0,()=>{tr.clearLine(e,1,()=>{t.once("keypress",o)})})};return i&&e.write(Se.cursor.hide),t.once("keypress",o),()=>{t.off("keypress",o),i&&e.write(Se.cursor.show),t instanceof Pk&&t.isTTY&&!XN&&t.setRawMode(!1),r.terminal=!1,r.close()}}var fo=t=>"columns"in t&&typeof t.columns=="number"?t.columns:80,Eg=t=>"rows"in t&&typeof t.rows=="number"?t.rows:20;function rr(t,e,n,i=n,r=n,o){let s=fo(t??Sg);return yt(e,s-n.length,{hard:!0,trim:!1}).split(`
266
266
  `).map((a,u,c)=>{let l=o?o(a,u):a;return u===0?`${i}${l}`:u===c.length-1?`${r}${l}`:`${n}${l}`}).join(`
267
- `)}function Ek(t,e){if("~standard"in t){let n=t["~standard"].validate(e);if(n instanceof Promise)throw new TypeError("Schema validation must be synchronous. Update `validate()` and remove any asynchronous logic.");return n.issues?.at(0)?.message}return t(e)}var Cr=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(e,n=!0){let{input:i=Sk,output:r=vg,render:o,signal:s,...a}=e;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=o.bind(this),this._track=n,this._abortSignal=s,this.input=i,this.output=r}unsubscribe(){this._subscribers.clear()}setSubscriber(e,n){let i=this._subscribers.get(e)??[];i.push(n),this._subscribers.set(e,i)}on(e,n){this.setSubscriber(e,{cb:n})}once(e,n){this.setSubscriber(e,{cb:n,once:!0})}emit(e,...n){let i=this._subscribers.get(e)??[],r=[];for(let o of i)o.cb(...n),o.once&&r.push(()=>i.splice(i.indexOf(o),1));for(let o of r)o()}prompt(){return new Promise(e=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(gg);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=RN.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),pu(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(we.cursor.show),this.output.off("resize",this.render),pu(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(we.cursor.show),this.output.off("resize",this.render),pu(this.input,!1),e(gg)})})}_isActionKey(e,n){return e===" "}_shouldSubmit(e,n){return!0}_setValue(e){this.value=e,this.emit("value",this.value)}_setUserInput(e,n){this.userInput=e??"",this.emit("userInput",this.userInput),n&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(e,n){if(this._track&&n.name!=="return"&&(n.name&&this._isActionKey(e,n)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),n?.name&&(!this._track&&fe.aliases.has(n.name)&&this.emit("cursor",fe.aliases.get(n.name)),fe.actions.has(n.name)&&this.emit("cursor",n.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),this.emit("key",e,n),n?.name==="return"&&this._shouldSubmit(e,n)){if(this.opts.validate){let i=Ek(this.opts.validate,this.value);i&&(this.error=i instanceof Error?i.message:i,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}yg([e,n?.name,n?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
268
- `),pu(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=vt(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
269
- `).length-1;this.output.write(we.cursor.move(-999,e*-1))}render(){let e=vt(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(we.cursor.hide);else{let n=LN(this._prevFrame,e),i=_g(this.output);if(this.restoreCursor(),n){let r=Math.max(0,n.numLinesAfter-i),o=Math.max(0,n.numLinesBefore-i),s=n.lines.find(a=>a>=r);if(s===void 0){this._prevFrame=e;return}if(n.lines.length===1){this.output.write(we.cursor.move(0,s-o)),this.output.write(we.erase.lines(1));let a=e.split(`
270
- `);this.output.write(a[s]),this._prevFrame=e,this.output.write(we.cursor.move(0,a.length-s-1));return}else if(n.lines.length>1){if(r<o)s=r;else{let u=s-o;u>0&&this.output.write(we.cursor.move(0,u))}this.output.write(we.erase.down());let a=e.split(`
267
+ `)}function zk(t,e){if("~standard"in t){let n=t["~standard"].validate(e);if(n instanceof Promise)throw new TypeError("Schema validation must be synchronous. Update `validate()` and remove any asynchronous logic.");return n.issues?.at(0)?.message}return t(e)}var Rr=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(e,n=!0){let{input:i=Ck,output:r=Sg,render:o,signal:s,...a}=e;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=o.bind(this),this._track=n,this._abortSignal=s,this.input=i,this.output=r}unsubscribe(){this._subscribers.clear()}setSubscriber(e,n){let i=this._subscribers.get(e)??[];i.push(n),this._subscribers.set(e,i)}on(e,n){this.setSubscriber(e,{cb:n})}once(e,n){this.setSubscriber(e,{cb:n,once:!0})}emit(e,...n){let i=this._subscribers.get(e)??[],r=[];for(let o of i)o.cb(...n),o.once&&r.push(()=>i.splice(i.indexOf(o),1));for(let o of r)o()}prompt(){return new Promise(e=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(wg);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=HN.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),Eu(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(Se.cursor.show),this.output.off("resize",this.render),Eu(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(Se.cursor.show),this.output.off("resize",this.render),Eu(this.input,!1),e(wg)})})}_isActionKey(e,n){return e===" "}_shouldSubmit(e,n){return!0}_setValue(e){this.value=e,this.emit("value",this.value)}_setUserInput(e,n){this.userInput=e??"",this.emit("userInput",this.userInput),n&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(e,n){if(this._track&&n.name!=="return"&&(n.name&&this._isActionKey(e,n)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),n?.name&&(!this._track&&fe.aliases.has(n.name)&&this.emit("cursor",fe.aliases.get(n.name)),fe.actions.has(n.name)&&this.emit("cursor",n.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),this.emit("key",e,n),n?.name==="return"&&this._shouldSubmit(e,n)){if(this.opts.validate){let i=zk(this.opts.validate,this.value);i&&(this.error=i instanceof Error?i.message:i,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}kg([e,n?.name,n?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
268
+ `),Eu(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=yt(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
269
+ `).length-1;this.output.write(Se.cursor.move(-999,e*-1))}render(){let e=yt(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(Se.cursor.hide);else{let n=YN(this._prevFrame,e),i=Eg(this.output);if(this.restoreCursor(),n){let r=Math.max(0,n.numLinesAfter-i),o=Math.max(0,n.numLinesBefore-i),s=n.lines.find(a=>a>=r);if(s===void 0){this._prevFrame=e;return}if(n.lines.length===1){this.output.write(Se.cursor.move(0,s-o)),this.output.write(Se.erase.lines(1));let a=e.split(`
270
+ `);this.output.write(a[s]),this._prevFrame=e,this.output.write(Se.cursor.move(0,a.length-s-1));return}else if(n.lines.length>1){if(r<o)s=r;else{let u=s-o;u>0&&this.output.write(Se.cursor.move(0,u))}this.output.write(Se.erase.down());let a=e.split(`
271
271
  `).slice(s);this.output.write(a.join(`
272
- `)),this._prevFrame=e;return}}this.output.write(we.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}};var mu=class extends Cr{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",n=>{this.output.write(we.cursor.move(0,-1)),this.value=n,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var Ik=class extends Cr{options;cursor=0;get _value(){return this.options[this.cursor].value}get _enabledOptions(){return this.options.filter(e=>e.disabled!==!0)}toggleAll(){let e=this._enabledOptions,n=this.value!==void 0&&this.value.length===e.length;this.value=n?[]:e.map(i=>i.value)}toggleInvert(){let e=this.value;if(!e)return;let n=this._enabledOptions.filter(i=>!e.includes(i.value));this.value=n.map(i=>i.value)}toggleValue(){this.value===void 0&&(this.value=[]);let e=this.value.includes(this._value);this.value=e?this.value.filter(n=>n!==this._value):[...this.value,this._value]}constructor(e){super(e,!1),this.options=e.options,this.value=[...e.initialValues??[]];let n=Math.max(this.options.findIndex(({value:i})=>i===e.cursorAt),0);this.cursor=this.options[n].disabled?Pr(n,1,this.options):n,this.on("key",(i,r)=>{r.name==="a"&&this.toggleAll(),r.name==="i"&&this.toggleInvert()}),this.on("cursor",i=>{switch(i){case"left":case"up":this.cursor=Pr(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=Pr(this.cursor,1,this.options);break;case"space":this.toggleValue();break}})}},gu=class extends Cr{_mask="\u2022";get cursor(){return this._cursor}get masked(){return this.userInput.replaceAll(/./g,this._mask)}get userInputWithCursor(){if(this.state==="submit"||this.state==="cancel")return this.masked;let e=this.userInput;if(this.cursor>=e.length)return`${this.masked}${mg(["inverse","hidden"],"_")}`;let n=this.masked,i=n.slice(0,this.cursor),r=n.slice(this.cursor);return`${i}${mg("inverse",r[0])}${r.slice(1)}`}clear(){this._clearUserInput()}constructor({mask:e,...n}){super(n),this._mask=e??"\u2022",this.on("userInput",i=>{this._setValue(i)})}},vu=class extends Cr{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(e){super(e,!1),this.options=e.options;let n=this.options.findIndex(({value:r})=>r===e.initialValue),i=n===-1?0:n;this.cursor=this.options[i].disabled?Pr(i,1,this.options):i,this.changeValue(),this.on("cursor",r=>{switch(r){case"left":case"up":this.cursor=Pr(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=Pr(this.cursor,1,this.options);break}this.changeValue()})}};var yu=class extends Cr{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let e=this.userInput;if(this.cursor>=e.length)return`${this.userInput}\u2588`;let n=e.slice(0,this.cursor),[i,...r]=e.slice(this.cursor);return`${n}${mg("inverse",i)}${r.join("")}`}get cursor(){return this._cursor}constructor(e){super({...e,initialUserInput:e.initialUserInput??e.initialValue}),this.on("userInput",n=>{this._setValue(n)}),this.on("finalize",()=>{this.value||(this.value=e.defaultValue),this.value===void 0&&(this.value="")})}};import{styleText as y,stripVTControlCharacters as oZ}from"node:util";import nt from"node:process";var ao=Je(pg(),1);function jN(){return nt.platform!=="win32"?nt.env.TERM!=="linux":!!nt.env.CI||!!nt.env.WT_SESSION||!!nt.env.TERMINUS_SUBLIME||nt.env.ConEmuTask==="{cmd::Cmder}"||nt.env.TERM_PROGRAM==="Terminus-Sublime"||nt.env.TERM_PROGRAM==="vscode"||nt.env.TERM==="xterm-256color"||nt.env.TERM==="alacritty"||nt.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var bg=jN(),MN=()=>process.env.CI==="true";var Y=(t,e)=>bg?t:e,FN=Y("\u25C6","*"),Ck=Y("\u25A0","x"),zk=Y("\u25B2","x"),xu=Y("\u25C7","o"),VN=Y("\u250C","T"),M=Y("\u2502","|"),yt=Y("\u2514","\u2014"),cZ=Y("\u2510","T"),lZ=Y("\u2518","\u2014"),$g=Y("\u25CF",">"),$u=Y("\u25CB"," "),ZN=Y("\u25FB","[\u2022]"),Tk=Y("\u25FC","[+]"),Ok=Y("\u25FB","[ ]"),BN=Y("\u25AA","\u2022"),Ak=Y("\u2500","-"),GN=Y("\u256E","+"),WN=Y("\u251C","+"),qN=Y("\u256F","+"),HN=Y("\u2570","+"),dZ=Y("\u256D","+"),JN=Y("\u25CF","\u2022"),KN=Y("\u25C6","*"),YN=Y("\u25B2","!"),XN=Y("\u25A0","x"),uo=t=>{switch(t){case"initial":case"active":return y("cyan",FN);case"cancel":return y("red",Ck);case"error":return y("yellow",zk);case"submit":return y("green",xu)}},Rk=t=>{switch(t){case"initial":case"active":return y("cyan",M);case"cancel":return y("red",M);case"error":return y("yellow",M);case"submit":return y("green",M)}},Pk=(t,e,n,i,r,o=!1)=>{let s=e,a=0;if(o)for(let u=i-1;u>=n&&(s-=t[u].length,a++,!(s<=r));u--);else for(let u=n;u<i&&(s-=t[u].length,a++,!(s<=r));u++);return{lineCount:s,removals:a}},xg=({cursor:t,options:e,style:n,output:i=process.stdout,maxItems:r=Number.POSITIVE_INFINITY,columnPadding:o=0,rowPadding:s=4})=>{let a=oo(i)-o,u=_g(i),c=y("dim","..."),l=Math.max(u-s,0),d=Math.max(Math.min(r,l),5),f=0;t>=d-3&&(f=Math.max(Math.min(t-d+3,e.length-d),0));let h=d<e.length&&f>0,p=d<e.length&&f+d<e.length,_=Math.min(f+d,e.length),S=[],k=0;h&&k++,p&&k++;let P=f+(h?1:0),C=_-(p?1:0);for(let T=P;T<C;T++){let Z=vt(n(e[T],T===t),a,{hard:!0,trim:!1}).split(`
273
- `);S.push(Z),k+=Z.length}if(k>l){let T=0,Z=0,F=k,q=t-P,ne=l,$e=()=>Pk(S,F,0,q,ne),he=()=>Pk(S,F,q+1,S.length,ne,!0);h?({lineCount:F,removals:T}=$e(),F>ne&&(p||(ne-=1),{lineCount:F,removals:Z}=he())):(p||(ne-=1),{lineCount:F,removals:Z}=he(),F>ne&&(ne-=1,{lineCount:F,removals:T}=$e())),T>0&&(h=!0,S.splice(0,T)),Z>0&&(p=!0,S.splice(S.length-Z,Z))}let E=[];h&&E.push(c);for(let T of S)for(let Z of T)E.push(Z);return p&&E.push(c),E};var wu=t=>{let e=t.active??"Yes",n=t.inactive??"No";return new mu({active:e,inactive:n,signal:t.signal,input:t.input,output:t.output,initialValue:t.initialValue??!0,render(){let i=t.withGuide??fe.withGuide,r=`${uo(this.state)} `,o=i?`${y("gray",M)} `:"",s=rr(t.output,t.message,o,r),a=`${i?`${y("gray",M)}
272
+ `)),this._prevFrame=e;return}}this.output.write(Se.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}};var Iu=class extends Rr{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",n=>{this.output.write(Se.cursor.move(0,-1)),this.value=n,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var Nk=class extends Rr{options;cursor=0;get _value(){return this.options[this.cursor].value}get _enabledOptions(){return this.options.filter(e=>e.disabled!==!0)}toggleAll(){let e=this._enabledOptions,n=this.value!==void 0&&this.value.length===e.length;this.value=n?[]:e.map(i=>i.value)}toggleInvert(){let e=this.value;if(!e)return;let n=this._enabledOptions.filter(i=>!e.includes(i.value));this.value=n.map(i=>i.value)}toggleValue(){this.value===void 0&&(this.value=[]);let e=this.value.includes(this._value);this.value=e?this.value.filter(n=>n!==this._value):[...this.value,this._value]}constructor(e){super(e,!1),this.options=e.options,this.value=[...e.initialValues??[]];let n=Math.max(this.options.findIndex(({value:i})=>i===e.cursorAt),0);this.cursor=this.options[n].disabled?Cr(n,1,this.options):n,this.on("key",(i,r)=>{r.name==="a"&&this.toggleAll(),r.name==="i"&&this.toggleInvert()}),this.on("cursor",i=>{switch(i){case"left":case"up":this.cursor=Cr(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=Cr(this.cursor,1,this.options);break;case"space":this.toggleValue();break}})}},Tu=class extends Rr{_mask="\u2022";get cursor(){return this._cursor}get masked(){return this.userInput.replaceAll(/./g,this._mask)}get userInputWithCursor(){if(this.state==="submit"||this.state==="cancel")return this.masked;let e=this.userInput;if(this.cursor>=e.length)return`${this.masked}${xg(["inverse","hidden"],"_")}`;let n=this.masked,i=n.slice(0,this.cursor),r=n.slice(this.cursor);return`${i}${xg("inverse",r[0])}${r.slice(1)}`}clear(){this._clearUserInput()}constructor({mask:e,...n}){super(n),this._mask=e??"\u2022",this.on("userInput",i=>{this._setValue(i)})}},Ou=class extends Rr{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(e){super(e,!1),this.options=e.options;let n=this.options.findIndex(({value:r})=>r===e.initialValue),i=n===-1?0:n;this.cursor=this.options[i].disabled?Cr(i,1,this.options):i,this.changeValue(),this.on("cursor",r=>{switch(r){case"left":case"up":this.cursor=Cr(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=Cr(this.cursor,1,this.options);break}this.changeValue()})}};var Au=class extends Rr{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let e=this.userInput;if(this.cursor>=e.length)return`${this.userInput}\u2588`;let n=e.slice(0,this.cursor),[i,...r]=e.slice(this.cursor);return`${n}${xg("inverse",i)}${r.join("")}`}get cursor(){return this._cursor}constructor(e){super({...e,initialUserInput:e.initialUserInput??e.initialValue}),this.on("userInput",n=>{this._setValue(n)}),this.on("finalize",()=>{this.value||(this.value=e.defaultValue),this.value===void 0&&(this.value="")})}};import{styleText as y,stripVTControlCharacters as OZ}from"node:util";import nt from"node:process";var mo=Je($g(),1);function QN(){return nt.platform!=="win32"?nt.env.TERM!=="linux":!!nt.env.CI||!!nt.env.WT_SESSION||!!nt.env.TERMINUS_SUBLIME||nt.env.ConEmuTask==="{cmd::Cmder}"||nt.env.TERM_PROGRAM==="Terminus-Sublime"||nt.env.TERM_PROGRAM==="vscode"||nt.env.TERM==="xterm-256color"||nt.env.TERM==="alacritty"||nt.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Ig=QN(),eD=()=>process.env.CI==="true";var Y=(t,e)=>Ig?t:e,tD=Y("\u25C6","*"),Mk=Y("\u25A0","x"),Fk=Y("\u25B2","x"),zu=Y("\u25C7","o"),rD=Y("\u250C","T"),M=Y("\u2502","|"),_t=Y("\u2514","\u2014"),RZ=Y("\u2510","T"),zZ=Y("\u2518","\u2014"),Tg=Y("\u25CF",">"),Ru=Y("\u25CB"," "),nD=Y("\u25FB","[\u2022]"),Dk=Y("\u25FC","[+]"),Lk=Y("\u25FB","[ ]"),iD=Y("\u25AA","\u2022"),Uk=Y("\u2500","-"),oD=Y("\u256E","+"),sD=Y("\u251C","+"),aD=Y("\u256F","+"),uD=Y("\u2570","+"),NZ=Y("\u256D","+"),cD=Y("\u25CF","\u2022"),lD=Y("\u25C6","*"),dD=Y("\u25B2","!"),hD=Y("\u25A0","x"),go=t=>{switch(t){case"initial":case"active":return y("cyan",tD);case"cancel":return y("red",Mk);case"error":return y("yellow",Fk);case"submit":return y("green",zu)}},Vk=t=>{switch(t){case"initial":case"active":return y("cyan",M);case"cancel":return y("red",M);case"error":return y("yellow",M);case"submit":return y("green",M)}},jk=(t,e,n,i,r,o=!1)=>{let s=e,a=0;if(o)for(let u=i-1;u>=n&&(s-=t[u].length,a++,!(s<=r));u--);else for(let u=n;u<i&&(s-=t[u].length,a++,!(s<=r));u++);return{lineCount:s,removals:a}},Og=({cursor:t,options:e,style:n,output:i=process.stdout,maxItems:r=Number.POSITIVE_INFINITY,columnPadding:o=0,rowPadding:s=4})=>{let a=fo(i)-o,u=Eg(i),c=y("dim","..."),l=Math.max(u-s,0),d=Math.max(Math.min(r,l),5),h=0;t>=d-3&&(h=Math.max(Math.min(t-d+3,e.length-d),0));let f=d<e.length&&h>0,p=d<e.length&&h+d<e.length,_=Math.min(h+d,e.length),S=[],k=0;f&&k++,p&&k++;let P=h+(f?1:0),C=_-(p?1:0);for(let T=P;T<C;T++){let Z=yt(n(e[T],T===t),a,{hard:!0,trim:!1}).split(`
273
+ `);S.push(Z),k+=Z.length}if(k>l){let T=0,Z=0,F=k,q=t-P,ne=l,$e=()=>jk(S,F,0,q,ne),pe=()=>jk(S,F,q+1,S.length,ne,!0);f?({lineCount:F,removals:T}=$e(),F>ne&&(p||(ne-=1),{lineCount:F,removals:Z}=pe())):(p||(ne-=1),{lineCount:F,removals:Z}=pe(),F>ne&&(ne-=1,{lineCount:F,removals:T}=$e())),T>0&&(f=!0,S.splice(0,T)),Z>0&&(p=!0,S.splice(S.length-Z,Z))}let E=[];f&&E.push(c);for(let T of S)for(let Z of T)E.push(Z);return p&&E.push(c),E};var Nu=t=>{let e=t.active??"Yes",n=t.inactive??"No";return new Iu({active:e,inactive:n,signal:t.signal,input:t.input,output:t.output,initialValue:t.initialValue??!0,render(){let i=t.withGuide??fe.withGuide,r=`${go(this.state)} `,o=i?`${y("gray",M)} `:"",s=rr(t.output,t.message,o,r),a=`${i?`${y("gray",M)}
274
274
  `:""}${s}
275
275
  `,u=this.value?e:n;switch(this.state){case"submit":{let c=i?`${y("gray",M)} `:"";return`${a}${c}${y("dim",u)}`}case"cancel":{let c=i?`${y("gray",M)} `:"";return`${a}${c}${y(["strikethrough","dim"],u)}${i?`
276
- ${y("gray",M)}`:""}`}default:{let c=i?`${y("cyan",M)} `:"",l=i?y("cyan",yt):"";return`${a}${c}${this.value?`${y("green",$g)} ${e}`:`${y("dim",$u)} ${y("dim",e)}`}${t.vertical?i?`
276
+ ${y("gray",M)}`:""}`}default:{let c=i?`${y("cyan",M)} `:"",l=i?y("cyan",_t):"";return`${a}${c}${this.value?`${y("green",Tg)} ${e}`:`${y("dim",Ru)} ${y("dim",e)}`}${t.vertical?i?`
277
277
  ${y("cyan",M)} `:`
278
- `:` ${y("dim","/")} `}${this.value?`${y("dim",$u)} ${y("dim",n)}`:`${y("green",$g)} ${n}`}
278
+ `:` ${y("dim","/")} `}${this.value?`${y("dim",Ru)} ${y("dim",n)}`:`${y("green",Tg)} ${n}`}
279
279
  ${l}
280
- `}}}}).prompt()};var qe={message:(t=[],{symbol:e=y("gray",M),secondarySymbol:n=y("gray",M),output:i=process.stdout,spacing:r=1,withGuide:o}={})=>{let s=[],a=o??fe.withGuide,u=a?n:"",c=a?`${e} `:"",l=a?`${n} `:"";for(let f=0;f<r;f++)s.push(u);let d=Array.isArray(t)?t:t.split(`
281
- `);if(d.length>0){let[f,...h]=d;f.length>0?s.push(`${c}${f}`):s.push(a?e:"");for(let p of h)p.length>0?s.push(`${l}${p}`):s.push(a?n:"")}i.write(`${s.join(`
280
+ `}}}}).prompt()};var je={message:(t=[],{symbol:e=y("gray",M),secondarySymbol:n=y("gray",M),output:i=process.stdout,spacing:r=1,withGuide:o}={})=>{let s=[],a=o??fe.withGuide,u=a?n:"",c=a?`${e} `:"",l=a?`${n} `:"";for(let h=0;h<r;h++)s.push(u);let d=Array.isArray(t)?t:t.split(`
281
+ `);if(d.length>0){let[h,...f]=d;h.length>0?s.push(`${c}${h}`):s.push(a?e:"");for(let p of f)p.length>0?s.push(`${l}${p}`):s.push(a?n:"")}i.write(`${s.join(`
282
282
  `)}
283
- `)},info:(t,e)=>{qe.message(t,{...e,symbol:y("blue",JN)})},success:(t,e)=>{qe.message(t,{...e,symbol:y("green",KN)})},step:(t,e)=>{qe.message(t,{...e,symbol:y("green",xu)})},warn:(t,e)=>{qe.message(t,{...e,symbol:y("yellow",YN)})},warning:(t,e)=>{qe.warn(t,e)},error:(t,e)=>{qe.message(t,{...e,symbol:y("red",XN)})}},Nk=(t="",e)=>{let n=e?.output??process.stdout,i=e?.withGuide??fe.withGuide?`${y("gray",yt)} `:"";n.write(`${i}${y("red",t)}
283
+ `)},info:(t,e)=>{je.message(t,{...e,symbol:y("blue",cD)})},success:(t,e)=>{je.message(t,{...e,symbol:y("green",lD)})},step:(t,e)=>{je.message(t,{...e,symbol:y("green",zu)})},warn:(t,e)=>{je.message(t,{...e,symbol:y("yellow",dD)})},warning:(t,e)=>{je.warn(t,e)},error:(t,e)=>{je.message(t,{...e,symbol:y("red",hD)})}},Zk=(t="",e)=>{let n=e?.output??process.stdout,i=e?.withGuide??fe.withGuide?`${y("gray",_t)} `:"";n.write(`${i}${y("red",t)}
284
284
 
285
- `)},Dk=(t="",e)=>{let n=e?.output??process.stdout,i=e?.withGuide??fe.withGuide?`${y("gray",VN)} `:"";n.write(`${i}${t}
286
- `)},Lk=(t="",e)=>{let n=e?.output??process.stdout,i=e?.withGuide??fe.withGuide?`${y("gray",M)}
287
- ${y("gray",yt)} `:"";n.write(`${i}${t}
285
+ `)},Bk=(t="",e)=>{let n=e?.output??process.stdout,i=e?.withGuide??fe.withGuide?`${y("gray",rD)} `:"";n.write(`${i}${t}
286
+ `)},Gk=(t="",e)=>{let n=e?.output??process.stdout,i=e?.withGuide??fe.withGuide?`${y("gray",M)}
287
+ ${y("gray",_t)} `:"";n.write(`${i}${t}
288
288
 
289
- `)};var so=(t,e)=>t.split(`
289
+ `)};var po=(t,e)=>t.split(`
290
290
  `).map(n=>e(n)).join(`
291
- `),Uk=t=>{let e=(i,r)=>{let o=i.label??String(i.value);return r==="disabled"?`${y("gray",Ok)} ${so(o,s=>y(["strikethrough","gray"],s))}${i.hint?` ${y("dim",`(${i.hint??"disabled"})`)}`:""}`:r==="active"?`${y("cyan",ZN)} ${o}${i.hint?` ${y("dim",`(${i.hint})`)}`:""}`:r==="selected"?`${y("green",Tk)} ${so(o,s=>y("dim",s))}${i.hint?` ${y("dim",`(${i.hint})`)}`:""}`:r==="cancelled"?`${so(o,s=>y(["strikethrough","dim"],s))}`:r==="active-selected"?`${y("green",Tk)} ${o}${i.hint?` ${y("dim",`(${i.hint})`)}`:""}`:r==="submitted"?`${so(o,s=>y("dim",s))}`:`${y("dim",Ok)} ${so(o,s=>y("dim",s))}`},n=t.required??!0;return new Ik({options:t.options,signal:t.signal,input:t.input,output:t.output,initialValues:t.initialValues,required:n,cursorAt:t.cursorAt,validate(i){if(n&&(i===void 0||i.length===0))return`Please select at least one option.
292
- ${y("reset",y("dim",`Press ${y(["gray","bgWhite","inverse"]," space ")} to select, ${y("gray",y("bgWhite",y("inverse"," enter ")))} to submit`))}`},render(){let i=t.withGuide??fe.withGuide,r=rr(t.output,t.message,i?`${Rk(this.state)} `:"",`${uo(this.state)} `),o=`${i?`${y("gray",M)}
291
+ `),Wk=t=>{let e=(i,r)=>{let o=i.label??String(i.value);return r==="disabled"?`${y("gray",Lk)} ${po(o,s=>y(["strikethrough","gray"],s))}${i.hint?` ${y("dim",`(${i.hint??"disabled"})`)}`:""}`:r==="active"?`${y("cyan",nD)} ${o}${i.hint?` ${y("dim",`(${i.hint})`)}`:""}`:r==="selected"?`${y("green",Dk)} ${po(o,s=>y("dim",s))}${i.hint?` ${y("dim",`(${i.hint})`)}`:""}`:r==="cancelled"?`${po(o,s=>y(["strikethrough","dim"],s))}`:r==="active-selected"?`${y("green",Dk)} ${o}${i.hint?` ${y("dim",`(${i.hint})`)}`:""}`:r==="submitted"?`${po(o,s=>y("dim",s))}`:`${y("dim",Lk)} ${po(o,s=>y("dim",s))}`},n=t.required??!0;return new Nk({options:t.options,signal:t.signal,input:t.input,output:t.output,initialValues:t.initialValues,required:n,cursorAt:t.cursorAt,validate(i){if(n&&(i===void 0||i.length===0))return`Please select at least one option.
292
+ ${y("reset",y("dim",`Press ${y(["gray","bgWhite","inverse"]," space ")} to select, ${y("gray",y("bgWhite",y("inverse"," enter ")))} to submit`))}`},render(){let i=t.withGuide??fe.withGuide,r=rr(t.output,t.message,i?`${Vk(this.state)} `:"",`${go(this.state)} `),o=`${i?`${y("gray",M)}
293
293
  `:""}${r}
294
294
  `,s=this.value??[],a=(u,c)=>{if(u.disabled)return e(u,"disabled");let l=s.includes(u.value);return c&&l?e(u,"active-selected"):l?e(u,"selected"):e(u,c?"active":"inactive")};switch(this.state){case"submit":{let u=this.options.filter(({value:l})=>s.includes(l)).map(l=>e(l,"submitted")).join(y("dim",", "))||y("dim","none"),c=rr(t.output,u,i?`${y("gray",M)} `:"");return`${o}${c}`}case"cancel":{let u=this.options.filter(({value:l})=>s.includes(l)).map(l=>e(l,"cancelled")).join(y("dim",", "));if(u.trim()==="")return`${o}${y("gray",M)}`;let c=rr(t.output,u,i?`${y("gray",M)} `:"");return`${o}${c}${i?`
295
295
  ${y("gray",M)}`:""}`}case"error":{let u=i?`${y("yellow",M)} `:"",c=this.error.split(`
296
- `).map((f,h)=>h===0?`${i?`${y("yellow",yt)} `:""}${y("yellow",f)}`:` ${f}`).join(`
296
+ `).map((h,f)=>f===0?`${i?`${y("yellow",_t)} `:""}${y("yellow",h)}`:` ${h}`).join(`
297
297
  `),l=o.split(`
298
298
  `).length,d=c.split(`
299
- `).length+1;return`${o}${u}${xg({output:t.output,options:this.options,cursor:this.cursor,maxItems:t.maxItems,columnPadding:u.length,rowPadding:l+d,style:a}).join(`
299
+ `).length+1;return`${o}${u}${Og({output:t.output,options:this.options,cursor:this.cursor,maxItems:t.maxItems,columnPadding:u.length,rowPadding:l+d,style:a}).join(`
300
300
  ${u}`)}
301
301
  ${c}
302
302
  `}default:{let u=i?`${y("cyan",M)} `:"",c=o.split(`
303
- `).length,l=i?2:1;return`${o}${u}${xg({output:t.output,options:this.options,cursor:this.cursor,maxItems:t.maxItems,columnPadding:u.length,rowPadding:c+l,style:a}).join(`
303
+ `).length,l=i?2:1;return`${o}${u}${Og({output:t.output,options:this.options,cursor:this.cursor,maxItems:t.maxItems,columnPadding:u.length,rowPadding:c+l,style:a}).join(`
304
304
  ${u}`)}
305
- ${i?y("cyan",yt):""}
306
- `}}}}).prompt()},QN=t=>y("dim",t),e4=(t,e,n)=>{let i={hard:!0,trim:!1},r=vt(t,e,i).split(`
307
- `),o=r.reduce((u,c)=>Math.max(ze(c),u),0),s=r.map(n).reduce((u,c)=>Math.max(ze(c),u),0),a=e-(s-o);return vt(t,a,i)},wg=(t="",e="",n)=>{let i=n?.output??nt.stdout,r=n?.withGuide??fe.withGuide,o=n?.format??QN,s=["",...e4(t,oo(i)-6,o).split(`
308
- `).map(o),""],a=ze(e),u=Math.max(s.reduce((f,h)=>{let p=ze(h);return p>f?p:f},0),a)+2,c=s.map(f=>`${y("gray",M)} ${f}${" ".repeat(u-ze(f))}${y("gray",M)}`).join(`
305
+ ${i?y("cyan",_t):""}
306
+ `}}}}).prompt()},fD=t=>y("dim",t),pD=(t,e,n)=>{let i={hard:!0,trim:!1},r=yt(t,e,i).split(`
307
+ `),o=r.reduce((u,c)=>Math.max(Re(c),u),0),s=r.map(n).reduce((u,c)=>Math.max(Re(c),u),0),a=e-(s-o);return yt(t,a,i)},Ag=(t="",e="",n)=>{let i=n?.output??nt.stdout,r=n?.withGuide??fe.withGuide,o=n?.format??fD,s=["",...pD(t,fo(i)-6,o).split(`
308
+ `).map(o),""],a=Re(e),u=Math.max(s.reduce((h,f)=>{let p=Re(f);return p>h?p:h},0),a)+2,c=s.map(h=>`${y("gray",M)} ${h}${" ".repeat(u-Re(h))}${y("gray",M)}`).join(`
309
309
  `),l=r?`${y("gray",M)}
310
- `:"",d=r?WN:HN;i.write(`${l}${y("green",xu)} ${y("reset",e)} ${y("gray",Ak.repeat(Math.max(u-a-1,1))+GN)}
310
+ `:"",d=r?sD:uD;i.write(`${l}${y("green",zu)} ${y("reset",e)} ${y("gray",Uk.repeat(Math.max(u-a-1,1))+oD)}
311
311
  ${c}
312
- ${y("gray",d+Ak.repeat(u+2)+qN)}
313
- `)},jk=t=>new gu({validate:t.validate,mask:t.mask??BN,signal:t.signal,input:t.input,output:t.output,render(){let e=t.withGuide??fe.withGuide,n=`${e?`${y("gray",M)}
314
- `:""}${uo(this.state)} ${t.message}
315
- `,i=this.userInputWithCursor,r=this.masked;switch(this.state){case"error":{let o=e?`${y("yellow",M)} `:"",s=e?`${y("yellow",yt)} `:"",a=r??"";return t.clearOnError&&this.clear(),`${n.trim()}
312
+ ${y("gray",d+Uk.repeat(u+2)+aD)}
313
+ `)},qk=t=>new Tu({validate:t.validate,mask:t.mask??iD,signal:t.signal,input:t.input,output:t.output,render(){let e=t.withGuide??fe.withGuide,n=`${e?`${y("gray",M)}
314
+ `:""}${go(this.state)} ${t.message}
315
+ `,i=this.userInputWithCursor,r=this.masked;switch(this.state){case"error":{let o=e?`${y("yellow",M)} `:"",s=e?`${y("yellow",_t)} `:"",a=r??"";return t.clearOnError&&this.clear(),`${n.trim()}
316
316
  ${o}${a}
317
317
  ${s}${y("yellow",this.error)}
318
318
  `}case"submit":{let o=e?`${y("gray",M)} `:"",s=r?y("dim",r):"";return`${n}${o}${s}`}case"cancel":{let o=e?`${y("gray",M)} `:"",s=r?y(["strikethrough","dim"],r):"";return`${n}${o}${s}${r&&e?`
319
- ${y("gray",M)}`:""}`}default:{let o=e?`${y("cyan",M)} `:"",s=e?y("cyan",yt):"";return`${n}${o}${i}
319
+ ${y("gray",M)}`:""}`}default:{let o=e?`${y("cyan",M)} `:"",s=e?y("cyan",_t):"";return`${n}${o}${i}
320
320
  ${s}
321
- `}}}}).prompt();var t4=t=>y("magenta",t),Mk=({indicator:t="dots",onCancel:e,output:n=process.stdout,cancelMessage:i,errorMessage:r,frames:o=bg?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:s=bg?80:120,signal:a,...u}={})=>{let c=MN(),l,d,f=!1,h=!1,p="",_,S=performance.now(),k=oo(n),P=u?.styleFrame??t4,C=Q=>{let D=Q>1?r??fe.messages.error:i??fe.messages.cancel;h=Q===1,f&&(ke(D,Q),h&&typeof e=="function"&&e())},E=()=>C(2),T=()=>C(1),Z=()=>{process.on("uncaughtExceptionMonitor",E),process.on("unhandledRejection",E),process.on("SIGINT",T),process.on("SIGTERM",T),process.on("exit",C),a&&a.addEventListener("abort",T)},F=()=>{process.removeListener("uncaughtExceptionMonitor",E),process.removeListener("unhandledRejection",E),process.removeListener("SIGINT",T),process.removeListener("SIGTERM",T),process.removeListener("exit",C),a&&a.removeEventListener("abort",T)},q=()=>{if(_===void 0)return;c&&n.write(`
322
- `);let Q=vt(_,k,{hard:!0,trim:!1}).split(`
323
- `);Q.length>1&&n.write(ao.cursor.up(Q.length-1)),n.write(ao.cursor.to(0)),n.write(ao.erase.down())},ne=Q=>Q.replace(/\.+$/,""),$e=Q=>{let D=(performance.now()-Q)/1e3,ce=Math.floor(D/60),it=Math.floor(D%60);return ce>0?`[${ce}m ${it}s]`:`[${it}s]`},he=u.withGuide??fe.withGuide,Se=(Q="")=>{f=!0,l=kk({output:n}),p=ne(Q),S=performance.now(),he&&n.write(`${y("gray",M)}
324
- `);let D=0,ce=0;Z(),d=setInterval(()=>{if(c&&p===_)return;q(),_=p;let it=P(o[D]),je;if(c)je=`${it} ${p}...`;else if(t==="timer")je=`${it} ${p} ${$e(S)}`;else{let le=".".repeat(Math.floor(ce)).slice(0,3);je=`${it} ${p}${le}`}let zr=vt(je,k,{hard:!0,trim:!1});n.write(zr),D=D+1<o.length?D+1:0,ce=ce<4?ce+.125:0},s)},ke=(Q="",D=0,ce=!1)=>{if(!f)return;f=!1,clearInterval(d),q();let it=D===0?y("green",xu):D===1?y("red",Ck):y("red",zk);p=Q??p,ce||(t==="timer"?n.write(`${it} ${p} ${$e(S)}
321
+ `}}}}).prompt();var mD=t=>y("magenta",t),Hk=({indicator:t="dots",onCancel:e,output:n=process.stdout,cancelMessage:i,errorMessage:r,frames:o=Ig?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:s=Ig?80:120,signal:a,...u}={})=>{let c=eD(),l,d,h=!1,f=!1,p="",_,S=performance.now(),k=fo(n),P=u?.styleFrame??mD,C=Q=>{let D=Q>1?r??fe.messages.error:i??fe.messages.cancel;f=Q===1,h&&(Ee(D,Q),f&&typeof e=="function"&&e())},E=()=>C(2),T=()=>C(1),Z=()=>{process.on("uncaughtExceptionMonitor",E),process.on("unhandledRejection",E),process.on("SIGINT",T),process.on("SIGTERM",T),process.on("exit",C),a&&a.addEventListener("abort",T)},F=()=>{process.removeListener("uncaughtExceptionMonitor",E),process.removeListener("unhandledRejection",E),process.removeListener("SIGINT",T),process.removeListener("SIGTERM",T),process.removeListener("exit",C),a&&a.removeEventListener("abort",T)},q=()=>{if(_===void 0)return;c&&n.write(`
322
+ `);let Q=yt(_,k,{hard:!0,trim:!1}).split(`
323
+ `);Q.length>1&&n.write(mo.cursor.up(Q.length-1)),n.write(mo.cursor.to(0)),n.write(mo.erase.down())},ne=Q=>Q.replace(/\.+$/,""),$e=Q=>{let D=(performance.now()-Q)/1e3,ce=Math.floor(D/60),it=Math.floor(D%60);return ce>0?`[${ce}m ${it}s]`:`[${it}s]`},pe=u.withGuide??fe.withGuide,ke=(Q="")=>{h=!0,l=Rk({output:n}),p=ne(Q),S=performance.now(),pe&&n.write(`${y("gray",M)}
324
+ `);let D=0,ce=0;Z(),d=setInterval(()=>{if(c&&p===_)return;q(),_=p;let it=P(o[D]),Me;if(c)Me=`${it} ${p}...`;else if(t==="timer")Me=`${it} ${p} ${$e(S)}`;else{let le=".".repeat(Math.floor(ce)).slice(0,3);Me=`${it} ${p}${le}`}let zr=yt(Me,k,{hard:!0,trim:!1});n.write(zr),D=D+1<o.length?D+1:0,ce=ce<4?ce+.125:0},s)},Ee=(Q="",D=0,ce=!1)=>{if(!h)return;h=!1,clearInterval(d),q();let it=D===0?y("green",zu):D===1?y("red",Mk):y("red",Fk);p=Q??p,ce||(t==="timer"?n.write(`${it} ${p} ${$e(S)}
325
325
  `):n.write(`${it} ${p}
326
- `)),F(),l()};return{start:Se,stop:(Q="")=>ke(Q,0),message:(Q="")=>{p=ne(Q??p)},cancel:(Q="")=>ke(Q,1),error:(Q="")=>ke(Q,2),clear:()=>ke("",0,!0),get isCancelled(){return h}}},fZ={light:Y("\u2500","-"),heavy:Y("\u2501","="),block:Y("\u2588","#")};var bu=(t,e)=>t.includes(`
326
+ `)),F(),l()};return{start:ke,stop:(Q="")=>Ee(Q,0),message:(Q="")=>{p=ne(Q??p)},cancel:(Q="")=>Ee(Q,1),error:(Q="")=>Ee(Q,2),clear:()=>Ee("",0,!0),get isCancelled(){return f}}},DZ={light:Y("\u2500","-"),heavy:Y("\u2501","="),block:Y("\u2588","#")};var Cu=(t,e)=>t.includes(`
327
327
  `)?t.split(`
328
328
  `).map(n=>e(n)).join(`
329
- `):e(t),co=t=>{let e=(n,i)=>{let r=n.label??String(n.value);switch(i){case"disabled":return`${y("gray",$u)} ${bu(r,o=>y("gray",o))}${n.hint?` ${y("dim",`(${n.hint??"disabled"})`)}`:""}`;case"selected":return`${bu(r,o=>y("dim",o))}`;case"active":return`${y("green",$g)} ${r}${n.hint?` ${y("dim",`(${n.hint})`)}`:""}`;case"cancelled":return`${bu(r,o=>y(["strikethrough","dim"],o))}`;default:return`${y("dim",$u)} ${bu(r,o=>y("dim",o))}`}};return new vu({options:t.options,signal:t.signal,input:t.input,output:t.output,initialValue:t.initialValue,render(){let n=t.withGuide??fe.withGuide,i=`${uo(this.state)} `,r=`${Rk(this.state)} `,o=rr(t.output,t.message,r,i),s=`${n?`${y("gray",M)}
329
+ `):e(t),vo=t=>{let e=(n,i)=>{let r=n.label??String(n.value);switch(i){case"disabled":return`${y("gray",Ru)} ${Cu(r,o=>y("gray",o))}${n.hint?` ${y("dim",`(${n.hint??"disabled"})`)}`:""}`;case"selected":return`${Cu(r,o=>y("dim",o))}`;case"active":return`${y("green",Tg)} ${r}${n.hint?` ${y("dim",`(${n.hint})`)}`:""}`;case"cancelled":return`${Cu(r,o=>y(["strikethrough","dim"],o))}`;default:return`${y("dim",Ru)} ${Cu(r,o=>y("dim",o))}`}};return new Ou({options:t.options,signal:t.signal,input:t.input,output:t.output,initialValue:t.initialValue,render(){let n=t.withGuide??fe.withGuide,i=`${go(this.state)} `,r=`${Vk(this.state)} `,o=rr(t.output,t.message,r,i),s=`${n?`${y("gray",M)}
330
330
  `:""}${o}
331
331
  `;switch(this.state){case"submit":{let a=n?`${y("gray",M)} `:"",u=rr(t.output,e(this.options[this.cursor],"selected"),a);return`${s}${u}`}case"cancel":{let a=n?`${y("gray",M)} `:"",u=rr(t.output,e(this.options[this.cursor],"cancelled"),a);return`${s}${u}${n?`
332
- ${y("gray",M)}`:""}`}default:{let a=n?`${y("cyan",M)} `:"",u=n?y("cyan",yt):"",c=s.split(`
333
- `).length,l=n?2:1;return`${s}${a}${xg({output:t.output,cursor:this.cursor,options:this.options,maxItems:t.maxItems,columnPadding:a.length,rowPadding:c+l,style:(d,f)=>e(d,d.disabled?"disabled":f?"active":"inactive")}).join(`
332
+ ${y("gray",M)}`:""}`}default:{let a=n?`${y("cyan",M)} `:"",u=n?y("cyan",_t):"",c=s.split(`
333
+ `).length,l=n?2:1;return`${s}${a}${Og({output:t.output,cursor:this.cursor,options:this.options,maxItems:t.maxItems,columnPadding:a.length,rowPadding:c+l,style:(d,h)=>e(d,d.disabled?"disabled":h?"active":"inactive")}).join(`
334
334
  ${a}`)}
335
335
  ${u}
336
- `}}}}).prompt()};var hZ=`${y("gray",M)} `;var Fk=t=>new yu({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,output:t.output,signal:t.signal,input:t.input,render(){let e=t?.withGuide??fe.withGuide,n=`${`${e?`${y("gray",M)}
337
- `:""}${uo(this.state)} `}${t.message}
338
- `,i=t.placeholder?y("inverse",t.placeholder[0])+y("dim",t.placeholder.slice(1)):y(["inverse","hidden"],"_"),r=this.userInput?this.userInputWithCursor:i,o=this.value??"";switch(this.state){case"error":{let s=this.error?` ${y("yellow",this.error)}`:"",a=e?`${y("yellow",M)} `:"",u=e?y("yellow",yt):"";return`${n.trim()}
336
+ `}}}}).prompt()};var LZ=`${y("gray",M)} `;var Jk=t=>new Au({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,output:t.output,signal:t.signal,input:t.input,render(){let e=t?.withGuide??fe.withGuide,n=`${`${e?`${y("gray",M)}
337
+ `:""}${go(this.state)} `}${t.message}
338
+ `,i=t.placeholder?y("inverse",t.placeholder[0])+y("dim",t.placeholder.slice(1)):y(["inverse","hidden"],"_"),r=this.userInput?this.userInputWithCursor:i,o=this.value??"";switch(this.state){case"error":{let s=this.error?` ${y("yellow",this.error)}`:"",a=e?`${y("yellow",M)} `:"",u=e?y("yellow",_t):"";return`${n.trim()}
339
339
  ${a}${r}
340
340
  ${u}${s}
341
341
  `}case"submit":{let s=o?` ${y("dim",o)}`:"",a=e?y("gray",M):"";return`${n}${a}${s}`}case"cancel":{let s=o?` ${y(["strikethrough","dim"],o)}`:"",a=e?y("gray",M):"";return`${n}${a}${s}${o.trim()?`
342
- ${a}`:""}`}default:{let s=e?`${y("cyan",M)} `:"",a=e?y("cyan",yt):"";return`${n}${s}${r}
342
+ ${a}`:""}`}default:{let s=e?`${y("cyan",M)} `:"",a=e?y("cyan",_t):"";return`${n}${s}${r}
343
343
  ${a}
344
- `}}}}).prompt();Ae();pr();var r4={brain:["text"],voice:["stt","tts"],memory:["embedding"]},Vk=["brain","voice","memory"],Sg="brain",n4=["text","stt","tts","embedding"];function i4(t){return t==="text"}function Zk(t){let e=new Set;for(let n of t)for(let i of r4[n])e.add(i);return n4.filter(n=>e.has(n))}function Bk(t){let e=["brain"],n=t.routes;return(n?.stt||n?.tts)&&e.push("voice"),n?.embedding&&e.push("memory"),e}function Gk(t,e){if(e==="valid")return[];let n=i4(t);return e==="invalid"?n?["retry","change"]:["retry","change","skip"]:n?["save","retry","change"]:["save","retry","change","skip"]}function Wk(t){let e={},n={};for(let r of t.routes){e[r.capability]={provider:r.provider,model:r.model};let o=t.keys.get(r.provider);o!==void 0&&o.length>0&&(n[r.provider]=o)}let i={version:t.existing.version,defaults:{logLevel:t.logLevel,modality:t.modality},upgrade:{auto:t.existing.upgrade.auto}};return Object.keys(e).length>0&&(i.routes=e),Object.keys(n).length>0&&(i.secrets=n),i}function qk(t,e){return!!t.isTTY&&!!e.isTTY}var lo=class extends Error{},Hk={save:{label:"save anyway",hint:"keep this key; verify later with jarvis doctor"},retry:{label:"re-enter the key"},change:{label:"choose a different provider"},skip:{label:"skip this capability",hint:"optional"}},Su=class{config;probe;io;stdin;stdout;constructor(e){this.config=e.config,this.probe=e.probe,this.io=e.io??ue,this.stdin=e.stdin??process.stdin,this.stdout=e.stdout??process.stdout}async run(){if(!qk(this.stdin,this.stdout))return this.printHeadlessGuidance(),1;try{return await this.wizard()}catch(e){if(e instanceof lo)return Nk("no changes written."),130;throw e}}loadExisting(){try{return{config:this.config.resolved(),corrupt:!1}}catch{return{config:hr.parse({}),corrupt:!0}}}async wizard(){let{config:e,corrupt:n}=this.loadExisting(),i=!n&&!!(e.routes??e.secrets);Dk(N.bold("jarvis init")),n&&qe.warn("the existing config.json is invalid; init will replace it with a fresh config."),wg(`Writes ${N.accent(Be.resolve("config.json"))} (owner-only).`+(i?`
345
- A config already exists - values are prefilled; edit or keep them.`:""),"setup");let r=await this.pickCapabilities(e),o=new Map,s=[];for(let d of Zk(r)){let f=await this.configureCapability(d,e,o);f&&s.push(f)}let a=this.ensure(await co({message:"Default modality",options:[{value:"voice",label:"voice",hint:"speak and listen when available"},{value:"text",label:"text",hint:"text-only"}],initialValue:e.defaults.modality})),u=this.ensure(await co({message:"Log level",options:["debug","info","warn","error"].map(d=>({value:d,label:d})),initialValue:e.defaults.logLevel}));if(this.review(s,o,a,u),!this.ensure(await wu({message:"Write this configuration?"})))throw new lo;return this.config.write(Wk({existing:e,routes:s,keys:o,modality:a,logLevel:u})),qe.success(`wrote ${Be.resolve("config.json")}`),await wu({message:"Start Jarvis now?",initialValue:!1})===!0&&qe.info("starting is not wired yet in v0.1 - run `jarvis` to begin a session."),Lk(N.ok("done.")),0}async pickCapabilities(e){let n=this.ensure(await Uk({message:"Which capabilities do you want to set up?",options:[{value:"brain",label:"Brain (text)",hint:"required - the reasoning model"},{value:"voice",label:"Voice (speech in + out)",hint:"optional"},{value:"memory",label:"Memory (embeddings)",hint:"optional"}],initialValues:Bk(e),required:!1}));n.includes(Sg)||qe.warn("Brain (text) is required; keeping it selected.");let i=new Set(n);return i.add(Sg),Vk.filter(r=>i.has(r))}async configureCapability(e,n,i){let r=this.probe.providersFor(e);if(r.length===0)return qe.warn(`no providers available for ${e}; skipping.`),null;for(;;){let o=await this.pickProvider(e,r,n),s=await this.pickModel(e,o,n);if(i.has(o))return{capability:e,provider:o,model:s};let a=await this.resolveKey(e,o,s,n,i);if(a!=="change-provider")return a}}async resolveKey(e,n,i,r,o){let s=await this.firstKey(n,r);for(;;){let a=await this.validateKey(n,s);if(a==="valid")return o.set(n,s),{capability:e,provider:n,model:i};let u=await this.pickAfterFailure(e,a);if(u==="save")return o.set(n,s),{capability:e,provider:n,model:i};if(u==="skip")return qe.info(`skipped ${e} (optional).`),null;if(u==="change")return"change-provider";s=await this.promptPassword(n)}}async pickProvider(e,n,i){let r=i.routes?.[e]?.provider;return this.ensure(await co({message:`${e} provider`,options:n.map(o=>({value:o,label:o})),initialValue:r&&n.includes(r)?r:void 0}))}async pickModel(e,n,i){let r=i.routes?.[e],o=r?.provider===n?r.model:this.probe.defaultModel(n,e)??"";return this.ensure(await Fk({message:`${e} model`,initialValue:o,validate:s=>s?.trim()?void 0:"a model is required"}))}async firstKey(e,n){let i=n.secrets?.[e];return i&&this.ensure(await wu({message:`Reuse the saved key for ${e}?`,initialValue:!0}))?i.trim():this.promptPassword(e)}async promptPassword(e){return this.ensure(await jk({message:`${e} API key`,validate:i=>i?.trim()?void 0:"a key is required"})).trim()}async validateKey(e,n){let i=Mk();i.start(`validating ${e} key...`);let r=await this.probe.probe(e,n),o=r.detail?` (${r.detail})`:"";return r.ok?i.stop(N.ok(`${e} key valid`)):r.status==="invalid"?i.stop(N.fail(`${e} key rejected${o}`)):r.status==="unverifiable"?i.stop(N.warn(`could not verify ${e} here${o}`)):i.stop(N.warn(`could not validate ${e}${o}`)),r.status}async pickAfterFailure(e,n){let i=Gk(e,n);return this.ensure(await co({message:`${e}: how do you want to proceed?`,options:i.map(r=>({value:r,label:Hk[r].label,hint:Hk[r].hint}))}))}review(e,n,i,r){let o=[];if(e.length===0)o.push("routes: none");else for(let s of e){let a=n.has(s.provider)?N.ok("key set"):N.warn("no key");o.push(`${s.capability}: ${s.provider}/${s.model} (${a})`)}o.push(`defaults: modality=${i}, logLevel=${r}`),wg(o.join(`
344
+ `}}}}).prompt();we();pr();var gD={brain:["text"],voice:["stt","tts"],memory:["embedding"]},Kk=["brain","voice","memory"],Pg="brain",vD=["text","stt","tts","embedding"];function yD(t){return t==="text"}function Yk(t){let e=new Set;for(let n of t)for(let i of gD[n])e.add(i);return vD.filter(n=>e.has(n))}function Xk(t){let e=["brain"],n=t.routes;return(n?.stt||n?.tts)&&e.push("voice"),n?.embedding&&e.push("memory"),e}function Qk(t,e){if(e==="valid")return[];let n=yD(t);return e==="invalid"?n?["retry","change"]:["retry","change","skip"]:n?["save","retry","change"]:["save","retry","change","skip"]}function eE(t){let e={},n={};for(let r of t.routes){let o=t.existing.routes?.[r.capability];e[r.capability]={provider:r.provider,model:r.model,...o?.provider===r.provider&&o.url!==void 0&&{url:o.url}};let s=t.keys.get(r.provider);s!==void 0&&s.length>0&&(n[r.provider]=s)}let i={version:t.existing.version,defaults:{logLevel:t.logLevel,modality:t.modality},upgrade:{auto:t.existing.upgrade.auto}};return Object.keys(e).length>0&&(i.routes=e),Object.keys(n).length>0&&(i.secrets=n),i}function tE(t,e){return!!t.isTTY&&!!e.isTTY}var yo=class extends Error{},rE={save:{label:"save anyway",hint:"keep this key; verify later with jarvis doctor"},retry:{label:"re-enter the key"},change:{label:"choose a different provider"},skip:{label:"skip this capability",hint:"optional"}},Du=class{config;probe;io;stdin;stdout;constructor(e){this.config=e.config,this.probe=e.probe,this.io=e.io??ue,this.stdin=e.stdin??process.stdin,this.stdout=e.stdout??process.stdout}async run(){if(!tE(this.stdin,this.stdout))return this.printHeadlessGuidance(),1;try{return await this.wizard()}catch(e){if(e instanceof yo)return Zk("no changes written."),130;throw e}}loadExisting(){try{return{config:this.config.resolved(),corrupt:!1}}catch{return{config:fr.parse({}),corrupt:!0}}}async wizard(){let{config:e,corrupt:n}=this.loadExisting(),i=!n&&!!(e.routes??e.secrets);Bk(N.bold("jarvis init")),n&&je.warn("the existing config.json is invalid; init will replace it with a fresh config."),Ag(`Writes ${N.accent(Ge.resolve("config.json"))} (owner-only).`+(i?`
345
+ A config already exists - values are prefilled; edit or keep them.`:""),"setup");let r=await this.pickCapabilities(e),o=new Map,s=[];for(let d of Yk(r)){let h=await this.configureCapability(d,e,o);h&&s.push(h)}let a=this.ensure(await vo({message:"Default modality",options:[{value:"voice",label:"voice",hint:"speak and listen when available"},{value:"text",label:"text",hint:"text-only"}],initialValue:e.defaults.modality})),u=this.ensure(await vo({message:"Log level",options:["debug","info","warn","error"].map(d=>({value:d,label:d})),initialValue:e.defaults.logLevel}));if(this.review(s,o,a,u),!this.ensure(await Nu({message:"Write this configuration?"})))throw new yo;return this.config.write(eE({existing:e,routes:s,keys:o,modality:a,logLevel:u})),je.success(`wrote ${Ge.resolve("config.json")}`),await Nu({message:"Start Jarvis now?",initialValue:!1})===!0&&je.info("starting is not wired yet in v0.1 - run `jarvis` to begin a session."),Gk(N.ok("done.")),0}async pickCapabilities(e){let n=this.ensure(await Wk({message:"Which capabilities do you want to set up?",options:[{value:"brain",label:"Brain (text)",hint:"required - the reasoning model"},{value:"voice",label:"Voice (speech in + out)",hint:"optional"},{value:"memory",label:"Memory (embeddings)",hint:"optional"}],initialValues:Xk(e),required:!1}));n.includes(Pg)||je.warn("Brain (text) is required; keeping it selected.");let i=new Set(n);return i.add(Pg),Kk.filter(r=>i.has(r))}async configureCapability(e,n,i){let r=this.probe.providersFor(e);if(r.length===0)return je.warn(`no providers available for ${e}; skipping.`),null;for(;;){let o=await this.pickProvider(e,r,n),s=await this.pickModel(e,o,n);if(!this.probe.requiresKey(o))return je.info(`${o} needs no API key (a self-hosted server).`),{capability:e,provider:o,model:s};if(i.has(o))return{capability:e,provider:o,model:s};let a=await this.resolveKey(e,o,s,n,i);if(a!=="change-provider")return a}}async resolveKey(e,n,i,r,o){let s=await this.firstKey(n,r);for(;;){let a=await this.validateKey(n,s);if(a==="valid")return o.set(n,s),{capability:e,provider:n,model:i};let u=await this.pickAfterFailure(e,a);if(u==="save")return o.set(n,s),{capability:e,provider:n,model:i};if(u==="skip")return je.info(`skipped ${e} (optional).`),null;if(u==="change")return"change-provider";s=await this.promptPassword(n)}}async pickProvider(e,n,i){let r=i.routes?.[e]?.provider;return this.ensure(await vo({message:`${e} provider`,options:n.map(o=>({value:o,label:o})),initialValue:r&&n.includes(r)?r:void 0}))}async pickModel(e,n,i){let r=i.routes?.[e],o=r?.provider===n?r.model:this.probe.defaultModel(n,e)??"";return this.ensure(await Jk({message:`${e} model`,initialValue:o,validate:s=>s?.trim()?void 0:"a model is required"}))}async firstKey(e,n){let i=n.secrets?.[e];return i&&this.ensure(await Nu({message:`Reuse the saved key for ${e}?`,initialValue:!0}))?i.trim():this.promptPassword(e)}async promptPassword(e){return this.ensure(await qk({message:`${e} API key`,validate:i=>i?.trim()?void 0:"a key is required"})).trim()}async validateKey(e,n){let i=Hk();i.start(`validating ${e} key...`);let r=await this.probe.probe(e,n),o=r.detail?` (${r.detail})`:"";return r.ok?i.stop(N.ok(`${e} key valid`)):r.status==="invalid"?i.stop(N.fail(`${e} key rejected${o}`)):r.status==="unverifiable"?i.stop(N.warn(`could not verify ${e} here${o}`)):i.stop(N.warn(`could not validate ${e}${o}`)),r.status}async pickAfterFailure(e,n){let i=Qk(e,n);return this.ensure(await vo({message:`${e}: how do you want to proceed?`,options:i.map(r=>({value:r,label:rE[r].label,hint:rE[r].hint}))}))}review(e,n,i,r){let o=[];if(e.length===0)o.push("routes: none");else for(let s of e){let a=n.has(s.provider)?N.ok("key set"):N.warn("no key");o.push(`${s.capability}: ${s.provider}/${s.model} (${a})`)}o.push(`defaults: modality=${i}, logLevel=${r}`),Ag(o.join(`
346
346
  `),"review (secrets redacted)")}printHeadlessGuidance(){this.io.err(["jarvis init needs an interactive terminal.","","On a headless or non-interactive host:"," - run `jarvis init` over an interactive SSH session, or"," - set secrets and defaults non-interactively, e.g.:"," jarvis config set secrets.anthropic <key>"," jarvis config set defaults.modality text"," - relocate the home with the JARVIS_HOME env var if needed.","","Note: configuring a provider route (provider + model together) is interactive","in v0.1 - use `jarvis init` for that. Verify any setup with: jarvis doctor"].join(`
347
347
  `)+`
348
- `)}ensure(e){if(_u(e))throw new lo;return e}};ki();import{randomUUID as o4}from"node:crypto";var kg=class{constructor(e,n,i=ue){this.session=e;this.reader=n;this.io=i}session;reader;io;prompt="you ";labelShown=!1;async run(){try{for await(let e of this.session.events())if(!await this.handle(e))break}finally{this.reader.close(),await this.session.close()}}async handle(e){switch(e.type){case"session.ready":return this.greet(),this.promptAndSend();case"turn.accepted":return this.labelShown=!1,!0;case"state":return e.state==="responding"&&this.showLabel(),!0;case"response.delta":return this.showLabel(),this.io.out(e.text),!0;case"response.done":return this.labelShown&&this.io.out(`
348
+ `)}ensure(e){if(Pu(e))throw new yo;return e}};Pi();import{randomUUID as _D}from"node:crypto";var Cg=class{constructor(e,n,i=ue){this.session=e;this.reader=n;this.io=i}session;reader;io;prompt="you ";labelShown=!1;async run(){try{for await(let e of this.session.events())if(!await this.handle(e))break}finally{this.reader.close(),await this.session.close()}}async handle(e){switch(e.type){case"session.ready":return this.greet(),this.promptAndSend();case"turn.accepted":return this.labelShown=!1,!0;case"state":return e.state==="responding"&&this.showLabel(),!0;case"response.delta":return this.showLabel(),this.io.out(e.text),!0;case"response.done":return this.labelShown&&this.io.out(`
349
349
  `),this.promptAndSend();case"error":return this.labelShown&&this.io.out(`
350
- `),this.renderError(e),this.promptAndSend();default:return!0}}async promptAndSend(){for(;;){let e=await this.reader.next(this.prompt);if(e===null)return!1;let n=e.trim();if(n.length!==0)try{return await this.session.send({type:"input.text",sessionId:this.session.sessionId,commandId:o4(),atMs:Date.now(),text:n}),!0}catch(i){if(i instanceof Le){if(i.reason==="closed")return!1;this.renderSendError(i);continue}throw i}}}greet(){this.io.out(N.dim("jarvis is ready. type a message, or press ctrl-c to exit.")+`
350
+ `),this.renderError(e),this.promptAndSend();default:return!0}}async promptAndSend(){for(;;){let e=await this.reader.next(this.prompt);if(e===null)return!1;let n=e.trim();if(n.length!==0)try{return await this.session.send({type:"input.text",sessionId:this.session.sessionId,commandId:_D(),atMs:Date.now(),text:n}),!0}catch(i){if(i instanceof Le){if(i.reason==="closed")return!1;this.renderSendError(i);continue}throw i}}}greet(){this.io.out(N.dim("jarvis is ready. type a message, or press ctrl-c to exit.")+`
351
351
  `)}showLabel(){this.labelShown||(this.io.out(N.dim("jarvis")+" "),this.labelShown=!0)}renderError(e){if(e.reason==="no_text_route"){this.io.out(N.warn("no brain configured yet - run `jarvis init` to add one.")+`
352
352
  `);return}this.io.out(N.fail(`something went wrong - ${e.message}`)+`
353
353
  `)}renderSendError(e){this.io.out(N.warn(`could not send that (${e.reason}) - ${e.message}`)+`
354
- `)}};async function Jk(t){if(!t.stdin.isTTY)return t.io.err(N.dim("jarvis is interactive - run it in a terminal.")+`
354
+ `)}};async function nE(t){if(!t.stdin.isTTY)return t.io.err(N.dim("jarvis is interactive - run it in a terminal.")+`
355
355
  `),1;let e;try{e=await t.openSession()}catch{return t.io.err(N.fail("could not start jarvis - your config may be invalid. run `jarvis doctor`.")+`
356
- `),1}let n=t.createReader();return await new kg(e,n,t.io).run(),0}import{createInterface as s4}from"node:readline";var ku=class{rl;closed=!1;pending=null;constructor(e,n){this.rl=s4({input:e,output:n}),this.rl.on("line",i=>this.settle(i)),this.rl.on("close",()=>{this.closed=!0,this.settle(null)}),this.rl.on("SIGINT",()=>this.close())}next(e){return this.closed?Promise.resolve(null):new Promise(n=>{this.pending=n,this.rl.setPrompt(e),this.rl.prompt()})}close(){this.closed||(this.closed=!0,this.rl.close())}settle(e){let n=this.pending;this.pending=null,n?.(e)}};var Dn=class extends Error{constructor(e){super(e),this.name="AudioUnavailableError"}};function Kk(t){let e=t.routes?.stt,n=t.routes?.tts;return!e||!n?!1:!!t.secrets?.[e.provider]&&!!t.secrets?.[n.provider]}async function Yk(t){if(!t.stdin.isTTY)return t.io.err(N.dim("jarvis is interactive - run it in a terminal.")+`
356
+ `),1}let n=t.createReader();return await new Cg(e,n,t.io).run(),0}import{createInterface as bD}from"node:readline";var Lu=class{rl;closed=!1;pending=null;constructor(e,n){this.rl=bD({input:e,output:n}),this.rl.on("line",i=>this.settle(i)),this.rl.on("close",()=>{this.closed=!0,this.settle(null)}),this.rl.on("SIGINT",()=>this.close())}next(e){return this.closed?Promise.resolve(null):new Promise(n=>{this.pending=n,this.rl.setPrompt(e),this.rl.prompt()})}close(){this.closed||(this.closed=!0,this.rl.close())}settle(e){let n=this.pending;this.pending=null,n?.(e)}};var Vn=class extends Error{constructor(e){super(e),this.name="AudioUnavailableError"}};function iE(t){let e=t.routes?.stt,n=t.routes?.tts;return!e||!n?!1:!!t.secrets?.[e.provider]&&!!t.secrets?.[n.provider]}async function oE(t){if(!t.stdin.isTTY)return t.io.err(N.dim("jarvis is interactive - run it in a terminal.")+`
357
357
  `),1;if(t.textOnly||!t.voiceConfigured)return t.runText();if(!await t.micAvailable())return t.io.err(N.warn("no microphone detected - check it is plugged in and mic access / privacy is enabled. starting in text mode.")+`
358
358
  `),t.runText();let e;try{e=await t.openVoiceSession()}catch{return t.io.err(N.fail("could not start jarvis - your config may be invalid. run `jarvis doctor`.")+`
359
- `),1}try{return await t.runVoice(e),0}catch(n){if(n instanceof Dn)return t.io.err(N.warn("could not start the microphone - check mic access / privacy. starting in text mode.")+`
360
- `),t.runText();throw n}}import{randomUUID as Og}from"node:crypto";function Eg({onlyFirst:t=!1}={}){let r="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(r,t?void 0:"g")}var a4=Eg();function Ig(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(a4,"")}var Xk=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Qk=12288,eE=65510,tE=[12288,12288,65281,65376,65504,65510];var rE=4352,nE=262141,Tg=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var Eu=(t,e)=>{let n=0,i=Math.floor(t.length/2)-1;for(;n<=i;){let r=Math.floor((n+i)/2),o=r*2;if(e<t[o])i=r-1;else if(e>t[o+1])n=r+1;else return!0}return!1};var iE=19968,[l4,d4]=f4(Tg);function f4(t){let e=t[0],n=t[1];for(let i=0;i<t.length;i+=2){let r=t[i],o=t[i+1];if(iE>=r&&iE<=o)return[r,o];o-r>n-e&&(e=r,n=o)}return[e,n]}var oE=t=>t<161||t>1114109?!1:Eu(Xk,t),sE=t=>t<Qk||t>eE?!1:Eu(tE,t);var aE=t=>t>=l4&&t<=d4?!0:t<rE||t>nE?!1:Eu(Tg,t);function h4(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function fo(t,{ambiguousAsWide:e=!1}={}){return h4(t),sE(t)||aE(t)||e&&oE(t)?2:1}var p4=new Intl.Segmenter,uE=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Mark}|\p{Surrogate})+$/v,m4=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,g4=/^\p{RGI_Emoji}$/v,v4=/^[\d#*]\u20E3$/,y4=/\p{Extended_Pictographic}/gu;function _4(t){if(t.length>50)return!1;if(v4.test(t))return!0;if(t.includes("\u200D")){let e=t.match(y4);return e!==null&&e.length>=2}return!1}function b4(t){return t.replace(m4,"")}function $4(t){return uE.test(t)}function cE(t){return t>=4352&&t<=4447||t>=43360&&t<=43388}function lE(t){return t>=4448&&t<=4519||t>=55216&&t<=55238}function dE(t){return t>=4520&&t<=4607||t>=55243&&t<=55291}function x4(t){return cE(t)||lE(t)||dE(t)}function w4(t,e){let n=[];for(let r of t)uE.test(r)||n.push(r.codePointAt(0));if(n.length===0)return;let i=0;for(let r=0;r<n.length;r++){let o=n[r];if(!x4(o)){if(i===0)return;for(let s=r;s<n.length;s++)i+=fo(n[s],e);return i}if(cE(o)&&lE(n[r+1])){i+=2,r+=dE(n[r+2])?2:1;continue}i+=fo(o,e)}return i}function S4(t,e){let n=0,i=!0;for(let r of t){if(i){i=!1;continue}r>="\uFF00"&&r<="\uFFEF"&&(n+=fo(r.codePointAt(0),e))}return n}function Iu(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:i=!1}=e,r=t;if(!i&&(r.includes("\x1B")||r.includes("\x9B"))&&(r=Ig(r)),r.length===0)return 0;if(/^[\u0020-\u007E]*$/.test(r))return r.length;let o=0,s={ambiguousAsWide:!n};for(let{segment:a}of p4.segment(r)){if($4(a))continue;if(g4.test(a)||_4(a)){o+=2;continue}let u=b4(a),c=w4(u,s);if(c!==void 0){o+=c;continue}let l=u.codePointAt(0);o+=fo(l,s),o+=S4(u,s)}return o}ki();Ae();function Ag(t){return t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}var ho="\x1B[2K\r",k4=new Intl.Segmenter(void 0,{granularity:"grapheme"}),Tu=class{session;capture;playback;io;terminalWidth;ptt;halfDuplex;signal;phase="listening";labelShown=!1;partialShown=!1;statusShown=!1;listenEpoch=0;asideActive=!1;turnStats={};talking;currentTurnId;cleanedUp=!1;onAbort=()=>{this.session.close()};constructor(e){this.session=e.session,this.capture=e.capture,this.playback=e.playback,this.io=e.io??ue,this.terminalWidth=e.terminalWidth??(()=>process.stdout.columns),this.ptt=e.pushToTalk,this.halfDuplex=e.options?.halfDuplex??!1,this.signal=e.signal,this.talking=this.ptt===void 0}async run(){if(this.signal){if(this.signal.aborted){await this.cleanup();return}this.signal.addEventListener("abort",this.onAbort,{once:!0})}try{await this.capture.start({onFrame:(e,n)=>this.handleFrame(e,n),onSpeechStart:()=>this.handleSpeechStart(),onError:e=>this.handleCaptureError(e)})}catch(e){throw await this.cleanup(),new Dn(e instanceof Error?e.message:String(e))}this.ptt?.listen({onStart:()=>{this.talking=!0},onEnd:()=>this.commitPushToTalkTurn()});try{for await(let e of this.session.events())this.handle(e)}finally{await this.cleanup()}}handleFrame(e,n){this.phase==="listening"&&this.talking&&this.sendFrame(e,n)}async sendFrame(e,n){try{await this.session.send({type:"input.audio.frame",sessionId:this.session.sessionId,commandId:Og(),atMs:n,audio:e})}catch(i){if(i instanceof Le&&i.reason==="closed"){this.capture.stop();return}B.debug("dropped an audio frame",{error:i})}}handleSpeechStart(){if(this.phase!=="responding"||this.halfDuplex||this.ptt)return;let e=this.currentTurnId;this.playback.flush(),this.closeOpenLine(),this.toListening(),this.cancelTurn(e,"barge_in")}async cancelTurn(e,n){try{await this.session.send({type:"turn.cancel",sessionId:this.session.sessionId,commandId:Og(),atMs:Date.now(),reason:n,...e!==void 0&&{turnId:e}})}catch{}}commitPushToTalkTurn(){this.talking=!1,this.endAudioInput()}async endAudioInput(){try{await this.session.send({type:"input.audio.end",sessionId:this.session.sessionId,commandId:Og(),atMs:Date.now()})}catch{}}handleCaptureError(e){this.cleanedUp||(this.closeOpenLine(),this.io.out(N.fail(`the microphone stopped - ${e.message}`)+`
359
+ `),1}try{return await t.runVoice(e),0}catch(n){if(n instanceof Vn)return t.io.err(N.warn("could not start the microphone - check mic access / privacy. starting in text mode.")+`
360
+ `),t.runText();throw n}}import{randomUUID as Dg}from"node:crypto";function Rg({onlyFirst:t=!1}={}){let r="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(r,t?void 0:"g")}var $D=Rg();function zg(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace($D,"")}var sE=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],aE=12288,uE=65510,cE=[12288,12288,65281,65376,65504,65510];var lE=4352,dE=262141,Ng=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var Uu=(t,e)=>{let n=0,i=Math.floor(t.length/2)-1;for(;n<=i;){let r=Math.floor((n+i)/2),o=r*2;if(e<t[o])i=r-1;else if(e>t[o+1])n=r+1;else return!0}return!1};var hE=19968,[SD,kD]=ED(Ng);function ED(t){let e=t[0],n=t[1];for(let i=0;i<t.length;i+=2){let r=t[i],o=t[i+1];if(hE>=r&&hE<=o)return[r,o];o-r>n-e&&(e=r,n=o)}return[e,n]}var fE=t=>t<161||t>1114109?!1:Uu(sE,t),pE=t=>t<aE||t>uE?!1:Uu(cE,t);var mE=t=>t>=SD&&t<=kD?!0:t<lE||t>dE?!1:Uu(Ng,t);function ID(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function _o(t,{ambiguousAsWide:e=!1}={}){return ID(t),pE(t)||mE(t)||e&&fE(t)?2:1}var TD=new Intl.Segmenter,gE=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Mark}|\p{Surrogate})+$/v,OD=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,AD=/^\p{RGI_Emoji}$/v,PD=/^[\d#*]\u20E3$/,CD=/\p{Extended_Pictographic}/gu;function RD(t){if(t.length>50)return!1;if(PD.test(t))return!0;if(t.includes("\u200D")){let e=t.match(CD);return e!==null&&e.length>=2}return!1}function zD(t){return t.replace(OD,"")}function ND(t){return gE.test(t)}function vE(t){return t>=4352&&t<=4447||t>=43360&&t<=43388}function yE(t){return t>=4448&&t<=4519||t>=55216&&t<=55238}function _E(t){return t>=4520&&t<=4607||t>=55243&&t<=55291}function DD(t){return vE(t)||yE(t)||_E(t)}function LD(t,e){let n=[];for(let r of t)gE.test(r)||n.push(r.codePointAt(0));if(n.length===0)return;let i=0;for(let r=0;r<n.length;r++){let o=n[r];if(!DD(o)){if(i===0)return;for(let s=r;s<n.length;s++)i+=_o(n[s],e);return i}if(vE(o)&&yE(n[r+1])){i+=2,r+=_E(n[r+2])?2:1;continue}i+=_o(o,e)}return i}function UD(t,e){let n=0,i=!0;for(let r of t){if(i){i=!1;continue}r>="\uFF00"&&r<="\uFFEF"&&(n+=_o(r.codePointAt(0),e))}return n}function ju(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:i=!1}=e,r=t;if(!i&&(r.includes("\x1B")||r.includes("\x9B"))&&(r=zg(r)),r.length===0)return 0;if(/^[\u0020-\u007E]*$/.test(r))return r.length;let o=0,s={ambiguousAsWide:!n};for(let{segment:a}of TD.segment(r)){if(ND(a))continue;if(AD.test(a)||RD(a)){o+=2;continue}let u=zD(a),c=LD(u,s);if(c!==void 0){o+=c;continue}let l=u.codePointAt(0);o+=_o(l,s),o+=UD(u,s)}return o}Pi();we();function Lg(t){return t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}var bo="\x1B[2K\r",jD=new Intl.Segmenter(void 0,{granularity:"grapheme"}),Mu=class{session;capture;playback;io;terminalWidth;ptt;halfDuplex;signal;phase="listening";labelShown=!1;partialShown=!1;statusShown=!1;listenEpoch=0;asideActive=!1;turnStats={};talking;currentTurnId;cleanedUp=!1;onAbort=()=>{this.session.close()};constructor(e){this.session=e.session,this.capture=e.capture,this.playback=e.playback,this.io=e.io??ue,this.terminalWidth=e.terminalWidth??(()=>process.stdout.columns),this.ptt=e.pushToTalk,this.halfDuplex=e.options?.halfDuplex??!1,this.signal=e.signal,this.talking=this.ptt===void 0}async run(){if(this.signal){if(this.signal.aborted){await this.cleanup();return}this.signal.addEventListener("abort",this.onAbort,{once:!0})}try{await this.capture.start({onFrame:(e,n)=>this.handleFrame(e,n),onSpeechStart:()=>this.handleSpeechStart(),onError:e=>this.handleCaptureError(e)})}catch(e){throw await this.cleanup(),new Vn(e instanceof Error?e.message:String(e))}this.ptt?.listen({onStart:()=>{this.talking=!0},onEnd:()=>this.commitPushToTalkTurn()});try{for await(let e of this.session.events())this.handle(e)}finally{await this.cleanup()}}handleFrame(e,n){this.phase==="listening"&&this.talking&&this.sendFrame(e,n)}async sendFrame(e,n){try{await this.session.send({type:"input.audio.frame",sessionId:this.session.sessionId,commandId:Dg(),atMs:n,audio:e})}catch(i){if(i instanceof Le&&i.reason==="closed"){this.capture.stop();return}B.debug("dropped an audio frame",{error:i})}}handleSpeechStart(){if(this.phase!=="responding"||this.halfDuplex||this.ptt)return;let e=this.currentTurnId;this.playback.flush(),this.closeOpenLine(),this.toListening(),this.cancelTurn(e,"barge_in")}async cancelTurn(e,n){try{await this.session.send({type:"turn.cancel",sessionId:this.session.sessionId,commandId:Dg(),atMs:Date.now(),reason:n,...e!==void 0&&{turnId:e}})}catch{}}commitPushToTalkTurn(){this.talking=!1,this.endAudioInput()}async endAudioInput(){try{await this.session.send({type:"input.audio.end",sessionId:this.session.sessionId,commandId:Dg(),atMs:Date.now()})}catch{}}handleCaptureError(e){this.cleanedUp||(this.closeOpenLine(),this.io.out(N.fail(`the microphone stopped - ${e.message}`)+`
361
361
  `),this.session.close())}handle(e){switch(e.type){case"session.ready":this.greet();return;case"turn.accepted":this.currentTurnId=e.turnId,this.labelShown=!1,this.turnStats={};return;case"transcript.partial":if(e.turnId!==this.currentTurnId)return;this.renderPartial(e.text);return;case"turn.final":if(e.turn.turnId!==this.currentTurnId)return;if(e.turn.disposition==="absorbed"){this.renderAside(e.turn),this.toListening();return}this.renderFinalUser(e.turn),this.turnStats.finalAtMs=e.atMs,this.renderStatus("thinking");return;case"state":e.state==="responding"&&(this.phase="responding",this.asideActive=!1),e.state==="aside"&&(this.asideActive=!0,this.phase==="listening"&&this.renderStatus("listening"));return;case"response.delta":if(this.phase!=="responding")return;this.turnStats.firstTokenAtMs??=e.atMs,this.showLabel(),this.io.out(e.text);return;case"response.audio":if(this.phase!=="responding")return;this.turnStats.firstAudioAtMs===void 0&&(this.turnStats.firstAudioAtMs=e.atMs,this.turnStats.playbackStartAtMs=Date.now(),this.labelShown||this.renderStatus("speaking")),this.playback.play(e.audio);return;case"response.done":if(this.phase!=="responding")return;this.closeOpenLine(),this.turnStats.playbackStartAtMs!==void 0&&this.renderStatus("speaking"),this.awaitPlaybackDrain();return;case"error":{let n=this.currentTurnId;this.playback.flush(),this.closeOpenLine(),this.renderError(e),this.toListening(),this.cancelTurn(n,"user_cancel");return}default:return}}greet(){let e=this.ptt?"jarvis is ready (push-to-talk). press space to talk, again to send.":"jarvis is listening. just speak.",n=this.halfDuplex?" half-duplex: barge-in is off.":"";this.io.out(N.dim(`${e}${n} press ctrl-c to exit.`)+`
362
- `),this.renderStatus("listening")}renderPartial(e){this.io.out(`${ho}you ${N.dim(this.clampPartialToOneRow(e))}`),this.partialShown=!0,this.statusShown=!1}clampPartialToOneRow(e){let n=this.visibleColumns()-5;if(Iu(e)<=n)return e;let i=n-3;if(i<=0)return"...";let r=[...k4.segment(e)],o=r.length,s=0;for(;o>0;){let a=s+Iu(r[o-1].segment);if(a>i)break;s=a,o-=1}return o<r.length?"..."+e.slice(r[o].index):"..."}renderFinalUser(e){this.io.out(`${ho}you ${e.text}
363
- `),this.partialShown=!1,this.statusShown=!1}renderAside(e){this.io.out(`${ho}${N.dim(`you (aside) ${e.text}`)}
364
- `),this.partialShown=!1,this.statusShown=!1}showLabel(){this.labelShown||(this.eraseStatusLine(),this.io.out(N.dim("jarvis")+" "),this.labelShown=!0)}renderStatus(e){this.partialShown||this.labelShown||(this.io.out(ho+N.dim(this.statusText(e))),this.statusShown=!0)}statusText(e){if(e!=="listening"||!this.asideActive)return`${e}...`;let n=this.ptt?"listening (aside - press to talk to resume)":'listening (aside - say "Jarvis" to resume)',i=this.visibleColumns();if(n.length<=i)return n;let r="listening (aside)";return r.length<=i?r:`${e}...`}visibleColumns(){let e=this.terminalWidth();return e!==void 0&&e>0?e:80}eraseStatusLine(){this.statusShown&&(this.io.out(ho),this.statusShown=!1)}renderError(e){if(e.reason==="no_voice_route"){this.io.out(N.warn("no voice configured yet - run `jarvis init` to add speech routes.")+`
362
+ `),this.renderStatus("listening")}renderPartial(e){this.io.out(`${bo}you ${N.dim(this.clampPartialToOneRow(e))}`),this.partialShown=!0,this.statusShown=!1}clampPartialToOneRow(e){let n=this.visibleColumns()-5;if(ju(e)<=n)return e;let i=n-3;if(i<=0)return"...";let r=[...jD.segment(e)],o=r.length,s=0;for(;o>0;){let a=s+ju(r[o-1].segment);if(a>i)break;s=a,o-=1}return o<r.length?"..."+e.slice(r[o].index):"..."}renderFinalUser(e){this.io.out(`${bo}you ${e.text}
363
+ `),this.partialShown=!1,this.statusShown=!1}renderAside(e){this.io.out(`${bo}${N.dim(`you (aside) ${e.text}`)}
364
+ `),this.partialShown=!1,this.statusShown=!1}showLabel(){this.labelShown||(this.eraseStatusLine(),this.io.out(N.dim("jarvis")+" "),this.labelShown=!0)}renderStatus(e){this.partialShown||this.labelShown||(this.io.out(bo+N.dim(this.statusText(e))),this.statusShown=!0)}statusText(e){if(e!=="listening"||!this.asideActive)return`${e}...`;let n=this.ptt?"listening (aside - press to talk to resume)":'listening (aside - say "Jarvis" to resume)',i=this.visibleColumns();if(n.length<=i)return n;let r="listening (aside)";return r.length<=i?r:`${e}...`}visibleColumns(){let e=this.terminalWidth();return e!==void 0&&e>0?e:80}eraseStatusLine(){this.statusShown&&(this.io.out(bo),this.statusShown=!1)}renderError(e){if(e.reason==="no_voice_route"){this.io.out(N.warn("no voice configured yet - run `jarvis init` to add speech routes.")+`
365
365
  `);return}if(e.reason==="no_text_route"){this.io.out(N.warn("no brain configured yet - run `jarvis init` to add one.")+`
366
366
  `);return}this.io.out(N.fail(`something went wrong - ${e.message}`)+`
367
367
  `)}closeOpenLine(){if(this.labelShown||this.partialShown){this.io.out(`
368
- `),this.labelShown=!1,this.partialShown=!1;return}this.eraseStatusLine()}awaitPlaybackDrain(){let e=this.listenEpoch;this.playback.drained().then(()=>{this.cleanedUp||e!==this.listenEpoch||(this.printTurnSummary(),this.toListening())})}printTurnSummary(){if(B.getLevel()!=="debug")return;let{finalAtMs:e,firstTokenAtMs:n,firstAudioAtMs:i,playbackStartAtMs:r}=this.turnStats,o=[];e!==void 0&&n!==void 0&&o.push(`commit->token ${Ag(n-e)}`),n!==void 0&&i!==void 0&&o.push(`token->audio ${Ag(i-n)}`),r!==void 0&&o.push(`spoke ${Ag(Date.now()-r)}`),o.length!==0&&(this.eraseStatusLine(),this.io.out(N.dim(`turn ${o.join(", ")}`)+`
369
- `))}toListening(){this.listenEpoch++,this.phase="listening",this.labelShown=!1,this.partialShown=!1,this.currentTurnId=void 0,this.renderStatus("listening")}async cleanup(){this.cleanedUp||(this.cleanedUp=!0,this.closeOpenLine(),this.signal?.removeEventListener("abort",this.onAbort),this.ptt?.close(),await this.capture.stop().catch(()=>{}),await this.playback.close().catch(()=>{}),await this.session.close().catch(()=>{}))}};import{emitKeypressEvents as E4}from"node:readline";var Ou=class{constructor(e,n,i=I4){this.input=e;this.onQuit=n;this.prepare=i}input;onQuit;prepare;handlers=null;talking=!1;listening=!1;onKeypress=(e,n)=>{if(n.ctrl&&n.name==="c"){this.onQuit();return}n.name==="space"&&this.toggle()};listen(e){this.listening||(this.listening=!0,this.handlers=e,this.prepare(this.input),this.input.isTTY&&this.input.setRawMode&&this.input.setRawMode(!0),this.input.resume?.(),this.input.on("keypress",this.onKeypress))}close(){this.listening&&(this.listening=!1,this.input.removeListener("keypress",this.onKeypress),this.input.isTTY&&this.input.setRawMode&&this.input.setRawMode(!1),this.input.pause?.(),this.handlers=null)}toggle(){this.talking=!this.talking,this.talking?this.handlers?.onStart():this.handlers?.onEnd()}};function I4(t){E4(t)}var F4={start:"starting...",stop:"stopping...",restart:"restarting...",devices:"listing devices..."};function V4(){try{let t=j4(new URL("../package.json",import.meta.url),"utf8"),e=JSON.parse(t);return typeof e.version=="string"?e.version:"0.0.0"}catch{return"0.0.0"}}function Z4(t,e){let n=new du(t),i=n.notice();i!==null&&ue.err(`${i}
370
- `),n.isStale(Date.now())&&n.refreshInBackground();let r=!1,o=!1;try{let c=new Ge().resolved();r=Kk(c),o=c.defaults.modality==="text"}catch{}let s=M4(),a=c=>(B.debug("opening interactive session",{project:e.project,capabilities:c}),Dm().openSession({deviceId:s,projectId:e.project,clientCapabilities:c})),u=()=>Jk({stdin:process.stdin,io:ue,openSession:()=>a(["text"]),createReader:()=>new ku(process.stdin,process.stdout)});return Yk({stdin:process.stdin,io:ue,textOnly:e.textOnly||o,voiceConfigured:r,micAvailable:G4,openVoiceSession:()=>a(["text","audio-in","audio-out"]),runVoice:c=>B4(c,e),runText:u})}async function B4(t,e){let{DecibriCapture:n,DecibriPlayback:i}=await Promise.resolve().then(()=>(Rg(),zg)),r=new AbortController,o=e.ptt?new Ou(process.stdin,()=>r.abort()):void 0,s=()=>r.abort();process.once("SIGINT",s);try{await new Tu({session:t,capture:new n,playback:new i,io:ue,...o&&{pushToTalk:o},options:{halfDuplex:e.halfDuplex},signal:r.signal}).run()}finally{process.removeListener("SIGINT",s)}}async function G4(){try{let{hasInputDevice:t}=await Promise.resolve().then(()=>(Rg(),zg));return t()}catch(t){return B.debug("audio module unavailable; treating as no microphone",{error:t}),!1}}function W4(t){return{activate:e=>Z4(t,e),status:()=>new Tr(t).status(),upgrade:()=>new Tr(t).upgrade(),init:()=>new Su({config:new Ge,probe:new Pn}).run(),doctor:()=>new fu({config:new Ge,probe:new Pn,version:t}).run(),configList:()=>new Ar(new Ge).list(),configGet:e=>new Ar(new Ge).get(e),configSet:(e,n)=>new Ar(new Ge).set(e,n),configUnset:e=>new Ar(new Ge).unset(e),stub:e=>(ue.err(`${F4[e]??`${e}: not implemented yet`}
371
- `),0)}}try{let t=V4();process.exitCode=await aS(process.argv.slice(2),t,W4(t))}catch(t){B.error("jarvis failed",{error:t}),process.exitCode=1}
368
+ `),this.labelShown=!1,this.partialShown=!1;return}this.eraseStatusLine()}awaitPlaybackDrain(){let e=this.listenEpoch;this.playback.drained().then(()=>{this.cleanedUp||e!==this.listenEpoch||(this.printTurnSummary(),this.toListening())})}printTurnSummary(){if(B.getLevel()!=="debug")return;let{finalAtMs:e,firstTokenAtMs:n,firstAudioAtMs:i,playbackStartAtMs:r}=this.turnStats,o=[];e!==void 0&&n!==void 0&&o.push(`commit->token ${Lg(n-e)}`),n!==void 0&&i!==void 0&&o.push(`token->audio ${Lg(i-n)}`),r!==void 0&&o.push(`spoke ${Lg(Date.now()-r)}`),o.length!==0&&(this.eraseStatusLine(),this.io.out(N.dim(`turn ${o.join(", ")}`)+`
369
+ `))}toListening(){this.listenEpoch++,this.phase="listening",this.labelShown=!1,this.partialShown=!1,this.currentTurnId=void 0,this.renderStatus("listening")}async cleanup(){this.cleanedUp||(this.cleanedUp=!0,this.closeOpenLine(),this.signal?.removeEventListener("abort",this.onAbort),this.ptt?.close(),await this.capture.stop().catch(()=>{}),await this.playback.close().catch(()=>{}),await this.session.close().catch(()=>{}))}};import{emitKeypressEvents as MD}from"node:readline";var Fu=class{constructor(e,n,i=FD){this.input=e;this.onQuit=n;this.prepare=i}input;onQuit;prepare;handlers=null;talking=!1;listening=!1;onKeypress=(e,n)=>{if(n.ctrl&&n.name==="c"){this.onQuit();return}n.name==="space"&&this.toggle()};listen(e){this.listening||(this.listening=!0,this.handlers=e,this.prepare(this.input),this.input.isTTY&&this.input.setRawMode&&this.input.setRawMode(!0),this.input.resume?.(),this.input.on("keypress",this.onKeypress))}close(){this.listening&&(this.listening=!1,this.input.removeListener("keypress",this.onKeypress),this.input.isTTY&&this.input.setRawMode&&this.input.setRawMode(!1),this.input.pause?.(),this.handlers=null)}toggle(){this.talking=!this.talking,this.talking?this.handlers?.onStart():this.handlers?.onEnd()}};function FD(t){MD(t)}var t4={start:"starting...",stop:"stopping...",restart:"restarting...",devices:"listing devices..."};function r4(){try{let t=QD(new URL("../package.json",import.meta.url),"utf8"),e=JSON.parse(t);return typeof e.version=="string"?e.version:"0.0.0"}catch{return"0.0.0"}}function n4(t,e){let n=new wu(t),i=n.notice();i!==null&&ue.err(`${i}
370
+ `),n.isStale(Date.now())&&n.refreshInBackground();let r=!1,o=!1;try{let c=new We().resolved();r=iE(c),o=c.defaults.modality==="text"}catch{}let s=e4(),a=c=>(B.debug("opening interactive session",{project:e.project,capabilities:c}),Wm().openSession({deviceId:s,projectId:e.project,clientCapabilities:c})),u=()=>nE({stdin:process.stdin,io:ue,openSession:()=>a(["text"]),createReader:()=>new Lu(process.stdin,process.stdout)});return oE({stdin:process.stdin,io:ue,textOnly:e.textOnly||o,voiceConfigured:r,micAvailable:o4,openVoiceSession:()=>a(["text","audio-in","audio-out"]),runVoice:c=>i4(c,e),runText:u})}async function i4(t,e){let{DecibriCapture:n,DecibriPlayback:i}=await Promise.resolve().then(()=>(Fg(),Mg)),r=new AbortController,o=e.ptt?new Fu(process.stdin,()=>r.abort()):void 0,s=()=>r.abort();process.once("SIGINT",s);try{await new Mu({session:t,capture:new n,playback:new i,io:ue,...o&&{pushToTalk:o},options:{halfDuplex:e.halfDuplex},signal:r.signal}).run()}finally{process.removeListener("SIGINT",s)}}async function o4(){try{let{hasInputDevice:t}=await Promise.resolve().then(()=>(Fg(),Mg));return t()}catch(t){return B.debug("audio module unavailable; treating as no microphone",{error:t}),!1}}function s4(t){return{activate:e=>n4(t,e),status:()=>new Or(t).status(),upgrade:()=>new Or(t).upgrade(),init:()=>new Du({config:new We,probe:new Tn}).run(),doctor:()=>new Su({config:new We,probe:new Tn,version:t}).run(),configList:()=>new Pr(new We).list(),configGet:e=>new Pr(new We).get(e),configSet:(e,n)=>new Pr(new We).set(e,n),configUnset:e=>new Pr(new We).unset(e),stub:e=>(ue.err(`${t4[e]??`${e}: not implemented yet`}
371
+ `),0)}}try{let t=r4();process.exitCode=await mS(process.argv.slice(2),t,s4(t))}catch(t){B.error("jarvis failed",{error:t}),process.exitCode=1}