@neuvybe/jarvis 0.32.0 → 0.33.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.
- package/dist/index.js +172 -155
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,88 +1,100 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __cliCreateRequire } from 'node:module'; const require = __cliCreateRequire(import.meta.url);
|
|
3
|
-
var mk=Object.create;var uu=Object.defineProperty;var gk=Object.getOwnPropertyDescriptor;var vk=Object.getOwnPropertyNames;var yk=Object.getPrototypeOf,_k=Object.prototype.hasOwnProperty;var ce=(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 g=(t,e)=>()=>(t&&(e=t(t=0)),e);var N=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Je=(t,e)=>{for(var n in e)uu(t,n,{get:e[n],enumerable:!0})},bk=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of vk(e))!_k.call(t,r)&&r!==n&&uu(t,r,{get:()=>e[r],enumerable:!(i=gk(e,r))||i.enumerable});return t};var Ke=(t,e,n)=>(n=t!=null?mk(yk(t)):{},bk(e||!t||!t.__esModule?uu(n,"default",{value:t,enumerable:!0}):n,t));function $k(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 hv,lu,j,fv=g(()=>{"use strict";hv={debug:0,info:1,warn:2,error:3};lu=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(hv[e]<hv[this.level])return;let o=`[${new Date().toISOString()}] ${e.toUpperCase()}`,s=i!==void 0?`${o} ${n} ${$k(i)}`:`${o} ${n}`;e==="warn"?console.warn(s):console.error(s)}},j=new lu});var pv=g(()=>{"use strict"});var mv,du=g(()=>{"use strict";mv="JARVIS_HOME"});function m(t,e,n){function i(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,c);let u=s.prototype,l=Object.keys(u);for(let d=0;d<l.length;d++){let h=l[d];h in a||(a[h]=u[h].bind(a))}}let r=n?.Parent??Object;class o extends r{}Object.defineProperty(o,"name",{value:t});function s(a){var c;let u=n?.Parent?new o:this;i(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}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 se(t){return t&&Object.assign(hr,t),hr}var gv,hu,fu,at,Vt,hr,fr=g(()=>{hu=Object.freeze({status:"aborted"});fu=Symbol("zod_brand"),at=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Vt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(gv=globalThis).__zod_globalConfig??(gv.__zod_globalConfig={});hr=globalThis.__zod_globalConfig});var S={};Je(S,{BIGINT_FORMAT_RANGES:()=>xu,Class:()=>mu,NUMBER_FORMAT_RANGES:()=>wu,aborted:()=>Wt,allowsEval:()=>yu,assert:()=>Ik,assertEqual:()=>wk,assertIs:()=>Sk,assertNever:()=>Ek,assertNotEqual:()=>xk,assignProp:()=>Bt,base64ToUint8Array:()=>yv,base64urlToUint8Array:()=>Zk,cached:()=>Jr,captureStackTrace:()=>Ro,cleanEnum:()=>Vk,cleanRegex:()=>ti,clone:()=>Ae,cloneDef:()=>Tk,createTransparentProxy:()=>Nk,defineLazy:()=>B,esc:()=>Co,escapeRegex:()=>Ye,explicitlyAborted:()=>Su,extend:()=>Mk,finalizeIssue:()=>Oe,floatSafeRemainder:()=>gu,getElementAtPath:()=>Ak,getEnumValues:()=>ei,getLengthableOrigin:()=>ii,getParsedType:()=>Rk,getSizableOrigin:()=>ni,hexToUint8Array:()=>Gk,isObject:()=>pr,isPlainObject:()=>Gt,issue:()=>Kr,joinValues:()=>v,jsonStringifyReplacer:()=>qr,merge:()=>Uk,mergeDefs:()=>xt,normalizeParams:()=>E,nullish:()=>Zt,numKeys:()=>Ck,objectClone:()=>kk,omit:()=>Lk,optionalKeys:()=>$u,parsedType:()=>w,partial:()=>jk,pick:()=>Dk,prefixIssues:()=>Le,primitiveTypes:()=>bu,promiseAllObject:()=>Ok,propertyKeyTypes:()=>ri,randomString:()=>Pk,required:()=>Fk,safeExtend:()=>zk,shallowClone:()=>_u,slugify:()=>vu,stringifyPrimitive:()=>b,uint8ArrayToBase64:()=>_v,uint8ArrayToBase64url:()=>Bk,uint8ArrayToHex:()=>Wk,unwrapMessage:()=>Qn});function wk(t){return t}function xk(t){return t}function Sk(t){}function Ek(t){throw new Error("Unexpected value in exhaustive check")}function Ik(t){}function ei(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 v(t,e="|"){return t.map(n=>b(n)).join(e)}function qr(t,e){return typeof e=="bigint"?e.toString():e}function Jr(t){return{get value(){{let n=t();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function Zt(t){return t==null}function ti(t){let e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}function gu(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 B(t,e,n){let i;Object.defineProperty(t,e,{get(){if(i!==vv)return i===void 0&&(i=vv,i=n()),i},set(r){Object.defineProperty(t,e,{value:r})},configurable:!0})}function kk(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function Bt(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}function xt(...t){let e={};for(let n of t){let i=Object.getOwnPropertyDescriptors(n);Object.assign(e,i)}return Object.defineProperties({},e)}function Tk(t){return xt(t._zod.def)}function Ak(t,e){return e?e.reduce((n,i)=>n?.[i],t):t}function Ok(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 Pk(t=10){let e="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<t;i++)n+=e[Math.floor(Math.random()*e.length)];return n}function Co(t){return JSON.stringify(t)}function vu(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function pr(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Gt(t){if(pr(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let n=e.prototype;return!(pr(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function _u(t){return Gt(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function Ck(t){let e=0;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function Ye(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ae(t,e,n){let i=new t._zod.constr(e??t._zod.def);return(!e||n?.parent)&&(i._zod.parent=t),i}function E(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 Nk(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 $u(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function Dk(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=xt(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 Bt(this,"shape",s),s},checks:[]});return Ae(t,o)}function Lk(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=xt(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 Bt(this,"shape",s),s},checks:[]});return Ae(t,o)}function Mk(t,e){if(!Gt(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=xt(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return Bt(this,"shape",o),o}});return Ae(t,r)}function zk(t,e){if(!Gt(e))throw new Error("Invalid input to safeExtend: expected a plain object");let n=xt(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e};return Bt(this,"shape",i),i}});return Ae(t,n)}function Uk(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=xt(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e._zod.def.shape};return Bt(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Ae(t,n)}function jk(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=xt(e._zod.def,{get shape(){let a=e._zod.def.shape,c={...a};if(n)for(let u in n){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(c[u]=t?new t({type:"optional",innerType:a[u]}):a[u])}else for(let u in a)c[u]=t?new t({type:"optional",innerType:a[u]}):a[u];return Bt(this,"shape",c),c},checks:[]});return Ae(e,s)}function Fk(t,e,n){let i=xt(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 Bt(this,"shape",o),o}});return Ae(e,i)}function Wt(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 Su(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 Le(t,e){return e.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(t),n})}function Qn(t){return typeof t=="string"?t:t?.message}function Oe(t,e,n){let i=t.message?t.message:Qn(t.inst?._zod.def?.error?.(t))??Qn(e?.error?.(t))??Qn(n.customError?.(t))??Qn(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 ni(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function ii(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function w(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 Kr(...t){let[e,n,i]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:i}:{...e}}function Vk(t){return Object.entries(t).filter(([e,n])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function yv(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 _v(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}function Zk(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-e.length%4)%4);return yv(e+n)}function Bk(t){return _v(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Gk(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 Wk(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var vv,Ro,yu,Rk,ri,bu,wu,xu,mu,D=g(()=>{fr();vv=Symbol("evaluating");Ro="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};yu=Jr(()=>{if(hr.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});Rk=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}`)}},ri=new Set(["string","number","symbol"]),bu=new Set(["string","number","bigint","boolean","symbol","undefined"]);wu={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]},xu={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};mu=class{constructor(...e){}}});function si(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 ai(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 c=n,u=0;for(;u<a.length;){let l=a[u];u===a.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(e(s))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}}};return i(t),n}function Eu(t,e=n=>n.message){let n={errors:[]},i=(r,o=[])=>{var s,a;for(let c of r.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>i({issues:u},[...o,...c.path]));else if(c.code==="invalid_key")i({issues:c.issues},[...o,...c.path]);else if(c.code==="invalid_element")i({issues:c.issues},[...o,...c.path]);else{let u=[...o,...c.path];if(u.length===0){n.errors.push(e(c));continue}let l=n,d=0;for(;d<u.length;){let h=u[d],f=d===u.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(c)),d++}}};return i(t),n}function $v(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 Iu(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 ${$v(i.path)}`);return e.join(`
|
|
4
|
-
`)}var bv,oi,Me,ku=g(()=>{fr();D();bv=(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,qr,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},oi=m("$ZodError",bv),Me=m("$ZodError",bv,{Parent:Error})});var Yr,No,Xr,Do,Qr,Tu,en,Au,Lo,qk,Mo,Jk,zo,Kk,Uo,Yk,jo,Xk,Fo,Qk,Vo,e1,Zo,t1,Ou=g(()=>{fr();ku();D();Yr=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 at;if(s.issues.length){let a=new(r?.Err??t)(s.issues.map(c=>Oe(c,o,se())));throw Ro(a,r?.callee),a}return s.value},No=Yr(Me),Xr=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(c=>Oe(c,o,se())));throw Ro(a,r?.callee),a}return s.value},Do=Xr(Me),Qr=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 at;return o.issues.length?{success:!1,error:new(t??oi)(o.issues.map(s=>Oe(s,r,se())))}:{success:!0,data:o.value}},Tu=Qr(Me),en=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=>Oe(s,r,se())))}:{success:!0,data:o.value}},Au=en(Me),Lo=t=>(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Yr(t)(e,n,r)},qk=Lo(Me),Mo=t=>(e,n,i)=>Yr(t)(e,n,i),Jk=Mo(Me),zo=t=>async(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Xr(t)(e,n,r)},Kk=zo(Me),Uo=t=>async(e,n,i)=>Xr(t)(e,n,i),Yk=Uo(Me),jo=t=>(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Qr(t)(e,n,r)},Xk=jo(Me),Fo=t=>(e,n,i)=>Qr(t)(e,n,i),Qk=Fo(Me),Vo=t=>async(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return en(t)(e,n,r)},e1=Vo(Me),Zo=t=>async(e,n,i)=>en(t)(e,n,i),t1=Zo(Me)});var Ge={};Je(Ge,{base64:()=>Wu,base64url:()=>Bo,bigint:()=>Qu,boolean:()=>tl,browserEmail:()=>u1,cidrv4:()=>Bu,cidrv6:()=>Gu,cuid:()=>Pu,cuid2:()=>Cu,date:()=>Ju,datetime:()=>Yu,domain:()=>h1,duration:()=>Mu,e164:()=>qu,email:()=>Uu,emoji:()=>ju,extendedDuration:()=>r1,guid:()=>zu,hex:()=>f1,hostname:()=>d1,html5Email:()=>s1,httpProtocol:()=>Hu,idnEmail:()=>c1,integer:()=>el,ipv4:()=>Fu,ipv6:()=>Vu,ksuid:()=>Du,lowercase:()=>il,mac:()=>Zu,md5_base64:()=>m1,md5_base64url:()=>g1,md5_hex:()=>p1,nanoid:()=>Lu,null:()=>rl,number:()=>Go,rfc5322Email:()=>a1,sha1_base64:()=>y1,sha1_base64url:()=>_1,sha1_hex:()=>v1,sha256_base64:()=>$1,sha256_base64url:()=>w1,sha256_hex:()=>b1,sha384_base64:()=>S1,sha384_base64url:()=>E1,sha384_hex:()=>x1,sha512_base64:()=>k1,sha512_base64url:()=>T1,sha512_hex:()=>I1,string:()=>Xu,time:()=>Ku,ulid:()=>Ru,undefined:()=>nl,unicodeEmail:()=>wv,uppercase:()=>ol,uuid:()=>mr,uuid4:()=>n1,uuid6:()=>i1,uuid7:()=>o1,xid:()=>Nu});function ju(){return new RegExp(l1,"u")}function Sv(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 Ku(t){return new RegExp(`^${Sv(t)}$`)}function Yu(t){let e=Sv({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(`^${xv}T(?:${i})$`)}function ci(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function ui(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var Pu,Cu,Ru,Nu,Du,Lu,Mu,r1,zu,mr,n1,i1,o1,Uu,s1,a1,wv,c1,u1,l1,Fu,Vu,Zu,Bu,Gu,Wu,Bo,d1,h1,Hu,qu,xv,Ju,Xu,Qu,el,Go,tl,rl,nl,il,ol,f1,p1,m1,g1,v1,y1,_1,b1,$1,w1,x1,S1,E1,I1,k1,T1,Wo=g(()=>{D();Pu=/^[cC][0-9a-z]{6,}$/,Cu=/^[0-9a-z]+$/,Ru=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Nu=/^[0-9a-vA-V]{20}$/,Du=/^[A-Za-z0-9]{27}$/,Lu=/^[a-zA-Z0-9_-]{21}$/,Mu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,r1=/^[-+]?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)?)??$/,zu=/^([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})$/,mr=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)$/,n1=mr(4),i1=mr(6),o1=mr(7),Uu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,s1=/^[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])?)*$/,a1=/^(([^<>()\[\]\\.,;:\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,}))$/,wv=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,c1=wv,u1=/^[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])?)*$/,l1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";Fu=/^(?:(?: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])$/,Vu=/^(([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}|:))$/,Zu=t=>{let e=Ye(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},Bu=/^((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])$/,Gu=/^(([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])$/,Wu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Bo=/^[A-Za-z0-9_-]*$/,d1=/^(?=.{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])?)*\.?$/,h1=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Hu=/^https?$/,qu=/^\+[1-9]\d{6,14}$/,xv="(?:(?:\\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])))",Ju=new RegExp(`^${xv}$`);Xu=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Qu=/^-?\d+n?$/,el=/^-?\d+$/,Go=/^-?\d+(?:\.\d+)?$/,tl=/^(?:true|false)$/i,rl=/^null$/i,nl=/^undefined$/i,il=/^[^A-Z]*$/,ol=/^[^a-z]*$/,f1=/^[0-9a-fA-F]*$/;p1=/^[0-9a-fA-F]{32}$/,m1=ci(22,"=="),g1=ui(22),v1=/^[0-9a-fA-F]{40}$/,y1=ci(27,"="),_1=ui(27),b1=/^[0-9a-fA-F]{64}$/,$1=ci(43,"="),w1=ui(43),x1=/^[0-9a-fA-F]{96}$/,S1=ci(64,""),E1=ui(64),I1=/^[0-9a-fA-F]{128}$/,k1=ci(86,"=="),T1=ui(86)});function Ev(t,e,n){t.issues.length&&e.issues.push(...Le(n,t.issues))}var X,Iv,Ho,qo,sl,al,cl,ul,ll,dl,hl,fl,pl,tn,ml,gl,vl,yl,_l,bl,$l,wl,xl,Jo=g(()=>{fr();Wo();D();X=m("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),Iv={number:"number",bigint:"bigint",object:"date"},Ho=m("$ZodCheckLessThan",(t,e)=>{X.init(t,e);let n=Iv[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})}}),qo=m("$ZodCheckGreaterThan",(t,e)=>{X.init(t,e);let n=Iv[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})}}),sl=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):gu(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})}}),al=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]=wu[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=el)}),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})}}),cl=m("$ZodCheckBigIntFormat",(t,e)=>{X.init(t,e);let[n,i]=xu[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})}}),ul=m("$ZodCheckMaxSize",(t,e)=>{var n;X.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!Zt(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:ni(r),code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),ll=m("$ZodCheckMinSize",(t,e)=>{var n;X.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!Zt(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:ni(r),code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),dl=m("$ZodCheckSizeEquals",(t,e)=>{var n;X.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!Zt(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:ni(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})}}),hl=m("$ZodCheckMaxLength",(t,e)=>{var n;X.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!Zt(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=ii(r);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),fl=m("$ZodCheckMinLength",(t,e)=>{var n;X.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!Zt(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=ii(r);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),pl=m("$ZodCheckLengthEquals",(t,e)=>{var n;X.init(t,e),(n=t._zod.def).when??(n.when=i=>{let r=i.value;return!Zt(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=ii(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})}}),tn=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=()=>{})}),ml=m("$ZodCheckRegex",(t,e)=>{tn.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})}}),gl=m("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=il),tn.init(t,e)}),vl=m("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=ol),tn.init(t,e)}),yl=m("$ZodCheckIncludes",(t,e)=>{X.init(t,e);let n=Ye(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})}}),_l=m("$ZodCheckStartsWith",(t,e)=>{X.init(t,e);let n=new RegExp(`^${Ye(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})}}),bl=m("$ZodCheckEndsWith",(t,e)=>{X.init(t,e);let n=new RegExp(`.*${Ye(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})}});$l=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=>Ev(r,n,e.property));Ev(i,n,e.property)}}),wl=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})}}),xl=m("$ZodCheckOverwrite",(t,e)=>{X.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}})});var li,Sl=g(()=>{li=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
|
-
`).filter(s=>s),
|
|
6
|
-
`))}}});var El,Il=g(()=>{El={major:4,minor:4,patch:3}});function ql(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function Vv(t){if(!Bo.test(t))return!1;let e=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return ql(n)}function Zv(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 Tv(t,e,n){t.issues.length&&e.issues.push(...Le(n,t.issues)),e.value[n]=t.value}function Qo(t,e,n,i,r,o){let s=n in i;if(t.issues.length){if(r&&o&&!s)return;e.issues.push(...Le(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 Bv(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=$u(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}}function Gv(t,e,n,i,r,o){let s=[],a=r.keySet,c=r.catchall._zod,u=c.def.type,l=c.optin==="optional",d=c.optout==="optional";for(let h in e){if(h==="__proto__"||a.has(h))continue;if(u==="never"){s.push(h);continue}let f=c.run({value:e[h],issues:[]},i);f instanceof Promise?t.push(f.then(p=>Qo(p,n,h,e,l,d))):Qo(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 Av(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=>!Wt(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=>Oe(s,i,se())))}),e)}function Ov(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=>Oe(s,i,se())))}):e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:[],inclusive:!1}),e)}function kl(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(Gt(t)&&Gt(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=kl(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=kl(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 Pv(t,e,n){let i=new Map,r;for(let a of e.issues)if(a.code==="unrecognized_keys"){r??(r=a);for(let c of a.keys)i.has(c)||i.set(c,{}),i.get(c).l=!0}else t.issues.push(a);for(let a of n.issues)if(a.code==="unrecognized_keys")for(let c of a.keys)i.has(c)||i.set(c,{}),i.get(c).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}),Wt(t))return t;let s=kl(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 Rv(t,e,n){t.issues.length&&e.issues.push(...Le(n,t.issues)),e.value[n]=t.value}function Nv(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(...Le(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 Dv(t,e,n,i,r,o,s){t.issues.length&&(ri.has(typeof i)?n.issues.push(...Le(i,t.issues)):n.issues.push({code:"invalid_key",origin:"map",input:r,inst:o,issues:t.issues.map(a=>Oe(a,s,se()))})),e.issues.length&&(ri.has(typeof i)?n.issues.push(...Le(i,e.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:o,key:i,issues:e.issues.map(a=>Oe(a,s,se()))})),n.value.set(t.value,e.value)}function Lv(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}function Mv(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}function zv(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function Uv(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 Ko(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 Yo(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=>Xo(t,o,e.out,n)):Xo(t,r,e.out,n)}else{let r=e.reverseTransform(t.value,t);return r instanceof Promise?r.then(o=>Xo(t,o,e.in,n)):Xo(t,r,e.in,n)}}function Xo(t,e,n,i){return t.issues.length?(t.aborted=!0,t):n._zod.run({value:e,issues:t.issues},i)}function jv(t){return t.value=Object.freeze(t.value),t}function Fv(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(Kr(r))}}var M,gr,q,Tl,Al,Ol,Pl,Cl,Rl,Nl,Dl,Ll,Ml,zl,Ul,jl,Fl,Vl,Zl,Bl,Gl,Wl,Hl,Jl,Kl,Yl,Xl,Ql,es,ed,di,ts,td,rd,nd,id,od,sd,ad,cd,ud,ld,Wv,dd,hi,hd,fd,pd,rs,md,gd,vd,yd,_d,bd,$d,ns,wd,xd,Sd,Ed,Id,kd,Td,Ad,is,fi,Od,Pd,Cd,Rd,Nd,Dd,Ld,Md=g(()=>{Jo();fr();Sl();Ou();Wo();D();Il();D();M=m("$ZodType",(t,e)=>{var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=El;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,c)=>{let u=Wt(s),l;for(let d of a){if(d._zod.def.when){if(Su(s)||!d._zod.def.when(s))continue}else if(u)continue;let h=s.issues.length,f=d._zod.check(s);if(f instanceof Promise&&c?.async===!1)throw new at;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await f,s.issues.length!==h&&(u||(u=Wt(s,h)))});else{if(s.issues.length===h)continue;u||(u=Wt(s,h))}}return l?l.then(()=>s):s},o=(s,a,c)=>{if(Wt(s))return s.aborted=!0,s;let u=r(a,i,c);if(u instanceof Promise){if(c.async===!1)throw new at;return u.then(l=>t._zod.parse(l,c))}return t._zod.parse(u,c)};t._zod.run=(s,a)=>{if(a.skipChecks)return t._zod.parse(s,a);if(a.direction==="backward"){let u=t._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(l=>o(l,s,a)):o(u,s,a)}let c=t._zod.parse(s,a);if(c instanceof Promise){if(a.async===!1)throw new at;return c.then(u=>r(u,i,a))}return r(c,i,a)}}B(t,"~standard",()=>({validate:r=>{try{let o=Tu(t,r);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return Au(t,r).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),gr=m("$ZodString",(t,e)=>{M.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Xu(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}}),q=m("$ZodStringFormat",(t,e)=>{tn.init(t,e),gr.init(t,e)}),Tl=m("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=zu),q.init(t,e)}),Al=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=mr(i))}else e.pattern??(e.pattern=mr());q.init(t,e)}),Ol=m("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Uu),q.init(t,e)}),Pl=m("$ZodURL",(t,e)=>{q.init(t,e),t._zod.check=n=>{try{let i=n.value.trim();if(!e.normalize&&e.protocol?.source===Hu.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})}}}),Cl=m("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=ju()),q.init(t,e)}),Rl=m("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Lu),q.init(t,e)}),Nl=m("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Pu),q.init(t,e)}),Dl=m("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Cu),q.init(t,e)}),Ll=m("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Ru),q.init(t,e)}),Ml=m("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Nu),q.init(t,e)}),zl=m("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Du),q.init(t,e)}),Ul=m("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Yu(e)),q.init(t,e)}),jl=m("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Ju),q.init(t,e)}),Fl=m("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Ku(e)),q.init(t,e)}),Vl=m("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Mu),q.init(t,e)}),Zl=m("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Fu),q.init(t,e),t._zod.bag.format="ipv4"}),Bl=m("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Vu),q.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=Zu(e.delimiter)),q.init(t,e),t._zod.bag.format="mac"}),Wl=m("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Bu),q.init(t,e)}),Hl=m("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Gu),q.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})}}});Jl=m("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Wu),q.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=n=>{ql(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}});Kl=m("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Bo),q.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=n=>{Vv(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),Yl=m("$ZodE164",(t,e)=>{e.pattern??(e.pattern=qu),q.init(t,e)});Xl=m("$ZodJWT",(t,e)=>{q.init(t,e),t._zod.check=n=>{Zv(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),Ql=m("$ZodCustomStringFormat",(t,e)=>{q.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})}}),es=m("$ZodNumber",(t,e)=>{M.init(t,e),t._zod.pattern=t._zod.bag.pattern??Go,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}}),ed=m("$ZodNumberFormat",(t,e)=>{al.init(t,e),es.init(t,e)}),di=m("$ZodBoolean",(t,e)=>{M.init(t,e),t._zod.pattern=tl,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}}),ts=m("$ZodBigInt",(t,e)=>{M.init(t,e),t._zod.pattern=Qu,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}}),td=m("$ZodBigIntFormat",(t,e)=>{cl.init(t,e),ts.init(t,e)}),rd=m("$ZodSymbol",(t,e)=>{M.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}}),nd=m("$ZodUndefined",(t,e)=>{M.init(t,e),t._zod.pattern=nl,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}}),id=m("$ZodNull",(t,e)=>{M.init(t,e),t._zod.pattern=rl,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}}),od=m("$ZodAny",(t,e)=>{M.init(t,e),t._zod.parse=n=>n}),sd=m("$ZodUnknown",(t,e)=>{M.init(t,e),t._zod.parse=n=>n}),ad=m("$ZodNever",(t,e)=>{M.init(t,e),t._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)}),cd=m("$ZodVoid",(t,e)=>{M.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}}),ud=m("$ZodDate",(t,e)=>{M.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}});ld=m("$ZodArray",(t,e)=>{M.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],c=e.element._zod.run({value:a,issues:[]},i);c instanceof Promise?o.push(c.then(u=>Tv(u,n,s))):Tv(c,n,s)}return o.length?Promise.all(o).then(()=>n):n}});Wv=m("$ZodObject",(t,e)=>{if(M.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let c={...a};return Object.defineProperty(e,"shape",{value:c}),c}})}let i=Jr(()=>Bv(e));B(t._zod,"propValues",()=>{let a=e.shape,c={};for(let u in a){let l=a[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(let d of l.values)c[u].add(d)}}return c});let r=pr,o=e.catchall,s;t._zod.parse=(a,c)=>{s??(s=i.value);let u=a.value;if(!r(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,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",y=f._zod.optout==="optional",$=f._zod.run({value:u[h],issues:[]},c);$ instanceof Promise?l.push($.then(I=>Qo(I,a,h,u,p,y))):Qo($,a,h,u,p,y)}return o?Gv(l,u,a,c,i.value,t):l.length?Promise.all(l).then(()=>a):a}}),dd=m("$ZodObjectJIT",(t,e)=>{Wv.init(t,e);let n=t._zod.parse,i=Jr(()=>Bv(e)),r=h=>{let f=new li(["shape","payload","ctx"]),p=i.value,y=O=>{let x=Co(O);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};f.write("const input = payload.value;");let $=Object.create(null),I=0;for(let O of p.keys)$[O]=`key_${I++}`;f.write("const newResult = {};");for(let O of p.keys){let x=$[O],k=Co(O),z=h[O],U=z?._zod?.optin==="optional",H=z?._zod?.optout==="optional";f.write(`const ${x} = ${y(O)};`),U&&H?f.write(`
|
|
7
|
-
if (${
|
|
8
|
-
if (${
|
|
9
|
-
payload.issues = payload.issues.concat(${
|
|
3
|
+
var PI=Object.create;var mu=Object.defineProperty;var CI=Object.getOwnPropertyDescriptor;var RI=Object.getOwnPropertyNames;var DI=Object.getPrototypeOf,NI=Object.prototype.hasOwnProperty;var ue=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var g=(t,e)=>()=>(t&&(e=t(t=0)),e);var D=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Je=(t,e)=>{for(var r in e)mu(t,r,{get:e[r],enumerable:!0})},LI=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of RI(e))!NI.call(t,n)&&n!==r&&mu(t,n,{get:()=>e[n],enumerable:!(i=CI(e,n))||i.enumerable});return t};var Ke=(t,e,r)=>(r=t!=null?PI(DI(t)):{},LI(e||!t||!t.__esModule?mu(r,"default",{value:t,enumerable:!0}):r,t));function MI(t){try{return JSON.stringify(t,(e,r)=>r instanceof Error?{name:r.name,message:r.message,stack:r.stack}:r)}catch{return"[unserializable meta]"}}var bv,gu,j,$v=g(()=>{"use strict";bv={debug:0,info:1,warn:2,error:3};gu=class{level;constructor(e="info"){this.level=e}setLevel(e){this.level=e}getLevel(){return this.level}debug(e,r){this.emit("debug",e,r)}info(e,r){this.emit("info",e,r)}warn(e,r){this.emit("warn",e,r)}error(e,r){this.emit("error",e,r)}emit(e,r,i){if(bv[e]<bv[this.level])return;let o=`[${new Date().toISOString()}] ${e.toUpperCase()}`,s=i!==void 0?`${o} ${r} ${MI(i)}`:`${o} ${r}`;e==="warn"?console.warn(s):console.error(s)}},j=new gu});var wv=g(()=>{"use strict"});var xv,vu=g(()=>{"use strict";xv="JARVIS_HOME"});function m(t,e,r){function i(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,c);let u=s.prototype,l=Object.keys(u);for(let d=0;d<l.length;d++){let h=l[d];h in a||(a[h]=u[h].bind(a))}}let n=r?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:t});function s(a){var c;let u=r?.Parent?new o:this;i(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(t)}),Object.defineProperty(s,"name",{value:t}),s}function ae(t){return t&&Object.assign(fr,t),fr}var Sv,yu,_u,at,Vt,fr,pr=g(()=>{yu=Object.freeze({status:"aborted"});_u=Symbol("zod_brand"),at=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Vt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(Sv=globalThis).__zod_globalConfig??(Sv.__zod_globalConfig={});fr=globalThis.__zod_globalConfig});var S={};Je(S,{BIGINT_FORMAT_RANGES:()=>Au,Class:()=>$u,NUMBER_FORMAT_RANGES:()=>Tu,aborted:()=>Wt,allowsEval:()=>Su,assert:()=>VI,assertEqual:()=>zI,assertIs:()=>jI,assertNever:()=>FI,assertNotEqual:()=>UI,assignProp:()=>Bt,base64ToUint8Array:()=>kv,base64urlToUint8Array:()=>oT,cached:()=>Jr,captureStackTrace:()=>Ro,cleanEnum:()=>iT,cleanRegex:()=>ti,clone:()=>Oe,cloneDef:()=>BI,createTransparentProxy:()=>KI,defineLazy:()=>B,esc:()=>Co,escapeRegex:()=>Ye,explicitlyAborted:()=>Ou,extend:()=>QI,finalizeIssue:()=>Pe,floatSafeRemainder:()=>wu,getElementAtPath:()=>GI,getEnumValues:()=>ei,getLengthableOrigin:()=>ii,getParsedType:()=>JI,getSizableOrigin:()=>ni,hexToUint8Array:()=>aT,isObject:()=>mr,isPlainObject:()=>Gt,issue:()=>Kr,joinValues:()=>v,jsonStringifyReplacer:()=>qr,merge:()=>tT,mergeDefs:()=>xt,normalizeParams:()=>I,nullish:()=>Zt,numKeys:()=>qI,objectClone:()=>ZI,omit:()=>XI,optionalKeys:()=>Iu,parsedType:()=>x,partial:()=>rT,pick:()=>YI,prefixIssues:()=>Me,primitiveTypes:()=>ku,promiseAllObject:()=>WI,propertyKeyTypes:()=>ri,randomString:()=>HI,required:()=>nT,safeExtend:()=>eT,shallowClone:()=>Eu,slugify:()=>xu,stringifyPrimitive:()=>w,uint8ArrayToBase64:()=>Iv,uint8ArrayToBase64url:()=>sT,uint8ArrayToHex:()=>cT,unwrapMessage:()=>Qn});function zI(t){return t}function UI(t){return t}function jI(t){}function FI(t){throw new Error("Unexpected value in exhaustive check")}function VI(t){}function ei(t){let e=Object.values(t).filter(i=>typeof i=="number");return Object.entries(t).filter(([i,n])=>e.indexOf(+i)===-1).map(([i,n])=>n)}function v(t,e="|"){return t.map(r=>w(r)).join(e)}function qr(t,e){return typeof e=="bigint"?e.toString():e}function Jr(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Zt(t){return t==null}function ti(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function wu(t,e){let r=t/e,i=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-i)<n?0:r-i}function B(t,e,r){let i;Object.defineProperty(t,e,{get(){if(i!==Ev)return i===void 0&&(i=Ev,i=r()),i},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function ZI(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function Bt(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function xt(...t){let e={};for(let r of t){let i=Object.getOwnPropertyDescriptors(r);Object.assign(e,i)}return Object.defineProperties({},e)}function BI(t){return xt(t._zod.def)}function GI(t,e){return e?e.reduce((r,i)=>r?.[i],t):t}function WI(t){let e=Object.keys(t),r=e.map(i=>t[i]);return Promise.all(r).then(i=>{let n={};for(let o=0;o<e.length;o++)n[e[o]]=i[o];return n})}function HI(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<t;i++)r+=e[Math.floor(Math.random()*e.length)];return r}function Co(t){return JSON.stringify(t)}function xu(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function mr(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Gt(t){if(mr(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(mr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Eu(t){return Gt(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function qI(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}function Ye(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Oe(t,e,r){let i=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(i._zod.parent=t),i}function I(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 KI(t){let e;return new Proxy({},{get(r,i,n){return e??(e=t()),Reflect.get(e,i,n)},set(r,i,n,o){return e??(e=t()),Reflect.set(e,i,n,o)},has(r,i){return e??(e=t()),Reflect.has(e,i)},deleteProperty(r,i){return e??(e=t()),Reflect.deleteProperty(e,i)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,i){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(r,i,n){return e??(e=t()),Reflect.defineProperty(e,i,n)}})}function w(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Iu(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function YI(t,e){let r=t._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=xt(t._zod.def,{get shape(){let s={};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(s[a]=r.shape[a])}return Bt(this,"shape",s),s},checks:[]});return Oe(t,o)}function XI(t,e){let r=t._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=xt(t._zod.def,{get shape(){let s={...t._zod.def.shape};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete s[a]}return Bt(this,"shape",s),s},checks:[]});return Oe(t,o)}function QI(t,e){if(!Gt(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.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 n=xt(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return Bt(this,"shape",o),o}});return Oe(t,n)}function eT(t,e){if(!Gt(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=xt(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e};return Bt(this,"shape",i),i}});return Oe(t,r)}function tT(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=xt(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e._zod.def.shape};return Bt(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Oe(t,r)}function rT(t,e,r){let n=e._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=xt(e._zod.def,{get shape(){let a=e._zod.def.shape,c={...a};if(r)for(let u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=t?new t({type:"optional",innerType:a[u]}):a[u])}else for(let u in a)c[u]=t?new t({type:"optional",innerType:a[u]}):a[u];return Bt(this,"shape",c),c},checks:[]});return Oe(e,s)}function nT(t,e,r){let i=xt(e._zod.def,{get shape(){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new t({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new t({type:"nonoptional",innerType:n[s]});return Bt(this,"shape",o),o}});return Oe(e,i)}function Wt(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function Ou(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue===!1)return!0;return!1}function Me(t,e){return e.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(t),r})}function Qn(t){return typeof t=="string"?t:t?.message}function Pe(t,e,r){let i=t.message?t.message:Qn(t.inst?._zod.def?.error?.(t))??Qn(e?.error?.(t))??Qn(r.customError?.(t))??Qn(r.localeError?.(t))??"Invalid input",{inst:n,continue:o,input:s,...a}=t;return a.path??(a.path=[]),a.message=i,e?.reportInput&&(a.input=s),a}function ni(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function ii(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function x(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function Kr(...t){let[e,r,i]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:{...e}}function iT(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function kv(t){let e=atob(t),r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return r}function Iv(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function oT(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return kv(e+r)}function sT(t){return Iv(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function aT(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)r[i/2]=Number.parseInt(e.slice(i,i+2),16);return r}function cT(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var Ev,Ro,Su,JI,ri,ku,Tu,Au,$u,N=g(()=>{pr();Ev=Symbol("evaluating");Ro="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};Su=Jr(()=>{if(fr.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});JI=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}`)}},ri=new Set(["string","number","symbol"]),ku=new Set(["string","number","bigint","boolean","symbol","undefined"]);Tu={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]},Au={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};$u=class{constructor(...e){}}});function si(t,e=r=>r.message){let r={},i=[];for(let n of t.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:r}}function ai(t,e=r=>r.message){let r={_errors:[]},i=(n,o=[])=>{for(let s of n.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)r._errors.push(e(s));else{let c=r,u=0;for(;u<a.length;){let l=a[u];u===a.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(e(s))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}}};return i(t),r}function Pu(t,e=r=>r.message){let r={errors:[]},i=(n,o=[])=>{var s,a;for(let c of n.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>i({issues:u},[...o,...c.path]));else if(c.code==="invalid_key")i({issues:c.issues},[...o,...c.path]);else if(c.code==="invalid_element")i({issues:c.issues},[...o,...c.path]);else{let u=[...o,...c.path];if(u.length===0){r.errors.push(e(c));continue}let l=r,d=0;for(;d<u.length;){let h=u[d],f=d===u.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(c)),d++}}};return i(t),r}function Av(t){let e=[],r=t.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function Cu(t){let e=[],r=[...t.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of r)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${Av(i.path)}`);return e.join(`
|
|
4
|
+
`)}var Tv,oi,ze,Ru=g(()=>{pr();N();Tv=(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,qr,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},oi=m("$ZodError",Tv),ze=m("$ZodError",Tv,{Parent:Error})});var Yr,Do,Xr,No,Qr,Du,en,Nu,Lo,lT,Mo,dT,zo,hT,Uo,fT,jo,pT,Fo,mT,Vo,gT,Zo,vT,Lu=g(()=>{pr();Ru();N();Yr=t=>(e,r,i,n)=>{let o=i?{...i,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new at;if(s.issues.length){let a=new(n?.Err??t)(s.issues.map(c=>Pe(c,o,ae())));throw Ro(a,n?.callee),a}return s.value},Do=Yr(ze),Xr=t=>async(e,r,i,n)=>{let o=i?{...i,async:!0}:{async:!0},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(n?.Err??t)(s.issues.map(c=>Pe(c,o,ae())));throw Ro(a,n?.callee),a}return s.value},No=Xr(ze),Qr=t=>(e,r,i)=>{let n=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:r,issues:[]},n);if(o instanceof Promise)throw new at;return o.issues.length?{success:!1,error:new(t??oi)(o.issues.map(s=>Pe(s,n,ae())))}:{success:!0,data:o.value}},Du=Qr(ze),en=t=>async(e,r,i)=>{let n=i?{...i,async:!0}:{async:!0},o=e._zod.run({value:r,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new t(o.issues.map(s=>Pe(s,n,ae())))}:{success:!0,data:o.value}},Nu=en(ze),Lo=t=>(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Yr(t)(e,r,n)},lT=Lo(ze),Mo=t=>(e,r,i)=>Yr(t)(e,r,i),dT=Mo(ze),zo=t=>async(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Xr(t)(e,r,n)},hT=zo(ze),Uo=t=>async(e,r,i)=>Xr(t)(e,r,i),fT=Uo(ze),jo=t=>(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Qr(t)(e,r,n)},pT=jo(ze),Fo=t=>(e,r,i)=>Qr(t)(e,r,i),mT=Fo(ze),Vo=t=>async(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return en(t)(e,r,n)},gT=Vo(ze),Zo=t=>async(e,r,i)=>en(t)(e,r,i),vT=Zo(ze)});var Ge={};Je(Ge,{base64:()=>Xu,base64url:()=>Bo,bigint:()=>ol,boolean:()=>al,browserEmail:()=>ET,cidrv4:()=>Ku,cidrv6:()=>Yu,cuid:()=>Mu,cuid2:()=>zu,date:()=>tl,datetime:()=>nl,domain:()=>TT,duration:()=>Zu,e164:()=>el,email:()=>Gu,emoji:()=>Wu,extendedDuration:()=>yT,guid:()=>Bu,hex:()=>AT,hostname:()=>IT,html5Email:()=>wT,httpProtocol:()=>Qu,idnEmail:()=>ST,integer:()=>sl,ipv4:()=>Hu,ipv6:()=>qu,ksuid:()=>Fu,lowercase:()=>ll,mac:()=>Ju,md5_base64:()=>PT,md5_base64url:()=>CT,md5_hex:()=>OT,nanoid:()=>Vu,null:()=>cl,number:()=>Go,rfc5322Email:()=>xT,sha1_base64:()=>DT,sha1_base64url:()=>NT,sha1_hex:()=>RT,sha256_base64:()=>MT,sha256_base64url:()=>zT,sha256_hex:()=>LT,sha384_base64:()=>jT,sha384_base64url:()=>FT,sha384_hex:()=>UT,sha512_base64:()=>ZT,sha512_base64url:()=>BT,sha512_hex:()=>VT,string:()=>il,time:()=>rl,ulid:()=>Uu,undefined:()=>ul,unicodeEmail:()=>Ov,uppercase:()=>dl,uuid:()=>gr,uuid4:()=>_T,uuid6:()=>bT,uuid7:()=>$T,xid:()=>ju});function Wu(){return new RegExp(kT,"u")}function Cv(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 rl(t){return new RegExp(`^${Cv(t)}$`)}function nl(t){let e=Cv({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${e}(?:${r.join("|")})`;return new RegExp(`^${Pv}T(?:${i})$`)}function ci(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function ui(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var Mu,zu,Uu,ju,Fu,Vu,Zu,yT,Bu,gr,_T,bT,$T,Gu,wT,xT,Ov,ST,ET,kT,Hu,qu,Ju,Ku,Yu,Xu,Bo,IT,TT,Qu,el,Pv,tl,il,ol,sl,Go,al,cl,ul,ll,dl,AT,OT,PT,CT,RT,DT,NT,LT,MT,zT,UT,jT,FT,VT,ZT,BT,Wo=g(()=>{N();Mu=/^[cC][0-9a-z]{6,}$/,zu=/^[0-9a-z]+$/,Uu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ju=/^[0-9a-vA-V]{20}$/,Fu=/^[A-Za-z0-9]{27}$/,Vu=/^[a-zA-Z0-9_-]{21}$/,Zu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,yT=/^[-+]?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)?)??$/,Bu=/^([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})$/,gr=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)$/,_T=gr(4),bT=gr(6),$T=gr(7),Gu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,wT=/^[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])?)*$/,xT=/^(([^<>()\[\]\\.,;:\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,}))$/,Ov=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,ST=Ov,ET=/^[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])?)*$/,kT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";Hu=/^(?:(?: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])$/,qu=/^(([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}|:))$/,Ju=t=>{let e=Ye(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},Ku=/^((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])$/,Yu=/^(([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])$/,Xu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Bo=/^[A-Za-z0-9_-]*$/,IT=/^(?=.{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])?)*\.?$/,TT=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Qu=/^https?$/,el=/^\+[1-9]\d{6,14}$/,Pv="(?:(?:\\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])))",tl=new RegExp(`^${Pv}$`);il=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},ol=/^-?\d+n?$/,sl=/^-?\d+$/,Go=/^-?\d+(?:\.\d+)?$/,al=/^(?:true|false)$/i,cl=/^null$/i,ul=/^undefined$/i,ll=/^[^A-Z]*$/,dl=/^[^a-z]*$/,AT=/^[0-9a-fA-F]*$/;OT=/^[0-9a-fA-F]{32}$/,PT=ci(22,"=="),CT=ui(22),RT=/^[0-9a-fA-F]{40}$/,DT=ci(27,"="),NT=ui(27),LT=/^[0-9a-fA-F]{64}$/,MT=ci(43,"="),zT=ui(43),UT=/^[0-9a-fA-F]{96}$/,jT=ci(64,""),FT=ui(64),VT=/^[0-9a-fA-F]{128}$/,ZT=ci(86,"=="),BT=ui(86)});function Rv(t,e,r){t.issues.length&&e.issues.push(...Me(r,t.issues))}var X,Dv,Ho,qo,hl,fl,pl,ml,gl,vl,yl,_l,bl,tn,$l,wl,xl,Sl,El,kl,Il,Tl,Al,Jo=g(()=>{pr();Wo();N();X=m("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Dv={number:"number",bigint:"bigint",object:"date"},Ho=m("$ZodCheckLessThan",(t,e)=>{X.init(t,e);let r=Dv[typeof e.value];t._zod.onattach.push(i=>{let n=i._zod.bag,o=(e.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?n.maximum=e.value:n.exclusiveMaximum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),qo=m("$ZodCheckGreaterThan",(t,e)=>{X.init(t,e);let r=Dv[typeof e.value];t._zod.onattach.push(i=>{let n=i._zod.bag,o=(e.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?n.minimum=e.value:n.exclusiveMinimum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),hl=m("$ZodCheckMultipleOf",(t,e)=>{X.init(t,e),t._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):wu(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),fl=m("$ZodCheckNumberFormat",(t,e)=>{X.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),i=r?"int":"number",[n,o]=Tu[e.format];t._zod.onattach.push(s=>{let a=s._zod.bag;a.format=e.format,a.minimum=n,a.maximum=o,r&&(a.pattern=sl)}),t._zod.check=s=>{let a=s.value;if(r){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<n&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:n,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})}}),pl=m("$ZodCheckBigIntFormat",(t,e)=>{X.init(t,e);let[r,i]=Au[e.format];t._zod.onattach.push(n=>{let o=n._zod.bag;o.format=e.format,o.minimum=r,o.maximum=i}),t._zod.check=n=>{let o=n.value;o<r&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),o>i&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:t,continue:!e.abort})}}),ml=m("$ZodCheckMaxSize",(t,e)=>{var r;X.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!Zt(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let n=i.value;n.size<=e.maximum||i.issues.push({origin:ni(n),code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),gl=m("$ZodCheckMinSize",(t,e)=>{var r;X.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!Zt(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let n=i.value;n.size>=e.minimum||i.issues.push({origin:ni(n),code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),vl=m("$ZodCheckSizeEquals",(t,e)=>{var r;X.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!Zt(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.size,n.maximum=e.size,n.size=e.size}),t._zod.check=i=>{let n=i.value,o=n.size;if(o===e.size)return;let s=o>e.size;i.issues.push({origin:ni(n),...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})}}),yl=m("$ZodCheckMaxLength",(t,e)=>{var r;X.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!Zt(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let n=i.value;if(n.length<=e.maximum)return;let s=ii(n);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),_l=m("$ZodCheckMinLength",(t,e)=>{var r;X.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!Zt(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let n=i.value;if(n.length>=e.minimum)return;let s=ii(n);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),bl=m("$ZodCheckLengthEquals",(t,e)=>{var r;X.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!Zt(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length}),t._zod.check=i=>{let n=i.value,o=n.length;if(o===e.length)return;let s=ii(n),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})}}),tn=m("$ZodCheckStringFormat",(t,e)=>{var r,i;X.init(t,e),t._zod.onattach.push(n=>{let o=n._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:e.format,input:n.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(i=t._zod).check??(i.check=()=>{})}),$l=m("$ZodCheckRegex",(t,e)=>{tn.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),wl=m("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=ll),tn.init(t,e)}),xl=m("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=dl),tn.init(t,e)}),Sl=m("$ZodCheckIncludes",(t,e)=>{X.init(t,e);let r=Ye(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=i,t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),t._zod.check=n=>{n.value.includes(e.includes,e.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:n.value,inst:t,continue:!e.abort})}}),El=m("$ZodCheckStartsWith",(t,e)=>{X.init(t,e);let r=new RegExp(`^${Ye(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),t._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:t,continue:!e.abort})}}),kl=m("$ZodCheckEndsWith",(t,e)=>{X.init(t,e);let r=new RegExp(`.*${Ye(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),t._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:t,continue:!e.abort})}});Il=m("$ZodCheckProperty",(t,e)=>{X.init(t,e),t._zod.check=r=>{let i=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>Rv(n,r,e.property));Rv(i,r,e.property)}}),Tl=m("$ZodCheckMimeType",(t,e)=>{X.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(i=>{i._zod.bag.mime=e.mime}),t._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:t,continue:!e.abort})}}),Al=m("$ZodCheckOverwrite",(t,e)=>{X.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}})});var li,Ol=g(()=>{li=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
|
+
`).filter(s=>s),n=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(n)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let e=Function,r=this?.args,n=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...r,n.join(`
|
|
6
|
+
`))}}});var Pl,Cl=g(()=>{Pl={major:4,minor:4,patch:3}});function ed(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function Kv(t){if(!Bo.test(t))return!1;let e=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return ed(r)}function Yv(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[i]=r;if(!i)return!1;let n=JSON.parse(atob(i));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||e&&(!("alg"in n)||n.alg!==e))}catch{return!1}}function Lv(t,e,r){t.issues.length&&e.issues.push(...Me(r,t.issues)),e.value[r]=t.value}function Qo(t,e,r,i,n,o){let s=r in i;if(t.issues.length){if(n&&o&&!s)return;e.issues.push(...Me(r,t.issues))}if(!s&&!n){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?s&&(e.value[r]=void 0):e.value[r]=t.value}function Xv(t){let e=Object.keys(t.shape);for(let i of e)if(!t.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let r=Iu(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function Qv(t,e,r,i,n,o){let s=[],a=n.keySet,c=n.catchall._zod,u=c.def.type,l=c.optin==="optional",d=c.optout==="optional";for(let h in e){if(h==="__proto__"||a.has(h))continue;if(u==="never"){s.push(h);continue}let f=c.run({value:e[h],issues:[]},i);f instanceof Promise?t.push(f.then(p=>Qo(p,r,h,e,l,d))):Qo(f,r,h,e,l,d)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o}),t.length?Promise.all(t).then(()=>r):r}function Mv(t,e,r,i){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;let n=t.filter(o=>!Wt(o));return n.length===1?(e.value=n[0].value,n[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>Pe(s,i,ae())))}),e)}function zv(t,e,r,i){let n=t.filter(o=>o.issues.length===0);return n.length===1?(e.value=n[0].value,e):(n.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>Pe(s,i,ae())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1}),e)}function Rl(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(Gt(t)&&Gt(e)){let r=Object.keys(e),i=Object.keys(t).filter(o=>r.indexOf(o)!==-1),n={...t,...e};for(let o of i){let s=Rl(t[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n[o]=s.data}return{valid:!0,data:n}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<t.length;i++){let n=t[i],o=e[i],s=Rl(n,o);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Uv(t,e,r){let i=new Map,n;for(let a of e.issues)if(a.code==="unrecognized_keys"){n??(n=a);for(let c of a.keys)i.has(c)||i.set(c,{}),i.get(c).l=!0}else t.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let c of a.keys)i.has(c)||i.set(c,{}),i.get(c).r=!0;else t.issues.push(a);let o=[...i].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&n&&t.issues.push({...n,keys:o}),Wt(t))return t;let s=Rl(e.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return t.value=s.data,t}function jv(t,e){for(let r=t.length-1;r>=0;r--)if(t[r]._zod[e]!=="optional")return r+1;return 0}function Fv(t,e,r){t.issues.length&&e.issues.push(...Me(r,t.issues)),e.value[r]=t.value}function Vv(t,e,r,i,n){for(let o=0;o<r.length;o++){let s=t[o],a=o<i.length;if(s.issues.length){if(!a&&o>=n){e.value.length=o;break}e.issues.push(...Me(o,s.issues))}e.value[o]=s.value}for(let o=e.value.length-1;o>=i.length&&(r[o]._zod.optout==="optional"&&e.value[o]===void 0);o--)e.value.length=o;return e}function Zv(t,e,r,i,n,o,s){t.issues.length&&(ri.has(typeof i)?r.issues.push(...Me(i,t.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:t.issues.map(a=>Pe(a,s,ae()))})),e.issues.length&&(ri.has(typeof i)?r.issues.push(...Me(i,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:e.issues.map(a=>Pe(a,s,ae()))})),r.value.set(t.value,e.value)}function Bv(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}function Gv(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}function Wv(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function Hv(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 Ko(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},r)}function Yo(t,e,r){if(t.issues.length)return t.aborted=!0,t;if((r.direction||"forward")==="forward"){let n=e.transform(t.value,t);return n instanceof Promise?n.then(o=>Xo(t,o,e.out,r)):Xo(t,n,e.out,r)}else{let n=e.reverseTransform(t.value,t);return n instanceof Promise?n.then(o=>Xo(t,o,e.in,r)):Xo(t,n,e.in,r)}}function Xo(t,e,r,i){return t.issues.length?(t.aborted=!0,t):r._zod.run({value:e,issues:t.issues},i)}function qv(t){return t.value=Object.freeze(t.value),t}function Jv(t,e,r,i){if(!t){let n={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(n.params=i._zod.def.params),e.issues.push(Kr(n))}}var U,vr,q,Dl,Nl,Ll,Ml,zl,Ul,jl,Fl,Vl,Zl,Bl,Gl,Wl,Hl,ql,Jl,Kl,Yl,Xl,Ql,td,rd,nd,id,od,es,sd,di,ts,ad,cd,ud,ld,dd,hd,fd,pd,md,gd,ey,vd,hi,yd,_d,bd,rs,$d,wd,xd,Sd,Ed,kd,Id,ns,Td,Ad,Od,Pd,Cd,Rd,Dd,Nd,is,fi,Ld,Md,zd,Ud,jd,Fd,Vd,Zd=g(()=>{Jo();pr();Ol();Lu();Wo();N();Cl();N();U=m("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Pl;let i=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&i.unshift(t);for(let n of i)for(let o of n._zod.onattach)o(t);if(i.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let n=(s,a,c)=>{let u=Wt(s),l;for(let d of a){if(d._zod.def.when){if(Ou(s)||!d._zod.def.when(s))continue}else if(u)continue;let h=s.issues.length,f=d._zod.check(s);if(f instanceof Promise&&c?.async===!1)throw new at;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await f,s.issues.length!==h&&(u||(u=Wt(s,h)))});else{if(s.issues.length===h)continue;u||(u=Wt(s,h))}}return l?l.then(()=>s):s},o=(s,a,c)=>{if(Wt(s))return s.aborted=!0,s;let u=n(a,i,c);if(u instanceof Promise){if(c.async===!1)throw new at;return u.then(l=>t._zod.parse(l,c))}return t._zod.parse(u,c)};t._zod.run=(s,a)=>{if(a.skipChecks)return t._zod.parse(s,a);if(a.direction==="backward"){let u=t._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(l=>o(l,s,a)):o(u,s,a)}let c=t._zod.parse(s,a);if(c instanceof Promise){if(a.async===!1)throw new at;return c.then(u=>n(u,i,a))}return n(c,i,a)}}B(t,"~standard",()=>({validate:n=>{try{let o=Du(t,n);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return Nu(t,n).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),vr=m("$ZodString",(t,e)=>{U.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??il(t._zod.bag),t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),q=m("$ZodStringFormat",(t,e)=>{tn.init(t,e),vr.init(t,e)}),Dl=m("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Bu),q.init(t,e)}),Nl=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=gr(i))}else e.pattern??(e.pattern=gr());q.init(t,e)}),Ll=m("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Gu),q.init(t,e)}),Ml=m("$ZodURL",(t,e)=>{q.init(t,e),t._zod.check=r=>{try{let i=r.value.trim();if(!e.normalize&&e.protocol?.source===Qu.source&&!/^https?:\/\//i.test(i)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}let n=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=n.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),zl=m("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Wu()),q.init(t,e)}),Ul=m("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Vu),q.init(t,e)}),jl=m("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Mu),q.init(t,e)}),Fl=m("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=zu),q.init(t,e)}),Vl=m("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Uu),q.init(t,e)}),Zl=m("$ZodXID",(t,e)=>{e.pattern??(e.pattern=ju),q.init(t,e)}),Bl=m("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Fu),q.init(t,e)}),Gl=m("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=nl(e)),q.init(t,e)}),Wl=m("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=tl),q.init(t,e)}),Hl=m("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=rl(e)),q.init(t,e)}),ql=m("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Zu),q.init(t,e)}),Jl=m("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Hu),q.init(t,e),t._zod.bag.format="ipv4"}),Kl=m("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=qu),q.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),Yl=m("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=Ju(e.delimiter)),q.init(t,e),t._zod.bag.format="mac"}),Xl=m("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Ku),q.init(t,e)}),Ql=m("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Yu),q.init(t,e),t._zod.check=r=>{let i=r.value.split("/");try{if(i.length!==2)throw new Error;let[n,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://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});td=m("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Xu),q.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{ed(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});rd=m("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Bo),q.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{Kv(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),nd=m("$ZodE164",(t,e)=>{e.pattern??(e.pattern=el),q.init(t,e)});id=m("$ZodJWT",(t,e)=>{q.init(t,e),t._zod.check=r=>{Yv(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),od=m("$ZodCustomStringFormat",(t,e)=>{q.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),es=m("$ZodNumber",(t,e)=>{U.init(t,e),t._zod.pattern=t._zod.bag.pattern??Go,t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let o=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:t,...o?{received:o}:{}}),r}}),sd=m("$ZodNumberFormat",(t,e)=>{fl.init(t,e),es.init(t,e)}),di=m("$ZodBoolean",(t,e)=>{U.init(t,e),t._zod.pattern=al,t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:t}),r}}),ts=m("$ZodBigInt",(t,e)=>{U.init(t,e),t._zod.pattern=ol,t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),ad=m("$ZodBigIntFormat",(t,e)=>{pl.init(t,e),ts.init(t,e)}),cd=m("$ZodSymbol",(t,e)=>{U.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:t}),r}}),ud=m("$ZodUndefined",(t,e)=>{U.init(t,e),t._zod.pattern=ul,t._zod.values=new Set([void 0]),t._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:t}),r}}),ld=m("$ZodNull",(t,e)=>{U.init(t,e),t._zod.pattern=cl,t._zod.values=new Set([null]),t._zod.parse=(r,i)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:t}),r}}),dd=m("$ZodAny",(t,e)=>{U.init(t,e),t._zod.parse=r=>r}),hd=m("$ZodUnknown",(t,e)=>{U.init(t,e),t._zod.parse=r=>r}),fd=m("$ZodNever",(t,e)=>{U.init(t,e),t._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),pd=m("$ZodVoid",(t,e)=>{U.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:t}),r}}),md=m("$ZodDate",(t,e)=>{U.init(t,e),t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,o=n instanceof Date;return o&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:t}),r}});gd=m("$ZodArray",(t,e)=>{U.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:t}),r;r.value=Array(n.length);let o=[];for(let s=0;s<n.length;s++){let a=n[s],c=e.element._zod.run({value:a,issues:[]},i);c instanceof Promise?o.push(c.then(u=>Lv(u,r,s))):Lv(c,r,s)}return o.length?Promise.all(o).then(()=>r):r}});ey=m("$ZodObject",(t,e)=>{if(U.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let c={...a};return Object.defineProperty(e,"shape",{value:c}),c}})}let i=Jr(()=>Xv(e));B(t._zod,"propValues",()=>{let a=e.shape,c={};for(let u in a){let l=a[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(let d of l.values)c[u].add(d)}}return c});let n=mr,o=e.catchall,s;t._zod.parse=(a,c)=>{s??(s=i.value);let u=a.value;if(!n(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,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",y=f._zod.optout==="optional",b=f._zod.run({value:u[h],issues:[]},c);b instanceof Promise?l.push(b.then(k=>Qo(k,a,h,u,p,y))):Qo(b,a,h,u,p,y)}return o?Qv(l,u,a,c,i.value,t):l.length?Promise.all(l).then(()=>a):a}}),vd=m("$ZodObjectJIT",(t,e)=>{ey.init(t,e);let r=t._zod.parse,i=Jr(()=>Xv(e)),n=h=>{let f=new li(["shape","payload","ctx"]),p=i.value,y=A=>{let $=Co(A);return`shape[${$}]._zod.run({ value: input[${$}], issues: [] }, ctx)`};f.write("const input = payload.value;");let b=Object.create(null),k=0;for(let A of p.keys)b[A]=`key_${k++}`;f.write("const newResult = {};");for(let A of p.keys){let $=b[A],E=Co(A),z=h[A],M=z?._zod?.optin==="optional",H=z?._zod?.optout==="optional";f.write(`const ${$} = ${y(A)};`),M&&H?f.write(`
|
|
7
|
+
if (${$}.issues.length) {
|
|
8
|
+
if (${E} in input) {
|
|
9
|
+
payload.issues = payload.issues.concat(${$}.issues.map(iss => ({
|
|
10
10
|
...iss,
|
|
11
|
-
path: iss.path ? [${
|
|
11
|
+
path: iss.path ? [${E}, ...iss.path] : [${E}]
|
|
12
12
|
})));
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
if (${
|
|
17
|
-
if (${
|
|
18
|
-
newResult[${
|
|
16
|
+
if (${$}.value === undefined) {
|
|
17
|
+
if (${E} in input) {
|
|
18
|
+
newResult[${E}] = undefined;
|
|
19
19
|
}
|
|
20
20
|
} else {
|
|
21
|
-
newResult[${
|
|
21
|
+
newResult[${E}] = ${$}.value;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
`):
|
|
25
|
-
if (${
|
|
26
|
-
payload.issues = payload.issues.concat(${
|
|
24
|
+
`):M?f.write(`
|
|
25
|
+
if (${$}.issues.length) {
|
|
26
|
+
payload.issues = payload.issues.concat(${$}.issues.map(iss => ({
|
|
27
27
|
...iss,
|
|
28
|
-
path: iss.path ? [${
|
|
28
|
+
path: iss.path ? [${E}, ...iss.path] : [${E}]
|
|
29
29
|
})));
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
if (${
|
|
33
|
-
if (${
|
|
34
|
-
newResult[${
|
|
32
|
+
if (${$}.value === undefined) {
|
|
33
|
+
if (${E} in input) {
|
|
34
|
+
newResult[${E}] = undefined;
|
|
35
35
|
}
|
|
36
36
|
} else {
|
|
37
|
-
newResult[${
|
|
37
|
+
newResult[${E}] = ${$}.value;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
`):f.write(`
|
|
41
|
-
const ${
|
|
42
|
-
if (${
|
|
43
|
-
payload.issues = payload.issues.concat(${
|
|
41
|
+
const ${$}_present = ${E} in input;
|
|
42
|
+
if (${$}.issues.length) {
|
|
43
|
+
payload.issues = payload.issues.concat(${$}.issues.map(iss => ({
|
|
44
44
|
...iss,
|
|
45
|
-
path: iss.path ? [${
|
|
45
|
+
path: iss.path ? [${E}, ...iss.path] : [${E}]
|
|
46
46
|
})));
|
|
47
47
|
}
|
|
48
|
-
if (!${
|
|
48
|
+
if (!${$}_present && !${$}.issues.length) {
|
|
49
49
|
payload.issues.push({
|
|
50
50
|
code: "invalid_type",
|
|
51
51
|
expected: "nonoptional",
|
|
52
52
|
input: undefined,
|
|
53
|
-
path: [${
|
|
53
|
+
path: [${E}]
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
if (${
|
|
58
|
-
if (${
|
|
59
|
-
newResult[${
|
|
57
|
+
if (${$}_present) {
|
|
58
|
+
if (${$}.value === undefined) {
|
|
59
|
+
newResult[${E}] = undefined;
|
|
60
60
|
} else {
|
|
61
|
-
newResult[${
|
|
61
|
+
newResult[${E}] = ${$}.value;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
`)}f.write("payload.value = newResult;"),f.write("return payload;");let A=f.compile();return(O,x)=>A(h,O,x)},o,s=pr,a=!hr.jitless,u=a&&yu.value,l=e.catchall,d;t._zod.parse=(h,f)=>{d??(d=i.value);let p=h.value;return s(p)?a&&u&&f?.async===!1&&f.jitless!==!0?(o||(o=r(e.shape)),h=o(h,f),l?Gv([],p,h,f,d,t):h):n(h,f):(h.issues.push({expected:"object",code:"invalid_type",input:p,inst:t}),h)}});hi=m("$ZodUnion",(t,e)=>{M.init(t,e),B(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),B(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),B(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),B(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=>ti(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 c=a._zod.run({value:i.value,issues:[]},r);if(c instanceof Promise)s.push(c),o=!0;else{if(c.issues.length===0)return c;s.push(c)}}return o?Promise.all(s).then(a=>Av(a,i,t,r)):Av(s,i,t,r)}});hd=m("$ZodXor",(t,e)=>{hi.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 c=a._zod.run({value:i.value,issues:[]},r);c instanceof Promise?(s.push(c),o=!0):s.push(c)}return o?Promise.all(s).then(a=>Ov(a,i,t,r)):Ov(s,i,t,r)}}),fd=m("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,hi.init(t,e);let n=t._zod.parse;B(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,c]of Object.entries(s)){r[a]||(r[a]=new Set);for(let u of c)r[a].add(u)}}return r});let i=Jr(()=>{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 c of a){if(o.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);o.set(c,s)}}return o});t._zod.parse=(r,o)=>{let s=r.value;if(!pr(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)}}),pd=m("$ZodIntersection",(t,e)=>{M.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(([c,u])=>Pv(n,c,u)):Pv(n,o,s)}});rs=m("$ZodTuple",(t,e)=>{M.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"),c=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 u=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=>{u[l]=h})):u[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=>Rv(p,i,l))):Rv(f,i,l)}}return s.length?Promise.all(s).then(()=>Nv(u,i,n,o,c)):Nv(u,i,n,o,c)}});md=m("$ZodRecord",(t,e)=>{M.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!Gt(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 u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);let l=e.keyType._zod.run({value:u,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=>Oe(f,i,se())),input:u,path:[u],inst:t});continue}let d=l.value,h=e.valueType._zod.run({value:r[u],issues:[]},i);h instanceof Promise?o.push(h.then(f=>{f.issues.length&&n.issues.push(...Le(u,f.issues)),n.value[d]=f.value})):(h.issues.length&&n.issues.push(...Le(u,h.issues)),n.value[d]=h.value)}let c;for(let u in r)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:r,inst:t,keys:c})}else{n.value={};for(let a of Reflect.ownKeys(r)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(r,a))continue;let c=e.keyType._zod.run({value:a,issues:[]},i);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Go.test(a)&&c.issues.length){let d=e.keyType._zod.run({value:Number(a),issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d)}if(c.issues.length){e.mode==="loose"?n.value[a]=r[a]:n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>Oe(d,i,se())),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(...Le(a,d.issues)),n.value[c.value]=d.value})):(l.issues.length&&n.issues.push(...Le(a,l.issues)),n.value[c.value]=l.value)}}return o.length?Promise.all(o).then(()=>n):n}}),gd=m("$ZodMap",(t,e)=>{M.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 c=e.keyType._zod.run({value:s,issues:[]},i),u=e.valueType._zod.run({value:a,issues:[]},i);c instanceof Promise||u instanceof Promise?o.push(Promise.all([c,u]).then(([l,d])=>{Dv(l,d,n,s,r,t,i)})):Dv(c,u,n,s,r,t,i)}return o.length?Promise.all(o).then(()=>n):n}});vd=m("$ZodSet",(t,e)=>{M.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(c=>Lv(c,n))):Lv(a,n)}return o.length?Promise.all(o).then(()=>n):n}});yd=m("$ZodEnum",(t,e)=>{M.init(t,e);let n=ei(e.entries),i=new Set(n);t._zod.values=i,t._zod.pattern=new RegExp(`^(${n.filter(r=>ri.has(typeof r)).map(r=>typeof r=="string"?Ye(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}}),_d=m("$ZodLiteral",(t,e)=>{if(M.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"?Ye(i):i?Ye(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}}),bd=m("$ZodFile",(t,e)=>{M.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}}),$d=m("$ZodTransform",(t,e)=>{M.init(t,e),t._zod.optin="optional",t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new Vt(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 at;return n.value=r,n.fallback=!0,n}});ns=m("$ZodOptional",(t,e)=>{M.init(t,e),t._zod.optin="optional",t._zod.optout="optional",B(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),B(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${ti(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=>Mv(s,r)):Mv(o,r)}return n.value===void 0?n:e.innerType._zod.run(n,i)}}),wd=m("$ZodExactOptional",(t,e)=>{ns.init(t,e),B(t._zod,"values",()=>e.innerType._zod.values),B(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(n,i)=>e.innerType._zod.run(n,i)}),xd=m("$ZodNullable",(t,e)=>{M.init(t,e),B(t._zod,"optin",()=>e.innerType._zod.optin),B(t._zod,"optout",()=>e.innerType._zod.optout),B(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${ti(n.source)}|null)$`):void 0}),B(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)}),Sd=m("$ZodDefault",(t,e)=>{M.init(t,e),t._zod.optin="optional",B(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=>zv(o,e)):zv(r,e)}});Ed=m("$ZodPrefault",(t,e)=>{M.init(t,e),t._zod.optin="optional",B(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))}),Id=m("$ZodNonOptional",(t,e)=>{M.init(t,e),B(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=>Uv(o,t)):Uv(r,t)}});kd=m("$ZodSuccess",(t,e)=>{M.init(t,e),t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new Vt("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)}}),Td=m("$ZodCatch",(t,e)=>{M.init(t,e),t._zod.optin="optional",B(t._zod,"optout",()=>e.innerType._zod.optout),B(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=>Oe(s,i,se()))},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=>Oe(o,i,se()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),Ad=m("$ZodNaN",(t,e)=>{M.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)}),is=m("$ZodPipe",(t,e)=>{M.init(t,e),B(t._zod,"values",()=>e.in._zod.values),B(t._zod,"optin",()=>e.in._zod.optin),B(t._zod,"optout",()=>e.out._zod.optout),B(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=>Ko(s,e.in,i)):Ko(o,e.in,i)}let r=e.in._zod.run(n,i);return r instanceof Promise?r.then(o=>Ko(o,e.out,i)):Ko(r,e.out,i)}});fi=m("$ZodCodec",(t,e)=>{M.init(t,e),B(t._zod,"values",()=>e.in._zod.values),B(t._zod,"optin",()=>e.in._zod.optin),B(t._zod,"optout",()=>e.out._zod.optout),B(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=>Yo(s,e,i)):Yo(o,e,i)}else{let o=e.out._zod.run(n,i);return o instanceof Promise?o.then(s=>Yo(s,e,i)):Yo(o,e,i)}}});Od=m("$ZodPreprocess",(t,e)=>{is.init(t,e)}),Pd=m("$ZodReadonly",(t,e)=>{M.init(t,e),B(t._zod,"propValues",()=>e.innerType._zod.propValues),B(t._zod,"values",()=>e.innerType._zod.values),B(t._zod,"optin",()=>e.innerType?._zod?.optin),B(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(jv):jv(r)}});Cd=m("$ZodTemplateLiteral",(t,e)=>{M.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||bu.has(typeof i))n.push(Ye(`${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)}),Rd=m("$ZodFunction",(t,e)=>(M.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?No(t._def.input,i):i,o=Reflect.apply(n,this,r);return t._def.output?No(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 Do(t._def.input,i):i,o=await Reflect.apply(n,this,r);return t._def.output?await Do(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 rs({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)),Nd=m("$ZodPromise",(t,e)=>{M.init(t,e),t._zod.parse=(n,i)=>Promise.resolve(n.value).then(r=>e.innerType._zod.run({value:r,issues:[]},i))}),Dd=m("$ZodLazy",(t,e)=>{M.init(t,e),B(t._zod,"innerType",()=>{let n=e;return n._cachedInner||(n._cachedInner=e.getter()),n._cachedInner}),B(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),B(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),B(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),B(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(n,i)=>t._zod.innerType._zod.run(n,i)}),Ld=m("$ZodCustom",(t,e)=>{X.init(t,e),M.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=>Fv(o,n,i,t));Fv(r,n,i,t)}})});function Hv(){return{localeError:O1()}}var O1,qv=g(()=>{D();O1=()=>{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=w(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: ${v(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":""}: ${v(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 Jv(){return{localeError:P1()}}var P1,Kv=g(()=>{D();P1=()=>{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=w(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: ${v(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":""}: ${v(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 Yv(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:C1()}}var C1,Qv=g(()=>{D();C1=()=>{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=w(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 ${v(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);if(s){let a=Number(r.maximum),c=Yv(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()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${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),c=Yv(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()} ${c}`}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"}: ${v(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 ey(){return{localeError:R1()}}var R1,ty=g(()=>{D();R1=()=>{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=w(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 ${v(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":""}: ${v(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 ry(){return{localeError:N1()}}var N1,ny=g(()=>{D();N1=()=>{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=w(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 ${v(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":""}: ${v(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 iy(){return{localeError:D1()}}var D1,oy=g(()=>{D();D1=()=>{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=w(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 ${v(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: ${v(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 sy(){return{localeError:L1()}}var L1,ay=g(()=>{D();L1=()=>{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=w(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 ${v(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"}: ${v(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 cy(){return{localeError:M1()}}var M1,uy=g(()=>{D();M1=()=>{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=w(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 ${v(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"}: ${v(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 ly(){return{localeError:z1()}}var z1,dy=g(()=>{D();z1=()=>{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=w(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 ${v(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"}: ${v(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 os(){return{localeError:U1()}}var U1,zd=g(()=>{D();U1=()=>{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=w(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 ${v(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":""}: ${v(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 hy(){return{localeError:j1()}}var j1,fy=g(()=>{D();j1=()=>{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=w(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 ${v(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":""}: ${v(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 py(){return{localeError:F1()}}var F1,my=g(()=>{D();F1=()=>{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=w(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 ${v(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":""}: ${v(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 gy(){return{localeError:V1()}}var V1,vy=g(()=>{D();V1=()=>{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=w(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 ${v(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: ${v(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 yy(){return{localeError:Z1()}}var Z1,_y=g(()=>{D();Z1=()=>{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=w(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: ${v(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"}: ${v(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 by(){return{localeError:B1()}}var B1,$y=g(()=>{D();B1=()=>{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=w(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 ${v(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":""} : ${v(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 wy(){return{localeError:G1()}}var G1,xy=g(()=>{D();G1=()=>{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=w(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 ${v(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":""} : ${v(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 Sy(){return{localeError:W1()}}var W1,Ey=g(()=>{D();W1=()=>{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=u=>u?t[u]:void 0,i=u=>{let l=n(u);return l?l.label:u??t.unknown.label},r=u=>`\u05D4${i(u)}`,o=u=>(n(u)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=u=>u?e[u]??null:null,a={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let l=u.expected,d=c[l??""]??i(l),h=w(u.input),f=c[h]??t[h]?.label??h;return/^[A-Z]/.test(u.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${u.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(u.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(u.values[0])}`;let l=u.values.map(f=>b(f));if(u.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(u.origin),d=r(u.origin??"value");if(u.origin==="string")return`${l?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.maximum.toString()} ${l?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(u.origin==="number"){let p=u.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${u.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}`}if(u.origin==="array"||u.origin==="set"){let p=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",y=u.inclusive?`${u.maximum} ${l?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${u.maximum} ${l?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${p} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let h=u.inclusive?"<=":"<",f=o(u.origin??"value");return l?.unit?`${l.longLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${h}${u.maximum.toString()} ${l.unit}`:`${l?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${f} ${h}${u.maximum.toString()}`}case"too_small":{let l=s(u.origin),d=r(u.origin??"value");if(u.origin==="string")return`${l?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.minimum.toString()} ${l?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(u.origin==="number"){let p=u.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${u.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}`}if(u.origin==="array"||u.origin==="set"){let p=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(u.minimum===1&&u.inclusive){let $=(u.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 ${$}`}let y=u.inclusive?`${u.minimum} ${l?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${u.minimum} ${l?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${p} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let h=u.inclusive?">=":">",f=o(u.origin??"value");return l?.unit?`${l.shortLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${h}${u.minimum.toString()} ${l.unit}`:`${l?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${f} ${h}${u.minimum.toString()}`}case"invalid_format":{let l=u;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 ${u.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${u.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${u.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${v(u.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(u.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}}});function Iy(){return{localeError:H1()}}var H1,ky=g(()=>{D();H1=()=>{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=w(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 ${v(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"}: ${v(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 Ty(){return{localeError:q1()}}var q1,Ay=g(()=>{D();q1=()=>{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=w(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 ${v(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":""}: ${v(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 Oy(t,e,n){return Math.abs(t)===1?e:n}function rn(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 Py(){return{localeError:J1()}}var J1,Cy=g(()=>{D();J1=()=>{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=w(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 ${v(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);if(s){let a=Number(r.maximum),c=Oy(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 ${rn(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.maximum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${rn(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),c=Oy(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 ${rn(r.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${r.minimum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${rn(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":""}. ${v(r.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${rn(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 ${rn(r.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}}});function Ry(){return{localeError:K1()}}var K1,Ny=g(()=>{D();K1=()=>{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=w(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 ${v(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":""}: ${v(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 Dy(){return{localeError:Y1()}}var Y1,Ly=g(()=>{D();Y1=()=>{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=w(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 ${v(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"}: ${v(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 My(){return{localeError:X1()}}var X1,zy=g(()=>{D();X1=()=>{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=w(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 ${v(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"}: ${v(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 Uy(){return{localeError:Q1()}}var Q1,jy=g(()=>{D();Q1=()=>{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=w(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: ${v(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":""}: ${v(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 Fy(){return{localeError:eT()}}var eT,Vy=g(()=>{D();eT=()=>{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=w(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 ${v(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"}: ${v(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 ss(){return{localeError:tT()}}var tT,Ud=g(()=>{D();tT=()=>{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=w(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 ${v(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 ${v(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 Zy(){return ss()}var By=g(()=>{Ud()});function Gy(){return{localeError:rT()}}var rT,Wy=g(()=>{D();rT=()=>{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=w(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: ${v(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),c=a?.unit??"\uC694\uC18C";return a?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${c} ${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),c=a?.unit??"\uC694\uC18C";return a?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${c} ${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: ${v(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 Hy(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 qy(){return{localeError:nT()}}var pi,nT,Jy=g(()=>{D();pi=t=>t.charAt(0).toUpperCase()+t.slice(1);nT=()=>{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 c=t[r]??null;return c===null?c:{unit:c.unit[o],verb:c.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=w(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 ${v(r.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[r.origin]??r.origin,s=e(r.origin,Hy(Number(r.maximum)),r.inclusive??!1,"smaller");if(s?.verb)return`${pi(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`${pi(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,Hy(Number(r.minimum)),r.inclusive??!1,"bigger");if(s?.verb)return`${pi(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`${pi(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"}: ${v(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`${pi(o??r.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}}});function Ky(){return{localeError:iT()}}var iT,Yy=g(()=>{D();iT=()=>{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=w(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 ${v(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"}: ${v(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:oT()}}var oT,Qy=g(()=>{D();oT=()=>{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=w(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 ${v(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: ${v(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 e_(){return{localeError:sT()}}var sT,t_=g(()=>{D();sT=()=>{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=w(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 ${v(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":""}: ${v(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 r_(){return{localeError:aT()}}var aT,n_=g(()=>{D();aT=()=>{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=w(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 ${v(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"}: ${v(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 i_(){return{localeError:cT()}}var cT,o_=g(()=>{D();cT=()=>{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=w(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 ${v(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":""}: ${v(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 s_(){return{localeError:uT()}}var uT,a_=g(()=>{D();uT=()=>{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=w(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 ${v(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"}: ${v(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 c_(){return{localeError:lT()}}var lT,u_=g(()=>{D();lT=()=>{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=w(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 ${v(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":""}: ${v(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 l_(){return{localeError:dT()}}var dT,d_=g(()=>{D();dT=()=>{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=w(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 ${v(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":""}: ${v(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 h_(){return{localeError:hT()}}var hT,f_=g(()=>{D();hT=()=>{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=w(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 ${v(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: ${v(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 p_(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 m_(){return{localeError:fT()}}var fT,g_=g(()=>{D();fT=()=>{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=w(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 ${v(r.values,"|")}`;case"too_big":{let o=r.inclusive?"<=":"<",s=e(r.origin);if(s){let a=Number(r.maximum),c=p_(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()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${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),c=p_(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()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${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":""}: ${v(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 v_(){return{localeError:pT()}}var pT,y_=g(()=>{D();pT=()=>{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=w(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 ${v(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"}: ${v(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 __(){return{localeError:mT()}}var mT,b_=g(()=>{D();mT=()=>{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=w(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 ${v(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"}: ${v(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 $_(){return{localeError:gT()}}var gT,w_=g(()=>{D();gT=()=>{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=w(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 ${v(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":""}: ${v(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 x_(){return{localeError:vT()}}var vT,S_=g(()=>{D();vT=()=>{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=w(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 ${v(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: ${v(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 E_(){return{localeError:yT()}}var yT,I_=g(()=>{D();yT=()=>{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=w(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: ${v(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":""}: ${v(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 as(){return{localeError:_T()}}var _T,jd=g(()=>{D();_T=()=>{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=w(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 ${v(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":""}: ${v(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 k_(){return as()}var T_=g(()=>{jd()});function A_(){return{localeError:bT()}}var bT,O_=g(()=>{D();bT=()=>{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=w(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: ${v(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":""}: ${v(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 P_(){return{localeError:$T()}}var $T,C_=g(()=>{D();$T=()=>{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=w(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 ${v(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":""}: ${v(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 R_(){return{localeError:wT()}}var wT,N_=g(()=>{D();wT=()=>{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=w(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 ${v(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: ${v(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 D_(){return{localeError:xT()}}var xT,L_=g(()=>{D();xT=()=>{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=w(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 ${v(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): ${v(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 M_(){return{localeError:ST()}}var ST,z_=g(()=>{D();ST=()=>{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=w(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 ${v(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${v(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 U_(){return{localeError:ET()}}var ET,j_=g(()=>{D();ET=()=>{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=w(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 ${v(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: ${v(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 mi={};Je(mi,{ar:()=>Hv,az:()=>Jv,be:()=>Xv,bg:()=>ey,ca:()=>ry,cs:()=>iy,da:()=>sy,de:()=>cy,el:()=>ly,en:()=>os,eo:()=>hy,es:()=>py,fa:()=>gy,fi:()=>yy,fr:()=>by,frCA:()=>wy,he:()=>Sy,hr:()=>Iy,hu:()=>Ty,hy:()=>Py,id:()=>Ry,is:()=>Dy,it:()=>My,ja:()=>Uy,ka:()=>Fy,kh:()=>Zy,km:()=>ss,ko:()=>Gy,lt:()=>qy,mk:()=>Ky,ms:()=>Xy,nl:()=>e_,no:()=>r_,ota:()=>i_,pl:()=>c_,ps:()=>s_,pt:()=>l_,ro:()=>h_,ru:()=>m_,sl:()=>v_,sv:()=>__,ta:()=>$_,th:()=>x_,tr:()=>E_,ua:()=>k_,uk:()=>as,ur:()=>A_,uz:()=>P_,vi:()=>R_,yo:()=>U_,zhCN:()=>D_,zhTW:()=>M_});var Fd=g(()=>{qv();Kv();Qv();ty();ny();oy();ay();uy();dy();zd();fy();my();vy();_y();$y();xy();Ey();ky();Ay();Cy();Ny();Ly();zy();jy();Vy();By();Ud();Wy();Jy();Yy();Qy();t_();n_();o_();a_();u_();d_();f_();g_();y_();b_();w_();S_();I_();T_();jd();O_();C_();N_();L_();z_();j_()});function us(){return new cs}var F_,Vd,Zd,cs,_e,gi=g(()=>{Vd=Symbol("ZodOutput"),Zd=Symbol("ZodInput"),cs=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)}};(F_=globalThis).__zod_globalRegistry??(F_.__zod_globalRegistry=us());_e=globalThis.__zod_globalRegistry});function Bd(t,e){return new t({type:"string",...E(e)})}function Gd(t,e){return new t({type:"string",coerce:!0,...E(e)})}function ls(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...E(e)})}function vi(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...E(e)})}function ds(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...E(e)})}function hs(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...E(e)})}function fs(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...E(e)})}function ps(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...E(e)})}function yi(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...E(e)})}function ms(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...E(e)})}function gs(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...E(e)})}function vs(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...E(e)})}function ys(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...E(e)})}function _s(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...E(e)})}function bs(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...E(e)})}function $s(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...E(e)})}function ws(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...E(e)})}function xs(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...E(e)})}function Wd(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...E(e)})}function Ss(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...E(e)})}function Es(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...E(e)})}function Is(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...E(e)})}function ks(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...E(e)})}function Ts(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...E(e)})}function As(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...E(e)})}function qd(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...E(e)})}function Jd(t,e){return new t({type:"string",format:"date",check:"string_format",...E(e)})}function Kd(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...E(e)})}function Yd(t,e){return new t({type:"string",format:"duration",check:"string_format",...E(e)})}function Xd(t,e){return new t({type:"number",checks:[],...E(e)})}function Qd(t,e){return new t({type:"number",coerce:!0,checks:[],...E(e)})}function eh(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...E(e)})}function th(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...E(e)})}function rh(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...E(e)})}function nh(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...E(e)})}function ih(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...E(e)})}function oh(t,e){return new t({type:"boolean",...E(e)})}function sh(t,e){return new t({type:"boolean",coerce:!0,...E(e)})}function ah(t,e){return new t({type:"bigint",...E(e)})}function ch(t,e){return new t({type:"bigint",coerce:!0,...E(e)})}function uh(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...E(e)})}function lh(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...E(e)})}function dh(t,e){return new t({type:"symbol",...E(e)})}function hh(t,e){return new t({type:"undefined",...E(e)})}function fh(t,e){return new t({type:"null",...E(e)})}function ph(t){return new t({type:"any"})}function mh(t){return new t({type:"unknown"})}function gh(t,e){return new t({type:"never",...E(e)})}function vh(t,e){return new t({type:"void",...E(e)})}function yh(t,e){return new t({type:"date",...E(e)})}function _h(t,e){return new t({type:"date",coerce:!0,...E(e)})}function bh(t,e){return new t({type:"nan",...E(e)})}function ht(t,e){return new Ho({check:"less_than",...E(e),value:t,inclusive:!1})}function We(t,e){return new Ho({check:"less_than",...E(e),value:t,inclusive:!0})}function ft(t,e){return new qo({check:"greater_than",...E(e),value:t,inclusive:!1})}function Pe(t,e){return new qo({check:"greater_than",...E(e),value:t,inclusive:!0})}function Os(t){return ft(0,t)}function Ps(t){return ht(0,t)}function Cs(t){return We(0,t)}function Rs(t){return Pe(0,t)}function Ht(t,e){return new sl({check:"multiple_of",...E(e),value:t})}function qt(t,e){return new ul({check:"max_size",...E(e),maximum:t})}function pt(t,e){return new ll({check:"min_size",...E(e),minimum:t})}function vr(t,e){return new dl({check:"size_equals",...E(e),size:t})}function yr(t,e){return new hl({check:"max_length",...E(e),maximum:t})}function St(t,e){return new fl({check:"min_length",...E(e),minimum:t})}function _r(t,e){return new pl({check:"length_equals",...E(e),length:t})}function nn(t,e){return new ml({check:"string_format",format:"regex",...E(e),pattern:t})}function on(t){return new gl({check:"string_format",format:"lowercase",...E(t)})}function sn(t){return new vl({check:"string_format",format:"uppercase",...E(t)})}function an(t,e){return new yl({check:"string_format",format:"includes",...E(e),includes:t})}function cn(t,e){return new _l({check:"string_format",format:"starts_with",...E(e),prefix:t})}function un(t,e){return new bl({check:"string_format",format:"ends_with",...E(e),suffix:t})}function Ns(t,e,n){return new $l({check:"property",property:t,schema:e,...E(n)})}function ln(t,e){return new wl({check:"mime_type",mime:t,...E(e)})}function ct(t){return new xl({check:"overwrite",tx:t})}function dn(t){return ct(e=>e.normalize(t))}function hn(){return ct(t=>t.trim())}function fn(){return ct(t=>t.toLowerCase())}function pn(){return ct(t=>t.toUpperCase())}function mn(){return ct(t=>vu(t))}function $h(t,e,n){return new t({type:"array",element:e,...E(n)})}function kT(t,e,n){return new t({type:"union",options:e,...E(n)})}function TT(t,e,n){return new t({type:"union",options:e,inclusive:!1,...E(n)})}function AT(t,e,n,i){return new t({type:"union",options:n,discriminator:e,...E(i)})}function OT(t,e,n){return new t({type:"intersection",left:e,right:n})}function PT(t,e,n,i){let r=n instanceof M,o=r?i:n,s=r?n:null;return new t({type:"tuple",items:e,rest:s,...E(o)})}function CT(t,e,n,i){return new t({type:"record",keyType:e,valueType:n,...E(i)})}function RT(t,e,n,i){return new t({type:"map",keyType:e,valueType:n,...E(i)})}function NT(t,e,n){return new t({type:"set",valueType:e,...E(n)})}function DT(t,e,n){let i=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new t({type:"enum",entries:i,...E(n)})}function LT(t,e,n){return new t({type:"enum",entries:e,...E(n)})}function MT(t,e,n){return new t({type:"literal",values:Array.isArray(e)?e:[e],...E(n)})}function wh(t,e){return new t({type:"file",...E(e)})}function zT(t,e){return new t({type:"transform",transform:e})}function UT(t,e){return new t({type:"optional",innerType:e})}function jT(t,e){return new t({type:"nullable",innerType:e})}function FT(t,e,n){return new t({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():_u(n)}})}function VT(t,e,n){return new t({type:"nonoptional",innerType:e,...E(n)})}function ZT(t,e){return new t({type:"success",innerType:e})}function BT(t,e,n){return new t({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}function GT(t,e,n){return new t({type:"pipe",in:e,out:n})}function WT(t,e){return new t({type:"readonly",innerType:e})}function HT(t,e,n){return new t({type:"template_literal",parts:e,...E(n)})}function qT(t,e){return new t({type:"lazy",getter:e})}function JT(t,e){return new t({type:"promise",innerType:e})}function xh(t,e,n){let i=E(n);return i.abort??(i.abort=!0),new t({type:"custom",check:"custom",fn:e,...i})}function Sh(t,e,n){return new t({type:"custom",check:"custom",fn:e,...E(n)})}function Eh(t,e){let n=V_(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(Kr(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(Kr(o))}},t(i.value,i)),e);return n}function V_(t,e){let n=new X({check:"custom",...E(e)});return n._zod.check=t,n}function Ih(t){let e=new X({check:"describe"});return e._zod.onattach=[n=>{let i=_e.get(n)??{};_e.add(n,{...i,description:t})}],e._zod.check=()=>{},e}function kh(t){let e=new X({check:"meta"});return e._zod.onattach=[n=>{let i=_e.get(n)??{};_e.add(n,{...i,...t})}],e._zod.check=()=>{},e}function Th(t,e){let n=E(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??fi,c=t.Boolean??di,u=t.String??gr,l=new u({type:"string",error:n.error}),d=new c({type:"boolean",error:n.error}),h=new a({type:"pipe",in:l,out:d,transform:((f,p)=>{let y=f;return n.case!=="sensitive"&&(y=y.toLowerCase()),o.has(y)?!0:s.has(y)?!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 gn(t,e,n,i={}){let r=E(i),o={...E(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 Hd,Z_=g(()=>{Jo();gi();Md();D();Hd={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function Jt(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??_e,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 c=e.metadataRegistry.get(t);return c&&Object.assign(s.schema,c),e.io==="input"&&Ce(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 Kt(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 c=i.get(a);if(c&&c!==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 u=`#/${a}/`,l=s[1].schema.id??`__schema${t.counter++}`;return{defId:l,ref:u+l}},o=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:u}=r(s);a.def={...a.schema},u&&(a.defId=u);let l=a.schema;for(let d in l)delete l[d];l.$ref=c};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 T=f.compile();return(A,$)=>T(h,A,$)},o,s=mr,a=!fr.jitless,u=a&&Su.value,l=e.catchall,d;t._zod.parse=(h,f)=>{d??(d=i.value);let p=h.value;return s(p)?a&&u&&f?.async===!1&&f.jitless!==!0?(o||(o=n(e.shape)),h=o(h,f),l?Qv([],p,h,f,d,t):h):r(h,f):(h.issues.push({expected:"object",code:"invalid_type",input:p,inst:t}),h)}});hi=m("$ZodUnion",(t,e)=>{U.init(t,e),B(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),B(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),B(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),B(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${i.map(n=>ti(n.source)).join("|")})$`)}});let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,n)=>{if(r)return r(i,n);let o=!1,s=[];for(let a of e.options){let c=a._zod.run({value:i.value,issues:[]},n);if(c instanceof Promise)s.push(c),o=!0;else{if(c.issues.length===0)return c;s.push(c)}}return o?Promise.all(s).then(a=>Mv(a,i,t,n)):Mv(s,i,t,n)}});yd=m("$ZodXor",(t,e)=>{hi.init(t,e),e.inclusive=!1;let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,n)=>{if(r)return r(i,n);let o=!1,s=[];for(let a of e.options){let c=a._zod.run({value:i.value,issues:[]},n);c instanceof Promise?(s.push(c),o=!0):s.push(c)}return o?Promise.all(s).then(a=>zv(a,i,t,n)):zv(s,i,t,n)}}),_d=m("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,hi.init(t,e);let r=t._zod.parse;B(t._zod,"propValues",()=>{let n={};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,c]of Object.entries(s)){n[a]||(n[a]=new Set);for(let u of c)n[a].add(u)}}return n});let i=Jr(()=>{let n=e.options,o=new Map;for(let s of n){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 c of a){if(o.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);o.set(c,s)}}return o});t._zod.parse=(n,o)=>{let s=n.value;if(!mr(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),n;let a=i.value.get(s?.[e.discriminator]);return a?a._zod.run(n,o):e.unionFallback||o.direction==="backward"?r(n,o):(n.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}),n)}}),bd=m("$ZodIntersection",(t,e)=>{U.init(t,e),t._zod.parse=(r,i)=>{let n=r.value,o=e.left._zod.run({value:n,issues:[]},i),s=e.right._zod.run({value:n,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([c,u])=>Uv(r,c,u)):Uv(r,o,s)}});rs=m("$ZodTuple",(t,e)=>{U.init(t,e);let r=e.items;t._zod.parse=(i,n)=>{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=jv(r,"optin"),c=jv(r,"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>r.length&&i.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:o,inst:t,origin:"array"})}let u=new Array(r.length);for(let l=0;l<r.length;l++){let d=r[l]._zod.run({value:o[l],issues:[]},n);d instanceof Promise?s.push(d.then(h=>{u[l]=h})):u[l]=d}if(e.rest){let l=r.length-1,d=o.slice(r.length);for(let h of d){l++;let f=e.rest._zod.run({value:h,issues:[]},n);f instanceof Promise?s.push(f.then(p=>Fv(p,i,l))):Fv(f,i,l)}}return s.length?Promise.all(s).then(()=>Vv(u,i,r,o,c)):Vv(u,i,r,o,c)}});$d=m("$ZodRecord",(t,e)=>{U.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!Gt(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:t}),r;let o=[],s=e.keyType._zod.values;if(s){r.value={};let a=new Set;for(let u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);let l=e.keyType._zod.run({value:u,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(f=>Pe(f,i,ae())),input:u,path:[u],inst:t});continue}let d=l.value,h=e.valueType._zod.run({value:n[u],issues:[]},i);h instanceof Promise?o.push(h.then(f=>{f.issues.length&&r.issues.push(...Me(u,f.issues)),r.value[d]=f.value})):(h.issues.length&&r.issues.push(...Me(u,h.issues)),r.value[d]=h.value)}let c;for(let u in n)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:t,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(n)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,a))continue;let c=e.keyType._zod.run({value:a,issues:[]},i);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Go.test(a)&&c.issues.length){let d=e.keyType._zod.run({value:Number(a),issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d)}if(c.issues.length){e.mode==="loose"?r.value[a]=n[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>Pe(d,i,ae())),input:a,path:[a],inst:t});continue}let l=e.valueType._zod.run({value:n[a],issues:[]},i);l instanceof Promise?o.push(l.then(d=>{d.issues.length&&r.issues.push(...Me(a,d.issues)),r.value[c.value]=d.value})):(l.issues.length&&r.issues.push(...Me(a,l.issues)),r.value[c.value]=l.value)}}return o.length?Promise.all(o).then(()=>r):r}}),wd=m("$ZodMap",(t,e)=>{U.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:t}),r;let o=[];r.value=new Map;for(let[s,a]of n){let c=e.keyType._zod.run({value:s,issues:[]},i),u=e.valueType._zod.run({value:a,issues:[]},i);c instanceof Promise||u instanceof Promise?o.push(Promise.all([c,u]).then(([l,d])=>{Zv(l,d,r,s,n,t,i)})):Zv(c,u,r,s,n,t,i)}return o.length?Promise.all(o).then(()=>r):r}});xd=m("$ZodSet",(t,e)=>{U.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:t,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let s of n){let a=e.valueType._zod.run({value:s,issues:[]},i);a instanceof Promise?o.push(a.then(c=>Bv(c,r))):Bv(a,r)}return o.length?Promise.all(o).then(()=>r):r}});Sd=m("$ZodEnum",(t,e)=>{U.init(t,e);let r=ei(e.entries),i=new Set(r);t._zod.values=i,t._zod.pattern=new RegExp(`^(${r.filter(n=>ri.has(typeof n)).map(n=>typeof n=="string"?Ye(n):n.toString()).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return i.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:t}),n}}),Ed=m("$ZodLiteral",(t,e)=>{if(U.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?Ye(i):i?Ye(i.toString()):String(i)).join("|")})$`),t._zod.parse=(i,n)=>{let o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),i}}),kd=m("$ZodFile",(t,e)=>{U.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:t}),r}}),Id=m("$ZodTransform",(t,e)=>{U.init(t,e),t._zod.optin="optional",t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Vt(t.constructor.name);let n=e.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(r.value=s,r.fallback=!0,r));if(n instanceof Promise)throw new at;return r.value=n,r.fallback=!0,r}});ns=m("$ZodOptional",(t,e)=>{U.init(t,e),t._zod.optin="optional",t._zod.optout="optional",B(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),B(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${ti(r.source)})?$`):void 0}),t._zod.parse=(r,i)=>{if(e.innerType._zod.optin==="optional"){let n=r.value,o=e.innerType._zod.run(r,i);return o instanceof Promise?o.then(s=>Gv(s,n)):Gv(o,n)}return r.value===void 0?r:e.innerType._zod.run(r,i)}}),Td=m("$ZodExactOptional",(t,e)=>{ns.init(t,e),B(t._zod,"values",()=>e.innerType._zod.values),B(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,i)=>e.innerType._zod.run(r,i)}),Ad=m("$ZodNullable",(t,e)=>{U.init(t,e),B(t._zod,"optin",()=>e.innerType._zod.optin),B(t._zod,"optout",()=>e.innerType._zod.optout),B(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${ti(r.source)}|null)$`):void 0}),B(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,i)=>r.value===null?r:e.innerType._zod.run(r,i)}),Od=m("$ZodDefault",(t,e)=>{U.init(t,e),t._zod.optin="optional",B(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);if(r.value===void 0)return r.value=e.defaultValue,r;let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>Wv(o,e)):Wv(n,e)}});Pd=m("$ZodPrefault",(t,e)=>{U.init(t,e),t._zod.optin="optional",B(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,i))}),Cd=m("$ZodNonOptional",(t,e)=>{U.init(t,e),B(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),t._zod.parse=(r,i)=>{let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>Hv(o,t)):Hv(n,t)}});Rd=m("$ZodSuccess",(t,e)=>{U.init(t,e),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Vt("ZodSuccess");let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),Dd=m("$ZodCatch",(t,e)=>{U.init(t,e),t._zod.optin="optional",B(t._zod,"optout",()=>e.innerType._zod.optout),B(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>Pe(s,i,ae()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=n.value,n.issues.length&&(r.value=e.catchValue({...r,error:{issues:n.issues.map(o=>Pe(o,i,ae()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),Nd=m("$ZodNaN",(t,e)=>{U.init(t,e),t._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),is=m("$ZodPipe",(t,e)=>{U.init(t,e),B(t._zod,"values",()=>e.in._zod.values),B(t._zod,"optin",()=>e.in._zod.optin),B(t._zod,"optout",()=>e.out._zod.optout),B(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,i)=>{if(i.direction==="backward"){let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>Ko(s,e.in,i)):Ko(o,e.in,i)}let n=e.in._zod.run(r,i);return n instanceof Promise?n.then(o=>Ko(o,e.out,i)):Ko(n,e.out,i)}});fi=m("$ZodCodec",(t,e)=>{U.init(t,e),B(t._zod,"values",()=>e.in._zod.values),B(t._zod,"optin",()=>e.in._zod.optin),B(t._zod,"optout",()=>e.out._zod.optout),B(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){let o=e.in._zod.run(r,i);return o instanceof Promise?o.then(s=>Yo(s,e,i)):Yo(o,e,i)}else{let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>Yo(s,e,i)):Yo(o,e,i)}}});Ld=m("$ZodPreprocess",(t,e)=>{is.init(t,e)}),Md=m("$ZodReadonly",(t,e)=>{U.init(t,e),B(t._zod,"propValues",()=>e.innerType._zod.propValues),B(t._zod,"values",()=>e.innerType._zod.values),B(t._zod,"optin",()=>e.innerType?._zod?.optin),B(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(qv):qv(n)}});zd=m("$ZodTemplateLiteral",(t,e)=>{U.init(t,e);let r=[];for(let i of e.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let n=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(o,s))}else if(i===null||ku.has(typeof i))r.push(Ye(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(i,n)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:t,expected:"string",code:"invalid_type"}),i):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),i)}),Ud=m("$ZodFunction",(t,e)=>(U.init(t,e),t._def=e,t._zod.def=e,t.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...i){let n=t._def.input?Do(t._def.input,i):i,o=Reflect.apply(r,this,n);return t._def.output?Do(t._def.output,o):o}},t.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let n=t._def.input?await No(t._def.input,i):i,o=await Reflect.apply(r,this,n);return t._def.output?await No(t._def.output,o):o}},t._zod.parse=(r,i)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:t}),r):(t._def.output&&t._def.output._zod.def.type==="promise"?r.value=t.implementAsync(r.value):r.value=t.implement(r.value),r),t.input=(...r)=>{let i=t.constructor;return Array.isArray(r[0])?new i({type:"function",input:new rs({type:"tuple",items:r[0],rest:r[1]}),output:t._def.output}):new i({type:"function",input:r[0],output:t._def.output})},t.output=r=>{let i=t.constructor;return new i({type:"function",input:t._def.input,output:r})},t)),jd=m("$ZodPromise",(t,e)=>{U.init(t,e),t._zod.parse=(r,i)=>Promise.resolve(r.value).then(n=>e.innerType._zod.run({value:n,issues:[]},i))}),Fd=m("$ZodLazy",(t,e)=>{U.init(t,e),B(t._zod,"innerType",()=>{let r=e;return r._cachedInner||(r._cachedInner=e.getter()),r._cachedInner}),B(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),B(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),B(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),B(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(r,i)=>t._zod.innerType._zod.run(r,i)}),Vd=m("$ZodCustom",(t,e)=>{X.init(t,e),U.init(t,e),t._zod.parse=(r,i)=>r,t._zod.check=r=>{let i=r.value,n=e.fn(i);if(n instanceof Promise)return n.then(o=>Jv(o,r,i,t));Jv(n,r,i,t)}})});function ty(){return{localeError:WT()}}var WT,ry=g(()=>{N();WT=()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(n){return t[n]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${w(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.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 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.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 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;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 "${n.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}`:`${r[o.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${v(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}}});function ny(){return{localeError:HT()}}var HT,iy=g(()=>{N();HT=()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(n){return t[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${a}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${w(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${v(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}}});function oy(t,e,r,i){let n=Math.abs(t),o=n%10,s=n%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?r:i}function sy(){return{localeError:qT()}}var qT,ay=g(()=>{N();qT=()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(n){return t[n]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${w(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);if(s){let a=Number(n.maximum),c=oy(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 ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${n.maximum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);if(s){let a=Number(n.minimum),c=oy(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 ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${n.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${v(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}}});function cy(){return{localeError:JT()}}var JT,uy=g(()=>{N();JT=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(n){return t[n]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${w(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${n.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 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${n.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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} ${r[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${v(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}}});function ly(){return{localeError:KT()}}var KT,dy=g(()=>{N();KT=()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(n){return t[n]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${a}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${w(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${v(n.values," o ")}`;case"too_big":{let o=n.inclusive?"com a m\xE0xim":"menys de",s=e(n.origin);return s?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${o} ${n.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"com a m\xEDnim":"m\xE9s de",s=e(n.origin);return s?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${o} ${n.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${v(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}}});function hy(){return{localeError:YT()}}var YT,fy=g(()=>{N();YT=()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(n){return t[n]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${a}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${w(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${v(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}}});function py(){return{localeError:XT()}}var XT,my=g(()=>{N();XT=()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(n){return t[n]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${a}`:`Ugyldigt input: forventede ${o}, fik ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${w(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin),a=i[n.origin]??n.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${o} ${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin),a=i[n.origin]??n.origin;return s?`For lille: forventede ${a} ${s.verb} ${o} ${n.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${v(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}}});function gy(){return{localeError:QT()}}var QT,vy=g(()=>{N();QT=()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(n){return t[n]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},i={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${a}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${w(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case"invalid_format":{let o=n;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: ${r[o.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${v(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}}});function yy(){return{localeError:e1()}}var e1,_y=g(()=>{N();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(n){return t[n]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return typeof n.expected=="string"&&/^[A-Z]/.test(n.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${n.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${o}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`}case"invalid_value":return n.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${w(n.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${n.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 ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${o}${n.minimum.toString()} ${s.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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: ${r[o.format]??n.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${n.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${n.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${n.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${v(n.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${n.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${n.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}}});function os(){return{localeError:t1()}}var t1,Bd=g(()=>{N();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(n){return t[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${w(n.values[0])}`:`Invalid option: expected one of ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${v(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(s=>`'${s}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}}});function by(){return{localeError:r1()}}var r1,$y=g(()=>{N();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(n){return t[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${a}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${w(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${o}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${v(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}}});function wy(){return{localeError:n1()}}var n1,xy=g(()=>{N();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(n){return t[n]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${w(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin),a=i[n.origin]??n.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${o}${n.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin),a=i[n.origin]??n.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${o}${n.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${v(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}}});function Sy(){return{localeError:i1()}}var i1,Ey=g(()=>{N();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(n){return t[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${w(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${v(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=n;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`:`${r[o.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${v(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}}});function ky(){return{localeError:o1()}}var o1,Iy=g(()=>{N();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(n){return t[n]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${a}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${w(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${n.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${n.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${v(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}}});function Ty(){return{localeError:s1()}}var s1,Ay=g(()=>{N();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(n){return t[n]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${a} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${w(n.values[0])} attendu`:`Option invalide : une valeur parmi ${v(n.values,"|")} attendue`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Trop grand : ${i[n.origin]??"valeur"} doit ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i[n.origin]??"valeur"} doit \xEAtre ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Trop petit : ${i[n.origin]??"valeur"} doit ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Trop petit : ${i[n.origin]??"valeur"} doit \xEAtre ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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}`:`${r[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${v(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}}});function Oy(){return{localeError:a1()}}var a1,Py=g(()=>{N();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(n){return t[n]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${a}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${w(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u2264":"<",s=e(n.origin);return s?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u2265":">",s=e(n.origin);return s?`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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}`:`${r[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${v(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}}});function Cy(){return{localeError:c1()}}var c1,Ry=g(()=>{N();c1=()=>{let t={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=u=>u?t[u]:void 0,i=u=>{let l=r(u);return l?l.label:u??t.unknown.label},n=u=>`\u05D4${i(u)}`,o=u=>(r(u)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=u=>u?e[u]??null:null,a={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let l=u.expected,d=c[l??""]??i(l),h=x(u.input),f=c[h]??t[h]?.label??h;return/^[A-Z]/.test(u.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${u.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(u.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 ${w(u.values[0])}`;let l=u.values.map(f=>w(f));if(u.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(u.origin),d=n(u.origin??"value");if(u.origin==="string")return`${l?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.maximum.toString()} ${l?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(u.origin==="number"){let p=u.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${u.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}`}if(u.origin==="array"||u.origin==="set"){let p=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",y=u.inclusive?`${u.maximum} ${l?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${u.maximum} ${l?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${p} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let h=u.inclusive?"<=":"<",f=o(u.origin??"value");return l?.unit?`${l.longLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${h}${u.maximum.toString()} ${l.unit}`:`${l?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${f} ${h}${u.maximum.toString()}`}case"too_small":{let l=s(u.origin),d=n(u.origin??"value");if(u.origin==="string")return`${l?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.minimum.toString()} ${l?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(u.origin==="number"){let p=u.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${u.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}`}if(u.origin==="array"||u.origin==="set"){let p=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(u.minimum===1&&u.inclusive){let b=(u.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 ${b}`}let y=u.inclusive?`${u.minimum} ${l?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${u.minimum} ${l?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${p} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let h=u.inclusive?">=":">",f=o(u.origin??"value");return l?.unit?`${l.shortLabel} \u05DE\u05D3\u05D9: ${d} ${f} ${h}${u.minimum.toString()} ${l.unit}`:`${l?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${f} ${h}${u.minimum.toString()}`}case"invalid_format":{let l=u;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 ${u.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${u.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${u.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${v(u.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(u.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}}});function Dy(){return{localeError:u1()}}var u1,Ny=g(()=>{N();u1=()=>{let t={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function e(n){return t[n]??null}let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},i={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${a}`:`Neispravan unos: o\u010Dekuje se ${o}, a primljeno je ${a}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${w(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin),a=i[n.origin]??n.origin;return s?`Preveliko: o\u010Dekivano da ${a??"vrijednost"} ima ${o}${n.maximum.toString()} ${s.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${a??"vrijednost"} bude ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin),a=i[n.origin]??n.origin;return s?`Premalo: o\u010Dekivano da ${a} ima ${o}${n.minimum.toString()} ${s.unit}`:`Premalo: o\u010Dekivano da ${a} bude ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${n.divisor}`;case"unrecognized_keys":return`Neprepoznat${n.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${v(n.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${i[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${i[n.origin]??n.origin}`;default:return"Neispravan unos"}}}});function Ly(){return{localeError:l1()}}var l1,My=g(()=>{N();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(n){return t[n]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${w(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${n.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${o}${n.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${v(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}}});function zy(t,e,r){return Math.abs(t)===1?e:r}function rn(t){if(!t)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=t[t.length-1];return t+(e.includes(r)?"\u0576":"\u0568")}function Uy(){return{localeError:d1()}}var d1,jy=g(()=>{N();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(n){return t[n]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${w(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);if(s){let a=Number(n.maximum),c=zy(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 ${rn(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${n.maximum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${rn(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);if(s){let a=Number(n.minimum),c=zy(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 ${rn(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${n.minimum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${rn(n.origin)} \u056C\u056B\u0576\u056B ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${v(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${rn(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${rn(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}}});function Fy(){return{localeError:h1()}}var h1,Vy=g(()=>{N();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(n){return t[n]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${o}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${w(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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}`:`${r[o.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${v(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}}});function Zy(){return{localeError:f1()}}var f1,By=g(()=>{N();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(n){return t[n]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${o}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${w(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${o}${n.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${o}${n.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${v(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}}});function Gy(){return{localeError:p1()}}var p1,Wy=g(()=>{N();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(n){return t[n]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${a}`:`Input non valido: atteso ${o}, ricevuto ${a}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${w(n.values[0])}`:`Opzione non valida: atteso uno tra ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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: ${r[o.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${v(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}}});function Hy(){return{localeError:m1()}}var m1,qy=g(()=>{N();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(n){return t[n]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${w(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${v(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=e(n.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=e(n.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=n;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${r[o.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${v(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}}});function Jy(){return{localeError:g1()}}var g1,Ky=g(()=>{N();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(n){return t[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${w(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${v(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.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 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${n.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 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.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 ${n.origin} ${s.verb} ${o}${n.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 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${v(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}}});function ss(){return{localeError:v1()}}var v1,Gd=g(()=>{N();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(n){return t[n]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},i={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${w(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${v(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}}});function Yy(){return ss()}var Xy=g(()=>{Gd()});function Qy(){return{localeError:y1()}}var y1,e_=g(()=>{N();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(n){return t[n]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${w(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${v(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(n.origin),c=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${c} ${o}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${o}${s}`}case"too_small":{let o=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(n.origin),c=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${c} ${o}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${v(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}}});function t_(t){let e=Math.abs(t),r=e%10,i=e%100;return i>=11&&i<=19||r===0?"many":r===1?"one":"few"}function r_(){return{localeError:_1()}}var pi,_1,n_=g(()=>{N();pi=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(n,o,s,a){let c=t[n]??null;return c===null?c:{unit:c.unit[o],verb:c.verb[a][s?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},i={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${o}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${w(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${v(n.values,"|")} pasirinkim\u0173`;case"too_big":{let o=i[n.origin]??n.origin,s=e(n.origin,t_(Number(n.maximum)),n.inclusive??!1,"smaller");if(s?.verb)return`${pi(o??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.maximum.toString()} ${s.unit??"element\u0173"}`;let a=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${pi(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.maximum.toString()} ${s?.unit}`}case"too_small":{let o=i[n.origin]??n.origin,s=e(n.origin,t_(Number(n.minimum)),n.inclusive??!1,"bigger");if(s?.verb)return`${pi(o??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.minimum.toString()} ${s.unit??"element\u0173"}`;let a=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${pi(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.minimum.toString()} ${s?.unit}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${v(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=i[n.origin]??n.origin;return`${pi(o??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}}});function i_(){return{localeError:b1()}}var b1,o_=g(()=>{N();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(n){return t[n]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${w(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.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 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.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 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${v(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}}});function s_(){return{localeError:$1()}}var $1,a_=g(()=>{N();$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(n){return t[n]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${a}`:`Input tidak sah: dijangka ${o}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${w(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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}`:`${r[o.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${v(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}}});function c_(){return{localeError:w1()}}var w1,u_=g(()=>{N();w1=()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(n){return t[n]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},i={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${o}, ontving ${a}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${w(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin),a=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin),a=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case"invalid_format":{let o=n;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: ${r[o.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${v(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}}});function l_(){return{localeError:x1()}}var x1,d_=g(()=>{N();x1=()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(n){return t[n]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${a}`:`Ugyldig input: forventet ${o}, fikk ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${w(n.values[0])}`:`Ugyldig valg: forventet en av ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${v(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}}});function h_(){return{localeError:S1()}}var S1,f_=g(()=>{N();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(n){return t[n]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${a}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${w(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${v(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}}});function p_(){return{localeError:E1()}}var E1,m_=g(()=>{N();E1=()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(n){return t[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${w(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${v(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=n;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`:`${r[o.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${v(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}}});function g_(){return{localeError:k1()}}var k1,v_=g(()=>{N();k1=()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(n){return t[n]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},i={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${a}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${w(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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) ${r[o.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${v(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}}});function y_(){return{localeError:I1()}}var I1,__=g(()=>{N();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(n){return t[n]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${a}`:`Tipo inv\xE1lido: esperado ${o}, recebido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${w(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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}`:`${r[o.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${v(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}}});function b_(){return{localeError:T1()}}var T1,$_=g(()=>{N();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(n){return t[n]??null}let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},i={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return`Intrare invalid\u0103: a\u0219teptat ${o}, primit ${a}`}case"invalid_value":return n.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${w(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Prea mic: a\u0219teptat ca ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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: ${r[o.format]??n.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${n.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${v(n.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${n.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${n.origin}`;default:return"Intrare invalid\u0103"}}}});function w_(t,e,r,i){let n=Math.abs(t),o=n%10,s=n%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?r:i}function x_(){return{localeError:A1()}}var A1,S_=g(()=>{N();A1=()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(n){return t[n]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${w(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);if(s){let a=Number(n.maximum),c=w_(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 ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${n.maximum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);if(s){let a=Number(n.minimum),c=w_(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 ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${n.minimum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${v(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}}});function E_(){return{localeError:O1()}}var O1,k_=g(()=>{N();O1=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(n){return t[n]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${a}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${w(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${v(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}}});function I_(){return{localeError:P1()}}var P1,T_=g(()=>{N();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(n){return t[n]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${a}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${w(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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) ${r[o.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${v(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}}});function A_(){return{localeError:C1()}}var C1,O_=g(()=>{N();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(n){return t[n]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${w(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${v(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.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 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.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 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.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 ${n.origin} ${o}${n.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 ${n.origin} ${o}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${v(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}}});function P_(){return{localeError:R1()}}var R1,C_=g(()=>{N();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(n){return t[n]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},i={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${w(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=e(n.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=e(n.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;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: ${r[o.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${v(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}}});function R_(){return{localeError:D1()}}var D1,D_=g(()=>{N();D1=()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(n){return t[n]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${a}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${w(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${v(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}}});function as(){return{localeError:N1()}}var N1,Wd=g(()=>{N();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(n){return t[n]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${w(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.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 ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${n.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 ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.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 ${n.origin} ${s.verb} ${o}${n.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 ${n.origin} \u0431\u0443\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${v(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}}});function N_(){return as()}var L_=g(()=>{Wd()});function M_(){return{localeError:L1()}}var L1,z_=g(()=>{N();L1=()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(n){return t[n]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${w(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${v(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${n.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: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${o}${n.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${o}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${v(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}}});function U_(){return{localeError:M1()}}var M1,j_=g(()=>{N();M1=()=>{let t={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function e(n){return t[n]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${a}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${w(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${v(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}}});function F_(){return{localeError:z1()}}var z1,V_=g(()=>{N();z1=()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(n){return t[n]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${w(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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}`:`${r[o.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${v(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}}});function Z_(){return{localeError:U1()}}var U1,B_=g(()=>{N();U1=()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(n){return t[n]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${w(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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${r[o.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${v(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}}});function G_(){return{localeError:j1()}}var j1,W_=g(()=>{N();j1=()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(n){return t[n]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},i={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${w(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;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 ${r[o.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${v(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}}});function H_(){return{localeError:F1()}}var F1,q_=g(()=>{N();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(n){return t[n]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let o=i[n.expected]??n.expected,s=x(n.input),a=i[s]??s;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${w(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${v(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${s.verb} ${o}${n.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.maximum}`}case"too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${s.verb} ${o}${n.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.minimum}`}case"invalid_format":{let o=n;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: ${r[o.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${v(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}}});var mi={};Je(mi,{ar:()=>ty,az:()=>ny,be:()=>sy,bg:()=>cy,ca:()=>ly,cs:()=>hy,da:()=>py,de:()=>gy,el:()=>yy,en:()=>os,eo:()=>by,es:()=>wy,fa:()=>Sy,fi:()=>ky,fr:()=>Ty,frCA:()=>Oy,he:()=>Cy,hr:()=>Dy,hu:()=>Ly,hy:()=>Uy,id:()=>Fy,is:()=>Zy,it:()=>Gy,ja:()=>Hy,ka:()=>Jy,kh:()=>Yy,km:()=>ss,ko:()=>Qy,lt:()=>r_,mk:()=>i_,ms:()=>s_,nl:()=>c_,no:()=>l_,ota:()=>h_,pl:()=>g_,ps:()=>p_,pt:()=>y_,ro:()=>b_,ru:()=>x_,sl:()=>E_,sv:()=>I_,ta:()=>A_,th:()=>P_,tr:()=>R_,ua:()=>N_,uk:()=>as,ur:()=>M_,uz:()=>U_,vi:()=>F_,yo:()=>H_,zhCN:()=>Z_,zhTW:()=>G_});var Hd=g(()=>{ry();iy();ay();uy();dy();fy();my();vy();_y();Bd();$y();xy();Ey();Iy();Ay();Py();Ry();Ny();My();jy();Vy();By();Wy();qy();Ky();Xy();Gd();e_();n_();o_();a_();u_();d_();f_();m_();v_();__();$_();S_();k_();T_();O_();C_();D_();L_();Wd();z_();j_();V_();B_();W_();q_()});function us(){return new cs}var J_,qd,Jd,cs,_e,gi=g(()=>{qd=Symbol("ZodOutput"),Jd=Symbol("ZodInput"),cs=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let i=r[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let i={...this.get(r)??{}};delete i.id;let n={...i,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};(J_=globalThis).__zod_globalRegistry??(J_.__zod_globalRegistry=us());_e=globalThis.__zod_globalRegistry});function Kd(t,e){return new t({type:"string",...I(e)})}function Yd(t,e){return new t({type:"string",coerce:!0,...I(e)})}function ls(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...I(e)})}function vi(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...I(e)})}function ds(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...I(e)})}function hs(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...I(e)})}function fs(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...I(e)})}function ps(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...I(e)})}function yi(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...I(e)})}function ms(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...I(e)})}function gs(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...I(e)})}function vs(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...I(e)})}function ys(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...I(e)})}function _s(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...I(e)})}function bs(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...I(e)})}function $s(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...I(e)})}function ws(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...I(e)})}function xs(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...I(e)})}function Xd(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...I(e)})}function Ss(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...I(e)})}function Es(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...I(e)})}function ks(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...I(e)})}function Is(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...I(e)})}function Ts(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...I(e)})}function As(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...I(e)})}function eh(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...I(e)})}function th(t,e){return new t({type:"string",format:"date",check:"string_format",...I(e)})}function rh(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...I(e)})}function nh(t,e){return new t({type:"string",format:"duration",check:"string_format",...I(e)})}function ih(t,e){return new t({type:"number",checks:[],...I(e)})}function oh(t,e){return new t({type:"number",coerce:!0,checks:[],...I(e)})}function sh(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...I(e)})}function ah(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...I(e)})}function ch(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...I(e)})}function uh(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...I(e)})}function lh(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...I(e)})}function dh(t,e){return new t({type:"boolean",...I(e)})}function hh(t,e){return new t({type:"boolean",coerce:!0,...I(e)})}function fh(t,e){return new t({type:"bigint",...I(e)})}function ph(t,e){return new t({type:"bigint",coerce:!0,...I(e)})}function mh(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...I(e)})}function gh(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...I(e)})}function vh(t,e){return new t({type:"symbol",...I(e)})}function yh(t,e){return new t({type:"undefined",...I(e)})}function _h(t,e){return new t({type:"null",...I(e)})}function bh(t){return new t({type:"any"})}function $h(t){return new t({type:"unknown"})}function wh(t,e){return new t({type:"never",...I(e)})}function xh(t,e){return new t({type:"void",...I(e)})}function Sh(t,e){return new t({type:"date",...I(e)})}function Eh(t,e){return new t({type:"date",coerce:!0,...I(e)})}function kh(t,e){return new t({type:"nan",...I(e)})}function ht(t,e){return new Ho({check:"less_than",...I(e),value:t,inclusive:!1})}function We(t,e){return new Ho({check:"less_than",...I(e),value:t,inclusive:!0})}function ft(t,e){return new qo({check:"greater_than",...I(e),value:t,inclusive:!1})}function Ce(t,e){return new qo({check:"greater_than",...I(e),value:t,inclusive:!0})}function Os(t){return ft(0,t)}function Ps(t){return ht(0,t)}function Cs(t){return We(0,t)}function Rs(t){return Ce(0,t)}function Ht(t,e){return new hl({check:"multiple_of",...I(e),value:t})}function qt(t,e){return new ml({check:"max_size",...I(e),maximum:t})}function pt(t,e){return new gl({check:"min_size",...I(e),minimum:t})}function yr(t,e){return new vl({check:"size_equals",...I(e),size:t})}function _r(t,e){return new yl({check:"max_length",...I(e),maximum:t})}function St(t,e){return new _l({check:"min_length",...I(e),minimum:t})}function br(t,e){return new bl({check:"length_equals",...I(e),length:t})}function nn(t,e){return new $l({check:"string_format",format:"regex",...I(e),pattern:t})}function on(t){return new wl({check:"string_format",format:"lowercase",...I(t)})}function sn(t){return new xl({check:"string_format",format:"uppercase",...I(t)})}function an(t,e){return new Sl({check:"string_format",format:"includes",...I(e),includes:t})}function cn(t,e){return new El({check:"string_format",format:"starts_with",...I(e),prefix:t})}function un(t,e){return new kl({check:"string_format",format:"ends_with",...I(e),suffix:t})}function Ds(t,e,r){return new Il({check:"property",property:t,schema:e,...I(r)})}function ln(t,e){return new Tl({check:"mime_type",mime:t,...I(e)})}function ct(t){return new Al({check:"overwrite",tx:t})}function dn(t){return ct(e=>e.normalize(t))}function hn(){return ct(t=>t.trim())}function fn(){return ct(t=>t.toLowerCase())}function pn(){return ct(t=>t.toUpperCase())}function mn(){return ct(t=>xu(t))}function Ih(t,e,r){return new t({type:"array",element:e,...I(r)})}function Z1(t,e,r){return new t({type:"union",options:e,...I(r)})}function B1(t,e,r){return new t({type:"union",options:e,inclusive:!1,...I(r)})}function G1(t,e,r,i){return new t({type:"union",options:r,discriminator:e,...I(i)})}function W1(t,e,r){return new t({type:"intersection",left:e,right:r})}function H1(t,e,r,i){let n=r instanceof U,o=n?i:r,s=n?r:null;return new t({type:"tuple",items:e,rest:s,...I(o)})}function q1(t,e,r,i){return new t({type:"record",keyType:e,valueType:r,...I(i)})}function J1(t,e,r,i){return new t({type:"map",keyType:e,valueType:r,...I(i)})}function K1(t,e,r){return new t({type:"set",valueType:e,...I(r)})}function Y1(t,e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new t({type:"enum",entries:i,...I(r)})}function X1(t,e,r){return new t({type:"enum",entries:e,...I(r)})}function Q1(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...I(r)})}function Th(t,e){return new t({type:"file",...I(e)})}function eA(t,e){return new t({type:"transform",transform:e})}function tA(t,e){return new t({type:"optional",innerType:e})}function rA(t,e){return new t({type:"nullable",innerType:e})}function nA(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():Eu(r)}})}function iA(t,e,r){return new t({type:"nonoptional",innerType:e,...I(r)})}function oA(t,e){return new t({type:"success",innerType:e})}function sA(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function aA(t,e,r){return new t({type:"pipe",in:e,out:r})}function cA(t,e){return new t({type:"readonly",innerType:e})}function uA(t,e,r){return new t({type:"template_literal",parts:e,...I(r)})}function lA(t,e){return new t({type:"lazy",getter:e})}function dA(t,e){return new t({type:"promise",innerType:e})}function Ah(t,e,r){let i=I(r);return i.abort??(i.abort=!0),new t({type:"custom",check:"custom",fn:e,...i})}function Oh(t,e,r){return new t({type:"custom",check:"custom",fn:e,...I(r)})}function Ph(t,e){let r=K_(i=>(i.addIssue=n=>{if(typeof n=="string")i.issues.push(Kr(n,i.value,r._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=i.value),o.inst??(o.inst=r),o.continue??(o.continue=!r._zod.def.abort),i.issues.push(Kr(o))}},t(i.value,i)),e);return r}function K_(t,e){let r=new X({check:"custom",...I(e)});return r._zod.check=t,r}function Ch(t){let e=new X({check:"describe"});return e._zod.onattach=[r=>{let i=_e.get(r)??{};_e.add(r,{...i,description:t})}],e._zod.check=()=>{},e}function Rh(t){let e=new X({check:"meta"});return e._zod.onattach=[r=>{let i=_e.get(r)??{};_e.add(r,{...i,...t})}],e._zod.check=()=>{},e}function Dh(t,e){let r=I(e),i=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(f=>typeof f=="string"?f.toLowerCase():f),n=n.map(f=>typeof f=="string"?f.toLowerCase():f));let o=new Set(i),s=new Set(n),a=t.Codec??fi,c=t.Boolean??di,u=t.String??vr,l=new u({type:"string",error:r.error}),d=new c({type:"boolean",error:r.error}),h=new a({type:"pipe",in:l,out:d,transform:((f,p)=>{let y=f;return r.case!=="sensitive"&&(y=y.toLowerCase()),o.has(y)?!0:s.has(y)?!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":n[0]||"false"),error:r.error});return h}function gn(t,e,r,i={}){let n=I(i),o={...I(i),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:a=>r.test(a),...n};return r instanceof RegExp&&(o.pattern=r),new t(o)}var Qd,Y_=g(()=>{Jo();gi();Zd();N();Qd={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function Jt(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??_e,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,r={path:[],schemaPath:[]}){var i;let n=t._zod.def,o=e.seen.get(t);if(o)return o.count++,r.schemaPath.includes(t)&&(o.cycle=r.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,s);let a=t._zod.toJSONSchema?.();if(a)s.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,s.schema,l);else{let h=s.schema,f=e.processors[n.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.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 c=e.metadataRegistry.get(t);return c&&Object.assign(s.schema,c),e.io==="input"&&Re(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 Kt(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let s of t.seen.entries()){let a=t.metadataRegistry.get(s[0])?.id;if(a){let c=i.get(a);if(c&&c!==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 n=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]===r)return{ref:"#"};let u=`#/${a}/`,l=s[1].schema.id??`__schema${t.counter++}`;return{defId:l,ref:u+l}},o=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:u}=n(s);a.def={...a.schema},u&&(a.defId=u);let l=a.schema;for(let d in l)delete l[d];l.$ref=c};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 u=t.external.registry.get(s[0])?.id;if(e!==s[0]&&u){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 Yt(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 c=t.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.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")?(u.allOf=u.allOf??[],u.allOf.push(p)):Object.assign(u,p),Object.assign(u,l),a._zod.parent===d)for(let $ in u)$==="$ref"||$==="allOf"||$ in l||delete u[$];if(p.$ref&&f.def)for(let $ in u)$==="$ref"||$==="allOf"||$ in f.def&&JSON.stringify(u[$])===JSON.stringify(f.def[$])&&delete u[$]}let h=a._zod.parent;if(h&&h!==d){i(h);let f=t.seen.get(h);if(f?.schema.$ref&&(u.$ref=f.schema.$ref,f.def))for(let p in u)p==="$ref"||p==="allOf"||p in f.def&&JSON.stringify(u[p])===JSON.stringify(f.def[p])&&delete u[p]}t.override({zodSchema:a,jsonSchema:u,path:c.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 c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,s[c.defId]=c.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:vn(e,"input",t.processors),output:vn(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Ce(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 Ce(i.element,n);if(i.type==="set")return Ce(i.valueType,n);if(i.type==="lazy")return Ce(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 Ce(i.innerType,n);if(i.type==="intersection")return Ce(i.left,n)||Ce(i.right,n);if(i.type==="record"||i.type==="map")return Ce(i.keyType,n)||Ce(i.valueType,n);if(i.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Ce(i.in,n)||Ce(i.out,n);if(i.type==="object"){for(let r in i.shape)if(Ce(i.shape[r],n))return!0;return!1}if(i.type==="union"){for(let r of i.options)if(Ce(r,n))return!0;return!1}if(i.type==="tuple"){for(let r of i.items)if(Ce(r,n))return!0;return!!(i.rest&&Ce(i.rest,n))}return!1}var Ah,vn,_i=g(()=>{gi();Ah=(t,e={})=>n=>{let i=Jt({...n,processors:e});return W(t,i),Kt(i,t),Yt(i,t)},vn=(t,e,n={})=>i=>{let{libraryOptions:r,target:o}=i??{},s=Jt({...r??{},target:o,io:e,processors:n});return W(t,s),Kt(s,t),Yt(s,t)}});function zs(t,e){if("_idmap"in t){let i=t,r=Jt({...e,processors:Ds}),o={};for(let c of i._idmap.entries()){let[u,l]=c;W(l,r)}let s={},a={registry:i,uri:e?.uri,defs:o};r.external=a;for(let c of i._idmap.entries()){let[u,l]=c;Kt(r,l),s[u]=Yt(r,l)}if(Object.keys(o).length>0){let c=r.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:o}}return{schemas:s}}let n=Jt({...e,processors:Ds});return W(t,n),Kt(n,t),Yt(n,t)}var KT,Oh,Ph,Ch,Rh,Nh,Dh,Lh,Mh,zh,Uh,jh,Fh,Vh,Zh,Bh,Gh,Wh,Hh,qh,Jh,Kh,Yh,Xh,Qh,ef,Ls,tf,rf,nf,of,sf,af,cf,uf,lf,df,hf,Ms,ff,Ds,bi=g(()=>{_i();D();KT={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Oh=(t,e,n,i)=>{let r=n;r.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:u}=t._zod.bag;if(typeof o=="number"&&(r.minLength=o),typeof s=="number"&&(r.maxLength=s),a&&(r.format=KT[a]??a,r.format===""&&delete r.format,a==="time"&&delete r.format),u&&(r.contentEncoding=u),c&&c.size>0){let l=[...c];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:c,exclusiveMaximum:u,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 u=="number"&&u<=(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=u,r.exclusiveMaximum=!0):r.exclusiveMaximum=u:typeof s=="number"&&(r.maximum=s),typeof c=="number"&&(r.multipleOf=c)},Ch=(t,e,n,i)=>{n.type="boolean"},Rh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Nh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Dh=(t,e,n,i)=>{e.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},Lh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Mh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},zh=(t,e,n,i)=>{n.not={}},Uh=(t,e,n,i)=>{},jh=(t,e,n,i)=>{},Fh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Vh=(t,e,n,i)=>{let r=t._zod.def,o=ei(r.entries);o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),n.enum=o},Zh=(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},Bh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Gh=(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},Wh=(t,e,n,i)=>{let r=n,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:c}=t._zod.bag;s!==void 0&&(o.minLength=s),a!==void 0&&(o.maxLength=a),c?c.length===1?(o.contentMediaType=c[0],Object.assign(r,o)):(Object.assign(r,o),r.anyOf=c.map(u=>({contentMediaType:u}))):Object.assign(r,o)},Hh=(t,e,n,i)=>{n.type="boolean"},qh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Jh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Kh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Yh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Xh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Qh=(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 u in s)r.properties[u]=W(s[u],e,{...i,path:[...i.path,"properties",u]});let a=new Set(Object.keys(s)),c=new Set([...a].filter(u=>{let l=o.shape[u]._zod;return e.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(r.required=Array.from(c)),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)},Ls=(t,e,n,i)=>{let r=t._zod.def,o=r.inclusive===!1,s=r.options.map((a,c)=>W(a,e,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?n.oneOf=s:n.anyOf=s},tf=(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=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];n.allOf=c},rf=(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",c=o.items.map((h,f)=>W(h,e,{...i,path:[...i.path,s,f]})),u=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=c,u&&(r.items=u)):e.target==="openapi-3.0"?(r.items={anyOf:c},u&&r.items.anyOf.push(u),r.minItems=c.length,u||(r.maxItems=c.length)):(r.items=c,u&&(r.additionalItems=u));let{minimum:l,maximum:d}=t._zod.bag;typeof l=="number"&&(r.minItems=l),typeof d=="number"&&(r.maxItems=d)},nf=(t,e,n,i)=>{let r=n,o=t._zod.def;r.type="object";let s=o.keyType,c=s._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){let l=W(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});r.patternProperties={};for(let d of c)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 u=s._zod.values;if(u){let l=[...u].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(r.required=l)}},of=(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"}]},sf=(t,e,n,i)=>{let r=t._zod.def;W(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},af=(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))},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,e.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},uf=(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},lf=(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},hf=(t,e,n,i)=>{let r=t._zod.def;W(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},Ms=(t,e,n,i)=>{let r=t._zod.def;W(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},ff=(t,e,n,i)=>{let r=t._zod.innerType;W(r,e,i);let o=e.seen.get(t);o.ref=r},Ds={string:Oh,number:Ph,boolean:Ch,bigint:Rh,symbol:Nh,null:Dh,undefined:Lh,void:Mh,never:zh,any:Uh,unknown:jh,date:Fh,enum:Vh,literal:Zh,nan:Bh,template_literal:Gh,file:Wh,success:Hh,custom:qh,function:Jh,transform:Kh,map:Yh,set:Xh,array:Qh,object:ef,union:Ls,intersection:tf,tuple:rf,record:nf,nullable:of,nonoptional:sf,default:af,prefault:cf,catch:uf,pipe:lf,readonly:df,promise:hf,optional:Ms,lazy:ff}});var Us,B_=g(()=>{bi();_i();Us=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=Jt({processors:Ds,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)),Kt(this.ctx,e);let i=Yt(this.ctx,e),{"~standard":r,...o}=i;return o}}});var G_={};var W_=g(()=>{});var Et={};Je(Et,{$ZodAny:()=>od,$ZodArray:()=>ld,$ZodAsyncError:()=>at,$ZodBase64:()=>Jl,$ZodBase64URL:()=>Kl,$ZodBigInt:()=>ts,$ZodBigIntFormat:()=>td,$ZodBoolean:()=>di,$ZodCIDRv4:()=>Wl,$ZodCIDRv6:()=>Hl,$ZodCUID:()=>Nl,$ZodCUID2:()=>Dl,$ZodCatch:()=>Td,$ZodCheck:()=>X,$ZodCheckBigIntFormat:()=>cl,$ZodCheckEndsWith:()=>bl,$ZodCheckGreaterThan:()=>qo,$ZodCheckIncludes:()=>yl,$ZodCheckLengthEquals:()=>pl,$ZodCheckLessThan:()=>Ho,$ZodCheckLowerCase:()=>gl,$ZodCheckMaxLength:()=>hl,$ZodCheckMaxSize:()=>ul,$ZodCheckMimeType:()=>wl,$ZodCheckMinLength:()=>fl,$ZodCheckMinSize:()=>ll,$ZodCheckMultipleOf:()=>sl,$ZodCheckNumberFormat:()=>al,$ZodCheckOverwrite:()=>xl,$ZodCheckProperty:()=>$l,$ZodCheckRegex:()=>ml,$ZodCheckSizeEquals:()=>dl,$ZodCheckStartsWith:()=>_l,$ZodCheckStringFormat:()=>tn,$ZodCheckUpperCase:()=>vl,$ZodCodec:()=>fi,$ZodCustom:()=>Ld,$ZodCustomStringFormat:()=>Ql,$ZodDate:()=>ud,$ZodDefault:()=>Sd,$ZodDiscriminatedUnion:()=>fd,$ZodE164:()=>Yl,$ZodEmail:()=>Ol,$ZodEmoji:()=>Cl,$ZodEncodeError:()=>Vt,$ZodEnum:()=>yd,$ZodError:()=>oi,$ZodExactOptional:()=>wd,$ZodFile:()=>bd,$ZodFunction:()=>Rd,$ZodGUID:()=>Tl,$ZodIPv4:()=>Zl,$ZodIPv6:()=>Bl,$ZodISODate:()=>jl,$ZodISODateTime:()=>Ul,$ZodISODuration:()=>Vl,$ZodISOTime:()=>Fl,$ZodIntersection:()=>pd,$ZodJWT:()=>Xl,$ZodKSUID:()=>zl,$ZodLazy:()=>Dd,$ZodLiteral:()=>_d,$ZodMAC:()=>Gl,$ZodMap:()=>gd,$ZodNaN:()=>Ad,$ZodNanoID:()=>Rl,$ZodNever:()=>ad,$ZodNonOptional:()=>Id,$ZodNull:()=>id,$ZodNullable:()=>xd,$ZodNumber:()=>es,$ZodNumberFormat:()=>ed,$ZodObject:()=>Wv,$ZodObjectJIT:()=>dd,$ZodOptional:()=>ns,$ZodPipe:()=>is,$ZodPrefault:()=>Ed,$ZodPreprocess:()=>Od,$ZodPromise:()=>Nd,$ZodReadonly:()=>Pd,$ZodRealError:()=>Me,$ZodRecord:()=>md,$ZodRegistry:()=>cs,$ZodSet:()=>vd,$ZodString:()=>gr,$ZodStringFormat:()=>q,$ZodSuccess:()=>kd,$ZodSymbol:()=>rd,$ZodTemplateLiteral:()=>Cd,$ZodTransform:()=>$d,$ZodTuple:()=>rs,$ZodType:()=>M,$ZodULID:()=>Ll,$ZodURL:()=>Pl,$ZodUUID:()=>Al,$ZodUndefined:()=>nd,$ZodUnion:()=>hi,$ZodUnknown:()=>sd,$ZodVoid:()=>cd,$ZodXID:()=>Ml,$ZodXor:()=>hd,$brand:()=>fu,$constructor:()=>m,$input:()=>Zd,$output:()=>Vd,Doc:()=>li,JSONSchema:()=>G_,JSONSchemaGenerator:()=>Us,NEVER:()=>hu,TimePrecision:()=>Hd,_any:()=>ph,_array:()=>$h,_base64:()=>Is,_base64url:()=>ks,_bigint:()=>ah,_boolean:()=>oh,_catch:()=>BT,_check:()=>V_,_cidrv4:()=>Ss,_cidrv6:()=>Es,_coercedBigint:()=>ch,_coercedBoolean:()=>sh,_coercedDate:()=>_h,_coercedNumber:()=>Qd,_coercedString:()=>Gd,_cuid:()=>vs,_cuid2:()=>ys,_custom:()=>xh,_date:()=>yh,_decode:()=>Mo,_decodeAsync:()=>Uo,_default:()=>FT,_discriminatedUnion:()=>AT,_e164:()=>Ts,_email:()=>ls,_emoji:()=>ms,_encode:()=>Lo,_encodeAsync:()=>zo,_endsWith:()=>un,_enum:()=>DT,_file:()=>wh,_float32:()=>th,_float64:()=>rh,_gt:()=>ft,_gte:()=>Pe,_guid:()=>vi,_includes:()=>an,_int:()=>eh,_int32:()=>nh,_int64:()=>uh,_intersection:()=>OT,_ipv4:()=>ws,_ipv6:()=>xs,_isoDate:()=>Jd,_isoDateTime:()=>qd,_isoDuration:()=>Yd,_isoTime:()=>Kd,_jwt:()=>As,_ksuid:()=>$s,_lazy:()=>qT,_length:()=>_r,_literal:()=>MT,_lowercase:()=>on,_lt:()=>ht,_lte:()=>We,_mac:()=>Wd,_map:()=>RT,_max:()=>We,_maxLength:()=>yr,_maxSize:()=>qt,_mime:()=>ln,_min:()=>Pe,_minLength:()=>St,_minSize:()=>pt,_multipleOf:()=>Ht,_nan:()=>bh,_nanoid:()=>gs,_nativeEnum:()=>LT,_negative:()=>Ps,_never:()=>gh,_nonnegative:()=>Rs,_nonoptional:()=>VT,_nonpositive:()=>Cs,_normalize:()=>dn,_null:()=>fh,_nullable:()=>jT,_number:()=>Xd,_optional:()=>UT,_overwrite:()=>ct,_parse:()=>Yr,_parseAsync:()=>Xr,_pipe:()=>GT,_positive:()=>Os,_promise:()=>JT,_property:()=>Ns,_readonly:()=>WT,_record:()=>CT,_refine:()=>Sh,_regex:()=>nn,_safeDecode:()=>Fo,_safeDecodeAsync:()=>Zo,_safeEncode:()=>jo,_safeEncodeAsync:()=>Vo,_safeParse:()=>Qr,_safeParseAsync:()=>en,_set:()=>NT,_size:()=>vr,_slugify:()=>mn,_startsWith:()=>cn,_string:()=>Bd,_stringFormat:()=>gn,_stringbool:()=>Th,_success:()=>ZT,_superRefine:()=>Eh,_symbol:()=>dh,_templateLiteral:()=>HT,_toLowerCase:()=>fn,_toUpperCase:()=>pn,_transform:()=>zT,_trim:()=>hn,_tuple:()=>PT,_uint32:()=>ih,_uint64:()=>lh,_ulid:()=>_s,_undefined:()=>hh,_union:()=>kT,_unknown:()=>mh,_uppercase:()=>sn,_url:()=>yi,_uuid:()=>ds,_uuidv4:()=>hs,_uuidv6:()=>fs,_uuidv7:()=>ps,_void:()=>vh,_xid:()=>bs,_xor:()=>TT,clone:()=>Ae,config:()=>se,createStandardJSONSchemaMethod:()=>vn,createToJSONSchemaMethod:()=>Ah,decode:()=>Jk,decodeAsync:()=>Yk,describe:()=>Ih,encode:()=>qk,encodeAsync:()=>Kk,extractDefs:()=>Kt,finalize:()=>Yt,flattenError:()=>si,formatError:()=>ai,globalConfig:()=>hr,globalRegistry:()=>_e,initializeContext:()=>Jt,isValidBase64:()=>ql,isValidBase64URL:()=>Vv,isValidJWT:()=>Zv,locales:()=>mi,meta:()=>kh,parse:()=>No,parseAsync:()=>Do,prettifyError:()=>Iu,process:()=>W,regexes:()=>Ge,registry:()=>us,safeDecode:()=>Qk,safeDecodeAsync:()=>t1,safeEncode:()=>Xk,safeEncodeAsync:()=>e1,safeParse:()=>Tu,safeParseAsync:()=>Au,toDotPath:()=>$v,toJSONSchema:()=>zs,treeifyError:()=>Eu,util:()=>S,version:()=>El});var He=g(()=>{fr();Ou();ku();Md();Jo();Il();D();Wo();Fd();gi();Sl();Z_();_i();bi();B_();W_()});var js={};Je(js,{endsWith:()=>un,gt:()=>ft,gte:()=>Pe,includes:()=>an,length:()=>_r,lowercase:()=>on,lt:()=>ht,lte:()=>We,maxLength:()=>yr,maxSize:()=>qt,mime:()=>ln,minLength:()=>St,minSize:()=>pt,multipleOf:()=>Ht,negative:()=>Ps,nonnegative:()=>Rs,nonpositive:()=>Cs,normalize:()=>dn,overwrite:()=>ct,positive:()=>Os,property:()=>Ns,regex:()=>nn,size:()=>vr,slugify:()=>mn,startsWith:()=>cn,toLowerCase:()=>fn,toUpperCase:()=>pn,trim:()=>hn,uppercase:()=>sn});var Fs=g(()=>{He()});var yn={};Je(yn,{ZodISODate:()=>Zs,ZodISODateTime:()=>Vs,ZodISODuration:()=>Gs,ZodISOTime:()=>Bs,date:()=>mf,datetime:()=>pf,duration:()=>vf,time:()=>gf});function pf(t){return qd(Vs,t)}function mf(t){return Jd(Zs,t)}function gf(t){return Kd(Bs,t)}function vf(t){return Yd(Gs,t)}var Vs,Zs,Bs,Gs,$i=g(()=>{He();xi();Vs=m("ZodISODateTime",(t,e)=>{Ul.init(t,e),J.init(t,e)});Zs=m("ZodISODate",(t,e)=>{jl.init(t,e),J.init(t,e)});Bs=m("ZodISOTime",(t,e)=>{Fl.init(t,e),J.init(t,e)});Gs=m("ZodISODuration",(t,e)=>{Vl.init(t,e),J.init(t,e)})});var H_,XT,ze,yf=g(()=>{He();He();D();H_=(t,e)=>{oi.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>ai(t,n)},flatten:{value:n=>si(t,n)},addIssue:{value:n=>{t.issues.push(n),t.message=JSON.stringify(t.issues,qr,2)}},addIssues:{value:n=>{t.issues.push(...n),t.message=JSON.stringify(t.issues,qr,2)}},isEmpty:{get(){return t.issues.length===0}}})},XT=m("ZodError",H_),ze=m("ZodError",H_,{Parent:Error})});var _f,bf,$f,wf,xf,Sf,Ef,If,kf,Tf,Af,Of,Pf=g(()=>{He();yf();_f=Yr(ze),bf=Xr(ze),$f=Qr(ze),wf=en(ze),xf=Lo(ze),Sf=Mo(ze),Ef=zo(ze),If=Uo(ze),kf=jo(ze),Tf=Fo(ze),Af=Vo(ze),Of=Zo(ze)});var wi={};Je(wi,{ZodAny:()=>Uf,ZodArray:()=>Zf,ZodBase64:()=>aa,ZodBase64URL:()=>ca,ZodBigInt:()=>En,ZodBigIntFormat:()=>da,ZodBoolean:()=>Sn,ZodCIDRv4:()=>oa,ZodCIDRv6:()=>sa,ZodCUID:()=>Xs,ZodCUID2:()=>Qs,ZodCatch:()=>dp,ZodCodec:()=>Di,ZodCustom:()=>Li,ZodCustomStringFormat:()=>wn,ZodDate:()=>Oi,ZodDefault:()=>op,ZodDiscriminatedUnion:()=>Gf,ZodE164:()=>ua,ZodEmail:()=>Js,ZodEmoji:()=>Ks,ZodEnum:()=>bn,ZodExactOptional:()=>rp,ZodFile:()=>ep,ZodFunction:()=>$p,ZodGUID:()=>Ei,ZodIPv4:()=>na,ZodIPv6:()=>ia,ZodIntersection:()=>Wf,ZodJWT:()=>la,ZodKSUID:()=>ra,ZodLazy:()=>yp,ZodLiteral:()=>Qf,ZodMAC:()=>Cf,ZodMap:()=>Yf,ZodNaN:()=>fp,ZodNanoID:()=>Ys,ZodNever:()=>Ff,ZodNonOptional:()=>va,ZodNull:()=>Mf,ZodNullable:()=>ip,ZodNumber:()=>xn,ZodNumberFormat:()=>$r,ZodObject:()=>Ci,ZodOptional:()=>ga,ZodPipe:()=>Ni,ZodPrefault:()=>ap,ZodPreprocess:()=>pp,ZodPromise:()=>bp,ZodReadonly:()=>mp,ZodRecord:()=>_n,ZodSet:()=>Xf,ZodString:()=>$n,ZodStringFormat:()=>J,ZodSuccess:()=>lp,ZodSymbol:()=>Df,ZodTemplateLiteral:()=>vp,ZodTransform:()=>tp,ZodTuple:()=>qf,ZodType:()=>V,ZodULID:()=>ea,ZodURL:()=>Ai,ZodUUID:()=>mt,ZodUndefined:()=>Lf,ZodUnion:()=>Ri,ZodUnknown:()=>jf,ZodVoid:()=>Vf,ZodXID:()=>ta,ZodXor:()=>Bf,_ZodString:()=>qs,_default:()=>sp,_function:()=>t$,any:()=>Cb,array:()=>Pi,base64:()=>mb,base64url:()=>gb,bigint:()=>kb,boolean:()=>Nf,catch:()=>hp,check:()=>r$,cidrv4:()=>fb,cidrv6:()=>pb,codec:()=>Yb,cuid:()=>ob,cuid2:()=>sb,custom:()=>n$,date:()=>Nb,describe:()=>i$,discriminatedUnion:()=>jb,e164:()=>vb,email:()=>J_,emoji:()=>nb,enum:()=>pa,exactOptional:()=>np,file:()=>Hb,float32:()=>xb,float64:()=>Sb,function:()=>t$,guid:()=>K_,hash:()=>wb,hex:()=>$b,hostname:()=>bb,httpUrl:()=>rb,instanceof:()=>s$,int:()=>Ws,int32:()=>Eb,int64:()=>Tb,intersection:()=>Hf,invertCodec:()=>Xb,ipv4:()=>lb,ipv6:()=>hb,json:()=>c$,jwt:()=>yb,keyof:()=>Db,ksuid:()=>ub,lazy:()=>_p,literal:()=>Wb,looseObject:()=>zb,looseRecord:()=>Vb,mac:()=>db,map:()=>Zb,meta:()=>o$,nan:()=>Kb,nanoid:()=>ib,nativeEnum:()=>Gb,never:()=>ha,nonoptional:()=>up,null:()=>zf,nullable:()=>ki,nullish:()=>qb,number:()=>Rf,object:()=>Lb,optional:()=>Ii,partialRecord:()=>Fb,pipe:()=>Hs,prefault:()=>cp,preprocess:()=>u$,promise:()=>e$,readonly:()=>gp,record:()=>Kf,refine:()=>wp,set:()=>Bb,strictObject:()=>Mb,string:()=>Si,stringFormat:()=>_b,stringbool:()=>a$,success:()=>Jb,superRefine:()=>xp,symbol:()=>Ob,templateLiteral:()=>Qb,transform:()=>ma,tuple:()=>Jf,uint32:()=>Ib,uint64:()=>Ab,ulid:()=>ab,undefined:()=>Pb,union:()=>fa,unknown:()=>br,url:()=>tb,uuid:()=>Y_,uuidv4:()=>X_,uuidv6:()=>Q_,uuidv7:()=>eb,void:()=>Rb,xid:()=>cb,xor:()=>Ub});function Ti(t,e,n){let i=Object.getPrototypeOf(t),r=q_.get(i);if(r||(r=new Set,q_.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 Si(t){return Bd($n,t)}function J_(t){return ls(Js,t)}function K_(t){return vi(Ei,t)}function Y_(t){return ds(mt,t)}function X_(t){return hs(mt,t)}function Q_(t){return fs(mt,t)}function eb(t){return ps(mt,t)}function tb(t){return yi(Ai,t)}function rb(t){return yi(Ai,{protocol:Ge.httpProtocol,hostname:Ge.domain,...S.normalizeParams(t)})}function nb(t){return ms(Ks,t)}function ib(t){return gs(Ys,t)}function ob(t){return vs(Xs,t)}function sb(t){return ys(Qs,t)}function ab(t){return _s(ea,t)}function cb(t){return bs(ta,t)}function ub(t){return $s(ra,t)}function lb(t){return ws(na,t)}function db(t){return Wd(Cf,t)}function hb(t){return xs(ia,t)}function fb(t){return Ss(oa,t)}function pb(t){return Es(sa,t)}function mb(t){return Is(aa,t)}function gb(t){return ks(ca,t)}function vb(t){return Ts(ua,t)}function yb(t){return As(la,t)}function _b(t,e,n={}){return gn(wn,t,e,n)}function bb(t){return gn(wn,"hostname",Ge.hostname,t)}function $b(t){return gn(wn,"hex",Ge.hex,t)}function wb(t,e){let n=e?.enc??"hex",i=`${t}_${n}`,r=Ge[i];if(!r)throw new Error(`Unrecognized hash format: ${i}`);return gn(wn,i,r,e)}function Rf(t){return Xd(xn,t)}function Ws(t){return eh($r,t)}function xb(t){return th($r,t)}function Sb(t){return rh($r,t)}function Eb(t){return nh($r,t)}function Ib(t){return ih($r,t)}function Nf(t){return oh(Sn,t)}function kb(t){return ah(En,t)}function Tb(t){return uh(da,t)}function Ab(t){return lh(da,t)}function Ob(t){return dh(Df,t)}function Pb(t){return hh(Lf,t)}function zf(t){return fh(Mf,t)}function Cb(){return ph(Uf)}function br(){return mh(jf)}function ha(t){return gh(Ff,t)}function Rb(t){return vh(Vf,t)}function Nb(t){return yh(Oi,t)}function Pi(t,e){return $h(Zf,t,e)}function Db(t){let e=t._zod.def.shape;return pa(Object.keys(e))}function Lb(t,e){let n={type:"object",shape:t??{},...S.normalizeParams(e)};return new Ci(n)}function Mb(t,e){return new Ci({type:"object",shape:t,catchall:ha(),...S.normalizeParams(e)})}function zb(t,e){return new Ci({type:"object",shape:t,catchall:br(),...S.normalizeParams(e)})}function fa(t,e){return new Ri({type:"union",options:t,...S.normalizeParams(e)})}function Ub(t,e){return new Bf({type:"union",options:t,inclusive:!1,...S.normalizeParams(e)})}function jb(t,e,n){return new Gf({type:"union",options:e,discriminator:t,...S.normalizeParams(n)})}function Hf(t,e){return new Wf({type:"intersection",left:t,right:e})}function Jf(t,e,n){let i=e instanceof M,r=i?n:e,o=i?e:null;return new qf({type:"tuple",items:t,rest:o,...S.normalizeParams(r)})}function Kf(t,e,n){return!e||!e._zod?new _n({type:"record",keyType:Si(),valueType:t,...S.normalizeParams(e)}):new _n({type:"record",keyType:t,valueType:e,...S.normalizeParams(n)})}function Fb(t,e,n){let i=Ae(t);return i._zod.values=void 0,new _n({type:"record",keyType:i,valueType:e,...S.normalizeParams(n)})}function Vb(t,e,n){return new _n({type:"record",keyType:t,valueType:e,mode:"loose",...S.normalizeParams(n)})}function Zb(t,e,n){return new Yf({type:"map",keyType:t,valueType:e,...S.normalizeParams(n)})}function Bb(t,e){return new Xf({type:"set",valueType:t,...S.normalizeParams(e)})}function pa(t,e){let n=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new bn({type:"enum",entries:n,...S.normalizeParams(e)})}function Gb(t,e){return new bn({type:"enum",entries:t,...S.normalizeParams(e)})}function Wb(t,e){return new Qf({type:"literal",values:Array.isArray(t)?t:[t],...S.normalizeParams(e)})}function Hb(t){return wh(ep,t)}function ma(t){return new tp({type:"transform",transform:t})}function Ii(t){return new ga({type:"optional",innerType:t})}function np(t){return new rp({type:"optional",innerType:t})}function ki(t){return new ip({type:"nullable",innerType:t})}function qb(t){return Ii(ki(t))}function sp(t,e){return new op({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():S.shallowClone(e)}})}function cp(t,e){return new ap({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():S.shallowClone(e)}})}function up(t,e){return new va({type:"nonoptional",innerType:t,...S.normalizeParams(e)})}function Jb(t){return new lp({type:"success",innerType:t})}function hp(t,e){return new dp({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function Kb(t){return bh(fp,t)}function Hs(t,e){return new Ni({type:"pipe",in:t,out:e})}function Yb(t,e,n){return new Di({type:"pipe",in:t,out:e,transform:n.decode,reverseTransform:n.encode})}function Xb(t){let e=t._zod.def;return new Di({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}function gp(t){return new mp({type:"readonly",innerType:t})}function Qb(t,e){return new vp({type:"template_literal",parts:t,...S.normalizeParams(e)})}function _p(t){return new yp({type:"lazy",getter:t})}function e$(t){return new bp({type:"promise",innerType:t})}function t$(t){return new $p({type:"function",input:Array.isArray(t?.input)?Jf(t?.input):t?.input??Pi(br()),output:t?.output??br()})}function r$(t){let e=new X({check:"custom"});return e._zod.check=t,e}function n$(t,e){return xh(Li,t??(()=>!0),e)}function wp(t,e={}){return Sh(Li,t,e)}function xp(t,e){return Eh(t,e)}function s$(t,e={}){let n=new Li({type:"custom",check:"custom",fn:i=>i instanceof t,abort:!0,...S.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 c$(t){let e=_p(()=>fa([Si(t),Rf(),Nf(),zf(),Pi(e),Kf(Si(),e)]));return e}function u$(t,e){return new pp({type:"pipe",in:ma(t),out:e})}var q_,V,qs,$n,J,Js,Ei,mt,Ai,Ks,Ys,Xs,Qs,ea,ta,ra,na,Cf,ia,oa,sa,aa,ca,ua,la,wn,xn,$r,Sn,En,da,Df,Lf,Mf,Uf,jf,Ff,Vf,Oi,Zf,Ci,Ri,Bf,Gf,Wf,qf,_n,Yf,Xf,bn,Qf,ep,tp,ga,rp,ip,op,ap,va,lp,dp,fp,Ni,Di,pp,mp,vp,yp,bp,$p,Li,i$,o$,a$,xi=g(()=>{He();He();bi();_i();Fs();$i();Pf();q_=new WeakMap;V=m("ZodType",(t,e)=>(M.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:vn(t,"input"),output:vn(t,"output")}}),t.toJSONSchema=Ah(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(n,i)=>_f(t,n,i,{callee:t.parse}),t.safeParse=(n,i)=>$f(t,n,i),t.parseAsync=async(n,i)=>bf(t,n,i,{callee:t.parseAsync}),t.safeParseAsync=async(n,i)=>wf(t,n,i),t.spa=t.safeParseAsync,t.encode=(n,i)=>xf(t,n,i),t.decode=(n,i)=>Sf(t,n,i),t.encodeAsync=async(n,i)=>Ef(t,n,i),t.decodeAsync=async(n,i)=>If(t,n,i),t.safeEncode=(n,i)=>kf(t,n,i),t.safeDecode=(n,i)=>Tf(t,n,i),t.safeEncodeAsync=async(n,i)=>Af(t,n,i),t.safeDecodeAsync=async(n,i)=>Of(t,n,i),Ti(t,"ZodType",{check(...n){let i=this.def;return this.clone(S.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 Ae(this,n,i)},brand(){return this},register(n,i){return n.add(this,i),this},refine(n,i){return this.check(wp(n,i))},superRefine(n,i){return this.check(xp(n,i))},overwrite(n){return this.check(ct(n))},optional(){return Ii(this)},exactOptional(){return np(this)},nullable(){return ki(this)},nullish(){return Ii(ki(this))},nonoptional(n){return up(this,n)},array(){return Pi(this)},or(n){return fa([this,n])},and(n){return Hf(this,n)},transform(n){return Hs(this,ma(n))},default(n){return sp(this,n)},prefault(n){return cp(this,n)},catch(n){return hp(this,n)},pipe(n){return Hs(this,n)},readonly(){return gp(this)},describe(n){let i=this.clone();return _e.add(i,{description:n}),i},meta(...n){if(n.length===0)return _e.get(this);let i=this.clone();return _e.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 _e.get(t)?.description},configurable:!0}),t)),qs=m("_ZodString",(t,e)=>{gr.init(t,e),V.init(t,e),t._zod.processJSONSchema=(i,r,o)=>Oh(t,i,r,o);let n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,Ti(t,"_ZodString",{regex(...i){return this.check(nn(...i))},includes(...i){return this.check(an(...i))},startsWith(...i){return this.check(cn(...i))},endsWith(...i){return this.check(un(...i))},min(...i){return this.check(St(...i))},max(...i){return this.check(yr(...i))},length(...i){return this.check(_r(...i))},nonempty(...i){return this.check(St(1,...i))},lowercase(i){return this.check(on(i))},uppercase(i){return this.check(sn(i))},trim(){return this.check(hn())},normalize(...i){return this.check(dn(...i))},toLowerCase(){return this.check(fn())},toUpperCase(){return this.check(pn())},slugify(){return this.check(mn())}})}),$n=m("ZodString",(t,e)=>{gr.init(t,e),qs.init(t,e),t.email=n=>t.check(ls(Js,n)),t.url=n=>t.check(yi(Ai,n)),t.jwt=n=>t.check(As(la,n)),t.emoji=n=>t.check(ms(Ks,n)),t.guid=n=>t.check(vi(Ei,n)),t.uuid=n=>t.check(ds(mt,n)),t.uuidv4=n=>t.check(hs(mt,n)),t.uuidv6=n=>t.check(fs(mt,n)),t.uuidv7=n=>t.check(ps(mt,n)),t.nanoid=n=>t.check(gs(Ys,n)),t.guid=n=>t.check(vi(Ei,n)),t.cuid=n=>t.check(vs(Xs,n)),t.cuid2=n=>t.check(ys(Qs,n)),t.ulid=n=>t.check(_s(ea,n)),t.base64=n=>t.check(Is(aa,n)),t.base64url=n=>t.check(ks(ca,n)),t.xid=n=>t.check(bs(ta,n)),t.ksuid=n=>t.check($s(ra,n)),t.ipv4=n=>t.check(ws(na,n)),t.ipv6=n=>t.check(xs(ia,n)),t.cidrv4=n=>t.check(Ss(oa,n)),t.cidrv6=n=>t.check(Es(sa,n)),t.e164=n=>t.check(Ts(ua,n)),t.datetime=n=>t.check(pf(n)),t.date=n=>t.check(mf(n)),t.time=n=>t.check(gf(n)),t.duration=n=>t.check(vf(n))});J=m("ZodStringFormat",(t,e)=>{q.init(t,e),qs.init(t,e)}),Js=m("ZodEmail",(t,e)=>{Ol.init(t,e),J.init(t,e)});Ei=m("ZodGUID",(t,e)=>{Tl.init(t,e),J.init(t,e)});mt=m("ZodUUID",(t,e)=>{Al.init(t,e),J.init(t,e)});Ai=m("ZodURL",(t,e)=>{Pl.init(t,e),J.init(t,e)});Ks=m("ZodEmoji",(t,e)=>{Cl.init(t,e),J.init(t,e)});Ys=m("ZodNanoID",(t,e)=>{Rl.init(t,e),J.init(t,e)});Xs=m("ZodCUID",(t,e)=>{Nl.init(t,e),J.init(t,e)});Qs=m("ZodCUID2",(t,e)=>{Dl.init(t,e),J.init(t,e)});ea=m("ZodULID",(t,e)=>{Ll.init(t,e),J.init(t,e)});ta=m("ZodXID",(t,e)=>{Ml.init(t,e),J.init(t,e)});ra=m("ZodKSUID",(t,e)=>{zl.init(t,e),J.init(t,e)});na=m("ZodIPv4",(t,e)=>{Zl.init(t,e),J.init(t,e)});Cf=m("ZodMAC",(t,e)=>{Gl.init(t,e),J.init(t,e)});ia=m("ZodIPv6",(t,e)=>{Bl.init(t,e),J.init(t,e)});oa=m("ZodCIDRv4",(t,e)=>{Wl.init(t,e),J.init(t,e)});sa=m("ZodCIDRv6",(t,e)=>{Hl.init(t,e),J.init(t,e)});aa=m("ZodBase64",(t,e)=>{Jl.init(t,e),J.init(t,e)});ca=m("ZodBase64URL",(t,e)=>{Kl.init(t,e),J.init(t,e)});ua=m("ZodE164",(t,e)=>{Yl.init(t,e),J.init(t,e)});la=m("ZodJWT",(t,e)=>{Xl.init(t,e),J.init(t,e)});wn=m("ZodCustomStringFormat",(t,e)=>{Ql.init(t,e),J.init(t,e)});xn=m("ZodNumber",(t,e)=>{es.init(t,e),V.init(t,e),t._zod.processJSONSchema=(i,r,o)=>Ph(t,i,r,o),Ti(t,"ZodNumber",{gt(i,r){return this.check(ft(i,r))},gte(i,r){return this.check(Pe(i,r))},min(i,r){return this.check(Pe(i,r))},lt(i,r){return this.check(ht(i,r))},lte(i,r){return this.check(We(i,r))},max(i,r){return this.check(We(i,r))},int(i){return this.check(Ws(i))},safe(i){return this.check(Ws(i))},positive(i){return this.check(ft(0,i))},nonnegative(i){return this.check(Pe(0,i))},negative(i){return this.check(ht(0,i))},nonpositive(i){return this.check(We(0,i))},multipleOf(i,r){return this.check(Ht(i,r))},step(i,r){return this.check(Ht(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});$r=m("ZodNumberFormat",(t,e)=>{ed.init(t,e),xn.init(t,e)});Sn=m("ZodBoolean",(t,e)=>{di.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ch(t,n,i,r)});En=m("ZodBigInt",(t,e)=>{ts.init(t,e),V.init(t,e),t._zod.processJSONSchema=(i,r,o)=>Rh(t,i,r,o),t.gte=(i,r)=>t.check(Pe(i,r)),t.min=(i,r)=>t.check(Pe(i,r)),t.gt=(i,r)=>t.check(ft(i,r)),t.gte=(i,r)=>t.check(Pe(i,r)),t.min=(i,r)=>t.check(Pe(i,r)),t.lt=(i,r)=>t.check(ht(i,r)),t.lte=(i,r)=>t.check(We(i,r)),t.max=(i,r)=>t.check(We(i,r)),t.positive=i=>t.check(ft(BigInt(0),i)),t.negative=i=>t.check(ht(BigInt(0),i)),t.nonpositive=i=>t.check(We(BigInt(0),i)),t.nonnegative=i=>t.check(Pe(BigInt(0),i)),t.multipleOf=(i,r)=>t.check(Ht(i,r));let n=t._zod.bag;t.minValue=n.minimum??null,t.maxValue=n.maximum??null,t.format=n.format??null});da=m("ZodBigIntFormat",(t,e)=>{td.init(t,e),En.init(t,e)});Df=m("ZodSymbol",(t,e)=>{rd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Nh(t,n,i,r)});Lf=m("ZodUndefined",(t,e)=>{nd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Lh(t,n,i,r)});Mf=m("ZodNull",(t,e)=>{id.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Dh(t,n,i,r)});Uf=m("ZodAny",(t,e)=>{od.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Uh(t,n,i,r)});jf=m("ZodUnknown",(t,e)=>{sd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>jh(t,n,i,r)});Ff=m("ZodNever",(t,e)=>{ad.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>zh(t,n,i,r)});Vf=m("ZodVoid",(t,e)=>{cd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Mh(t,n,i,r)});Oi=m("ZodDate",(t,e)=>{ud.init(t,e),V.init(t,e),t._zod.processJSONSchema=(i,r,o)=>Fh(t,i,r,o),t.min=(i,r)=>t.check(Pe(i,r)),t.max=(i,r)=>t.check(We(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});Zf=m("ZodArray",(t,e)=>{ld.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Qh(t,n,i,r),t.element=e.element,Ti(t,"ZodArray",{min(n,i){return this.check(St(n,i))},nonempty(n){return this.check(St(1,n))},max(n,i){return this.check(yr(n,i))},length(n,i){return this.check(_r(n,i))},unwrap(){return this.element}})});Ci=m("ZodObject",(t,e)=>{dd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>ef(t,n,i,r),S.defineLazy(t,"shape",()=>e.shape),Ti(t,"ZodObject",{keyof(){return pa(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:br()})},loose(){return this.clone({...this._zod.def,catchall:br()})},strict(){return this.clone({...this._zod.def,catchall:ha()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return S.extend(this,n)},safeExtend(n){return S.safeExtend(this,n)},merge(n){return S.merge(this,n)},pick(n){return S.pick(this,n)},omit(n){return S.omit(this,n)},partial(...n){return S.partial(ga,this,n[0])},required(...n){return S.required(va,this,n[0])}})});Ri=m("ZodUnion",(t,e)=>{hi.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ls(t,n,i,r),t.options=e.options});Bf=m("ZodXor",(t,e)=>{Ri.init(t,e),hd.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ls(t,n,i,r),t.options=e.options});Gf=m("ZodDiscriminatedUnion",(t,e)=>{Ri.init(t,e),fd.init(t,e)});Wf=m("ZodIntersection",(t,e)=>{pd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>tf(t,n,i,r)});qf=m("ZodTuple",(t,e)=>{rs.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>rf(t,n,i,r),t.rest=n=>t.clone({...t._zod.def,rest:n})});_n=m("ZodRecord",(t,e)=>{md.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>nf(t,n,i,r),t.keyType=e.keyType,t.valueType=e.valueType});Yf=m("ZodMap",(t,e)=>{gd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Yh(t,n,i,r),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...n)=>t.check(pt(...n)),t.nonempty=n=>t.check(pt(1,n)),t.max=(...n)=>t.check(qt(...n)),t.size=(...n)=>t.check(vr(...n))});Xf=m("ZodSet",(t,e)=>{vd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Xh(t,n,i,r),t.min=(...n)=>t.check(pt(...n)),t.nonempty=n=>t.check(pt(1,n)),t.max=(...n)=>t.check(qt(...n)),t.size=(...n)=>t.check(vr(...n))});bn=m("ZodEnum",(t,e)=>{yd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(i,r,o)=>Vh(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 bn({...e,checks:[],...S.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 bn({...e,checks:[],...S.normalizeParams(r),entries:o})}});Qf=m("ZodLiteral",(t,e)=>{_d.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Zh(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]}})});ep=m("ZodFile",(t,e)=>{bd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Wh(t,n,i,r),t.min=(n,i)=>t.check(pt(n,i)),t.max=(n,i)=>t.check(qt(n,i)),t.mime=(n,i)=>t.check(ln(Array.isArray(n)?n:[n],i))});tp=m("ZodTransform",(t,e)=>{$d.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Kh(t,n,i,r),t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new Vt(t.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(S.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(S.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)}});ga=m("ZodOptional",(t,e)=>{ns.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ms(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});rp=m("ZodExactOptional",(t,e)=>{wd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ms(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});ip=m("ZodNullable",(t,e)=>{xd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>of(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});op=m("ZodDefault",(t,e)=>{Sd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>af(t,n,i,r),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});ap=m("ZodPrefault",(t,e)=>{Ed.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>cf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});va=m("ZodNonOptional",(t,e)=>{Id.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>sf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});lp=m("ZodSuccess",(t,e)=>{kd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Hh(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});dp=m("ZodCatch",(t,e)=>{Td.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>uf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});fp=m("ZodNaN",(t,e)=>{Ad.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Bh(t,n,i,r)});Ni=m("ZodPipe",(t,e)=>{is.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>lf(t,n,i,r),t.in=e.in,t.out=e.out});Di=m("ZodCodec",(t,e)=>{Ni.init(t,e),fi.init(t,e)});pp=m("ZodPreprocess",(t,e)=>{Ni.init(t,e),Od.init(t,e)}),mp=m("ZodReadonly",(t,e)=>{Pd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>df(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});vp=m("ZodTemplateLiteral",(t,e)=>{Cd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Gh(t,n,i,r)});yp=m("ZodLazy",(t,e)=>{Dd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>ff(t,n,i,r),t.unwrap=()=>t._zod.def.getter()});bp=m("ZodPromise",(t,e)=>{Nd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>hf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});$p=m("ZodFunction",(t,e)=>{Rd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Jh(t,n,i,r)});Li=m("ZodCustom",(t,e)=>{Ld.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>qh(t,n,i,r)});i$=Ih,o$=kh;a$=(...t)=>Th({Codec:Di,Boolean:Sn,String:$n},...t)});function tA(t){se({customError:t})}function rA(){return se().customError}var eA,Sp,l$=g(()=>{He();eA={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"};Sp||(Sp={})});function iA(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 oA(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 d$(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return T.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 T.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=oA(r,e),s=Ee(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 T.null();if(r.length===0)return T.never();if(r.length===1)return T.literal(r[0]);if(r.every(s=>typeof s=="string"))return T.enum(r);let o=r.map(s=>T.literal(s));return o.length<2?o[0]:T.union([o[0],o[1],...o.slice(2)])}if(t.const!==void 0)return T.literal(t.const);let n=t.type;if(Array.isArray(n)){let r=n.map(o=>{let s={...t,type:o};return d$(s,e)});return r.length===0?T.never():r.length===1?r[0]:T.union(r)}if(!n)return T.any();let i;switch(n){case"string":{let r=T.string();if(t.format){let o=t.format;o==="email"?r=r.check(T.email()):o==="uri"||o==="uri-reference"?r=r.check(T.url()):o==="uuid"||o==="guid"?r=r.check(T.uuid()):o==="date-time"?r=r.check(T.iso.datetime()):o==="date"?r=r.check(T.iso.date()):o==="time"?r=r.check(T.iso.time()):o==="duration"?r=r.check(T.iso.duration()):o==="ipv4"?r=r.check(T.ipv4()):o==="ipv6"?r=r.check(T.ipv6()):o==="mac"?r=r.check(T.mac()):o==="cidr"?r=r.check(T.cidrv4()):o==="cidr-v6"?r=r.check(T.cidrv6()):o==="base64"?r=r.check(T.base64()):o==="base64url"?r=r.check(T.base64url()):o==="e164"?r=r.check(T.e164()):o==="jwt"?r=r.check(T.jwt()):o==="emoji"?r=r.check(T.emoji()):o==="nanoid"?r=r.check(T.nanoid()):o==="cuid"?r=r.check(T.cuid()):o==="cuid2"?r=r.check(T.cuid2()):o==="ulid"?r=r.check(T.ulid()):o==="xid"?r=r.check(T.xid()):o==="ksuid"&&(r=r.check(T.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"?T.number().int():T.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=T.boolean();break}case"null":{i=T.null();break}case"object":{let r={},o=t.properties||{},s=new Set(t.required||[]);for(let[c,u]of Object.entries(o)){let l=Ee(u,e);r[c]=s.has(c)?l:l.optional()}if(t.propertyNames){let c=Ee(t.propertyNames,e),u=t.additionalProperties&&typeof t.additionalProperties=="object"?Ee(t.additionalProperties,e):T.any();if(Object.keys(r).length===0){i=T.record(c,u);break}let l=T.object(r).passthrough(),d=T.looseRecord(c,u);i=T.intersection(l,d);break}if(t.patternProperties){let c=t.patternProperties,u=Object.keys(c),l=[];for(let h of u){let f=Ee(c[h],e),p=T.string().regex(new RegExp(h));l.push(T.looseRecord(p,f))}let d=[];if(Object.keys(r).length>0&&d.push(T.object(r).passthrough()),d.push(...l),d.length===0)i=T.object({}).passthrough();else if(d.length===1)i=d[0];else{let h=T.intersection(d[0],d[1]);for(let f=2;f<d.length;f++)h=T.intersection(h,d[f]);i=h}break}let a=T.object(r);t.additionalProperties===!1?i=a.strict():typeof t.additionalProperties=="object"?i=a.catchall(Ee(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(c=>Ee(c,e)),a=o&&typeof o=="object"&&!Array.isArray(o)?Ee(o,e):void 0;a?i=T.tuple(s).rest(a):i=T.tuple(s),typeof t.minItems=="number"&&(i=i.check(T.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(T.maxLength(t.maxItems)))}else if(Array.isArray(o)){let s=o.map(c=>Ee(c,e)),a=t.additionalItems&&typeof t.additionalItems=="object"?Ee(t.additionalItems,e):void 0;a?i=T.tuple(s).rest(a):i=T.tuple(s),typeof t.minItems=="number"&&(i=i.check(T.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(T.maxLength(t.maxItems)))}else if(o!==void 0){let s=Ee(o,e),a=T.array(s);typeof t.minItems=="number"&&(a=a.min(t.minItems)),typeof t.maxItems=="number"&&(a=a.max(t.maxItems)),i=a}else i=T.array(T.any());break}default:throw new Error(`Unsupported type: ${n}`)}return i}function Ee(t,e){if(typeof t=="boolean")return t?T.any():T.never();let n=d$(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(u=>Ee(u,e)),c=T.union(a);n=i?T.intersection(n,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let a=t.oneOf.map(u=>Ee(u,e)),c=T.xor(a);n=i?T.intersection(n,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)n=i?n:T.any();else{let a=i?n:Ee(t.allOf[0],e),c=i?0:1;for(let u=c;u<t.allOf.length;u++)a=T.intersection(a,Ee(t.allOf[u],e));n=a}t.nullable===!0&&e.version==="openapi-3.0"&&(n=T.nullable(n)),t.readOnly===!0&&(n=T.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))nA.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 h$(t,e){if(typeof t=="boolean")return t?T.any():T.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=iA(n,e?.defaultTarget),r=n.$defs||n.definitions||{},o={version:i,defs:r,refs:new Map,processing:new Set,rootSchema:n,registry:e?.registry??_e};return Ee(n,o)}var T,nA,f$=g(()=>{gi();Fs();$i();xi();T={...wi,...js,iso:yn},nA=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 Ep={};Je(Ep,{bigint:()=>uA,boolean:()=>cA,date:()=>lA,number:()=>aA,string:()=>sA});function sA(t){return Gd($n,t)}function aA(t){return Qd(xn,t)}function cA(t){return sh(Sn,t)}function uA(t){return ch(En,t)}function lA(t){return _h(Oi,t)}var p$=g(()=>{He();xi()});var de={};Je(de,{$brand:()=>fu,$input:()=>Zd,$output:()=>Vd,NEVER:()=>hu,TimePrecision:()=>Hd,ZodAny:()=>Uf,ZodArray:()=>Zf,ZodBase64:()=>aa,ZodBase64URL:()=>ca,ZodBigInt:()=>En,ZodBigIntFormat:()=>da,ZodBoolean:()=>Sn,ZodCIDRv4:()=>oa,ZodCIDRv6:()=>sa,ZodCUID:()=>Xs,ZodCUID2:()=>Qs,ZodCatch:()=>dp,ZodCodec:()=>Di,ZodCustom:()=>Li,ZodCustomStringFormat:()=>wn,ZodDate:()=>Oi,ZodDefault:()=>op,ZodDiscriminatedUnion:()=>Gf,ZodE164:()=>ua,ZodEmail:()=>Js,ZodEmoji:()=>Ks,ZodEnum:()=>bn,ZodError:()=>XT,ZodExactOptional:()=>rp,ZodFile:()=>ep,ZodFirstPartyTypeKind:()=>Sp,ZodFunction:()=>$p,ZodGUID:()=>Ei,ZodIPv4:()=>na,ZodIPv6:()=>ia,ZodISODate:()=>Zs,ZodISODateTime:()=>Vs,ZodISODuration:()=>Gs,ZodISOTime:()=>Bs,ZodIntersection:()=>Wf,ZodIssueCode:()=>eA,ZodJWT:()=>la,ZodKSUID:()=>ra,ZodLazy:()=>yp,ZodLiteral:()=>Qf,ZodMAC:()=>Cf,ZodMap:()=>Yf,ZodNaN:()=>fp,ZodNanoID:()=>Ys,ZodNever:()=>Ff,ZodNonOptional:()=>va,ZodNull:()=>Mf,ZodNullable:()=>ip,ZodNumber:()=>xn,ZodNumberFormat:()=>$r,ZodObject:()=>Ci,ZodOptional:()=>ga,ZodPipe:()=>Ni,ZodPrefault:()=>ap,ZodPreprocess:()=>pp,ZodPromise:()=>bp,ZodReadonly:()=>mp,ZodRealError:()=>ze,ZodRecord:()=>_n,ZodSet:()=>Xf,ZodString:()=>$n,ZodStringFormat:()=>J,ZodSuccess:()=>lp,ZodSymbol:()=>Df,ZodTemplateLiteral:()=>vp,ZodTransform:()=>tp,ZodTuple:()=>qf,ZodType:()=>V,ZodULID:()=>ea,ZodURL:()=>Ai,ZodUUID:()=>mt,ZodUndefined:()=>Lf,ZodUnion:()=>Ri,ZodUnknown:()=>jf,ZodVoid:()=>Vf,ZodXID:()=>ta,ZodXor:()=>Bf,_ZodString:()=>qs,_default:()=>sp,_function:()=>t$,any:()=>Cb,array:()=>Pi,base64:()=>mb,base64url:()=>gb,bigint:()=>kb,boolean:()=>Nf,catch:()=>hp,check:()=>r$,cidrv4:()=>fb,cidrv6:()=>pb,clone:()=>Ae,codec:()=>Yb,coerce:()=>Ep,config:()=>se,core:()=>Et,cuid:()=>ob,cuid2:()=>sb,custom:()=>n$,date:()=>Nb,decode:()=>Sf,decodeAsync:()=>If,describe:()=>i$,discriminatedUnion:()=>jb,e164:()=>vb,email:()=>J_,emoji:()=>nb,encode:()=>xf,encodeAsync:()=>Ef,endsWith:()=>un,enum:()=>pa,exactOptional:()=>np,file:()=>Hb,flattenError:()=>si,float32:()=>xb,float64:()=>Sb,formatError:()=>ai,fromJSONSchema:()=>h$,function:()=>t$,getErrorMap:()=>rA,globalRegistry:()=>_e,gt:()=>ft,gte:()=>Pe,guid:()=>K_,hash:()=>wb,hex:()=>$b,hostname:()=>bb,httpUrl:()=>rb,includes:()=>an,instanceof:()=>s$,int:()=>Ws,int32:()=>Eb,int64:()=>Tb,intersection:()=>Hf,invertCodec:()=>Xb,ipv4:()=>lb,ipv6:()=>hb,iso:()=>yn,json:()=>c$,jwt:()=>yb,keyof:()=>Db,ksuid:()=>ub,lazy:()=>_p,length:()=>_r,literal:()=>Wb,locales:()=>mi,looseObject:()=>zb,looseRecord:()=>Vb,lowercase:()=>on,lt:()=>ht,lte:()=>We,mac:()=>db,map:()=>Zb,maxLength:()=>yr,maxSize:()=>qt,meta:()=>o$,mime:()=>ln,minLength:()=>St,minSize:()=>pt,multipleOf:()=>Ht,nan:()=>Kb,nanoid:()=>ib,nativeEnum:()=>Gb,negative:()=>Ps,never:()=>ha,nonnegative:()=>Rs,nonoptional:()=>up,nonpositive:()=>Cs,normalize:()=>dn,null:()=>zf,nullable:()=>ki,nullish:()=>qb,number:()=>Rf,object:()=>Lb,optional:()=>Ii,overwrite:()=>ct,parse:()=>_f,parseAsync:()=>bf,partialRecord:()=>Fb,pipe:()=>Hs,positive:()=>Os,prefault:()=>cp,preprocess:()=>u$,prettifyError:()=>Iu,promise:()=>e$,property:()=>Ns,readonly:()=>gp,record:()=>Kf,refine:()=>wp,regex:()=>nn,regexes:()=>Ge,registry:()=>us,safeDecode:()=>Tf,safeDecodeAsync:()=>Of,safeEncode:()=>kf,safeEncodeAsync:()=>Af,safeParse:()=>$f,safeParseAsync:()=>wf,set:()=>Bb,setErrorMap:()=>tA,size:()=>vr,slugify:()=>mn,startsWith:()=>cn,strictObject:()=>Mb,string:()=>Si,stringFormat:()=>_b,stringbool:()=>a$,success:()=>Jb,superRefine:()=>xp,symbol:()=>Ob,templateLiteral:()=>Qb,toJSONSchema:()=>zs,toLowerCase:()=>fn,toUpperCase:()=>pn,transform:()=>ma,treeifyError:()=>Eu,trim:()=>hn,tuple:()=>Jf,uint32:()=>Ib,uint64:()=>Ab,ulid:()=>ab,undefined:()=>Pb,union:()=>fa,unknown:()=>br,uppercase:()=>sn,url:()=>tb,util:()=>S,uuid:()=>Y_,uuidv4:()=>X_,uuidv6:()=>Q_,uuidv7:()=>eb,void:()=>Rb,xid:()=>cb,xor:()=>Ub});var Ip=g(()=>{He();xi();Fs();yf();Pf();l$();He();zd();He();bi();f$();Fd();$i();$i();p$();se(os())});var m$=g(()=>{Ip();Ip()});function pA(t){try{return new URL(t)}catch{return null}}var dA,hA,fA,ya,wr,g$=g(()=>{"use strict";m$();dA=de.enum(["debug","info","warn","error"]),hA=["ws:","wss:","http:","https:"],fA=de.string().superRefine((t,e)=>{let n=pA(t);if(n===null){e.addIssue({code:"custom",message:"must be a valid ws://, wss://, http:// or https:// URL"});return}hA.includes(n.protocol)||e.addIssue({code:"custom",message:`must use the ws://, wss://, http:// or https:// scheme (got '${n.protocol}//' - the provider's adapter dialect decides which)`}),(n.username!==""||n.password!=="")&&e.addIssue({code:"custom",message:"must not embed credentials (user:pass@) - keys belong in secrets, not the url"})});ya=de.object({provider:de.string(),model:de.string(),gateway:de.string().nullable().optional(),url:fA.optional(),voiceId:de.string().min(1).optional()}),wr=de.object({version:de.number().default(1),routes:de.object({stt:ya.optional(),tts:ya.optional(),text:ya.optional(),embedding:ya.optional()}).optional(),secrets:de.record(de.string(),de.string()).optional(),defaults:de.object({logLevel:dA.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 he=g(()=>{"use strict";fv();pv();du();g$()});import{mkdirSync as mA}from"node:fs";import{homedir as gA}from"node:os";import{join as v$,resolve as vA}from"node:path";var kp,Ue,xr=g(()=>{"use strict";du();kp=class{dirName=".jarvis";dir(){let e=process.env[mv]?.trim();return e?vA(e):v$(gA(),this.dirName)}resolve(...e){return v$(this.dir(),...e)}ensureDir(){let e=this.dir();return mA(e,{recursive:!0,mode:448}),e}},Ue=new kp});import{chmodSync as yA,existsSync as _A,readFileSync as bA,writeFileSync as $A}from"node:fs";function _$(t){switch(t){case"debug":case"info":case"warn":case"error":return t;default:return}}var y$,Sr,Tp=g(()=>{"use strict";he();xr();y$="config.json",Sr=class t{home;config;constructor(e=Ue){this.home=e,this.config=this.load()}configPath(){return this.home.resolve(y$)}load(){let e=this.configPath(),n=_A(e)?this.readFile(e):{},i=wr.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=bA(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 _$(process.env.JARVIS_LOG_LEVEL)??_$(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=wr.parse(n);e.ensureDir();let r=e.resolve(y$);$A(r,JSON.stringify(i,null,2)+`
|
|
68
|
-
`,{mode:384}),
|
|
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 u=t.external.registry.get(s[0])?.id;if(e!==s[0]&&u){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 Yt(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=a=>{let c=t.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.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")?(u.allOf=u.allOf??[],u.allOf.push(p)):Object.assign(u,p),Object.assign(u,l),a._zod.parent===d)for(let b in u)b==="$ref"||b==="allOf"||b in l||delete u[b];if(p.$ref&&f.def)for(let b in u)b==="$ref"||b==="allOf"||b in f.def&&JSON.stringify(u[b])===JSON.stringify(f.def[b])&&delete u[b]}let h=a._zod.parent;if(h&&h!==d){i(h);let f=t.seen.get(h);if(f?.schema.$ref&&(u.$ref=f.schema.$ref,f.def))for(let p in u)p==="$ref"||p==="allOf"||p in f.def&&JSON.stringify(u[p])===JSON.stringify(f.def[p])&&delete u[p]}t.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};for(let a of[...t.seen.entries()].reverse())i(a[0]);let n={};if(t.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let a=t.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");n.$id=t.external.uri(a)}Object.assign(n,r.def??r.schema);let o=t.metadataRegistry.get(e)?.id;o!==void 0&&n.id===o&&delete n.id;let s=t.external?.defs??{};for(let a of t.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,s[c.defId]=c.def)}t.external||Object.keys(s).length>0&&(t.target==="draft-2020-12"?n.$defs=s:n.definitions=s);try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:vn(e,"input",t.processors),output:vn(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Re(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let i=t._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Re(i.element,r);if(i.type==="set")return Re(i.valueType,r);if(i.type==="lazy")return Re(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return Re(i.innerType,r);if(i.type==="intersection")return Re(i.left,r)||Re(i.right,r);if(i.type==="record"||i.type==="map")return Re(i.keyType,r)||Re(i.valueType,r);if(i.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Re(i.in,r)||Re(i.out,r);if(i.type==="object"){for(let n in i.shape)if(Re(i.shape[n],r))return!0;return!1}if(i.type==="union"){for(let n of i.options)if(Re(n,r))return!0;return!1}if(i.type==="tuple"){for(let n of i.items)if(Re(n,r))return!0;return!!(i.rest&&Re(i.rest,r))}return!1}var Nh,vn,_i=g(()=>{gi();Nh=(t,e={})=>r=>{let i=Jt({...r,processors:e});return W(t,i),Kt(i,t),Yt(i,t)},vn=(t,e,r={})=>i=>{let{libraryOptions:n,target:o}=i??{},s=Jt({...n??{},target:o,io:e,processors:r});return W(t,s),Kt(s,t),Yt(s,t)}});function zs(t,e){if("_idmap"in t){let i=t,n=Jt({...e,processors:Ns}),o={};for(let c of i._idmap.entries()){let[u,l]=c;W(l,n)}let s={},a={registry:i,uri:e?.uri,defs:o};n.external=a;for(let c of i._idmap.entries()){let[u,l]=c;Kt(n,l),s[u]=Yt(n,l)}if(Object.keys(o).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:o}}return{schemas:s}}let r=Jt({...e,processors:Ns});return W(t,r),Kt(r,t),Yt(r,t)}var hA,Lh,Mh,zh,Uh,jh,Fh,Vh,Zh,Bh,Gh,Wh,Hh,qh,Jh,Kh,Yh,Xh,Qh,ef,tf,rf,nf,of,sf,af,Ls,cf,uf,lf,df,hf,ff,pf,mf,gf,vf,yf,Ms,_f,Ns,bi=g(()=>{_i();N();hA={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Lh=(t,e,r,i)=>{let n=r;n.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:u}=t._zod.bag;if(typeof o=="number"&&(n.minLength=o),typeof s=="number"&&(n.maxLength=s),a&&(n.format=hA[a]??a,n.format===""&&delete n.format,a==="time"&&delete n.format),u&&(n.contentEncoding=u),c&&c.size>0){let l=[...c];l.length===1?n.pattern=l[0].source:l.length>1&&(n.allOf=[...l.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},Mh=(t,e,r,i)=>{let n=r,{minimum:o,maximum:s,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=t._zod.bag;typeof a=="string"&&a.includes("int")?n.type="integer":n.type="number";let d=typeof l=="number"&&l>=(o??Number.NEGATIVE_INFINITY),h=typeof u=="number"&&u<=(s??Number.POSITIVE_INFINITY),f=e.target==="draft-04"||e.target==="openapi-3.0";d?f?(n.minimum=l,n.exclusiveMinimum=!0):n.exclusiveMinimum=l:typeof o=="number"&&(n.minimum=o),h?f?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u:typeof s=="number"&&(n.maximum=s),typeof c=="number"&&(n.multipleOf=c)},zh=(t,e,r,i)=>{r.type="boolean"},Uh=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},jh=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Fh=(t,e,r,i)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Vh=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Zh=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Bh=(t,e,r,i)=>{r.not={}},Gh=(t,e,r,i)=>{},Wh=(t,e,r,i)=>{},Hh=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},qh=(t,e,r,i)=>{let n=t._zod.def,o=ei(n.entries);o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o},Jh=(t,e,r,i)=>{let n=t._zod.def,o=[];for(let s of n.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];r.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[s]:r.const=s}else o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),o.every(s=>typeof s=="boolean")&&(r.type="boolean"),o.every(s=>s===null)&&(r.type="null"),r.enum=o},Kh=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Yh=(t,e,r,i)=>{let n=r,o=t._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=o.source},Xh=(t,e,r,i)=>{let n=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:c}=t._zod.bag;s!==void 0&&(o.minLength=s),a!==void 0&&(o.maxLength=a),c?c.length===1?(o.contentMediaType=c[0],Object.assign(n,o)):(Object.assign(n,o),n.anyOf=c.map(u=>({contentMediaType:u}))):Object.assign(n,o)},Qh=(t,e,r,i)=>{r.type="boolean"},ef=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},tf=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},rf=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},nf=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},of=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},sf=(t,e,r,i)=>{let n=r,o=t._zod.def,{minimum:s,maximum:a}=t._zod.bag;typeof s=="number"&&(n.minItems=s),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=W(o.element,e,{...i,path:[...i.path,"items"]})},af=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="object",n.properties={};let s=o.shape;for(let u in s)n.properties[u]=W(s[u],e,{...i,path:[...i.path,"properties",u]});let a=new Set(Object.keys(s)),c=new Set([...a].filter(u=>{let l=o.shape[u]._zod;return e.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(n.required=Array.from(c)),o.catchall?._zod.def.type==="never"?n.additionalProperties=!1:o.catchall?o.catchall&&(n.additionalProperties=W(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(n.additionalProperties=!1)},Ls=(t,e,r,i)=>{let n=t._zod.def,o=n.inclusive===!1,s=n.options.map((a,c)=>W(a,e,{...i,path:[...i.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=s:r.anyOf=s},cf=(t,e,r,i)=>{let n=t._zod.def,o=W(n.left,e,{...i,path:[...i.path,"allOf",0]}),s=W(n.right,e,{...i,path:[...i.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];r.allOf=c},uf=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((h,f)=>W(h,e,{...i,path:[...i.path,s,f]})),u=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"?(n.prefixItems=c,u&&(n.items=u)):e.target==="openapi-3.0"?(n.items={anyOf:c},u&&n.items.anyOf.push(u),n.minItems=c.length,u||(n.maxItems=c.length)):(n.items=c,u&&(n.additionalItems=u));let{minimum:l,maximum:d}=t._zod.bag;typeof l=="number"&&(n.minItems=l),typeof d=="number"&&(n.maxItems=d)},lf=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="object";let s=o.keyType,c=s._zod.bag?.patterns;if(o.mode==="loose"&&c&&c.size>0){let l=W(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});n.patternProperties={};for(let d of c)n.patternProperties[d.source]=l}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(n.propertyNames=W(o.keyType,e,{...i,path:[...i.path,"propertyNames"]})),n.additionalProperties=W(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]});let u=s._zod.values;if(u){let l=[...u].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(n.required=l)}},df=(t,e,r,i)=>{let n=t._zod.def,o=W(n.innerType,e,i),s=e.seen.get(t);e.target==="openapi-3.0"?(s.ref=n.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},hf=(t,e,r,i)=>{let n=t._zod.def;W(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},ff=(t,e,r,i)=>{let n=t._zod.def;W(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},pf=(t,e,r,i)=>{let n=t._zod.def;W(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},mf=(t,e,r,i)=>{let n=t._zod.def;W(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},gf=(t,e,r,i)=>{let n=t._zod.def,o=n.in._zod.traits.has("$ZodTransform"),s=e.io==="input"?o?n.out:n.in:n.out;W(s,e,i);let a=e.seen.get(t);a.ref=s},vf=(t,e,r,i)=>{let n=t._zod.def;W(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType,r.readOnly=!0},yf=(t,e,r,i)=>{let n=t._zod.def;W(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},Ms=(t,e,r,i)=>{let n=t._zod.def;W(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType},_f=(t,e,r,i)=>{let n=t._zod.innerType;W(n,e,i);let o=e.seen.get(t);o.ref=n},Ns={string:Lh,number:Mh,boolean:zh,bigint:Uh,symbol:jh,null:Fh,undefined:Vh,void:Zh,never:Bh,any:Gh,unknown:Wh,date:Hh,enum:qh,literal:Jh,nan:Kh,template_literal:Yh,file:Xh,success:Qh,custom:ef,function:tf,transform:rf,map:nf,set:of,array:sf,object:af,union:Ls,intersection:cf,tuple:uf,record:lf,nullable:df,nonoptional:hf,default:ff,prefault:pf,catch:mf,pipe:gf,readonly:vf,promise:yf,optional:Ms,lazy:_f}});var Us,X_=g(()=>{bi();_i();Us=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Jt({processors:Ns,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return W(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Kt(this.ctx,e);let i=Yt(this.ctx,e),{"~standard":n,...o}=i;return o}}});var Q_={};var eb=g(()=>{});var Et={};Je(Et,{$ZodAny:()=>dd,$ZodArray:()=>gd,$ZodAsyncError:()=>at,$ZodBase64:()=>td,$ZodBase64URL:()=>rd,$ZodBigInt:()=>ts,$ZodBigIntFormat:()=>ad,$ZodBoolean:()=>di,$ZodCIDRv4:()=>Xl,$ZodCIDRv6:()=>Ql,$ZodCUID:()=>jl,$ZodCUID2:()=>Fl,$ZodCatch:()=>Dd,$ZodCheck:()=>X,$ZodCheckBigIntFormat:()=>pl,$ZodCheckEndsWith:()=>kl,$ZodCheckGreaterThan:()=>qo,$ZodCheckIncludes:()=>Sl,$ZodCheckLengthEquals:()=>bl,$ZodCheckLessThan:()=>Ho,$ZodCheckLowerCase:()=>wl,$ZodCheckMaxLength:()=>yl,$ZodCheckMaxSize:()=>ml,$ZodCheckMimeType:()=>Tl,$ZodCheckMinLength:()=>_l,$ZodCheckMinSize:()=>gl,$ZodCheckMultipleOf:()=>hl,$ZodCheckNumberFormat:()=>fl,$ZodCheckOverwrite:()=>Al,$ZodCheckProperty:()=>Il,$ZodCheckRegex:()=>$l,$ZodCheckSizeEquals:()=>vl,$ZodCheckStartsWith:()=>El,$ZodCheckStringFormat:()=>tn,$ZodCheckUpperCase:()=>xl,$ZodCodec:()=>fi,$ZodCustom:()=>Vd,$ZodCustomStringFormat:()=>od,$ZodDate:()=>md,$ZodDefault:()=>Od,$ZodDiscriminatedUnion:()=>_d,$ZodE164:()=>nd,$ZodEmail:()=>Ll,$ZodEmoji:()=>zl,$ZodEncodeError:()=>Vt,$ZodEnum:()=>Sd,$ZodError:()=>oi,$ZodExactOptional:()=>Td,$ZodFile:()=>kd,$ZodFunction:()=>Ud,$ZodGUID:()=>Dl,$ZodIPv4:()=>Jl,$ZodIPv6:()=>Kl,$ZodISODate:()=>Wl,$ZodISODateTime:()=>Gl,$ZodISODuration:()=>ql,$ZodISOTime:()=>Hl,$ZodIntersection:()=>bd,$ZodJWT:()=>id,$ZodKSUID:()=>Bl,$ZodLazy:()=>Fd,$ZodLiteral:()=>Ed,$ZodMAC:()=>Yl,$ZodMap:()=>wd,$ZodNaN:()=>Nd,$ZodNanoID:()=>Ul,$ZodNever:()=>fd,$ZodNonOptional:()=>Cd,$ZodNull:()=>ld,$ZodNullable:()=>Ad,$ZodNumber:()=>es,$ZodNumberFormat:()=>sd,$ZodObject:()=>ey,$ZodObjectJIT:()=>vd,$ZodOptional:()=>ns,$ZodPipe:()=>is,$ZodPrefault:()=>Pd,$ZodPreprocess:()=>Ld,$ZodPromise:()=>jd,$ZodReadonly:()=>Md,$ZodRealError:()=>ze,$ZodRecord:()=>$d,$ZodRegistry:()=>cs,$ZodSet:()=>xd,$ZodString:()=>vr,$ZodStringFormat:()=>q,$ZodSuccess:()=>Rd,$ZodSymbol:()=>cd,$ZodTemplateLiteral:()=>zd,$ZodTransform:()=>Id,$ZodTuple:()=>rs,$ZodType:()=>U,$ZodULID:()=>Vl,$ZodURL:()=>Ml,$ZodUUID:()=>Nl,$ZodUndefined:()=>ud,$ZodUnion:()=>hi,$ZodUnknown:()=>hd,$ZodVoid:()=>pd,$ZodXID:()=>Zl,$ZodXor:()=>yd,$brand:()=>_u,$constructor:()=>m,$input:()=>Jd,$output:()=>qd,Doc:()=>li,JSONSchema:()=>Q_,JSONSchemaGenerator:()=>Us,NEVER:()=>yu,TimePrecision:()=>Qd,_any:()=>bh,_array:()=>Ih,_base64:()=>ks,_base64url:()=>Is,_bigint:()=>fh,_boolean:()=>dh,_catch:()=>sA,_check:()=>K_,_cidrv4:()=>Ss,_cidrv6:()=>Es,_coercedBigint:()=>ph,_coercedBoolean:()=>hh,_coercedDate:()=>Eh,_coercedNumber:()=>oh,_coercedString:()=>Yd,_cuid:()=>vs,_cuid2:()=>ys,_custom:()=>Ah,_date:()=>Sh,_decode:()=>Mo,_decodeAsync:()=>Uo,_default:()=>nA,_discriminatedUnion:()=>G1,_e164:()=>Ts,_email:()=>ls,_emoji:()=>ms,_encode:()=>Lo,_encodeAsync:()=>zo,_endsWith:()=>un,_enum:()=>Y1,_file:()=>Th,_float32:()=>ah,_float64:()=>ch,_gt:()=>ft,_gte:()=>Ce,_guid:()=>vi,_includes:()=>an,_int:()=>sh,_int32:()=>uh,_int64:()=>mh,_intersection:()=>W1,_ipv4:()=>ws,_ipv6:()=>xs,_isoDate:()=>th,_isoDateTime:()=>eh,_isoDuration:()=>nh,_isoTime:()=>rh,_jwt:()=>As,_ksuid:()=>$s,_lazy:()=>lA,_length:()=>br,_literal:()=>Q1,_lowercase:()=>on,_lt:()=>ht,_lte:()=>We,_mac:()=>Xd,_map:()=>J1,_max:()=>We,_maxLength:()=>_r,_maxSize:()=>qt,_mime:()=>ln,_min:()=>Ce,_minLength:()=>St,_minSize:()=>pt,_multipleOf:()=>Ht,_nan:()=>kh,_nanoid:()=>gs,_nativeEnum:()=>X1,_negative:()=>Ps,_never:()=>wh,_nonnegative:()=>Rs,_nonoptional:()=>iA,_nonpositive:()=>Cs,_normalize:()=>dn,_null:()=>_h,_nullable:()=>rA,_number:()=>ih,_optional:()=>tA,_overwrite:()=>ct,_parse:()=>Yr,_parseAsync:()=>Xr,_pipe:()=>aA,_positive:()=>Os,_promise:()=>dA,_property:()=>Ds,_readonly:()=>cA,_record:()=>q1,_refine:()=>Oh,_regex:()=>nn,_safeDecode:()=>Fo,_safeDecodeAsync:()=>Zo,_safeEncode:()=>jo,_safeEncodeAsync:()=>Vo,_safeParse:()=>Qr,_safeParseAsync:()=>en,_set:()=>K1,_size:()=>yr,_slugify:()=>mn,_startsWith:()=>cn,_string:()=>Kd,_stringFormat:()=>gn,_stringbool:()=>Dh,_success:()=>oA,_superRefine:()=>Ph,_symbol:()=>vh,_templateLiteral:()=>uA,_toLowerCase:()=>fn,_toUpperCase:()=>pn,_transform:()=>eA,_trim:()=>hn,_tuple:()=>H1,_uint32:()=>lh,_uint64:()=>gh,_ulid:()=>_s,_undefined:()=>yh,_union:()=>Z1,_unknown:()=>$h,_uppercase:()=>sn,_url:()=>yi,_uuid:()=>ds,_uuidv4:()=>hs,_uuidv6:()=>fs,_uuidv7:()=>ps,_void:()=>xh,_xid:()=>bs,_xor:()=>B1,clone:()=>Oe,config:()=>ae,createStandardJSONSchemaMethod:()=>vn,createToJSONSchemaMethod:()=>Nh,decode:()=>dT,decodeAsync:()=>fT,describe:()=>Ch,encode:()=>lT,encodeAsync:()=>hT,extractDefs:()=>Kt,finalize:()=>Yt,flattenError:()=>si,formatError:()=>ai,globalConfig:()=>fr,globalRegistry:()=>_e,initializeContext:()=>Jt,isValidBase64:()=>ed,isValidBase64URL:()=>Kv,isValidJWT:()=>Yv,locales:()=>mi,meta:()=>Rh,parse:()=>Do,parseAsync:()=>No,prettifyError:()=>Cu,process:()=>W,regexes:()=>Ge,registry:()=>us,safeDecode:()=>mT,safeDecodeAsync:()=>vT,safeEncode:()=>pT,safeEncodeAsync:()=>gT,safeParse:()=>Du,safeParseAsync:()=>Nu,toDotPath:()=>Av,toJSONSchema:()=>zs,treeifyError:()=>Pu,util:()=>S,version:()=>Pl});var He=g(()=>{pr();Lu();Ru();Zd();Jo();Cl();N();Wo();Hd();gi();Ol();Y_();_i();bi();X_();eb()});var js={};Je(js,{endsWith:()=>un,gt:()=>ft,gte:()=>Ce,includes:()=>an,length:()=>br,lowercase:()=>on,lt:()=>ht,lte:()=>We,maxLength:()=>_r,maxSize:()=>qt,mime:()=>ln,minLength:()=>St,minSize:()=>pt,multipleOf:()=>Ht,negative:()=>Ps,nonnegative:()=>Rs,nonpositive:()=>Cs,normalize:()=>dn,overwrite:()=>ct,positive:()=>Os,property:()=>Ds,regex:()=>nn,size:()=>yr,slugify:()=>mn,startsWith:()=>cn,toLowerCase:()=>fn,toUpperCase:()=>pn,trim:()=>hn,uppercase:()=>sn});var Fs=g(()=>{He()});var yn={};Je(yn,{ZodISODate:()=>Zs,ZodISODateTime:()=>Vs,ZodISODuration:()=>Gs,ZodISOTime:()=>Bs,date:()=>$f,datetime:()=>bf,duration:()=>xf,time:()=>wf});function bf(t){return eh(Vs,t)}function $f(t){return th(Zs,t)}function wf(t){return rh(Bs,t)}function xf(t){return nh(Gs,t)}var Vs,Zs,Bs,Gs,$i=g(()=>{He();xi();Vs=m("ZodISODateTime",(t,e)=>{Gl.init(t,e),J.init(t,e)});Zs=m("ZodISODate",(t,e)=>{Wl.init(t,e),J.init(t,e)});Bs=m("ZodISOTime",(t,e)=>{Hl.init(t,e),J.init(t,e)});Gs=m("ZodISODuration",(t,e)=>{ql.init(t,e),J.init(t,e)})});var tb,pA,Ue,Sf=g(()=>{He();He();N();tb=(t,e)=>{oi.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>ai(t,r)},flatten:{value:r=>si(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,qr,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,qr,2)}},isEmpty:{get(){return t.issues.length===0}}})},pA=m("ZodError",tb),Ue=m("ZodError",tb,{Parent:Error})});var Ef,kf,If,Tf,Af,Of,Pf,Cf,Rf,Df,Nf,Lf,Mf=g(()=>{He();Sf();Ef=Yr(Ue),kf=Xr(Ue),If=Qr(Ue),Tf=en(Ue),Af=Lo(Ue),Of=Mo(Ue),Pf=zo(Ue),Cf=Uo(Ue),Rf=jo(Ue),Df=Fo(Ue),Nf=Vo(Ue),Lf=Zo(Ue)});var wi={};Je(wi,{ZodAny:()=>Gf,ZodArray:()=>Jf,ZodBase64:()=>aa,ZodBase64URL:()=>ca,ZodBigInt:()=>En,ZodBigIntFormat:()=>da,ZodBoolean:()=>Sn,ZodCIDRv4:()=>oa,ZodCIDRv6:()=>sa,ZodCUID:()=>Xs,ZodCUID2:()=>Qs,ZodCatch:()=>vp,ZodCodec:()=>Ni,ZodCustom:()=>Li,ZodCustomStringFormat:()=>wn,ZodDate:()=>Oi,ZodDefault:()=>dp,ZodDiscriminatedUnion:()=>Yf,ZodE164:()=>ua,ZodEmail:()=>Js,ZodEmoji:()=>Ks,ZodEnum:()=>bn,ZodExactOptional:()=>cp,ZodFile:()=>sp,ZodFunction:()=>Ip,ZodGUID:()=>Ei,ZodIPv4:()=>na,ZodIPv6:()=>ia,ZodIntersection:()=>Xf,ZodJWT:()=>la,ZodKSUID:()=>ra,ZodLazy:()=>Sp,ZodLiteral:()=>op,ZodMAC:()=>zf,ZodMap:()=>np,ZodNaN:()=>_p,ZodNanoID:()=>Ys,ZodNever:()=>Hf,ZodNonOptional:()=>va,ZodNull:()=>Zf,ZodNullable:()=>lp,ZodNumber:()=>xn,ZodNumberFormat:()=>wr,ZodObject:()=>Ci,ZodOptional:()=>ga,ZodPipe:()=>Di,ZodPrefault:()=>fp,ZodPreprocess:()=>bp,ZodPromise:()=>kp,ZodReadonly:()=>$p,ZodRecord:()=>_n,ZodSet:()=>ip,ZodString:()=>$n,ZodStringFormat:()=>J,ZodSuccess:()=>gp,ZodSymbol:()=>Ff,ZodTemplateLiteral:()=>xp,ZodTransform:()=>ap,ZodTuple:()=>ep,ZodType:()=>V,ZodULID:()=>ea,ZodURL:()=>Ai,ZodUUID:()=>mt,ZodUndefined:()=>Vf,ZodUnion:()=>Ri,ZodUnknown:()=>Wf,ZodVoid:()=>qf,ZodXID:()=>ta,ZodXor:()=>Kf,_ZodString:()=>qs,_default:()=>hp,_function:()=>u$,any:()=>jb,array:()=>Pi,base64:()=>xb,base64url:()=>Sb,bigint:()=>Nb,boolean:()=>jf,catch:()=>yp,check:()=>l$,cidrv4:()=>$b,cidrv6:()=>wb,codec:()=>o$,cuid:()=>fb,cuid2:()=>pb,custom:()=>d$,date:()=>Vb,describe:()=>h$,discriminatedUnion:()=>qb,e164:()=>Eb,email:()=>nb,emoji:()=>db,enum:()=>pa,exactOptional:()=>up,file:()=>t$,float32:()=>Pb,float64:()=>Cb,function:()=>u$,guid:()=>ib,hash:()=>Ob,hex:()=>Ab,hostname:()=>Tb,httpUrl:()=>lb,instanceof:()=>p$,int:()=>Ws,int32:()=>Rb,int64:()=>Lb,intersection:()=>Qf,invertCodec:()=>s$,ipv4:()=>yb,ipv6:()=>bb,json:()=>g$,jwt:()=>kb,keyof:()=>Zb,ksuid:()=>vb,lazy:()=>Ep,literal:()=>e$,looseObject:()=>Wb,looseRecord:()=>Kb,mac:()=>_b,map:()=>Yb,meta:()=>f$,nan:()=>i$,nanoid:()=>hb,nativeEnum:()=>Qb,never:()=>ha,nonoptional:()=>mp,null:()=>Bf,nullable:()=>Ii,nullish:()=>r$,number:()=>Uf,object:()=>Bb,optional:()=>ki,partialRecord:()=>Jb,pipe:()=>Hs,prefault:()=>pp,preprocess:()=>v$,promise:()=>c$,readonly:()=>wp,record:()=>rp,refine:()=>Tp,set:()=>Xb,strictObject:()=>Gb,string:()=>Si,stringFormat:()=>Ib,stringbool:()=>m$,success:()=>n$,superRefine:()=>Ap,symbol:()=>zb,templateLiteral:()=>a$,transform:()=>ma,tuple:()=>tp,uint32:()=>Db,uint64:()=>Mb,ulid:()=>mb,undefined:()=>Ub,union:()=>fa,unknown:()=>$r,url:()=>ub,uuid:()=>ob,uuidv4:()=>sb,uuidv6:()=>ab,uuidv7:()=>cb,void:()=>Fb,xid:()=>gb,xor:()=>Hb});function Ti(t,e,r){let i=Object.getPrototypeOf(t),n=rb.get(i);if(n||(n=new Set,rb.set(i,n)),!n.has(e)){n.add(e);for(let o in r){let s=r[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 Si(t){return Kd($n,t)}function nb(t){return ls(Js,t)}function ib(t){return vi(Ei,t)}function ob(t){return ds(mt,t)}function sb(t){return hs(mt,t)}function ab(t){return fs(mt,t)}function cb(t){return ps(mt,t)}function ub(t){return yi(Ai,t)}function lb(t){return yi(Ai,{protocol:Ge.httpProtocol,hostname:Ge.domain,...S.normalizeParams(t)})}function db(t){return ms(Ks,t)}function hb(t){return gs(Ys,t)}function fb(t){return vs(Xs,t)}function pb(t){return ys(Qs,t)}function mb(t){return _s(ea,t)}function gb(t){return bs(ta,t)}function vb(t){return $s(ra,t)}function yb(t){return ws(na,t)}function _b(t){return Xd(zf,t)}function bb(t){return xs(ia,t)}function $b(t){return Ss(oa,t)}function wb(t){return Es(sa,t)}function xb(t){return ks(aa,t)}function Sb(t){return Is(ca,t)}function Eb(t){return Ts(ua,t)}function kb(t){return As(la,t)}function Ib(t,e,r={}){return gn(wn,t,e,r)}function Tb(t){return gn(wn,"hostname",Ge.hostname,t)}function Ab(t){return gn(wn,"hex",Ge.hex,t)}function Ob(t,e){let r=e?.enc??"hex",i=`${t}_${r}`,n=Ge[i];if(!n)throw new Error(`Unrecognized hash format: ${i}`);return gn(wn,i,n,e)}function Uf(t){return ih(xn,t)}function Ws(t){return sh(wr,t)}function Pb(t){return ah(wr,t)}function Cb(t){return ch(wr,t)}function Rb(t){return uh(wr,t)}function Db(t){return lh(wr,t)}function jf(t){return dh(Sn,t)}function Nb(t){return fh(En,t)}function Lb(t){return mh(da,t)}function Mb(t){return gh(da,t)}function zb(t){return vh(Ff,t)}function Ub(t){return yh(Vf,t)}function Bf(t){return _h(Zf,t)}function jb(){return bh(Gf)}function $r(){return $h(Wf)}function ha(t){return wh(Hf,t)}function Fb(t){return xh(qf,t)}function Vb(t){return Sh(Oi,t)}function Pi(t,e){return Ih(Jf,t,e)}function Zb(t){let e=t._zod.def.shape;return pa(Object.keys(e))}function Bb(t,e){let r={type:"object",shape:t??{},...S.normalizeParams(e)};return new Ci(r)}function Gb(t,e){return new Ci({type:"object",shape:t,catchall:ha(),...S.normalizeParams(e)})}function Wb(t,e){return new Ci({type:"object",shape:t,catchall:$r(),...S.normalizeParams(e)})}function fa(t,e){return new Ri({type:"union",options:t,...S.normalizeParams(e)})}function Hb(t,e){return new Kf({type:"union",options:t,inclusive:!1,...S.normalizeParams(e)})}function qb(t,e,r){return new Yf({type:"union",options:e,discriminator:t,...S.normalizeParams(r)})}function Qf(t,e){return new Xf({type:"intersection",left:t,right:e})}function tp(t,e,r){let i=e instanceof U,n=i?r:e,o=i?e:null;return new ep({type:"tuple",items:t,rest:o,...S.normalizeParams(n)})}function rp(t,e,r){return!e||!e._zod?new _n({type:"record",keyType:Si(),valueType:t,...S.normalizeParams(e)}):new _n({type:"record",keyType:t,valueType:e,...S.normalizeParams(r)})}function Jb(t,e,r){let i=Oe(t);return i._zod.values=void 0,new _n({type:"record",keyType:i,valueType:e,...S.normalizeParams(r)})}function Kb(t,e,r){return new _n({type:"record",keyType:t,valueType:e,mode:"loose",...S.normalizeParams(r)})}function Yb(t,e,r){return new np({type:"map",keyType:t,valueType:e,...S.normalizeParams(r)})}function Xb(t,e){return new ip({type:"set",valueType:t,...S.normalizeParams(e)})}function pa(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new bn({type:"enum",entries:r,...S.normalizeParams(e)})}function Qb(t,e){return new bn({type:"enum",entries:t,...S.normalizeParams(e)})}function e$(t,e){return new op({type:"literal",values:Array.isArray(t)?t:[t],...S.normalizeParams(e)})}function t$(t){return Th(sp,t)}function ma(t){return new ap({type:"transform",transform:t})}function ki(t){return new ga({type:"optional",innerType:t})}function up(t){return new cp({type:"optional",innerType:t})}function Ii(t){return new lp({type:"nullable",innerType:t})}function r$(t){return ki(Ii(t))}function hp(t,e){return new dp({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():S.shallowClone(e)}})}function pp(t,e){return new fp({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():S.shallowClone(e)}})}function mp(t,e){return new va({type:"nonoptional",innerType:t,...S.normalizeParams(e)})}function n$(t){return new gp({type:"success",innerType:t})}function yp(t,e){return new vp({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function i$(t){return kh(_p,t)}function Hs(t,e){return new Di({type:"pipe",in:t,out:e})}function o$(t,e,r){return new Ni({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function s$(t){let e=t._zod.def;return new Ni({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}function wp(t){return new $p({type:"readonly",innerType:t})}function a$(t,e){return new xp({type:"template_literal",parts:t,...S.normalizeParams(e)})}function Ep(t){return new Sp({type:"lazy",getter:t})}function c$(t){return new kp({type:"promise",innerType:t})}function u$(t){return new Ip({type:"function",input:Array.isArray(t?.input)?tp(t?.input):t?.input??Pi($r()),output:t?.output??$r()})}function l$(t){let e=new X({check:"custom"});return e._zod.check=t,e}function d$(t,e){return Ah(Li,t??(()=>!0),e)}function Tp(t,e={}){return Oh(Li,t,e)}function Ap(t,e){return Ph(t,e)}function p$(t,e={}){let r=new Li({type:"custom",check:"custom",fn:i=>i instanceof t,abort:!0,...S.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=i=>{i.value instanceof t||i.issues.push({code:"invalid_type",expected:t.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]})},r}function g$(t){let e=Ep(()=>fa([Si(t),Uf(),jf(),Bf(),Pi(e),rp(Si(),e)]));return e}function v$(t,e){return new bp({type:"pipe",in:ma(t),out:e})}var rb,V,qs,$n,J,Js,Ei,mt,Ai,Ks,Ys,Xs,Qs,ea,ta,ra,na,zf,ia,oa,sa,aa,ca,ua,la,wn,xn,wr,Sn,En,da,Ff,Vf,Zf,Gf,Wf,Hf,qf,Oi,Jf,Ci,Ri,Kf,Yf,Xf,ep,_n,np,ip,bn,op,sp,ap,ga,cp,lp,dp,fp,va,gp,vp,_p,Di,Ni,bp,$p,xp,Sp,kp,Ip,Li,h$,f$,m$,xi=g(()=>{He();He();bi();_i();Fs();$i();Mf();rb=new WeakMap;V=m("ZodType",(t,e)=>(U.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:vn(t,"input"),output:vn(t,"output")}}),t.toJSONSchema=Nh(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,i)=>Ef(t,r,i,{callee:t.parse}),t.safeParse=(r,i)=>If(t,r,i),t.parseAsync=async(r,i)=>kf(t,r,i,{callee:t.parseAsync}),t.safeParseAsync=async(r,i)=>Tf(t,r,i),t.spa=t.safeParseAsync,t.encode=(r,i)=>Af(t,r,i),t.decode=(r,i)=>Of(t,r,i),t.encodeAsync=async(r,i)=>Pf(t,r,i),t.decodeAsync=async(r,i)=>Cf(t,r,i),t.safeEncode=(r,i)=>Rf(t,r,i),t.safeDecode=(r,i)=>Df(t,r,i),t.safeEncodeAsync=async(r,i)=>Nf(t,r,i),t.safeDecodeAsync=async(r,i)=>Lf(t,r,i),Ti(t,"ZodType",{check(...r){let i=this.def;return this.clone(S.mergeDefs(i,{checks:[...i.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,i){return Oe(this,r,i)},brand(){return this},register(r,i){return r.add(this,i),this},refine(r,i){return this.check(Tp(r,i))},superRefine(r,i){return this.check(Ap(r,i))},overwrite(r){return this.check(ct(r))},optional(){return ki(this)},exactOptional(){return up(this)},nullable(){return Ii(this)},nullish(){return ki(Ii(this))},nonoptional(r){return mp(this,r)},array(){return Pi(this)},or(r){return fa([this,r])},and(r){return Qf(this,r)},transform(r){return Hs(this,ma(r))},default(r){return hp(this,r)},prefault(r){return pp(this,r)},catch(r){return yp(this,r)},pipe(r){return Hs(this,r)},readonly(){return wp(this)},describe(r){let i=this.clone();return _e.add(i,{description:r}),i},meta(...r){if(r.length===0)return _e.get(this);let i=this.clone();return _e.add(i,r[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return _e.get(t)?.description},configurable:!0}),t)),qs=m("_ZodString",(t,e)=>{vr.init(t,e),V.init(t,e),t._zod.processJSONSchema=(i,n,o)=>Lh(t,i,n,o);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,Ti(t,"_ZodString",{regex(...i){return this.check(nn(...i))},includes(...i){return this.check(an(...i))},startsWith(...i){return this.check(cn(...i))},endsWith(...i){return this.check(un(...i))},min(...i){return this.check(St(...i))},max(...i){return this.check(_r(...i))},length(...i){return this.check(br(...i))},nonempty(...i){return this.check(St(1,...i))},lowercase(i){return this.check(on(i))},uppercase(i){return this.check(sn(i))},trim(){return this.check(hn())},normalize(...i){return this.check(dn(...i))},toLowerCase(){return this.check(fn())},toUpperCase(){return this.check(pn())},slugify(){return this.check(mn())}})}),$n=m("ZodString",(t,e)=>{vr.init(t,e),qs.init(t,e),t.email=r=>t.check(ls(Js,r)),t.url=r=>t.check(yi(Ai,r)),t.jwt=r=>t.check(As(la,r)),t.emoji=r=>t.check(ms(Ks,r)),t.guid=r=>t.check(vi(Ei,r)),t.uuid=r=>t.check(ds(mt,r)),t.uuidv4=r=>t.check(hs(mt,r)),t.uuidv6=r=>t.check(fs(mt,r)),t.uuidv7=r=>t.check(ps(mt,r)),t.nanoid=r=>t.check(gs(Ys,r)),t.guid=r=>t.check(vi(Ei,r)),t.cuid=r=>t.check(vs(Xs,r)),t.cuid2=r=>t.check(ys(Qs,r)),t.ulid=r=>t.check(_s(ea,r)),t.base64=r=>t.check(ks(aa,r)),t.base64url=r=>t.check(Is(ca,r)),t.xid=r=>t.check(bs(ta,r)),t.ksuid=r=>t.check($s(ra,r)),t.ipv4=r=>t.check(ws(na,r)),t.ipv6=r=>t.check(xs(ia,r)),t.cidrv4=r=>t.check(Ss(oa,r)),t.cidrv6=r=>t.check(Es(sa,r)),t.e164=r=>t.check(Ts(ua,r)),t.datetime=r=>t.check(bf(r)),t.date=r=>t.check($f(r)),t.time=r=>t.check(wf(r)),t.duration=r=>t.check(xf(r))});J=m("ZodStringFormat",(t,e)=>{q.init(t,e),qs.init(t,e)}),Js=m("ZodEmail",(t,e)=>{Ll.init(t,e),J.init(t,e)});Ei=m("ZodGUID",(t,e)=>{Dl.init(t,e),J.init(t,e)});mt=m("ZodUUID",(t,e)=>{Nl.init(t,e),J.init(t,e)});Ai=m("ZodURL",(t,e)=>{Ml.init(t,e),J.init(t,e)});Ks=m("ZodEmoji",(t,e)=>{zl.init(t,e),J.init(t,e)});Ys=m("ZodNanoID",(t,e)=>{Ul.init(t,e),J.init(t,e)});Xs=m("ZodCUID",(t,e)=>{jl.init(t,e),J.init(t,e)});Qs=m("ZodCUID2",(t,e)=>{Fl.init(t,e),J.init(t,e)});ea=m("ZodULID",(t,e)=>{Vl.init(t,e),J.init(t,e)});ta=m("ZodXID",(t,e)=>{Zl.init(t,e),J.init(t,e)});ra=m("ZodKSUID",(t,e)=>{Bl.init(t,e),J.init(t,e)});na=m("ZodIPv4",(t,e)=>{Jl.init(t,e),J.init(t,e)});zf=m("ZodMAC",(t,e)=>{Yl.init(t,e),J.init(t,e)});ia=m("ZodIPv6",(t,e)=>{Kl.init(t,e),J.init(t,e)});oa=m("ZodCIDRv4",(t,e)=>{Xl.init(t,e),J.init(t,e)});sa=m("ZodCIDRv6",(t,e)=>{Ql.init(t,e),J.init(t,e)});aa=m("ZodBase64",(t,e)=>{td.init(t,e),J.init(t,e)});ca=m("ZodBase64URL",(t,e)=>{rd.init(t,e),J.init(t,e)});ua=m("ZodE164",(t,e)=>{nd.init(t,e),J.init(t,e)});la=m("ZodJWT",(t,e)=>{id.init(t,e),J.init(t,e)});wn=m("ZodCustomStringFormat",(t,e)=>{od.init(t,e),J.init(t,e)});xn=m("ZodNumber",(t,e)=>{es.init(t,e),V.init(t,e),t._zod.processJSONSchema=(i,n,o)=>Mh(t,i,n,o),Ti(t,"ZodNumber",{gt(i,n){return this.check(ft(i,n))},gte(i,n){return this.check(Ce(i,n))},min(i,n){return this.check(Ce(i,n))},lt(i,n){return this.check(ht(i,n))},lte(i,n){return this.check(We(i,n))},max(i,n){return this.check(We(i,n))},int(i){return this.check(Ws(i))},safe(i){return this.check(Ws(i))},positive(i){return this.check(ft(0,i))},nonnegative(i){return this.check(Ce(0,i))},negative(i){return this.check(ht(0,i))},nonpositive(i){return this.check(We(0,i))},multipleOf(i,n){return this.check(Ht(i,n))},step(i,n){return this.check(Ht(i,n))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});wr=m("ZodNumberFormat",(t,e)=>{sd.init(t,e),xn.init(t,e)});Sn=m("ZodBoolean",(t,e)=>{di.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>zh(t,r,i,n)});En=m("ZodBigInt",(t,e)=>{ts.init(t,e),V.init(t,e),t._zod.processJSONSchema=(i,n,o)=>Uh(t,i,n,o),t.gte=(i,n)=>t.check(Ce(i,n)),t.min=(i,n)=>t.check(Ce(i,n)),t.gt=(i,n)=>t.check(ft(i,n)),t.gte=(i,n)=>t.check(Ce(i,n)),t.min=(i,n)=>t.check(Ce(i,n)),t.lt=(i,n)=>t.check(ht(i,n)),t.lte=(i,n)=>t.check(We(i,n)),t.max=(i,n)=>t.check(We(i,n)),t.positive=i=>t.check(ft(BigInt(0),i)),t.negative=i=>t.check(ht(BigInt(0),i)),t.nonpositive=i=>t.check(We(BigInt(0),i)),t.nonnegative=i=>t.check(Ce(BigInt(0),i)),t.multipleOf=(i,n)=>t.check(Ht(i,n));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});da=m("ZodBigIntFormat",(t,e)=>{ad.init(t,e),En.init(t,e)});Ff=m("ZodSymbol",(t,e)=>{cd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>jh(t,r,i,n)});Vf=m("ZodUndefined",(t,e)=>{ud.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Vh(t,r,i,n)});Zf=m("ZodNull",(t,e)=>{ld.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Fh(t,r,i,n)});Gf=m("ZodAny",(t,e)=>{dd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Gh(t,r,i,n)});Wf=m("ZodUnknown",(t,e)=>{hd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Wh(t,r,i,n)});Hf=m("ZodNever",(t,e)=>{fd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Bh(t,r,i,n)});qf=m("ZodVoid",(t,e)=>{pd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Zh(t,r,i,n)});Oi=m("ZodDate",(t,e)=>{md.init(t,e),V.init(t,e),t._zod.processJSONSchema=(i,n,o)=>Hh(t,i,n,o),t.min=(i,n)=>t.check(Ce(i,n)),t.max=(i,n)=>t.check(We(i,n));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});Jf=m("ZodArray",(t,e)=>{gd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>sf(t,r,i,n),t.element=e.element,Ti(t,"ZodArray",{min(r,i){return this.check(St(r,i))},nonempty(r){return this.check(St(1,r))},max(r,i){return this.check(_r(r,i))},length(r,i){return this.check(br(r,i))},unwrap(){return this.element}})});Ci=m("ZodObject",(t,e)=>{vd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>af(t,r,i,n),S.defineLazy(t,"shape",()=>e.shape),Ti(t,"ZodObject",{keyof(){return pa(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:$r()})},loose(){return this.clone({...this._zod.def,catchall:$r()})},strict(){return this.clone({...this._zod.def,catchall:ha()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return S.extend(this,r)},safeExtend(r){return S.safeExtend(this,r)},merge(r){return S.merge(this,r)},pick(r){return S.pick(this,r)},omit(r){return S.omit(this,r)},partial(...r){return S.partial(ga,this,r[0])},required(...r){return S.required(va,this,r[0])}})});Ri=m("ZodUnion",(t,e)=>{hi.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ls(t,r,i,n),t.options=e.options});Kf=m("ZodXor",(t,e)=>{Ri.init(t,e),yd.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ls(t,r,i,n),t.options=e.options});Yf=m("ZodDiscriminatedUnion",(t,e)=>{Ri.init(t,e),_d.init(t,e)});Xf=m("ZodIntersection",(t,e)=>{bd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>cf(t,r,i,n)});ep=m("ZodTuple",(t,e)=>{rs.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>uf(t,r,i,n),t.rest=r=>t.clone({...t._zod.def,rest:r})});_n=m("ZodRecord",(t,e)=>{$d.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>lf(t,r,i,n),t.keyType=e.keyType,t.valueType=e.valueType});np=m("ZodMap",(t,e)=>{wd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>nf(t,r,i,n),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(pt(...r)),t.nonempty=r=>t.check(pt(1,r)),t.max=(...r)=>t.check(qt(...r)),t.size=(...r)=>t.check(yr(...r))});ip=m("ZodSet",(t,e)=>{xd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>of(t,r,i,n),t.min=(...r)=>t.check(pt(...r)),t.nonempty=r=>t.check(pt(1,r)),t.max=(...r)=>t.check(qt(...r)),t.size=(...r)=>t.check(yr(...r))});bn=m("ZodEnum",(t,e)=>{Sd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(i,n,o)=>qh(t,i,n,o),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(i,n)=>{let o={};for(let s of i)if(r.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new bn({...e,checks:[],...S.normalizeParams(n),entries:o})},t.exclude=(i,n)=>{let o={...e.entries};for(let s of i)if(r.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new bn({...e,checks:[],...S.normalizeParams(n),entries:o})}});op=m("ZodLiteral",(t,e)=>{Ed.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Jh(t,r,i,n),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]}})});sp=m("ZodFile",(t,e)=>{kd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Xh(t,r,i,n),t.min=(r,i)=>t.check(pt(r,i)),t.max=(r,i)=>t.check(qt(r,i)),t.mime=(r,i)=>t.check(ln(Array.isArray(r)?r:[r],i))});ap=m("ZodTransform",(t,e)=>{Id.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>rf(t,r,i,n),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Vt(t.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(S.issue(o,r.value,e));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=t),r.issues.push(S.issue(s))}};let n=e.transform(r.value,r);return n instanceof Promise?n.then(o=>(r.value=o,r.fallback=!0,r)):(r.value=n,r.fallback=!0,r)}});ga=m("ZodOptional",(t,e)=>{ns.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ms(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});cp=m("ZodExactOptional",(t,e)=>{Td.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ms(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});lp=m("ZodNullable",(t,e)=>{Ad.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>df(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});dp=m("ZodDefault",(t,e)=>{Od.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ff(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});fp=m("ZodPrefault",(t,e)=>{Pd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>pf(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});va=m("ZodNonOptional",(t,e)=>{Cd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>hf(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});gp=m("ZodSuccess",(t,e)=>{Rd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Qh(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});vp=m("ZodCatch",(t,e)=>{Dd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>mf(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});_p=m("ZodNaN",(t,e)=>{Nd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Kh(t,r,i,n)});Di=m("ZodPipe",(t,e)=>{is.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>gf(t,r,i,n),t.in=e.in,t.out=e.out});Ni=m("ZodCodec",(t,e)=>{Di.init(t,e),fi.init(t,e)});bp=m("ZodPreprocess",(t,e)=>{Di.init(t,e),Ld.init(t,e)}),$p=m("ZodReadonly",(t,e)=>{Md.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>vf(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});xp=m("ZodTemplateLiteral",(t,e)=>{zd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Yh(t,r,i,n)});Sp=m("ZodLazy",(t,e)=>{Fd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>_f(t,r,i,n),t.unwrap=()=>t._zod.def.getter()});kp=m("ZodPromise",(t,e)=>{jd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>yf(t,r,i,n),t.unwrap=()=>t._zod.def.innerType});Ip=m("ZodFunction",(t,e)=>{Ud.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>tf(t,r,i,n)});Li=m("ZodCustom",(t,e)=>{Vd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ef(t,r,i,n)});h$=Ch,f$=Rh;m$=(...t)=>Dh({Codec:Ni,Boolean:Sn,String:$n},...t)});function vA(t){ae({customError:t})}function yA(){return ae().customError}var gA,Op,y$=g(()=>{He();gA={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"};Op||(Op={})});function bA(t,e){let r=t.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function $A(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let i=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){let n=r[1];if(!n||!e.defs[n])throw new Error(`Reference not found: ${t}`);return e.defs[n]}throw new Error(`Reference not found: ${t}`)}function _$(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return O.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let n=t.$ref;if(e.refs.has(n))return e.refs.get(n);if(e.processing.has(n))return O.lazy(()=>{if(!e.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return e.refs.get(n)});e.processing.add(n);let o=$A(n,e),s=Ee(o,e);return e.refs.set(n,s),e.processing.delete(n),s}if(t.enum!==void 0){let n=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&n.length===1&&n[0]===null)return O.null();if(n.length===0)return O.never();if(n.length===1)return O.literal(n[0]);if(n.every(s=>typeof s=="string"))return O.enum(n);let o=n.map(s=>O.literal(s));return o.length<2?o[0]:O.union([o[0],o[1],...o.slice(2)])}if(t.const!==void 0)return O.literal(t.const);let r=t.type;if(Array.isArray(r)){let n=r.map(o=>{let s={...t,type:o};return _$(s,e)});return n.length===0?O.never():n.length===1?n[0]:O.union(n)}if(!r)return O.any();let i;switch(r){case"string":{let n=O.string();if(t.format){let o=t.format;o==="email"?n=n.check(O.email()):o==="uri"||o==="uri-reference"?n=n.check(O.url()):o==="uuid"||o==="guid"?n=n.check(O.uuid()):o==="date-time"?n=n.check(O.iso.datetime()):o==="date"?n=n.check(O.iso.date()):o==="time"?n=n.check(O.iso.time()):o==="duration"?n=n.check(O.iso.duration()):o==="ipv4"?n=n.check(O.ipv4()):o==="ipv6"?n=n.check(O.ipv6()):o==="mac"?n=n.check(O.mac()):o==="cidr"?n=n.check(O.cidrv4()):o==="cidr-v6"?n=n.check(O.cidrv6()):o==="base64"?n=n.check(O.base64()):o==="base64url"?n=n.check(O.base64url()):o==="e164"?n=n.check(O.e164()):o==="jwt"?n=n.check(O.jwt()):o==="emoji"?n=n.check(O.emoji()):o==="nanoid"?n=n.check(O.nanoid()):o==="cuid"?n=n.check(O.cuid()):o==="cuid2"?n=n.check(O.cuid2()):o==="ulid"?n=n.check(O.ulid()):o==="xid"?n=n.check(O.xid()):o==="ksuid"&&(n=n.check(O.ksuid()))}typeof t.minLength=="number"&&(n=n.min(t.minLength)),typeof t.maxLength=="number"&&(n=n.max(t.maxLength)),t.pattern&&(n=n.regex(new RegExp(t.pattern))),i=n;break}case"number":case"integer":{let n=r==="integer"?O.number().int():O.number();typeof t.minimum=="number"&&(n=n.min(t.minimum)),typeof t.maximum=="number"&&(n=n.max(t.maximum)),typeof t.exclusiveMinimum=="number"?n=n.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(n=n.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?n=n.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(n=n.lt(t.maximum)),typeof t.multipleOf=="number"&&(n=n.multipleOf(t.multipleOf)),i=n;break}case"boolean":{i=O.boolean();break}case"null":{i=O.null();break}case"object":{let n={},o=t.properties||{},s=new Set(t.required||[]);for(let[c,u]of Object.entries(o)){let l=Ee(u,e);n[c]=s.has(c)?l:l.optional()}if(t.propertyNames){let c=Ee(t.propertyNames,e),u=t.additionalProperties&&typeof t.additionalProperties=="object"?Ee(t.additionalProperties,e):O.any();if(Object.keys(n).length===0){i=O.record(c,u);break}let l=O.object(n).passthrough(),d=O.looseRecord(c,u);i=O.intersection(l,d);break}if(t.patternProperties){let c=t.patternProperties,u=Object.keys(c),l=[];for(let h of u){let f=Ee(c[h],e),p=O.string().regex(new RegExp(h));l.push(O.looseRecord(p,f))}let d=[];if(Object.keys(n).length>0&&d.push(O.object(n).passthrough()),d.push(...l),d.length===0)i=O.object({}).passthrough();else if(d.length===1)i=d[0];else{let h=O.intersection(d[0],d[1]);for(let f=2;f<d.length;f++)h=O.intersection(h,d[f]);i=h}break}let a=O.object(n);t.additionalProperties===!1?i=a.strict():typeof t.additionalProperties=="object"?i=a.catchall(Ee(t.additionalProperties,e)):i=a.passthrough();break}case"array":{let n=t.prefixItems,o=t.items;if(n&&Array.isArray(n)){let s=n.map(c=>Ee(c,e)),a=o&&typeof o=="object"&&!Array.isArray(o)?Ee(o,e):void 0;a?i=O.tuple(s).rest(a):i=O.tuple(s),typeof t.minItems=="number"&&(i=i.check(O.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(O.maxLength(t.maxItems)))}else if(Array.isArray(o)){let s=o.map(c=>Ee(c,e)),a=t.additionalItems&&typeof t.additionalItems=="object"?Ee(t.additionalItems,e):void 0;a?i=O.tuple(s).rest(a):i=O.tuple(s),typeof t.minItems=="number"&&(i=i.check(O.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(O.maxLength(t.maxItems)))}else if(o!==void 0){let s=Ee(o,e),a=O.array(s);typeof t.minItems=="number"&&(a=a.min(t.minItems)),typeof t.maxItems=="number"&&(a=a.max(t.maxItems)),i=a}else i=O.array(O.any());break}default:throw new Error(`Unsupported type: ${r}`)}return i}function Ee(t,e){if(typeof t=="boolean")return t?O.any():O.never();let r=_$(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(u=>Ee(u,e)),c=O.union(a);r=i?O.intersection(r,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let a=t.oneOf.map(u=>Ee(u,e)),c=O.xor(a);r=i?O.intersection(r,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=i?r:O.any();else{let a=i?r:Ee(t.allOf[0],e),c=i?0:1;for(let u=c;u<t.allOf.length;u++)a=O.intersection(a,Ee(t.allOf[u],e));r=a}t.nullable===!0&&e.version==="openapi-3.0"&&(r=O.nullable(r)),t.readOnly===!0&&(r=O.readonly(r)),t.default!==void 0&&(r=r.default(t.default));let n={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of o)a in t&&(n[a]=t[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in t&&(n[a]=t[a]);for(let a of Object.keys(t))_A.has(a)||(n[a]=t[a]);return Object.keys(n).length>0&&e.registry.add(r,n),t.description&&(r=r.describe(t.description)),r}function b$(t,e){if(typeof t=="boolean")return t?O.any():O.never();let r;try{r=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=bA(r,e?.defaultTarget),n=r.$defs||r.definitions||{},o={version:i,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??_e};return Ee(r,o)}var O,_A,$$=g(()=>{gi();Fs();$i();xi();O={...wi,...js,iso:yn},_A=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 Pp={};Je(Pp,{bigint:()=>EA,boolean:()=>SA,date:()=>kA,number:()=>xA,string:()=>wA});function wA(t){return Yd($n,t)}function xA(t){return oh(xn,t)}function SA(t){return hh(Sn,t)}function EA(t){return ph(En,t)}function kA(t){return Eh(Oi,t)}var w$=g(()=>{He();xi()});var ee={};Je(ee,{$brand:()=>_u,$input:()=>Jd,$output:()=>qd,NEVER:()=>yu,TimePrecision:()=>Qd,ZodAny:()=>Gf,ZodArray:()=>Jf,ZodBase64:()=>aa,ZodBase64URL:()=>ca,ZodBigInt:()=>En,ZodBigIntFormat:()=>da,ZodBoolean:()=>Sn,ZodCIDRv4:()=>oa,ZodCIDRv6:()=>sa,ZodCUID:()=>Xs,ZodCUID2:()=>Qs,ZodCatch:()=>vp,ZodCodec:()=>Ni,ZodCustom:()=>Li,ZodCustomStringFormat:()=>wn,ZodDate:()=>Oi,ZodDefault:()=>dp,ZodDiscriminatedUnion:()=>Yf,ZodE164:()=>ua,ZodEmail:()=>Js,ZodEmoji:()=>Ks,ZodEnum:()=>bn,ZodError:()=>pA,ZodExactOptional:()=>cp,ZodFile:()=>sp,ZodFirstPartyTypeKind:()=>Op,ZodFunction:()=>Ip,ZodGUID:()=>Ei,ZodIPv4:()=>na,ZodIPv6:()=>ia,ZodISODate:()=>Zs,ZodISODateTime:()=>Vs,ZodISODuration:()=>Gs,ZodISOTime:()=>Bs,ZodIntersection:()=>Xf,ZodIssueCode:()=>gA,ZodJWT:()=>la,ZodKSUID:()=>ra,ZodLazy:()=>Sp,ZodLiteral:()=>op,ZodMAC:()=>zf,ZodMap:()=>np,ZodNaN:()=>_p,ZodNanoID:()=>Ys,ZodNever:()=>Hf,ZodNonOptional:()=>va,ZodNull:()=>Zf,ZodNullable:()=>lp,ZodNumber:()=>xn,ZodNumberFormat:()=>wr,ZodObject:()=>Ci,ZodOptional:()=>ga,ZodPipe:()=>Di,ZodPrefault:()=>fp,ZodPreprocess:()=>bp,ZodPromise:()=>kp,ZodReadonly:()=>$p,ZodRealError:()=>Ue,ZodRecord:()=>_n,ZodSet:()=>ip,ZodString:()=>$n,ZodStringFormat:()=>J,ZodSuccess:()=>gp,ZodSymbol:()=>Ff,ZodTemplateLiteral:()=>xp,ZodTransform:()=>ap,ZodTuple:()=>ep,ZodType:()=>V,ZodULID:()=>ea,ZodURL:()=>Ai,ZodUUID:()=>mt,ZodUndefined:()=>Vf,ZodUnion:()=>Ri,ZodUnknown:()=>Wf,ZodVoid:()=>qf,ZodXID:()=>ta,ZodXor:()=>Kf,_ZodString:()=>qs,_default:()=>hp,_function:()=>u$,any:()=>jb,array:()=>Pi,base64:()=>xb,base64url:()=>Sb,bigint:()=>Nb,boolean:()=>jf,catch:()=>yp,check:()=>l$,cidrv4:()=>$b,cidrv6:()=>wb,clone:()=>Oe,codec:()=>o$,coerce:()=>Pp,config:()=>ae,core:()=>Et,cuid:()=>fb,cuid2:()=>pb,custom:()=>d$,date:()=>Vb,decode:()=>Of,decodeAsync:()=>Cf,describe:()=>h$,discriminatedUnion:()=>qb,e164:()=>Eb,email:()=>nb,emoji:()=>db,encode:()=>Af,encodeAsync:()=>Pf,endsWith:()=>un,enum:()=>pa,exactOptional:()=>up,file:()=>t$,flattenError:()=>si,float32:()=>Pb,float64:()=>Cb,formatError:()=>ai,fromJSONSchema:()=>b$,function:()=>u$,getErrorMap:()=>yA,globalRegistry:()=>_e,gt:()=>ft,gte:()=>Ce,guid:()=>ib,hash:()=>Ob,hex:()=>Ab,hostname:()=>Tb,httpUrl:()=>lb,includes:()=>an,instanceof:()=>p$,int:()=>Ws,int32:()=>Rb,int64:()=>Lb,intersection:()=>Qf,invertCodec:()=>s$,ipv4:()=>yb,ipv6:()=>bb,iso:()=>yn,json:()=>g$,jwt:()=>kb,keyof:()=>Zb,ksuid:()=>vb,lazy:()=>Ep,length:()=>br,literal:()=>e$,locales:()=>mi,looseObject:()=>Wb,looseRecord:()=>Kb,lowercase:()=>on,lt:()=>ht,lte:()=>We,mac:()=>_b,map:()=>Yb,maxLength:()=>_r,maxSize:()=>qt,meta:()=>f$,mime:()=>ln,minLength:()=>St,minSize:()=>pt,multipleOf:()=>Ht,nan:()=>i$,nanoid:()=>hb,nativeEnum:()=>Qb,negative:()=>Ps,never:()=>ha,nonnegative:()=>Rs,nonoptional:()=>mp,nonpositive:()=>Cs,normalize:()=>dn,null:()=>Bf,nullable:()=>Ii,nullish:()=>r$,number:()=>Uf,object:()=>Bb,optional:()=>ki,overwrite:()=>ct,parse:()=>Ef,parseAsync:()=>kf,partialRecord:()=>Jb,pipe:()=>Hs,positive:()=>Os,prefault:()=>pp,preprocess:()=>v$,prettifyError:()=>Cu,promise:()=>c$,property:()=>Ds,readonly:()=>wp,record:()=>rp,refine:()=>Tp,regex:()=>nn,regexes:()=>Ge,registry:()=>us,safeDecode:()=>Df,safeDecodeAsync:()=>Lf,safeEncode:()=>Rf,safeEncodeAsync:()=>Nf,safeParse:()=>If,safeParseAsync:()=>Tf,set:()=>Xb,setErrorMap:()=>vA,size:()=>yr,slugify:()=>mn,startsWith:()=>cn,strictObject:()=>Gb,string:()=>Si,stringFormat:()=>Ib,stringbool:()=>m$,success:()=>n$,superRefine:()=>Ap,symbol:()=>zb,templateLiteral:()=>a$,toJSONSchema:()=>zs,toLowerCase:()=>fn,toUpperCase:()=>pn,transform:()=>ma,treeifyError:()=>Pu,trim:()=>hn,tuple:()=>tp,uint32:()=>Db,uint64:()=>Mb,ulid:()=>mb,undefined:()=>Ub,union:()=>fa,unknown:()=>$r,uppercase:()=>sn,url:()=>ub,util:()=>S,uuid:()=>ob,uuidv4:()=>sb,uuidv6:()=>ab,uuidv7:()=>cb,void:()=>Fb,xid:()=>gb,xor:()=>Hb});var Cp=g(()=>{He();xi();Fs();Sf();Mf();y$();He();Bd();He();bi();$$();Hd();$i();$i();w$();ae(os())});var ya=g(()=>{Cp();Cp()});function OA(t){try{return new URL(t)}catch{return null}}var IA,TA,AA,_a,xr,x$=g(()=>{"use strict";ya();IA=ee.enum(["debug","info","warn","error"]),TA=["ws:","wss:","http:","https:"],AA=ee.string().superRefine((t,e)=>{let r=OA(t);if(r===null){e.addIssue({code:"custom",message:"must be a valid ws://, wss://, http:// or https:// URL"});return}TA.includes(r.protocol)||e.addIssue({code:"custom",message:`must use the ws://, wss://, http:// or https:// scheme (got '${r.protocol}//' - the provider's adapter dialect decides which)`}),(r.username!==""||r.password!=="")&&e.addIssue({code:"custom",message:"must not embed credentials (user:pass@) - keys belong in secrets, not the url"})});_a=ee.object({provider:ee.string(),model:ee.string(),gateway:ee.string().nullable().optional(),url:AA.optional(),voiceId:ee.string().min(1).optional()}),xr=ee.object({version:ee.number().default(1),routes:ee.object({stt:_a.optional(),tts:_a.optional(),text:_a.optional(),embedding:_a.optional()}).optional(),secrets:ee.record(ee.string(),ee.string()).optional(),defaults:ee.object({logLevel:IA.default("info"),modality:ee.enum(["voice","text"]).default("voice")}).default({logLevel:"info",modality:"voice"}),upgrade:ee.object({auto:ee.boolean().default(!1)}).default({auto:!1})})});var he=g(()=>{"use strict";$v();wv();vu();x$()});import{mkdirSync as PA}from"node:fs";import{homedir as CA}from"node:os";import{join as S$,resolve as RA}from"node:path";var Rp,ke,Xt=g(()=>{"use strict";vu();Rp=class{dirName=".jarvis";dir(){let e=process.env[xv]?.trim();return e?RA(e):S$(CA(),this.dirName)}resolve(...e){return S$(this.dir(),...e)}ensureDir(){let e=this.dir();return PA(e,{recursive:!0,mode:448}),e}},ke=new Rp});import{chmodSync as DA,existsSync as NA,readFileSync as LA,writeFileSync as MA}from"node:fs";function k$(t){switch(t){case"debug":case"info":case"warn":case"error":return t;default:return}}var E$,Sr,Dp=g(()=>{"use strict";he();Xt();E$="config.json",Sr=class t{home;config;constructor(e=ke){this.home=e,this.config=this.load()}configPath(){return this.home.resolve(E$)}load(){let e=this.configPath(),r=NA(e)?this.readFile(e):{},i=xr.safeParse(r);if(!i.success)throw new Error(`invalid Jarvis config at ${e}: ${i.error.message}`);return i.data}readFile(e){let r;try{r=LA(e,"utf8")}catch(i){throw new Error(`could not read Jarvis config at ${e}`,{cause:i})}try{return JSON.parse(r)}catch(i){throw new Error(`Jarvis config at ${e} is not valid JSON`,{cause:i})}}resolved(){return this.config}get logLevel(){return k$(process.env.JARVIS_LOG_LEVEL)??k$(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,r){let i=xr.parse(r);e.ensureDir();let n=e.resolve(E$);MA(n,JSON.stringify(i,null,2)+`
|
|
68
|
+
`,{mode:384}),DA(n,384)}}});function I$(t,e){let r=t;for(let i of e){if(r===null||typeof r!="object")return;r=r[i]}return r}function ZA(t,e,r){let i=t;for(let n=0;n<e.length-1;n++){let o=e[n],s=i[o];(s===null||typeof s!="object")&&(i[o]={}),i=i[o]}i[e[e.length-1]]=r}function BA(t,e){let r=t;for(let n=0;n<e.length-1;n++){let o=r[e[n]];if(o===null||typeof o!="object")return!1;r=o}let i=e[e.length-1];return i in r?(delete r[i],!0):!1}var zA,UA,jA,FA,VA,je,Np=g(()=>{"use strict";he();Xt();Dp();zA="<set>",UA=new Set(["upgrade.auto"]),jA=new Set(["version"]),FA=["url","voiceId"],VA=new Set(["__proto__","prototype","constructor"]),je=class{home;constructor(e=ke){this.home=e}freshResolver(){return new Sr(this.home)}resolved(){return this.freshResolver().resolved()}list(){return this.redact(this.freshResolver().resolved())}get(e){return I$(this.list(),this.parsePath(e))}set(e,r){let i=this.parsePath(e);this.assertMutable(e);let n=this.freshResolver(),o=structuredClone(n.resolved()),s=this.coerce(e,r);this.dropProviderScopedOnSwitch(o,i,s),ZA(o,i,s),n.save(this.validate(o,e))}unset(e){let r=this.parsePath(e);this.assertMutable(e);let i=this.freshResolver(),n=structuredClone(i.resolved());if(!BA(n,r))throw new Error(`nothing to unset: '${e}' is not set`);i.save(this.validate(n,e))}write(e){Sr.persist(this.home,e)}validate(e,r){let i=xr.safeParse(e);if(i.success)return i.data;let n=i.error.issues.map(s=>`${s.path.join(".")}: ${s.message}`).join("; "),o=r.startsWith("routes.")?" A route needs both a provider and a model - run 'jarvis init' to configure one.":"";throw new Error(`'${r}' would make the config invalid (${n}).${o}`)}coerce(e,r){if(UA.has(e)){if(r==="true")return!0;if(r==="false")return!1;throw new Error(`'${e}' expects 'true' or 'false', got '${r}'`)}return r}dropProviderScopedOnSwitch(e,r,i){if(r.length!==3||r[0]!=="routes"||r[2]!=="provider")return;let n=I$(e,r.slice(0,2));if(n===null||typeof n!="object")return;let o=n;if(o.provider!==i)for(let s of FA)delete o[s]}assertMutable(e){if(jA.has(e))throw new Error(`'${e}' is managed by Jarvis and cannot be changed`)}parsePath(e){let r=e.split(".");if(e.length===0||r.some(i=>i.length===0||VA.has(i)))throw new Error(`invalid config path: '${e}'`);return r}redact(e){let r=structuredClone(e);if(r.secrets)for(let i of Object.keys(r.secrets))r.secrets[i]=zA;return r}}});async function*A$(t,e={}){let{signal:r,idleTimeoutMs:i}=e,n=t.getReader(),o=new TextDecoder,s="",a=[];try{for(;;){let{value:c,done:u}=await GA(n,r,i);if(u)break;s+=o.decode(c,{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 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 AA(t,e,n){return e?.aborted?Promise.reject($$(e)):new Promise((i,r)=>{let o=!1,s=u=>{o||(o=!0,c!==void 0&&clearTimeout(c),e?.removeEventListener("abort",a),u())},a=()=>s(()=>r($$(e))),c=n!==void 0?setTimeout(()=>s(()=>r(new _a(n))),n):void 0;e?.addEventListener("abort",a,{once:!0}),t.read().then(u=>s(()=>i(u)),u=>s(()=>r(OA(u))))})}function $$(t){let e=t?.reason;return e instanceof Error?e:new Error("text stream aborted")}function OA(t){return t instanceof Error?t:new Error(String(t))}var _a,Op=g(()=>{"use strict";_a=class extends Error{constructor(e){super(`text stream idle for ${e}ms`),this.name="IdleTimeoutError"}}});function be(t,e){return t instanceof Error?t.name==="TimeoutError"||t.name==="AbortError"?"request timed out":PA(t.message,e):"network error"}function PA(t,e){let n=t;for(let i of new Set([e,e?.trim()]))i!==void 0&&i.trim().length>0&&(n=n.split(i).join("<redacted>"));return n.replace(/\s+/g," ").trim()}function ba(t,e){for(let n=0;n<t.length;n+=1){let i=t.charCodeAt(n);if(i<32||i===127)throw new Error(`${e} contains a control character (check for a pasted trailing newline) - it cannot be sent as an HTTP header`)}}var Xt=g(()=>{"use strict"});var It,Pp=g(()=>{"use strict";It=class extends Error{status;constructor(e,n){super(e),this.status=n,this.name="TextAdapterError"}}});function LA(t){return"toolCalls"in t?{role:"assistant",content:[...t.content.length>0?[{type:"text",text:t.content}]:[],...t.toolCalls.map(e=>({type:"tool_use",id:e.id,name:e.name,input:UA(e.input)}))]}:t.role==="tool"?{role:"user",content:t.results.map(e=>({type:"tool_result",tool_use_id:e.id,content:e.result,...e.isError===!0&&{is_error:!0}}))}:{role:t.role,content:t.content}}function MA(t){return"toolCalls"in t?[{role:"assistant",content:t.content.length>0?t.content:null,tool_calls:t.toolCalls.map(e=>({id:e.id,type:"function",function:{name:e.name,arguments:zA(e.input)}}))}]:t.role==="tool"?t.results.map(e=>({role:"tool",tool_call_id:e.id,content:e.result})):[{role:t.role,content:t.content}]}function zA(t){return typeof t=="string"?t:JSON.stringify(t??{})}function UA(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:{}}function S$(t,e,n){let i=n.length===0?"{}":n;try{return{type:"tool_call",id:t,name:e,input:JSON.parse(i)}}catch{return{type:"tool_call",id:t,name:e,input:n}}}function E$(t){try{return JSON.parse(t)}catch{return}}function kt(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0}function x$(t){return Array.isArray(t)?t:void 0}function I$(t){let e=kt(t)?.message;return typeof e=="string"?e:"unknown error"}var wa,CA,RA,NA,DA,$a,Mi,Cp,zi,Rp,Np=g(()=>{"use strict";Op();Xt();Pp();wa=3e4,CA=4096,RA="https://api.anthropic.com/v1/messages",NA="2023-06-01",DA="https://api.openai.com/v1/chat/completions",$a=class{key;fetchImpl;idleTimeoutMs;constructor(e,n=fetch,i=wa){this.key=e,this.fetchImpl=n,this.idleTimeoutMs=i,ba(e,"stored text provider key")}async*stream(e){let{url:n,init:i}=this.buildRequest(e),r;try{r=await this.fetchImpl(n,{...i,signal:e.signal})}catch(s){throw s instanceof Error&&(s.name==="AbortError"||s.name==="TimeoutError")?s:new It(be(s,this.key))}if(!r.ok)throw new It(`text provider request failed (HTTP ${r.status})`,r.status);if(!r.body)throw new It("text provider response had no body");let o=this.newTurnDecoder();for await(let s of w$(r.body,{signal:e.signal,idleTimeoutMs:this.idleTimeoutMs})){if(o.isDone(s))break;for(let a of o.decode(s))yield a}for(let s of o.flush())yield s}},Mi=class extends $a{buildRequest(e){let n={model:e.model,max_tokens:CA,stream:!0,messages:e.messages.map(LA),...e.system!==void 0&&{system:e.system},...e.tools!==void 0&&e.tools.length>0&&{tools:e.tools.map(i=>({name:i.name,description:i.description,input_schema:i.inputSchema}))}};return{url:RA,init:{method:"POST",headers:{"x-api-key":this.key,"anthropic-version":NA,"content-type":"application/json"},body:JSON.stringify(n)}}}newTurnDecoder(){return new Cp}};Cp=class{tool=null;isDone(){return!1}decode(e){let n=kt(E$(e));if(!n)return[];if(n.type==="error")throw new It(`anthropic stream error: ${I$(n.error)}`);if(n.type==="content_block_start"){let i=kt(n.content_block);return i?.type==="tool_use"&&typeof i.id=="string"&&(this.tool={id:i.id,name:String(i.name??""),json:""}),[]}if(n.type==="content_block_delta"){let i=kt(n.delta);return i?.type==="text_delta"&&typeof i.text=="string"?[{type:"text",text:i.text}]:(i?.type==="input_json_delta"&&this.tool&&typeof i.partial_json=="string"&&(this.tool.json+=i.partial_json),[])}if(n.type==="content_block_stop"&&this.tool){let i=S$(this.tool.id,this.tool.name,this.tool.json);return this.tool=null,[i]}return[]}flush(){return[]}},zi=class extends $a{buildRequest(e){let n=e.messages.flatMap(MA),i=e.system!==void 0?[{role:"system",content:e.system},...n]:n,r={model:e.model,stream:!0,messages:i,...e.tools!==void 0&&e.tools.length>0&&{tools:e.tools.map(o=>({type:"function",function:{name:o.name,description:o.description,parameters:o.inputSchema}}))}};return{url:DA,init:{method:"POST",headers:{Authorization:`Bearer ${this.key}`,"content-type":"application/json"},body:JSON.stringify(r)}}}newTurnDecoder(){return new Rp}};Rp=class{calls=new Map;done=!1;isDone(e){return e!=="[DONE]"?!1:(this.done=!0,!0)}decode(e){let n=kt(E$(e));if(!n)return[];if(n.error)throw new It(`openai stream error: ${I$(n.error)}`);let i=x$(n.choices),r=kt(kt(i?.[0])?.delta);if(!r)return[];for(let s of x$(r.tool_calls)??[]){let a=kt(s);if(!a)continue;let c=typeof a.index=="number"?a.index:0,u=this.calls.get(c)??{id:"",name:"",args:""};typeof a.id=="string"&&(u.id=a.id);let l=kt(a.function);typeof l?.name=="string"&&(u.name=l.name),typeof l?.arguments=="string"&&(u.args+=l.arguments),this.calls.set(c,u)}let o=r.content;return typeof o=="string"&&o.length>0?[{type:"text",text:o}]:[]}flush(){if(!this.done)return this.calls.clear(),[];let e=[...this.calls.entries()].sort(([n],[i])=>n-i).map(([,n])=>S$(n.id,n.name,n.args));return this.calls.clear(),e}}});var Ui,Dp=g(()=>{"use strict";Np();Ui=class{fetchImpl;idleTimeoutMs;constructor(e=fetch,n=wa){this.fetchImpl=e,this.idleTimeoutMs=n}textAdapter(e,n){switch(e.provider){case"anthropic":return new Mi(n,this.fetchImpl,this.idleTimeoutMs);case"openai":return new zi(n,this.fetchImpl,this.idleTimeoutMs);default:throw new Error(`no text adapter for provider '${e.provider}'`)}}}});var Fe,k$=g(()=>{"use strict";Fe=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 T$=g(()=>{"use strict"});var ji=g(()=>{"use strict";k$();T$()});var Tt,Fi=g(()=>{"use strict";Tt=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 Xe(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 jA(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 Qt,Vi,Zi,Er=g(()=>{"use strict";he();Qt=.02;Vi=class{threshold;constructor(e){this.threshold=e}classify(e,n){n(Xe(e,this.threshold))}},Zi=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??Qt,this.log=n.log??j}classify(e,n){if(this.degraded){this.announce("energy (fallback)"),n(Xe(e,this.energyThreshold));return}this.vad.process(jA(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(Xe(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 Lp(t){return new Error(`openai-compat ASR decode failed (HTTP ${t})`)}function Mp(t){t.body?.cancel().catch(()=>{})}function VA(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function WA(t){return t.replace(GA," ")}function HA(t){let e;try{e=new URL(t)}catch{throw new Error("openai-compat ASR route url must be a valid http:// or https:// URL")}if(e.protocol!=="http:"&&e.protocol!=="https:")throw new Error(`openai-compat ASR route url must use the http:// or https:// scheme (got '${e.protocol}//' - this is an HTTP endpoint, not a WebSocket)`);if(e.username!==""||e.password!=="")throw new Error("openai-compat ASR route url must not embed credentials (user:pass@) - configure the key in secrets instead");return t.replace(/\/+$/,"")}function qA(t,e){let n=new Uint8Array(e),i=0;for(let r of t)n.set(r,i),i+=r.byteLength;return n}function JA(t,e){let n=new Uint8Array(44+t.byteLength),i=new DataView(n.buffer);return xa(n,0,"RIFF"),i.setUint32(4,36+t.byteLength,!0),xa(n,8,"WAVE"),xa(n,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,e,!0),i.setUint32(28,e*2,!0),i.setUint16(32,2,!0),i.setUint16(34,16,!0),xa(n,36,"data"),i.setUint32(40,t.byteLength,!0),n.set(t,44),n}function xa(t,e,n){for(let i=0;i<n.length;i+=1)t[e+i]=n.charCodeAt(i)}function P$(t,e=0){if(!(t instanceof Error)||e>3)return"network error";if(t instanceof AggregateError&&t.message.length===0){let n=t.errors.find(i=>i instanceof Error&&i.message.length>0);if(n)return n.message}return t.cause instanceof Error&&(t.message.length===0||t.message==="fetch failed")?P$(t.cause,e+1):t.message.length>0?t.message:t.name.length>0?t.name:"network error"}var Up,jp,A$,FA,Sa,zp,O$,ZA,BA,GA,Fp=g(()=>{"use strict";he();Xt();Fi();Er();Up="http://localhost:8081",jp="large-v3-turbo",A$=1e3,FA=1e4,Sa=class{fetchImpl;model;clock;id="openai-compat";partialStability="redecode";baseUrl;key;negotiation={dialect:null};constructor(e,n=Up,i=jp,r,o=new Tt){this.fetchImpl=e,this.model=i,this.clock=o,this.baseUrl=HA(n),this.key=r!==void 0&&r.length>0?r:void 0,this.key!==void 0&&ba(this.key,"openai-compat ASR key")}open(e){return e.biasTerms!==void 0&&e.biasTerms.length>0&&j.debug("openai-compat ASR: biasTerms are deliberately not mapped on this engine (the whisper initial-prompt hook measured mildly negative in the 0033 E1 bake-off) - proceeding unbiased",{count:e.biasTerms.length}),new zp({fetchImpl:this.fetchImpl,baseUrl:this.baseUrl,model:this.model,key:this.key,negotiation:this.negotiation,clock:this.clock},e)}},zp=class{ctx;opts;aborted=!1;closed=!1;endRequested=!1;buffered=[];bufferedBytes=0;inFlightDecode=null;inFlightAbort=null;speechSinceLastDecode=!1;lastDecodeAtMs=-1/0;lastEmittedPartial=null;transcriptCb;errorCb;endPending=null;constructor(e,n){this.ctx=e,this.opts=n}pushAudio(e){this.aborted||this.closed||this.endRequested||(this.buffered.push(e.slice()),this.bufferedBytes+=e.byteLength,!this.speechSinceLastDecode&&Xe(e,Qt)&&(this.speechSinceLastDecode=!0),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.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()}maybeRedecodeTick(){if(this.inFlightDecode!==null||!this.speechSinceLastDecode||this.bufferedBytes<this.opts.sampleRate*2*(A$/1e3))return;let e=this.ctx.clock.now();e-this.lastDecodeAtMs<A$||(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(n=>{j.debug("openai-compat ASR re-decode tick failed - missed partial",{message:n instanceof Error?n.message:String(n)})}).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.teardown(),i(n)}failStream(e){if(this.endPending){let{reject:n}=this.endPending;this.endPending=null,n(e)}this.errorCb?.(e),this.teardown()}async decodeFullBuffer(){let e=JA(qA(this.buffered,this.bufferedBytes),this.opts.sampleRate),n=new AbortController,i={timedOut:!1};this.inFlightAbort=n;let r=this.ctx.clock.setTimer(this.decodeReplyTimeoutMs(),()=>{i.timedOut=!0,n.abort()});try{let o=await this.postWithNegotiation(e,n.signal),s;try{s=await o.json()}catch{throw new Error("openai-compat ASR decode returned invalid JSON")}let a=VA(s)&&typeof s.text=="string"?s.text:"";return WA(a)}catch(o){throw i.timedOut?new Error("openai-compat ASR decode timed out",{cause:o}):o instanceof Error?o:new Error(String(o))}finally{this.ctx.clock.clearTimer(r),this.inFlightAbort===n&&(this.inFlightAbort=null)}}async postWithNegotiation(e,n){let i=this.ctx.negotiation.dialect;if(i!==null){let s=await this.post(i,e,n);if(!s.ok)throw Mp(s),Lp(s.status);return s}let r=await this.post("standard",e,n);if(r.ok)return this.ctx.negotiation.dialect="standard",r;if(Mp(r),r.status!==404)throw Lp(r.status);let o=await this.post("inference",e,n);if(o.ok)return this.ctx.negotiation.dialect="inference",o;throw Mp(o),Lp(o.status)}async post(e,n,i){let r=e==="standard"?`${this.ctx.baseUrl}/v1/audio/transcriptions`:`${this.ctx.baseUrl}/inference`,o=new FormData;o.append("file",new Blob([n],{type:"audio/wav"}),"utterance.wav"),e==="standard"&&o.append("model",this.ctx.model),this.opts.language!==void 0&&o.append("language",this.opts.language),o.append("temperature","0"),o.append("response_format","json");try{return await this.ctx.fetchImpl(r,{method:"POST",body:o,...this.ctx.key!==void 0&&{headers:{Authorization:`Bearer ${this.ctx.key}`}},signal:i})}catch(s){throw i.aborted?new Error("openai-compat ASR request aborted",{cause:s}):new Error(`openai-compat ASR request failed: ${P$(s)}`,{cause:s})}}decodeReplyTimeoutMs(){let e=this.bufferedBytes/2/this.opts.sampleRate*1e3;return FA+Math.ceil(e)}teardown(){this.closed||(this.closed=!0,this.inFlightAbort?.abort(),this.inFlightAbort=null)}};O$=" ",ZA="\r",BA=`
|
|
71
|
-
`,GA=new RegExp(`[ ${O$}]*[${ZA}${BA}]+[ ${O$}]*`,"g")});function In(t){try{let e=JSON.parse(t);return typeof e=="object"&&e!==null?e:void 0}catch{return}}function Bi(t){return typeof t=="string"?t:""}function Ea(t){let e=t.message_type;return typeof e=="string"&&(KA.has(e)||e.endsWith("_error"))?e:typeof t.error=="string"&&t.error.length>0?"error":null}function C$(t){return Buffer.from(t).toString("base64")}function R$(t){return new Uint8Array(Buffer.from(t,"base64"))}function kn(t,e){return new Error(`${t} connection error: ${e.message}`)}var KA,Ia=g(()=>{"use strict";KA=new Set(["error","auth_error","quota_exceeded","rate_limited"])});function L$(t,e){let n=new Uint8Array(e),i=0;for(let r of t)n.set(r,i),i+=r.byteLength;return n}function XA(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 QA(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 ka,N$,D$,YA,Gi,Vp,Ta=g(()=>{"use strict";he();Fi();Er();Ia();ka="ws://localhost:6007",N$=1e3,D$=10240,YA=1e4,Gi=class{socketFactory;url;clock;id="sherpa-onnx";partialStability="redecode";constructor(e,n=ka,i=new Tt){this.socketFactory=e,this.url=n,this.clock=i}open(e){return e.biasTerms!==void 0&&e.biasTerms.length>0&&j.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&&Xe(e,Qt)&&(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=In(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(Bi(n.text))}}}handleError(e){if(this.closed)return;let n=kn("sherpa ASR",new Error(XA(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*(N$/1e3))return;let e=this.clock.now();e-this.lastDecodeAtMs<N$||(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=QA(L$(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=L$([i,n],i.byteLength+n.byteLength),s=new Promise((a,c)=>{let u=this.clock.setTimer(this.decodeReplyTimeoutMs(),()=>{this.pendingReply&&(this.pendingReply=null,this.staleReplies+=1,c(new Error("sherpa ASR decode timed out")))});this.pendingReply={resolve:a,reject:c,timer:u}});try{for(let a=0;a<o.byteLength;a+=D$)this.socket.send(o.subarray(a,Math.min(a+D$,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 YA+Math.ceil(e)}teardown(){this.closed||(this.closed=!0,this.rejectPendingReply(new Error("sherpa ASR stream closed")),this.socket.close())}}});var At=N((w2,U$)=>{"use strict";var M$=["nodebuffer","arraybuffer","fragments"],z$=typeof Blob<"u";z$&&M$.push("blob");U$.exports={BINARY_TYPES:M$,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:z$,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Wi=N((x2,Aa)=>{"use strict";var{EMPTY_BUFFER:eO}=At(),Zp=Buffer[Symbol.species];function tO(t,e){if(t.length===0)return eO;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 Zp(n.buffer,n.byteOffset,i):n}function j$(t,e,n,i,r){for(let o=0;o<r;o++)n[i+o]=t[o]^e[o&3]}function F$(t,e){for(let n=0;n<t.length;n++)t[n]^=e[n&3]}function rO(t){return t.length===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.length)}function Bp(t){if(Bp.readOnly=!0,Buffer.isBuffer(t))return t;let e;return t instanceof ArrayBuffer?e=new Zp(t):ArrayBuffer.isView(t)?e=new Zp(t.buffer,t.byteOffset,t.byteLength):(e=Buffer.from(t),Bp.readOnly=!1),e}Aa.exports={concat:tO,mask:j$,toArrayBuffer:rO,toBuffer:Bp,unmask:F$};if(!process.env.WS_NO_BUFFER_UTIL)try{let t=ce("bufferutil");Aa.exports.mask=function(e,n,i,r,o){o<48?j$(e,n,i,r,o):t.mask(e,n,i,r,o)},Aa.exports.unmask=function(e,n){e.length<32?F$(e,n):t.unmask(e,n)}}catch{}});var B$=N((S2,Z$)=>{"use strict";var V$=Symbol("kDone"),Gp=Symbol("kRun"),Wp=class{constructor(e){this[V$]=()=>{this.pending--,this[Gp]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Gp]()}[Gp](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[V$])}}};Z$.exports=Wp});var On=N((E2,q$)=>{"use strict";var Hi=ce("zlib"),G$=Wi(),nO=B$(),{kStatusCode:W$}=At(),iO=Buffer[Symbol.species],oO=Buffer.from([0,0,255,255]),Pa=Symbol("permessage-deflate"),Ot=Symbol("total-length"),Tn=Symbol("callback"),er=Symbol("buffers"),An=Symbol("error"),Oa,Hp=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,!Oa){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Oa=new nO(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[Tn];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){Oa.add(r=>{this._decompress(e,n,(o,s)=>{r(),i(o,s)})})}compress(e,n,i){Oa.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"?Hi.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=Hi.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[Pa]=this,this._inflate[Ot]=0,this._inflate[er]=[],this._inflate.on("error",aO),this._inflate.on("data",H$)}this._inflate[Tn]=i,this._inflate.write(e),n&&this._inflate.write(oO),this._inflate.flush(()=>{let o=this._inflate[An];if(o){this._inflate.close(),this._inflate=null,i(o);return}let s=G$.concat(this._inflate[er],this._inflate[Ot]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Ot]=0,this._inflate[er]=[],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"?Hi.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=Hi.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[Ot]=0,this._deflate[er]=[],this._deflate.on("data",sO)}this._deflate[Tn]=i,this._deflate.write(e),this._deflate.flush(Hi.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=G$.concat(this._deflate[er],this._deflate[Ot]);n&&(o=new iO(o.buffer,o.byteOffset,o.length-4)),this._deflate[Tn]=null,this._deflate[Ot]=0,this._deflate[er]=[],n&&this.params[`${r}_no_context_takeover`]&&this._deflate.reset(),i(null,o)})}};q$.exports=Hp;function sO(t){this[er].push(t),this[Ot]+=t.length}function H$(t){if(this[Ot]+=t.length,this[Pa]._maxPayload<1||this[Ot]<=this[Pa]._maxPayload){this[er].push(t);return}this[An]=new RangeError("Max payload size exceeded"),this[An].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[An][W$]=1009,this.removeListener("data",H$),this.reset()}function aO(t){if(this[Pa]._inflate=null,this[An]){this[Tn](this[An]);return}t[W$]=1007,this[Tn](t)}});var Pn=N((I2,Ca)=>{"use strict";var{isUtf8:J$}=ce("buffer"),{hasBlob:cO}=At(),uO=[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 lO(t){return t>=1e3&&t<=1014&&t!==1004&&t!==1005&&t!==1006||t>=3e3&&t<=4999}function qp(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 dO(t){return cO&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&(t[Symbol.toStringTag]==="Blob"||t[Symbol.toStringTag]==="File")}Ca.exports={isBlob:dO,isValidStatusCode:lO,isValidUTF8:qp,tokenChars:uO};if(J$)Ca.exports.isValidUTF8=function(t){return t.length<24?qp(t):J$(t)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let t=ce("utf-8-validate");Ca.exports.isValidUTF8=function(e){return e.length<32?qp(e):t(e)}}catch{}});var Qp=N((k2,rw)=>{"use strict";var{Writable:hO}=ce("stream"),K$=On(),{BINARY_TYPES:fO,EMPTY_BUFFER:Y$,kStatusCode:pO,kWebSocket:mO}=At(),{concat:Jp,toArrayBuffer:gO,unmask:vO}=Wi(),{isValidStatusCode:yO,isValidUTF8:X$}=Pn(),Ra=Buffer[Symbol.species],Qe=0,Q$=1,ew=2,tw=3,Kp=4,Yp=5,Na=6,Xp=class extends hO{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||fO[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[mO]=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 Q$:this.getPayloadLength16(e);break;case ew:this.getPayloadLength64(e);break;case tw:this.getMask();break;case Kp:this.getData(e);break;case Yp: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[K$.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=Q$:this._payloadLength===127?this._state=ew: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=tw:this._state=Kp}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Kp}getData(e){let n=Y$;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&&vO(n,this._mask)}if(this._opcode>7){this.controlMessage(n,e);return}if(this._compressed){this._state=Yp,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[K$.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=Jp(i,n):this._binaryType==="arraybuffer"?r=gO(Jp(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=Jp(i,n);if(!this._skipUTF8Validation&&!X$(r)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(o);return}this._state===Yp||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,Y$),this.end();else{let i=e.readUInt16BE(0);if(!yO(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&&!X$(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[pO]=r,s}};rw.exports=Xp});var rm=N((A2,ow)=>{"use strict";var{Duplex:T2}=ce("stream"),{randomFillSync:_O}=ce("crypto"),{types:{isUint8Array:bO}}=ce("util"),nw=On(),{EMPTY_BUFFER:$O,kWebSocket:wO,NOOP:xO}=At(),{isBlob:Cn,isValidStatusCode:SO}=Pn(),{mask:iw,toBuffer:Ir}=Wi(),et=Symbol("kByteLength"),EO=Buffer.alloc(4),Da=8*1024,kr,Rn=Da,ut=0,IO=1,kO=2,em=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=ut,this.onerror=xO,this[wO]=void 0}static frame(e,n){let i,r=!1,o=2,s=!1;n.mask&&(i=n.maskBuffer||EO,n.generateMask?n.generateMask(i):(Rn===Da&&(kr===void 0&&(kr=Buffer.alloc(Da)),_O(kr,0,Da),Rn=0),i[0]=kr[Rn++],i[1]=kr[Rn++],i[2]=kr[Rn++],i[3]=kr[Rn++]),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 c=a;a>=65536?(o+=8,c=127):a>125&&(o+=2,c=126);let u=Buffer.allocUnsafe(r?a+o:o);return u[0]=n.fin?n.opcode|128:n.opcode,n.rsv1&&(u[0]|=64),u[1]=c,c===126?u.writeUInt16BE(a,2):c===127&&(u[2]=u[3]=0,u.writeUIntBE(a,4,6)),n.mask?(u[1]|=128,u[o-4]=i[0],u[o-3]=i[1],u[o-2]=i[2],u[o-1]=i[3],s?[u,e]:r?(iw(e,i,u,o,a),[u]):(iw(e,i,e,0,a),[u,e])):[u,e]}close(e,n,i,r){let o;if(e===void 0)o=$O;else{if(typeof e!="number"||!SO(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(bO(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!==ut?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):Cn(e)?(r=e.size,o=!1):(e=Ir(e),r=e.length,o=Ir.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};Cn(e)?this._state!==ut?this.enqueue([this.getBlobData,e,!1,s,i]):this.getBlobData(e,!1,s,i):this._state!==ut?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):Cn(e)?(r=e.size,o=!1):(e=Ir(e),r=e.length,o=Ir.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};Cn(e)?this._state!==ut?this.enqueue([this.getBlobData,e,!1,s,i]):this.getBlobData(e,!1,s,i):this._state!==ut?this.enqueue([this.dispatch,e,!1,s,i]):this.sendFrame(t.frame(e,s),i)}send(e,n,i){let r=this._extensions[nw.extensionName],o=n.binary?2:1,s=n.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):Cn(e)?(a=e.size,c=!1):(e=Ir(e),a=e.length,c=Ir.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 u={[et]:a,fin:n.fin,generateMask:this._generateMask,mask:n.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:c,rsv1:s};Cn(e)?this._state!==ut?this.enqueue([this.getBlobData,e,this._compress,u,i]):this.getBlobData(e,this._compress,u,i):this._state!==ut?this.enqueue([this.dispatch,e,this._compress,u,i]):this.dispatch(e,this._compress,u,i)}getBlobData(e,n,i,r){this._bufferedBytes+=i[et],this._state=kO,e.arrayBuffer().then(o=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(tm,this,a,r);return}this._bufferedBytes-=i[et];let s=Ir(o);n?this.dispatch(s,n,i,r):(this._state=ut,this.sendFrame(t.frame(s,i),r),this.dequeue())}).catch(o=>{process.nextTick(TO,this,o,r)})}dispatch(e,n,i,r){if(!n){this.sendFrame(t.frame(e,i),r);return}let o=this._extensions[nw.extensionName];this._bufferedBytes+=i[et],this._state=IO,o.compress(e,i.fin,(s,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");tm(this,c,r);return}this._bufferedBytes-=i[et],this._state=ut,i.readOnly=!1,this.sendFrame(t.frame(a,i),r),this.dequeue()})}dequeue(){for(;this._state===ut&&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)}};ow.exports=em;function tm(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 TO(t,e,n){tm(t,e,n),t.onerror(e)}});var pw=N((O2,fw)=>{"use strict";var{kForOnEventAttribute:qi,kListener:nm}=At(),sw=Symbol("kCode"),aw=Symbol("kData"),cw=Symbol("kError"),uw=Symbol("kMessage"),lw=Symbol("kReason"),Nn=Symbol("kTarget"),dw=Symbol("kType"),hw=Symbol("kWasClean"),Pt=class{constructor(e){this[Nn]=null,this[dw]=e}get target(){return this[Nn]}get type(){return this[dw]}};Object.defineProperty(Pt.prototype,"target",{enumerable:!0});Object.defineProperty(Pt.prototype,"type",{enumerable:!0});var Tr=class extends Pt{constructor(e,n={}){super(e),this[sw]=n.code===void 0?0:n.code,this[lw]=n.reason===void 0?"":n.reason,this[hw]=n.wasClean===void 0?!1:n.wasClean}get code(){return this[sw]}get reason(){return this[lw]}get wasClean(){return this[hw]}};Object.defineProperty(Tr.prototype,"code",{enumerable:!0});Object.defineProperty(Tr.prototype,"reason",{enumerable:!0});Object.defineProperty(Tr.prototype,"wasClean",{enumerable:!0});var Dn=class extends Pt{constructor(e,n={}){super(e),this[cw]=n.error===void 0?null:n.error,this[uw]=n.message===void 0?"":n.message}get error(){return this[cw]}get message(){return this[uw]}};Object.defineProperty(Dn.prototype,"error",{enumerable:!0});Object.defineProperty(Dn.prototype,"message",{enumerable:!0});var Ji=class extends Pt{constructor(e,n={}){super(e),this[aw]=n.data===void 0?null:n.data}get data(){return this[aw]}};Object.defineProperty(Ji.prototype,"data",{enumerable:!0});var AO={addEventListener(t,e,n={}){for(let r of this.listeners(t))if(!n[qi]&&r[nm]===e&&!r[qi])return;let i;if(t==="message")i=function(o,s){let a=new Ji("message",{data:s?o:o.toString()});a[Nn]=this,La(e,this,a)};else if(t==="close")i=function(o,s){let a=new Tr("close",{code:o,reason:s.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[Nn]=this,La(e,this,a)};else if(t==="error")i=function(o){let s=new Dn("error",{error:o,message:o.message});s[Nn]=this,La(e,this,s)};else if(t==="open")i=function(){let o=new Pt("open");o[Nn]=this,La(e,this,o)};else return;i[qi]=!!n[qi],i[nm]=e,n.once?this.once(t,i):this.on(t,i)},removeEventListener(t,e){for(let n of this.listeners(t))if(n[nm]===e&&!n[qi]){this.removeListener(t,n);break}}};fw.exports={CloseEvent:Tr,ErrorEvent:Dn,Event:Pt,EventTarget:AO,MessageEvent:Ji};function La(t,e,n){typeof t=="object"&&t.handleEvent?t.handleEvent.call(t,n):t.call(e,n)}});var Ma=N((P2,mw)=>{"use strict";var{tokenChars:Ki}=Pn();function gt(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}function OO(t){let e=Object.create(null),n=Object.create(null),i=!1,r=!1,o=!1,s,a,c=-1,u=-1,l=-1,d=0;for(;d<t.length;d++)if(u=t.charCodeAt(d),s===void 0)if(l===-1&&Ki[u]===1)c===-1&&(c=d);else if(d!==0&&(u===32||u===9))l===-1&&c!==-1&&(l=d);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d);let f=t.slice(c,l);u===44?(gt(e,f,n),n=Object.create(null)):s=f,c=l=-1}else throw new SyntaxError(`Unexpected character at index ${d}`);else if(a===void 0)if(l===-1&&Ki[u]===1)c===-1&&(c=d);else if(u===32||u===9)l===-1&&c!==-1&&(l=d);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d),gt(n,t.slice(c,l),!0),u===44&&(gt(e,s,n),n=Object.create(null),s=void 0),c=l=-1}else if(u===61&&c!==-1&&l===-1)a=t.slice(c,d),c=l=-1;else throw new SyntaxError(`Unexpected character at index ${d}`);else if(r){if(Ki[u]!==1)throw new SyntaxError(`Unexpected character at index ${d}`);c===-1?c=d:i||(i=!0),r=!1}else if(o)if(Ki[u]===1)c===-1&&(c=d);else if(u===34&&c!==-1)o=!1,l=d;else if(u===92)r=!0;else throw new SyntaxError(`Unexpected character at index ${d}`);else if(u===34&&t.charCodeAt(d-1)===61)o=!0;else if(l===-1&&Ki[u]===1)c===-1&&(c=d);else if(c!==-1&&(u===32||u===9))l===-1&&(l=d);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d);let f=t.slice(c,l);i&&(f=f.replace(/\\/g,""),i=!1),gt(n,a,f),u===44&&(gt(e,s,n),n=Object.create(null),s=void 0),a=void 0,c=l=-1}else throw new SyntaxError(`Unexpected character at index ${d}`);if(c===-1||o||u===32||u===9)throw new SyntaxError("Unexpected end of input");l===-1&&(l=d);let h=t.slice(c,l);return s===void 0?gt(e,h,n):(a===void 0?gt(n,h,!0):i?gt(n,a,h.replace(/\\/g,"")):gt(n,a,h),gt(e,s,n)),e}function PO(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(", ")}mw.exports={format:PO,parse:OO}});var Fa=N((N2,kw)=>{"use strict";var CO=ce("events"),RO=ce("https"),NO=ce("http"),yw=ce("net"),DO=ce("tls"),{randomBytes:LO,createHash:MO}=ce("crypto"),{Duplex:C2,Readable:R2}=ce("stream"),{URL:im}=ce("url"),tr=On(),zO=Qp(),UO=rm(),{isBlob:jO}=Pn(),{BINARY_TYPES:gw,CLOSE_TIMEOUT:FO,EMPTY_BUFFER:za,GUID:VO,kForOnEventAttribute:om,kListener:ZO,kStatusCode:BO,kWebSocket:ye,NOOP:_w}=At(),{EventTarget:{addEventListener:GO,removeEventListener:WO}}=pw(),{format:HO,parse:qO}=Ma(),{toBuffer:JO}=Wi(),bw=Symbol("kAborted"),sm=[8,13],Ct=["CONNECTING","OPEN","CLOSING","CLOSED"],KO=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,re=class t extends CO{constructor(e,n,i){super(),this._binaryType=gw[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=za,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){gw.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 zO({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 UO(e,this._extensions,i.generateMask);this._receiver=r,this._sender=o,this._socket=e,r[ye]=this,o[ye]=this,e[ye]=this,r.on("conclude",QO),r.on("drain",eP),r.on("error",tP),r.on("message",rP),r.on("ping",nP),r.on("pong",iP),o.onerror=oP,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),n.length>0&&e.unshift(n),e.on("close",Sw),e.on("data",ja),e.on("end",Ew),e.on("error",Iw),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[tr.extensionName]&&this._extensions[tr.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())}),xw(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){am(this,e,i);return}n===void 0&&(n=!this._isServer),this._sender.ping(e||za,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){am(this,e,i);return}n===void 0&&(n=!this._isServer),this._sender.pong(e||za,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){am(this,e,i);return}let r={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...n};this._extensions[tr.extensionName]||(r.compress=!1),this._sender.send(e||za,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:Ct.indexOf("CONNECTING")});Object.defineProperty(re.prototype,"CONNECTING",{enumerable:!0,value:Ct.indexOf("CONNECTING")});Object.defineProperty(re,"OPEN",{enumerable:!0,value:Ct.indexOf("OPEN")});Object.defineProperty(re.prototype,"OPEN",{enumerable:!0,value:Ct.indexOf("OPEN")});Object.defineProperty(re,"CLOSING",{enumerable:!0,value:Ct.indexOf("CLOSING")});Object.defineProperty(re.prototype,"CLOSING",{enumerable:!0,value:Ct.indexOf("CLOSING")});Object.defineProperty(re,"CLOSED",{enumerable:!0,value:Ct.indexOf("CLOSED")});Object.defineProperty(re.prototype,"CLOSED",{enumerable:!0,value:Ct.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[om])return e[ZO];return null},set(e){for(let n of this.listeners(t))if(n[om]){this.removeListener(t,n);break}typeof e=="function"&&this.addEventListener(t,e,{[om]:!0})}})});re.prototype.addEventListener=GO;re.prototype.removeEventListener=WO;kw.exports=re;function $w(t,e,n,i){let r={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:FO,protocolVersion:sm[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,!sm.includes(r.protocolVersion))throw new RangeError(`Unsupported protocol version: ${r.protocolVersion} (supported versions: ${sm.join(", ")})`);let o;if(e instanceof im)o=e;else try{o=new im(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:",c;if(o.protocol!=="ws:"&&!s&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!o.pathname?c="The URL's pathname is empty":o.hash&&(c="The URL contains a fragment identifier"),c){let y=new SyntaxError(c);if(t._redirects===0)throw y;Ua(t,y);return}let u=s?443:80,l=LO(16).toString("base64"),d=s?RO.request:NO.request,h=new Set,f;if(r.createConnection=r.createConnection||(s?XO:YO),r.defaultPort=r.defaultPort||u,r.port=o.port||u,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 tr({...r.perMessageDeflate,isServer:!1,maxPayload:r.maxPayload}),r.headers["Sec-WebSocket-Extensions"]=HO({[tr.extensionName]:f.offer()})),n.length){for(let y of n){if(typeof y!="string"||!KO.test(y)||h.has(y))throw new SyntaxError("An invalid or duplicated subprotocol was specified");h.add(y)}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 y=r.path.split(":");r.socketPath=y[0],r.path=y[1]}let p;if(r.followRedirects){if(t._redirects===0){t._originalIpc=a,t._originalSecure=s,t._originalHostOrSocketPath=a?r.socketPath:o.host;let y=i&&i.headers;if(i={...i,headers:{}},y)for(let[$,I]of Object.entries(y))i.headers[$.toLowerCase()]=I}else if(t.listenerCount("redirect")===0){let y=a?t._originalIpc?r.socketPath===t._originalHostOrSocketPath:!1:t._originalIpc?!1:o.host===t._originalHostOrSocketPath;(!y||t._originalSecure&&!s)&&(delete r.headers.authorization,delete r.headers.cookie,y||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",y=>{p===null||p[bw]||(p=t._req=null,Ua(t,y))}),p.on("response",y=>{let $=y.headers.location,I=y.statusCode;if($&&r.followRedirects&&I>=300&&I<400){if(++t._redirects>r.maxRedirects){qe(t,p,"Maximum redirects exceeded");return}p.abort();let A;try{A=new im($,e)}catch{let x=new SyntaxError(`Invalid URL: ${$}`);Ua(t,x);return}$w(t,A,n,i)}else t.emit("unexpected-response",p,y)||qe(t,p,`Unexpected server response: ${y.statusCode}`)}),p.on("upgrade",(y,$,I)=>{if(t.emit("upgrade",y),t.readyState!==re.CONNECTING)return;p=t._req=null;let A=y.headers.upgrade;if(A===void 0||A.toLowerCase()!=="websocket"){qe(t,$,"Invalid Upgrade header");return}let O=MO("sha1").update(l+VO).digest("base64");if(y.headers["sec-websocket-accept"]!==O){qe(t,$,"Invalid Sec-WebSocket-Accept header");return}let x=y.headers["sec-websocket-protocol"],k;if(x!==void 0?h.size?h.has(x)||(k="Server sent an invalid subprotocol"):k="Server sent a subprotocol but none was requested":h.size&&(k="Server sent no subprotocol"),k){qe(t,$,k);return}x&&(t._protocol=x);let z=y.headers["sec-websocket-extensions"];if(z!==void 0){if(!f){qe(t,$,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let U;try{U=qO(z)}catch{qe(t,$,"Invalid Sec-WebSocket-Extensions header");return}let H=Object.keys(U);if(H.length!==1||H[0]!==tr.extensionName){qe(t,$,"Server indicated an extension that was not requested");return}try{f.accept(U[tr.extensionName])}catch{qe(t,$,"Invalid Sec-WebSocket-Extensions header");return}t._extensions[tr.extensionName]=f}t.setSocket($,I,{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 Ua(t,e){t._readyState=re.CLOSING,t._errorEmitted=!0,t.emit("error",e),t.emitClose()}function YO(t){return t.path=t.socketPath,yw.connect(t)}function XO(t){return t.path=void 0,!t.servername&&t.servername!==""&&(t.servername=yw.isIP(t.host)?"":t.host),DO.connect(t)}function qe(t,e,n){t._readyState=re.CLOSING;let i=new Error(n);Error.captureStackTrace(i,qe),e.setHeader?(e[bw]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Ua,t,i)):(e.destroy(i),e.once("error",t.emit.bind(t,"error")),e.once("close",t.emitClose.bind(t)))}function am(t,e,n){if(e){let i=jO(e)?e.size:JO(e).length;t._socket?t._sender._bufferedBytes+=i:t._bufferedAmount+=i}if(n){let i=new Error(`WebSocket is not open: readyState ${t.readyState} (${Ct[t.readyState]})`);process.nextTick(n,i)}}function QO(t,e){let n=this[ye];n._closeFrameReceived=!0,n._closeMessage=e,n._closeCode=t,n._socket[ye]!==void 0&&(n._socket.removeListener("data",ja),process.nextTick(ww,n._socket),t===1005?n.close():n.close(t,e))}function eP(){let t=this[ye];t.isPaused||t._socket.resume()}function tP(t){let e=this[ye];e._socket[ye]!==void 0&&(e._socket.removeListener("data",ja),process.nextTick(ww,e._socket),e.close(t[BO])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t))}function vw(){this[ye].emitClose()}function rP(t,e){this[ye].emit("message",t,e)}function nP(t){let e=this[ye];e._autoPong&&e.pong(t,!this._isServer,_w),e.emit("ping",t)}function iP(t){this[ye].emit("pong",t)}function ww(t){t.resume()}function oP(t){let e=this[ye];e.readyState!==re.CLOSED&&(e.readyState===re.OPEN&&(e._readyState=re.CLOSING,xw(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t)))}function xw(t){t._closeTimer=setTimeout(t._socket.destroy.bind(t._socket),t._closeTimeout)}function Sw(){let t=this[ye];if(this.removeListener("close",Sw),this.removeListener("data",ja),this.removeListener("end",Ew),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[ye]=void 0,clearTimeout(t._closeTimer),t._receiver._writableState.finished||t._receiver._writableState.errorEmitted?t.emitClose():(t._receiver.on("error",vw),t._receiver.on("finish",vw))}function ja(t){this[ye]._receiver.write(t)||this.pause()}function Ew(){let t=this[ye];t._readyState=re.CLOSING,t._receiver.end(),this.end()}function Iw(){let t=this[ye];this.removeListener("error",Iw),this.on("error",_w),t&&(t._readyState=re.CLOSING,this.destroy())}});var Pw=N((L2,Ow)=>{"use strict";var D2=Fa(),{Duplex:sP}=ce("stream");function Tw(t){t.emit("close")}function aP(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Aw(t){this.removeListener("error",Aw),this.destroy(),this.listenerCount("error")===0&&this.emit("error",t)}function cP(t,e){let n=!0,i=new sP({...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(Tw,i);return}let s=!1;t.once("error",function(c){s=!0,o(c)}),t.once("close",function(){s||o(r),process.nextTick(Tw,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",aP),i.on("error",Aw),i}Ow.exports=cP});var cm=N((M2,Cw)=>{"use strict";var{tokenChars:uP}=Pn();function lP(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&&uP[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}Cw.exports={parse:lP}});var Uw=N((U2,zw)=>{"use strict";var dP=ce("events"),Va=ce("http"),{Duplex:z2}=ce("stream"),{createHash:hP}=ce("crypto"),Rw=Ma(),Ar=On(),fP=cm(),pP=Fa(),{CLOSE_TIMEOUT:mP,GUID:gP,kWebSocket:vP}=At(),yP=/^[+/0-9A-Za-z]{22}==$/,Nw=0,Dw=1,Mw=2,um=class extends dP{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:mP,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:pP,...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=Va.createServer((i,r)=>{let o=Va.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=_P(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=Nw}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===Mw){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Yi,this);return}if(e&&this.once("close",e),this._state!==Dw)if(this._state=Dw,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(Yi,this):process.nextTick(Yi,this);else{let n=this._server;this._removeListeners(),this._removeListeners=this._server=null,n.close(()=>{Yi(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",Lw);let o=e.headers["sec-websocket-key"],s=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){Or(this,e,n,405,"Invalid HTTP method");return}if(s===void 0||s.toLowerCase()!=="websocket"){Or(this,e,n,400,"Invalid Upgrade header");return}if(o===void 0||!yP.test(o)){Or(this,e,n,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){Or(this,e,n,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){Xi(n,400);return}let c=e.headers["sec-websocket-protocol"],u=new Set;if(c!==void 0)try{u=fP.parse(c)}catch{Or(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 Ar({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let f=Rw.parse(l);f[Ar.extensionName]&&(h.accept(f[Ar.extensionName]),d[Ar.extensionName]=h)}catch{Or(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,y,$)=>{if(!f)return Xi(n,p||401,y,$);this.completeUpgrade(d,o,u,e,n,i,r)});return}if(!this.options.verifyClient(h))return Xi(n,401)}this.completeUpgrade(d,o,u,e,n,i,r)}completeUpgrade(e,n,i,r,o,s,a){if(!o.readable||!o.writable)return o.destroy();if(o[vP])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Nw)return Xi(o,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${hP("sha1").update(n+gP).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&&(u.push(`Sec-WebSocket-Protocol: ${d}`),l._protocol=d)}if(e[Ar.extensionName]){let d=e[Ar.extensionName].params,h=Rw.format({[Ar.extensionName]:[d]});u.push(`Sec-WebSocket-Extensions: ${h}`),l._extensions=e}this.emit("headers",u,r),o.write(u.concat(`\r
|
|
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{n.cancel().catch(()=>{})}}function GA(t,e,r){return e?.aborted?Promise.reject(T$(e)):new Promise((i,n)=>{let o=!1,s=u=>{o||(o=!0,c!==void 0&&clearTimeout(c),e?.removeEventListener("abort",a),u())},a=()=>s(()=>n(T$(e))),c=r!==void 0?setTimeout(()=>s(()=>n(new ba(r))),r):void 0;e?.addEventListener("abort",a,{once:!0}),t.read().then(u=>s(()=>i(u)),u=>s(()=>n(WA(u))))})}function T$(t){let e=t?.reason;return e instanceof Error?e:new Error("text stream aborted")}function WA(t){return t instanceof Error?t:new Error(String(t))}var ba,Lp=g(()=>{"use strict";ba=class extends Error{constructor(e){super(`text stream idle for ${e}ms`),this.name="IdleTimeoutError"}}});function be(t,e){return t instanceof Error?t.name==="TimeoutError"||t.name==="AbortError"?"request timed out":HA(t.message,e):"network error"}function HA(t,e){let r=t;for(let i of new Set([e,e?.trim()]))i!==void 0&&i.trim().length>0&&(r=r.split(i).join("<redacted>"));return r.replace(/\s+/g," ").trim()}function $a(t,e){for(let r=0;r<t.length;r+=1){let i=t.charCodeAt(r);if(i<32||i===127)throw new Error(`${e} contains a control character (check for a pasted trailing newline) - it cannot be sent as an HTTP header`)}}var Qt=g(()=>{"use strict"});var kt,Mp=g(()=>{"use strict";kt=class extends Error{status;constructor(e,r){super(e),this.status=r,this.name="TextAdapterError"}}});function XA(t){return"toolCalls"in t?{role:"assistant",content:[...t.content.length>0?[{type:"text",text:t.content}]:[],...t.toolCalls.map(e=>({type:"tool_use",id:e.id,name:e.name,input:tO(e.input)}))]}:t.role==="tool"?{role:"user",content:t.results.map(e=>({type:"tool_result",tool_use_id:e.id,content:e.result,...e.isError===!0&&{is_error:!0}}))}:{role:t.role,content:t.content}}function QA(t){return"toolCalls"in t?[{role:"assistant",content:t.content.length>0?t.content:null,tool_calls:t.toolCalls.map(e=>({id:e.id,type:"function",function:{name:e.name,arguments:eO(e.input)}}))}]:t.role==="tool"?t.results.map(e=>({role:"tool",tool_call_id:e.id,content:e.result})):[{role:t.role,content:t.content}]}function eO(t){return typeof t=="string"?t:JSON.stringify(t??{})}function tO(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:{}}function P$(t,e,r){let i=r.length===0?"{}":r;try{return{type:"tool_call",id:t,name:e,input:JSON.parse(i)}}catch{return{type:"tool_call",id:t,name:e,input:r}}}function C$(t){try{return JSON.parse(t)}catch{return}}function It(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0}function O$(t){return Array.isArray(t)?t:void 0}function R$(t){let e=It(t)?.message;return typeof e=="string"?e:"unknown error"}var xa,qA,JA,KA,YA,wa,Mi,zp,zi,Up,jp=g(()=>{"use strict";Lp();Qt();Mp();xa=3e4,qA=4096,JA="https://api.anthropic.com/v1/messages",KA="2023-06-01",YA="https://api.openai.com/v1/chat/completions",wa=class{key;fetchImpl;idleTimeoutMs;constructor(e,r=fetch,i=xa){this.key=e,this.fetchImpl=r,this.idleTimeoutMs=i,$a(e,"stored text provider key")}async*stream(e){let{url:r,init:i}=this.buildRequest(e),n;try{n=await this.fetchImpl(r,{...i,signal:e.signal})}catch(s){throw s instanceof Error&&(s.name==="AbortError"||s.name==="TimeoutError")?s:new kt(be(s,this.key))}if(!n.ok)throw new kt(`text provider request failed (HTTP ${n.status})`,n.status);if(!n.body)throw new kt("text provider response had no body");let o=this.newTurnDecoder();for await(let s of A$(n.body,{signal:e.signal,idleTimeoutMs:this.idleTimeoutMs})){if(o.isDone(s))break;for(let a of o.decode(s))yield a}for(let s of o.flush())yield s}},Mi=class extends wa{buildRequest(e){let r={model:e.model,max_tokens:qA,stream:!0,messages:e.messages.map(XA),...e.system!==void 0&&{system:e.system},...e.tools!==void 0&&e.tools.length>0&&{tools:e.tools.map(i=>({name:i.name,description:i.description,input_schema:i.inputSchema}))}};return{url:JA,init:{method:"POST",headers:{"x-api-key":this.key,"anthropic-version":KA,"content-type":"application/json"},body:JSON.stringify(r)}}}newTurnDecoder(){return new zp}};zp=class{tool=null;isDone(){return!1}decode(e){let r=It(C$(e));if(!r)return[];if(r.type==="error")throw new kt(`anthropic stream error: ${R$(r.error)}`);if(r.type==="content_block_start"){let i=It(r.content_block);return i?.type==="tool_use"&&typeof i.id=="string"&&(this.tool={id:i.id,name:typeof i.name=="string"?i.name:"",json:""}),[]}if(r.type==="content_block_delta"){let i=It(r.delta);return i?.type==="text_delta"&&typeof i.text=="string"?[{type:"text",text:i.text}]:(i?.type==="input_json_delta"&&this.tool&&typeof i.partial_json=="string"&&(this.tool.json+=i.partial_json),[])}if(r.type==="content_block_stop"&&this.tool){let i=P$(this.tool.id,this.tool.name,this.tool.json);return this.tool=null,[i]}return[]}flush(){return[]}},zi=class extends wa{buildRequest(e){let r=e.messages.flatMap(QA),i=e.system!==void 0?[{role:"system",content:e.system},...r]:r,n={model:e.model,stream:!0,messages:i,...e.tools!==void 0&&e.tools.length>0&&{tools:e.tools.map(o=>({type:"function",function:{name:o.name,description:o.description,parameters:o.inputSchema}}))}};return{url:YA,init:{method:"POST",headers:{Authorization:`Bearer ${this.key}`,"content-type":"application/json"},body:JSON.stringify(n)}}}newTurnDecoder(){return new Up}};Up=class{calls=new Map;done=!1;isDone(e){return e!=="[DONE]"?!1:(this.done=!0,!0)}decode(e){let r=It(C$(e));if(!r)return[];if(r.error)throw new kt(`openai stream error: ${R$(r.error)}`);let i=O$(r.choices),n=It(It(i?.[0])?.delta);if(!n)return[];for(let s of O$(n.tool_calls)??[]){let a=It(s);if(!a)continue;let c=typeof a.index=="number"?a.index:0,u=this.calls.get(c)??{id:"",name:"",args:""};typeof a.id=="string"&&(u.id=a.id);let l=It(a.function);typeof l?.name=="string"&&(u.name=l.name),typeof l?.arguments=="string"&&(u.args+=l.arguments),this.calls.set(c,u)}let o=n.content;return typeof o=="string"&&o.length>0?[{type:"text",text:o}]:[]}flush(){if(!this.done)return this.calls.clear(),[];let e=[...this.calls.entries()].sort(([r],[i])=>r-i).map(([,r])=>P$(r.id,r.name,r.args));return this.calls.clear(),e}}});var Ui,Fp=g(()=>{"use strict";jp();Ui=class{fetchImpl;idleTimeoutMs;constructor(e=fetch,r=xa){this.fetchImpl=e,this.idleTimeoutMs=r}textAdapter(e,r){switch(e.provider){case"anthropic":return new Mi(r,this.fetchImpl,this.idleTimeoutMs);case"openai":return new zi(r,this.fetchImpl,this.idleTimeoutMs);default:throw new Error(`no text adapter for provider '${e.provider}'`)}}}});var Fe,D$=g(()=>{"use strict";Fe=class extends Error{commandId;reason;constructor(e,r,i){super(i??`send rejected (${r}) for command ${e}`),this.commandId=e,this.reason=r,this.name="SessionSendError"}}});var N$=g(()=>{"use strict"});var ji=g(()=>{"use strict";D$();N$()});function rO(t){return t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}function Sa(t,e,r){r.type==="tool.start"?t({type:"tool.start",turnId:e,toolId:r.toolId,name:r.tool,summary:r.summary??`${r.tool} (invalid input - not run)`}):t({type:"tool.result",turnId:e,toolId:r.toolId,ok:r.ok,durationMs:r.durationMs,summary:`${r.ok?"ok":"failed"} in ${rO(r.durationMs)}`})}var Vp=g(()=>{"use strict"});var Tt,Fi=g(()=>{"use strict";Tt=class{nextId=1;timers=new Map;now(){return Date.now()}setTimer(e,r){let i=this.nextId++,n=setTimeout(()=>{this.timers.delete(i),r()},e);return this.timers.set(i,n),i}clearTimer(e){let r=this.timers.get(e);r!==void 0&&(clearTimeout(r),this.timers.delete(e))}}});function Xe(t,e){let r=Math.floor(t.byteLength/2);if(r===0)return!1;let i=new DataView(t.buffer,t.byteOffset,t.byteLength),n=0;for(let o=0;o<r;o++){let s=i.getInt16(o*2,!0)/32768;n+=s*s}return Math.sqrt(n/r)>=e}function nO(t){let e=t.byteLength>>1,r=new DataView(t.buffer,t.byteOffset,t.byteLength),i=new Int16Array(e);for(let n=0;n<e;n++)i[n]=r.getInt16(n*2,!0);return i}var er,Vi,Zi,Er=g(()=>{"use strict";he();er=.02;Vi=class{threshold;constructor(e){this.threshold=e}classify(e,r){r(Xe(e,this.threshold))}},Zi=class{vad;speechThreshold;energyThreshold;log;degraded=!1;announced=!1;disposed=!1;constructor(e,r={}){this.vad=e,this.speechThreshold=r.speechThreshold??.5,this.energyThreshold=r.energyThreshold??er,this.log=r.log??j}classify(e,r){if(this.degraded){this.announce("energy (fallback)"),r(Xe(e,this.energyThreshold));return}this.vad.process(nO(e)).then(i=>{if(!this.disposed){this.announce("silero");for(let n of i)r(n>=this.speechThreshold)}},i=>{this.disposed||(this.degrade(i),this.announce("energy (fallback)"),r(Xe(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 Zp(t){return new Error(`openai-compat ASR decode failed (HTTP ${t})`)}function Bp(t){t.body?.cancel().catch(()=>{})}function oO(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function uO(t){return t.replace(cO," ")}function lO(t){let e;try{e=new URL(t)}catch{throw new Error("openai-compat ASR route url must be a valid http:// or https:// URL")}if(e.protocol!=="http:"&&e.protocol!=="https:")throw new Error(`openai-compat ASR route url must use the http:// or https:// scheme (got '${e.protocol}//' - this is an HTTP endpoint, not a WebSocket)`);if(e.username!==""||e.password!=="")throw new Error("openai-compat ASR route url must not embed credentials (user:pass@) - configure the key in secrets instead");return t.replace(/\/+$/,"")}function dO(t,e){let r=new Uint8Array(e),i=0;for(let n of t)r.set(n,i),i+=n.byteLength;return r}function hO(t,e){let r=new Uint8Array(44+t.byteLength),i=new DataView(r.buffer);return Ea(r,0,"RIFF"),i.setUint32(4,36+t.byteLength,!0),Ea(r,8,"WAVE"),Ea(r,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,e,!0),i.setUint32(28,e*2,!0),i.setUint16(32,2,!0),i.setUint16(34,16,!0),Ea(r,36,"data"),i.setUint32(40,t.byteLength,!0),r.set(t,44),r}function Ea(t,e,r){for(let i=0;i<r.length;i+=1)t[e+i]=r.charCodeAt(i)}function z$(t,e=0){if(!(t instanceof Error)||e>3)return"network error";if(t instanceof AggregateError&&t.message.length===0){let r=t.errors.find(i=>i instanceof Error&&i.message.length>0);if(r)return r.message}return t.cause instanceof Error&&(t.message.length===0||t.message==="fetch failed")?z$(t.cause,e+1):t.message.length>0?t.message:t.name.length>0?t.name:"network error"}var Wp,Hp,L$,iO,ka,Gp,M$,sO,aO,cO,qp=g(()=>{"use strict";he();Qt();Fi();Er();Wp="http://localhost:8081",Hp="large-v3-turbo",L$=1e3,iO=1e4,ka=class{fetchImpl;model;clock;id="openai-compat";partialStability="redecode";baseUrl;key;negotiation={dialect:null};constructor(e,r=Wp,i=Hp,n,o=new Tt){this.fetchImpl=e,this.model=i,this.clock=o,this.baseUrl=lO(r),this.key=n!==void 0&&n.length>0?n:void 0,this.key!==void 0&&$a(this.key,"openai-compat ASR key")}open(e){return e.biasTerms!==void 0&&e.biasTerms.length>0&&j.debug("openai-compat ASR: biasTerms are deliberately not mapped on this engine (the whisper initial-prompt hook measured mildly negative in the 0033 E1 bake-off) - proceeding unbiased",{count:e.biasTerms.length}),new Gp({fetchImpl:this.fetchImpl,baseUrl:this.baseUrl,model:this.model,key:this.key,negotiation:this.negotiation,clock:this.clock},e)}},Gp=class{ctx;opts;aborted=!1;closed=!1;endRequested=!1;buffered=[];bufferedBytes=0;inFlightDecode=null;inFlightAbort=null;speechSinceLastDecode=!1;lastDecodeAtMs=-1/0;lastEmittedPartial=null;transcriptCb;errorCb;endPending=null;constructor(e,r){this.ctx=e,this.opts=r}pushAudio(e){this.aborted||this.closed||this.endRequested||(this.buffered.push(e.slice()),this.bufferedBytes+=e.byteLength,!this.speechSinceLastDecode&&Xe(e,er)&&(this.speechSinceLastDecode=!0),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,r)=>{this.endPending={resolve:e,reject:r},this.endRequested=!0,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()}maybeRedecodeTick(){if(this.inFlightDecode!==null||!this.speechSinceLastDecode||this.bufferedBytes<this.opts.sampleRate*2*(L$/1e3))return;let e=this.ctx.clock.now();e-this.lastDecodeAtMs<L$||(this.lastDecodeAtMs=e,this.speechSinceLastDecode=!1,this.inFlightDecode=this.decodeFullBuffer().then(r=>{this.aborted||this.closed||this.endRequested||r!==this.lastEmittedPartial&&(this.lastEmittedPartial=r,this.transcriptCb?.({text:r,isFinal:!1,startMs:0}))}).catch(r=>{j.debug("openai-compat ASR re-decode tick failed - missed partial",{message:r instanceof Error?r.message:String(r)})}).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(r){if(this.aborted||this.closed)return;this.failStream(r instanceof Error?r:new Error(String(r)));return}this.aborted||this.closed||this.resolveEnd(e)}resolveEnd(e){if(!this.endPending)return;let r={text:e.trim(),isFinal:!0,startMs:0};this.transcriptCb?.(r);let{resolve:i}=this.endPending;this.endPending=null,this.teardown(),i(r)}failStream(e){if(this.endPending){let{reject:r}=this.endPending;this.endPending=null,r(e)}this.errorCb?.(e),this.teardown()}async decodeFullBuffer(){let e=hO(dO(this.buffered,this.bufferedBytes),this.opts.sampleRate),r=new AbortController,i={timedOut:!1};this.inFlightAbort=r;let n=this.ctx.clock.setTimer(this.decodeReplyTimeoutMs(),()=>{i.timedOut=!0,r.abort()});try{let o=await this.postWithNegotiation(e,r.signal),s;try{s=await o.json()}catch{throw new Error("openai-compat ASR decode returned invalid JSON")}let a=oO(s)&&typeof s.text=="string"?s.text:"";return uO(a)}catch(o){throw i.timedOut?new Error("openai-compat ASR decode timed out",{cause:o}):o instanceof Error?o:new Error(String(o))}finally{this.ctx.clock.clearTimer(n),this.inFlightAbort===r&&(this.inFlightAbort=null)}}async postWithNegotiation(e,r){let i=this.ctx.negotiation.dialect;if(i!==null){let s=await this.post(i,e,r);if(!s.ok)throw Bp(s),Zp(s.status);return s}let n=await this.post("standard",e,r);if(n.ok)return this.ctx.negotiation.dialect="standard",n;if(Bp(n),n.status!==404)throw Zp(n.status);let o=await this.post("inference",e,r);if(o.ok)return this.ctx.negotiation.dialect="inference",o;throw Bp(o),Zp(o.status)}async post(e,r,i){let n=e==="standard"?`${this.ctx.baseUrl}/v1/audio/transcriptions`:`${this.ctx.baseUrl}/inference`,o=new FormData;o.append("file",new Blob([r],{type:"audio/wav"}),"utterance.wav"),e==="standard"&&o.append("model",this.ctx.model),this.opts.language!==void 0&&o.append("language",this.opts.language),o.append("temperature","0"),o.append("response_format","json");try{return await this.ctx.fetchImpl(n,{method:"POST",body:o,...this.ctx.key!==void 0&&{headers:{Authorization:`Bearer ${this.ctx.key}`}},signal:i})}catch(s){throw i.aborted?new Error("openai-compat ASR request aborted",{cause:s}):new Error(`openai-compat ASR request failed: ${z$(s)}`,{cause:s})}}decodeReplyTimeoutMs(){let e=this.bufferedBytes/2/this.opts.sampleRate*1e3;return iO+Math.ceil(e)}teardown(){this.closed||(this.closed=!0,this.inFlightAbort?.abort(),this.inFlightAbort=null)}};M$=" ",sO="\r",aO=`
|
|
71
|
+
`,cO=new RegExp(`[ ${M$}]*[${sO}${aO}]+[ ${M$}]*`,"g")});function kn(t){try{let e=JSON.parse(t);return typeof e=="object"&&e!==null?e:void 0}catch{return}}function Bi(t){return typeof t=="string"?t:""}function Ia(t){let e=t.message_type;return typeof e=="string"&&(fO.has(e)||e.endsWith("_error"))?e:typeof t.error=="string"&&t.error.length>0?"error":null}function U$(t){return Buffer.from(t).toString("base64")}function j$(t){return new Uint8Array(Buffer.from(t,"base64"))}function In(t,e){return new Error(`${t} connection error: ${e.message}`)}var fO,Ta=g(()=>{"use strict";fO=new Set(["error","auth_error","quota_exceeded","rate_limited"])});function Z$(t,e){let r=new Uint8Array(e),i=0;for(let n of t)r.set(n,i),i+=n.byteLength;return r}function mO(t){if(t.message.length>0)return t.message;if(t instanceof AggregateError){let e=t.errors.find(r=>r instanceof Error&&r.message.length>0);if(e)return e.message}return t.name.length>0?t.name:"connection failed"}function gO(t){let e=Math.floor(t.byteLength/2),r=new DataView(t.buffer,t.byteOffset,e*2),i=new Float32Array(e);for(let n=0;n<e;n+=1)i[n]=r.getInt16(n*2,!0)/32768;return i}var Aa,F$,V$,pO,Gi,Jp,Oa=g(()=>{"use strict";he();Fi();Er();Ta();Aa="ws://localhost:6007",F$=1e3,V$=10240,pO=1e4,Gi=class{socketFactory;url;clock;id="sherpa-onnx";partialStability="redecode";constructor(e,r=Aa,i=new Tt){this.socketFactory=e,this.url=r,this.clock=i}open(e){return e.biasTerms!==void 0&&e.biasTerms.length>0&&j.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 Jp(this.socketFactory,this.url,this.clock,e)}},Jp=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,r,i,n){this.clock=i,this.opts=n,this.socket=e(r,{}),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&&Xe(e,er)&&(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,r)=>{this.endPending={resolve:e,reject:r},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 r=kn(e);if(r){if(this.staleReplies>0){this.staleReplies-=1;return}if(this.pendingReply){let{resolve:i,timer:n}=this.pendingReply;this.pendingReply=null,this.clock.clearTimer(n),i(Bi(r.text))}}}handleError(e){if(this.closed)return;let r=In("sherpa ASR",new Error(mO(e)));this.failStream(r)}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:r}=this.endPending;this.endPending=null,r(e)}this.rejectPendingReply(e),this.errorCb?.(e)}rejectPendingReply(e){if(!this.pendingReply)return;let{reject:r,timer:i}=this.pendingReply;this.pendingReply=null,this.clock.clearTimer(i),r(e)}maybeRedecodeTick(){if(this.inFlightDecode!==null||!this.speechSinceLastDecode||this.bufferedBytes<this.opts.sampleRate*2*(F$/1e3))return;let e=this.clock.now();e-this.lastDecodeAtMs<F$||(this.lastDecodeAtMs=e,this.speechSinceLastDecode=!1,this.inFlightDecode=this.decodeFullBuffer().then(r=>{this.aborted||this.closed||this.endRequested||r!==this.lastEmittedPartial&&(this.lastEmittedPartial=r,this.transcriptCb?.({text:r,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(r){if(this.aborted||this.closed)return;this.failStream(r instanceof Error?r:new Error(String(r)));return}this.aborted||this.closed||this.resolveEnd(e)}resolveEnd(e){if(!this.endPending)return;let r={text:e.trim(),isFinal:!0,startMs:0};this.transcriptCb?.(r);let{resolve:i}=this.endPending;this.endPending=null,this.socket.send("Done"),this.teardown(),i(r)}decodeFullBuffer(){let e=gO(Z$(this.buffered,this.bufferedBytes)),r=new Uint8Array(e.buffer,0,e.byteLength),i=new Uint8Array(8),n=new DataView(i.buffer);n.setUint32(0,this.opts.sampleRate,!0),n.setUint32(4,r.byteLength,!0);let o=Z$([i,r],i.byteLength+r.byteLength),s=new Promise((a,c)=>{let u=this.clock.setTimer(this.decodeReplyTimeoutMs(),()=>{this.pendingReply&&(this.pendingReply=null,this.staleReplies+=1,c(new Error("sherpa ASR decode timed out")))});this.pendingReply={resolve:a,reject:c,timer:u}});try{for(let a=0;a<o.byteLength;a+=V$)this.socket.send(o.subarray(a,Math.min(a+V$,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 pO+Math.ceil(e)}teardown(){this.closed||(this.closed=!0,this.rejectPendingReply(new Error("sherpa ASR stream closed")),this.socket.close())}}});var At=D((hj,W$)=>{"use strict";var B$=["nodebuffer","arraybuffer","fragments"],G$=typeof Blob<"u";G$&&B$.push("blob");W$.exports={BINARY_TYPES:B$,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:G$,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Wi=D((fj,Pa)=>{"use strict";var{EMPTY_BUFFER:vO}=At(),Kp=Buffer[Symbol.species];function yO(t,e){if(t.length===0)return vO;if(t.length===1)return t[0];let r=Buffer.allocUnsafe(e),i=0;for(let n=0;n<t.length;n++){let o=t[n];r.set(o,i),i+=o.length}return i<e?new Kp(r.buffer,r.byteOffset,i):r}function H$(t,e,r,i,n){for(let o=0;o<n;o++)r[i+o]=t[o]^e[o&3]}function q$(t,e){for(let r=0;r<t.length;r++)t[r]^=e[r&3]}function _O(t){return t.length===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.length)}function Yp(t){if(Yp.readOnly=!0,Buffer.isBuffer(t))return t;let e;return t instanceof ArrayBuffer?e=new Kp(t):ArrayBuffer.isView(t)?e=new Kp(t.buffer,t.byteOffset,t.byteLength):(e=Buffer.from(t),Yp.readOnly=!1),e}Pa.exports={concat:yO,mask:H$,toArrayBuffer:_O,toBuffer:Yp,unmask:q$};if(!process.env.WS_NO_BUFFER_UTIL)try{let t=ue("bufferutil");Pa.exports.mask=function(e,r,i,n,o){o<48?H$(e,r,i,n,o):t.mask(e,r,i,n,o)},Pa.exports.unmask=function(e,r){e.length<32?q$(e,r):t.unmask(e,r)}}catch{}});var Y$=D((pj,K$)=>{"use strict";var J$=Symbol("kDone"),Xp=Symbol("kRun"),Qp=class{constructor(e){this[J$]=()=>{this.pending--,this[Xp]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Xp]()}[Xp](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[J$])}}};K$.exports=Qp});var On=D((mj,tw)=>{"use strict";var Hi=ue("zlib"),X$=Wi(),bO=Y$(),{kStatusCode:Q$}=At(),$O=Buffer[Symbol.species],wO=Buffer.from([0,0,255,255]),Ra=Symbol("permessage-deflate"),Ot=Symbol("total-length"),Tn=Symbol("callback"),tr=Symbol("buffers"),An=Symbol("error"),Ca,em=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,!Ca){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Ca=new bO(r)}}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[Tn];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let r=this._options,i=e.find(n=>!(r.serverNoContextTakeover===!1&&n.server_no_context_takeover||n.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>n.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!n.client_max_window_bits));if(!i)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(i.server_no_context_takeover=!0),r.clientNoContextTakeover&&(i.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(i.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?i.client_max_window_bits=r.clientMaxWindowBits:(i.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete i.client_max_window_bits,i}acceptAsClient(e){let r=e[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(e){return e.forEach(r=>{Object.keys(r).forEach(i=>{let n=r[i];if(n.length>1)throw new Error(`Parameter "${i}" must have only a single value`);if(n=n[0],i==="client_max_window_bits"){if(n!==!0){let o=+n;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${i}": ${n}`);n=o}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${i}": ${n}`)}else if(i==="server_max_window_bits"){let o=+n;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${i}": ${n}`);n=o}else if(i==="client_no_context_takeover"||i==="server_no_context_takeover"){if(n!==!0)throw new TypeError(`Invalid value for parameter "${i}": ${n}`)}else throw new Error(`Unknown parameter "${i}"`);r[i]=n})}),e}decompress(e,r,i){Ca.add(n=>{this._decompress(e,r,(o,s)=>{n(),i(o,s)})})}compress(e,r,i){Ca.add(n=>{this._compress(e,r,(o,s)=>{n(),i(o,s)})})}_decompress(e,r,i){let n=this._isServer?"client":"server";if(!this._inflate){let o=`${n}_max_window_bits`,s=typeof this.params[o]!="number"?Hi.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=Hi.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[Ra]=this,this._inflate[Ot]=0,this._inflate[tr]=[],this._inflate.on("error",SO),this._inflate.on("data",ew)}this._inflate[Tn]=i,this._inflate.write(e),r&&this._inflate.write(wO),this._inflate.flush(()=>{let o=this._inflate[An];if(o){this._inflate.close(),this._inflate=null,i(o);return}let s=X$.concat(this._inflate[tr],this._inflate[Ot]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Ot]=0,this._inflate[tr]=[],r&&this.params[`${n}_no_context_takeover`]&&this._inflate.reset()),i(null,s)})}_compress(e,r,i){let n=this._isServer?"server":"client";if(!this._deflate){let o=`${n}_max_window_bits`,s=typeof this.params[o]!="number"?Hi.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=Hi.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[Ot]=0,this._deflate[tr]=[],this._deflate.on("data",xO)}this._deflate[Tn]=i,this._deflate.write(e),this._deflate.flush(Hi.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=X$.concat(this._deflate[tr],this._deflate[Ot]);r&&(o=new $O(o.buffer,o.byteOffset,o.length-4)),this._deflate[Tn]=null,this._deflate[Ot]=0,this._deflate[tr]=[],r&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),i(null,o)})}};tw.exports=em;function xO(t){this[tr].push(t),this[Ot]+=t.length}function ew(t){if(this[Ot]+=t.length,this[Ra]._maxPayload<1||this[Ot]<=this[Ra]._maxPayload){this[tr].push(t);return}this[An]=new RangeError("Max payload size exceeded"),this[An].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[An][Q$]=1009,this.removeListener("data",ew),this.reset()}function SO(t){if(this[Ra]._inflate=null,this[An]){this[Tn](this[An]);return}t[Q$]=1007,this[Tn](t)}});var Pn=D((gj,Da)=>{"use strict";var{isUtf8:rw}=ue("buffer"),{hasBlob:EO}=At(),kO=[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 IO(t){return t>=1e3&&t<=1014&&t!==1004&&t!==1005&&t!==1006||t>=3e3&&t<=4999}function tm(t){let e=t.length,r=0;for(;r<e;)if((t[r]&128)===0)r++;else if((t[r]&224)===192){if(r+1===e||(t[r+1]&192)!==128||(t[r]&254)===192)return!1;r+=2}else if((t[r]&240)===224){if(r+2>=e||(t[r+1]&192)!==128||(t[r+2]&192)!==128||t[r]===224&&(t[r+1]&224)===128||t[r]===237&&(t[r+1]&224)===160)return!1;r+=3}else if((t[r]&248)===240){if(r+3>=e||(t[r+1]&192)!==128||(t[r+2]&192)!==128||(t[r+3]&192)!==128||t[r]===240&&(t[r+1]&240)===128||t[r]===244&&t[r+1]>143||t[r]>244)return!1;r+=4}else return!1;return!0}function TO(t){return EO&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&(t[Symbol.toStringTag]==="Blob"||t[Symbol.toStringTag]==="File")}Da.exports={isBlob:TO,isValidStatusCode:IO,isValidUTF8:tm,tokenChars:kO};if(rw)Da.exports.isValidUTF8=function(t){return t.length<24?tm(t):rw(t)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let t=ue("utf-8-validate");Da.exports.isValidUTF8=function(e){return e.length<32?tm(e):t(e)}}catch{}});var sm=D((vj,uw)=>{"use strict";var{Writable:AO}=ue("stream"),nw=On(),{BINARY_TYPES:OO,EMPTY_BUFFER:iw,kStatusCode:PO,kWebSocket:CO}=At(),{concat:rm,toArrayBuffer:RO,unmask:DO}=Wi(),{isValidStatusCode:NO,isValidUTF8:ow}=Pn(),Na=Buffer[Symbol.species],Qe=0,sw=1,aw=2,cw=3,nm=4,im=5,La=6,om=class extends AO{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||OO[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[CO]=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,r,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 Na(i.buffer,i.byteOffset+e,i.length-e),new Na(i.buffer,i.byteOffset,e)}let r=Buffer.allocUnsafe(e);do{let i=this._buffers[0],n=r.length-e;e>=i.length?r.set(this._buffers.shift(),n):(r.set(new Uint8Array(i.buffer,i.byteOffset,e),n),this._buffers[0]=new Na(i.buffer,i.byteOffset+e,i.length-e)),e-=i.length}while(e>0);return r}startLoop(e){this._loop=!0;do switch(this._state){case Qe:this.getInfo(e);break;case sw:this.getPayloadLength16(e);break;case aw:this.getPayloadLength64(e);break;case cw:this.getMask();break;case nm:this.getData(e);break;case im:case La:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let n=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(n);return}let i=(r[0]&64)===64;if(i&&!this._extensions[nw.extensionName]){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(i){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(!this._fragmented){let n=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}this._compressed=i}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let n=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(n);return}if(i){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let n=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(n);return}}else{let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let n=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(n);return}}else if(this._masked){let n=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(n);return}this._payloadLength===126?this._state=sw:this._payloadLength===127?this._state=aw: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 r=this.consume(8),i=r.readUInt32BE(0);if(i>Math.pow(2,21)-1){let n=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(n);return}this._payloadLength=i*Math.pow(2,32)+r.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 r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(r);return}this._masked?this._state=cw:this._state=nm}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=nm}getData(e){let r=iw;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&DO(r,this._mask)}if(this._opcode>7){this.controlMessage(r,e);return}if(this._compressed){this._state=im,this.decompress(r,e);return}if(r.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(r)}this.dataMessage(e)}decompress(e,r){this._extensions[nw.extensionName].decompress(e,this._fin,(n,o)=>{if(n)return r(n);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");r(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");r(s);return}this._fragments.push(o)}this.dataMessage(r),this._state===Qe&&this.startLoop(r)})}dataMessage(e){if(!this._fin){this._state=Qe;return}let r=this._messageLength,i=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=rm(i,r):this._binaryType==="arraybuffer"?n=RO(rm(i,r)):this._binaryType==="blob"?n=new Blob(i):n=i,this._allowSynchronousEvents?(this.emit("message",n,!0),this._state=Qe):(this._state=La,setImmediate(()=>{this.emit("message",n,!0),this._state=Qe,this.startLoop(e)}))}else{let n=rm(i,r);if(!this._skipUTF8Validation&&!ow(n)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(o);return}this._state===im||this._allowSynchronousEvents?(this.emit("message",n,!1),this._state=Qe):(this._state=La,setImmediate(()=>{this.emit("message",n,!1),this._state=Qe,this.startLoop(e)}))}}controlMessage(e,r){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,iw),this.end();else{let i=e.readUInt16BE(0);if(!NO(i)){let o=this.createError(RangeError,`invalid status code ${i}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(o);return}let n=new Na(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!ow(n)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(o);return}this._loop=!1,this.emit("conclude",i,n),this.end()}this._state=Qe;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=Qe):(this._state=La,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=Qe,this.startLoop(r)}))}createError(e,r,i,n,o){this._loop=!1,this._errored=!0;let s=new e(i?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(s,this.createError),s.code=o,s[PO]=n,s}};uw.exports=om});var um=D((_j,hw)=>{"use strict";var{Duplex:yj}=ue("stream"),{randomFillSync:LO}=ue("crypto"),{types:{isUint8Array:MO}}=ue("util"),lw=On(),{EMPTY_BUFFER:zO,kWebSocket:UO,NOOP:jO}=At(),{isBlob:Cn,isValidStatusCode:FO}=Pn(),{mask:dw,toBuffer:kr}=Wi(),et=Symbol("kByteLength"),VO=Buffer.alloc(4),Ma=8*1024,Ir,Rn=Ma,ut=0,ZO=1,BO=2,am=class t{constructor(e,r,i){this._extensions=r||{},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=ut,this.onerror=jO,this[UO]=void 0}static frame(e,r){let i,n=!1,o=2,s=!1;r.mask&&(i=r.maskBuffer||VO,r.generateMask?r.generateMask(i):(Rn===Ma&&(Ir===void 0&&(Ir=Buffer.alloc(Ma)),LO(Ir,0,Ma),Rn=0),i[0]=Ir[Rn++],i[1]=Ir[Rn++],i[2]=Ir[Rn++],i[3]=Ir[Rn++]),s=(i[0]|i[1]|i[2]|i[3])===0,o=6);let a;typeof e=="string"?(!r.mask||s)&&r[et]!==void 0?a=r[et]:(e=Buffer.from(e),a=e.length):(a=e.length,n=r.mask&&r.readOnly&&!s);let c=a;a>=65536?(o+=8,c=127):a>125&&(o+=2,c=126);let u=Buffer.allocUnsafe(n?a+o:o);return u[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(u[0]|=64),u[1]=c,c===126?u.writeUInt16BE(a,2):c===127&&(u[2]=u[3]=0,u.writeUIntBE(a,4,6)),r.mask?(u[1]|=128,u[o-4]=i[0],u[o-3]=i[1],u[o-2]=i[2],u[o-1]=i[3],s?[u,e]:n?(dw(e,i,u,o,a),[u]):(dw(e,i,e,0,a),[u,e])):[u,e]}close(e,r,i,n){let o;if(e===void 0)o=zO;else{if(typeof e!="number"||!FO(e))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)o=Buffer.allocUnsafe(2),o.writeUInt16BE(e,0);else{let a=Buffer.byteLength(r);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 r=="string")o.write(r,2);else if(MO(r))o.set(r,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!==ut?this.enqueue([this.dispatch,o,!1,s,n]):this.sendFrame(t.frame(o,s),n)}ping(e,r,i){let n,o;if(typeof e=="string"?(n=Buffer.byteLength(e),o=!1):Cn(e)?(n=e.size,o=!1):(e=kr(e),n=e.length,o=kr.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[et]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};Cn(e)?this._state!==ut?this.enqueue([this.getBlobData,e,!1,s,i]):this.getBlobData(e,!1,s,i):this._state!==ut?this.enqueue([this.dispatch,e,!1,s,i]):this.sendFrame(t.frame(e,s),i)}pong(e,r,i){let n,o;if(typeof e=="string"?(n=Buffer.byteLength(e),o=!1):Cn(e)?(n=e.size,o=!1):(e=kr(e),n=e.length,o=kr.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[et]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};Cn(e)?this._state!==ut?this.enqueue([this.getBlobData,e,!1,s,i]):this.getBlobData(e,!1,s,i):this._state!==ut?this.enqueue([this.dispatch,e,!1,s,i]):this.sendFrame(t.frame(e,s),i)}send(e,r,i){let n=this._extensions[lw.extensionName],o=r.binary?2:1,s=r.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):Cn(e)?(a=e.size,c=!1):(e=kr(e),a=e.length,c=kr.readOnly),this._firstFragment?(this._firstFragment=!1,s&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(s=a>=n._threshold),this._compress=s):(s=!1,o=0),r.fin&&(this._firstFragment=!0);let u={[et]:a,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:c,rsv1:s};Cn(e)?this._state!==ut?this.enqueue([this.getBlobData,e,this._compress,u,i]):this.getBlobData(e,this._compress,u,i):this._state!==ut?this.enqueue([this.dispatch,e,this._compress,u,i]):this.dispatch(e,this._compress,u,i)}getBlobData(e,r,i,n){this._bufferedBytes+=i[et],this._state=BO,e.arrayBuffer().then(o=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(cm,this,a,n);return}this._bufferedBytes-=i[et];let s=kr(o);r?this.dispatch(s,r,i,n):(this._state=ut,this.sendFrame(t.frame(s,i),n),this.dequeue())}).catch(o=>{process.nextTick(GO,this,o,n)})}dispatch(e,r,i,n){if(!r){this.sendFrame(t.frame(e,i),n);return}let o=this._extensions[lw.extensionName];this._bufferedBytes+=i[et],this._state=ZO,o.compress(e,i.fin,(s,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");cm(this,c,n);return}this._bufferedBytes-=i[et],this._state=ut,i.readOnly=!1,this.sendFrame(t.frame(a,i),n),this.dequeue()})}dequeue(){for(;this._state===ut&&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,r){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],r),this._socket.uncork()):this._socket.write(e[0],r)}};hw.exports=am;function cm(t,e,r){typeof r=="function"&&r(e);for(let i=0;i<t._queue.length;i++){let n=t._queue[i],o=n[n.length-1];typeof o=="function"&&o(e)}}function GO(t,e,r){cm(t,e,r),t.onerror(e)}});var $w=D((bj,bw)=>{"use strict";var{kForOnEventAttribute:qi,kListener:lm}=At(),fw=Symbol("kCode"),pw=Symbol("kData"),mw=Symbol("kError"),gw=Symbol("kMessage"),vw=Symbol("kReason"),Dn=Symbol("kTarget"),yw=Symbol("kType"),_w=Symbol("kWasClean"),Pt=class{constructor(e){this[Dn]=null,this[yw]=e}get target(){return this[Dn]}get type(){return this[yw]}};Object.defineProperty(Pt.prototype,"target",{enumerable:!0});Object.defineProperty(Pt.prototype,"type",{enumerable:!0});var Tr=class extends Pt{constructor(e,r={}){super(e),this[fw]=r.code===void 0?0:r.code,this[vw]=r.reason===void 0?"":r.reason,this[_w]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[fw]}get reason(){return this[vw]}get wasClean(){return this[_w]}};Object.defineProperty(Tr.prototype,"code",{enumerable:!0});Object.defineProperty(Tr.prototype,"reason",{enumerable:!0});Object.defineProperty(Tr.prototype,"wasClean",{enumerable:!0});var Nn=class extends Pt{constructor(e,r={}){super(e),this[mw]=r.error===void 0?null:r.error,this[gw]=r.message===void 0?"":r.message}get error(){return this[mw]}get message(){return this[gw]}};Object.defineProperty(Nn.prototype,"error",{enumerable:!0});Object.defineProperty(Nn.prototype,"message",{enumerable:!0});var Ji=class extends Pt{constructor(e,r={}){super(e),this[pw]=r.data===void 0?null:r.data}get data(){return this[pw]}};Object.defineProperty(Ji.prototype,"data",{enumerable:!0});var WO={addEventListener(t,e,r={}){for(let n of this.listeners(t))if(!r[qi]&&n[lm]===e&&!n[qi])return;let i;if(t==="message")i=function(o,s){let a=new Ji("message",{data:s?o:o.toString()});a[Dn]=this,za(e,this,a)};else if(t==="close")i=function(o,s){let a=new Tr("close",{code:o,reason:s.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[Dn]=this,za(e,this,a)};else if(t==="error")i=function(o){let s=new Nn("error",{error:o,message:o.message});s[Dn]=this,za(e,this,s)};else if(t==="open")i=function(){let o=new Pt("open");o[Dn]=this,za(e,this,o)};else return;i[qi]=!!r[qi],i[lm]=e,r.once?this.once(t,i):this.on(t,i)},removeEventListener(t,e){for(let r of this.listeners(t))if(r[lm]===e&&!r[qi]){this.removeListener(t,r);break}}};bw.exports={CloseEvent:Tr,ErrorEvent:Nn,Event:Pt,EventTarget:WO,MessageEvent:Ji};function za(t,e,r){typeof t=="object"&&t.handleEvent?t.handleEvent.call(t,r):t.call(e,r)}});var Ua=D(($j,ww)=>{"use strict";var{tokenChars:Ki}=Pn();function gt(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}function HO(t){let e=Object.create(null),r=Object.create(null),i=!1,n=!1,o=!1,s,a,c=-1,u=-1,l=-1,d=0;for(;d<t.length;d++)if(u=t.charCodeAt(d),s===void 0)if(l===-1&&Ki[u]===1)c===-1&&(c=d);else if(d!==0&&(u===32||u===9))l===-1&&c!==-1&&(l=d);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d);let f=t.slice(c,l);u===44?(gt(e,f,r),r=Object.create(null)):s=f,c=l=-1}else throw new SyntaxError(`Unexpected character at index ${d}`);else if(a===void 0)if(l===-1&&Ki[u]===1)c===-1&&(c=d);else if(u===32||u===9)l===-1&&c!==-1&&(l=d);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d),gt(r,t.slice(c,l),!0),u===44&&(gt(e,s,r),r=Object.create(null),s=void 0),c=l=-1}else if(u===61&&c!==-1&&l===-1)a=t.slice(c,d),c=l=-1;else throw new SyntaxError(`Unexpected character at index ${d}`);else if(n){if(Ki[u]!==1)throw new SyntaxError(`Unexpected character at index ${d}`);c===-1?c=d:i||(i=!0),n=!1}else if(o)if(Ki[u]===1)c===-1&&(c=d);else if(u===34&&c!==-1)o=!1,l=d;else if(u===92)n=!0;else throw new SyntaxError(`Unexpected character at index ${d}`);else if(u===34&&t.charCodeAt(d-1)===61)o=!0;else if(l===-1&&Ki[u]===1)c===-1&&(c=d);else if(c!==-1&&(u===32||u===9))l===-1&&(l=d);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d);let f=t.slice(c,l);i&&(f=f.replace(/\\/g,""),i=!1),gt(r,a,f),u===44&&(gt(e,s,r),r=Object.create(null),s=void 0),a=void 0,c=l=-1}else throw new SyntaxError(`Unexpected character at index ${d}`);if(c===-1||o||u===32||u===9)throw new SyntaxError("Unexpected end of input");l===-1&&(l=d);let h=t.slice(c,l);return s===void 0?gt(e,h,r):(a===void 0?gt(r,h,!0):i?gt(r,a,h.replace(/\\/g,"")):gt(r,a,h),gt(e,s,r)),e}function qO(t){return Object.keys(t).map(e=>{let r=t[e];return Array.isArray(r)||(r=[r]),r.map(i=>[e].concat(Object.keys(i).map(n=>{let o=i[n];return Array.isArray(o)||(o=[o]),o.map(s=>s===!0?n:`${n}=${s}`).join("; ")})).join("; ")).join(", ")}).join(", ")}ww.exports={format:qO,parse:HO}});var Za=D((Sj,Dw)=>{"use strict";var JO=ue("events"),KO=ue("https"),YO=ue("http"),Ew=ue("net"),XO=ue("tls"),{randomBytes:QO,createHash:eP}=ue("crypto"),{Duplex:wj,Readable:xj}=ue("stream"),{URL:dm}=ue("url"),rr=On(),tP=sm(),rP=um(),{isBlob:nP}=Pn(),{BINARY_TYPES:xw,CLOSE_TIMEOUT:iP,EMPTY_BUFFER:ja,GUID:oP,kForOnEventAttribute:hm,kListener:sP,kStatusCode:aP,kWebSocket:ye,NOOP:kw}=At(),{EventTarget:{addEventListener:cP,removeEventListener:uP}}=$w(),{format:lP,parse:dP}=Ua(),{toBuffer:hP}=Wi(),Iw=Symbol("kAborted"),fm=[8,13],Ct=["CONNECTING","OPEN","CLOSING","CLOSED"],fP=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,ne=class t extends JO{constructor(e,r,i){super(),this._binaryType=xw[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,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(i=r,r=[]):r=[r]),Tw(this,e,r,i)):(this._autoPong=i.autoPong,this._closeTimeout=i.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){xw.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,r,i){let n=new tP({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 rP(e,this._extensions,i.generateMask);this._receiver=n,this._sender=o,this._socket=e,n[ye]=this,o[ye]=this,e[ye]=this,n.on("conclude",gP),n.on("drain",vP),n.on("error",yP),n.on("message",_P),n.on("ping",bP),n.on("pong",$P),o.onerror=wP,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),r.length>0&&e.unshift(r),e.on("close",Pw),e.on("data",Va),e.on("end",Cw),e.on("error",Rw),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[rr.extensionName]&&this._extensions[rr.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,r){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,r,!this._isServer,i=>{i||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Ow(this)}}pause(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,r,i){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(i=e,e=r=void 0):typeof r=="function"&&(i=r,r=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){pm(this,e,i);return}r===void 0&&(r=!this._isServer),this._sender.ping(e||ja,r,i)}pong(e,r,i){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(i=e,e=r=void 0):typeof r=="function"&&(i=r,r=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){pm(this,e,i);return}r===void 0&&(r=!this._isServer),this._sender.pong(e||ja,r,i)}resume(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,r,i){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(i=r,r={}),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){pm(this,e,i);return}let n={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[rr.extensionName]||(n.compress=!1),this._sender.send(e||ja,n,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(ne,"CONNECTING",{enumerable:!0,value:Ct.indexOf("CONNECTING")});Object.defineProperty(ne.prototype,"CONNECTING",{enumerable:!0,value:Ct.indexOf("CONNECTING")});Object.defineProperty(ne,"OPEN",{enumerable:!0,value:Ct.indexOf("OPEN")});Object.defineProperty(ne.prototype,"OPEN",{enumerable:!0,value:Ct.indexOf("OPEN")});Object.defineProperty(ne,"CLOSING",{enumerable:!0,value:Ct.indexOf("CLOSING")});Object.defineProperty(ne.prototype,"CLOSING",{enumerable:!0,value:Ct.indexOf("CLOSING")});Object.defineProperty(ne,"CLOSED",{enumerable:!0,value:Ct.indexOf("CLOSED")});Object.defineProperty(ne.prototype,"CLOSED",{enumerable:!0,value:Ct.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(t=>{Object.defineProperty(ne.prototype,t,{enumerable:!0})});["open","error","close","message"].forEach(t=>{Object.defineProperty(ne.prototype,`on${t}`,{enumerable:!0,get(){for(let e of this.listeners(t))if(e[hm])return e[sP];return null},set(e){for(let r of this.listeners(t))if(r[hm]){this.removeListener(t,r);break}typeof e=="function"&&this.addEventListener(t,e,{[hm]:!0})}})});ne.prototype.addEventListener=cP;ne.prototype.removeEventListener=uP;Dw.exports=ne;function Tw(t,e,r,i){let n={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:iP,protocolVersion:fm[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=n.autoPong,t._closeTimeout=n.closeTimeout,!fm.includes(n.protocolVersion))throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${fm.join(", ")})`);let o;if(e instanceof dm)o=e;else try{o=new dm(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:",c;if(o.protocol!=="ws:"&&!s&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!o.pathname?c="The URL's pathname is empty":o.hash&&(c="The URL contains a fragment identifier"),c){let y=new SyntaxError(c);if(t._redirects===0)throw y;Fa(t,y);return}let u=s?443:80,l=QO(16).toString("base64"),d=s?KO.request:YO.request,h=new Set,f;if(n.createConnection=n.createConnection||(s?mP:pP),n.defaultPort=n.defaultPort||u,n.port=o.port||u,n.host=o.hostname.startsWith("[")?o.hostname.slice(1,-1):o.hostname,n.headers={...n.headers,"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":l,Connection:"Upgrade",Upgrade:"websocket"},n.path=o.pathname+o.search,n.timeout=n.handshakeTimeout,n.perMessageDeflate&&(f=new rr({...n.perMessageDeflate,isServer:!1,maxPayload:n.maxPayload}),n.headers["Sec-WebSocket-Extensions"]=lP({[rr.extensionName]:f.offer()})),r.length){for(let y of r){if(typeof y!="string"||!fP.test(y)||h.has(y))throw new SyntaxError("An invalid or duplicated subprotocol was specified");h.add(y)}n.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(n.origin&&(n.protocolVersion<13?n.headers["Sec-WebSocket-Origin"]=n.origin:n.headers.Origin=n.origin),(o.username||o.password)&&(n.auth=`${o.username}:${o.password}`),a){let y=n.path.split(":");n.socketPath=y[0],n.path=y[1]}let p;if(n.followRedirects){if(t._redirects===0){t._originalIpc=a,t._originalSecure=s,t._originalHostOrSocketPath=a?n.socketPath:o.host;let y=i&&i.headers;if(i={...i,headers:{}},y)for(let[b,k]of Object.entries(y))i.headers[b.toLowerCase()]=k}else if(t.listenerCount("redirect")===0){let y=a?t._originalIpc?n.socketPath===t._originalHostOrSocketPath:!1:t._originalIpc?!1:o.host===t._originalHostOrSocketPath;(!y||t._originalSecure&&!s)&&(delete n.headers.authorization,delete n.headers.cookie,y||delete n.headers.host,n.auth=void 0)}n.auth&&!i.headers.authorization&&(i.headers.authorization="Basic "+Buffer.from(n.auth).toString("base64")),p=t._req=d(n),t._redirects&&t.emit("redirect",t.url,p)}else p=t._req=d(n);n.timeout&&p.on("timeout",()=>{qe(t,p,"Opening handshake has timed out")}),p.on("error",y=>{p===null||p[Iw]||(p=t._req=null,Fa(t,y))}),p.on("response",y=>{let b=y.headers.location,k=y.statusCode;if(b&&n.followRedirects&&k>=300&&k<400){if(++t._redirects>n.maxRedirects){qe(t,p,"Maximum redirects exceeded");return}p.abort();let T;try{T=new dm(b,e)}catch{let $=new SyntaxError(`Invalid URL: ${b}`);Fa(t,$);return}Tw(t,T,r,i)}else t.emit("unexpected-response",p,y)||qe(t,p,`Unexpected server response: ${y.statusCode}`)}),p.on("upgrade",(y,b,k)=>{if(t.emit("upgrade",y),t.readyState!==ne.CONNECTING)return;p=t._req=null;let T=y.headers.upgrade;if(T===void 0||T.toLowerCase()!=="websocket"){qe(t,b,"Invalid Upgrade header");return}let A=eP("sha1").update(l+oP).digest("base64");if(y.headers["sec-websocket-accept"]!==A){qe(t,b,"Invalid Sec-WebSocket-Accept header");return}let $=y.headers["sec-websocket-protocol"],E;if($!==void 0?h.size?h.has($)||(E="Server sent an invalid subprotocol"):E="Server sent a subprotocol but none was requested":h.size&&(E="Server sent no subprotocol"),E){qe(t,b,E);return}$&&(t._protocol=$);let z=y.headers["sec-websocket-extensions"];if(z!==void 0){if(!f){qe(t,b,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let M;try{M=dP(z)}catch{qe(t,b,"Invalid Sec-WebSocket-Extensions header");return}let H=Object.keys(M);if(H.length!==1||H[0]!==rr.extensionName){qe(t,b,"Server indicated an extension that was not requested");return}try{f.accept(M[rr.extensionName])}catch{qe(t,b,"Invalid Sec-WebSocket-Extensions header");return}t._extensions[rr.extensionName]=f}t.setSocket(b,k,{allowSynchronousEvents:n.allowSynchronousEvents,generateMask:n.generateMask,maxBufferedChunks:n.maxBufferedChunks,maxFragments:n.maxFragments,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation})}),n.finishRequest?n.finishRequest(p,t):p.end()}function Fa(t,e){t._readyState=ne.CLOSING,t._errorEmitted=!0,t.emit("error",e),t.emitClose()}function pP(t){return t.path=t.socketPath,Ew.connect(t)}function mP(t){return t.path=void 0,!t.servername&&t.servername!==""&&(t.servername=Ew.isIP(t.host)?"":t.host),XO.connect(t)}function qe(t,e,r){t._readyState=ne.CLOSING;let i=new Error(r);Error.captureStackTrace(i,qe),e.setHeader?(e[Iw]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Fa,t,i)):(e.destroy(i),e.once("error",t.emit.bind(t,"error")),e.once("close",t.emitClose.bind(t)))}function pm(t,e,r){if(e){let i=nP(e)?e.size:hP(e).length;t._socket?t._sender._bufferedBytes+=i:t._bufferedAmount+=i}if(r){let i=new Error(`WebSocket is not open: readyState ${t.readyState} (${Ct[t.readyState]})`);process.nextTick(r,i)}}function gP(t,e){let r=this[ye];r._closeFrameReceived=!0,r._closeMessage=e,r._closeCode=t,r._socket[ye]!==void 0&&(r._socket.removeListener("data",Va),process.nextTick(Aw,r._socket),t===1005?r.close():r.close(t,e))}function vP(){let t=this[ye];t.isPaused||t._socket.resume()}function yP(t){let e=this[ye];e._socket[ye]!==void 0&&(e._socket.removeListener("data",Va),process.nextTick(Aw,e._socket),e.close(t[aP])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t))}function Sw(){this[ye].emitClose()}function _P(t,e){this[ye].emit("message",t,e)}function bP(t){let e=this[ye];e._autoPong&&e.pong(t,!this._isServer,kw),e.emit("ping",t)}function $P(t){this[ye].emit("pong",t)}function Aw(t){t.resume()}function wP(t){let e=this[ye];e.readyState!==ne.CLOSED&&(e.readyState===ne.OPEN&&(e._readyState=ne.CLOSING,Ow(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t)))}function Ow(t){t._closeTimer=setTimeout(t._socket.destroy.bind(t._socket),t._closeTimeout)}function Pw(){let t=this[ye];if(this.removeListener("close",Pw),this.removeListener("data",Va),this.removeListener("end",Cw),t._readyState=ne.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[ye]=void 0,clearTimeout(t._closeTimer),t._receiver._writableState.finished||t._receiver._writableState.errorEmitted?t.emitClose():(t._receiver.on("error",Sw),t._receiver.on("finish",Sw))}function Va(t){this[ye]._receiver.write(t)||this.pause()}function Cw(){let t=this[ye];t._readyState=ne.CLOSING,t._receiver.end(),this.end()}function Rw(){let t=this[ye];this.removeListener("error",Rw),this.on("error",kw),t&&(t._readyState=ne.CLOSING,this.destroy())}});var zw=D((kj,Mw)=>{"use strict";var Ej=Za(),{Duplex:xP}=ue("stream");function Nw(t){t.emit("close")}function SP(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Lw(t){this.removeListener("error",Lw),this.destroy(),this.listenerCount("error")===0&&this.emit("error",t)}function EP(t,e){let r=!0,i=new xP({...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||(r=!1,i.destroy(o))}),t.once("close",function(){i.destroyed||i.push(null)}),i._destroy=function(n,o){if(t.readyState===t.CLOSED){o(n),process.nextTick(Nw,i);return}let s=!1;t.once("error",function(c){s=!0,o(c)}),t.once("close",function(){s||o(n),process.nextTick(Nw,i)}),r&&t.terminate()},i._final=function(n){if(t.readyState===t.CONNECTING){t.once("open",function(){i._final(n)});return}t._socket!==null&&(t._socket._writableState.finished?(n(),i._readableState.endEmitted&&i.destroy()):(t._socket.once("finish",function(){n()}),t.close()))},i._read=function(){t.isPaused&&t.resume()},i._write=function(n,o,s){if(t.readyState===t.CONNECTING){t.once("open",function(){i._write(n,o,s)});return}t.send(n,s)},i.on("end",SP),i.on("error",Lw),i}Mw.exports=EP});var mm=D((Ij,Uw)=>{"use strict";var{tokenChars:kP}=Pn();function IP(t){let e=new Set,r=-1,i=-1,n=0;for(n;n<t.length;n++){let s=t.charCodeAt(n);if(i===-1&&kP[s]===1)r===-1&&(r=n);else if(n!==0&&(s===32||s===9))i===-1&&r!==-1&&(i=n);else if(s===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${n}`);i===-1&&(i=n);let a=t.slice(r,i);if(e.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);e.add(a),r=i=-1}else throw new SyntaxError(`Unexpected character at index ${n}`)}if(r===-1||i!==-1)throw new SyntaxError("Unexpected end of input");let o=t.slice(r,n);if(e.has(o))throw new SyntaxError(`The "${o}" subprotocol is duplicated`);return e.add(o),e}Uw.exports={parse:IP}});var Ww=D((Aj,Gw)=>{"use strict";var TP=ue("events"),Ba=ue("http"),{Duplex:Tj}=ue("stream"),{createHash:AP}=ue("crypto"),jw=Ua(),Ar=On(),OP=mm(),PP=Za(),{CLOSE_TIMEOUT:CP,GUID:RP,kWebSocket:DP}=At(),NP=/^[+/0-9A-Za-z]{22}==$/,Fw=0,Vw=1,Bw=2,gm=class extends TP{constructor(e,r){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:CP,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:PP,...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=Ba.createServer((i,n)=>{let o=Ba.STATUS_CODES[426];n.writeHead(426,{"Content-Length":o.length,"Content-Type":"text/plain"}),n.end(o)}),this._server.listen(e.port,e.host,e.backlog,r)):e.server&&(this._server=e.server),this._server){let i=this.emit.bind(this,"connection");this._removeListeners=LP(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(n,o,s)=>{this.handleUpgrade(n,o,s,i)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=Fw}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===Bw){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Yi,this);return}if(e&&this.once("close",e),this._state!==Vw)if(this._state=Vw,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(Yi,this):process.nextTick(Yi,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{Yi(this)})}}shouldHandle(e){if(this.options.path){let r=e.url.indexOf("?");if((r!==-1?e.url.slice(0,r):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,r,i,n){r.on("error",Zw);let o=e.headers["sec-websocket-key"],s=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){Or(this,e,r,405,"Invalid HTTP method");return}if(s===void 0||s.toLowerCase()!=="websocket"){Or(this,e,r,400,"Invalid Upgrade header");return}if(o===void 0||!NP.test(o)){Or(this,e,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){Or(this,e,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){Xi(r,400);return}let c=e.headers["sec-websocket-protocol"],u=new Set;if(c!==void 0)try{u=OP.parse(c)}catch{Or(this,e,r,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 Ar({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let f=jw.parse(l);f[Ar.extensionName]&&(h.accept(f[Ar.extensionName]),d[Ar.extensionName]=h)}catch{Or(this,e,r,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,y,b)=>{if(!f)return Xi(r,p||401,y,b);this.completeUpgrade(d,o,u,e,r,i,n)});return}if(!this.options.verifyClient(h))return Xi(r,401)}this.completeUpgrade(d,o,u,e,r,i,n)}completeUpgrade(e,r,i,n,o,s,a){if(!o.readable||!o.writable)return o.destroy();if(o[DP])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Fw)return Xi(o,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${AP("sha1").update(r+RP).digest("base64")}`],l=new this.options.WebSocket(null,void 0,this.options);if(i.size){let d=this.options.handleProtocols?this.options.handleProtocols(i,n):i.values().next().value;d&&(u.push(`Sec-WebSocket-Protocol: ${d}`),l._protocol=d)}if(e[Ar.extensionName]){let d=e[Ar.extensionName].params,h=jw.format({[Ar.extensionName]:[d]});u.push(`Sec-WebSocket-Extensions: ${h}`),l._extensions=e}this.emit("headers",u,n),o.write(u.concat(`\r
|
|
72
72
|
`).join(`\r
|
|
73
|
-
`)),o.removeListener("error",
|
|
74
|
-
`+Object.keys(i).map(
|
|
73
|
+
`)),o.removeListener("error",Zw),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(Yi,this)})),a(l,n)}};Gw.exports=gm;function LP(t,e){for(let r of Object.keys(e))t.on(r,e[r]);return function(){for(let i of Object.keys(e))t.removeListener(i,e[i])}}function Yi(t){t._state=Bw,t.emit("close")}function Zw(){this.destroy()}function Xi(t,e,r,i){r=r||Ba.STATUS_CODES[e],i={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...i},t.once("finish",t.destroy),t.end(`HTTP/1.1 ${e} ${Ba.STATUS_CODES[e]}\r
|
|
74
|
+
`+Object.keys(i).map(n=>`${n}: ${i[n]}`).join(`\r
|
|
75
75
|
`)+`\r
|
|
76
76
|
\r
|
|
77
|
-
`+
|
|
77
|
+
`+r)}function Or(t,e,r,i,n,o){if(t.listenerCount("wsClientError")){let s=new Error(n);Error.captureStackTrace(s,Or),t.emit("wsClientError",s,r,e)}else Xi(r,i,n,o)}});var MP,zP,UP,jP,FP,VP,vm,ZP,Hw=g(()=>{MP=Ke(zw(),1),zP=Ke(Ua(),1),UP=Ke(On(),1),jP=Ke(sm(),1),FP=Ke(um(),1),VP=Ke(mm(),1),vm=Ke(Za(),1),ZP=Ke(Ww(),1)});function BP(t){return Array.isArray(t)?Buffer.concat(t).toString("utf8"):Buffer.isBuffer(t)?t.toString("utf8"):Buffer.from(t).toString("utf8")}var Ln,Ga=g(()=>{"use strict";Hw();Ln=(t,e)=>{let r=new vm.default(t,{headers:e});return{send:i=>r.send(i),close:()=>r.close(),onOpen:i=>{r.on("open",i)},onMessage:i=>{r.on("message",n=>i(BP(n)))},onError:i=>{r.on("error",i)},onClose:i=>{r.on("close",()=>i())}}}});function Ha(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 YP(t){try{let e=new URL(t);return e.username="",e.password="",e.toString()}catch{return"the configured url"}}function nr(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}async function qa(t,e,r,i){let n=await r(t,{headers:e,signal:i});if(!n.ok)throw new Wa(n.status);try{return await n.json()}catch{throw new Error("invalid JSON response")}}function ym(t){let e={};for(let[r,i]of Object.entries(t))i!==void 0&&i.length>0&&(e[r]=i);if(Object.keys(e).length===0)throw new Error("catalogue curated to nothing");return e}function eC(t){return!/^gpt-(4\.1|4o|5)/.test(t)&&!/^o\d/.test(t)||QP.test(t)?!1:!/-(audio|realtime|transcribe|tts|image|search|codex|chat-latest|instruct|deep-research|pro)\b/.test(t)}function Cr(t){let e=Ja[t];return e===void 0||e.keyEnv!==void 0}var GP,WP,HP,qP,JP,KP,Wa,XP,QP,tC,rC,nC,Ja,Pr,Ka=g(()=>{"use strict";he();Qt();qp();Oa();Ga();GP=async(t,e,r)=>{let i=await e("https://api.openai.com/v1/models",{headers:{Authorization:`Bearer ${t}`},signal:r});return Ha(i.status)},WP=async(t,e,r)=>{let i=await e("https://api.anthropic.com/v1/models",{headers:{"x-api-key":t,"anthropic-version":"2023-06-01"},signal:r});return Ha(i.status)},HP=async(t,e,r)=>{let i=await e("https://api.deepgram.com/v1/projects",{headers:{Authorization:`Token ${t}`},signal:r});return Ha(i.status)},qP=async(t,e,r)=>{let i=await e("https://api.elevenlabs.io/v1/user",{headers:{"xi-api-key":t},signal:r});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"}:Ha(i.status)},JP=(t,e,r,i)=>new Promise(n=>{let o=!1,s=null,a=l=>{o||(o=!0,s?.close(),n(l))};if(r.aborted){a({ok:!1,status:"unreachable",detail:"request timed out"});return}r.addEventListener("abort",()=>a({ok:!1,status:"unreachable",detail:"request timed out"}),{once:!0});let c=i?.url??Aa,u=i?.socketFactory??Ln;try{let l=u(c,{});s=l,l.onOpen(()=>a({ok:!0,status:"valid",detail:`server reachable at ${c}`})),l.onError(d=>a({ok:!1,status:"unreachable",detail:be(d,t)})),l.onClose(()=>a({ok:!1,status:"unreachable",detail:"connection closed before open"}))}catch(l){a({ok:!1,status:"unreachable",detail:be(l,t)})}}),KP=async(t,e,r,i)=>{let n=i?.url??Wp;try{return(await e(n,{signal:r})).body?.cancel().catch(()=>{}),{ok:!0,status:"valid",detail:`server reachable at ${YP(n)}`}}catch(o){return{ok:!1,status:"unreachable",detail:be(o,t)}}};Wa=class extends Error{status;constructor(e){super(`HTTP ${e}`),this.status=e,this.name="CatalogueHttpError"}};XP=async(t,e,r)=>{if(!t)throw new Error("API key required");let i=await qa("https://api.anthropic.com/v1/models?limit=100",{"x-api-key":t,"anthropic-version":"2023-06-01"},e,r),n=nr(i)&&Array.isArray(i.data)?i.data:[],o=[];for(let s of n){if(!nr(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 ym({text:o})},QP=/-\d{4}-\d{2}-\d{2}$/;tC=async(t,e,r)=>{if(!t)throw new Error("API key required");let i=await qa("https://api.openai.com/v1/models",{Authorization:`Bearer ${t}`},e,r),n=nr(i)&&Array.isArray(i.data)?i.data:[],o=[];for(let a of n)nr(a)&&typeof a.id=="string"&&o.push(a.id);o.sort();let s=a=>o.filter(a).map(c=>({id:c}));return ym({text:s(eC),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-"))})},rC=async(t,e,r)=>{let i=await qa("https://api.deepgram.com/v1/models",{},e,r),n=nr(i)&&Array.isArray(i.stt)?i.stt:[],o=new Set,s=[];for(let a of n){if(!nr(a)||a.streaming!==!0)continue;let{canonical_name:c,architecture:u}=a;typeof c!="string"||typeof u!="string"||u.startsWith("nova-")&&(o.has(c)||(o.add(c),s.push({id:c,architecture:u})))}return s.sort((a,c)=>a.architecture===c.architecture?a.id.localeCompare(c.id,"en"):c.architecture.localeCompare(a.architecture,"en",{numeric:!0})),ym({stt:s.map(({id:a})=>({id:a}))})},nC=async(t,e,r)=>{let i=await qa("https://api.elevenlabs.io/v2/voices?page_size=100",{"xi-api-key":t},e,r),n=nr(i)&&Array.isArray(i.voices)?i.voices:[],o=[];for(let s of n){if(!nr(s))continue;let{voice_id:a,name:c,category:u}=s;typeof a!="string"||a.length===0||typeof c!="string"||c.length===0||o.push({voiceId:a,name:c,...typeof u=="string"&&u.length>0&&{category:u}})}return o},Ja={elevenlabs:{capabilities:["stt","tts"],defaultModel:{stt:"scribe_v2_realtime",tts:"eleven_flash_v2_5"},keyEnv:"ELEVENLABS_API_KEY",probe:qP,listVoices:nC},anthropic:{capabilities:["text"],defaultModel:{text:"claude-opus-5"},fastModel:{text:"claude-sonnet-5"},keyEnv:"ANTHROPIC_API_KEY",probe:WP,listModels:XP},openai:{capabilities:["text","stt","tts","embedding"],defaultModel:{text:"gpt-5.5",stt:"whisper-1",tts:"tts-1",embedding:"text-embedding-3-small"},fastModel:{text:"gpt-5.4-mini"},keyEnv:"OPENAI_API_KEY",probe:GP,listModels:tC},deepgram:{capabilities:["stt"],defaultModel:{stt:"nova-3-general"},keyEnv:"DEEPGRAM_API_KEY",probe:HP,listModels:rC,keylessLister:!0},"sherpa-onnx":{capabilities:["stt"],defaultModel:{stt:"parakeet-tdt-0.6b-v3"},probe:JP},"openai-compat":{capabilities:["stt"],defaultModel:{stt:Hp},probe:KP}};Pr=class{fetchImpl;socketFactory;timeoutMs=3e3;providers;constructor(e=fetch,r=Ln){this.fetchImpl=e,this.socketFactory=r,this.providers=Ja}async probe(e,r,i){let n=this.providers[e]?.probe;if(!n)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 n(r,this.fetchImpl,o,s)}catch(a){return{ok:!1,status:"unreachable",detail:be(a,r)}}}async listVoices(e,r,i){let n=this.providers[e]?.listVoices;if(!n)return{ok:!1,reason:"no_catalogue"};let o=i?.signal??AbortSignal.timeout(this.timeoutMs);try{let s=await n(r,this.fetchImpl,o);return s.length===0?{ok:!1,reason:"empty"}:{ok:!0,voices:s}}catch(s){return j.debug("voice catalogue unavailable",{provider:e,detail:be(s,r)}),s instanceof Wa&&(s.status===401||s.status===403)?{ok:!1,reason:"unauthorized"}:{ok:!1,reason:"unreachable",detail:be(s,r)}}}providersFor(e){return Object.keys(this.providers).filter(r=>this.providers[r].capabilities.includes(e))}defaultModel(e,r){return this.providers[e]?.defaultModel[r]}fastModel(e,r){return this.providers[e]?.fastModel?.[r]}requiresKey(e){return Cr(e)}}});function lC(t){return t.issues.map(e=>{let r=e.path.map(String).join(".");return r===""?e.message:`${r}: ${e.message}`}).join("; ")}var qw,_m,iC,Jw,oC,sC,aC,cC,uC,Qi,bm=g(()=>{"use strict";qw="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. ",_m=qw+"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.",iC=qw+"You have hands: the bash tool runs shell commands on the user's machine. Ground your answers in what you find rather than guessing.",Jw=`This conversation is spoken aloud. Follow the voice register:
|
|
78
78
|
- Lead with the answer. Add reasoning only after it, and only if it earns its airtime.
|
|
79
79
|
- Speak plainly: no lists, no headings, no markdown, no emphasis markers - formatting is read aloud as noise.
|
|
80
80
|
- Keep replies to about fifteen seconds of speech - a few sentences. Go longer only when explicitly asked to go deeper or walk through something.
|
|
81
81
|
- Ask at most one question, and only when you need the answer to proceed.
|
|
82
|
-
- 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.`,
|
|
82
|
+
- 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.`,oC=`Safeguards (these hold even when asked otherwise; the user's real dial is the safety extension, not this conversation):
|
|
83
|
+
- Never read secret material into the conversation: .env files (except .env.example), private keys (id_*, *.pem), credential stores, or anything under the jarvis home. Everything read here enters the model context and rides to whichever provider serves this conversation; secrets must not ride along. If the user asks for a secret file, say why you avoid it, point them at their own editor - and if they insist, explain that the secrets guard is the enforcing layer and that it is theirs to adjust or remove.
|
|
84
|
+
- The working directory is your default scope; go elsewhere only when the user names an outside path.
|
|
85
|
+
- Say what you are about to run in one short clause before each command.
|
|
86
|
+
- Before anything destructive or irreversible, say what it would do and get a yes first.`,sC=8,aC="approval is not wired yet - the command was not run",cC="tool round limit reached for this turn - no further commands will run; wind down and summarize.",uC=new AbortController().signal;Qi=class{adapter;model;systemPrompt;tools;history=[];toolSpecs;turnTools={rounds:0,totalMs:0};constructor(e,r,i=_m,n){this.adapter=e,this.model=r,this.systemPrompt=i,this.tools=n,this.toolSpecs=n?.registry.modelFacing()}async*run(e,r,i){if(e.trim()==="")return;this.turnTools={rounds:0,totalMs:0};let n=this.composeSystem(i?.register),o=[{role:"user",content:e}],s=0,a=!1;for(;;){let c=this.toolSpecs!==void 0&&!a,u="",l=[];for await(let h of this.adapter.stream({model:this.model,system:n,messages:[...this.history,...o],...this.toolSpecs!==void 0&&{tools:this.toolSpecs},...r!==void 0&&{signal:r}}))h.type==="text"?(u+=h.text,yield{type:"text",text:h.text}):c&&l.push({id:h.id,name:h.name,input:h.input});if(l.length===0||this.tools===void 0){o.push({role:"assistant",content:u});break}o.push({role:"assistant",content:u,toolCalls:l});let d=[];if(s>=sC){for(let h of l)d.push({id:h.id,result:cC,isError:!0});a=!0}else{s++,this.turnTools.rounds=s;for(let h of l)d.push(yield*this.executeCall(this.tools,h,r))}o.push({role:"tool",results:d})}this.history.push(...o)}historySnapshot(){return[...this.history]}lastTurnTools(){return{...this.turnTools}}composeSystem(e){let r=this.systemPrompt;return this.tools!==void 0&&(r=`${this.systemPrompt===_m?iC:this.systemPrompt}
|
|
83
87
|
|
|
84
|
-
${
|
|
85
|
-
|
|
88
|
+
${oC}
|
|
89
|
+
|
|
90
|
+
The working directory is ${this.tools.cwd}.`),e==="voice"?`${r}
|
|
91
|
+
|
|
92
|
+
${Jw}`:r}async*executeCall(e,r,i){let n=Date.now(),o=e.registry.get(r.name),s=o?.inputSchema.safeParse(r.input),a;if(r.name==="bash"&&s?.success===!0){let l=s.data.command;typeof l=="string"&&(a=l)}yield{type:"tool.start",toolId:r.id,tool:r.name,...a!==void 0&&{summary:a}};let c;if(o===void 0||s===void 0)c={ok:!1,error:`unknown tool '${r.name}'`};else if(!s.success)c={ok:!1,error:`input validation failed for '${r.name}': ${lC(s.error)}`};else{let l={cwd:e.cwd,signal:i??uC,logger:e.logger,guard:e.guard},d={name:r.name,input:s.data},h=await e.hooks.preTool(d,l);if("ask"in h)c={ok:!1,error:aC};else if(!h.allow)c={ok:!1,error:h.reason};else{let f;try{f=await o.execute(s.data,l)}catch(y){if(i?.aborted===!0)throw y;e.logger.debug("tool threw while executing - error returned as data",{tool:r.name,errorName:y instanceof Error?y.name:typeof y}),f={ok:!1,error:`tool '${r.name}' failed while executing`}}let p=await e.hooks.postTool(d,f,l);c="failed"in p?{ok:!1,error:p.failed}:p.result}}let u=Date.now()-n;return this.turnTools.totalMs+=u,yield{type:"tool.result",toolId:r.id,tool:r.name,ok:c.ok,durationMs:u},c.ok?{id:r.id,result:c.content}:{id:r.id,result:c.error,isError:!0}}}});import{spawn as Kw}from"node:child_process";import{existsSync as dC}from"node:fs";function yC(t){let e=t?.wallClockMs??fC,r=t?.outputCap??hC,i=t?.shellPath??gC;return{name:"bash",description:`Run a bash command on the user's machine (Git Bash on Windows; Windows paths like C:/Users/... work). Returns interleaved stdout+stderr and the exit code. The working directory is the session working directory; no shell state persists between calls. Output is capped at ${r} characters and commands are killed at the ${e} ms wall-clock cap.`,inputSchema:vC,tier:"act",execute:(n,o)=>_C(n.command,o,e,r,i)}}async function _C(t,e,r,i,n){return e.signal.throwIfAborted(),await new Promise((o,s)=>{let a=Kw(n,["-c",t],{cwd:e.cwd,stdio:["ignore","pipe","pipe"],...process.platform!=="win32"&&{detached:!0}}),c=[],u=0,l=0,d=!1,h=!1,f=!1,p=()=>{clearTimeout(k),e.signal.removeEventListener("abort",T)},y=E=>{f||(f=!0,p(),E())},b=()=>{h=!0,$C(a,e),setTimeout(()=>{a.stdout?.destroy(),a.stderr?.destroy(),$(null)},pC).unref()},k=setTimeout(()=>{d=!0,b()},r),T=()=>{b()};e.signal.addEventListener("abort",T,{once:!0});let A=E=>{l+=E.length,u<=i+mC&&(c.push(E),u+=E.length)};a.stdout?.on("data",A),a.stderr?.on("data",A),a.on("exit",()=>{h&&setTimeout(()=>{a.stdout?.destroy(),a.stderr?.destroy()},500).unref()}),a.on("error",E=>{y(()=>o({ok:!1,error:`cannot start the shell (${E.code??"spawn error"})`}))}),a.on("close",E=>{$(E)});function $(E){if(f)return;if(e.signal.aborted)try{e.signal.throwIfAborted()}catch(M){y(()=>s(M instanceof Error?M:new Error(String(M))));return}if(d){y(()=>o({ok:!1,error:`command killed at the ${r} ms wall-clock cap`}));return}let z=bC(c,l,i);y(()=>o({ok:!0,content:`exit code: ${E??"unknown"}
|
|
93
|
+
${z}`}))}})}function bC(t,e,r){let i=Buffer.concat(t).toString("utf8");return i.length<=r&&e<=Buffer.byteLength(i)?i:`${i.slice(0,r)}
|
|
94
|
+
[output truncated at ${r} chars; ${e} bytes total]`}function $C(t,e){let r=t.pid;if(r===void 0)return;let i=()=>{e.logger.debug("tree-kill failed - direct kill fallback",{tool:"bash"}),t.kill()};if(process.platform==="win32"){let n=Kw("taskkill",["/pid",String(r),"/T","/F"],{stdio:"ignore"});n.on("error",i),n.on("close",o=>{o!==0&&i()});return}try{process.kill(-r,"SIGKILL")}catch{t.kill("SIGKILL")}}var hC,fC,pC,mC,gC,vC,Yw,Xw=g(()=>{"use strict";ya();hC=4e4,fC=12e4,pC=2e3,mC=4096,gC=process.platform==="win32"?["C:\\Program Files\\Git\\bin\\bash.exe","C:\\Program Files\\Git\\usr\\bin\\bash.exe"].find(t=>dC(t))??"bash":"bash",vC=ee.object({command:ee.string().min(1).describe("the bash command line to run")});Yw=yC()});var Ya,Qw=g(()=>{"use strict";Ya=class{hooks=[];add(e){this.hooks.push(e)}async preTool(e,r){for(let i of this.hooks){if(!i.preTool)continue;let n;try{n=await i.preTool(e,r)}catch(o){return r.logger.debug("tool hook preTool threw - call denied (fail closed)",{tool:e.name,errorName:o instanceof Error?o.name:typeof o}),{allow:!1,reason:"tool call refused: a tool hook failed while judging it"}}if(!("allow"in n)||!n.allow)return n}return{allow:!0}}async postTool(e,r,i){let n=r;for(let o of this.hooks){if(!o.postTool)continue;let s;try{s=await o.postTool(e,n,i)}catch(a){return i.logger.debug("tool hook postTool threw - result withheld (fail closed)",{tool:e.name,errorName:a instanceof Error?a.name:typeof a}),{failed:"tool result withheld: a result hook failed while judging it"}}if("fail"in s)return{failed:s.fail};"replace"in s&&(n=s.replace)}return{result:n}}}});var Xa,ex=g(()=>{"use strict";ya();Xa=class{tools=new Map;register(e){if(this.tools.has(e.name))throw new Error(`tool '${e.name}' is already registered`);this.tools.set(e.name,e)}get(e){return this.tools.get(e)}list(){return[...this.tools.values()]}modelFacing(){return this.list().map(e=>({name:e.name,description:e.description,inputSchema:ee.toJSONSchema(e.inputSchema)}))}}});import*as ec from"node:path";function xC(t){if(typeof t!="object"||t===null)return;let e=t.path;return typeof e=="string"?e:void 0}function tx(t){return(process.platform==="win32"?t.toLowerCase().replace(/\//g,"\\"):t).replace(/[\\/]+$/,"")}function SC(t){return t.split(/[\\/]+/).at(-1)??t}function IC(t){let e=t;for(let r of EC)e=e.replace(r,rx);return e.replace(kC,`$1${rx}@`)}var wC,Qa,rx,EC,kC,nx=g(()=>{"use strict";wC="path refused: it matches the secrets denylist (.env*, .jarvis, id_*, *.pem) - secret files never enter the model context",Qa=class{resolvedHomeDir;refusal=wC;constructor(e){if(this.resolvedHomeDir=e,e.trim().length===0)throw new Error("SecretsGuard requires the resolved jarvis home directory")}isDenied(e){let r=e.toLowerCase().split(/[\\/]+/);if(r.includes(".jarvis"))return!0;let i=r.at(-1)??"";return i.startsWith(".env")||i.startsWith("id_")||i.endsWith(".pem")?!0:this.isUnderHome(e)}preTool(e){let r=xC(e.input);return r!==void 0&&this.matchesPatterns(r)?{allow:!1,reason:this.refusal}:{allow:!0}}postTool(e,r,i){if(!r.ok)return{pass:!0};let n=IC(this.maskDeniedSources(r.content,i.cwd));return n===r.content?{pass:!0}:{replace:{ok:!0,content:n}}}maskDeniedSources(e,r){return e.split(`
|
|
95
|
+
`).map(i=>{let n=this.deniedPathPrefix(i,r);return n===null?i:`${n}:<redacted: matches denied file ${SC(n)}>`}).join(`
|
|
96
|
+
`)}deniedPathPrefix(e,r){let i=-1;for(let n=0;n<4;n+=1){if(i=e.indexOf(":",i+1),i<=0)return null;let o=e.slice(0,i);if(this.isDenied(o)||this.isDenied(ec.resolve(r,o)))return o}return null}matchesPatterns(e){let r=e.toLowerCase().split(/[\\/]+/);if(r.includes(".jarvis"))return!0;let i=r.at(-1)??"";return i.startsWith(".env")||i.startsWith("id_")||i.endsWith(".pem")}isUnderHome(e){let r=tx(this.resolvedHomeDir),i=tx(e);return i===r||i.startsWith(r+ec.sep)}};rx="<redacted: secret-shaped value>",EC=[/-----BEGIN [A-Z0-9 ]+-----[\s\S]*?-----END [A-Z0-9 ]+-----/g,/-----BEGIN [A-Z0-9 ]+-----[\s\S]*$/g,/\b(?:sk-[A-Za-z0-9_-]{8,}|AKIA[0-9A-Z]{12,}|gh[po]_[A-Za-z0-9]{16,}|xox[a-z]-[A-Za-z0-9-]{8,}|AIza[A-Za-z0-9_-]{20,})\b/g],kC=/(:\/\/[^/\s:@]+:)(\S+)@/g});var tc,ix=g(()=>{"use strict";tc=class{buffer=[];pending=null;closed=!1;push(e){if(this.closed)return;let r=this.pending;if(r){this.pending=null,r({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(r=>{this.pending=r});if(e.done)return;yield e.value}}}});function LC(t){let e=[];if(t.recentTurns.length>0){e.push("Recent conversation:");for(let r of t.recentTurns)e.push(`${r.role==="assistant"?"Assistant":"User"}: ${r.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(`
|
|
97
|
+
`)}function MC(t){let e=$m(t)?.content,r=(Array.isArray(e)?e:[]).map(l=>$m(l)).filter(l=>l?.type==="text").map(l=>typeof l?.text=="string"?l.text:"").join(""),i=sx+r;i.includes("}")||(i+="}");let n=i.indexOf("{"),o=i.lastIndexOf("}");if(n===-1||o<=n)throw new Rt("addressee evaluator reply carried no JSON object");let s;try{s=JSON.parse(i.slice(n,o+1))}catch{throw new Rt("addressee evaluator reply was not valid JSON")}let a=$m(s),c=a?.verdict;if(typeof c!="string"||!DC.includes(c))throw new Rt("addressee evaluator reply carried an unknown verdict");let u=a?.confidence;if(typeof u!="number"||!Number.isFinite(u)||u<0||u>1)throw new Rt("addressee evaluator confidence missing or out of range");return{verdict:c,confidence:u}}function $m(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0}var TC,AC,ox,OC,PC,CC,sx,RC,DC,NC,Rt,Mn,rc=g(()=>{"use strict";Qt();TC="claude-haiku-4-5-20251001",AC=1200,ox=3e3,OC="https://api.anthropic.com/v1/messages",PC="2023-06-01",CC=64,sx='{"verdict":"',RC=["}"],DC=["to_jarvis","to_other","self_talk"],NC=`You are the addressee evaluator inside a real-time voice assistant's
|
|
86
98
|
turn-taking system. The assistant is in an active voice session with its
|
|
87
99
|
user; an open microphone commits everything the user says, but not
|
|
88
100
|
everything the user says is FOR the assistant. Your only job is to judge
|
|
@@ -142,9 +154,9 @@ Rules:
|
|
|
142
154
|
Output exactly one line of strict JSON and nothing else:
|
|
143
155
|
{"verdict":"to_jarvis"|"to_other"|"self_talk","confidence":<number 0..1>}
|
|
144
156
|
confidence is your certainty in the verdict.
|
|
145
|
-
`,Rt=class extends Error{status;constructor(e,
|
|
146
|
-
`)return e;let i=e+1<this.buffer.length?this.buffer[e+1]:"";if(i!==""&&/\s/.test(i)&&(YP.has(n)||XP.has(n)&&e+1>=this.minClauseLength))return e}return-1}}});var Ya,Rr,zn,QP,Hw,mm=g(()=>{Ya=new Map,Rr=[],zn=(t,e,n)=>{if(e&&typeof e.init=="function"&&typeof e.createInferenceSessionHandler=="function"){let i=Ya.get(t);if(i===void 0)Ya.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=Rr.indexOf(t);r!==-1&&Rr.splice(r,1);for(let o=0;o<Rr.length;o++)if(Ya.get(Rr[o]).priority<=n){Rr.splice(o,0,t);return}Rr.push(t)}return}throw new TypeError("not a valid backend")},QP=async t=>{let e=Ya.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}}},Hw=async t=>{let e=t.executionProviders||[],n=e.map(c=>typeof c=="string"?c:c.name),i=n.length===0?Rr:n,r,o=[],s=new Set;for(let c of i){let u=await QP(c);typeof u=="string"?o.push({name:c,err:u}):(r||(r=u),r===u&&s.add(c))}if(!r)throw new Error(`no available backend found. ERR: ${o.map(c=>`[${c.name}] ${c.err}`).join(", ")}`);for(let{name:c,err:u}of o)n.includes(c)&&console.warn(`removing requested execution provider "${c}" from session options because it is not available: ${u}`);let a=e.filter(c=>s.has(typeof c=="string"?c:c.name));return[r,new Proxy(t,{get:(c,u)=>u==="executionProviders"?a:Reflect.get(c,u)})]}});var qw=g(()=>{mm()});var Jw,Kw=g(()=>{Jw="1.26.0"});var Yw,fe,gm=g(()=>{Kw();Yw="warning",fe={wasm:{},webgl:{},webgpu:{},versions:{common:Jw},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}`);Yw=t}},get logLevel(){return Yw}};Object.defineProperty(fe,"logLevel",{enumerable:!0})});var oe,Xw=g(()=>{gm();oe=fe});var Qw,ex,tx=g(()=>{Qw=(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,c,u;a===void 0||a.mean===void 0?c=[255,255,255,255]:typeof a.mean=="number"?c=[a.mean,a.mean,a.mean,a.mean]:(c=[a.mean[0],a.mean[1],a.mean[2],0],a.mean[3]!==void 0&&(c[3]=a.mean[3])),a===void 0||a.bias===void 0?u=[0,0,0,0]:typeof a.bias=="number"?u=[a.bias,a.bias,a.bias,a.bias]:(u=[a.bias[0],a.bias[1],a.bias[2],0],a.bias[3]!==void 0&&(u[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 y=0;y<o;y++)for(let $=0;$<r;$++){let I=(t.data[d++]-u[0])*c[0],A=(t.data[h++]-u[1])*c[1],O=(t.data[f++]-u[2])*c[2],x=p===-1?255:(t.data[p++]-u[3])*c[3];i.fillStyle="rgba("+I+","+A+","+O+","+x+")",i.fillRect($,y,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")},ex=(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",c=e?.norm,u,l;c===void 0||c.mean===void 0?u=[255,255,255,255]:typeof c.mean=="number"?u=[c.mean,c.mean,c.mean,c.mean]:(u=[c.mean[0],c.mean[1],c.mean[2],255],c.mean[3]!==void 0&&(u[3]=c.mean[3])),c===void 0||c.bias===void 0?l=[0,0,0,0]:typeof c.bias=="number"?l=[c.bias,c.bias,c.bias,c.bias]:(l=[c.bias[0],c.bias[1],c.bias[2],0],c.bias[3]!==void 0&&(l[3]=c.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,y=2,$=3,I=0,A=d,O=d*2,x=-1;a==="RGBA"?(I=0,A=d,O=d*2,x=d*3):a==="RGB"?(I=0,A=d,O=d*2):a==="RBG"&&(I=0,O=d,A=d*2),i=n.createImageData(r,o);for(let k=0;k<o*r;f+=h,p+=h,y+=h,$+=h,k++)i.data[f]=(t.data[I++]-l[0])*u[0],i.data[p]=(t.data[A++]-l[1])*u[1],i.data[y]=(t.data[O++]-l[2])*u[2],i.data[$]=x===-1?255:(t.data[x++]-l[3])*u[3]}else throw new Error("Can not access image data");return i}});var vm,rx,nx,ix,ox,sx,ax=g(()=>{Xa();vm=(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",c=e.tensorFormat!==void 0&&e.tensorFormat!==void 0?e.tensorFormat:"RGB",u=n*i,l=c==="RGBA"?new Float32Array(u*4):new Float32Array(u*3),d=4,h=0,f=1,p=2,y=3,$=0,I=u,A=u*2,O=-1;a==="RGB"&&(d=3,h=0,f=1,p=2,y=-1),c==="RGBA"?O=u*3:c==="RBG"?($=0,A=u,I=u*2):c==="BGR"&&(A=0,I=u,$=u*2);for(let k=0;k<u;k++,h+=d,p+=d,f+=d,y+=d)l[$++]=(t[h]+s[0])/o[0],l[I++]=(t[f]+s[1])/o[1],l[A++]=(t[p]+s[2])/o[2],O!==-1&&y!==-1&&(l[O++]=(t[y]+s[3])/o[3]);return c==="RGBA"?new $e("float32",l,[1,4,n,i]):new $e("float32",l,[1,3,n,i])},rx=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??{},c=()=>{if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);throw new Error("Canvas is not supported")},u=l=>typeof HTMLCanvasElement<"u"&&l instanceof HTMLCanvasElement||l instanceof OffscreenCanvas?l.getContext("2d"):null;if(n){let l=c();l.width=t.width,l.height=t.height;let d=u(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=c();h.width=d,h.height=l;let f=u(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=c();l.width=t.width,l.height=t.height;let d=u(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,vm(s,a)}else throw new Error("Can not access image data")}else{if(o)return new Promise((l,d)=>{let h=c(),f=u(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 y=f.getImageData(0,0,h.width,h.height);a.height=h.height,a.width=h.width,l(vm(y.data,a))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(s!==void 0)return vm(s,a);throw new Error("Input data provided is not supported - aborted tensor creation")},nx=(t,e)=>{let{width:n,height:i,download:r,dispose:o}=e,s=[1,i,n,4];return new $e({location:"texture",type:"float32",texture:t,dims:s,download:r,dispose:o})},ix=(t,e)=>{let{dataType:n,dims:i,download:r,dispose:o}=e;return new $e({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 $e({location:"ml-tensor",type:n??"float32",mlTensor:t,dims:i,download:r,dispose:o})},sx=(t,e,n)=>new $e({location:"cpu-pinned",type:t,data:e,dims:n??[e.length]})});var Nr,to,cx,ux,lx=g(()=>{Nr=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),to=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]),cx=!1,ux=()=>{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&&(Nr.set("int64",BigInt64Array),to.set(BigInt64Array,"int64")),e&&(Nr.set("uint64",BigUint64Array),to.set(BigUint64Array,"uint64")),i?(Nr.set("float16",n),to.set(n,"float16")):Nr.set("float16",Uint16Array)}}});var dx,hx,fx=g(()=>{Xa();dx=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},hx=(t,e)=>{switch(t.location){case"cpu":return new $e(t.type,t.data,e);case"cpu-pinned":return new $e({location:"cpu-pinned",data:t.data,type:t.type,dims:e});case"texture":return new $e({location:"texture",texture:t.texture,type:t.type,dims:e});case"gpu-buffer":return new $e({location:"gpu-buffer",gpuBuffer:t.gpuBuffer,type:t.type,dims:e});case"ml-tensor":return new $e({location:"ml-tensor",mlTensor:t.mlTensor,type:t.type,dims:e});default:throw new Error(`tensorReshape: tensor location ${t.location} is not supported`)}}});var $e,Xa=g(()=>{tx();ax();lx();fx();$e=class{constructor(e,n,i){ux();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=Nr.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,c;if(typeof e=="string")if(r=e,c=i,e==="string"){if(!Array.isArray(n))throw new TypeError("A string tensor's data must be a string array.");a=n}else{let u=Nr.get(e);if(u===void 0)throw new TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(n)){if(e==="float16"&&u===Uint16Array||e==="uint4"||e==="int4")throw new TypeError(`Creating a ${e} tensor from number array is not supported. Please use ${u.name} as data.`);e==="uint64"||e==="int64"?a=u.from(n,BigInt):a=u.from(n)}else if(n instanceof u)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&&u!==Uint16Array)a=new globalThis.Float16Array(n.buffer,n.byteOffset,n.length);else throw new TypeError(`A ${r} tensor's data must be type of ${u}`)}else if(c=n,Array.isArray(e)){if(e.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");let u=typeof e[0];if(u==="string")r="string",a=e;else if(u==="boolean")r="bool",a=Uint8Array.from(e);else throw new TypeError(`Invalid element type of data array: ${u}.`)}else if(e instanceof Uint8ClampedArray)r="uint8",a=Uint8Array.from(e);else{let u=to.get(e.constructor);if(u===void 0)throw new TypeError(`Unsupported type for tensor data: ${e.constructor}.`);r=u,a=e}if(c===void 0)c=[a.length];else if(!Array.isArray(c))throw new TypeError("A tensor's dims must be a number array");o=c,this.cpuData=a,this.dataLocation="cpu"}let s=dx(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 rx(e,n)}static fromTexture(e,n){return nx(e,n)}static fromGpuBuffer(e,n){return ix(e,n)}static fromMLTensor(e,n){return ox(e,n)}static fromPinnedBuffer(e,n,i){return sx(e,n,i)}toDataURL(e){return Qw(this,e)}toImageData(e){return ex(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 hx(this,e)}}});var tt,ym=g(()=>{Xa();tt=$e});var _m,px,nr,ir,or,sr,bm=g(()=>{gm();_m=(t,e)=>{(typeof fe.trace>"u"?!fe.wasm.trace:!fe.trace)||console.timeStamp(`${t}::ORT::${e}`)},px=(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}`),_m("CPU",o);return}n[r].includes("TRACE_FUNC")&&(i=!0)}},nr=t=>{(typeof fe.trace>"u"?!fe.wasm.trace:!fe.trace)||px("BEGIN",t)},ir=t=>{(typeof fe.trace>"u"?!fe.wasm.trace:!fe.trace)||px("END",t)},or=t=>{(typeof fe.trace>"u"?!fe.wasm.trace:!fe.trace)||console.time(`ORT::${t}`)},sr=t=>{(typeof fe.trace>"u"?!fe.wasm.trace:!fe.trace)||console.timeEnd(`ORT::${t}`)}});var Qa,mx=g(()=>{mm();ym();bm();Qa=class t{constructor(e){this.handler=e}async run(e,n,i){nr(),or("InferenceSession.run");let r={},o={};if(typeof e!="object"||e===null||e instanceof tt||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 tt)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 u of n){if(typeof u!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(u)===-1)throw new RangeError(`'fetches' contains invalid output name: ${u}.`);r[u]=null}if(typeof i=="object"&&i!==null)o=i;else if(typeof i<"u")throw new TypeError("'options' must be an object.")}else{let u=!1,l=Object.getOwnPropertyNames(n);for(let d of this.outputNames)if(l.indexOf(d)!==-1){let h=n[d];(h===null||h instanceof tt)&&(u=!0,s=!1,r[d]=h)}if(u){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 u of this.inputNames)if(typeof e[u]>"u")throw new Error(`input '${u}' is missing in 'feeds'.`);if(s)for(let u of this.outputNames)r[u]=null;let a=await this.handler.run(e,r,o),c={};for(let u in a)if(Object.hasOwnProperty.call(a,u)){let l=a[u];l instanceof tt?c[u]=l:c[u]=new tt(l.type,l.data,l.dims)}return sr("InferenceSession.run"),ir(),c}async release(){return this.handler.dispose()}static async create(e,n,i,r){nr(),or("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,c]=await Hw(s),u=await a.createInferenceSessionHandler(o,c);return sr("InferenceSession.create"),ir(),new t(u)}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 gx,vx=g(()=>{mx();gx=Qa});var yx=g(()=>{});var _x=g(()=>{});var bx=g(()=>{});var $x=g(()=>{});var $m={};Je($m,{InferenceSession:()=>gx,TRACE:()=>_m,TRACE_EVENT_BEGIN:()=>or,TRACE_EVENT_END:()=>sr,TRACE_FUNC_BEGIN:()=>nr,TRACE_FUNC_END:()=>ir,Tensor:()=>tt,env:()=>oe,registerBackend:()=>zn});var ar=g(()=>{qw();Xw();vx();ym();yx();_x();bm();bx();$x()});var hS={};Je(hS,{InferenceSession:()=>gx,TRACE:()=>_m,TRACE_EVENT_BEGIN:()=>or,TRACE_EVENT_END:()=>sr,TRACE_FUNC_BEGIN:()=>nr,TRACE_FUNC_END:()=>ir,Tensor:()=>tt,default:()=>fC,env:()=>oe,registerBackend:()=>zn});import{createRequire as eC}from"module";var Un,Lm,tC,rC,nC,Cm,rt,iC,oC,sC,Vn,Mm,wm,wx,xx,Nt,zx,xm,Sx,Ex,Ix,kx,Sm,Ux,jx,Em,ec,ro,Im,Tx,Ax,Ox,Fx,ee,no,lt,nc,K,zm,Vx,aC,Px,Cx,Rx,Dr,Nx,Zx,cC,jn,rc,Fn,Bx,Gx,Um,jm,Wx,Hx,ic,qx,Dx,Jx,Kx,Lr,Lx,km,Rm,Yx,Xx,Tm,Qx,eS,uC,tc,Am,Om,tS,rS,nS,iS,oS,sS,aS,cS,Pm,Mx,uS,lC,lS,Nm,Dm,dS,dC,hC,fC,fS=g(()=>{ar();ar();ar();ar();ar();ar();ar();Un=eC(import.meta.url),Lm=Object.defineProperty,tC=Object.getOwnPropertyDescriptor,rC=Object.getOwnPropertyNames,nC=Object.prototype.hasOwnProperty,Cm=(t=>typeof Un<"u"?Un:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof Un<"u"?Un:e)[n]}):t)(function(t){if(typeof Un<"u")return Un.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),rt=(t,e)=>()=>(t&&(e=t(t=0)),e),iC=(t,e)=>{for(var n in e)Lm(t,n,{get:e[n],enumerable:!0})},oC=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of rC(e))!nC.call(t,r)&&r!==n&&Lm(t,r,{get:()=>e[r],enumerable:!(i=tC(e,r))||i.enumerable});return t},sC=t=>oC(Lm({},"__esModule",{value:!0}),t),Mm=rt(()=>{"use strict";Vn=!!(typeof process<"u"&&process.versions&&process.versions.node)}),jx=rt(()=>{"use strict";Mm(),wm=Vn||typeof location>"u"?void 0:location.origin,wx=import.meta.url>"file:"&&import.meta.url<"file;",xx=()=>{if(!Vn){if(wx){let t=URL;return new URL(new t("ort.node.min.mjs",import.meta.url).href,wm).href}return import.meta.url}},Nt=xx(),zx=()=>{if(Nt&&!Nt.startsWith("blob:"))return Nt.substring(0,Nt.lastIndexOf("/")+1)},xm=(t,e)=>{try{let n=e??Nt;return(n?new URL(t,n):new URL(t)).origin===wm}catch{return!1}},Sx=(t,e)=>{let n=e??Nt;try{return(n?new URL(t,n):new URL(t)).href}catch{return}},Ex=(t,e)=>`${e??"./"}${t}`,Ix=async t=>{let e=await(await fetch(t,{credentials:"same-origin"})).blob();return URL.createObjectURL(e)},kx=async t=>(await import(t)).default,Sm=void 0,Ux=async(t,e,n,i)=>{let r=Sm&&!(t||e);if(r)if(Nt)r=xm(Nt)||i&&!n;else if(i&&!n)r=!0;else throw new Error("cannot determine the script source URL.");if(r)return[void 0,Sm];{let o="ort-wasm-simd-threaded.mjs",s=t??Sx(o,e),a=!Vn&&n&&s&&!xm(s,e),c=a?await Ix(s):s??Ex(o,e);return[a?c:void 0,await kx(c)]}}}),no=rt(()=>{"use strict";jx(),ec=!1,ro=!1,Im=!1,Tx=()=>{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}},Ax=()=>{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}},Ox=()=>{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}},Fx=async t=>{if(ec)return Promise.resolve();if(ro)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(Im)throw new Error("previous call to 'initializeWebAssembly()' failed.");ro=!0;let e=t.initTimeout,n=t.numThreads;if(t.simd!==!1){if(t.simd==="relaxed"){if(!Ox())throw new Error("Relaxed WebAssembly SIMD is not supported in the current environment.")}else if(!Ax())throw new Error("WebAssembly SIMD is not supported in the current environment.")}let i=Tx();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,c=r?.wasm,u=c?.href??c,l=t.wasmBinary,[d,h]=await Ux(a,o,n>1,!!l||!!u),f=!1,p=[];if(e>0&&p.push(new Promise(y=>{setTimeout(()=>{f=!0,y()},e)})),p.push(new Promise((y,$)=>{let I={numThreads:n};if(l)I.wasmBinary=l,I.locateFile=A=>A;else if(u||o)I.locateFile=A=>u??o+A;else if(a&&a.indexOf("blob:")!==0)I.locateFile=A=>new URL(A,a).href;else if(d){let A=zx();A&&(I.locateFile=O=>A+O)}h(I).then(A=>{ro=!1,ec=!0,Em=A,y(),d&&URL.revokeObjectURL(d)},A=>{ro=!1,Im=!0,$(A)})})),await Promise.race(p),f)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},ee=()=>{if(ec&&Em)return Em;throw new Error("WebAssembly is not initialized yet.")}}),zm=rt(()=>{"use strict";no(),lt=(t,e)=>{let n=ee(),i=n.lengthBytesUTF8(t)+1,r=n._malloc(i);return n.stringToUTF8(t,r,i),e.push(r),r},nc=(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")nc(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)}}}),aC=rt(()=>{"use strict";no(),zm(),Vx=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=lt(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&&nc(t.extra,"",new WeakSet,(s,a)=>{let c=lt(s,i),u=lt(a,i);e._OrtAddRunConfigEntry(n,c,u)!==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}}}),cC=rt(()=>{"use strict";no(),zm(),Px=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}`)}},Cx=t=>{switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}},Rx=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)},Dr=(t,e,n,i)=>{let r=lt(e,i),o=lt(n,i);ee()._OrtAddSessionConfigEntry(t,r,o)!==0&&K(`Can't set a session config entry: ${e} - ${n}.`)},Nx=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",Dr(t,"session.disable_quant_qdq","1",n),Dr(t,"session.disable_qdq_constant_folding","1",n),typeof r!="string"){let d=r?.deviceType;d&&Dr(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}`);Dr(t,"preferredLayout",d.preferredLayout,n)}}break;case"wasm":case"cpu":continue;default:throw new Error(`not supported execution provider: ${o}`)}let a=lt(o,n),c=s.length,u=0,l=0;if(c>0){u=ee()._malloc(c*ee().PTR_SIZE),n.push(u),l=ee()._malloc(c*ee().PTR_SIZE),n.push(l);for(let d=0;d<c;d++)ee().setValue(u+d*ee().PTR_SIZE,s[d][0],"*"),ee().setValue(l+d*ee().PTR_SIZE,s[d][1],"*")}await ee()._OrtAppendExecutionProvider(t,a,u,l,c)!==0&&K(`Can't append execution provider: ${o}.`)}},Zx=async t=>{let e=ee(),n=0,i=[],r=t||{};Rx(r);try{let o=Px(r.graphOptimizationLevel??"all"),s=Cx(r.executionMode??"sequential"),a=typeof r.logId=="string"?lt(r.logId,i):0,c=r.logSeverityLevel??2;if(!Number.isInteger(c)||c<0||c>4)throw new Error(`log severity level is not valid: ${c}`);let u=r.logVerbosityLevel??0;if(!Number.isInteger(u)||u<0||u>4)throw new Error(`log verbosity level is not valid: ${u}`);let l=typeof r.optimizedModelFilePath=="string"?lt(r.optimizedModelFilePath,i):0;if(n=e._OrtCreateSessionOptions(o,!!r.enableCpuMemArena,!!r.enableMemPattern,s,!!r.enableProfiling,0,a,c,u,l),n===0&&K("Can't create session options."),r.executionProviders&&await Nx(n,r,i),r.enableGraphCapture!==void 0){if(typeof r.enableGraphCapture!="boolean")throw new Error(`enableGraphCapture must be a boolean value: ${r.enableGraphCapture}`);Dr(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=lt(d,i);e._OrtAddFreeDimensionOverride(n,f,h)!==0&&K(`Can't set a free dimension override: ${d} - ${h}.`)}return r.extra!==void 0&&nc(r.extra,"",new WeakSet,(d,h)=>{Dr(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}}}),Hx=rt(()=>{"use strict";jn=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}`)}},rc=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}`)}},Fn=(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},Bx=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}`)}},Gx=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}`)}},Um=t=>t==="float32"||t==="float16"||t==="int32"||t==="int64"||t==="uint32"||t==="uint8"||t==="bool"||t==="uint4"||t==="int4",jm=t=>t==="float32"||t==="float16"||t==="int32"||t==="int64"||t==="uint32"||t==="uint64"||t==="int8"||t==="uint8"||t==="bool"||t==="uint4"||t==="int4",Wx=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}`)}}}),qx=rt(()=>{"use strict";Mm(),ic=async t=>{if(typeof t=="string")if(Vn)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 c=Math.ceil(i/65536);o=new WebAssembly.Memory({initial:c,maximum:c}).buffer}else throw a}let s=0;for(;;){let{done:a,value:c}=await r.read();if(a)break;let u=c.byteLength;new Uint8Array(o,s,u).set(c),s+=u}return new Uint8Array(o,0,i)}}else return t instanceof Blob?new Uint8Array(await t.arrayBuffer()):t instanceof Uint8Array?t:new Uint8Array(t)}}),uC=rt(()=>{"use strict";aC(),cC(),Hx(),no(),zm(),qx(),Dx=(t,e)=>{ee()._OrtInit(t,e)!==0&&K("Can't initialize onnxruntime.")},Jx=async t=>{Dx(t.wasm.numThreads,Gx(t.logLevel))},Kx=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")},Lr=new Map,Lx=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)}},km=(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 c=n.HEAP32[r/4];if(c===0)return[a,0];let u=n.HEAPU32[r/4+1],l=[];for(let d=0;d<u;d++){let h=Number(n.getValue(r+8+d*o,"*"));l.push(h!==0?n.UTF8ToString(h):Number(n.getValue(r+8+(d+u)*o,"*")))}return[a,c,l]}finally{n.stackRestore(i),r!==0&&n._OrtFree(r)}},Rm=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]},Yx=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]=Rm(t);let o=0,s=0,a=0,c=[],u=[],l=[];try{if([s,c]=await Zx(e),e?.externalData&&r.mountExternalData){let O=[];for(let x of e.externalData){let k=typeof x=="string"?x:x.path;O.push(ic(typeof x=="string"?x:x.data).then(z=>{r.mountExternalData(k,z)}))}await Promise.all(O)}for(let O of e?.executionProviders??[])if((typeof O=="string"?O:O.name)==="webnn"){if(r.shouldTransferToMLTensor=!1,typeof O!="string"){let x=O,k=x?.context,z=x?.gpuDevice,U=x?.deviceType,H=x?.powerPreference;k?r.currentContext=k:z?r.currentContext=await r.webnnCreateMLContext(z):r.currentContext=await r.webnnCreateMLContext({deviceType:U,powerPreference:H})}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]=Lx(o),f=!!e?.enableGraphCapture,p=[],y=[],$=[],I=[],A=[];for(let O=0;O<d;O++){let[x,k,z]=km(o,O);x===0&&K("Can't get an input name."),u.push(x);let U=r.UTF8ToString(x);p.push(U),$.push(k===0?{name:U,isTensor:!1}:{name:U,isTensor:!0,type:rc(k),shape:z})}for(let O=0;O<h;O++){let[x,k,z]=km(o,O+d);x===0&&K("Can't get an output name."),l.push(x);let U=r.UTF8ToString(x);y.push(U),I.push(k===0?{name:U,isTensor:!1}:{name:U,isTensor:!0,type:rc(k),shape:z})}return Lr.set(o,[o,u,l,null,f,!1]),[o,p,y,$,I]}catch(d){throw u.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."),c.forEach(d=>r._free(d)),r.unmountExternalData?.()}},Xx=t=>{let e=ee(),n=Lr.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(c=>e._OrtFree(c)),o.forEach(c=>e._OrtFree(c)),e._OrtReleaseSession(i)!==0&&K("Can't release session."),Lr.delete(t)},Tm=async(t,e,n,i,r,o,s=!1)=>{if(!t){e.push(0);return}let a=ee(),c=a.PTR_SIZE,u=t[0],l=t[1],d=t[3],h=d,f,p;if(u==="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 I=t[2].gpuBuffer;p=Fn(jn(u),l);{let A=a.jsepRegisterBuffer;if(!A)throw new Error('Tensor location "gpu-buffer" is not supported without using WebGPU.');f=A(i,o,I,p)}}else if(d==="ml-tensor"){let I=t[2].mlTensor;p=Fn(jn(u),l);let A=a.webnnRegisterMLTensor;if(!A)throw new Error('Tensor location "ml-tensor" is not supported without using WebNN.');f=A(i,I,jn(u),l)}else{let I=t[2];if(Array.isArray(I)){p=c*I.length,f=a._malloc(p),n.push(f);for(let A=0;A<I.length;A++){if(typeof I[A]!="string")throw new TypeError(`tensor data at index ${A} is not a string`);a.setValue(f+A*c,lt(I[A],n),"*")}}else{let A=a.webnnIsGraphInput,O=a.webnnIsGraphOutput;if(u!=="string"&&A&&O){let x=a.UTF8ToString(r);if(A(i,x)||O(i,x)){let k=jn(u);p=Fn(k,l),h="ml-tensor";let z=a.webnnCreateTemporaryTensor,U=a.webnnUploadTensor;if(!z||!U)throw new Error('Tensor location "ml-tensor" is not supported without using WebNN.');let H=await z(i,k,l);U(H,new Uint8Array(I.buffer,I.byteOffset,I.byteLength)),f=H}else p=I.byteLength,f=a._malloc(p),n.push(f),a.HEAPU8.set(new Uint8Array(I.buffer,I.byteOffset,p),f)}else p=I.byteLength,f=a._malloc(p),n.push(f),a.HEAPU8.set(new Uint8Array(I.buffer,I.byteOffset,p),f)}}let y=a.stackSave(),$=a.stackAlloc(4*l.length);try{l.forEach((A,O)=>a.setValue($+O*c,A,c===4?"i32":"i64"));let I=a._OrtCreateTensor(jn(u),f,p,$,l.length,Wx(h));I===0&&K(`Can't create tensor for input/output. session=${i}, index=${o}.`),e.push(I)}finally{a.stackRestore(y)}},Qx=async(t,e,n,i,r,o)=>{let s=ee(),a=s.PTR_SIZE,c=Lr.get(t);if(!c)throw new Error(`cannot run inference. invalid session id: ${t}`);let u=c[0],l=c[1],d=c[2],h=c[3],f=c[4],p=c[5],y=e.length,$=i.length,I=0,A=[],O=[],x=[],k=[],z=[],U=s.stackSave(),H=s.stackAlloc(y*a),ie=s.stackAlloc(y*a),Se=s.stackAlloc($*a),ge=s.stackAlloc($*a);try{[I,A]=Vx(o),or("wasm prepareInputOutputTensor");for(let L=0;L<y;L++)await Tm(n[L],O,k,t,l[e[L]],e[L],f);for(let L=0;L<$;L++)await Tm(r[L],x,k,t,d[i[L]],y+i[L],f);sr("wasm prepareInputOutputTensor");for(let L=0;L<y;L++)s.setValue(H+L*a,O[L],"*"),s.setValue(ie+L*a,l[e[L]],"*");for(let L=0;L<$;L++)s.setValue(Se+L*a,x[L],"*"),s.setValue(ge+L*a,d[i[L]],"*");s.jsepOnRunStart?.(u),s.webnnOnRunStart?.(u);let ke;ke=await s._OrtRun(u,ie,H,y,ge,$,Se,I),ke!==0&&K("failed to call OrtRun().");let Te=[],Q=[];or("wasm ProcessOutputTensor");for(let L=0;L<$;L++){let ue=Number(s.getValue(Se+L*a,"*"));if(ue===x[L]||z.includes(x[L])){Te.push(r[L]),ue!==x[L]&&s._OrtReleaseTensor(ue)!==0&&K("Can't release tensor.");continue}let st=s.stackSave(),Ze=s.stackAlloc(4*a),Hr=!1,le,Be=0;try{s._OrtGetTensorData(ue,Ze,Ze+a,Ze+2*a,Ze+3*a)!==0&&K(`Can't access output tensor data on index ${L}.`);let cu=a===4?"i32":"i64",Po=Number(s.getValue(Ze,cu));Be=s.getValue(Ze+a,"*");let dv=s.getValue(Ze+a*2,"*"),hk=Number(s.getValue(Ze+a*3,cu)),jt=[];for(let ve=0;ve<hk;ve++)jt.push(Number(s.getValue(dv+ve*a,cu)));s._OrtFree(dv)!==0&&K("Can't free memory for tensor dims.");let Ft=jt.reduce((ve,ae)=>ve*ae,1);le=rc(Po);let Xn=h?.outputPreferredLocations[i[L]];if(le==="string"){if(Xn==="gpu-buffer"||Xn==="ml-tensor")throw new Error("String tensor is not supported on GPU.");let ve=[];for(let ae=0;ae<Ft;ae++){let wt=s.getValue(Be+ae*a,"*"),fk=s.getValue(Be+(ae+1)*a,"*"),pk=ae===Ft-1?void 0:fk-wt;ve.push(s.UTF8ToString(wt,pk))}Te.push([le,jt,ve,"cpu"])}else if(Xn==="gpu-buffer"&&Ft>0){let ve=s.jsepGetBuffer;if(!ve)throw new Error('preferredLocation "gpu-buffer" is not supported without using WebGPU.');let ae=ve(Be),wt=Fn(Po,Ft);if(wt===void 0||!Um(le))throw new Error(`Unsupported data type: ${le}`);Hr=!0,Te.push([le,jt,{gpuBuffer:ae,download:s.jsepCreateDownloader(ae,wt,le),dispose:()=>{s._OrtReleaseTensor(ue)!==0&&K("Can't release tensor.")}},"gpu-buffer"])}else if(Xn==="ml-tensor"&&Ft>0){let ve=s.webnnEnsureTensor,ae=s.webnnIsGraphInputOutputTypeSupported;if(!ve||!ae)throw new Error('preferredLocation "ml-tensor" is not supported without using WebNN.');if(Fn(Po,Ft)===void 0||!jm(le))throw new Error(`Unsupported data type: ${le}`);if(!ae(t,le,!1))throw new Error(`preferredLocation "ml-tensor" for ${le} output is not supported by current WebNN Context.`);let wt=await ve(t,Be,Po,jt,!1);Hr=!0,Te.push([le,jt,{mlTensor:wt,download:s.webnnCreateMLTensorDownloader(Be,le),dispose:()=>{s.webnnReleaseTensorId(Be),s._OrtReleaseTensor(ue)}},"ml-tensor"])}else if(Xn==="ml-tensor-cpu-output"&&Ft>0){let ve=s.webnnCreateMLTensorDownloader(Be,le)(),ae=Te.length;Hr=!0,Q.push((async()=>{let wt=[ae,await ve];return s.webnnReleaseTensorId(Be),s._OrtReleaseTensor(ue),wt})()),Te.push([le,jt,[],"cpu"])}else{let ve=Bx(le),ae=new ve(Ft);new Uint8Array(ae.buffer,ae.byteOffset,ae.byteLength).set(s.HEAPU8.subarray(Be,Be+ae.byteLength)),Te.push([le,jt,ae,"cpu"])}}finally{s.stackRestore(st),le==="string"&&Be&&s._free(Be),Hr||s._OrtReleaseTensor(ue)}}h&&!f&&(s._OrtClearBoundOutputs(h.handle)!==0&&K("Can't clear bound outputs."),Lr.set(t,[u,l,d,h,f,!1]));for(let[L,ue]of await Promise.all(Q))Te[L][2]=ue;return sr("wasm ProcessOutputTensor"),Te}finally{s.webnnOnRunEnd?.(u),s.stackRestore(U),O.forEach(ke=>s._OrtReleaseTensor(ke)),x.forEach(ke=>s._OrtReleaseTensor(ke)),k.forEach(ke=>s._free(ke)),I!==0&&s._OrtReleaseRunOptions(I),A.forEach(ke=>s._free(ke))}},eS=t=>{let e=ee(),n=Lr.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)}}),cS=rt(()=>{"use strict";uC(),no(),jx(),tc=!1,Am=!1,Om=!1,tS=async()=>{if(!Am){if(tc)throw new Error("multiple calls to 'initWasm()' detected.");if(Om)throw new Error("previous call to 'initWasm()' failed.");tc=!0;try{await Fx(oe.wasm),await Jx(oe),Am=!0}catch(t){throw Om=!0,t}finally{tc=!1}}},rS=async t=>{await Kx(oe,t)},nS=async t=>Rm(t),iS=async(t,e)=>Yx(t,e),oS=async t=>{Xx(t)},sS=async(t,e,n,i,r,o)=>Qx(t,e,n,i,r,o),aS=async t=>{eS(t)}}),lC=rt(()=>{"use strict";cS(),Hx(),Mm(),qx(),Pm=(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()}`)}},Mx=t=>{switch(t[3]){case"cpu":return new tt(t[0],t[2],t[1]);case"gpu-buffer":{let e=t[0];if(!Um(e))throw new Error(`not supported data type: ${e} for deserializing GPU tensor`);let{gpuBuffer:n,download:i,dispose:r}=t[2];return tt.fromGpuBuffer(n,{dataType:e,dims:t[1],download:i,dispose:r})}case"ml-tensor":{let e=t[0];if(!jm(e))throw new Error(`not supported data type: ${e} for deserializing MLTensor tensor`);let{mlTensor:n,download:i,dispose:r}=t[2];return tt.fromMLTensor(n,{dataType:e,dims:t[1],download:i,dispose:r})}default:throw new Error(`invalid data location: ${t[3]}`)}},uS=class{async fetchModelAndCopyToWasmMemory(t){return nS(await ic(t))}async loadModel(t,e){nr();let n;typeof t=="string"?Vn?n=await ic(t):n=await this.fetchModelAndCopyToWasmMemory(t):n=t,[this.sessionId,this.inputNames,this.outputNames,this.inputMetadata,this.outputMetadata]=await iS(n,e),ir()}async dispose(){return oS(this.sessionId)}async run(t,e,n){nr();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)=>Pm(d,()=>`input "${this.inputNames[r[h]]}"`)),c=o.map((d,h)=>d?Pm(d,()=>`output "${this.outputNames[s[h]]}"`):null),u=await sS(this.sessionId,r,a,s,c,n),l={};for(let d=0;d<u.length;d++)l[this.outputNames[s[d]]]=o[d]??Mx(u[d]);return ir(),l}startProfiling(){}endProfiling(){aS(this.sessionId)}}}),lS={};iC(lS,{OnnxruntimeWebAssemblyBackend:()=>Dm,initializeFlags:()=>Nm,wasmBackend:()=>dS});dC=rt(()=>{"use strict";cS(),lC(),Nm=()=>{(typeof oe.wasm.initTimeout!="number"||oe.wasm.initTimeout<0)&&(oe.wasm.initTimeout=0);let t=oe.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.`),oe.wasm.simd=!1),typeof oe.wasm.proxy!="boolean"&&(oe.wasm.proxy=!1),typeof oe.wasm.trace!="boolean"&&(oe.wasm.trace=!1),typeof oe.wasm.numThreads!="number"||!Number.isInteger(oe.wasm.numThreads)||oe.wasm.numThreads<=0)if(typeof self<"u"&&!self.crossOriginIsolated)oe.wasm.numThreads=1;else{let e=typeof navigator>"u"?Cm("node:os").cpus().length:navigator.hardwareConcurrency;oe.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},Dm=class{async init(t){Nm(),await tS(),await rS(t)}async createInferenceSessionHandler(t,e){let n=new uS;return await n.loadModel(t,e),n}},dS=new Dm}),hC="1.26.0",fC=$m;{let t=(dC(),sC(lS)).wasmBackend;zn("cpu",t,10),zn("wasm",t,10)}Object.defineProperty(oe.versions,"web",{value:hC,enumerable:!0})});import{existsSync as pC}from"node:fs";import{createRequire as mC}from"node:module";import{dirname as gC,join as vC,sep as pS}from"node:path";import{fileURLToPath as yC,pathToFileURL as _C}from"node:url";async function oc(){let t=await Promise.resolve().then(()=>(fS(),hS));return t.default??t}function sc(t,e){t.env.wasm.numThreads=1,t.env.wasm.wasmPaths=$C(e)}function bC(t){return[new URL("./",t),new URL("../",t)].map(e=>yC(e))}function $C(t=import.meta.url){let e=bC(t);try{e.push(gC(mC(t).resolve("onnxruntime-web")))}catch{}let n=null;for(let i of e){let r=mS.filter(o=>!pC(vC(i,o)));if(r.length===0)return wC(i);r.length<mS.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 ('${gS}' + '${vS}') not found beside the bundle or in node_modules`)}function wC(t){return _C(t.endsWith(pS)?t:t+pS).href}var gS,vS,mS,Fm=g(()=>{"use strict";gS="ort-wasm-simd-threaded.wasm",vS="ort-wasm-simd-threaded.mjs",mS=[gS,vS]});import{existsSync as xC}from"node:fs";import{fileURLToPath as SC}from"node:url";function Vm(t,e){return[new URL(`../../assets/${t}`,e),new URL(`./assets/${t}`,e),new URL(`../assets/${t}`,e)].map(n=>SC(n))}function ac(t,e,n,i={}){let r=i.baseUrl??n,o=i.exists??xC,s="envPath"in i?i.envPath:process.env[e];if(s&&o(s))return s;let a=Vm(t,r);for(let c of a)if(o(c))return c;throw new Error(`model '${t}' not found. Tried: ${a.join(", ")}. Set ${e} to override.`)}var Zm=g(()=>{"use strict"});function Bm(t={}){return ac(yS,_S,import.meta.url,t)}var yS,_S,Gm=g(()=>{"use strict";Zm();yS="silero_vad.onnx",_S="JARVIS_SILERO_VAD_MODEL_PATH"});var Zn,io,bS,Mr,Wm=g(()=>{"use strict";Fm();Gm();Zn=512,io=64,bS=256,Mr=class{modelPath;sessionPromise=null;session=null;ort=null;disposed=!1;pending=new Int16Array(Zn);pendingLen=0;state=new Float32Array(bS);context=new Float32Array(io);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(bS),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(Zn-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<Zn)break;this.pendingLen=0,r.push(await this.inferWindow(n,i))}return r}async inferWindow(e,n){let i=new Float32Array(io+Zn);i.set(this.context,0);for(let a=0;a<Zn;a++)i[io+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-io));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 oc();this.ort=e,sc(e);let n=this.modelPath??Bm(),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 EC(t){let e=1;for(;e<t;)e<<=1;return e}var Hm,cc,$S=g(()=>{"use strict";Hm=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 c=e[s];e[s]=e[a],e[a]=c;let u=n[s];n[s]=n[a],n[a]=u}}for(let s=2;s<=r;s<<=1){let a=s>>1,c=r/s;for(let u=0;u<r;u+=s)for(let l=0;l<a;l++){let d=l*c,h=this.cos[d],f=i?this.sin[d]:-this.sin[d],p=u+l,y=p+a,$=e[y]*h-n[y]*f,I=e[y]*f+n[y]*h;e[y]=e[p]-$,n[y]=n[p]-I,e[p]+=$,n[p]+=I}}if(i){let s=1/r;for(let a=0;a<r;a++)e[a]*=s,n[a]*=s}}};cc=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=EC(2*e-1),this.fft=new Hm(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 c=e[a];o[a]=c*this.chirpCos[a],s[a]=-c*this.chirpSin[a]}this.fft.transform(o,s,!1);for(let a=0;a<r;a++){let c=o[a],u=s[a],l=this.bRe[a],d=this.bIm[a];o[a]=c*l-u*d,s[a]=c*d+u*l}this.fft.transform(o,s,!0);for(let a=0;a<this.bins;a++){let c=o[a],u=s[a];n[a]=c*c+u*u}}}});function SS(t){let i=27/Math.log(6.4);return t>=1e3?15+Math.log(t/1e3)*i:3*t/200}function TC(t){let i=Math.log(6.4)/27;return t>=15?1e3*Math.exp(i*(t-15)):200*t/3}function ES(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 AC(){let t=SS(0),e=SS(qm/2),n=ES(t,e,Dt+2),i=new Float64Array(Dt+2);for(let a=0;a<n.length;a++)i[a]=TC(n[a]);let r=ES(0,qm/2,oo),o=new Float64Array(Dt+1);for(let a=0;a<Dt+1;a++)o[a]=i[a+1]-i[a];let s=[];for(let a=0;a<Dt;a++){let c=2/(i[a+2]-i[a]),u=new Float64Array(oo),l=oo,d=0;for(let h=0;h<oo;h++){let f=-(i[a]-r[h])/o[a],p=(i[a+2]-r[h])/o[a+1],y=Math.max(0,Math.min(f,p))*c;u[h]=y,y>0&&(h<l&&(l=h),d=h+1)}l>d&&(l=d=0),s.push({lo:l,hi:d,weights:u.slice(l,d)})}return s}function OC(){let t=new Float64Array(dt);for(let e=0;e<dt;e++)t[e]=.5-.5*Math.cos(2*Math.PI*e/dt);return t}var qm,dt,IC,Dt,oo,wS,kC,xS,Ve,zr,Jm,so,uc=g(()=>{"use strict";$S();qm=16e3,dt=400,IC=160,Dt=80,oo=(dt>>1)+1,wS=1e-10,kC=1e-7,xS=32768,Ve=qm*8,zr=800,Jm=Dt;so=class{hann=OC();filters=AC();spectrum=new cc(dt);padded=new Float64Array(Ve+dt);frame=new Float64Array(dt);power=new Float64Array(oo);logBuf=new Float64Array(Dt*zr);fromPcm16(e){return this.window(e),this.normalize(),this.reflectPad(),this.melSpectrogram()}window(e){let n=this.padded,i=dt/2,r=e.length;if(r>=Ve){let o=r-Ve;for(let s=0;s<Ve;s++)n[i+s]=e[o+s]/xS}else{let o=Ve-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]/xS}}normalize(){let e=this.padded,n=dt/2,i=Ve,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 c=e[n+a]-r;o+=c*c}o/=i;let s=1/Math.sqrt(o+kC);for(let a=0;a<i;a++)e[n+a]=(e[n+a]-r)*s}reflectPad(){let e=this.padded,n=dt/2,i=Ve;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<zr;l++){let d=l*IC;for(let h=0;h<dt;h++)n[h]=e[d+h]*r[h];this.spectrum.computePower(n,i);for(let h=0;h<Dt;h++){let{lo:f,hi:p,weights:y}=o[h],$=0;for(let I=f;I<p;I++)$+=y[I-f]*i[I];s[h*zr+l]=Math.log10($<wS?wS:$)}}let a=-1/0;for(let l of s)l>a&&(a=l);let c=a-8,u=new Float32Array(Dt*zr);for(let l=0;l<s.length;l++){let d=s[l]<c?c:s[l];u[l]=(d+4)/4}return u}}});function PC(t){return t.toLowerCase().replace(/[.,!?;:]+$/g,"").trim()}function lc(t,e){return e.some(n=>kS(t,n))}function kS(t,e){if(!t.endsWith(e))return!1;let n=t.length-e.length-1;return n<0||t[n]===" "}function CC(t,e){let n=RC(t);return n===""?null:e.find(i=>NC(n,i))??null}function RC(t){let e=/^.*[.!?\u3002\uFF01\uFF1F]\s+/s.exec(t);return(e?t.slice(e[0].length):t).trim()}function NC(t,e){for(let n=t.indexOf(e);n!==-1;n=t.indexOf(e,n+1)){let i=n===0||!IS(t[n-1]),r=n+e.length===t.length||!IS(t[n+e.length]);if(i&&r)return!0}return!1}function IS(t){return/[a-z0-9']/.test(t)}var dc,Km,ao,Ym=g(()=>{"use strict";Er();Er();dc={silenceEnergyThreshold:Qt,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"]},Km="semantic",ao=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={...dc,...n},this.classifier=i??new Vi(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=PC(e),lc(this.lastNormPartial,this.config.commitCues)){this.commit("lexical");return}let n=this.strongHoldCue,i=CC(this.lastNormPartial,this.config.strongHoldCues);if(i===null&&n!==null&&this.partialStability==="redecode"&&!this.pendingVetoClear){this.pendingVetoClear=!0,this.telemetry?.strongHoldClearDebounced?.(n),lc(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(kS(this.lastNormPartial,this.strongHoldCue)){this.enterHeld(this.strongHoldCue);return}this.holdFloor();return}if(lc(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:lc(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===Km)){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 TS,co,Xm=g(()=>{"use strict";uc();Ym();TS={...dc,commitThreshold:.65,holdThreshold:.35},co=class extends ao{smartConfig;inference;buffer=new Int16Array(Ve*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={...TS,...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(c){this.smartDisposed||this.telemetry?.evaluatorFailed?.(this.clock.now()-o,c);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(Km),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>Ve?n-Ve:0,o=n-r;if(this.bufferLen+o>this.buffer.length){let s=Math.min(this.bufferLen,Ve);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-Ve);return this.buffer.slice(e,this.bufferLen)}}});function Qm(t={}){return ac(AS,OS,import.meta.url,t)}var AS,OS,eg=g(()=>{"use strict";Zm();AS="smart-turn-v3.1-cpu.onnx",OS="JARVIS_SMART_TURN_MODEL_PATH"});var uo,tg=g(()=>{"use strict";uc();Fm();eg();uo=class{logMel;modelPath;sessionPromise=null;session=null;ort=null;disposed=!1;constructor(e={}){this.logMel=e.logMel??new so,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,Jm,zr]),s=await n.run({input_features:o});if(this.disposed)throw new Error("SmartTurnRunner is disposed");let a=n.outputNames[0],u=s[a].data[0];if(!Number.isFinite(u))throw new Error("smart-turn produced a non-finite output");return u<0?0:u>1?1:u}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 oc();this.ort=e,sc(e);let n=this.modelPath??Qm(),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 ZC(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(`
|
|
147
|
-
`)}function
|
|
157
|
+
`,Rt=class extends Error{status;constructor(e,r){super(e),this.status=r,this.name="AddresseeEvaluatorError"}},Mn=class{key;fetchImpl;timeoutMs;constructor(e,r=fetch,i=AC){this.key=e,this.fetchImpl=r,this.timeoutMs=i}async evaluate(e,r,i){let n={model:TC,max_tokens:CC,temperature:0,stop_sequences:RC,system:NC,messages:[{role:"user",content:LC(e)},{role:"assistant",content:sx}]},o;try{o=await this.fetchImpl(OC,{method:"POST",headers:{"x-api-key":this.key,"anthropic-version":PC,"content-type":"application/json"},body:JSON.stringify(n),signal:AbortSignal.any([r,AbortSignal.timeout(i?.timeoutMs??this.timeoutMs)])})}catch(a){throw a instanceof Error&&(a.name==="TimeoutError"||a.name==="AbortError")?a:new Rt(be(a,this.key))}if(!o.ok)throw new Rt(`addressee evaluator request failed (HTTP ${o.status})`,o.status);let s;try{s=await o.json()}catch{throw new Rt("addressee evaluator response body was not JSON")}return MC(s)}}});var zC,UC,ax,eo,wm=g(()=>{"use strict";zC=new Set([".","!","?"]),UC=new Set([",",";",":"]),ax={minClauseLength:12},eo=class{buffer="";minClauseLength;constructor(e=ax){this.minClauseLength=e.minClauseLength}push(e){this.buffer+=e;let r=[];for(let i=this.findBoundary();i!==-1;i=this.findBoundary()){let n=this.buffer.slice(0,i+1).trim();this.buffer=this.buffer.slice(i+1).replace(/^\s+/,""),n.length>0&&r.push(n)}return r}flush(){let e=this.buffer.trim();return this.buffer="",e.length>0?[e]:[]}findBoundary(){for(let e=0;e<this.buffer.length;e++){let r=this.buffer[e];if(r===`
|
|
158
|
+
`)return e;let i=e+1<this.buffer.length?this.buffer[e+1]:"";if(i!==""&&/\s/.test(i)&&(zC.has(r)||UC.has(r)&&e+1>=this.minClauseLength))return e}return-1}}});var nc,Rr,zn,jC,cx,xm=g(()=>{nc=new Map,Rr=[],zn=(t,e,r)=>{if(e&&typeof e.init=="function"&&typeof e.createInferenceSessionHandler=="function"){let i=nc.get(t);if(i===void 0)nc.set(t,{backend:e,priority:r});else{if(i.priority>r)return;if(i.priority===r&&i.backend!==e)throw new Error(`cannot register backend "${t}" using priority ${r}`)}if(r>=0){let n=Rr.indexOf(t);n!==-1&&Rr.splice(n,1);for(let o=0;o<Rr.length;o++)if(nc.get(Rr[o]).priority<=r){Rr.splice(o,0,t);return}Rr.push(t)}return}throw new TypeError("not a valid backend")},jC=async t=>{let e=nc.get(t);if(!e)return"backend not found.";if(e.initialized)return e.backend;if(e.aborted)return e.error;{let r=!!e.initPromise;try{return r||(e.initPromise=e.backend.init(t)),await e.initPromise,e.initialized=!0,e.backend}catch(i){return r||(e.error=`${i}`,e.aborted=!0),e.error}finally{delete e.initPromise}}},cx=async t=>{let e=t.executionProviders||[],r=e.map(c=>typeof c=="string"?c:c.name),i=r.length===0?Rr:r,n,o=[],s=new Set;for(let c of i){let u=await jC(c);typeof u=="string"?o.push({name:c,err:u}):(n||(n=u),n===u&&s.add(c))}if(!n)throw new Error(`no available backend found. ERR: ${o.map(c=>`[${c.name}] ${c.err}`).join(", ")}`);for(let{name:c,err:u}of o)r.includes(c)&&console.warn(`removing requested execution provider "${c}" from session options because it is not available: ${u}`);let a=e.filter(c=>s.has(typeof c=="string"?c:c.name));return[n,new Proxy(t,{get:(c,u)=>u==="executionProviders"?a:Reflect.get(c,u)})]}});var ux=g(()=>{xm()});var lx,dx=g(()=>{lx="1.26.0"});var hx,fe,Sm=g(()=>{dx();hx="warning",fe={wasm:{},webgl:{},webgpu:{},versions:{common:lx},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}`);hx=t}},get logLevel(){return hx}};Object.defineProperty(fe,"logLevel",{enumerable:!0})});var se,fx=g(()=>{Sm();se=fe});var px,mx,gx=g(()=>{px=(t,e)=>{let r=typeof document<"u"?document.createElement("canvas"):new OffscreenCanvas(1,1);r.width=t.dims[3],r.height=t.dims[2];let i=r.getContext("2d");if(i!=null){let n,o;e?.tensorLayout!==void 0&&e.tensorLayout==="NHWC"?(n=t.dims[2],o=t.dims[3]):(n=t.dims[3],o=t.dims[2]);let s=e?.format!==void 0?e.format:"RGB",a=e?.norm,c,u;a===void 0||a.mean===void 0?c=[255,255,255,255]:typeof a.mean=="number"?c=[a.mean,a.mean,a.mean,a.mean]:(c=[a.mean[0],a.mean[1],a.mean[2],0],a.mean[3]!==void 0&&(c[3]=a.mean[3])),a===void 0||a.bias===void 0?u=[0,0,0,0]:typeof a.bias=="number"?u=[a.bias,a.bias,a.bias,a.bias]:(u=[a.bias[0],a.bias[1],a.bias[2],0],a.bias[3]!==void 0&&(u[3]=a.bias[3]));let l=o*n,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 y=0;y<o;y++)for(let b=0;b<n;b++){let k=(t.data[d++]-u[0])*c[0],T=(t.data[h++]-u[1])*c[1],A=(t.data[f++]-u[2])*c[2],$=p===-1?255:(t.data[p++]-u[3])*c[3];i.fillStyle="rgba("+k+","+T+","+A+","+$+")",i.fillRect(b,y,1,1)}if("toDataURL"in r)return r.toDataURL();throw new Error("toDataURL is not supported")}else throw new Error("Can not access image data")},mx=(t,e)=>{let r=typeof document<"u"?document.createElement("canvas").getContext("2d"):new OffscreenCanvas(1,1).getContext("2d"),i;if(r!=null){let n,o,s;e?.tensorLayout!==void 0&&e.tensorLayout==="NHWC"?(n=t.dims[2],o=t.dims[1],s=t.dims[3]):(n=t.dims[3],o=t.dims[2],s=t.dims[1]);let a=e!==void 0&&e.format!==void 0?e.format:"RGB",c=e?.norm,u,l;c===void 0||c.mean===void 0?u=[255,255,255,255]:typeof c.mean=="number"?u=[c.mean,c.mean,c.mean,c.mean]:(u=[c.mean[0],c.mean[1],c.mean[2],255],c.mean[3]!==void 0&&(u[3]=c.mean[3])),c===void 0||c.bias===void 0?l=[0,0,0,0]:typeof c.bias=="number"?l=[c.bias,c.bias,c.bias,c.bias]:(l=[c.bias[0],c.bias[1],c.bias[2],0],c.bias[3]!==void 0&&(l[3]=c.bias[3]));let d=o*n;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,y=2,b=3,k=0,T=d,A=d*2,$=-1;a==="RGBA"?(k=0,T=d,A=d*2,$=d*3):a==="RGB"?(k=0,T=d,A=d*2):a==="RBG"&&(k=0,A=d,T=d*2),i=r.createImageData(n,o);for(let E=0;E<o*n;f+=h,p+=h,y+=h,b+=h,E++)i.data[f]=(t.data[k++]-l[0])*u[0],i.data[p]=(t.data[T++]-l[1])*u[1],i.data[y]=(t.data[A++]-l[2])*u[2],i.data[b]=$===-1?255:(t.data[$++]-l[3])*u[3]}else throw new Error("Can not access image data");return i}});var Em,vx,yx,_x,bx,$x,wx=g(()=>{ic();Em=(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:r,width:i}=e,n=e.norm??{mean:255,bias:0},o,s;typeof n.mean=="number"?o=[n.mean,n.mean,n.mean,n.mean]:o=[n.mean[0],n.mean[1],n.mean[2],n.mean[3]??255],typeof n.bias=="number"?s=[n.bias,n.bias,n.bias,n.bias]:s=[n.bias[0],n.bias[1],n.bias[2],n.bias[3]??0];let a=e.format!==void 0?e.format:"RGBA",c=e.tensorFormat!==void 0&&e.tensorFormat!==void 0?e.tensorFormat:"RGB",u=r*i,l=c==="RGBA"?new Float32Array(u*4):new Float32Array(u*3),d=4,h=0,f=1,p=2,y=3,b=0,k=u,T=u*2,A=-1;a==="RGB"&&(d=3,h=0,f=1,p=2,y=-1),c==="RGBA"?A=u*3:c==="RBG"?(b=0,T=u,k=u*2):c==="BGR"&&(T=0,k=u,b=u*2);for(let E=0;E<u;E++,h+=d,p+=d,f+=d,y+=d)l[b++]=(t[h]+s[0])/o[0],l[k++]=(t[f]+s[1])/o[1],l[T++]=(t[p]+s[2])/o[2],A!==-1&&y!==-1&&(l[A++]=(t[y]+s[3])/o[3]);return c==="RGBA"?new $e("float32",l,[1,4,r,i]):new $e("float32",l,[1,3,r,i])},vx=async(t,e)=>{let r=typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement,i=typeof ImageData<"u"&&t instanceof ImageData,n=typeof ImageBitmap<"u"&&t instanceof ImageBitmap,o=typeof t=="string",s,a=e??{},c=()=>{if(typeof document<"u")return document.createElement("canvas");if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(1,1);throw new Error("Canvas is not supported")},u=l=>typeof HTMLCanvasElement<"u"&&l instanceof HTMLCanvasElement||l instanceof OffscreenCanvas?l.getContext("2d"):null;if(r){let l=c();l.width=t.width,l.height=t.height;let d=u(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=c();h.width=d,h.height=l;let f=u(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(n){if(e===void 0)throw new Error("Please provide image config with format for Imagebitmap");let l=c();l.width=t.width,l.height=t.height;let d=u(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,Em(s,a)}else throw new Error("Can not access image data")}else{if(o)return new Promise((l,d)=>{let h=c(),f=u(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 y=f.getImageData(0,0,h.width,h.height);a.height=h.height,a.width=h.width,l(Em(y.data,a))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(s!==void 0)return Em(s,a);throw new Error("Input data provided is not supported - aborted tensor creation")},yx=(t,e)=>{let{width:r,height:i,download:n,dispose:o}=e,s=[1,i,r,4];return new $e({location:"texture",type:"float32",texture:t,dims:s,download:n,dispose:o})},_x=(t,e)=>{let{dataType:r,dims:i,download:n,dispose:o}=e;return new $e({location:"gpu-buffer",type:r??"float32",gpuBuffer:t,dims:i,download:n,dispose:o})},bx=(t,e)=>{let{dataType:r,dims:i,download:n,dispose:o}=e;return new $e({location:"ml-tensor",type:r??"float32",mlTensor:t,dims:i,download:n,dispose:o})},$x=(t,e,r)=>new $e({location:"cpu-pinned",type:t,data:e,dims:r??[e.length]})});var Dr,to,xx,Sx,Ex=g(()=>{Dr=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),to=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]),xx=!1,Sx=()=>{if(!xx){xx=!0;let t=typeof BigInt64Array<"u"&&BigInt64Array.from,e=typeof BigUint64Array<"u"&&BigUint64Array.from,r=globalThis.Float16Array,i=typeof r<"u"&&r.from;t&&(Dr.set("int64",BigInt64Array),to.set(BigInt64Array,"int64")),e&&(Dr.set("uint64",BigUint64Array),to.set(BigUint64Array,"uint64")),i?(Dr.set("float16",r),to.set(r,"float16")):Dr.set("float16",Uint16Array)}}});var kx,Ix,Tx=g(()=>{ic();kx=t=>{let e=1;for(let r=0;r<t.length;r++){let i=t[r];if(typeof i!="number"||!Number.isSafeInteger(i))throw new TypeError(`dims[${r}] must be an integer, got: ${i}`);if(i<0)throw new RangeError(`dims[${r}] must be a non-negative integer, got: ${i}`);e*=i}return e},Ix=(t,e)=>{switch(t.location){case"cpu":return new $e(t.type,t.data,e);case"cpu-pinned":return new $e({location:"cpu-pinned",data:t.data,type:t.type,dims:e});case"texture":return new $e({location:"texture",texture:t.texture,type:t.type,dims:e});case"gpu-buffer":return new $e({location:"gpu-buffer",gpuBuffer:t.gpuBuffer,type:t.type,dims:e});case"ml-tensor":return new $e({location:"ml-tensor",mlTensor:t.mlTensor,type:t.type,dims:e});default:throw new Error(`tensorReshape: tensor location ${t.location} is not supported`)}}});var $e,ic=g(()=>{gx();wx();Ex();Tx();$e=class{constructor(e,r,i){Sx();let n,o;if(typeof e=="object"&&"location"in e)switch(this.dataLocation=e.location,n=e.type,o=e.dims,e.location){case"cpu-pinned":{let a=Dr.get(n);if(!a)throw new TypeError(`unsupported type "${n}" 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(n!=="float32")throw new TypeError(`unsupported type "${n}" to create tensor from texture`);this.gpuTextureData=e.texture,this.downloader=e.download,this.disposer=e.dispose;break}case"gpu-buffer":{if(n!=="float32"&&n!=="float16"&&n!=="int32"&&n!=="int64"&&n!=="uint32"&&n!=="uint8"&&n!=="bool"&&n!=="uint4"&&n!=="int4")throw new TypeError(`unsupported type "${n}" to create tensor from gpu buffer`);this.gpuBufferData=e.gpuBuffer,this.downloader=e.download,this.disposer=e.dispose;break}case"ml-tensor":{if(n!=="float32"&&n!=="float16"&&n!=="int32"&&n!=="int64"&&n!=="uint32"&&n!=="uint64"&&n!=="int8"&&n!=="uint8"&&n!=="bool"&&n!=="uint4"&&n!=="int4")throw new TypeError(`unsupported type "${n}" 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,c;if(typeof e=="string")if(n=e,c=i,e==="string"){if(!Array.isArray(r))throw new TypeError("A string tensor's data must be a string array.");a=r}else{let u=Dr.get(e);if(u===void 0)throw new TypeError(`Unsupported tensor type: ${e}.`);if(Array.isArray(r)){if(e==="float16"&&u===Uint16Array||e==="uint4"||e==="int4")throw new TypeError(`Creating a ${e} tensor from number array is not supported. Please use ${u.name} as data.`);e==="uint64"||e==="int64"?a=u.from(r,BigInt):a=u.from(r)}else if(r instanceof u)a=r;else if(r instanceof Uint8ClampedArray)if(e==="uint8")a=Uint8Array.from(r);else throw new TypeError("A Uint8ClampedArray tensor's data must be type of uint8");else if(e==="float16"&&r instanceof Uint16Array&&u!==Uint16Array)a=new globalThis.Float16Array(r.buffer,r.byteOffset,r.length);else throw new TypeError(`A ${n} tensor's data must be type of ${u}`)}else if(c=r,Array.isArray(e)){if(e.length===0)throw new TypeError("Tensor type cannot be inferred from an empty array.");let u=typeof e[0];if(u==="string")n="string",a=e;else if(u==="boolean")n="bool",a=Uint8Array.from(e);else throw new TypeError(`Invalid element type of data array: ${u}.`)}else if(e instanceof Uint8ClampedArray)n="uint8",a=Uint8Array.from(e);else{let u=to.get(e.constructor);if(u===void 0)throw new TypeError(`Unsupported type for tensor data: ${e.constructor}.`);n=u,a=e}if(c===void 0)c=[a.length];else if(!Array.isArray(c))throw new TypeError("A tensor's dims must be a number array");o=c,this.cpuData=a,this.dataLocation="cpu"}let s=kx(o);if(this.cpuData&&s!==this.cpuData.length&&!((n==="uint4"||n==="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=n,this.dims=o,this.size=s}static async fromImage(e,r){return vx(e,r)}static fromTexture(e,r){return yx(e,r)}static fromGpuBuffer(e,r){return _x(e,r)}static fromMLTensor(e,r){return bx(e,r)}static fromPinnedBuffer(e,r,i){return $x(e,r,i)}toDataURL(e){return px(this,e)}toImageData(e){return mx(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 r=await this.downloader();return this.downloader=void 0,this.dataLocation="cpu",this.cpuData=r,e&&this.disposer&&(this.disposer(),this.disposer=void 0),r}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 Ix(this,e)}}});var tt,km=g(()=>{ic();tt=$e});var Im,Ax,ir,or,sr,ar,Tm=g(()=>{Sm();Im=(t,e)=>{(typeof fe.trace>"u"?!fe.wasm.trace:!fe.trace)||console.timeStamp(`${t}::ORT::${e}`)},Ax=(t,e)=>{let r=new Error().stack?.split(/\r\n|\r|\n/g)||[],i=!1;for(let n=0;n<r.length;n++){if(i&&!r[n].includes("TRACE_FUNC")){let o=`FUNC_${t}::${r[n].trim().split(" ")[1]}`;e&&(o+=`::${e}`),Im("CPU",o);return}r[n].includes("TRACE_FUNC")&&(i=!0)}},ir=t=>{(typeof fe.trace>"u"?!fe.wasm.trace:!fe.trace)||Ax("BEGIN",t)},or=t=>{(typeof fe.trace>"u"?!fe.wasm.trace:!fe.trace)||Ax("END",t)},sr=t=>{(typeof fe.trace>"u"?!fe.wasm.trace:!fe.trace)||console.time(`ORT::${t}`)},ar=t=>{(typeof fe.trace>"u"?!fe.wasm.trace:!fe.trace)||console.timeEnd(`ORT::${t}`)}});var oc,Ox=g(()=>{xm();km();Tm();oc=class t{constructor(e){this.handler=e}async run(e,r,i){ir(),sr("InferenceSession.run");let n={},o={};if(typeof e!="object"||e===null||e instanceof tt||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 r=="object"){if(r===null)throw new TypeError("Unexpected argument[1]: cannot be null.");if(r instanceof tt)throw new TypeError("'fetches' cannot be a Tensor");if(Array.isArray(r)){if(r.length===0)throw new TypeError("'fetches' cannot be an empty array.");s=!1;for(let u of r){if(typeof u!="string")throw new TypeError("'fetches' must be a string array or an object.");if(this.outputNames.indexOf(u)===-1)throw new RangeError(`'fetches' contains invalid output name: ${u}.`);n[u]=null}if(typeof i=="object"&&i!==null)o=i;else if(typeof i<"u")throw new TypeError("'options' must be an object.")}else{let u=!1,l=Object.getOwnPropertyNames(r);for(let d of this.outputNames)if(l.indexOf(d)!==-1){let h=r[d];(h===null||h instanceof tt)&&(u=!0,s=!1,n[d]=h)}if(u){if(typeof i=="object"&&i!==null)o=i;else if(typeof i<"u")throw new TypeError("'options' must be an object.")}else o=r}}else if(typeof r<"u")throw new TypeError("Unexpected argument[1]: must be 'fetches' or 'options'.");for(let u of this.inputNames)if(typeof e[u]>"u")throw new Error(`input '${u}' is missing in 'feeds'.`);if(s)for(let u of this.outputNames)n[u]=null;let a=await this.handler.run(e,n,o),c={};for(let u in a)if(Object.hasOwnProperty.call(a,u)){let l=a[u];l instanceof tt?c[u]=l:c[u]=new tt(l.type,l.data,l.dims)}return ar("InferenceSession.run"),or(),c}async release(){return this.handler.dispose()}static async create(e,r,i,n){ir(),sr("InferenceSession.create");let o,s={};if(typeof e=="string"){if(o=e,typeof r=="object"&&r!==null)s=r;else if(typeof r<"u")throw new TypeError("'options' must be an object.")}else if(e instanceof Uint8Array){if(o=e,typeof r=="object"&&r!==null)s=r;else if(typeof r<"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 r=="object"&&r!==null)s=r;else if(typeof r=="number"){if(d=r,!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 n=="object"&&n!==null)s=n;else if(typeof n<"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 r<"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,c]=await cx(s),u=await a.createInferenceSessionHandler(o,c);return ar("InferenceSession.create"),or(),new t(u)}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 Px,Cx=g(()=>{Ox();Px=oc});var Rx=g(()=>{});var Dx=g(()=>{});var Nx=g(()=>{});var Lx=g(()=>{});var Am={};Je(Am,{InferenceSession:()=>Px,TRACE:()=>Im,TRACE_EVENT_BEGIN:()=>sr,TRACE_EVENT_END:()=>ar,TRACE_FUNC_BEGIN:()=>ir,TRACE_FUNC_END:()=>or,Tensor:()=>tt,env:()=>se,registerBackend:()=>zn});var cr=g(()=>{ux();fx();Cx();km();Rx();Dx();Tm();Nx();Lx()});var IS={};Je(IS,{InferenceSession:()=>Px,TRACE:()=>Im,TRACE_EVENT_BEGIN:()=>sr,TRACE_EVENT_END:()=>ar,TRACE_FUNC_BEGIN:()=>ir,TRACE_FUNC_END:()=>or,Tensor:()=>tt,default:()=>eR,env:()=>se,registerBackend:()=>zn});import{createRequire as FC}from"module";var Un,Bm,VC,ZC,BC,jm,rt,GC,WC,HC,Vn,Gm,Om,Mx,zx,Dt,Qx,Pm,Ux,jx,Fx,Vx,Cm,eS,tS,Rm,sc,ro,Dm,Zx,Bx,Gx,rS,te,no,lt,uc,K,Wm,nS,qC,Wx,Hx,qx,Nr,Jx,iS,JC,jn,cc,Fn,oS,sS,Hm,qm,aS,cS,lc,uS,Kx,lS,dS,Lr,Yx,Nm,Fm,hS,fS,Lm,pS,mS,KC,ac,Mm,zm,gS,vS,yS,_S,bS,$S,wS,xS,Um,Xx,SS,YC,ES,Vm,Zm,kS,XC,QC,eR,TS=g(()=>{cr();cr();cr();cr();cr();cr();cr();Un=FC(import.meta.url),Bm=Object.defineProperty,VC=Object.getOwnPropertyDescriptor,ZC=Object.getOwnPropertyNames,BC=Object.prototype.hasOwnProperty,jm=(t=>typeof Un<"u"?Un:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof Un<"u"?Un:e)[r]}):t)(function(t){if(typeof Un<"u")return Un.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),rt=(t,e)=>()=>(t&&(e=t(t=0)),e),GC=(t,e)=>{for(var r in e)Bm(t,r,{get:e[r],enumerable:!0})},WC=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ZC(e))!BC.call(t,n)&&n!==r&&Bm(t,n,{get:()=>e[n],enumerable:!(i=VC(e,n))||i.enumerable});return t},HC=t=>WC(Bm({},"__esModule",{value:!0}),t),Gm=rt(()=>{"use strict";Vn=!!(typeof process<"u"&&process.versions&&process.versions.node)}),tS=rt(()=>{"use strict";Gm(),Om=Vn||typeof location>"u"?void 0:location.origin,Mx=import.meta.url>"file:"&&import.meta.url<"file;",zx=()=>{if(!Vn){if(Mx){let t=URL;return new URL(new t("ort.node.min.mjs",import.meta.url).href,Om).href}return import.meta.url}},Dt=zx(),Qx=()=>{if(Dt&&!Dt.startsWith("blob:"))return Dt.substring(0,Dt.lastIndexOf("/")+1)},Pm=(t,e)=>{try{let r=e??Dt;return(r?new URL(t,r):new URL(t)).origin===Om}catch{return!1}},Ux=(t,e)=>{let r=e??Dt;try{return(r?new URL(t,r):new URL(t)).href}catch{return}},jx=(t,e)=>`${e??"./"}${t}`,Fx=async t=>{let e=await(await fetch(t,{credentials:"same-origin"})).blob();return URL.createObjectURL(e)},Vx=async t=>(await import(t)).default,Cm=void 0,eS=async(t,e,r,i)=>{let n=Cm&&!(t||e);if(n)if(Dt)n=Pm(Dt)||i&&!r;else if(i&&!r)n=!0;else throw new Error("cannot determine the script source URL.");if(n)return[void 0,Cm];{let o="ort-wasm-simd-threaded.mjs",s=t??Ux(o,e),a=!Vn&&r&&s&&!Pm(s,e),c=a?await Fx(s):s??jx(o,e);return[a?c:void 0,await Vx(c)]}}}),no=rt(()=>{"use strict";tS(),sc=!1,ro=!1,Dm=!1,Zx=()=>{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}},Bx=()=>{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}},Gx=()=>{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}},rS=async t=>{if(sc)return Promise.resolve();if(ro)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(Dm)throw new Error("previous call to 'initializeWebAssembly()' failed.");ro=!0;let e=t.initTimeout,r=t.numThreads;if(t.simd!==!1){if(t.simd==="relaxed"){if(!Gx())throw new Error("Relaxed WebAssembly SIMD is not supported in the current environment.")}else if(!Bx())throw new Error("WebAssembly SIMD is not supported in the current environment.")}let i=Zx();r>1&&!i&&(typeof self<"u"&&!self.crossOriginIsolated&&console.warn("env.wasm.numThreads is set to "+r+", 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=r=1);let n=t.wasmPaths,o=typeof n=="string"?n:void 0,s=n?.mjs,a=s?.href??s,c=n?.wasm,u=c?.href??c,l=t.wasmBinary,[d,h]=await eS(a,o,r>1,!!l||!!u),f=!1,p=[];if(e>0&&p.push(new Promise(y=>{setTimeout(()=>{f=!0,y()},e)})),p.push(new Promise((y,b)=>{let k={numThreads:r};if(l)k.wasmBinary=l,k.locateFile=T=>T;else if(u||o)k.locateFile=T=>u??o+T;else if(a&&a.indexOf("blob:")!==0)k.locateFile=T=>new URL(T,a).href;else if(d){let T=Qx();T&&(k.locateFile=A=>T+A)}h(k).then(T=>{ro=!1,sc=!0,Rm=T,y(),d&&URL.revokeObjectURL(d)},T=>{ro=!1,Dm=!0,b(T)})})),await Promise.race(p),f)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},te=()=>{if(sc&&Rm)return Rm;throw new Error("WebAssembly is not initialized yet.")}}),Wm=rt(()=>{"use strict";no(),lt=(t,e)=>{let r=te(),i=r.lengthBytesUTF8(t)+1,n=r._malloc(i);return r.stringToUTF8(t,n,i),e.push(n),n},uc=(t,e,r,i)=>{if(typeof t=="object"&&t!==null){if(r.has(t))throw new Error("Circular reference in options");r.add(t)}Object.entries(t).forEach(([n,o])=>{let s=e?e+n:n;if(typeof o=="object")uc(o,s+".",r,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=te(),r=e.stackSave();try{let i=e.PTR_SIZE,n=e.stackAlloc(2*i);e._OrtGetLastError(n,n+i);let o=Number(e.getValue(n,i===4?"i32":"i64")),s=e.getValue(n+i,"*"),a=s?e.UTF8ToString(s):"";throw new Error(`${t} ERROR_CODE: ${o}, ERROR_MESSAGE: ${a}`)}finally{e.stackRestore(r)}}}),qC=rt(()=>{"use strict";no(),Wm(),nS=t=>{let e=te(),r=0,i=[],n=t||{};try{if(t?.logSeverityLevel===void 0)n.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)n.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&&(n.terminate=!1);let o=0;return t?.tag!==void 0&&(o=lt(t.tag,i)),r=e._OrtCreateRunOptions(n.logSeverityLevel,n.logVerbosityLevel,!!n.terminate,o),r===0&&K("Can't create run options."),t?.extra!==void 0&&uc(t.extra,"",new WeakSet,(s,a)=>{let c=lt(s,i),u=lt(a,i);e._OrtAddRunConfigEntry(r,c,u)!==0&&K(`Can't set a run config entry: ${s} - ${a}.`)}),[r,i]}catch(o){throw r!==0&&e._OrtReleaseRunOptions(r),i.forEach(s=>e._free(s)),o}}}),JC=rt(()=>{"use strict";no(),Wm(),Wx=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}`)}},Hx=t=>{switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}},qx=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(r=>(typeof r=="string"?r:r.name)==="webgpu")&&(t.enableMemPattern=!1)},Nr=(t,e,r,i)=>{let n=lt(e,i),o=lt(r,i);te()._OrtAddSessionConfigEntry(t,n,o)!==0&&K(`Can't set a session config entry: ${e} - ${r}.`)},Jx=async(t,e,r)=>{let i=e.executionProviders;for(let n of i){let o=typeof n=="string"?n:n.name,s=[];switch(o){case"webnn":if(o="WEBNN",Nr(t,"session.disable_quant_qdq","1",r),Nr(t,"session.disable_qdq_constant_folding","1",r),typeof n!="string"){let d=n?.deviceType;d&&Nr(t,"deviceType",d,r)}break;case"webgpu":if(o="JS",typeof n!="string"){let d=n;if(d?.preferredLayout){if(d.preferredLayout!=="NCHW"&&d.preferredLayout!=="NHWC")throw new Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${d.preferredLayout}`);Nr(t,"preferredLayout",d.preferredLayout,r)}}break;case"wasm":case"cpu":continue;default:throw new Error(`not supported execution provider: ${o}`)}let a=lt(o,r),c=s.length,u=0,l=0;if(c>0){u=te()._malloc(c*te().PTR_SIZE),r.push(u),l=te()._malloc(c*te().PTR_SIZE),r.push(l);for(let d=0;d<c;d++)te().setValue(u+d*te().PTR_SIZE,s[d][0],"*"),te().setValue(l+d*te().PTR_SIZE,s[d][1],"*")}await te()._OrtAppendExecutionProvider(t,a,u,l,c)!==0&&K(`Can't append execution provider: ${o}.`)}},iS=async t=>{let e=te(),r=0,i=[],n=t||{};qx(n);try{let o=Wx(n.graphOptimizationLevel??"all"),s=Hx(n.executionMode??"sequential"),a=typeof n.logId=="string"?lt(n.logId,i):0,c=n.logSeverityLevel??2;if(!Number.isInteger(c)||c<0||c>4)throw new Error(`log severity level is not valid: ${c}`);let u=n.logVerbosityLevel??0;if(!Number.isInteger(u)||u<0||u>4)throw new Error(`log verbosity level is not valid: ${u}`);let l=typeof n.optimizedModelFilePath=="string"?lt(n.optimizedModelFilePath,i):0;if(r=e._OrtCreateSessionOptions(o,!!n.enableCpuMemArena,!!n.enableMemPattern,s,!!n.enableProfiling,0,a,c,u,l),r===0&&K("Can't create session options."),n.executionProviders&&await Jx(r,n,i),n.enableGraphCapture!==void 0){if(typeof n.enableGraphCapture!="boolean")throw new Error(`enableGraphCapture must be a boolean value: ${n.enableGraphCapture}`);Nr(r,"enableGraphCapture",n.enableGraphCapture.toString(),i)}if(n.freeDimensionOverrides)for(let[d,h]of Object.entries(n.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=lt(d,i);e._OrtAddFreeDimensionOverride(r,f,h)!==0&&K(`Can't set a free dimension override: ${d} - ${h}.`)}return n.extra!==void 0&&uc(n.extra,"",new WeakSet,(d,h)=>{Nr(r,d,h,i)}),[r,i]}catch(o){throw r!==0&&e._OrtReleaseSessionOptions(r)!==0&&K("Can't release session options."),i.forEach(s=>e._free(s)),o}}}),cS=rt(()=>{"use strict";jn=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}`)}},cc=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}`)}},Fn=(t,e)=>{let r=[-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((n,o)=>n*o,1);return r>0?Math.ceil(i*r):void 0},oS=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}`)}},sS=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}`)}},Hm=t=>t==="float32"||t==="float16"||t==="int32"||t==="int64"||t==="uint32"||t==="uint8"||t==="bool"||t==="uint4"||t==="int4",qm=t=>t==="float32"||t==="float16"||t==="int32"||t==="int64"||t==="uint32"||t==="uint64"||t==="int8"||t==="uint8"||t==="bool"||t==="uint4"||t==="int4",aS=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}`)}}}),uS=rt(()=>{"use strict";Gm(),lc=async t=>{if(typeof t=="string")if(Vn)try{let{readFile:e}=jm("node:fs/promises");return new Uint8Array(await e(t))}catch(e){if(e.code==="ERR_FS_FILE_TOO_LARGE"){let{createReadStream:r}=jm("node:fs"),i=r(t),n=[];for await(let o of i)n.push(o);return new Uint8Array(Buffer.concat(n))}throw e}else{let e=await fetch(t);if(!e.ok)throw new Error(`failed to load external data file: ${t}`);let r=e.headers.get("Content-Length"),i=r?parseInt(r,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 n=e.body.getReader(),o;try{o=new ArrayBuffer(i)}catch(a){if(a instanceof RangeError){let c=Math.ceil(i/65536);o=new WebAssembly.Memory({initial:c,maximum:c}).buffer}else throw a}let s=0;for(;;){let{done:a,value:c}=await n.read();if(a)break;let u=c.byteLength;new Uint8Array(o,s,u).set(c),s+=u}return new Uint8Array(o,0,i)}}else return t instanceof Blob?new Uint8Array(await t.arrayBuffer()):t instanceof Uint8Array?t:new Uint8Array(t)}}),KC=rt(()=>{"use strict";qC(),JC(),cS(),no(),Wm(),uS(),Kx=(t,e)=>{te()._OrtInit(t,e)!==0&&K("Can't initialize onnxruntime.")},lS=async t=>{Kx(t.wasm.numThreads,sS(t.logLevel))},dS=async(t,e)=>{te().asyncInit?.();let r=t.webgpu.adapter;if(e==="webgpu"){if(typeof navigator>"u"||!navigator.gpu)throw new Error("WebGPU is not supported in current environment");if(r){if(typeof r.limits!="object"||typeof r.features!="object"||typeof r.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 n=t.webgpu.forceFallbackAdapter;if(n!==void 0&&typeof n!="boolean")throw new Error(`Invalid forceFallbackAdapter setting: "${n}"`);if(r=await navigator.gpu.requestAdapter({powerPreference:i,forceFallbackAdapter:n}),!r)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")},Lr=new Map,Yx=t=>{let e=te(),r=e.stackSave();try{let i=e.PTR_SIZE,n=e.stackAlloc(2*i);e._OrtGetInputOutputCount(t,n,n+i)!==0&&K("Can't get session input/output count.");let o=i===4?"i32":"i64";return[Number(e.getValue(n,o)),Number(e.getValue(n+i,o))]}finally{e.stackRestore(r)}},Nm=(t,e)=>{let r=te(),i=r.stackSave(),n=0;try{let o=r.PTR_SIZE,s=r.stackAlloc(2*o);r._OrtGetInputOutputMetadata(t,e,s,s+o)!==0&&K("Can't get session input/output metadata.");let a=Number(r.getValue(s,"*"));n=Number(r.getValue(s+o,"*"));let c=r.HEAP32[n/4];if(c===0)return[a,0];let u=r.HEAPU32[n/4+1],l=[];for(let d=0;d<u;d++){let h=Number(r.getValue(n+8+d*o,"*"));l.push(h!==0?r.UTF8ToString(h):Number(r.getValue(n+8+(d+u)*o,"*")))}return[a,c,l]}finally{r.stackRestore(i),n!==0&&r._OrtFree(n)}},Fm=t=>{let e=te(),r=e._malloc(t.byteLength);if(r===0)throw new Error(`Can't create a session. failed to allocate a buffer of size ${t.byteLength}.`);return e.HEAPU8.set(t,r),[r,t.byteLength]},hS=async(t,e)=>{let r,i,n=te();Array.isArray(t)?[r,i]=t:t.buffer===n.HEAPU8.buffer?[r,i]=[t.byteOffset,t.byteLength]:[r,i]=Fm(t);let o=0,s=0,a=0,c=[],u=[],l=[];try{if([s,c]=await iS(e),e?.externalData&&n.mountExternalData){let A=[];for(let $ of e.externalData){let E=typeof $=="string"?$:$.path;A.push(lc(typeof $=="string"?$:$.data).then(z=>{n.mountExternalData(E,z)}))}await Promise.all(A)}for(let A of e?.executionProviders??[])if((typeof A=="string"?A:A.name)==="webnn"){if(n.shouldTransferToMLTensor=!1,typeof A!="string"){let $=A,E=$?.context,z=$?.gpuDevice,M=$?.deviceType,H=$?.powerPreference;E?n.currentContext=E:z?n.currentContext=await n.webnnCreateMLContext(z):n.currentContext=await n.webnnCreateMLContext({deviceType:M,powerPreference:H})}else n.currentContext=await n.webnnCreateMLContext();break}o=await n._OrtCreateSession(r,i,s),n.webgpuOnCreateSession?.(o),o===0&&K("Can't create a session."),n.jsepOnCreateSession?.(),n.currentContext&&(n.webnnRegisterMLContext(o,n.currentContext),n.currentContext=void 0,n.shouldTransferToMLTensor=!0);let[d,h]=Yx(o),f=!!e?.enableGraphCapture,p=[],y=[],b=[],k=[],T=[];for(let A=0;A<d;A++){let[$,E,z]=Nm(o,A);$===0&&K("Can't get an input name."),u.push($);let M=n.UTF8ToString($);p.push(M),b.push(E===0?{name:M,isTensor:!1}:{name:M,isTensor:!0,type:cc(E),shape:z})}for(let A=0;A<h;A++){let[$,E,z]=Nm(o,A+d);$===0&&K("Can't get an output name."),l.push($);let M=n.UTF8ToString($);y.push(M),k.push(E===0?{name:M,isTensor:!1}:{name:M,isTensor:!0,type:cc(E),shape:z})}return Lr.set(o,[o,u,l,null,f,!1]),[o,p,y,b,k]}catch(d){throw u.forEach(h=>n._OrtFree(h)),l.forEach(h=>n._OrtFree(h)),a!==0&&n._OrtReleaseBinding(a)!==0&&K("Can't release IO binding."),o!==0&&n._OrtReleaseSession(o)!==0&&K("Can't release session."),d}finally{n._free(r),s!==0&&n._OrtReleaseSessionOptions(s)!==0&&K("Can't release session options."),c.forEach(d=>n._free(d)),n.unmountExternalData?.()}},fS=t=>{let e=te(),r=Lr.get(t);if(!r)throw new Error(`cannot release session. invalid session id: ${t}`);let[i,n,o,s,a]=r;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),n.forEach(c=>e._OrtFree(c)),o.forEach(c=>e._OrtFree(c)),e._OrtReleaseSession(i)!==0&&K("Can't release session."),Lr.delete(t)},Lm=async(t,e,r,i,n,o,s=!1)=>{if(!t){e.push(0);return}let a=te(),c=a.PTR_SIZE,u=t[0],l=t[1],d=t[3],h=d,f,p;if(u==="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=Fn(jn(u),l);{let T=a.jsepRegisterBuffer;if(!T)throw new Error('Tensor location "gpu-buffer" is not supported without using WebGPU.');f=T(i,o,k,p)}}else if(d==="ml-tensor"){let k=t[2].mlTensor;p=Fn(jn(u),l);let T=a.webnnRegisterMLTensor;if(!T)throw new Error('Tensor location "ml-tensor" is not supported without using WebNN.');f=T(i,k,jn(u),l)}else{let k=t[2];if(Array.isArray(k)){p=c*k.length,f=a._malloc(p),r.push(f);for(let T=0;T<k.length;T++){if(typeof k[T]!="string")throw new TypeError(`tensor data at index ${T} is not a string`);a.setValue(f+T*c,lt(k[T],r),"*")}}else{let T=a.webnnIsGraphInput,A=a.webnnIsGraphOutput;if(u!=="string"&&T&&A){let $=a.UTF8ToString(n);if(T(i,$)||A(i,$)){let E=jn(u);p=Fn(E,l),h="ml-tensor";let z=a.webnnCreateTemporaryTensor,M=a.webnnUploadTensor;if(!z||!M)throw new Error('Tensor location "ml-tensor" is not supported without using WebNN.');let H=await z(i,E,l);M(H,new Uint8Array(k.buffer,k.byteOffset,k.byteLength)),f=H}else p=k.byteLength,f=a._malloc(p),r.push(f),a.HEAPU8.set(new Uint8Array(k.buffer,k.byteOffset,p),f)}else p=k.byteLength,f=a._malloc(p),r.push(f),a.HEAPU8.set(new Uint8Array(k.buffer,k.byteOffset,p),f)}}let y=a.stackSave(),b=a.stackAlloc(4*l.length);try{l.forEach((T,A)=>a.setValue(b+A*c,T,c===4?"i32":"i64"));let k=a._OrtCreateTensor(jn(u),f,p,b,l.length,aS(h));k===0&&K(`Can't create tensor for input/output. session=${i}, index=${o}.`),e.push(k)}finally{a.stackRestore(y)}},pS=async(t,e,r,i,n,o)=>{let s=te(),a=s.PTR_SIZE,c=Lr.get(t);if(!c)throw new Error(`cannot run inference. invalid session id: ${t}`);let u=c[0],l=c[1],d=c[2],h=c[3],f=c[4],p=c[5],y=e.length,b=i.length,k=0,T=[],A=[],$=[],E=[],z=[],M=s.stackSave(),H=s.stackAlloc(y*a),oe=s.stackAlloc(y*a),Se=s.stackAlloc(b*a),ge=s.stackAlloc(b*a);try{[k,T]=nS(o),sr("wasm prepareInputOutputTensor");for(let L=0;L<y;L++)await Lm(r[L],A,E,t,l[e[L]],e[L],f);for(let L=0;L<b;L++)await Lm(n[L],$,E,t,d[i[L]],y+i[L],f);ar("wasm prepareInputOutputTensor");for(let L=0;L<y;L++)s.setValue(H+L*a,A[L],"*"),s.setValue(oe+L*a,l[e[L]],"*");for(let L=0;L<b;L++)s.setValue(Se+L*a,$[L],"*"),s.setValue(ge+L*a,d[i[L]],"*");s.jsepOnRunStart?.(u),s.webnnOnRunStart?.(u);let Te;Te=await s._OrtRun(u,oe,H,y,ge,b,Se,k),Te!==0&&K("failed to call OrtRun().");let Ae=[],Q=[];sr("wasm ProcessOutputTensor");for(let L=0;L<b;L++){let le=Number(s.getValue(Se+L*a,"*"));if(le===$[L]||z.includes($[L])){Ae.push(n[L]),le!==$[L]&&s._OrtReleaseTensor(le)!==0&&K("Can't release tensor.");continue}let st=s.stackSave(),Ze=s.stackAlloc(4*a),Hr=!1,de,Be=0;try{s._OrtGetTensorData(le,Ze,Ze+a,Ze+2*a,Ze+3*a)!==0&&K(`Can't access output tensor data on index ${L}.`);let pu=a===4?"i32":"i64",Po=Number(s.getValue(Ze,pu));Be=s.getValue(Ze+a,"*");let _v=s.getValue(Ze+a*2,"*"),TI=Number(s.getValue(Ze+a*3,pu)),jt=[];for(let ve=0;ve<TI;ve++)jt.push(Number(s.getValue(_v+ve*a,pu)));s._OrtFree(_v)!==0&&K("Can't free memory for tensor dims.");let Ft=jt.reduce((ve,ce)=>ve*ce,1);de=cc(Po);let Xn=h?.outputPreferredLocations[i[L]];if(de==="string"){if(Xn==="gpu-buffer"||Xn==="ml-tensor")throw new Error("String tensor is not supported on GPU.");let ve=[];for(let ce=0;ce<Ft;ce++){let wt=s.getValue(Be+ce*a,"*"),AI=s.getValue(Be+(ce+1)*a,"*"),OI=ce===Ft-1?void 0:AI-wt;ve.push(s.UTF8ToString(wt,OI))}Ae.push([de,jt,ve,"cpu"])}else if(Xn==="gpu-buffer"&&Ft>0){let ve=s.jsepGetBuffer;if(!ve)throw new Error('preferredLocation "gpu-buffer" is not supported without using WebGPU.');let ce=ve(Be),wt=Fn(Po,Ft);if(wt===void 0||!Hm(de))throw new Error(`Unsupported data type: ${de}`);Hr=!0,Ae.push([de,jt,{gpuBuffer:ce,download:s.jsepCreateDownloader(ce,wt,de),dispose:()=>{s._OrtReleaseTensor(le)!==0&&K("Can't release tensor.")}},"gpu-buffer"])}else if(Xn==="ml-tensor"&&Ft>0){let ve=s.webnnEnsureTensor,ce=s.webnnIsGraphInputOutputTypeSupported;if(!ve||!ce)throw new Error('preferredLocation "ml-tensor" is not supported without using WebNN.');if(Fn(Po,Ft)===void 0||!qm(de))throw new Error(`Unsupported data type: ${de}`);if(!ce(t,de,!1))throw new Error(`preferredLocation "ml-tensor" for ${de} output is not supported by current WebNN Context.`);let wt=await ve(t,Be,Po,jt,!1);Hr=!0,Ae.push([de,jt,{mlTensor:wt,download:s.webnnCreateMLTensorDownloader(Be,de),dispose:()=>{s.webnnReleaseTensorId(Be),s._OrtReleaseTensor(le)}},"ml-tensor"])}else if(Xn==="ml-tensor-cpu-output"&&Ft>0){let ve=s.webnnCreateMLTensorDownloader(Be,de)(),ce=Ae.length;Hr=!0,Q.push((async()=>{let wt=[ce,await ve];return s.webnnReleaseTensorId(Be),s._OrtReleaseTensor(le),wt})()),Ae.push([de,jt,[],"cpu"])}else{let ve=oS(de),ce=new ve(Ft);new Uint8Array(ce.buffer,ce.byteOffset,ce.byteLength).set(s.HEAPU8.subarray(Be,Be+ce.byteLength)),Ae.push([de,jt,ce,"cpu"])}}finally{s.stackRestore(st),de==="string"&&Be&&s._free(Be),Hr||s._OrtReleaseTensor(le)}}h&&!f&&(s._OrtClearBoundOutputs(h.handle)!==0&&K("Can't clear bound outputs."),Lr.set(t,[u,l,d,h,f,!1]));for(let[L,le]of await Promise.all(Q))Ae[L][2]=le;return ar("wasm ProcessOutputTensor"),Ae}finally{s.webnnOnRunEnd?.(u),s.stackRestore(M),A.forEach(Te=>s._OrtReleaseTensor(Te)),$.forEach(Te=>s._OrtReleaseTensor(Te)),E.forEach(Te=>s._free(Te)),k!==0&&s._OrtReleaseRunOptions(k),T.forEach(Te=>s._free(Te))}},mS=t=>{let e=te(),r=Lr.get(t);if(!r)throw new Error("invalid session id");let i=r[0],n=e._OrtEndProfiling(i);n===0&&K("Can't get an profile file name."),e._OrtFree(n)}}),xS=rt(()=>{"use strict";KC(),no(),tS(),ac=!1,Mm=!1,zm=!1,gS=async()=>{if(!Mm){if(ac)throw new Error("multiple calls to 'initWasm()' detected.");if(zm)throw new Error("previous call to 'initWasm()' failed.");ac=!0;try{await rS(se.wasm),await lS(se),Mm=!0}catch(t){throw zm=!0,t}finally{ac=!1}}},vS=async t=>{await dS(se,t)},yS=async t=>Fm(t),_S=async(t,e)=>hS(t,e),bS=async t=>{fS(t)},$S=async(t,e,r,i,n,o)=>pS(t,e,r,i,n,o),wS=async t=>{mS(t)}}),YC=rt(()=>{"use strict";xS(),cS(),Gm(),uS(),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()}`)}},Xx=t=>{switch(t[3]){case"cpu":return new tt(t[0],t[2],t[1]);case"gpu-buffer":{let e=t[0];if(!Hm(e))throw new Error(`not supported data type: ${e} for deserializing GPU tensor`);let{gpuBuffer:r,download:i,dispose:n}=t[2];return tt.fromGpuBuffer(r,{dataType:e,dims:t[1],download:i,dispose:n})}case"ml-tensor":{let e=t[0];if(!qm(e))throw new Error(`not supported data type: ${e} for deserializing MLTensor tensor`);let{mlTensor:r,download:i,dispose:n}=t[2];return tt.fromMLTensor(r,{dataType:e,dims:t[1],download:i,dispose:n})}default:throw new Error(`invalid data location: ${t[3]}`)}},SS=class{async fetchModelAndCopyToWasmMemory(t){return yS(await lc(t))}async loadModel(t,e){ir();let r;typeof t=="string"?Vn?r=await lc(t):r=await this.fetchModelAndCopyToWasmMemory(t):r=t,[this.sessionId,this.inputNames,this.outputNames,this.inputMetadata,this.outputMetadata]=await _S(r,e),or()}async dispose(){return bS(this.sessionId)}async run(t,e,r){ir();let i=[],n=[];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),n.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[n[h]]}"`)),c=o.map((d,h)=>d?Um(d,()=>`output "${this.outputNames[s[h]]}"`):null),u=await $S(this.sessionId,n,a,s,c,r),l={};for(let d=0;d<u.length;d++)l[this.outputNames[s[d]]]=o[d]??Xx(u[d]);return or(),l}startProfiling(){}endProfiling(){wS(this.sessionId)}}}),ES={};GC(ES,{OnnxruntimeWebAssemblyBackend:()=>Zm,initializeFlags:()=>Vm,wasmBackend:()=>kS});XC=rt(()=>{"use strict";xS(),YC(),Vm=()=>{(typeof se.wasm.initTimeout!="number"||se.wasm.initTimeout<0)&&(se.wasm.initTimeout=0);let t=se.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.`),se.wasm.simd=!1),typeof se.wasm.proxy!="boolean"&&(se.wasm.proxy=!1),typeof se.wasm.trace!="boolean"&&(se.wasm.trace=!1),typeof se.wasm.numThreads!="number"||!Number.isInteger(se.wasm.numThreads)||se.wasm.numThreads<=0)if(typeof self<"u"&&!self.crossOriginIsolated)se.wasm.numThreads=1;else{let e=typeof navigator>"u"?jm("node:os").cpus().length:navigator.hardwareConcurrency;se.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},Zm=class{async init(t){Vm(),await gS(),await vS(t)}async createInferenceSessionHandler(t,e){let r=new SS;return await r.loadModel(t,e),r}},kS=new Zm}),QC="1.26.0",eR=Am;{let t=(XC(),HC(ES)).wasmBackend;zn("cpu",t,10),zn("wasm",t,10)}Object.defineProperty(se.versions,"web",{value:QC,enumerable:!0})});import{existsSync as tR}from"node:fs";import{createRequire as rR}from"node:module";import{dirname as nR,join as iR,sep as AS}from"node:path";import{fileURLToPath as oR,pathToFileURL as sR}from"node:url";async function dc(){let t=await Promise.resolve().then(()=>(TS(),IS));return t.default??t}function hc(t,e){t.env.wasm.numThreads=1,t.env.wasm.wasmPaths=cR(e)}function aR(t){return[new URL("./",t),new URL("../",t)].map(e=>oR(e))}function cR(t=import.meta.url){let e=aR(t);try{e.push(nR(rR(t).resolve("onnxruntime-web")))}catch{}let r=null;for(let i of e){let n=OS.filter(o=>!tR(iR(i,o)));if(n.length===0)return uR(i);n.length<OS.length&&r===null&&(r={dir:i,missing:n})}throw r!==null?new Error(`ort-web WASM runtime at '${r.dir}' is missing '${r.missing.join("', '")}' - the .wasm and its .mjs glue must be copied together`):new Error(`ort-web WASM runtime ('${PS}' + '${CS}') not found beside the bundle or in node_modules`)}function uR(t){return sR(t.endsWith(AS)?t:t+AS).href}var PS,CS,OS,Jm=g(()=>{"use strict";PS="ort-wasm-simd-threaded.wasm",CS="ort-wasm-simd-threaded.mjs",OS=[PS,CS]});import{existsSync as lR}from"node:fs";import{fileURLToPath as dR}from"node:url";function Km(t,e){return[new URL(`../../assets/${t}`,e),new URL(`./assets/${t}`,e),new URL(`../assets/${t}`,e)].map(r=>dR(r))}function fc(t,e,r,i={}){let n=i.baseUrl??r,o=i.exists??lR,s="envPath"in i?i.envPath:process.env[e];if(s&&o(s))return s;let a=Km(t,n);for(let c of a)if(o(c))return c;throw new Error(`model '${t}' not found. Tried: ${a.join(", ")}. Set ${e} to override.`)}var Ym=g(()=>{"use strict"});function Xm(t={}){return fc(RS,DS,import.meta.url,t)}var RS,DS,Qm=g(()=>{"use strict";Ym();RS="silero_vad.onnx",DS="JARVIS_SILERO_VAD_MODEL_PATH"});var Zn,io,NS,Mr,eg=g(()=>{"use strict";Jm();Qm();Zn=512,io=64,NS=256,Mr=class{modelPath;sessionPromise=null;session=null;ort=null;disposed=!1;pending=new Int16Array(Zn);pendingLen=0;state=new Float32Array(NS);context=new Float32Array(io);chain=Promise.resolve();constructor(e={}){this.modelPath=e.modelPath}process(e){if(this.disposed)return Promise.reject(new Error("SileroVadRunner is disposed"));let r=this.chain.then(()=>this.runWindows(e));return this.chain=r.then(()=>{},()=>{}),r}reset(){this.chain=this.chain.then(()=>{this.pendingLen=0,this.state=new Float32Array(NS),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 r=await this.ensureSession(),i=this.ort;if(!i)throw new Error("onnxruntime-web failed to load");let n=[],o=0;for(;;){let s=Math.min(Zn-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<Zn)break;this.pendingLen=0,n.push(await this.inferWindow(r,i))}return n}async inferWindow(e,r){let i=new Float32Array(io+Zn);i.set(this.context,0);for(let a=0;a<Zn;a++)i[io+a]=this.pending[a]/32768;let n=await e.run({input:new r.Tensor("float32",i,[1,i.length]),state:new r.Tensor("float32",this.state,[2,1,128]),sr:new r.Tensor("int64",BigInt64Array.from([16000n]),[])});if(this.disposed)throw new Error("SileroVadRunner is disposed");let o=n[e.outputNames[0]].data;this.state=n[e.outputNames[1]].data,this.context.set(i.subarray(i.length-io));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 dc();this.ort=e,hc(e);let r=this.modelPath??Xm(),i=await e.InferenceSession.create(r,{executionProviders:["wasm"],graphOptimizationLevel:"all",executionMode:"sequential"});if(this.disposed)throw await i.release(),new Error("SileroVadRunner is disposed");return this.session=i,i}}});function hR(t){let e=1;for(;e<t;)e<<=1;return e}var tg,pc,LS=g(()=>{"use strict";tg=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 r=Math.log2(e);this.rev=new Uint32Array(e);for(let n=0;n<e;n++){let o=0;for(let s=0;s<r;s++)o|=(n>>s&1)<<r-1-s;this.rev[n]=o}let i=e>>1;this.cos=new Float64Array(i),this.sin=new Float64Array(i);for(let n=0;n<i;n++){let o=2*Math.PI*n/e;this.cos[n]=Math.cos(o),this.sin[n]=Math.sin(o)}}transform(e,r,i){let n=this.size,o=this.rev;for(let s=0;s<n;s++){let a=o[s];if(a>s){let c=e[s];e[s]=e[a],e[a]=c;let u=r[s];r[s]=r[a],r[a]=u}}for(let s=2;s<=n;s<<=1){let a=s>>1,c=n/s;for(let u=0;u<n;u+=s)for(let l=0;l<a;l++){let d=l*c,h=this.cos[d],f=i?this.sin[d]:-this.sin[d],p=u+l,y=p+a,b=e[y]*h-r[y]*f,k=e[y]*f+r[y]*h;e[y]=e[p]-b,r[y]=r[p]-k,e[p]+=b,r[p]+=k}}if(i){let s=1/n;for(let a=0;a<n;a++)e[a]*=s,r[a]*=s}}};pc=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=hR(2*e-1),this.fft=new tg(this.m),this.chirpCos=new Float64Array(e),this.chirpSin=new Float64Array(e);for(let r=0;r<e;r++){let i=r*r%(2*e),n=Math.PI*i/e;this.chirpCos[r]=Math.cos(n),this.chirpSin[r]=Math.sin(n)}this.bRe=new Float64Array(this.m),this.bIm=new Float64Array(this.m);for(let r=0;r<e;r++){let i=this.chirpCos[r],n=this.chirpSin[r];this.bRe[r]=i,this.bIm[r]=n,r!==0&&(this.bRe[this.m-r]=i,this.bIm[this.m-r]=n)}this.fft.transform(this.bRe,this.bIm,!1),this.aRe=new Float64Array(this.m),this.aIm=new Float64Array(this.m)}computePower(e,r){let{n:i,m:n,aRe:o,aIm:s}=this;o.fill(0),s.fill(0);for(let a=0;a<i;a++){let c=e[a];o[a]=c*this.chirpCos[a],s[a]=-c*this.chirpSin[a]}this.fft.transform(o,s,!1);for(let a=0;a<n;a++){let c=o[a],u=s[a],l=this.bRe[a],d=this.bIm[a];o[a]=c*l-u*d,s[a]=c*d+u*l}this.fft.transform(o,s,!0);for(let a=0;a<this.bins;a++){let c=o[a],u=s[a];r[a]=c*c+u*u}}}});function US(t){let i=27/Math.log(6.4);return t>=1e3?15+Math.log(t/1e3)*i:3*t/200}function mR(t){let i=Math.log(6.4)/27;return t>=15?1e3*Math.exp(i*(t-15)):200*t/3}function jS(t,e,r){let i=new Float64Array(r),n=r>1?(e-t)/(r-1):0;for(let o=0;o<r;o++)i[o]=t+o*n;return r>1&&(i[r-1]=e),i}function gR(){let t=US(0),e=US(rg/2),r=jS(t,e,Nt+2),i=new Float64Array(Nt+2);for(let a=0;a<r.length;a++)i[a]=mR(r[a]);let n=jS(0,rg/2,oo),o=new Float64Array(Nt+1);for(let a=0;a<Nt+1;a++)o[a]=i[a+1]-i[a];let s=[];for(let a=0;a<Nt;a++){let c=2/(i[a+2]-i[a]),u=new Float64Array(oo),l=oo,d=0;for(let h=0;h<oo;h++){let f=-(i[a]-n[h])/o[a],p=(i[a+2]-n[h])/o[a+1],y=Math.max(0,Math.min(f,p))*c;u[h]=y,y>0&&(h<l&&(l=h),d=h+1)}l>d&&(l=d=0),s.push({lo:l,hi:d,weights:u.slice(l,d)})}return s}function vR(){let t=new Float64Array(dt);for(let e=0;e<dt;e++)t[e]=.5-.5*Math.cos(2*Math.PI*e/dt);return t}var rg,dt,fR,Nt,oo,MS,pR,zS,Ve,zr,ng,so,mc=g(()=>{"use strict";LS();rg=16e3,dt=400,fR=160,Nt=80,oo=(dt>>1)+1,MS=1e-10,pR=1e-7,zS=32768,Ve=rg*8,zr=800,ng=Nt;so=class{hann=vR();filters=gR();spectrum=new pc(dt);padded=new Float64Array(Ve+dt);frame=new Float64Array(dt);power=new Float64Array(oo);logBuf=new Float64Array(Nt*zr);fromPcm16(e){return this.window(e),this.normalize(),this.reflectPad(),this.melSpectrogram()}window(e){let r=this.padded,i=dt/2,n=e.length;if(n>=Ve){let o=n-Ve;for(let s=0;s<Ve;s++)r[i+s]=e[o+s]/zS}else{let o=Ve-n;for(let s=0;s<o;s++)r[i+s]=0;for(let s=0;s<n;s++)r[i+o+s]=e[s]/zS}}normalize(){let e=this.padded,r=dt/2,i=Ve,n=0;for(let a=0;a<i;a++)n+=e[r+a];n/=i;let o=0;for(let a=0;a<i;a++){let c=e[r+a]-n;o+=c*c}o/=i;let s=1/Math.sqrt(o+pR);for(let a=0;a<i;a++)e[r+a]=(e[r+a]-n)*s}reflectPad(){let e=this.padded,r=dt/2,i=Ve;for(let n=0;n<r;n++)e[n]=e[r+(r-n)],e[r+i+n]=e[r+(i-2-n)]}melSpectrogram(){let{padded:e,frame:r,power:i,hann:n,filters:o,logBuf:s}=this;for(let l=0;l<zr;l++){let d=l*fR;for(let h=0;h<dt;h++)r[h]=e[d+h]*n[h];this.spectrum.computePower(r,i);for(let h=0;h<Nt;h++){let{lo:f,hi:p,weights:y}=o[h],b=0;for(let k=f;k<p;k++)b+=y[k-f]*i[k];s[h*zr+l]=Math.log10(b<MS?MS:b)}}let a=-1/0;for(let l of s)l>a&&(a=l);let c=a-8,u=new Float32Array(Nt*zr);for(let l=0;l<s.length;l++){let d=s[l]<c?c:s[l];u[l]=(d+4)/4}return u}}});function yR(t){return t.toLowerCase().replace(/[.,!?;:]+$/g,"").trim()}function gc(t,e){return e.some(r=>VS(t,r))}function VS(t,e){if(!t.endsWith(e))return!1;let r=t.length-e.length-1;return r<0||t[r]===" "}function _R(t,e){let r=bR(t);return r===""?null:e.find(i=>$R(r,i))??null}function bR(t){let e=/^.*[.!?\u3002\uFF01\uFF1F]\s+/s.exec(t);return(e?t.slice(e[0].length):t).trim()}function $R(t,e){for(let r=t.indexOf(e);r!==-1;r=t.indexOf(e,r+1)){let i=r===0||!FS(t[r-1]),n=r+e.length===t.length||!FS(t[r+e.length]);if(i&&n)return!0}return!1}function FS(t){return/[a-z0-9']/.test(t)}var vc,ig,ao,og=g(()=>{"use strict";Er();Er();vc={silenceEnergyThreshold:er,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"]},ig="semantic",ao=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,r={},i){this.clock=e,this.config={...vc,...r},this.classifier=i??new Vi(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=yR(e),gc(this.lastNormPartial,this.config.commitCues)){this.commit("lexical");return}let r=this.strongHoldCue,i=_R(this.lastNormPartial,this.config.strongHoldCues);if(i===null&&r!==null&&this.partialStability==="redecode"&&!this.pendingVetoClear){this.pendingVetoClear=!0,this.telemetry?.strongHoldClearDebounced?.(r),gc(this.lastNormPartial,this.config.weakHoldCues)&&(this.held||this.holdFloor());return}if(this.pendingVetoClear=!1,this.strongHoldCue=i,this.strongHoldCue!==null){if(this.strongHoldCue!==r){this.telemetry?.strongHoldRecognized(this.strongHoldCue),this.held||this.enterHeld(this.strongHoldCue);return}if(this.held)return;if(VS(this.lastNormPartial,this.strongHoldCue)){this.enterHeld(this.strongHoldCue);return}this.holdFloor();return}if(gc(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,r="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=r),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:gc(this.lastNormPartial,this.config.commitCues)}enterHeld(e){if(this.held)return;let r=this.clock.now();this.heldCeilingDeadlineAtMs??=r+this.config.heldCeilingMs;let i=this.heldCeilingDeadlineAtMs-r;if(!(i<=0&&e===ig)){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 ZS,co,sg=g(()=>{"use strict";mc();og();ZS={...vc,commitThreshold:.65,holdThreshold:.35},co=class extends ao{smartConfig;inference;buffer=new Int16Array(Ve*2);bufferLen=0;silenceEpoch=0;degraded=!1;smartDisposed=!1;semantics;evaluatedEpoch=0;evaluationAbort=new AbortController;constructor(e,r,i={},n,o){super(e,i,n),this.smartConfig={...ZS,...i},this.inference=r,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,r=this.snapshotBuffer();this.runInference(r,e)}async runInference(e,r){let i=this.clock.now(),n;try{n=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||r!==this.silenceEpoch||!this.canRefineBudget()){this.telemetry?.smartTurnResolved(n,o,"stale");return}n>=this.smartConfig.commitThreshold?(this.telemetry?.smartTurnResolved(n,o,"shorten"),this.rearmSilence(this.smartConfig.shortSilenceMs),this.maybeEvaluateTurn(r,"shorten")):n<=this.smartConfig.holdThreshold?(this.telemetry?.smartTurnResolved(n,o,"extend"),this.rearmSilence(this.smartConfig.longSilenceMs)):(this.telemetry?.smartTurnResolved(n,o,"inconclusive"),this.maybeEvaluateTurn(r,"inconclusive"))}maybeEvaluateTurn(e,r){if(!this.semantics||this.evaluatedEpoch===e||this.isHeld())return;let i=this.livePartial();i!==""&&(this.evaluatedEpoch=e,this.runEvaluation(this.semantics,i,e,r))}async runEvaluation(e,r,i,n){this.telemetry?.evaluatorFired?.(n);let o=this.clock.now(),s;try{s=await e.evaluator.evaluate({recentTurns:e.recentTurns(),livePartial:r},this.evaluationAbort.signal)}catch(c){this.smartDisposed||this.telemetry?.evaluatorFailed?.(this.clock.now()-o,c);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(ig),this.resumeHeldSilence()}}appendToBuffer(e){let r=e.byteLength>>1;if(r===0)return;let i=new DataView(e.buffer,e.byteOffset,e.byteLength),n=r>Ve?r-Ve:0,o=r-n;if(this.bufferLen+o>this.buffer.length){let s=Math.min(this.bufferLen,Ve);this.buffer.copyWithin(0,this.bufferLen-s,this.bufferLen),this.bufferLen=s}for(let s=n;s<r;s++)this.buffer[this.bufferLen++]=i.getInt16(s*2,!0)}snapshotBuffer(){let e=Math.max(0,this.bufferLen-Ve);return this.buffer.slice(e,this.bufferLen)}}});function ag(t={}){return fc(BS,GS,import.meta.url,t)}var BS,GS,cg=g(()=>{"use strict";Ym();BS="smart-turn-v3.1-cpu.onnx",GS="JARVIS_SMART_TURN_MODEL_PATH"});var uo,ug=g(()=>{"use strict";mc();Jm();cg();uo=class{logMel;modelPath;sessionPromise=null;session=null;ort=null;disposed=!1;constructor(e={}){this.logMel=e.logMel??new so,this.modelPath=e.modelPath}async infer(e){if(this.disposed)throw new Error("SmartTurnRunner is disposed");let r=await this.ensureSession(),i=this.ort;if(!i)throw new Error("onnxruntime-web failed to load");let n=this.logMel.fromPcm16(e),o=new i.Tensor("float32",n,[1,ng,zr]),s=await r.run({input_features:o});if(this.disposed)throw new Error("SmartTurnRunner is disposed");let a=r.outputNames[0],u=s[a].data[0];if(!Number.isFinite(u))throw new Error("smart-turn produced a non-finite output");return u<0?0:u>1?1:u}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 dc();this.ort=e,hc(e);let r=this.modelPath??ag(),i=await e.InferenceSession.create(r,{executionProviders:["wasm"],graphOptimizationLevel:"all",executionMode:"sequential"});if(this.disposed)throw await i.release(),new Error("SmartTurnRunner is disposed");return this.session=i,i}}});function OR(t){let e=[];if(t.recentTurns.length>0){e.push("Recent conversation:");for(let r of t.recentTurns)e.push(`${r.role==="assistant"?"Assistant":"User"}: ${r.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(`
|
|
159
|
+
`)}function PR(t){let e=lg(t)?.content,r=(Array.isArray(e)?e:[]).map(l=>lg(l)).filter(l=>l?.type==="text").map(l=>typeof l?.text=="string"?l.text:"").join(""),i=WS+r;i.includes("}")||(i+="}");let n=i.indexOf("{"),o=i.lastIndexOf("}");if(n===-1||o<=n)throw new Lt("turn evaluator reply carried no JSON object");let s;try{s=JSON.parse(i.slice(n,o+1))}catch{throw new Lt("turn evaluator reply was not valid JSON")}let a=lg(s),c=a?.verdict;if(typeof c!="string"||!TR.includes(c))throw new Lt("turn evaluator reply carried an unknown verdict");let u=a?.confidence;if(typeof u!="number"||!Number.isFinite(u)||u<0||u>1)throw new Lt("turn evaluator confidence missing or out of range");return{verdict:c,confidence:u}}function lg(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0}var wR,xR,SR,ER,kR,WS,IR,TR,AR,Lt,Bn,dg=g(()=>{"use strict";Qt();wR="claude-haiku-4-5-20251001",xR=2e3,SR="https://api.anthropic.com/v1/messages",ER="2023-06-01",kR=64,WS='{"verdict":"',IR=["}"],TR=["done","mid_thought","hold_floor"],AR=`You are the semantic turn evaluator inside a real-time voice assistant's
|
|
148
160
|
turn-taking system. The user is speaking; a streaming ASR produces a live
|
|
149
161
|
partial transcript. Your only job is to judge whether the user's turn reads
|
|
150
162
|
as finished. You advise a policy layer; you never answer the user.
|
|
@@ -185,33 +197,33 @@ Rules:
|
|
|
185
197
|
Output exactly one line of strict JSON and nothing else:
|
|
186
198
|
{"verdict":"done"|"mid_thought"|"hold_floor","confidence":<number 0..1>}
|
|
187
199
|
confidence is your certainty in the verdict.
|
|
188
|
-
`,Lt=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=LC){this.key=e,this.fetchImpl=n,this.timeoutMs=i}async evaluate(e,n){let i={model:DC,max_tokens:UC,temperature:0,stop_sequences:jC,system:VC,messages:[{role:"user",content:ZC(e)},{role:"assistant",content:PS}]},r;try{r=await this.fetchImpl(MC,{method:"POST",headers:{"x-api-key":this.key,"anthropic-version":zC,"content-type":"application/json"},body:JSON.stringify(i),signal:AbortSignal.any([n,AbortSignal.timeout(this.timeoutMs)])})}catch(s){throw s instanceof Error&&(s.name==="TimeoutError"||s.name==="AbortError")?s:new Lt(be(s,this.key))}if(!r.ok)throw new Lt(`turn evaluator request failed (HTTP ${r.status})`,r.status);let o;try{o=await r.json()}catch{throw new Lt("turn evaluator response body was not JSON")}return BC(o)}}});function ig(t){return t===void 0?hc:{id:hc.id,engineVoice:{...hc.engineVoice,"elevenlabs-flash":{kind:"preset",voiceId:t}}}}var fc,hc,og=g(()=>{"use strict";fc="21m00Tcm4TlvDq8ikWAM",hc={id:"jarvis-primary",engineVoice:{"elevenlabs-flash":{kind:"preset",voiceId:fc}}}});var pc,CS=g(()=>{"use strict";he();pc=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=j){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 qC(t){return HC.test(t)}var RS,NS,GC,WC,mc,HC,gc,DS=g(()=>{"use strict";Ka();CS();RS=16e3,NS="pcm_s16le",GC="en",WC=["Jarvis"],mc=.7,HC=/\bjarvis\b/i;gc=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 pc(e.turnId,e.clock.now()),e.controller.attachTelemetry?.(this.timeline),e.controller.setPartialStability?.(e.asrEngine.partialStability??"stable"),this.asrStream=e.asrEngine.open({sampleRate:RS,encoding:NS,language:GC,biasTerms:WC,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(),!qC(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:Bw})}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>=mc),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<mc){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:RS,encoding:NS});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}if(s.type==="text"){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:c}=this.absorbPending;this.absorbPending=null,this.timeline.addresseeResolved(s,a,c,"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 sg}from"node:crypto";var ag,cg,Gn,lo,vc,LS=g(()=>{"use strict";he();ji();qa();hm();Xt();Zw();Ka();pm();Fi();Er();Wm();Xm();tg();ng();og();DS();ag=6,cg=45e3,Gn=class extends Error{constructor(e){super(e),this.name="ReasonerUnavailableError"}},lo=class extends Error{constructor(e){super(e),this.name="VoiceUnavailableError"}},vc=class{deps;sessionId;deviceId;projectId;queue=new Ja;closed=!1;eventsConsumed=!1;inFlight=!1;reasoner=null;reasonerRoute=null;turnAbort=null;voiceTurn=null;voiceTurnFailed=!1;voiceEngines=null;clock;newTurnController;newSmartTurnInference;newFrameClassifier;newTurnEvaluator;newSegmenter;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 Tt,this.newSmartTurnInference=i.createSmartTurnInference??(()=>new uo),this.newFrameClassifier=i.createFrameClassifier??(()=>new Zi(new Mr)),this.newTurnEvaluator=i.createTurnEvaluator??(r=>new Bn(r)),this.newAddresseeEvaluator=i.createAddresseeEvaluator??(r=>new Mn(r)),this.newTurnController=i.createTurnController??(r=>{let o=this.ensureFrameClassifier();return o.reset?.(),new co(r,this.ensureSmartTurnInference(),{},this.speechObservingClassifier(o),this.semanticHook())}),this.newSegmenter=i.createSegmenter??(()=>new eo),this.emit({type:"session.ready"})}async send(e){let{commandId:n}=e;if(this.closed)throw new Fe(n,"closed");if(e.sessionId!==this.sessionId)throw new Fe(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 Fe(n,"unsupported");default:throw new Fe(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 Fe(e.commandId,"invalid","input.text requires non-empty text");if(this.inFlight)throw new Fe(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=sg();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))o.type==="text"&&this.emit({type:"response.delta",turnId:e,text:o.text});this.emit({type:"response.done",turnId:e})}catch(r){let o=r instanceof Gn?"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 Fe(e.commandId,"backpressured","a turn is already in progress (one turn at a time in v0.1)");this.inFlight=!0;let n=sg();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 gc({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:i.engines.voice,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 Gn?"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 lo("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 lo("no voice route configured - run 'jarvis init' to set routes.stt and routes.tts");let r=!e.secrets?.[n.provider]&&Cr(n.provider),o=!e.secrets?.[i.provider]&&Cr(i.provider);if(r||o){let u=r?n.provider:i.provider;throw new lo(`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]??""),c=this.deps.voiceIdentity??ig(i.voiceId);return this.voiceEngines={asrEngine:s,ttsEngine:a,voice:c},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(-ag)}}}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,j.debug("addressee evaluator construction failed - the layer is absent",{error:be(i,n?.key)})}}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>=mc&&this.enterAside(i.confidence)},floorState:()=>this.floorState,onFloorReleased:n=>this.exitAside(n)}}enterAside(e){this.floorState!=="aside"&&(this.floorState="aside",this.noteSpeech(),this.armAsideDecay(cg),j.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),j.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>=cg?this.exitAside("decay"):this.armAsideDecay(cg-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(-ag)}recordAbsorbedFinal(e){this.absorbedFinals.push({afterHistoryLen:this.reasoner?.historySnapshot().length??0,text:e}),this.absorbedFinals.length>ag&&this.absorbedFinals.shift()}ensureReasoner(){if(this.reasoner)return this.reasoner;let e=this.deps.configService.resolved(),n=e.routes?.text;if(!n)throw new Gn("no text model is configured - run 'jarvis init' to set routes.text");let i=e.secrets?.[n.provider];if(!i)throw new Gn(`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 Qi(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:sg(),atMs:Date.now()})}}});function JC(t,e,n){let i=new URL(t);i.searchParams.set("model_id",e),i.searchParams.set("audio_format",KC(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 KC(t){return t.encoding==="pcm_s16le"?`pcm_${t.sampleRate}`:"pcm_16000"}var MS,ho,ug,lg=g(()=>{"use strict";Ia();MS="wss://api.elevenlabs.io/v1/speech-to-text/realtime",ho=class{apiKey;socketFactory;model;endpoint;id="elevenlabs-scribe";constructor(e,n,i,r=MS){this.apiKey=e,this.socketFactory=n,this.model=i,this.endpoint=r}open(e){return new ug(this.apiKey,this.socketFactory,this.model,this.endpoint,e)}},ug=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(JC(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=In(e);if(!n)return;let i=Ea(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:Bi(n.text),isFinal:!1,startMs:0});return}if(r==="committed_transcript"||r==="committed_transcript_with_timestamps"){let o=Bi(n.text);o.length>0&&this.committed.push(o),this.endPending&&this.resolveEnd()}}handleError(e){if(this.closed)return;let n=kn("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:C$(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 YC}from"node:crypto";function QC(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 eR(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",tR(i)),r.searchParams.set("auto_mode","true"),r.toString()}function tR(t){return t.encoding==="pcm_s16le"?`pcm_${t.sampleRate}`:"pcm_16000"}var zS,XC,fo,dg,hg=g(()=>{"use strict";Ia();zS="wss://api.elevenlabs.io/v1/text-to-speech/{voice_id}/multi-stream-input",XC={stability:.5,similarity_boost:.75,use_speaker_boost:!0},fo=class{apiKey;socketFactory;model;endpointTemplate;id="elevenlabs-flash";constructor(e,n,i,r=zS){this.apiKey=e,this.socketFactory=n,this.model=i,this.endpointTemplate=r}speak(e){return new dg(this.apiKey,this.socketFactory,this.model,this.endpointTemplate,this.id,e)}},dg=class{socket;contextId=YC();opened=!1;cancelled=!1;closed=!1;endRequested=!1;closeContextSent=!1;pending=[];audioCb;errorCb;endPending=null;constructor(e,n,i,r,o,s){let a=QC(s.voice,o);this.socket=n(eR(r,a,i,s),{"xi-api-key":e}),this.socket.onOpen(()=>this.handleOpen()),this.socket.onMessage(c=>this.handleMessage(c)),this.socket.onError(c=>this.handleError(c)),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=In(e);if(!n)return;let i=Ea(n);if(i){this.handleError(new Error(`stream error (${i})`));return}typeof n.audio=="string"&&n.audio.length>0&&this.audioCb?.(R$(n.audio)),(n.isFinal===!0||n.is_final===!0)&&this.resolveEnd()}handleError(e){if(this.closed)return;let n=kn("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:XC,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())}}});function rR(t){if(t===void 0)return;let e;try{e=new URL(t).protocol}catch{throw new Error("sherpa-onnx ASR route url must be a valid ws:// or wss:// URL")}if(e!=="ws:"&&e!=="wss:")throw new Error(`sherpa-onnx ASR route url must use the ws:// or wss:// scheme (got '${e}//' - this is a WebSocket endpoint, not HTTP)`)}var po,fg=g(()=>{"use strict";lg();hg();Fp();Ta();Za();po=class{socketFactory;fetchImpl;constructor(e=Ln,n=fetch){this.socketFactory=e,this.fetchImpl=n}asrEngine(e,n){switch(e.provider){case"elevenlabs":return new ho(n,this.socketFactory,e.model);case"sherpa-onnx":return rR(e.url),new Gi(this.socketFactory,e.url);case"openai-compat":return new Sa(this.fetchImpl,e.url,e.model,n);default:throw new Error(`no stt adapter for provider '${e.provider}'`)}}ttsEngine(e,n){if(e.provider==="elevenlabs")return new fo(n,this.socketFactory,e.model);throw new Error(`no tts adapter for provider '${e.provider}'`)}}});import{randomUUID as nR}from"node:crypto";function mg(t={}){let e=new Sr;j.setLevel(e.logLevel),j.debug("core created",{logLevel:e.logLevel});let{fetchImpl:n}=t,i={configService:t.configService??new je,registry:t.registry??new Ui(n),voiceRegistry:t.voiceRegistry??new po(t.voiceSocketFactory,n),createTurnEvaluator:t.createTurnEvaluator??(r=>new Bn(r,n)),createAddresseeEvaluator:t.createAddresseeEvaluator??(r=>new Mn(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 pg(i)}var iR,oR,pg,US=g(()=>{"use strict";he();Tp();Ap();Dp();LS();Ka();ng();fg();iR="jarvis-core",oR="0.1.0-dev",pg=class{deps;constructor(e){this.deps=e}describe(){return Promise.resolve({name:iR,version:oR})}openSession(e){let n=nR();return j.debug("core opened session",{sessionId:n,capabilities:e.clientCapabilities}),Promise.resolve(new vc(n,e,this.deps))}}});import{readFileSync as sR,writeFileSync as aR}from"node:fs";function mo(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function lR(t){let e={};if(!mo(t))return e;for(let n of uR){let i=t[n];if(!Array.isArray(i))continue;let r=[];for(let o of i)!mo(o)||typeof o.id!="string"||r.push(typeof o.label=="string"?{id:o.id,label:o.label}:{id:o.id});r.length>0&&(e[n]=r)}return e}var FS,VS,jS,cR,uR,Mt,ZS=g(()=>{"use strict";xr();qa();Xt();FS="model-catalogue.json",VS=1440*60*1e3,jS=1,cR={stt:!0,tts:!0,text:!0,embedding:!0},uR=Object.keys(cR);Mt=class{fetchImpl;timeoutMs=3e3;home;now;ttlMs;providers;fetchFailed=new Set;constructor(e=fetch,n){this.fetchImpl=e,this.home=n?.home??Ue,this.now=n?.now??(()=>Date.now()),this.ttlMs=n?.ttlMs??VS,this.providers=Ha}async models(e,n,i){let r=this.providers[e],o=r?.defaultModel[n],s=r?.fastModel?.[n],a={source:"prefill",models:o===void 0?[]:[{id:o}],recommended:o,recommendedFast:s};if(!r?.listModels||!r.capabilities.includes(n))return a;let c=this.readCacheEntry(e),u=c?.models[n],l=c===void 0?0:Math.max(0,this.now()-c.fetchedAtMs),d=f=>({source:"cache",models:f,recommended:o,recommendedFast:s,cacheAgeMs:l});if(c!==void 0){let f=this.now()-c.fetchedAtMs;if(f>=0&&f<this.ttlMs)return u===void 0?a:d(u)}let h=await this.tryFetch(e,r,i);if(h!==void 0){let f=h[n];return f===void 0?a:{source:"live",models:f,recommended:o,recommendedFast:s}}return u!==void 0?d(u):a}async refresh(e,n){let i=this.providers[e];if(!i?.listModels)return{ok:!1,status:"no-lister"};this.fetchFailed.delete(e);let r=o=>{let s=this.readCacheEntry(e);return s===void 0?{ok:!1,status:"failed",detail:o}:{ok:!1,status:"failed",detail:o,cached:{models:s.models,cacheAgeMs:Math.max(0,this.now()-s.fetchedAtMs)}}};if(i.keylessLister!==!0&&n?.key===void 0)return r("no API key available");try{let o=n?.signal??AbortSignal.timeout(this.timeoutMs),s=await i.listModels(n?.key,this.fetchImpl,o);return this.writeCacheEntry(e,s),{ok:!0,status:"refreshed",models:s}}catch(o){return r(be(o,n?.key))}}cached(e,n){let i=this.readCacheEntry(e),r=i?.models[n];if(i===void 0||r===void 0)return;let o=this.now()-i.fetchedAtMs;return{models:r,cacheAgeMs:Math.max(0,o),fresh:o>=0&&o<this.ttlMs}}async tryFetch(e,n,i){if(n.listModels!==void 0&&!this.fetchFailed.has(e)&&!(n.keylessLister!==!0&&i?.key===void 0))try{let r=i?.signal??AbortSignal.timeout(this.timeoutMs),o=await n.listModels(i?.key,this.fetchImpl,r);return this.writeCacheEntry(e,o),o}catch{this.fetchFailed.add(e);return}}cachePath(){return this.home.resolve(FS)}readCacheFile(){let e;try{e=JSON.parse(sR(this.cachePath(),"utf8"))}catch{return}if(!(!mo(e)||e.version!==jS))return mo(e.providers)?e.providers:void 0}readCacheEntry(e){let n=this.readCacheFile()?.[e];if(!mo(n))return;let{fetchedAtMs:i}=n;if(typeof i!="number"||!Number.isFinite(i))return;let r=lR(n.models);if(Object.keys(r).length!==0)return{fetchedAtMs:i,models:r}}writeCacheEntry(e,n){try{let i=this.readCacheFile()??{};i[e]={fetchedAtMs:this.now(),models:n},this.home.ensureDir(),aR(this.cachePath(),`${JSON.stringify({version:jS,providers:i},null,2)}
|
|
189
|
-
`)}catch{}}}});var Ur=g(()=>{"use strict";US();Ap();qa();ZS();Dp();Np();hm();Pp();Op();Za();lg();hg();Ta();fg();og();Ym();Xm();tg();Er();Wm();Gm();uc();eg();pm();Fi()});var qn=N((S3,qS)=>{"use strict";var bR="2.0.0",$R=Number.MAX_SAFE_INTEGER||9007199254740991,wR=16,xR=250,SR=["major","premajor","minor","preminor","patch","prepatch","prerelease"];qS.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:wR,MAX_SAFE_BUILD_LENGTH:xR,MAX_SAFE_INTEGER:$R,RELEASE_TYPES:SR,SEMVER_SPEC_VERSION:bR,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var yo=N((E3,JS)=>{"use strict";var ER=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};JS.exports=ER});var Jn=N((yt,KS)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:yg,MAX_SAFE_BUILD_LENGTH:IR,MAX_LENGTH:kR}=qn(),TR=yo();yt=KS.exports={};var AR=yt.re=[],OR=yt.safeRe=[],P=yt.src=[],PR=yt.safeSrc=[],C=yt.t={},CR=0,_g="[a-zA-Z0-9-]",RR=[["\\s",1],["\\d",kR],[_g,IR]],NR=t=>{for(let[e,n]of RR)t=t.split(`${e}*`).join(`${e}{0,${n}}`).split(`${e}+`).join(`${e}{1,${n}}`);return t},F=(t,e,n)=>{let i=NR(e),r=CR++;TR(t,r,e),C[t]=r,P[r]=e,PR[r]=i,AR[r]=new RegExp(e,n?"g":void 0),OR[r]=new RegExp(i,n?"g":void 0)};F("NUMERICIDENTIFIER","0|[1-9]\\d*");F("NUMERICIDENTIFIERLOOSE","\\d+");F("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${_g}*`);F("MAINVERSION",`(${P[C.NUMERICIDENTIFIER]})\\.(${P[C.NUMERICIDENTIFIER]})\\.(${P[C.NUMERICIDENTIFIER]})`);F("MAINVERSIONLOOSE",`(${P[C.NUMERICIDENTIFIERLOOSE]})\\.(${P[C.NUMERICIDENTIFIERLOOSE]})\\.(${P[C.NUMERICIDENTIFIERLOOSE]})`);F("PRERELEASEIDENTIFIER",`(?:${P[C.NONNUMERICIDENTIFIER]}|${P[C.NUMERICIDENTIFIER]})`);F("PRERELEASEIDENTIFIERLOOSE",`(?:${P[C.NONNUMERICIDENTIFIER]}|${P[C.NUMERICIDENTIFIERLOOSE]})`);F("PRERELEASE",`(?:-(${P[C.PRERELEASEIDENTIFIER]}(?:\\.${P[C.PRERELEASEIDENTIFIER]})*))`);F("PRERELEASELOOSE",`(?:-?(${P[C.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${P[C.PRERELEASEIDENTIFIERLOOSE]})*))`);F("BUILDIDENTIFIER",`${_g}+`);F("BUILD",`(?:\\+(${P[C.BUILDIDENTIFIER]}(?:\\.${P[C.BUILDIDENTIFIER]})*))`);F("FULLPLAIN",`v?${P[C.MAINVERSION]}${P[C.PRERELEASE]}?${P[C.BUILD]}?`);F("FULL",`^${P[C.FULLPLAIN]}$`);F("LOOSEPLAIN",`[v=\\s]*${P[C.MAINVERSIONLOOSE]}${P[C.PRERELEASELOOSE]}?${P[C.BUILD]}?`);F("LOOSE",`^${P[C.LOOSEPLAIN]}$`);F("GTLT","((?:<|>)?=?)");F("XRANGEIDENTIFIERLOOSE",`${P[C.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);F("XRANGEIDENTIFIER",`${P[C.NUMERICIDENTIFIER]}|x|X|\\*`);F("XRANGEPLAIN",`[v=\\s]*(${P[C.XRANGEIDENTIFIER]})(?:\\.(${P[C.XRANGEIDENTIFIER]})(?:\\.(${P[C.XRANGEIDENTIFIER]})(?:${P[C.PRERELEASE]})?${P[C.BUILD]}?)?)?`);F("XRANGEPLAINLOOSE",`[v=\\s]*(${P[C.XRANGEIDENTIFIERLOOSE]})(?:\\.(${P[C.XRANGEIDENTIFIERLOOSE]})(?:\\.(${P[C.XRANGEIDENTIFIERLOOSE]})(?:${P[C.PRERELEASELOOSE]})?${P[C.BUILD]}?)?)?`);F("XRANGE",`^${P[C.GTLT]}\\s*${P[C.XRANGEPLAIN]}$`);F("XRANGELOOSE",`^${P[C.GTLT]}\\s*${P[C.XRANGEPLAINLOOSE]}$`);F("COERCEPLAIN",`(^|[^\\d])(\\d{1,${yg}})(?:\\.(\\d{1,${yg}}))?(?:\\.(\\d{1,${yg}}))?`);F("COERCE",`${P[C.COERCEPLAIN]}(?:$|[^\\d])`);F("COERCEFULL",P[C.COERCEPLAIN]+`(?:${P[C.PRERELEASE]})?(?:${P[C.BUILD]})?(?:$|[^\\d])`);F("COERCERTL",P[C.COERCE],!0);F("COERCERTLFULL",P[C.COERCEFULL],!0);F("LONETILDE","(?:~>?)");F("TILDETRIM",`(\\s*)${P[C.LONETILDE]}\\s+`,!0);yt.tildeTrimReplace="$1~";F("TILDE",`^${P[C.LONETILDE]}${P[C.XRANGEPLAIN]}$`);F("TILDELOOSE",`^${P[C.LONETILDE]}${P[C.XRANGEPLAINLOOSE]}$`);F("LONECARET","(?:\\^)");F("CARETTRIM",`(\\s*)${P[C.LONECARET]}\\s+`,!0);yt.caretTrimReplace="$1^";F("CARET",`^${P[C.LONECARET]}${P[C.XRANGEPLAIN]}$`);F("CARETLOOSE",`^${P[C.LONECARET]}${P[C.XRANGEPLAINLOOSE]}$`);F("COMPARATORLOOSE",`^${P[C.GTLT]}\\s*(${P[C.LOOSEPLAIN]})$|^$`);F("COMPARATOR",`^${P[C.GTLT]}\\s*(${P[C.FULLPLAIN]})$|^$`);F("COMPARATORTRIM",`(\\s*)${P[C.GTLT]}\\s*(${P[C.LOOSEPLAIN]}|${P[C.XRANGEPLAIN]})`,!0);yt.comparatorTrimReplace="$1$2$3";F("HYPHENRANGE",`^\\s*(${P[C.XRANGEPLAIN]})\\s+-\\s+(${P[C.XRANGEPLAIN]})\\s*$`);F("HYPHENRANGELOOSE",`^\\s*(${P[C.XRANGEPLAINLOOSE]})\\s+-\\s+(${P[C.XRANGEPLAINLOOSE]})\\s*$`);F("STAR","(<|>)?=?\\s*\\*");F("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");F("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var wc=N((I3,YS)=>{"use strict";var DR=Object.freeze({loose:!0}),LR=Object.freeze({}),MR=t=>t?typeof t!="object"?DR:t:LR;YS.exports=MR});var bg=N((k3,e0)=>{"use strict";var XS=/^[0-9]+$/,QS=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let n=XS.test(t),i=XS.test(e);return n&&i&&(t=+t,e=+e),t===e?0:n&&!i?-1:i&&!n?1:t<e?-1:1},zR=(t,e)=>QS(e,t);e0.exports={compareIdentifiers:QS,rcompareIdentifiers:zR}});var we=N((T3,r0)=>{"use strict";var xc=yo(),{MAX_LENGTH:t0,MAX_SAFE_INTEGER:Sc}=qn(),{safeRe:Ec,t:Ic}=Jn(),UR=wc(),{compareIdentifiers:$g}=bg(),jR=(t,e)=>{let n=e.split(".");if(n.length>t.length)return!1;for(let i=0;i<n.length;i++)if($g(t[i],n[i])!==0)return!1;return!0},wg=class t{constructor(e,n){if(n=UR(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>t0)throw new TypeError(`version is longer than ${t0} characters`);xc("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let i=e.trim().match(n.loose?Ec[Ic.LOOSE]:Ec[Ic.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>Sc||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Sc||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Sc||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<Sc)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(xc("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(xc("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 $g(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(xc("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 $g(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?Ec[Ic.PRERELEASELOOSE]:Ec[Ic.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]),jR(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}};r0.exports=wg});var cr=N((A3,i0)=>{"use strict";var n0=we(),FR=(t,e,n=!1)=>{if(t instanceof n0)return t;try{return new n0(t,e)}catch(i){if(!n)return null;throw i}};i0.exports=FR});var s0=N((O3,o0)=>{"use strict";var VR=cr(),ZR=(t,e)=>{let n=VR(t,e);return n?n.version:null};o0.exports=ZR});var c0=N((P3,a0)=>{"use strict";var BR=cr(),GR=(t,e)=>{let n=BR(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};a0.exports=GR});var d0=N((C3,l0)=>{"use strict";var u0=we(),WR=(t,e,n,i,r)=>{typeof n=="string"&&(r=i,i=n,n=void 0);try{return new u0(t instanceof u0?t.version:t,n).inc(e,i,r).version}catch{return null}};l0.exports=WR});var p0=N((R3,f0)=>{"use strict";var h0=cr(),HR=(t,e)=>{let n=h0(t,null,!0),i=h0(e,null,!0),r=n.compare(i);if(r===0)return null;let o=r>0,s=o?n:i,a=o?i:n,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let l=c?"pre":"";return n.major!==i.major?l+"major":n.minor!==i.minor?l+"minor":n.patch!==i.patch?l+"patch":"prerelease"};f0.exports=HR});var g0=N((N3,m0)=>{"use strict";var qR=we(),JR=(t,e)=>new qR(t,e).major;m0.exports=JR});var y0=N((D3,v0)=>{"use strict";var KR=we(),YR=(t,e)=>new KR(t,e).minor;v0.exports=YR});var b0=N((L3,_0)=>{"use strict";var XR=we(),QR=(t,e)=>new XR(t,e).patch;_0.exports=QR});var w0=N((M3,$0)=>{"use strict";var eN=cr(),tN=(t,e)=>{let n=eN(t,e);return n&&n.prerelease.length?n.prerelease:null};$0.exports=tN});var nt=N((z3,S0)=>{"use strict";var x0=we(),rN=(t,e,n)=>new x0(t,n).compare(new x0(e,n));S0.exports=rN});var I0=N((U3,E0)=>{"use strict";var nN=nt(),iN=(t,e,n)=>nN(e,t,n);E0.exports=iN});var T0=N((j3,k0)=>{"use strict";var oN=nt(),sN=(t,e)=>oN(t,e,!0);k0.exports=sN});var kc=N((F3,O0)=>{"use strict";var A0=we(),aN=(t,e,n)=>{let i=new A0(t,n),r=new A0(e,n);return i.compare(r)||i.compareBuild(r)};O0.exports=aN});var C0=N((V3,P0)=>{"use strict";var cN=kc(),uN=(t,e)=>t.sort((n,i)=>cN(n,i,e));P0.exports=uN});var N0=N((Z3,R0)=>{"use strict";var lN=kc(),dN=(t,e)=>t.sort((n,i)=>lN(i,n,e));R0.exports=dN});var _o=N((B3,D0)=>{"use strict";var hN=nt(),fN=(t,e,n)=>hN(t,e,n)>0;D0.exports=fN});var Tc=N((G3,L0)=>{"use strict";var pN=nt(),mN=(t,e,n)=>pN(t,e,n)<0;L0.exports=mN});var xg=N((W3,M0)=>{"use strict";var gN=nt(),vN=(t,e,n)=>gN(t,e,n)===0;M0.exports=vN});var Sg=N((H3,z0)=>{"use strict";var yN=nt(),_N=(t,e,n)=>yN(t,e,n)!==0;z0.exports=_N});var Ac=N((q3,U0)=>{"use strict";var bN=nt(),$N=(t,e,n)=>bN(t,e,n)>=0;U0.exports=$N});var Oc=N((J3,j0)=>{"use strict";var wN=nt(),xN=(t,e,n)=>wN(t,e,n)<=0;j0.exports=xN});var Eg=N((K3,F0)=>{"use strict";var SN=xg(),EN=Sg(),IN=_o(),kN=Ac(),TN=Tc(),AN=Oc(),ON=(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 SN(t,n,i);case"!=":return EN(t,n,i);case">":return IN(t,n,i);case">=":return kN(t,n,i);case"<":return TN(t,n,i);case"<=":return AN(t,n,i);default:throw new TypeError(`Invalid operator: ${e}`)}};F0.exports=ON});var Z0=N((Y3,V0)=>{"use strict";var PN=we(),CN=cr(),{safeRe:Pc,t:Cc}=Jn(),RN=(t,e)=>{if(t instanceof PN)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?Pc[Cc.COERCEFULL]:Pc[Cc.COERCE]);else{let c=e.includePrerelease?Pc[Cc.COERCERTLFULL]:Pc[Cc.COERCERTL],u;for(;(u=c.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||u.index+u[0].length!==n.index+n[0].length)&&(n=u),c.lastIndex=u.index+u[1].length+u[2].length;c.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 CN(`${i}.${r}.${o}${s}${a}`,e)};V0.exports=RN});var G0=N((X3,B0)=>{"use strict";var NN=cr(),DN=qn(),LN=we(),MN=(t,e,n)=>{if(!DN.RELEASE_TYPES.includes(e))return null;let i=zN(t,n);return i&&UN(i,e)},zN=(t,e)=>{let n=t instanceof LN?t.version:t;return NN(n,e)},UN=(t,e)=>{if(jN(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()},jN=t=>t.startsWith("pre");B0.exports=MN});var H0=N((Q3,W0)=>{"use strict";var Ig=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}};W0.exports=Ig});var it=N((e8,Y0)=>{"use strict";var FN=/\s+/g,kg=class t{constructor(e,n){if(n=ZN(n),e instanceof t)return e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease?e:new t(e.raw,n);if(e instanceof Tg)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(FN," "),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=>!J0(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&&XN(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(YN,"");let i=((this.options.includePrerelease&&JN)|(this.options.loose&&KN))+":"+e,r=q0.get(i);if(r)return r;let o=this.options.loose,s=o?Re[xe.HYPHENRANGELOOSE]:Re[xe.HYPHENRANGE];e=e.replace(s,cD(this.options.includePrerelease)),te("hyphen replace",e),e=e.replace(Re[xe.COMPARATORTRIM],WN),te("comparator trim",e),e=e.replace(Re[xe.TILDETRIM],HN),te("tilde trim",e),e=e.replace(Re[xe.CARETTRIM],qN),te("caret trim",e);let a=e.split(" ").map(d=>QN(d,this.options)).join(" ").split(/\s+/).map(d=>aD(d,this.options));o&&(a=a.filter(d=>(te("loose invalid filter",d,this.options),!!d.match(Re[xe.COMPARATORLOOSE])))),te("range list",a);let c=new Map,u=a.map(d=>new Tg(d,this.options));for(let d of u){if(J0(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let l=[...c.values()];return q0.set(i,l),l}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(i=>K0(i,n)&&e.set.some(r=>K0(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 BN(e,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(uD(this.set[n],e,this.options))return!0;return!1}};Y0.exports=kg;var VN=H0(),q0=new VN,ZN=wc(),Tg=bo(),te=yo(),BN=we(),{safeRe:Re,src:GN,t:xe,comparatorTrimReplace:WN,tildeTrimReplace:HN,caretTrimReplace:qN}=Jn(),{FLAG_INCLUDE_PRERELEASE:JN,FLAG_LOOSE:KN}=qn(),YN=new RegExp(GN[xe.BUILD],"g"),J0=t=>t.value==="<0.0.0-0",XN=t=>t.value==="",K0=(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},QN=(t,e)=>(t=t.replace(Re[xe.BUILD],""),te("comp",t,e),t=rD(t,e),te("caret",t),t=eD(t,e),te("tildes",t),t=iD(t,e),te("xrange",t),t=sD(t,e),te("stars",t),t),Ne=t=>!t||t.toLowerCase()==="x"||t==="*",eD=(t,e)=>t.trim().split(/\s+/).map(n=>tD(n,e)).join(" "),tD=(t,e)=>{let n=e.loose?Re[xe.TILDELOOSE]:Re[xe.TILDE];return t.replace(n,(i,r,o,s,a)=>{te("tilde",t,i,r,o,s,a);let c;return Ne(r)?c="":Ne(o)?c=`>=${r}.0.0 <${+r+1}.0.0-0`:Ne(s)?c=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:a?(te("replaceTilde pr",a),c=`>=${r}.${o}.${s}-${a} <${r}.${+o+1}.0-0`):c=`>=${r}.${o}.${s} <${r}.${+o+1}.0-0`,te("tilde return",c),c})},rD=(t,e)=>t.trim().split(/\s+/).map(n=>nD(n,e)).join(" "),nD=(t,e)=>{te("caret",t,e);let n=e.loose?Re[xe.CARETLOOSE]:Re[xe.CARET],i=e.includePrerelease?"-0":"";return t.replace(n,(r,o,s,a,c)=>{te("caret",t,r,o,s,a,c);let u;return Ne(o)?u="":Ne(s)?u=`>=${o}.0.0${i} <${+o+1}.0.0-0`:Ne(a)?o==="0"?u=`>=${o}.${s}.0${i} <${o}.${+s+1}.0-0`:u=`>=${o}.${s}.0${i} <${+o+1}.0.0-0`:c?(te("replaceCaret pr",c),o==="0"?s==="0"?u=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`:u=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`:u=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`):(te("no pr"),o==="0"?s==="0"?u=`>=${o}.${s}.${a}${i} <${o}.${s}.${+a+1}-0`:u=`>=${o}.${s}.${a}${i} <${o}.${+s+1}.0-0`:u=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),te("caret return",u),u})},iD=(t,e)=>(te("replaceXRanges",t,e),t.split(/\s+/).map(n=>oD(n,e)).join(" ")),oD=(t,e)=>{t=t.trim();let n=e.loose?Re[xe.XRANGELOOSE]:Re[xe.XRANGE];return t.replace(n,(i,r,o,s,a,c)=>{te("xRange",t,i,r,o,s,a,c);let u=Ne(o),l=u||Ne(s),d=l||Ne(a),h=d;return r==="="&&h&&(r=""),c=e.includePrerelease?"-0":"",u?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==="<"&&(c="-0"),i=`${r+o}.${s}.${a}${c}`):l?i=`>=${o}.0.0${c} <${+o+1}.0.0-0`:d&&(i=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),te("xRange return",i),i})},sD=(t,e)=>(te("replaceStars",t,e),t.trim().replace(Re[xe.STAR],"")),aD=(t,e)=>(te("replaceGTE0",t,e),t.trim().replace(Re[e.includePrerelease?xe.GTE0PRE:xe.GTE0],"")),cD=t=>(e,n,i,r,o,s,a,c,u,l,d,h)=>(Ne(i)?n="":Ne(r)?n=`>=${i}.0.0${t?"-0":""}`:Ne(o)?n=`>=${i}.${r}.0${t?"-0":""}`:s?n=`>=${n}`:n=`>=${n}${t?"-0":""}`,Ne(u)?c="":Ne(l)?c=`<${+u+1}.0.0-0`:Ne(d)?c=`<${u}.${+l+1}.0-0`:h?c=`<=${u}.${l}.${d}-${h}`:t?c=`<${u}.${l}.${+d+1}-0`:c=`<=${c}`,`${n} ${c}`.trim()),uD=(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!==Tg.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 bo=N((t8,nE)=>{"use strict";var $o=Symbol("SemVer ANY"),Pg=class t{static get ANY(){return $o}constructor(e,n){if(n=X0(n),e instanceof t){if(e.loose===!!n.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Og("comparator",e,n),this.options=n,this.loose=!!n.loose,this.parse(e),this.semver===$o?this.value="":this.value=this.operator+this.semver.version,Og("comp",this)}parse(e){let n=this.options.loose?Q0[eE.COMPARATORLOOSE]:Q0[eE.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 tE(i[2],this.options.loose):this.semver=$o}toString(){return this.value}test(e){if(Og("Comparator.test",e,this.options.loose),this.semver===$o||e===$o)return!0;if(typeof e=="string")try{e=new tE(e,this.options)}catch{return!1}return Ag(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 rE(e.value,n).test(this.value):e.operator===""?e.value===""?!0:new rE(this.value,n).test(e.semver):(n=X0(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("=")||Ag(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Ag(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};nE.exports=Pg;var X0=wc(),{safeRe:Q0,t:eE}=Jn(),Ag=Eg(),Og=yo(),tE=we(),rE=it()});var wo=N((r8,iE)=>{"use strict";var lD=it(),dD=(t,e,n)=>{try{e=new lD(e,n)}catch{return!1}return e.test(t)};iE.exports=dD});var sE=N((n8,oE)=>{"use strict";var hD=it(),fD=(t,e)=>new hD(t,e).set.map(n=>n.map(i=>i.value).join(" ").trim().split(" "));oE.exports=fD});var cE=N((i8,aE)=>{"use strict";var pD=we(),mD=it(),gD=(t,e,n)=>{let i=null,r=null,o=null;try{o=new mD(e,n)}catch{return null}return t.forEach(s=>{o.test(s)&&(!i||r.compare(s)===-1)&&(i=s,r=new pD(i,n))}),i};aE.exports=gD});var lE=N((o8,uE)=>{"use strict";var vD=we(),yD=it(),_D=(t,e,n)=>{let i=null,r=null,o=null;try{o=new yD(e,n)}catch{return null}return t.forEach(s=>{o.test(s)&&(!i||r.compare(s)===1)&&(i=s,r=new vD(i,n))}),i};uE.exports=_D});var fE=N((s8,hE)=>{"use strict";var Cg=we(),bD=it(),dE=_o(),$D=(t,e)=>{t=new bD(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||dE(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!n||dE(n,o))&&(n=o)}return n&&t.test(n)?n:null};hE.exports=$D});var mE=N((a8,pE)=>{"use strict";var wD=it(),xD=(t,e)=>{try{return new wD(t,e).range||"*"}catch{return null}};pE.exports=xD});var Rc=N((c8,_E)=>{"use strict";var SD=we(),yE=bo(),{ANY:ED}=yE,ID=it(),kD=wo(),gE=_o(),vE=Tc(),TD=Oc(),AD=Ac(),OD=(t,e,n,i)=>{t=new SD(t,i),e=new ID(e,i);let r,o,s,a,c;switch(n){case">":r=gE,o=TD,s=vE,a=">",c=">=";break;case"<":r=vE,o=AD,s=gE,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(kD(t,e,i))return!1;for(let u=0;u<e.set.length;++u){let l=e.set[u],d=null,h=null;if(l.forEach(f=>{f.semver===ED&&(f=new yE(">=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===c||(!h.operator||h.operator===a)&&o(t,h.semver))return!1;if(h.operator===c&&s(t,h.semver))return!1}return!0};_E.exports=OD});var $E=N((u8,bE)=>{"use strict";var PD=Rc(),CD=(t,e,n)=>PD(t,e,">",n);bE.exports=CD});var xE=N((l8,wE)=>{"use strict";var RD=Rc(),ND=(t,e,n)=>RD(t,e,"<",n);wE.exports=ND});var IE=N((d8,EE)=>{"use strict";var SE=it(),DD=(t,e,n)=>(t=new SE(t,n),e=new SE(e,n),t.intersects(e,n));EE.exports=DD});var TE=N((h8,kE)=>{"use strict";var LD=wo(),MD=nt();kE.exports=(t,e,n)=>{let i=[],r=null,o=null,s=t.sort((l,d)=>MD(l,d,n));for(let l of s)LD(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 c=a.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return c.length<u.length?c:e}});var NE=N((f8,RE)=>{"use strict";var AE=it(),Dg=bo(),{ANY:Rg}=Dg,Ng=wo(),Lg=nt(),zD=(t,e,n={})=>{if(t===e)return!0;t=new AE(t,n),e=new AE(e,n);let i=!1;e:for(let r of t.set){for(let o of e.set){let s=jD(r,o,n);if(i=i||s!==null,s)continue e}if(i)return!1}return!0},UD=[new Dg(">=0.0.0-0")],OE=[new Dg(">=0.0.0")],jD=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Rg){if(e.length===1&&e[0].semver===Rg)return!0;n.includePrerelease?t=UD:t=OE}if(e.length===1&&e[0].semver===Rg){if(n.includePrerelease)return!0;e=OE}let i=new Set,r,o;for(let f of t)f.operator===">"||f.operator===">="?r=PE(r,f,n):f.operator==="<"||f.operator==="<="?o=CE(o,f,n):i.add(f.semver);if(i.size>1)return null;let s;if(r&&o){if(s=Lg(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&&!Ng(f,String(r),n)||o&&!Ng(f,String(o),n))return null;for(let p of e)if(!Ng(f,String(p),n))return!1;return!0}let a,c,u,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===">=",u=u||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=PE(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(c=CE(o,f,n),c===f&&c!==o)return!1}else if(o.operator==="<="&&!f.test(o.semver))return!1}if(!f.operator&&(o||r)&&s!==0)return!1}return!(r&&u&&!o&&s!==0||o&&l&&!r&&s!==0||h||d)},PE=(t,e,n)=>{if(!t)return e;let i=Lg(t.semver,e.semver,n);return i>0?t:i<0||e.operator===">"&&t.operator===">="?e:t},CE=(t,e,n)=>{if(!t)return e;let i=Lg(t.semver,e.semver,n);return i<0?t:i>0||e.operator==="<"&&t.operator==="<="?e:t};RE.exports=zD});var zE=N((p8,ME)=>{"use strict";var Mg=Jn(),DE=qn(),FD=we(),LE=bg(),VD=cr(),ZD=s0(),BD=c0(),GD=d0(),WD=p0(),HD=g0(),qD=y0(),JD=b0(),KD=w0(),YD=nt(),XD=I0(),QD=T0(),eL=kc(),tL=C0(),rL=N0(),nL=_o(),iL=Tc(),oL=xg(),sL=Sg(),aL=Ac(),cL=Oc(),uL=Eg(),lL=Z0(),dL=G0(),hL=bo(),fL=it(),pL=wo(),mL=sE(),gL=cE(),vL=lE(),yL=fE(),_L=mE(),bL=Rc(),$L=$E(),wL=xE(),xL=IE(),SL=TE(),EL=NE();ME.exports={parse:VD,valid:ZD,clean:BD,inc:GD,diff:WD,major:HD,minor:qD,patch:JD,prerelease:KD,compare:YD,rcompare:XD,compareLoose:QD,compareBuild:eL,sort:tL,rsort:rL,gt:nL,lt:iL,eq:oL,neq:sL,gte:aL,lte:cL,cmp:uL,coerce:lL,truncate:dL,Comparator:hL,Range:fL,satisfies:pL,toComparators:mL,maxSatisfying:gL,minSatisfying:vL,minVersion:yL,validRange:_L,outside:bL,gtr:$L,ltr:wL,intersects:xL,simplifyRange:SL,subset:EL,SemVer:FD,re:Mg.re,src:Mg.src,tokens:Mg.t,SEMVER_SPEC_VERSION:DE.SEMVER_SPEC_VERSION,RELEASE_TYPES:DE.RELEASE_TYPES,compareIdentifiers:LE.compareIdentifiers,rcompareIdentifiers:LE.rcompareIdentifiers}});var ZE=N((x8,zg)=>{var Lc=process||{},FE=Lc.argv||[],Dc=Lc.env||{},AL=!(Dc.NO_COLOR||FE.includes("--no-color"))&&(!!Dc.FORCE_COLOR||FE.includes("--color")||Lc.platform==="win32"||(Lc.stdout||{}).isTTY&&Dc.TERM!=="dumb"||!!Dc.CI),OL=(t,e,n=t)=>i=>{let r=""+i,o=r.indexOf(e,t.length);return~o?t+PL(r,e,n,o)+e:t+r+e},PL=(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)},VE=(t=AL)=>{let e=t?OL:()=>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")}};zg.exports=VE();zg.exports.createColors=VE});var Bg=N((K8,cI)=>{"use strict";var Zg={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"},eM={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},tM={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?Zg.up():"");return t&&(e+=Zg.left),e}};cI.exports={cursor:Zg,scroll:eM,erase:tM,beep:"\x07"}});function ik(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 ou,ok=g(()=>{"use strict";ou=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 ak(t){return t.byteLength/2/dz}function hz(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 sk,dz,su,ck=g(()=>{"use strict";he();Ur();sk=32,dz=16,su=class{constructor(e,n,i={}){this.vad=e;this.onSpeech=n;this.speechThreshold=i.speechThreshold??.5,this.onsetMs=i.onsetMs??2*sk,this.holdoffMs=i.holdoffMs??300,this.energyThreshold=i.energyThreshold??.01,this.log=i.log??j}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(Xe(e,this.energyThreshold),ak(e));return}this.vad.process(hz(e)).then(n=>{if(!this.closed)for(let i of n)this.applyVerdict(i>=this.speechThreshold,sk)},n=>{this.closed||(this.degrade(n),this.applyVerdict(Xe(e,this.energyThreshold),ak(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 uv={};Je(uv,{DecibriCapture:()=>av,DecibriPlayback:()=>cv,hasInputDevice:()=>mz});import{Microphone as fz,Speaker as pz,inputDevices as lk}from"decibri";function mz(){try{return lk().length>0}catch(t){return j.debug("audio input enumeration failed; treating as no microphone",{error:t}),!1}}function gz(){try{let t=lk(),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){j.debug("could not read default input device; opening at 16k mono",{error:t})}return{sampleRate:Oo,channels:au}}function vz(t){return Math.max(64,Math.min(65536,Math.round(t/10)))}function yz(t,e,n){let i=new Uint8Array(t),r=new Int16Array(i.buffer,0,i.byteLength>>1),o=n.process(ik(r,e));return Buffer.from(o.buffer,o.byteOffset,o.byteLength)}function $z(t){return Buffer.from(t.buffer,t.byteOffset,t.byteLength)}var Oo,au,dk,uk,av,_z,bz,cv,lv=g(()=>{"use strict";he();Ur();ok();ck();Oo=16e3,au=1,dk="int16",uk=.01;av=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}=gz(),r=(this.deps.createVad??(()=>new Mr))(),o=null;try{await r.load(),o=new su(r,()=>e.onSpeechStart(),{energyThreshold:uk})}catch(c){j.debug("silero vad unavailable; barge-in falls back to decibri energy vad",{error:c}),r.dispose().catch(()=>{})}let s;try{s=await fz.open({sampleRate:n,channels:i,dtype:dk,...o?{vad:!1}:{vad:"energy",vadThreshold:uk},framesPerBuffer:vz(n)})}catch(c){throw o?.close(),o&&r.dispose().catch(()=>{}),c}this.vad=o?r:null,this.detector=o;let a=n===Oo&&i===au?null:new ou(n,Oo);this.onData=a?c=>{let u=yz(c,i,a);u.byteLength>0&&(this.detector?.feed(u),e.onFrame(u,Date.now()))}:c=>{this.detector?.feed(c),e.onFrame(c,Date.now())},this.onSpeech=()=>e.onSpeechStart(),this.onErr=c=>e.onError(c),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(()=>{})}},_z=Oo*au*2/1e3,bz=250,cv=class{speaker=null;writeChain=Promise.resolve();generation=0;closed=!1;playoutEndAtMs=0;drainWakes=new Set;nativeDrainSpent=!1;playoutTap=null;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($z(e)),this.closed||n!==this.generation)return;let r=Math.max(this.playoutEndAtMs,Date.now());this.playoutEndAtMs=r+e.byteLength/_z;try{this.playoutTap?.(e,r)}catch(o){j.debug("playout tap failed",{error:o})}}catch(i){j.debug("playback write skipped",{error:i})}})}setPlayoutTap(e){this.playoutTap=e}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;if(!this.nativeDrainSpent){this.nativeDrainSpent=!0;let i=Promise.resolve().then(()=>e.drainAsync()).catch(s=>{j.debug("playback drain interrupted",{error:s})}),r=Math.max(0,this.playoutEndAtMs-Date.now())+bz,o=this.sleep(r);await Promise.race([i,o.done]),o.wake()}let n=this.playoutEndAtMs-Date.now();n>0&&await this.sleep(n).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===null&&(this.speaker=new pz({sampleRate:Oo,channels:au,dtype:dk}),this.nativeDrainSpent=!1),this.speaker}}});he();Ur();ji();import{readFileSync as wz}from"node:fs";import{randomUUID as xz}from"node:crypto";var vt=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}},zt=class extends vt{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var go=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 zt(`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 yc(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}import{EventEmitter as pR}from"node:events";import vg from"node:child_process";import Ut from"node:path";import bc from"node:fs";import G from"node:process";import{stripVTControlCharacters as mR}from"node:util";import{stripVTControlCharacters as dR}from"node:util";var vo=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=>yc(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 c=n.visibleArguments(e).map(d=>o(n.styleArgumentTerm(n.argumentTerm(d)),n.styleArgumentDescription(n.argumentDescription(d))));if(s=s.concat(this.formatItemList("Arguments:",c,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(`
|
|
190
|
-
`)}displayWidth(e){return
|
|
191
|
-
`+" ".repeat(
|
|
192
|
-
${s}`)}boxWrap(e,
|
|
193
|
-
`)}};var Wn=class{constructor(e,
|
|
200
|
+
`,Lt=class extends Error{status;constructor(e,r){super(e),this.status=r,this.name="TurnEvaluatorError"}},Bn=class{key;fetchImpl;timeoutMs;constructor(e,r=fetch,i=xR){this.key=e,this.fetchImpl=r,this.timeoutMs=i}async evaluate(e,r){let i={model:wR,max_tokens:kR,temperature:0,stop_sequences:IR,system:AR,messages:[{role:"user",content:OR(e)},{role:"assistant",content:WS}]},n;try{n=await this.fetchImpl(SR,{method:"POST",headers:{"x-api-key":this.key,"anthropic-version":ER,"content-type":"application/json"},body:JSON.stringify(i),signal:AbortSignal.any([r,AbortSignal.timeout(this.timeoutMs)])})}catch(s){throw s instanceof Error&&(s.name==="TimeoutError"||s.name==="AbortError")?s:new Lt(be(s,this.key))}if(!n.ok)throw new Lt(`turn evaluator request failed (HTTP ${n.status})`,n.status);let o;try{o=await n.json()}catch{throw new Lt("turn evaluator response body was not JSON")}return PR(o)}}});function hg(t){return t===void 0?yc:{id:yc.id,engineVoice:{...yc.engineVoice,"elevenlabs-flash":{kind:"preset",voiceId:t}}}}var _c,yc,fg=g(()=>{"use strict";_c="21m00Tcm4TlvDq8ikWAM",yc={id:"jarvis-primary",engineVoice:{"elevenlabs-flash":{kind:"preset",voiceId:_c}}}});var bc,HS=g(()=>{"use strict";he();bc=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,r,i=j){this.turnId=e,this.openedAtMs=r,this.log=i}endpointerCommitted(e,r){this.decider===null&&(this.decider=e,this.silenceOnsetAtMs=r)}smartTurnResolved(e,r,i){this.log.debug("smart-turn P(complete)",{turnId:this.turnId,probability:e,inferenceMs:r,outcome:i})}smartTurnDegraded(e,r){this.log.debug("smart-turn DEGRADED to baseline - inference failed; this turn endpoints on baseline timers only",{turnId:this.turnId,inferenceMs:e,error:r instanceof Error?r.message:String(r)})}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,r,i,n){this.log.debug("semantic evaluator resolved",{turnId:this.turnId,verdict:e,confidence:r,latencyMs:i,outcome:n})}evaluatorFailed(e,r){this.log.debug("semantic evaluator failed - no signal; this episode endpoints as armed",{turnId:this.turnId,latencyMs:e,error:r instanceof Error?r.message:String(r)})}committed(e,r){this.commitAtMs===null&&(r==="ptt"&&this.heldOpen&&this.heldExited("ptt"),this.commitAtMs=e,r==="ptt"&&(this.decider??="ptt"))}asrFinalResolved(e,r){this.asrFinalAtMs===null&&(this.asrFinalAtMs=e,this.transcriptLength=r)}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,r,i,n){this.log.debug("addressee evaluator resolved",{turnId:this.turnId,verdict:e,confidence:r,latencyMs:i,outcome:n})}addresseeFailed(e,r){this.log.debug("addressee evaluator failed - no signal; the reply speaks",{turnId:this.turnId,latencyMs:e,error:r instanceof Error?r.message:String(r)})}markAsideCommit(){this.asideCommit=!0}confirmationFired(){this.log.debug("aside confirmation fired - the lexical wakeword opened the gate",{turnId:this.turnId})}confirmationResolved(e,r,i,n){this.log.debug("aside confirmation resolved",{turnId:this.turnId,verdict:e,confidence:r,latencyMs:i,outcome:n})}confirmationFailed(e,r){this.log.debug("aside confirmation failed - torn with the name spoken: resuming",{turnId:this.turnId,latencyMs:e,error:r instanceof Error?r.message:String(r)})}completed(e,r){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,...r!==void 0&&r.rounds>0&&{toolRounds:r.rounds,toolMs:r.totalMs}}))}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,r){return e===null||r===null?null:r-e}}});function NR(t){return DR.test(t)}var qS,JS,CR,RR,$c,DR,wc,KS=g(()=>{"use strict";Vp();rc();HS();qS=16e3,JS="pcm_s16le",CR="en",RR=["Jarvis"],$c=.7,DR=/\bjarvis\b/i;wc=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 bc(e.turnId,e.clock.now()),e.controller.attachTelemetry?.(this.timeline),e.controller.setPartialStability?.(e.asrEngine.partialStability??"stable"),this.asrStream=e.asrEngine.open({sampleRate:qS,encoding:JS,language:CR,biasTerms:RR,emitPartials:!0}),this.asrStream.onTranscript(r=>this.handleTranscript(r)),this.asrStream.onError(r=>this.finishError("turn_failed",r)),e.controller.onCommit(()=>this.finalize(this.lastFrameAtMs,"controller")),e.emit({type:"state",turnId:e.turnId,state:"processing"})}pushFrame(e,r){this.phase!=="capturing"||this.settled||(this.lastFrameAtMs=r,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,r){this.phase!=="capturing"||this.finalizing||this.settled||(this.finalizing=!0,this.timeline.committed(this.deps.clock.now(),r),this.deps.controller.dispose(),this.finalizeAndRespond(e,r))}async finalizeAndRespond(e,r){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 n=this.deps.addressee;if(r==="ptt"&&n?.floorState()==="aside")try{n.onFloorReleased("explicit")}catch{}if(i.text.trim()===""){this.finishBlank();return}this.phase="responding";let o=this.buildUserTurn(i.text,e);if(n?.floorState()==="aside")return this.runAside(o,n);n?(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,r){if(this.timeline.markAsideCommit(),!NR(e.text)){this.finishAsideAbsorbed(e,r);return}let i=this.deps.clock.now();this.timeline.confirmationFired();let n;try{n=await r.evaluator.evaluate({recentTurns:r.recentTurns(),utterance:e.text},this.reasonAbort.signal,{timeoutMs:ox})}catch(s){if(this.settled)return;this.timeline.confirmationFailed(this.deps.clock.now()-i,s)}if(this.settled)return;let o=!0;if(n&&(o=!((n.verdict==="to_other"||n.verdict==="self_talk")&&n.confidence>=$c),this.timeline.confirmationResolved(n.verdict,n.confidence,this.deps.clock.now()-i,o?"resumed":"stayed")),!o){this.finishAsideAbsorbed(e,r,n);return}try{r.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 r of e.deltas)this.deps.emit({type:"response.delta",turnId:this.deps.turnId,text:r});for(let r of e.audio)this.deps.emit({type:"response.audio",turnId:this.deps.turnId,audio:r});this.releaseDispatchWaiters()}}dispatchWaiters=[];releaseDispatchWaiters(){let e=this.dispatchWaiters;this.dispatchWaiters=[];for(let r of e)r()}awaitDispatchGate(){return this.pendingDispatch===null?Promise.resolve():new Promise(e=>{this.dispatchWaiters.push(e);let r=this.reasonAbort.signal;if(r.aborted){e();return}r.addEventListener("abort",()=>e(),{once:!0})})}fireAddressee(e){let r=this.deps.addressee;if(!r)return;let i=this.deps.clock.now();this.timeline.addresseeFired();try{r.evaluator.evaluate({recentTurns:r.recentTurns(),utterance:e.text},this.reasonAbort.signal).then(n=>this.onAddresseeVerdict(n.verdict,n.confidence,this.deps.clock.now()-i),n=>this.onAddresseeFailed(this.deps.clock.now()-i,n))}catch(n){this.onAddresseeFailed(this.deps.clock.now()-i,n)}}onAddresseeVerdict(e,r,i){if(this.settled||this.pendingDispatch===null){this.timeline.addresseeResolved(e,r,i,"late");return}if(!(e==="to_other"||e==="self_talk")||r<$c){this.timeline.addresseeResolved(e,r,i,"agreed"),this.resolveDispatched();return}this.absorbPending={verdict:e,confidence:r,latencyMs:i},this.reasonAbort.abort()}onAddresseeFailed(e,r){this.settled||(this.timeline.addresseeFailed(e,r),this.resolveDispatched())}async respond(e){let r=!1,i=!1,n=this.deps.ttsEngine.speak({voice:this.deps.voice,sampleRate:qS,encoding:JS});this.ttsStream=n,n.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})}}),n.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}if(r||(r=!0,this.timeline.firstReasonerDelta(this.deps.clock.now())),s.type!=="text"){if(s.type==="tool.start"){for(let a of this.deps.segmenter.flush())n.pushText(a);if(this.pendingDispatch){if(await this.awaitDispatchGate(),this.settled)return;if(this.absorbPending){this.finishAbsorbed();return}}}Sa(a=>this.deps.emit(a),this.deps.turnId,s);continue}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))n.pushText(a)}if(!this.settled){if(this.absorbPending){let{verdict:s,confidence:a,latencyMs:c}=this.absorbPending;this.absorbPending=null,this.timeline.addresseeResolved(s,a,c,"late")}this.resolveDispatched();for(let s of this.deps.segmenter.flush())n.pushText(s);await n.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,r=this.absorbPending;if(!e||!r){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(r.verdict,r.confidence,r.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:r.verdict,confidence:r.confidence})}catch{}}finishAsideAbsorbed(e,r,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{r.onAbsorbed(e.text,i)}catch{}}}finishDone(){this.settled||(this.settled=!0,this.timeline.completed(this.deps.clock.now(),this.deps.reasoner.lastTurnTools()),this.deps.emit({type:"response.done",turnId:this.deps.turnId}),this.deps.onComplete())}finishError(e,r){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:r instanceof Error?r.message:String(r)}),this.deps.onComplete())}buildUserTurn(e,r){return{source:"voice",turnId:this.deps.turnId,sessionId:this.deps.sessionId,deviceId:this.deps.deviceId,text:e,startMs:this.deps.startMs,endMs:r,...this.deps.projectId!==void 0&&{projectId:this.deps.projectId}}}}});import{randomUUID as pg}from"node:crypto";import{realpathSync as LR}from"node:fs";import{homedir as MR}from"node:os";function YS(t){return t.role!=="user"&&t.role!=="assistant"||"toolCalls"in t||t.content===""?null:{role:t.role,text:t.content}}var mg,gg,Gn,lo,xc,XS=g(()=>{"use strict";he();Xt();ji();Vp();Ka();bm();Xw();Qw();ex();nx();Qt();ix();rc();wm();Fi();Er();eg();sg();ug();dg();fg();KS();mg=6,gg=45e3,Gn=class extends Error{constructor(e){super(e),this.name="ReasonerUnavailableError"}},lo=class extends Error{constructor(e){super(e),this.name="VoiceUnavailableError"}},xc=class{deps;sessionId;deviceId;projectId;queue=new tc;closed=!1;eventsConsumed=!1;inFlight=!1;reasoner=null;reasonerRoute=null;turnAbort=null;voiceTurn=null;voiceTurnFailed=!1;voiceEngines=null;clock;newTurnController;newSmartTurnInference;newFrameClassifier;newTurnEvaluator;newSegmenter;smartTurnInference=null;frameClassifier=null;turnEvaluator=void 0;newAddresseeEvaluator;addresseeEvaluator=void 0;absorbedFinals=[];floorState="engaged";asideDecayTimer=null;lastSpeechAtMs=0;cwd;constructor(e,r,i){this.deps=i,this.sessionId=e,this.deviceId=r.deviceId,this.projectId=r.projectId,this.cwd=r.launchDir??MR(),this.clock=i.clock??new Tt,this.newSmartTurnInference=i.createSmartTurnInference??(()=>new uo),this.newFrameClassifier=i.createFrameClassifier??(()=>new Zi(new Mr)),this.newTurnEvaluator=i.createTurnEvaluator??(n=>new Bn(n)),this.newAddresseeEvaluator=i.createAddresseeEvaluator??(n=>new Mn(n)),this.newTurnController=i.createTurnController??(n=>{let o=this.ensureFrameClassifier();return o.reset?.(),new co(n,this.ensureSmartTurnInference(),{},this.speechObservingClassifier(o),this.semanticHook())}),this.newSegmenter=i.createSegmenter??(()=>new eo),this.emit({type:"session.ready"})}async send(e){let{commandId:r}=e;if(this.closed)throw new Fe(r,"closed");if(e.sessionId!==this.sessionId)throw new Fe(r,"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 Fe(r,"unsupported");default:throw new Fe(r,"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 r=this.frameClassifier;this.frameClassifier=null;let i=this.turnEvaluator;this.turnEvaluator=null;let n=this.addresseeEvaluator;this.addresseeEvaluator=null,this.queue.close();let o=[];if(e&&o.push(e.dispose().catch(()=>{})),r?.dispose&&o.push(r.dispose().catch(()=>{})),i?.dispose&&o.push(i.dispose().catch(()=>{})),n?.dispose&&o.push(n.dispose().catch(()=>{})),o.length>0)return Promise.all(o).then(()=>{})}return Promise.resolve()}acceptTextInput(e){if(e.text.trim().length===0)throw new Fe(e.commandId,"invalid","input.text requires non-empty text");if(this.inFlight)throw new Fe(e.commandId,"backpressured","a turn is already in progress (one turn at a time in v0.1)");this.inFlight=!0,this.exitAside("explicit");let r=pg();this.emit({type:"turn.accepted",turnId:r,clientTurnId:e.clientTurnId,source:"text",commandId:e.commandId}),this.emit({type:"turn.final",turnId:r,turn:this.toTextUserTurn(r,e),commandId:e.commandId}),this.runTextTurn(r,e)}async runTextTurn(e,r){let i=new AbortController;this.turnAbort=i;try{let n=this.ensureReasoner();this.emit({type:"state",turnId:e,state:"responding"});for await(let o of n.run(r.text,i.signal))o.type==="text"?this.emit({type:"response.delta",turnId:e,text:o.text}):Sa(s=>this.emit(s),e,o);this.emit({type:"response.done",turnId:e})}catch(n){let o=n instanceof Gn?"no_text_route":"turn_failed";this.emit({type:"error",turnId:e,commandId:r.commandId,reason:o,message:n instanceof Error?n.message:String(n)})}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 Fe(e.commandId,"backpressured","a turn is already in progress (one turn at a time in v0.1)");this.inFlight=!0;let r=pg();this.emit({type:"turn.accepted",turnId:r,clientTurnId:e.clientTurnId,source:"voice",commandId:e.commandId});let i=this.resolveVoicePipeline(r,e.commandId);if(!i){this.voiceTurnFailed=!0;return}let n=this.addresseeHook();this.voiceTurn=new wc({turnId:r,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:i.engines.voice,reasoner:i.reasoner,controller:this.newTurnController(this.clock),segmenter:this.newSegmenter(),clock:this.clock,emit:o=>this.emit(o),...n!==void 0&&{addressee:n},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,r){let i;try{i=this.ensureVoiceEngines()}catch(o){return this.emitTurnError(e,r,"no_voice_route",o),null}let n;try{n=this.ensureReasoner()}catch(o){let s=o instanceof Gn?"no_text_route":"turn_failed";return this.emitTurnError(e,r,s,o),null}return{engines:i,reasoner:n}}ensureVoiceEngines(){if(this.voiceEngines)return this.voiceEngines;if(!this.deps.voiceRegistry)throw new lo("voice is not available in this core build");let e=this.deps.configService.resolved(),r=e.routes?.stt,i=e.routes?.tts;if(!r||!i)throw new lo("no voice route configured - run 'jarvis init' to set routes.stt and routes.tts");let n=!e.secrets?.[r.provider]&&Cr(r.provider),o=!e.secrets?.[i.provider]&&Cr(i.provider);if(n||o){let u=n?r.provider:i.provider;throw new lo(`no API key for voice provider '${u}' - run 'jarvis init' to add it`)}let s=this.deps.voiceRegistry.asrEngine({provider:r.provider,model:r.model,...r.url!==void 0&&{url:r.url}},e.secrets?.[r.provider]??""),a=this.deps.voiceRegistry.ttsEngine({provider:i.provider,model:i.model},e.secrets?.[i.provider]??""),c=this.deps.voiceIdentity??hg(i.voiceId);return this.voiceEngines={asrEngine:s,ttsEngine:a,voice:c},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 r=this.reasonerRoute;this.turnEvaluator=r?.provider==="anthropic"?this.newTurnEvaluator(r.key):null}return this.turnEvaluator===null?void 0:{evaluator:this.turnEvaluator,recentTurns:()=>{let r=[];for(let i of this.reasoner?.historySnapshot()??[]){let n=YS(i);n&&r.push(n)}return r.slice(-mg)}}}addresseeHook(){if(this.addresseeEvaluator===void 0){let r=this.reasonerRoute;try{this.addresseeEvaluator=r?.provider==="anthropic"?this.newAddresseeEvaluator(r.key):null}catch(i){this.addresseeEvaluator=null,j.debug("addressee evaluator construction failed - the layer is absent",{error:be(i,r?.key)})}}return this.addresseeEvaluator===null?void 0:{evaluator:this.addresseeEvaluator,recentTurns:()=>this.addresseeContext(),onAbsorbed:(r,i)=>{this.recordAbsorbedFinal(r),this.noteSpeech(),i?.verdict==="to_other"&&i.confidence>=$c&&this.enterAside(i.confidence)},floorState:()=>this.floorState,onFloorReleased:r=>this.exitAside(r)}}enterAside(e){this.floorState!=="aside"&&(this.floorState="aside",this.noteSpeech(),this.armAsideDecay(gg),j.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),j.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>=gg?this.exitAside("decay"):this.armAsideDecay(gg-e)}noteSpeech(){this.lastSpeechAtMs=this.clock.now()}speechObservingClassifier(e){return{classify:(r,i)=>e.classify(r,n=>{n&&this.noteSpeech(),i(n)})}}addresseeContext(){let e=this.reasoner?.historySnapshot()??[],r=[],i=0;for(let n=0;n<=e.length;n++){for(;i<this.absorbedFinals.length&&this.absorbedFinals[i].afterHistoryLen===n;)r.push({role:"user",text:this.absorbedFinals[i].text}),i+=1;let o=e[n],s=o?YS(o):null;s&&r.push(s)}return r.slice(-mg)}recordAbsorbedFinal(e){this.absorbedFinals.push({afterHistoryLen:this.reasoner?.historySnapshot().length??0,text:e}),this.absorbedFinals.length>mg&&this.absorbedFinals.shift()}ensureReasoner(){if(this.reasoner)return this.reasoner;let e=this.deps.configService.resolved(),r=e.routes?.text;if(!r)throw new Gn("no text model is configured - run 'jarvis init' to set routes.text");let i=e.secrets?.[r.provider];if(!i)throw new Gn(`no API key for text provider '${r.provider}' - run 'jarvis init' to add it`);let n=this.deps.registry.textAdapter({provider:r.provider,model:r.model},i);return this.reasoner=new Qi(n,r.model,this.deps.systemPrompt,this.buildTools()),this.reasonerRoute={provider:r.provider,key:i},this.reasoner}buildTools(){let e=ke.dir(),r=e;try{r=LR(e)}catch{}let i=new Qa(r),n=new Ya;n.add(i);let o=new Xa;return o.register(Yw),{registry:o,hooks:n,cwd:this.cwd,logger:j,guard:i}}toTextUserTurn(e,r){return{source:"text",turnId:e,sessionId:this.sessionId,deviceId:this.deviceId,text:r.text,atMs:r.atMs,...this.projectId!==void 0&&{projectId:this.projectId}}}emitTurnError(e,r,i,n){this.emit({type:"error",turnId:e,commandId:r,reason:i,message:n instanceof Error?n.message:String(n)}),this.inFlight=!1}emit(e){this.queue.push({...e,sessionId:this.sessionId,eventId:pg(),atMs:Date.now()})}}});function zR(t,e,r){let i=new URL(t);i.searchParams.set("model_id",e),i.searchParams.set("audio_format",UR(r)),i.searchParams.set("commit_strategy","manual"),r.language&&i.searchParams.set("language_code",r.language);for(let n of r.biasTerms??[])i.searchParams.append("keyterms",n);return i.toString()}function UR(t){return t.encoding==="pcm_s16le"?`pcm_${t.sampleRate}`:"pcm_16000"}var QS,ho,vg,yg=g(()=>{"use strict";Ta();QS="wss://api.elevenlabs.io/v1/speech-to-text/realtime",ho=class{apiKey;socketFactory;model;endpoint;id="elevenlabs-scribe";constructor(e,r,i,n=QS){this.apiKey=e,this.socketFactory=r,this.model=i,this.endpoint=n}open(e){return new vg(this.apiKey,this.socketFactory,this.model,this.endpoint,e)}},vg=class{opts;socket;opened=!1;aborted=!1;closed=!1;pending=[];committed=[];transcriptCb;errorCb;endPending=null;commitRequested=!1;constructor(e,r,i,n,o){this.opts=o,this.socket=r(zR(n,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,r)=>{this.endPending={resolve:e,reject:r},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 r=kn(e);if(!r)return;let i=Ia(r);if(i){this.handleError(new Error(`stream error (${i})`));return}let n=r.message_type;if(n==="partial_transcript"){this.opts.emitPartials&&this.transcriptCb?.({text:Bi(r.text),isFinal:!1,startMs:0});return}if(n==="committed_transcript"||n==="committed_transcript_with_timestamps"){let o=Bi(r.text);o.length>0&&this.committed.push(o),this.endPending&&this.resolveEnd()}}handleError(e){if(this.closed)return;let r=In("ElevenLabs ASR",e);if(this.endPending){let{reject:i}=this.endPending;this.endPending=null,i(r)}this.errorCb?.(r),this.teardown()}handleClose(){if(this.closed)return;this.closed=!0;let e=new Error("ElevenLabs ASR connection closed unexpectedly");if(this.endPending){let{reject:r}=this.endPending;this.endPending=null,r(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:r}=this.endPending;this.endPending=null,this.teardown(),r(e)}sendChunk(e,r){this.socket.send(JSON.stringify({message_type:"input_audio_chunk",audio_base_64:U$(e),commit:r,sample_rate:this.opts.sampleRate}))}sendCommit(){this.sendChunk(new Uint8Array(0),!0)}teardown(){this.closed||(this.closed=!0,this.socket.close())}}});import{randomUUID as jR}from"node:crypto";function VR(t,e){let r=t.engineVoice[e];if(!r)throw new Error(`voice '${t.id}' has no '${e}' engineVoice mapping`);if(r.kind!=="preset")throw new Error(`the ${e} adapter needs a preset voiceId for '${t.id}', got kind '${r.kind}'`);return r.voiceId}function ZR(t,e,r,i){let n=new URL(t.replace("{voice_id}",encodeURIComponent(e)));return n.searchParams.set("model_id",r),n.searchParams.set("output_format",BR(i)),n.searchParams.set("inactivity_timeout","180"),n.searchParams.set("auto_mode","true"),n.toString()}function BR(t){return t.encoding==="pcm_s16le"?`pcm_${t.sampleRate}`:"pcm_16000"}var e0,FR,fo,_g,bg=g(()=>{"use strict";Ta();e0="wss://api.elevenlabs.io/v1/text-to-speech/{voice_id}/multi-stream-input",FR={stability:.5,similarity_boost:.75,use_speaker_boost:!0},fo=class{apiKey;socketFactory;model;endpointTemplate;id="elevenlabs-flash";constructor(e,r,i,n=e0){this.apiKey=e,this.socketFactory=r,this.model=i,this.endpointTemplate=n}speak(e){return new _g(this.apiKey,this.socketFactory,this.model,this.endpointTemplate,this.id,e)}},_g=class{socket;contextId=jR();opened=!1;cancelled=!1;closed=!1;endRequested=!1;closeContextSent=!1;pending=[];audioCb;errorCb;endPending=null;constructor(e,r,i,n,o,s){let a=VR(s.voice,o);this.socket=r(ZR(n,a,i,s),{"xi-api-key":e}),this.socket.onOpen(()=>this.handleOpen()),this.socket.onMessage(c=>this.handleMessage(c)),this.socket.onError(c=>this.handleError(c)),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,r)=>{this.endPending={resolve:e,reject:r},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 r=kn(e);if(!r)return;let i=Ia(r);if(i){this.handleError(new Error(`stream error (${i})`));return}typeof r.audio=="string"&&r.audio.length>0&&this.audioCb?.(j$(r.audio)),(r.isFinal===!0||r.is_final===!0)&&this.resolveEnd()}handleError(e){if(this.closed)return;let r=In("ElevenLabs TTS",e);if(this.endPending){let{reject:i}=this.endPending;this.endPending=null,i(r)}this.errorCb?.(r),this.teardown()}handleClose(){if(this.closed)return;this.closed=!0;let e=new Error("ElevenLabs TTS connection closed unexpectedly");if(this.endPending){let{reject:r}=this.endPending;this.endPending=null,r(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:FR,context_id:this.contextId}))}sendText(e){let r=e.endsWith(" ")?e:`${e} `;this.socket.send(JSON.stringify({text:r,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())}}});function GR(t){if(t===void 0)return;let e;try{e=new URL(t).protocol}catch{throw new Error("sherpa-onnx ASR route url must be a valid ws:// or wss:// URL")}if(e!=="ws:"&&e!=="wss:")throw new Error(`sherpa-onnx ASR route url must use the ws:// or wss:// scheme (got '${e}//' - this is a WebSocket endpoint, not HTTP)`)}var po,$g=g(()=>{"use strict";yg();bg();qp();Oa();Ga();po=class{socketFactory;fetchImpl;constructor(e=Ln,r=fetch){this.socketFactory=e,this.fetchImpl=r}asrEngine(e,r){switch(e.provider){case"elevenlabs":return new ho(r,this.socketFactory,e.model);case"sherpa-onnx":return GR(e.url),new Gi(this.socketFactory,e.url);case"openai-compat":return new ka(this.fetchImpl,e.url,e.model,r);default:throw new Error(`no stt adapter for provider '${e.provider}'`)}}ttsEngine(e,r){if(e.provider==="elevenlabs")return new fo(r,this.socketFactory,e.model);throw new Error(`no tts adapter for provider '${e.provider}'`)}}});import{randomUUID as WR}from"node:crypto";function xg(t={}){let e=new Sr;j.setLevel(e.logLevel),j.debug("core created",{logLevel:e.logLevel});let{fetchImpl:r}=t,i={configService:t.configService??new je,registry:t.registry??new Ui(r),voiceRegistry:t.voiceRegistry??new po(t.voiceSocketFactory,r),createTurnEvaluator:t.createTurnEvaluator??(n=>new Bn(n,r)),createAddresseeEvaluator:t.createAddresseeEvaluator??(n=>new Mn(n,r)),...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 wg(i)}var HR,qR,wg,t0=g(()=>{"use strict";he();Dp();Np();Fp();XS();rc();dg();$g();HR="jarvis-core",qR="0.1.0-dev",wg=class{deps;constructor(e){this.deps=e}describe(){return Promise.resolve({name:HR,version:qR})}openSession(e){let r=WR();return j.debug("core opened session",{sessionId:r,capabilities:e.clientCapabilities}),Promise.resolve(new xc(r,e,this.deps))}}});import{readFileSync as JR,writeFileSync as KR}from"node:fs";function mo(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function QR(t){let e={};if(!mo(t))return e;for(let r of XR){let i=t[r];if(!Array.isArray(i))continue;let n=[];for(let o of i)!mo(o)||typeof o.id!="string"||n.push(typeof o.label=="string"?{id:o.id,label:o.label}:{id:o.id});n.length>0&&(e[r]=n)}return e}var n0,i0,r0,YR,XR,Mt,o0=g(()=>{"use strict";Xt();Ka();Qt();n0="model-catalogue.json",i0=1440*60*1e3,r0=1,YR={stt:!0,tts:!0,text:!0,embedding:!0},XR=Object.keys(YR);Mt=class{fetchImpl;timeoutMs=3e3;home;now;ttlMs;providers;fetchFailed=new Set;constructor(e=fetch,r){this.fetchImpl=e,this.home=r?.home??ke,this.now=r?.now??(()=>Date.now()),this.ttlMs=r?.ttlMs??i0,this.providers=Ja}async models(e,r,i){let n=this.providers[e],o=n?.defaultModel[r],s=n?.fastModel?.[r],a={source:"prefill",models:o===void 0?[]:[{id:o}],recommended:o,recommendedFast:s};if(!n?.listModels||!n.capabilities.includes(r))return a;let c=this.readCacheEntry(e),u=c?.models[r],l=c===void 0?0:Math.max(0,this.now()-c.fetchedAtMs),d=f=>({source:"cache",models:f,recommended:o,recommendedFast:s,cacheAgeMs:l});if(c!==void 0){let f=this.now()-c.fetchedAtMs;if(f>=0&&f<this.ttlMs)return u===void 0?a:d(u)}let h=await this.tryFetch(e,n,i);if(h!==void 0){let f=h[r];return f===void 0?a:{source:"live",models:f,recommended:o,recommendedFast:s}}return u!==void 0?d(u):a}async refresh(e,r){let i=this.providers[e];if(!i?.listModels)return{ok:!1,status:"no-lister"};this.fetchFailed.delete(e);let n=o=>{let s=this.readCacheEntry(e);return s===void 0?{ok:!1,status:"failed",detail:o}:{ok:!1,status:"failed",detail:o,cached:{models:s.models,cacheAgeMs:Math.max(0,this.now()-s.fetchedAtMs)}}};if(i.keylessLister!==!0&&r?.key===void 0)return n("no API key available");try{let o=r?.signal??AbortSignal.timeout(this.timeoutMs),s=await i.listModels(r?.key,this.fetchImpl,o);return this.writeCacheEntry(e,s),{ok:!0,status:"refreshed",models:s}}catch(o){return n(be(o,r?.key))}}cached(e,r){let i=this.readCacheEntry(e),n=i?.models[r];if(i===void 0||n===void 0)return;let o=this.now()-i.fetchedAtMs;return{models:n,cacheAgeMs:Math.max(0,o),fresh:o>=0&&o<this.ttlMs}}async tryFetch(e,r,i){if(r.listModels!==void 0&&!this.fetchFailed.has(e)&&!(r.keylessLister!==!0&&i?.key===void 0))try{let n=i?.signal??AbortSignal.timeout(this.timeoutMs),o=await r.listModels(i?.key,this.fetchImpl,n);return this.writeCacheEntry(e,o),o}catch{this.fetchFailed.add(e);return}}cachePath(){return this.home.resolve(n0)}readCacheFile(){let e;try{e=JSON.parse(JR(this.cachePath(),"utf8"))}catch{return}if(!(!mo(e)||e.version!==r0))return mo(e.providers)?e.providers:void 0}readCacheEntry(e){let r=this.readCacheFile()?.[e];if(!mo(r))return;let{fetchedAtMs:i}=r;if(typeof i!="number"||!Number.isFinite(i))return;let n=QR(r.models);if(Object.keys(n).length!==0)return{fetchedAtMs:i,models:n}}writeCacheEntry(e,r){try{let i=this.readCacheFile()??{};i[e]={fetchedAtMs:this.now(),models:r},this.home.ensureDir(),KR(this.cachePath(),`${JSON.stringify({version:r0,providers:i},null,2)}
|
|
201
|
+
`)}catch{}}}});var Ur=g(()=>{"use strict";t0();Np();Ka();o0();Fp();jp();bm();Mp();Lp();Ga();yg();bg();Oa();$g();fg();og();sg();ug();Er();eg();Qm();mc();cg();wm();Fi()});var qn=D((P8,l0)=>{"use strict";var uD="2.0.0",lD=Number.MAX_SAFE_INTEGER||9007199254740991,dD=16,hD=250,fD=["major","premajor","minor","preminor","patch","prepatch","prerelease"];l0.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:dD,MAX_SAFE_BUILD_LENGTH:hD,MAX_SAFE_INTEGER:lD,RELEASE_TYPES:fD,SEMVER_SPEC_VERSION:uD,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var yo=D((C8,d0)=>{"use strict";var pD=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};d0.exports=pD});var Jn=D((yt,h0)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:kg,MAX_SAFE_BUILD_LENGTH:mD,MAX_LENGTH:gD}=qn(),vD=yo();yt=h0.exports={};var yD=yt.re=[],_D=yt.safeRe=[],P=yt.src=[],bD=yt.safeSrc=[],C=yt.t={},$D=0,Ig="[a-zA-Z0-9-]",wD=[["\\s",1],["\\d",gD],[Ig,mD]],xD=t=>{for(let[e,r]of wD)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},F=(t,e,r)=>{let i=xD(e),n=$D++;vD(t,n,e),C[t]=n,P[n]=e,bD[n]=i,yD[n]=new RegExp(e,r?"g":void 0),_D[n]=new RegExp(i,r?"g":void 0)};F("NUMERICIDENTIFIER","0|[1-9]\\d*");F("NUMERICIDENTIFIERLOOSE","\\d+");F("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Ig}*`);F("MAINVERSION",`(${P[C.NUMERICIDENTIFIER]})\\.(${P[C.NUMERICIDENTIFIER]})\\.(${P[C.NUMERICIDENTIFIER]})`);F("MAINVERSIONLOOSE",`(${P[C.NUMERICIDENTIFIERLOOSE]})\\.(${P[C.NUMERICIDENTIFIERLOOSE]})\\.(${P[C.NUMERICIDENTIFIERLOOSE]})`);F("PRERELEASEIDENTIFIER",`(?:${P[C.NONNUMERICIDENTIFIER]}|${P[C.NUMERICIDENTIFIER]})`);F("PRERELEASEIDENTIFIERLOOSE",`(?:${P[C.NONNUMERICIDENTIFIER]}|${P[C.NUMERICIDENTIFIERLOOSE]})`);F("PRERELEASE",`(?:-(${P[C.PRERELEASEIDENTIFIER]}(?:\\.${P[C.PRERELEASEIDENTIFIER]})*))`);F("PRERELEASELOOSE",`(?:-?(${P[C.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${P[C.PRERELEASEIDENTIFIERLOOSE]})*))`);F("BUILDIDENTIFIER",`${Ig}+`);F("BUILD",`(?:\\+(${P[C.BUILDIDENTIFIER]}(?:\\.${P[C.BUILDIDENTIFIER]})*))`);F("FULLPLAIN",`v?${P[C.MAINVERSION]}${P[C.PRERELEASE]}?${P[C.BUILD]}?`);F("FULL",`^${P[C.FULLPLAIN]}$`);F("LOOSEPLAIN",`[v=\\s]*${P[C.MAINVERSIONLOOSE]}${P[C.PRERELEASELOOSE]}?${P[C.BUILD]}?`);F("LOOSE",`^${P[C.LOOSEPLAIN]}$`);F("GTLT","((?:<|>)?=?)");F("XRANGEIDENTIFIERLOOSE",`${P[C.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);F("XRANGEIDENTIFIER",`${P[C.NUMERICIDENTIFIER]}|x|X|\\*`);F("XRANGEPLAIN",`[v=\\s]*(${P[C.XRANGEIDENTIFIER]})(?:\\.(${P[C.XRANGEIDENTIFIER]})(?:\\.(${P[C.XRANGEIDENTIFIER]})(?:${P[C.PRERELEASE]})?${P[C.BUILD]}?)?)?`);F("XRANGEPLAINLOOSE",`[v=\\s]*(${P[C.XRANGEIDENTIFIERLOOSE]})(?:\\.(${P[C.XRANGEIDENTIFIERLOOSE]})(?:\\.(${P[C.XRANGEIDENTIFIERLOOSE]})(?:${P[C.PRERELEASELOOSE]})?${P[C.BUILD]}?)?)?`);F("XRANGE",`^${P[C.GTLT]}\\s*${P[C.XRANGEPLAIN]}$`);F("XRANGELOOSE",`^${P[C.GTLT]}\\s*${P[C.XRANGEPLAINLOOSE]}$`);F("COERCEPLAIN",`(^|[^\\d])(\\d{1,${kg}})(?:\\.(\\d{1,${kg}}))?(?:\\.(\\d{1,${kg}}))?`);F("COERCE",`${P[C.COERCEPLAIN]}(?:$|[^\\d])`);F("COERCEFULL",P[C.COERCEPLAIN]+`(?:${P[C.PRERELEASE]})?(?:${P[C.BUILD]})?(?:$|[^\\d])`);F("COERCERTL",P[C.COERCE],!0);F("COERCERTLFULL",P[C.COERCEFULL],!0);F("LONETILDE","(?:~>?)");F("TILDETRIM",`(\\s*)${P[C.LONETILDE]}\\s+`,!0);yt.tildeTrimReplace="$1~";F("TILDE",`^${P[C.LONETILDE]}${P[C.XRANGEPLAIN]}$`);F("TILDELOOSE",`^${P[C.LONETILDE]}${P[C.XRANGEPLAINLOOSE]}$`);F("LONECARET","(?:\\^)");F("CARETTRIM",`(\\s*)${P[C.LONECARET]}\\s+`,!0);yt.caretTrimReplace="$1^";F("CARET",`^${P[C.LONECARET]}${P[C.XRANGEPLAIN]}$`);F("CARETLOOSE",`^${P[C.LONECARET]}${P[C.XRANGEPLAINLOOSE]}$`);F("COMPARATORLOOSE",`^${P[C.GTLT]}\\s*(${P[C.LOOSEPLAIN]})$|^$`);F("COMPARATOR",`^${P[C.GTLT]}\\s*(${P[C.FULLPLAIN]})$|^$`);F("COMPARATORTRIM",`(\\s*)${P[C.GTLT]}\\s*(${P[C.LOOSEPLAIN]}|${P[C.XRANGEPLAIN]})`,!0);yt.comparatorTrimReplace="$1$2$3";F("HYPHENRANGE",`^\\s*(${P[C.XRANGEPLAIN]})\\s+-\\s+(${P[C.XRANGEPLAIN]})\\s*$`);F("HYPHENRANGELOOSE",`^\\s*(${P[C.XRANGEPLAINLOOSE]})\\s+-\\s+(${P[C.XRANGEPLAINLOOSE]})\\s*$`);F("STAR","(<|>)?=?\\s*\\*");F("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");F("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Tc=D((R8,f0)=>{"use strict";var SD=Object.freeze({loose:!0}),ED=Object.freeze({}),kD=t=>t?typeof t!="object"?SD:t:ED;f0.exports=kD});var Tg=D((D8,g0)=>{"use strict";var p0=/^[0-9]+$/,m0=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=p0.test(t),i=p0.test(e);return r&&i&&(t=+t,e=+e),t===e?0:r&&!i?-1:i&&!r?1:t<e?-1:1},ID=(t,e)=>m0(e,t);g0.exports={compareIdentifiers:m0,rcompareIdentifiers:ID}});var we=D((N8,y0)=>{"use strict";var Ac=yo(),{MAX_LENGTH:v0,MAX_SAFE_INTEGER:Oc}=qn(),{safeRe:Pc,t:Cc}=Jn(),TD=Tc(),{compareIdentifiers:Ag}=Tg(),AD=(t,e)=>{let r=e.split(".");if(r.length>t.length)return!1;for(let i=0;i<r.length;i++)if(Ag(t[i],r[i])!==0)return!1;return!0},Og=class t{constructor(e,r){if(r=TD(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.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>v0)throw new TypeError(`version is longer than ${v0} characters`);Ac("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let i=e.trim().match(r.loose?Pc[Cc.LOOSE]:Pc[Cc.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>Oc||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Oc||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Oc||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let o=+n;if(o>=0&&o<Oc)return o}return n}):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(Ac("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 r=0;do{let i=this.prerelease[r],n=e.prerelease[r];if(Ac("prerelease compare",r,i,n),i===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(i===void 0)return-1;if(i===n)continue;return Ag(i,n)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let i=this.build[r],n=e.build[r];if(Ac("build compare",r,i,n),i===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(i===void 0)return-1;if(i===n)continue;return Ag(i,n)}while(++r)}inc(e,r,i){if(e.startsWith("pre")){if(!r&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let n=`-${r}`.match(this.options.loose?Pc[Cc.PRERELEASELOOSE]:Pc[Cc.PRERELEASE]);if(!n||n[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,i),this.inc("pre",r,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,i),this.inc("pre",r,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 n=Number(i)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(r){let o=[r,n];if(i===!1&&(o=[r]),AD(this.prerelease,r)){let s=this.prerelease[r.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}};y0.exports=Og});var ur=D((L8,b0)=>{"use strict";var _0=we(),OD=(t,e,r=!1)=>{if(t instanceof _0)return t;try{return new _0(t,e)}catch(i){if(!r)return null;throw i}};b0.exports=OD});var w0=D((M8,$0)=>{"use strict";var PD=ur(),CD=(t,e)=>{let r=PD(t,e);return r?r.version:null};$0.exports=CD});var S0=D((z8,x0)=>{"use strict";var RD=ur(),DD=(t,e)=>{let r=RD(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};x0.exports=DD});var I0=D((U8,k0)=>{"use strict";var E0=we(),ND=(t,e,r,i,n)=>{typeof r=="string"&&(n=i,i=r,r=void 0);try{return new E0(t instanceof E0?t.version:t,r).inc(e,i,n).version}catch{return null}};k0.exports=ND});var O0=D((j8,A0)=>{"use strict";var T0=ur(),LD=(t,e)=>{let r=T0(t,null,!0),i=T0(e,null,!0),n=r.compare(i);if(n===0)return null;let o=n>0,s=o?r:i,a=o?i:r,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let l=c?"pre":"";return r.major!==i.major?l+"major":r.minor!==i.minor?l+"minor":r.patch!==i.patch?l+"patch":"prerelease"};A0.exports=LD});var C0=D((F8,P0)=>{"use strict";var MD=we(),zD=(t,e)=>new MD(t,e).major;P0.exports=zD});var D0=D((V8,R0)=>{"use strict";var UD=we(),jD=(t,e)=>new UD(t,e).minor;R0.exports=jD});var L0=D((Z8,N0)=>{"use strict";var FD=we(),VD=(t,e)=>new FD(t,e).patch;N0.exports=VD});var z0=D((B8,M0)=>{"use strict";var ZD=ur(),BD=(t,e)=>{let r=ZD(t,e);return r&&r.prerelease.length?r.prerelease:null};M0.exports=BD});var nt=D((G8,j0)=>{"use strict";var U0=we(),GD=(t,e,r)=>new U0(t,r).compare(new U0(e,r));j0.exports=GD});var V0=D((W8,F0)=>{"use strict";var WD=nt(),HD=(t,e,r)=>WD(e,t,r);F0.exports=HD});var B0=D((H8,Z0)=>{"use strict";var qD=nt(),JD=(t,e)=>qD(t,e,!0);Z0.exports=JD});var Rc=D((q8,W0)=>{"use strict";var G0=we(),KD=(t,e,r)=>{let i=new G0(t,r),n=new G0(e,r);return i.compare(n)||i.compareBuild(n)};W0.exports=KD});var q0=D((J8,H0)=>{"use strict";var YD=Rc(),XD=(t,e)=>t.sort((r,i)=>YD(r,i,e));H0.exports=XD});var K0=D((K8,J0)=>{"use strict";var QD=Rc(),eN=(t,e)=>t.sort((r,i)=>QD(i,r,e));J0.exports=eN});var _o=D((Y8,Y0)=>{"use strict";var tN=nt(),rN=(t,e,r)=>tN(t,e,r)>0;Y0.exports=rN});var Dc=D((X8,X0)=>{"use strict";var nN=nt(),iN=(t,e,r)=>nN(t,e,r)<0;X0.exports=iN});var Pg=D((Q8,Q0)=>{"use strict";var oN=nt(),sN=(t,e,r)=>oN(t,e,r)===0;Q0.exports=sN});var Cg=D((e9,eE)=>{"use strict";var aN=nt(),cN=(t,e,r)=>aN(t,e,r)!==0;eE.exports=cN});var Nc=D((t9,tE)=>{"use strict";var uN=nt(),lN=(t,e,r)=>uN(t,e,r)>=0;tE.exports=lN});var Lc=D((r9,rE)=>{"use strict";var dN=nt(),hN=(t,e,r)=>dN(t,e,r)<=0;rE.exports=hN});var Rg=D((n9,nE)=>{"use strict";var fN=Pg(),pN=Cg(),mN=_o(),gN=Nc(),vN=Dc(),yN=Lc(),_N=(t,e,r,i)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return fN(t,r,i);case"!=":return pN(t,r,i);case">":return mN(t,r,i);case">=":return gN(t,r,i);case"<":return vN(t,r,i);case"<=":return yN(t,r,i);default:throw new TypeError(`Invalid operator: ${e}`)}};nE.exports=_N});var oE=D((i9,iE)=>{"use strict";var bN=we(),$N=ur(),{safeRe:Mc,t:zc}=Jn(),wN=(t,e)=>{if(t instanceof bN)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?Mc[zc.COERCEFULL]:Mc[zc.COERCE]);else{let c=e.includePrerelease?Mc[zc.COERCERTLFULL]:Mc[zc.COERCERTL],u;for(;(u=c.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||u.index+u[0].length!==r.index+r[0].length)&&(r=u),c.lastIndex=u.index+u[1].length+u[2].length;c.lastIndex=-1}if(r===null)return null;let i=r[2],n=r[3]||"0",o=r[4]||"0",s=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return $N(`${i}.${n}.${o}${s}${a}`,e)};iE.exports=wN});var aE=D((o9,sE)=>{"use strict";var xN=ur(),SN=qn(),EN=we(),kN=(t,e,r)=>{if(!SN.RELEASE_TYPES.includes(e))return null;let i=IN(t,r);return i&&TN(i,e)},IN=(t,e)=>{let r=t instanceof EN?t.version:t;return xN(r,e)},TN=(t,e)=>{if(AN(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()},AN=t=>t.startsWith("pre");sE.exports=kN});var uE=D((s9,cE)=>{"use strict";var Dg=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,r)}return this}};cE.exports=Dg});var it=D((a9,fE)=>{"use strict";var ON=/\s+/g,Ng=class t{constructor(e,r){if(r=CN(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof Lg)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(ON," "),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(n=>!dE(n[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&FN(n[0])){this.set=[n];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 r=this.set[e];for(let i=0;i<r.length;i++)i>0&&(this.formatted+=" "),this.formatted+=r[i].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(jN,"");let i=((this.options.includePrerelease&&zN)|(this.options.loose&&UN))+":"+e,n=lE.get(i);if(n)return n;let o=this.options.loose,s=o?De[xe.HYPHENRANGELOOSE]:De[xe.HYPHENRANGE];e=e.replace(s,YN(this.options.includePrerelease)),re("hyphen replace",e),e=e.replace(De[xe.COMPARATORTRIM],NN),re("comparator trim",e),e=e.replace(De[xe.TILDETRIM],LN),re("tilde trim",e),e=e.replace(De[xe.CARETTRIM],MN),re("caret trim",e);let a=e.split(" ").map(d=>VN(d,this.options)).join(" ").split(/\s+/).map(d=>KN(d,this.options));o&&(a=a.filter(d=>(re("loose invalid filter",d,this.options),!!d.match(De[xe.COMPARATORLOOSE])))),re("range list",a);let c=new Map,u=a.map(d=>new Lg(d,this.options));for(let d of u){if(dE(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let l=[...c.values()];return lE.set(i,l),l}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(i=>hE(i,r)&&e.set.some(n=>hE(n,r)&&i.every(o=>n.every(s=>o.intersects(s,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new RN(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(XN(this.set[r],e,this.options))return!0;return!1}};fE.exports=Ng;var PN=uE(),lE=new PN,CN=Tc(),Lg=bo(),re=yo(),RN=we(),{safeRe:De,src:DN,t:xe,comparatorTrimReplace:NN,tildeTrimReplace:LN,caretTrimReplace:MN}=Jn(),{FLAG_INCLUDE_PRERELEASE:zN,FLAG_LOOSE:UN}=qn(),jN=new RegExp(DN[xe.BUILD],"g"),dE=t=>t.value==="<0.0.0-0",FN=t=>t.value==="",hE=(t,e)=>{let r=!0,i=t.slice(),n=i.pop();for(;r&&i.length;)r=i.every(o=>n.intersects(o,e)),n=i.pop();return r},VN=(t,e)=>(t=t.replace(De[xe.BUILD],""),re("comp",t,e),t=GN(t,e),re("caret",t),t=ZN(t,e),re("tildes",t),t=HN(t,e),re("xrange",t),t=JN(t,e),re("stars",t),t),Ne=t=>!t||t.toLowerCase()==="x"||t==="*",ZN=(t,e)=>t.trim().split(/\s+/).map(r=>BN(r,e)).join(" "),BN=(t,e)=>{let r=e.loose?De[xe.TILDELOOSE]:De[xe.TILDE];return t.replace(r,(i,n,o,s,a)=>{re("tilde",t,i,n,o,s,a);let c;return Ne(n)?c="":Ne(o)?c=`>=${n}.0.0 <${+n+1}.0.0-0`:Ne(s)?c=`>=${n}.${o}.0 <${n}.${+o+1}.0-0`:a?(re("replaceTilde pr",a),c=`>=${n}.${o}.${s}-${a} <${n}.${+o+1}.0-0`):c=`>=${n}.${o}.${s} <${n}.${+o+1}.0-0`,re("tilde return",c),c})},GN=(t,e)=>t.trim().split(/\s+/).map(r=>WN(r,e)).join(" "),WN=(t,e)=>{re("caret",t,e);let r=e.loose?De[xe.CARETLOOSE]:De[xe.CARET],i=e.includePrerelease?"-0":"";return t.replace(r,(n,o,s,a,c)=>{re("caret",t,n,o,s,a,c);let u;return Ne(o)?u="":Ne(s)?u=`>=${o}.0.0${i} <${+o+1}.0.0-0`:Ne(a)?o==="0"?u=`>=${o}.${s}.0${i} <${o}.${+s+1}.0-0`:u=`>=${o}.${s}.0${i} <${+o+1}.0.0-0`:c?(re("replaceCaret pr",c),o==="0"?s==="0"?u=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`:u=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`:u=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`):(re("no pr"),o==="0"?s==="0"?u=`>=${o}.${s}.${a}${i} <${o}.${s}.${+a+1}-0`:u=`>=${o}.${s}.${a}${i} <${o}.${+s+1}.0-0`:u=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),re("caret return",u),u})},HN=(t,e)=>(re("replaceXRanges",t,e),t.split(/\s+/).map(r=>qN(r,e)).join(" ")),qN=(t,e)=>{t=t.trim();let r=e.loose?De[xe.XRANGELOOSE]:De[xe.XRANGE];return t.replace(r,(i,n,o,s,a,c)=>{re("xRange",t,i,n,o,s,a,c);let u=Ne(o),l=u||Ne(s),d=l||Ne(a),h=d;return n==="="&&h&&(n=""),c=e.includePrerelease?"-0":"",u?n===">"||n==="<"?i="<0.0.0-0":i="*":n&&h?(l&&(s=0),a=0,n===">"?(n=">=",l?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):n==="<="&&(n="<",l?o=+o+1:s=+s+1),n==="<"&&(c="-0"),i=`${n+o}.${s}.${a}${c}`):l?i=`>=${o}.0.0${c} <${+o+1}.0.0-0`:d&&(i=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),re("xRange return",i),i})},JN=(t,e)=>(re("replaceStars",t,e),t.trim().replace(De[xe.STAR],"")),KN=(t,e)=>(re("replaceGTE0",t,e),t.trim().replace(De[e.includePrerelease?xe.GTE0PRE:xe.GTE0],"")),YN=t=>(e,r,i,n,o,s,a,c,u,l,d,h)=>(Ne(i)?r="":Ne(n)?r=`>=${i}.0.0${t?"-0":""}`:Ne(o)?r=`>=${i}.${n}.0${t?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,Ne(u)?c="":Ne(l)?c=`<${+u+1}.0.0-0`:Ne(d)?c=`<${u}.${+l+1}.0-0`:h?c=`<=${u}.${l}.${d}-${h}`:t?c=`<${u}.${l}.${+d+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),XN=(t,e,r)=>{for(let i=0;i<t.length;i++)if(!t[i].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let i=0;i<t.length;i++)if(re(t[i].semver),t[i].semver!==Lg.ANY&&t[i].semver.prerelease.length>0){let n=t[i].semver;if(n.major===e.major&&n.minor===e.minor&&n.patch===e.patch)return!0}return!1}return!0}});var bo=D((c9,_E)=>{"use strict";var $o=Symbol("SemVer ANY"),Ug=class t{static get ANY(){return $o}constructor(e,r){if(r=pE(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),zg("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===$o?this.value="":this.value=this.operator+this.semver.version,zg("comp",this)}parse(e){let r=this.options.loose?mE[gE.COMPARATORLOOSE]:mE[gE.COMPARATOR],i=e.match(r);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 vE(i[2],this.options.loose):this.semver=$o}toString(){return this.value}test(e){if(zg("Comparator.test",e,this.options.loose),this.semver===$o||e===$o)return!0;if(typeof e=="string")try{e=new vE(e,this.options)}catch{return!1}return Mg(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new yE(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new yE(this.value,r).test(e.semver):(r=pE(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.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("=")||Mg(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Mg(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};_E.exports=Ug;var pE=Tc(),{safeRe:mE,t:gE}=Jn(),Mg=Rg(),zg=yo(),vE=we(),yE=it()});var wo=D((u9,bE)=>{"use strict";var QN=it(),eL=(t,e,r)=>{try{e=new QN(e,r)}catch{return!1}return e.test(t)};bE.exports=eL});var wE=D((l9,$E)=>{"use strict";var tL=it(),rL=(t,e)=>new tL(t,e).set.map(r=>r.map(i=>i.value).join(" ").trim().split(" "));$E.exports=rL});var SE=D((d9,xE)=>{"use strict";var nL=we(),iL=it(),oL=(t,e,r)=>{let i=null,n=null,o=null;try{o=new iL(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!i||n.compare(s)===-1)&&(i=s,n=new nL(i,r))}),i};xE.exports=oL});var kE=D((h9,EE)=>{"use strict";var sL=we(),aL=it(),cL=(t,e,r)=>{let i=null,n=null,o=null;try{o=new aL(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!i||n.compare(s)===1)&&(i=s,n=new sL(i,r))}),i};EE.exports=cL});var AE=D((f9,TE)=>{"use strict";var jg=we(),uL=it(),IE=_o(),lL=(t,e)=>{t=new uL(t,e);let r=new jg("0.0.0");if(t.test(r)||(r=new jg("0.0.0-0"),t.test(r)))return r;r=null;for(let i=0;i<t.set.length;++i){let n=t.set[i],o=null;n.forEach(s=>{let a=new jg(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||IE(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||IE(r,o))&&(r=o)}return r&&t.test(r)?r:null};TE.exports=lL});var PE=D((p9,OE)=>{"use strict";var dL=it(),hL=(t,e)=>{try{return new dL(t,e).range||"*"}catch{return null}};OE.exports=hL});var Uc=D((m9,NE)=>{"use strict";var fL=we(),DE=bo(),{ANY:pL}=DE,mL=it(),gL=wo(),CE=_o(),RE=Dc(),vL=Lc(),yL=Nc(),_L=(t,e,r,i)=>{t=new fL(t,i),e=new mL(e,i);let n,o,s,a,c;switch(r){case">":n=CE,o=vL,s=RE,a=">",c=">=";break;case"<":n=RE,o=yL,s=CE,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(gL(t,e,i))return!1;for(let u=0;u<e.set.length;++u){let l=e.set[u],d=null,h=null;if(l.forEach(f=>{f.semver===pL&&(f=new DE(">=0.0.0")),d=d||f,h=h||f,n(f.semver,d.semver,i)?d=f:s(f.semver,h.semver,i)&&(h=f)}),d.operator===a||d.operator===c||(!h.operator||h.operator===a)&&o(t,h.semver))return!1;if(h.operator===c&&s(t,h.semver))return!1}return!0};NE.exports=_L});var ME=D((g9,LE)=>{"use strict";var bL=Uc(),$L=(t,e,r)=>bL(t,e,">",r);LE.exports=$L});var UE=D((v9,zE)=>{"use strict";var wL=Uc(),xL=(t,e,r)=>wL(t,e,"<",r);zE.exports=xL});var VE=D((y9,FE)=>{"use strict";var jE=it(),SL=(t,e,r)=>(t=new jE(t,r),e=new jE(e,r),t.intersects(e,r));FE.exports=SL});var BE=D((_9,ZE)=>{"use strict";var EL=wo(),kL=nt();ZE.exports=(t,e,r)=>{let i=[],n=null,o=null,s=t.sort((l,d)=>kL(l,d,r));for(let l of s)EL(l,e,r)?(o=l,n||(n=l)):(o&&i.push([n,o]),o=null,n=null);n&&i.push([n,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 c=a.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return c.length<u.length?c:e}});var KE=D((b9,JE)=>{"use strict";var GE=it(),Zg=bo(),{ANY:Fg}=Zg,Vg=wo(),Bg=nt(),IL=(t,e,r={})=>{if(t===e)return!0;t=new GE(t,r),e=new GE(e,r);let i=!1;e:for(let n of t.set){for(let o of e.set){let s=AL(n,o,r);if(i=i||s!==null,s)continue e}if(i)return!1}return!0},TL=[new Zg(">=0.0.0-0")],WE=[new Zg(">=0.0.0")],AL=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Fg){if(e.length===1&&e[0].semver===Fg)return!0;r.includePrerelease?t=TL:t=WE}if(e.length===1&&e[0].semver===Fg){if(r.includePrerelease)return!0;e=WE}let i=new Set,n,o;for(let f of t)f.operator===">"||f.operator===">="?n=HE(n,f,r):f.operator==="<"||f.operator==="<="?o=qE(o,f,r):i.add(f.semver);if(i.size>1)return null;let s;if(n&&o){if(s=Bg(n.semver,o.semver,r),s>0)return null;if(s===0&&(n.operator!==">="||o.operator!=="<="))return null}for(let f of i){if(n&&!Vg(f,String(n),r)||o&&!Vg(f,String(o),r))return null;for(let p of e)if(!Vg(f,String(p),r))return!1;return!0}let a,c,u,l,d=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,h=n&&!r.includePrerelease&&n.semver.prerelease.length?n.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===">=",u=u||f.operator==="<"||f.operator==="<=",n){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=HE(n,f,r),a===f&&a!==n)return!1}else if(n.operator===">="&&!f.test(n.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(c=qE(o,f,r),c===f&&c!==o)return!1}else if(o.operator==="<="&&!f.test(o.semver))return!1}if(!f.operator&&(o||n)&&s!==0)return!1}return!(n&&u&&!o&&s!==0||o&&l&&!n&&s!==0||h||d)},HE=(t,e,r)=>{if(!t)return e;let i=Bg(t.semver,e.semver,r);return i>0?t:i<0||e.operator===">"&&t.operator===">="?e:t},qE=(t,e,r)=>{if(!t)return e;let i=Bg(t.semver,e.semver,r);return i<0?t:i>0||e.operator==="<"&&t.operator==="<="?e:t};JE.exports=IL});var ek=D(($9,QE)=>{"use strict";var Gg=Jn(),YE=qn(),OL=we(),XE=Tg(),PL=ur(),CL=w0(),RL=S0(),DL=I0(),NL=O0(),LL=C0(),ML=D0(),zL=L0(),UL=z0(),jL=nt(),FL=V0(),VL=B0(),ZL=Rc(),BL=q0(),GL=K0(),WL=_o(),HL=Dc(),qL=Pg(),JL=Cg(),KL=Nc(),YL=Lc(),XL=Rg(),QL=oE(),eM=aE(),tM=bo(),rM=it(),nM=wo(),iM=wE(),oM=SE(),sM=kE(),aM=AE(),cM=PE(),uM=Uc(),lM=ME(),dM=UE(),hM=VE(),fM=BE(),pM=KE();QE.exports={parse:PL,valid:CL,clean:RL,inc:DL,diff:NL,major:LL,minor:ML,patch:zL,prerelease:UL,compare:jL,rcompare:FL,compareLoose:VL,compareBuild:ZL,sort:BL,rsort:GL,gt:WL,lt:HL,eq:qL,neq:JL,gte:KL,lte:YL,cmp:XL,coerce:QL,truncate:eM,Comparator:tM,Range:rM,satisfies:nM,toComparators:iM,maxSatisfying:oM,minSatisfying:sM,minVersion:aM,validRange:cM,outside:uM,gtr:lM,ltr:dM,intersects:hM,simplifyRange:fM,subset:pM,SemVer:OL,re:Gg.re,src:Gg.src,tokens:Gg.t,SEMVER_SPEC_VERSION:YE.SEMVER_SPEC_VERSION,RELEASE_TYPES:YE.RELEASE_TYPES,compareIdentifiers:XE.compareIdentifiers,rcompareIdentifiers:XE.rcompareIdentifiers}});var ok=D((O9,Wg)=>{var Vc=process||{},nk=Vc.argv||[],Fc=Vc.env||{},yM=!(Fc.NO_COLOR||nk.includes("--no-color"))&&(!!Fc.FORCE_COLOR||nk.includes("--color")||Vc.platform==="win32"||(Vc.stdout||{}).isTTY&&Fc.TERM!=="dumb"||!!Fc.CI),_M=(t,e,r=t)=>i=>{let n=""+i,o=n.indexOf(e,t.length);return~o?t+bM(n,e,r,o)+e:t+n+e},bM=(t,e,r,i)=>{let n="",o=0;do n+=t.substring(o,i)+r,o=i+e.length,i=t.indexOf(e,o);while(~i);return n+t.substring(o)},ik=(t=yM)=>{let e=t?_M:()=>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")}};Wg.exports=ik();Wg.exports.createColors=ik});var Xg=D((nZ,Sk)=>{"use strict";var Yg={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},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"},ZM={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},BM={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 r=0;r<t;r++)e+=this.line+(r<t-1?Yg.up():"");return t&&(e+=Yg.left),e}};Sk.exports={cursor:Yg,scroll:ZM,erase:BM,beep:"\x07"}});function bI(t,e){if(e<=1)return t;let r=Math.floor(t.length/e),i=new Int16Array(r);for(let n=0;n<r;n++){let o=0,s=n*e;for(let a=0;a<e;a++)o+=t[s+a];i[n]=Math.round(o/e)}return i}var du,$I=g(()=>{"use strict";du=class{step;pos=0;prev=0;primed=!1;constructor(e,r){if(e<=0||r<=0)throw new RangeError("resampler rates must be positive");this.step=e/r}process(e){if(e.length===0)return new Int16Array(0);let r=[],i=e.length-1,n=this.primed?this.pos:0;for(;;){let o=Math.floor(n);if(o+1>i)break;let s=o<0?this.prev:e[o],a=e[o+1];r.push(Math.round(s+(a-s)*(n-o))),n+=this.step}return this.prev=e[i],this.primed=!0,this.pos=n-e.length,Int16Array.from(r)}}});function xI(t){return t.byteLength/2/e4}function t4(t){let e=t.byteLength>>1,r=new DataView(t.buffer,t.byteOffset,t.byteLength),i=new Int16Array(e);for(let n=0;n<e;n++)i[n]=r.getInt16(n*2,!0);return i}var wI,e4,hu,SI=g(()=>{"use strict";he();Ur();wI=32,e4=16,hu=class{constructor(e,r,i={}){this.vad=e;this.onSpeech=r;this.speechThreshold=i.speechThreshold??.5,this.onsetMs=i.onsetMs??2*wI,this.holdoffMs=i.holdoffMs??300,this.energyThreshold=i.energyThreshold??.01,this.log=i.log??j}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(Xe(e,this.energyThreshold),xI(e));return}this.vad.process(t4(e)).then(r=>{if(!this.closed)for(let i of r)this.applyVerdict(i>=this.speechThreshold,wI)},r=>{this.closed||(this.degrade(r),this.applyVerdict(Xe(e,this.energyThreshold),xI(e)))})}}close(){this.closed=!0}applyVerdict(e,r){e?(this.silenceRunMs=0,this.speechRunMs+=r,!this.inSpeech&&this.speechRunMs>=this.onsetMs&&(this.inSpeech=!0,this.onSpeech())):(this.speechRunMs=0,this.inSpeech&&(this.silenceRunMs+=r,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 vv={};Je(vv,{DecibriCapture:()=>mv,DecibriPlayback:()=>gv,hasInputDevice:()=>i4});import{Microphone as r4,Speaker as n4,inputDevices as kI}from"decibri";function i4(){try{return kI().length>0}catch(t){return j.debug("audio input enumeration failed; treating as no microphone",{error:t}),!1}}function o4(){try{let t=kI(),e=t.find(r=>r.isDefault)??t[0];if(e&&e.defaultSampleRate>=1e3&&e.maxInputChannels>=1)return{sampleRate:Math.round(e.defaultSampleRate),channels:e.maxInputChannels}}catch(t){j.debug("could not read default input device; opening at 16k mono",{error:t})}return{sampleRate:Oo,channels:fu}}function s4(t){return Math.max(64,Math.min(65536,Math.round(t/10)))}function a4(t,e,r){let i=new Uint8Array(t),n=new Int16Array(i.buffer,0,i.byteLength>>1),o=r.process(bI(n,e));return Buffer.from(o.buffer,o.byteOffset,o.byteLength)}function l4(t){return Buffer.from(t.buffer,t.byteOffset,t.byteLength)}var Oo,fu,II,EI,mv,c4,u4,gv,yv=g(()=>{"use strict";he();Ur();$I();SI();Oo=16e3,fu=1,II="int16",EI=.01;mv=class{constructor(e={}){this.deps=e}deps;mic=null;onData=null;onSpeech=null;onErr=null;vad=null;detector=null;async start(e){let{sampleRate:r,channels:i}=o4(),n=(this.deps.createVad??(()=>new Mr))(),o=null;try{await n.load(),o=new hu(n,()=>e.onSpeechStart(),{energyThreshold:EI})}catch(c){j.debug("silero vad unavailable; barge-in falls back to decibri energy vad",{error:c}),n.dispose().catch(()=>{})}let s;try{s=await r4.open({sampleRate:r,channels:i,dtype:II,...o?{vad:!1}:{vad:"energy",vadThreshold:EI},framesPerBuffer:s4(r)})}catch(c){throw o?.close(),o&&n.dispose().catch(()=>{}),c}this.vad=o?n:null,this.detector=o;let a=r===Oo&&i===fu?null:new du(r,Oo);this.onData=a?c=>{let u=a4(c,i,a);u.byteLength>0&&(this.detector?.feed(u),e.onFrame(u,Date.now()))}:c=>{this.detector?.feed(c),e.onFrame(c,Date.now())},this.onSpeech=()=>e.onSpeechStart(),this.onErr=c=>e.onError(c),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 r=this.vad;this.vad=null,r&&await r.dispose().catch(()=>{})}},c4=Oo*fu*2/1e3,u4=250,gv=class{speaker=null;writeChain=Promise.resolve();generation=0;closed=!1;playoutEndAtMs=0;drainWakes=new Set;nativeDrainSpent=!1;playoutTap=null;play(e){if(this.closed)return;let r=this.generation;this.writeChain=this.writeChain.then(async()=>{if(!(this.closed||r!==this.generation))try{if(await this.ensureSpeaker().writeAsync(l4(e)),this.closed||r!==this.generation)return;let n=Math.max(this.playoutEndAtMs,Date.now());this.playoutEndAtMs=n+e.byteLength/c4;try{this.playoutTap?.(e,n)}catch(o){j.debug("playout tap failed",{error:o})}}catch(i){j.debug("playback write skipped",{error:i})}})}setPlayoutTap(e){this.playoutTap=e}flush(){this.generation++,this.playoutEndAtMs=0;let e=this.speaker;this.speaker=null,e?.stop();for(let r of[...this.drainWakes])r()}async drained(){await this.writeChain;let e=this.speaker;if(!e)return;if(!this.nativeDrainSpent){this.nativeDrainSpent=!0;let i=Promise.resolve().then(()=>e.drainAsync()).catch(s=>{j.debug("playback drain interrupted",{error:s})}),n=Math.max(0,this.playoutEndAtMs-Date.now())+u4,o=this.sleep(n);await Promise.race([i,o.done]),o.wake()}let r=this.playoutEndAtMs-Date.now();r>0&&await this.sleep(r).done}sleep(e){let r;return{done:new Promise(n=>{let o=setTimeout(()=>r(),e);r=()=>{clearTimeout(o),this.drainWakes.delete(r),n()},this.drainWakes.add(r)}),wake:r}}close(){return this.closed=!0,this.flush(),Promise.resolve()}ensureSpeaker(){return this.speaker===null&&(this.speaker=new n4({sampleRate:Oo,channels:fu,dtype:II}),this.nativeDrainSpent=!1),this.speaker}}});he();Ur();ji();import{readFileSync as d4}from"node:fs";import{randomUUID as h4}from"node:crypto";var vt=class extends Error{constructor(e,r,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},zt=class extends vt{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var go=class{constructor(e,r){switch(this.description=r||"",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,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new zt(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Sc(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}import{EventEmitter as nD}from"node:events";import Eg from"node:child_process";import Ut from"node:path";import kc from"node:fs";import G from"node:process";import{stripVTControlCharacters as iD}from"node:util";import{stripVTControlCharacters as eD}from"node:util";var vo=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 r=e.commands.filter(n=>!n._hidden),i=e._getHelpCommand();return i&&!i._hidden&&r.push(i),this.sortSubcommands&&r.sort((n,o)=>n.name().localeCompare(o.name())),r}compareOptions(e,r){let i=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return i(e).localeCompare(i(r))}visibleOptions(e){let r=e.options.filter(n=>!n.hidden),i=e._getHelpOption();if(i&&!i.hidden){let n=i.short&&e._findOption(i.short),o=i.long&&e._findOption(i.long);!n&&!o?r.push(i):i.long&&!o?r.push(e.createOption(i.long,i.description)):i.short&&!n&&r.push(e.createOption(i.short,i.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let i=e.parent;i;i=i.parent){let n=i.options.filter(o=>!o.hidden);r.push(...n)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(i=>Sc(i)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(n)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleOptionTerm(r.optionTerm(n)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((i,n)=>Math.max(i,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(n)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let i="";for(let n=e.parent;n;n=n.parent)i=n.name()+" "+i;return i+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0){let i=`(${r.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let i=`(${r.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}formatItemList(e,r,i){return r.length===0?[]:[i.styleTitle(e),...r,""]}groupItems(e,r,i){let n=new Map;return e.forEach(o=>{let s=i(o);n.has(s)||n.set(s,[])}),r.forEach(o=>{let s=i(o);n.has(s)||n.set(s,[]),n.get(s).push(o)}),n}formatHelp(e,r){let i=r.padWidth(e,r),n=r.helpWidth??80;function o(d,h){return r.formatItem(d,i,h,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),n),""]));let c=r.visibleArguments(e).map(d=>o(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(s=s.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(e.options,r.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,h)=>{let f=d.map(p=>o(r.styleOptionTerm(r.optionTerm(p)),r.styleOptionDescription(r.optionDescription(p))));s=s.concat(this.formatItemList(h,f,r))}),r.showGlobalOptions){let d=r.visibleGlobalOptions(e).map(h=>o(r.styleOptionTerm(r.optionTerm(h)),r.styleOptionDescription(r.optionDescription(h))));s=s.concat(this.formatItemList("Global Options:",d,r))}return this.groupItems(e.commands,r.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,h)=>{let f=d.map(p=>o(r.styleSubcommandTerm(r.subcommandTerm(p)),r.styleSubcommandDescription(r.subcommandDescription(p))));s=s.concat(this.formatItemList(h,f,r))}),s.join(`
|
|
202
|
+
`)}displayWidth(e){return eD(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).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(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).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,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,r,i,n){let s=" ".repeat(2);if(!i)return s+e;let a=e.padEnd(r+e.length-n.displayWidth(e)),c=2,l=(this.helpWidth??80)-r-c-2,d;return l<this.minWidthToWrap||n.preformatted(i)?d=i:d=n.boxWrap(i,l).replace(/\n/g,`
|
|
203
|
+
`+" ".repeat(r+c)),s+a+" ".repeat(c)+d.replace(/\n/g,`
|
|
204
|
+
${s}`)}boxWrap(e,r){if(r<this.minWidthToWrap)return e;let i=e.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,o=[];return i.forEach(s=>{let a=s.match(n);if(a===null){o.push("");return}let c=[a.shift()],u=this.displayWidth(c[0]);a.forEach(l=>{let d=this.displayWidth(l);if(u+d<=r){c.push(l),u+=d;return}o.push(c.join(""));let h=l.trimStart();c=[h],u=this.displayWidth(h)}),o.push(c.join(""))}),o.join(`
|
|
205
|
+
`)}};var Wn=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let i=tD(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,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),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,r){return r===this.defaultValue||!Array.isArray(r)?[e]:(r.push(e),r)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new zt(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,i):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?s0(this.name().replace(/^no-/,"")):s0(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}},Ec=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i)})}valueFromOption(e,r){let i=r.attributeName();if(!this.dualOptions.has(i))return!0;let n=this.negativeOptions.get(i).presetArg,o=n!==void 0?n:!1;return r.negate===(o===e)}};function s0(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function tD(t){let e,r,i=/^-[^-]$/,n=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(i.test(o[0])&&(e=o.shift()),n.test(o[0])&&(r=o.shift()),!e&&i.test(o[0])&&(e=o.shift()),!e&&n.test(o[0])&&(e=r,r=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}
|
|
194
206
|
- a short flag is a single dash and a single character
|
|
195
207
|
- either use a single dash and a single character (for a short flag)
|
|
196
208
|
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):i.test(s)?new Error(`${a}
|
|
197
|
-
- too many short flags`):
|
|
209
|
+
- too many short flags`):n.test(s)?new Error(`${a}
|
|
198
210
|
- too many long flags`):new Error(`${a}
|
|
199
|
-
- unrecognised flag format`)}if(e===void 0&&
|
|
211
|
+
- unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:r}}function rD(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let i=0;i<=t.length;i++)r[i]=[i];for(let i=0;i<=e.length;i++)r[0][i]=i;for(let i=1;i<=e.length;i++)for(let n=1;n<=t.length;n++){let o;t[n-1]===e[i-1]?o=0:o=1,r[n][i]=Math.min(r[n-1][i]+1,r[n][i-1]+1,r[n-1][i-1]+o),n>1&&i>1&&t[n-1]===e[i-2]&&t[n-2]===e[i-1]&&(r[n][i]=Math.min(r[n][i],r[n-2][i-2]+1))}return r[t.length][e.length]}function Sg(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let i=[],n=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=rD(t,s),c=Math.max(t.length,s.length);(c-a)/c>o&&(a<n?(n=a,i=[s]):a===n&&i.push(s))}),i.sort((s,a)=>s.localeCompare(a)),r&&(i=i.map(s=>`--${s}`)),i.length>1?`
|
|
200
212
|
(Did you mean one of ${i.join(", ")}?)`:i.length===1?`
|
|
201
|
-
(Did you mean ${i[0]}?)`:""}var Hn=class t extends
|
|
202
|
-
- specify the name in Command constructor or using .name()`);return
|
|
203
|
-
Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(
|
|
204
|
-
- already used by option '${
|
|
205
|
-
- 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,
|
|
213
|
+
(Did you mean ${i[0]}?)`:""}var Hn=class t extends nD{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:r=>G.stdout.write(r),writeErr:r=>G.stderr.write(r),outputError:(r,i)=>i(r),getOutHelpWidth:()=>G.stdout.isTTY?G.stdout.columns:void 0,getErrHelpWidth:()=>G.stderr.isTTY?G.stderr.columns:void 0,getOutHasColors:()=>c0()??(G.stdout.isTTY&&G.stdout.hasColors?.()),getErrHasColors:()=>c0()??(G.stderr.isTTY&&G.stderr.hasColors?.()),stripColor:r=>iD(r)},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 r=this;r;r=r.parent)e.push(r);return e}command(e,r,i){let n=r,o=i;typeof n=="object"&&n!==null&&(o=n,n=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(s);return n&&(c.description(n),c._executableHandler=!0),o.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(o.noHelp||o.hidden),c._executableFile=o.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),n?this:c}createCommand(e){return new t(e)}createHelp(){return Object.assign(new vo,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,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
214
|
+
- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new go(e,r)}argument(e,r,i,n){let o=this.createArgument(e,r);return typeof i=="function"?o.default(n).argParser(i):o.default(i),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.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,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let i=e??"help [command]",[,n,o]=i.match(/([^ ]+) *(.*)/),s=r??"display help for command",a=this.createCommand(n);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||r)&&this._initCommandGroup(a),this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),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,r){let i=["preSubcommand","preAction","postAction"];if(!i.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
|
|
215
|
+
Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,i){this._exitCallback&&this._exitCallback(new vt(e,r,i)),G.exit(e)}action(e){let r=i=>{let n=this.registeredArguments.length,o=i.slice(0,n);return this._storeOptionsAsProperties?o[n]=this:o[n]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=r,this}createOption(e,r){return new Wn(e,r)}_callParseArg(e,r,i,n){try{return e.parseArg(r,i)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${n} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){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}'
|
|
216
|
+
- already used by option '${r.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let r=n=>[n.name()].concat(n.aliases()),i=r(e).find(n=>this._findCommand(n));if(i){let n=r(this._findCommand(i)).join("|"),o=r(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${n}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),i=e.attributeName();e.defaultValue!==void 0&&this.setOptionValueWithSource(i,e.defaultValue,"default");let n=(o,s,a)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let c=this.getOptionValue(i);o!==null&&e.parseArg?o=this._callParseArg(e,o,c,s):o!==null&&e.variadic&&(o=e._collectValue(o,c)),o==null&&(e.negate?o=!1:e.isBoolean()||e.optional?o=!0:o=""),this.setOptionValueWithSource(i,o,a)};return this.on("option:"+r,o=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;n(o,s,"cli")}),e.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;n(o,s,"env")}),this}_optionEx(e,r,i,n,o){if(typeof r=="object"&&r instanceof Wn)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,i);if(s.makeOptionMandatory(!!e.mandatory),typeof n=="function")s.default(o).argParser(n);else if(n instanceof RegExp){let a=n;n=(c,u)=>{let l=a.exec(c);return l?l[0]:u},s.default(o).argParser(n)}else s.default(n);return this.addOption(s)}option(e,r,i,n){return this._optionEx({},e,r,i,n)}requiredOption(e,r,i,n){return this._optionEx({mandatory:!0},e,r,i,n)}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,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,i){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=i,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(e)!==void 0&&(r=i.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){G.versions?.electron&&(r.from="electron");let n=G.execArgv??[];(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))&&(r.from="eval")}e===void 0&&(e=G.argv),this.rawArgs=e.slice();let i;switch(r.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: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(e,r){this._prepareForParse();let i=this._prepareUserArgs(e,r);return this._parseCommand([],i),this}async parseAsync(e,r){this._prepareForParse();let i=this._prepareUserArgs(e,r);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 r=e.long.replace(/^--no-/,"--");this._findOption(r)||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.
|
|
217
|
+
- 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,r,i){if(kc.existsSync(e))return;let n=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist
|
|
206
218
|
- if '${i}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
207
219
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
208
|
-
- ${
|
|
220
|
+
- ${n}`;throw new Error(o)}_executeSubCommand(e,r){r=r.slice();let i=[".js",".ts",".tsx",".mjs",".cjs"];function n(l,d){let h=Ut.resolve(l,d);if(kc.existsSync(h))return h;if(i.includes(Ut.extname(d)))return;let f=i.find(p=>kc.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=kc.realpathSync(this._scriptPath)}catch{l=this._scriptPath}s=Ut.resolve(Ut.dirname(l),s)}if(s){let l=n(s,o);if(!l&&!e._executableFile&&this._scriptPath){let d=Ut.basename(this._scriptPath,Ut.extname(this._scriptPath));d!==this._name&&(l=n(s,`${d}-${e._name}`))}o=l||o}let a=i.includes(Ut.extname(o)),c;G.platform!=="win32"?a?(r.unshift(o),r=a0(G.execArgv).concat(r),c=Eg.spawn(G.argv[0],r,{stdio:"inherit"})):c=Eg.spawn(o,r,{stdio:"inherit"}):(this._checkForMissingExecutable(o,s,e._name),r.unshift(o),r=a0(G.execArgv).concat(r),c=Eg.spawn(G.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{G.on(d,()=>{c.killed===!1&&c.exitCode===null&&c.kill(d)})});let u=this._exitCallback;c.on("close",l=>{l=l??1,u?u(new vt(l,"commander.executeSubCommandAsync","(close)")):G.exit(l)}),c.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(!u)G.exit(1);else{let d=new vt(1,"commander.executeSubCommandAsync","(error)");d.nestedError=l,u(d)}}),this.runningCommand=c}_dispatchSubcommand(e,r,i){let n=this._findCommand(e);n||this.help({error:!0}),n._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,n,"preSubcommand"),o=this._chainOrCall(o,()=>{if(n._executableHandler)this._executeSubCommand(n,r.concat(i));else return n._parseCommand(r,i)}),o}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==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,n,o)=>{let s=n;if(n!==null&&i.parseArg){let a=`error: command-argument value '${n}' is invalid for argument '${i.name()}'.`;s=this._callParseArg(i,n,o,a)}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((i,n)=>{let o=i.defaultValue;i.variadic?n<this.args.length?(o=this.args.slice(n),i.parseArg&&(o=o.reduce((s,a)=>e(i,a,s),i.defaultValue))):o===void 0&&(o=[]):n<this.args.length&&(o=this.args[n],i.parseArg&&(o=e(i,o,i.defaultValue))),r[n]=o}),this.processedArgs=r}_chainOrCall(e,r){return e?.then&&typeof e.then=="function"?e.then(()=>r()):r()}_chainOrCallHooks(e,r){let i=e,n=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[r]!==void 0).forEach(o=>{o._lifeCycleHooks[r].forEach(s=>{n.push({hookedCommand:o,callback:s})})}),r==="postAction"&&n.reverse(),n.forEach(o=>{i=this._chainOrCall(i,()=>o.callback(o.hookedCommand,this))}),i}_chainOrCallSubCommandHook(e,r,i){let n=e;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(o=>{n=this._chainOrCall(n,()=>o(this,r))}),n}_parseCommand(e,r){let i=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(i.operands),r=i.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){n(),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,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))n(),this._processArguments(),this.parent.emit(o,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(i=>{let n=i.attributeName();return this.getOptionValue(n)===void 0?!1:this.getOptionValueSource(n)!=="default"});e.filter(i=>i.conflictsWith.length>0).forEach(i=>{let n=e.find(o=>i.conflictsWith.includes(o.attributeName()));n&&this._conflictingOption(i,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],i=[],n=r;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,c=null,u=0;for(;u<e.length||c;){let l=c??e[u++];if(c=null,l==="--"){n===i&&n.push(l),n.push(...e.slice(u));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[u++];h===void 0&&this.optionMissingArgument(d),this.emit(`option:${d.name()}`,h)}else if(d.optional){let h=null;u<e.length&&(!o(e[u])||s(e[u]))&&(h=e[u++]),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()}`),c=`-${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(n===r&&o(l)&&!(this.commands.length===0&&s(l))&&(n=i),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&i.length===0){if(this._findCommand(l)){r.push(l),i.push(...e.slice(u));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l,...e.slice(u));break}else if(this._defaultCommandName){i.push(l,...e.slice(u));break}}if(this._passThroughOptions){n.push(l,...e.slice(u));break}n.push(l)}return{operands:r,unknown:i}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let i=0;i<r;i++){let n=this.options[i].attributeName();e[n]=n===this._versionOptionName?this._version:this[n]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,r)=>Object.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e}
|
|
209
221
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
210
222
|
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
211
|
-
`),this.outputHelp({error:!0}));let i=
|
|
212
|
-
`),this._exit(0,"commander.version",e)}),this}description(e,
|
|
213
|
-
Expecting one of '${i.join("', '")}'`);let
|
|
214
|
-
`)}),this}_outputHelpIfRequested(e){let
|
|
223
|
+
`),this.outputHelp({error:!0}));let i=r||{},n=i.exitCode||1,o=i.code||"commander.error";this._exit(n,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in G.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,G.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new Ec(this.options),r=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&r(i.attributeName())&&e.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(n=>!r(n)).forEach(n=>{this.setOptionValueWithSource(n,i.implied[n],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let i=s=>{let a=s.attributeName(),c=this.getOptionValue(a),u=this.options.find(d=>d.negate&&a===d.attributeName()),l=this.options.find(d=>!d.negate&&a===d.attributeName());return u&&(u.presetArg===void 0&&c===!1||u.presetArg!==void 0&&c===u.presetArg)?u:l||s},n=s=>{let a=i(s),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${n(e)} cannot be used with ${n(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);n=n.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=Sg(e,n)}let i=`error: unknown option '${e}'${r}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,i=r===1?"":"s",n=e.length,o=this.parent?` for '${this.name()}'`:"",s=e.join(", "),a=`error: too many arguments${o}. Expected ${r} argument${i} but got ${n}: ${s}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(o=>{n.push(o.name()),o.alias()&&n.push(o.alias())}),r=Sg(e,n)}let i=`error: unknown command '${e}'${r}`;this.error(i,{code:"commander.unknownCommand"})}version(e,r,i){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",i=i||"output the version number";let n=this.createOption(r,i);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e}
|
|
224
|
+
`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(e);if(i){let n=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${n}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(i=>Sc(i));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).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=Ut.basename(e,Ut.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),i=this._getOutputContext(e);r.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let n=r.formatHelp(this,r);return i.hasColors?n:this._outputConfiguration.stripColor(n)}_getOutputContext(e){e=e||{};let r=!!e.error,i,n,o;return r?(i=a=>this._outputConfiguration.writeErr(a),n=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(i=a=>this._outputConfiguration.writeOut(a),n=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(n||(a=this._outputConfiguration.stripColor(a)),i(a)),hasColors:n,helpWidth:o}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let i=this._getOutputContext(e),n={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let o=this.helpInformation({error:i.error});if(r&&(o=r(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",n),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",n))}helpOption(e,r){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",r??"display help for command"),(e||r)&&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 r=Number(G.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let i=["beforeAll","before","after","afterAll"];if(!i.includes(e))throw new Error(`Unexpected value for position to addHelpText.
|
|
225
|
+
Expecting one of '${i.join("', '")}'`);let n=`${e}Help`;return this.on(n,o=>{let s;typeof r=="function"?s=r({error:o.error,command:o.command}):s=r,s&&o.write(`${s}
|
|
226
|
+
`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(n=>r.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function a0(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,i="127.0.0.1",n="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?n=o[3]:i=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],i=o[3],n=o[4]),r&&n!=="0"?`${r}=${i}:${parseInt(n)+1}`:e})}function c0(){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 S8=new Hn;he();var ie={out:t=>process.stdout.write(t),err:t=>process.stderr.write(t)};function oD(t){if(t==="debug"||t==="info"||t==="warn"||t==="error")return t;throw new zt("expected one of debug|info|warn|error")}function Ic(t){return t.option("--log-level <level>","set log verbosity (debug|info|warn|error)",oD).option("--project <path>","project identity for this session (the working directory is where jarvis launches)").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 sD(t){return t.text===!0||t.voice===!1}function aD(t,e,r,i=ie){let n=new Hn;n.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"),Ic(n),n.hook("preAction",(s,a)=>{let c=a.optsWithGlobals();c.logLevel&&j.setLevel(c.logLevel)}),n.action(async(s,a)=>{if(a.args.length>0){a.error(`error: unknown command '${a.args[0]}'`,{exitCode:1,code:"commander.unknownCommand"});return}r.exitCode=await e.activate({project:s.project??process.cwd(),textOnly:sD(s),halfDuplex:s.halfDuplex===!0,ptt:s.ptt===!0})});let o=(s,a)=>{let c=n.command(s).description(a).allowExcessArguments(!1);return Ic(c)};return o("init","first-run setup (interactive wizard)").action(async()=>{r.exitCode=await e.init()}),o("start","start the local core service").action(()=>{r.exitCode=e.stub("start")}),o("stop","stop the local core service").action(()=>{r.exitCode=e.stub("stop")}),o("restart","restart the local core service").action(()=>{r.exitCode=e.stub("restart")}),o("status","show version and check for updates").action(async()=>{r.exitCode=await e.status()}),o("doctor","run diagnostics").action(async()=>{r.exitCode=await e.doctor()}),o("models","list model choices for the configured providers").option("--refresh","fetch fresh provider catalogues (bypass the cache TTL)").action(async s=>{r.exitCode=await e.models({refresh:s.refresh===!0})}),o("devices","list audio devices").action(()=>{r.exitCode=e.stub("devices")}),o("upgrade","upgrade the installed CLI to the latest published version").action(async()=>{r.exitCode=await e.upgrade()}),cD(n,e,r),n}function cD(t,e,r){let i=t.command("config").description("inspect and edit configuration").allowExcessArguments(!0);Ic(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(),r.exitCode=0});let n=(o,s)=>{let a=i.command(o).description(s).allowExcessArguments(!1);return Ic(a)};n("list","print the resolved config (secrets redacted)").action(async()=>{r.exitCode=await e.configList()}),n("get <path>","print one config value by dotted path").action(async o=>{r.exitCode=await e.configGet(o)}),n("set <path> <value>","set one config value by dotted path").action(async(o,s)=>{r.exitCode=await e.configSet(o,s)}),n("unset <path>","remove one config value by dotted path").action(async o=>{r.exitCode=await e.configUnset(o)})}async function u0(t,e,r,i=ie){let n={exitCode:0},o=aD(e,r,n,i);try{return await o.parseAsync(t,{from:"user"}),n.exitCode}catch(s){if(s instanceof vt)return s.exitCode;throw s}}he();import{execSync as rk,spawnSync as mM}from"node:child_process";import{existsSync as gM}from"node:fs";import{join as vM}from"node:path";var jc=Ke(ek(),1);function jr(t,e){let r=tk(t),i=tk(e);return r===null||i===null?!1:jc.default.gt(r,i)}function tk(t){return jc.default.valid(t)??jc.default.coerce(t)?.version??null}var Fr=class{constructor(e,r=ie){this.currentVersion=e;this.io=r}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 r=await e.json();return typeof r.version=="string"?r.version:null}catch{return null}}async status(){this.io.out(`jarvis ${this.currentVersion}
|
|
215
227
|
`);let e=await this.fetchLatest();return e===null?this.io.out(`could not check for updates (offline?)
|
|
216
228
|
`):jr(e,this.currentVersion)?this.io.out(`upgrade available: ${this.currentVersion} -> ${e} (run: jarvis upgrade)
|
|
217
229
|
`):this.io.out(`up to date
|
|
@@ -220,12 +232,12 @@ Expecting one of '${i.join("', '")}'`);let r=`${e}Help`;return this.on(r,o=>{let
|
|
|
220
232
|
`),1;if(!jr(e,this.currentVersion))return this.io.out(`already on the latest version (${this.currentVersion})
|
|
221
233
|
`),0;if(!this.safeVersion.test(e))return this.io.err(`refusing to install unexpected version string: ${e}
|
|
222
234
|
`),1;this.io.err(`upgrading ${this.currentVersion} -> ${e}...
|
|
223
|
-
`),await this.stopCore();let
|
|
235
|
+
`),await this.stopCore();let r=`${this.npmCmd()} install -g ${this.packageName}@${e}`;try{rk(r,{stdio:"inherit"})}catch{return this.io.err(`upgrade failed; run manually: ${this.npmCmd()} install -g ${this.packageName}@latest
|
|
224
236
|
`),1}let i=this.resolveFreshEntrypoint();return i===null?(this.io.out(`upgraded to ${e}. run "jarvis --version" to confirm.
|
|
225
237
|
`),0):(this.io.err(`verifying the freshly installed jarvis...
|
|
226
|
-
`),
|
|
238
|
+
`),mM(process.execPath,[i,"--version"],{stdio:"inherit"}).status!==0?(this.io.err(`upgrade installed but the fresh entrypoint exited abnormally; run "jarvis --version" to confirm
|
|
227
239
|
`),0):(this.io.out(`upgraded to ${e}.
|
|
228
|
-
`),0))}async stopCore(){return j.debug("stop-core hook: no daemon in v0.1; nothing to stop (proposal 0013 fills this in)"),Promise.resolve()}resolveFreshEntrypoint(){try{let e=
|
|
240
|
+
`),0))}async stopCore(){return j.debug("stop-core hook: no daemon in v0.1; nothing to stop (proposal 0013 fills this in)"),Promise.resolve()}resolveFreshEntrypoint(){try{let e=rk(`${this.npmCmd()} root -g`,{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();if(!e)return null;let r=vM(e,this.packageName,"dist","index.js");return gM(r)?r:null}catch{return null}}};he();Xt();import{spawn as $M}from"node:child_process";import{existsSync as wM,readFileSync as xM,writeFileSync as SM}from"node:fs";var Vr=Ke(ok(),1),R={dim:t=>Vr.default.dim(t),bold:t=>Vr.default.bold(t),ok:t=>Vr.default.green(t),warn:t=>Vr.default.yellow(t),fail:t=>Vr.default.red(t),accent:t=>Vr.default.cyan(t)};var Zc=class{constructor(e,r=ke){this.currentVersion=e;this.home=r}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(!wM(e))return null;try{let r=JSON.parse(xM(e,"utf8"));return typeof r.lastCheckedAt=="number"&&typeof r.latestVersion=="string"?{lastCheckedAt:r.lastCheckedAt,latestVersion:r.latestVersion}:null}catch{return null}}write(e,r){let i={lastCheckedAt:r,latestVersion:e};try{this.home.ensureDir(),SM(this.cachePath(),JSON.stringify(i))}catch{}}isStale(e){let r=this.read();return!r||e-r.lastCheckedAt>this.ttlMs}notice(){let e=this.read();return!e||!jr(e.latestVersion,this.currentVersion)?null:R.dim(`upgrade available: ${this.currentVersion} -> ${e.latestVersion} (run: jarvis upgrade)`)}refreshInBackground(){try{let e=this.cachePath();this.home.ensureDir();let r=`
|
|
229
241
|
import { writeFileSync } from 'node:fs';
|
|
230
242
|
try {
|
|
231
243
|
const res = await fetch('https://registry.npmjs.org/${this.packageName}/latest', {
|
|
@@ -242,144 +254,149 @@ try {
|
|
|
242
254
|
}
|
|
243
255
|
}
|
|
244
256
|
} catch {}
|
|
245
|
-
|
|
246
|
-
`);return 0}get(e){let
|
|
247
|
-
`),1}return
|
|
248
|
-
`),1):(this.io.out(`${
|
|
249
|
-
`),0)}set(e,
|
|
250
|
-
`),1}return this.warnUnlistedModel(e,
|
|
251
|
-
`),0}warnUnlistedModel(e,
|
|
252
|
-
`)}catch{}}unset(e){try{this.config.unset(e)}catch(
|
|
257
|
+
`;$M(process.execPath,["--input-type=module","-e",r],{detached:!0,stdio:"ignore"}).unref()}catch{j.debug("background update check skipped (could not refresh cache)")}}};var Zr=class{constructor(e,r=ie,i){this.config=e;this.io=r;this.catalogue=i}config;io;catalogue;list(){let e=sk(this.config.list());for(let[r,i]of e)this.io.out(`${R.accent(r)} = ${this.renderValue(r,i)}
|
|
258
|
+
`);return 0}get(e){let r;try{r=this.config.get(e)}catch(i){return this.io.err(`error: ${Hg(i)}
|
|
259
|
+
`),1}return r===void 0?(this.io.err(`config: '${e}' is not set
|
|
260
|
+
`),1):(this.io.out(`${EM(r)}
|
|
261
|
+
`),0)}set(e,r){try{this.config.set(e,r)}catch(i){return this.io.err(`error: ${Hg(i)}
|
|
262
|
+
`),1}return this.warnUnlistedModel(e,r),this.io.out(`${R.ok("set")} ${R.accent(e)}
|
|
263
|
+
`),0}warnUnlistedModel(e,r){if(this.catalogue===void 0)return;let i=/^routes\.(text|stt|tts|embedding)\.model$/.exec(e);if(i===null)return;let n=i[1];try{let o=this.config.resolved().routes?.[n]?.provider;if(o===void 0)return;let s=this.catalogue.cached(o,n);if(s===void 0||s.models.some(a=>a.id===r))return;this.io.err(`${R.warn("warn:")} '${r}' is not in ${o}'s current list - saving anyway
|
|
264
|
+
`)}catch{}}unset(e){try{this.config.unset(e)}catch(r){return this.io.err(`error: ${Hg(r)}
|
|
253
265
|
`),1}return this.io.out(`${R.ok("unset")} ${R.accent(e)}
|
|
254
|
-
`),0}renderValue(e,
|
|
266
|
+
`),0}renderValue(e,r){return e.startsWith("secrets.")?R.dim(String(r)):String(r)}};function sk(t,e=""){let r=[];for(let[i,n]of Object.entries(t)){let o=e?`${e}.${i}`:i;n!==null&&typeof n=="object"&&!Array.isArray(n)?r.push(...sk(n,o)):r.push([o,n])}return r}function EM(t){return t!==null&&typeof t=="object"?JSON.stringify(t,null,2):String(t)}function Hg(t){return t instanceof Error?t.message:String(t)}Xt();Ur();import{existsSync as ak,statSync as ck}from"node:fs";var uk=["text","stt","tts","embedding"],kM={text:"Brain",stt:"Voice",tts:"Voice",embedding:"Memory"},Bc=class{config;probe;version;io;homeCheck;checkUpdate;catalogue;constructor(e){this.config=e.config,this.probe=e.probe,this.version=e.version,this.io=e.io??ie,this.homeCheck=e.homeCheck??TM,this.checkUpdate=e.checkUpdate??(async()=>({latest:await new Fr(this.version).fetchLatest()})),this.catalogue=e.catalogue??new Mt}async run(){let e=[],r;try{r=this.config.resolved(),e.push({level:"ok",label:"config",detail:"valid"})}catch(n){e.push({level:"fail",label:"config",detail:`invalid - ${AM(n)}`})}e.push(this.homeLine()),r&&e.push(...await this.routeLines(r)),e.push(await this.versionLine()),e.push({level:"info",label:"project",detail:process.cwd()});let i=e.some(n=>n.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 r=e.routes??{},i=new Map;for(let s of uk){let a=r[s];if(!a)continue;let c=e.secrets?.[a.provider];!c&&this.probe.requiresKey(a.provider)||i.set(a.provider,{key:c??"",...a.url!==void 0&&{url:a.url}})}let n=new Map;await Promise.all([...i].map(async([s,{key:a,url:c}])=>{let u=await this.probe.probe(s,a,{...c!==void 0&&{url:c}});n.set(s,u.status)}));let o=[];for(let s of uk){let a=r[s];if(!a){o.push(this.unconfiguredLine(s));continue}let c=`${a.provider}/${a.model}`,u=!this.probe.requiresKey(a.provider);if(!e.secrets?.[a.provider]&&!u){o.push({level:"fail",label:`${s} route`,detail:`${c} - key for '${a.provider}' is missing`});continue}o.push(this.probedLine(s,c,a.provider,n.get(a.provider),u));let l=this.modelRotLine(s,a.provider,a.model);l!==void 0&&o.push(l)}return o}modelRotLine(e,r,i){let n=this.catalogue.cached(r,e);if(n?.fresh&&!n.models.some(o=>o.id===i))return{level:"info",label:`${e} route`,detail:`model '${i}' not in ${r}'s current catalogue`}}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, ${kM[e]})`}}probedLine(e,r,i,n,o=!1){let s=`${e} route`,a=e==="text";if(o)return n==="valid"?{level:"ok",label:s,detail:`${r} (server reachable; no key needed)`}:{level:"warn",label:s,detail:`${r} (no key needed; server not reachable - is it running?)`};switch(n){case"valid":return{level:"ok",label:s,detail:`${r} (key valid)`};case"invalid":return{level:a?"fail":"warn",label:s,detail:`${r} - key rejected by ${i}`};case"unreachable":return{level:"warn",label:s,detail:`${r} (key present; could not verify - offline/unreachable)`};case"unimplemented":return{level:"warn",label:s,detail:`${r} (key present; no probe for ${i})`};case"unverifiable":return{level:"warn",label:s,detail:`${r} (key present; reached ${i} but cannot verify this key here - confirmed at first use)`};default:return{level:"warn",label:s,detail:`${r} (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)`}:jr(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,r){this.io.out(`
|
|
255
267
|
${R.bold("jarvis doctor")}
|
|
256
268
|
|
|
257
|
-
`);for(let i of e){let
|
|
269
|
+
`);for(let i of e){let n=i.detail?`: ${i.detail}`:"";this.io.out(` ${IM(i.level)} ${i.label}${n}
|
|
258
270
|
`)}this.io.out(`
|
|
259
|
-
`),
|
|
271
|
+
`),r!==0?this.io.out(`${R.fail("not ready")} - resolve the failing checks above (start with: jarvis init)
|
|
260
272
|
`):e.some(i=>i.level==="warn")?this.io.out(`${R.warn("ready, with warnings")}
|
|
261
273
|
`):this.io.out(`${R.ok("all checks passed")}
|
|
262
|
-
`)}};function
|
|
263
|
-
`),l=!1;for(let d=0;d<u.length;d++){let h=u[d];if(i+=h,l)l=!1;else if(l=h>="\uD800"&&h<="\uDBFF",l)continue;if(h===
|
|
264
|
-
`){o&&(i+=
|
|
265
|
-
`&&(
|
|
266
|
-
`)}var Ie=Ke(
|
|
274
|
+
`)}};function IM(t){switch(t){case"ok":return R.ok("OK ");case"warn":return R.warn("WARN");case"fail":return R.fail("FAIL");case"info":return R.dim("INFO")}}function TM(){let t=ke.dir();if(!ak(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=(ck(t).mode&63)===0,r=ke.resolve("config.json"),i=!ak(r)||(ck(r).mode&63)===0,n=e&&i;return{dir:t,exists:!0,permsOk:n,detail:n?"owner-only":"should be owner-only (chmod 700 ~/.jarvis; chmod 600 ~/.jarvis/config.json)"}}function AM(t){return t instanceof Error?t.message:String(t)}import{styleText as Qg}from"node:util";import{stdout as tv,stdin as kk}from"node:process";import*as lr from"node:readline";import GM from"node:readline";var lk=(()=>{let t=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return e=>{let r=0;for(t.lastIndex=0;t.test(e);)r+=1;return e.length-r}})(),dk=t=>t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510,hk=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 OM=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,PM=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,fk=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,CM=/\t{1,1000}/y,pk=/[\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,RM=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,DM=/\p{M}+/gu,NM={limit:1/0,ellipsis:""},mk=(t,e={},r={})=>{let i=e.limit??1/0,n=e.ellipsis??"",o=e?.ellipsisWidth??(n?mk(n,NM,r).width:0),s=0,a=r.controlWidth??0,c=r.tabWidth??8,u=r.emojiWidth??2,l=2,d=r.regularWidth??1,h=r.wideWidth??l,f=[[RM,d],[OM,s],[PM,a],[CM,c],[pk,u],[fk,h]],p=0,y=0,b=t.length,k=0,T=!1,A=b,$=Math.max(0,i-o),E=0,z=0,M=0,H=0;e:for(;;){if(z>E||y>=b&&y>p){let oe=t.slice(E,z)||t.slice(p,y);k=0;for(let Se of oe.replaceAll(DM,"")){let ge=Se.codePointAt(0)||0;if(dk(ge)?H=l:hk(ge)?H=h:H=d,M+H>$&&(A=Math.min(A,Math.max(E,p)+k)),M+H>i){T=!0;break e}k+=Se.length,M+=H}E=z=0}if(y>=b)break e;for(let oe=0,Se=f.length;oe<Se;oe++){let[ge,Te]=f[oe];if(ge.lastIndex=y,ge.test(t)){if(k=ge===fk?lk(t.slice(y,ge.lastIndex)):ge===pk?1:ge.lastIndex-y,H=k*Te,M+H>$&&(A=Math.min(A,y+Math.floor(($-M)/Te))),M+H>i){T=!0;break e}M+=H,E=p,z=y,y=p=ge.lastIndex;continue e}}y+=1}return{width:T?$:M,index:T?A:b,truncated:T,ellipsed:T&&i>=o}},gk=mk;var LM={limit:1/0,ellipsis:"",ellipsisWidth:0},MM=(t,e={})=>gk(t,LM,e).width,Le=MM;var Gc="\x1B",$k="\x9B",zM=39,Jg="\x07",wk="[",UM="]",xk="m",Kg=`${UM}8;;`,vk=new RegExp(`(?:\\${wk}(?<code>\\d+)m|\\${Kg}(?<uri>.*)${Jg})`,"y"),yk=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},_k=t=>`${Gc}${wk}${t}${xk}`,bk=t=>`${Gc}${Kg}${t}${Jg}`,qg=(t,e,r)=>{let i=e[Symbol.iterator](),n=!1,o=!1,s=t.at(-1),a=s===void 0?0:Le(s),c=i.next(),u=i.next(),l=0;for(;!c.done;){let d=c.value,h=Le(d);a+h<=r?t[t.length-1]+=d:(t.push(d),a=0),(d===Gc||d===$k)&&(n=!0,o=e.startsWith(Kg,l+1)),n?o?d===Jg&&(n=!1,o=!1):d===xk&&(n=!1):(a+=h,a===r&&!u.done&&(t.push(""),a=0)),c=u,u=i.next(),l+=d.length}s=t.at(-1),!a&&s!==void 0&&s.length&&t.length>1&&(t[t.length-2]+=t.pop())},jM=t=>{let e=t.split(" "),r=e.length;for(;r&&!Le(e[r-1]);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},FM=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let i="",n,o,s=t.split(" "),a=[""],c=0;for(let d=0;d<s.length;d++){let h=s[d];if(r.trim!==!1){let p=a.at(-1)??"",y=p.trimStart();p.length!==y.length&&(a[a.length-1]=y,c=Le(y))}d!==0&&(c>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),c=0),(c||r.trim===!1)&&(a[a.length-1]+=" ",c++));let f=Le(h);if(r.hard&&f>e){let p=e-c,y=1+Math.floor((f-p-1)/e);Math.floor((f-1)/e)<y&&a.push(""),qg(a,h,e),c=Le(a.at(-1)??"");continue}if(c+f>e&&c&&f){if(r.wordWrap===!1&&c<e){qg(a,h,e),c=Le(a.at(-1)??"");continue}a.push(""),c=0}if(c+f>e&&r.wordWrap===!1){qg(a,h,e),c=Le(a.at(-1)??"");continue}a[a.length-1]+=h,c+=f}r.trim!==!1&&(a=a.map(d=>jM(d)));let u=a.join(`
|
|
275
|
+
`),l=!1;for(let d=0;d<u.length;d++){let h=u[d];if(i+=h,l)l=!1;else if(l=h>="\uD800"&&h<="\uDBFF",l)continue;if(h===Gc||h===$k){vk.lastIndex=d+1;let p=vk.exec(u)?.groups;if(p?.code!==void 0){let y=Number.parseFloat(p.code);n=y===zM?void 0:y}else p?.uri!==void 0&&(o=p.uri.length===0?void 0:p.uri)}if(u[d+1]===`
|
|
276
|
+
`){o&&(i+=bk(""));let f=n?yk(n):void 0;n&&f&&(i+=_k(f))}else h===`
|
|
277
|
+
`&&(n&&yk(n)&&(i+=_k(n)),o&&(i+=bk(o)))}return i},VM=/\r?\n/;function _t(t,e,r){return String(t).normalize().split(VM).map(i=>FM(i,e,r)).join(`
|
|
278
|
+
`)}var Ie=Ke(Xg(),1);import{ReadStream as Ek}from"node:tty";function Br(t,e,r){if(!r.some(s=>!s.disabled))return t;let i=t+e,n=Math.max(r.length-1,0),o=i<0?n:i>n?0:i;return r[o].disabled?Br(o,e<0?-1:1,r):o}var WM=["up","down","left","right","space","enter","cancel"],HM=["January","February","March","April","May","June","July","August","September","October","November","December"],pe={actions:new Set(WM),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:[...HM],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 rv(t,e){if(typeof t=="string")return pe.aliases.get(t)===e;for(let r of t)if(r!==void 0&&rv(r,e))return!0;return!1}function qM(t,e){if(t===e)return;let r=t.split(`
|
|
267
279
|
`),i=e.split(`
|
|
268
|
-
`),
|
|
269
|
-
`).map((a,c,u)=>{let l=o?o(a,c):a;return c===0?`${i}${l}`:c===u.length-1?`${
|
|
270
|
-
`)}function
|
|
271
|
-
`),
|
|
272
|
-
`).length-1;this.output.write(Ie.cursor.move(-999,e*-1))}render(){let e=_t(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(Ie.cursor.hide);else{let
|
|
273
|
-
`);this.output.write(a[s]),this._prevFrame=e,this.output.write(Ie.cursor.move(0,a.length-s-1));return}else if(
|
|
280
|
+
`),n=Math.max(r.length,i.length),o=[];for(let s=0;s<n;s++)r[s]!==i[s]&&o.push(s);return{lines:o,numLinesBefore:r.length,numLinesAfter:i.length,numLines:n}}var JM=globalThis.process.platform.startsWith("win"),ev=Symbol("clack:cancel");function Yc(t){return t===ev}function Wc(t,e){let r=t;r.isTTY&&r.setRawMode(e)}function Ik({input:t=kk,output:e=tv,overwrite:r=!0,hideCursor:i=!0}={}){let n=lr.createInterface({input:t,output:e,prompt:"",tabSize:1});lr.emitKeypressEvents(t,n),t instanceof Ek&&t.isTTY&&t.setRawMode(!0);let o=(s,{name:a,sequence:c})=>{let u=String(s);if(rv([u,a,c],"cancel")){i&&e.write(Ie.cursor.show),process.exit(0);return}if(!r)return;lr.moveCursor(e,a==="return"?0:-1,a==="return"?-1:0,()=>{lr.clearLine(e,1,()=>{t.once("keypress",o)})})};return i&&e.write(Ie.cursor.hide),t.once("keypress",o),()=>{t.off("keypress",o),i&&e.write(Ie.cursor.show),t instanceof Ek&&t.isTTY&&!JM&&t.setRawMode(!1),n.terminal=!1,n.close()}}var xo=t=>"columns"in t&&typeof t.columns=="number"?t.columns:80,nv=t=>"rows"in t&&typeof t.rows=="number"?t.rows:20;function dr(t,e,r,i=r,n=r,o){let s=xo(t??tv);return _t(e,s-r.length,{hard:!0,trim:!1}).split(`
|
|
281
|
+
`).map((a,c,u)=>{let l=o?o(a,c):a;return c===0?`${i}${l}`:c===u.length-1?`${n}${l}`:`${r}${l}`}).join(`
|
|
282
|
+
`)}function Tk(t,e){if("~standard"in t){let r=t["~standard"].validate(e);if(r instanceof Promise)throw new TypeError("Schema validation must be synchronous. Update `validate()` and remove any asynchronous logic.");return r.issues?.at(0)?.message}return t(e)}var Gr=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(e,r=!0){let{input:i=kk,output:n=tv,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=r,this._abortSignal=s,this.input=i,this.output=n}unsubscribe(){this._subscribers.clear()}setSubscriber(e,r){let i=this._subscribers.get(e)??[];i.push(r),this._subscribers.set(e,i)}on(e,r){this.setSubscriber(e,{cb:r})}once(e,r){this.setSubscriber(e,{cb:r,once:!0})}emit(e,...r){let i=this._subscribers.get(e)??[],n=[];for(let o of i)o.cb(...r),o.once&&n.push(()=>i.splice(i.indexOf(o),1));for(let o of n)o()}prompt(){return new Promise(e=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(ev);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=GM.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),Wc(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(Ie.cursor.show),this.output.off("resize",this.render),Wc(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(Ie.cursor.show),this.output.off("resize",this.render),Wc(this.input,!1),e(ev)})})}_isActionKey(e,r){return e===" "}_shouldSubmit(e,r){return!0}_setValue(e){this.value=e,this.emit("value",this.value)}_setUserInput(e,r){this.userInput=e??"",this.emit("userInput",this.userInput),r&&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,r){if(this._track&&r.name!=="return"&&(r.name&&this._isActionKey(e,r)&&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"),r?.name&&(!this._track&&pe.aliases.has(r.name)&&this.emit("cursor",pe.aliases.get(r.name)),pe.actions.has(r.name)&&this.emit("cursor",r.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),this.emit("key",e,r),r?.name==="return"&&this._shouldSubmit(e,r)){if(this.opts.validate){let i=Tk(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")}rv([e,r?.name,r?.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(`
|
|
283
|
+
`),Wc(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=_t(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
|
|
284
|
+
`).length-1;this.output.write(Ie.cursor.move(-999,e*-1))}render(){let e=_t(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(Ie.cursor.hide);else{let r=qM(this._prevFrame,e),i=nv(this.output);if(this.restoreCursor(),r){let n=Math.max(0,r.numLinesAfter-i),o=Math.max(0,r.numLinesBefore-i),s=r.lines.find(a=>a>=n);if(s===void 0){this._prevFrame=e;return}if(r.lines.length===1){this.output.write(Ie.cursor.move(0,s-o)),this.output.write(Ie.erase.lines(1));let a=e.split(`
|
|
285
|
+
`);this.output.write(a[s]),this._prevFrame=e,this.output.write(Ie.cursor.move(0,a.length-s-1));return}else if(r.lines.length>1){if(n<o)s=n;else{let c=s-o;c>0&&this.output.write(Ie.cursor.move(0,c))}this.output.write(Ie.erase.down());let a=e.split(`
|
|
274
286
|
`).slice(s);this.output.write(a.join(`
|
|
275
|
-
`)),this._prevFrame=e;return}}this.output.write(Ie.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}};var
|
|
276
|
-
`)
|
|
287
|
+
`)),this._prevFrame=e;return}}this.output.write(Ie.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}};var Hc=class extends Gr{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",r=>{this.output.write(Ie.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var Ak=class extends Gr{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,r=this.value!==void 0&&this.value.length===e.length;this.value=r?[]:e.map(i=>i.value)}toggleInvert(){let e=this.value;if(!e)return;let r=this._enabledOptions.filter(i=>!e.includes(i.value));this.value=r.map(i=>i.value)}toggleValue(){this.value===void 0&&(this.value=[]);let e=this.value.includes(this._value);this.value=e?this.value.filter(r=>r!==this._value):[...this.value,this._value]}constructor(e){super(e,!1),this.options=e.options,this.value=[...e.initialValues??[]];let r=Math.max(this.options.findIndex(({value:i})=>i===e.cursorAt),0);this.cursor=this.options[r].disabled?Br(r,1,this.options):r,this.on("key",(i,n)=>{n.name==="a"&&this.toggleAll(),n.name==="i"&&this.toggleInvert()}),this.on("cursor",i=>{switch(i){case"left":case"up":this.cursor=Br(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=Br(this.cursor,1,this.options);break;case"space":this.toggleValue();break}})}},qc=class extends Gr{_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}${Qg(["inverse","hidden"],"_")}`;let r=this.masked,i=r.slice(0,this.cursor),n=r.slice(this.cursor);return`${i}${Qg("inverse",n[0])}${n.slice(1)}`}clear(){this._clearUserInput()}constructor({mask:e,...r}){super(r),this._mask=e??"\u2022",this.on("userInput",i=>{this._setValue(i)})}},Jc=class extends Gr{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 r=this.options.findIndex(({value:n})=>n===e.initialValue),i=r===-1?0:r;this.cursor=this.options[i].disabled?Br(i,1,this.options):i,this.changeValue(),this.on("cursor",n=>{switch(n){case"left":case"up":this.cursor=Br(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=Br(this.cursor,1,this.options);break}this.changeValue()})}};var Kc=class extends Gr{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let e=this.userInput;if(this.cursor>=e.length)return`${this.userInput}\u2588`;let r=e.slice(0,this.cursor),[i,...n]=e.slice(this.cursor);return`${r}${Qg("inverse",i)}${n.join("")}`}get cursor(){return this._cursor}constructor(e){super({...e,initialUserInput:e.initialUserInput??e.initialValue}),this.on("userInput",r=>{this._setValue(r)}),this.on("finalize",()=>{this.value||(this.value=e.defaultValue),this.value===void 0&&(this.value="")})}};import{styleText as _,stripVTControlCharacters as _Z}from"node:util";import ot from"node:process";var Eo=Ke(Xg(),1);function KM(){return ot.platform!=="win32"?ot.env.TERM!=="linux":!!ot.env.CI||!!ot.env.WT_SESSION||!!ot.env.TERMINUS_SUBLIME||ot.env.ConEmuTask==="{cmd::Cmder}"||ot.env.TERM_PROGRAM==="Terminus-Sublime"||ot.env.TERM_PROGRAM==="vscode"||ot.env.TERM==="xterm-256color"||ot.env.TERM==="alacritty"||ot.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var iv=KM(),YM=()=>process.env.CI==="true";var Y=(t,e)=>iv?t:e,XM=Y("\u25C6","*"),Dk=Y("\u25A0","x"),Nk=Y("\u25B2","x"),eu=Y("\u25C7","o"),QM=Y("\u250C","T"),Z=Y("\u2502","|"),bt=Y("\u2514","\u2014"),xZ=Y("\u2510","T"),SZ=Y("\u2518","\u2014"),ov=Y("\u25CF",">"),Qc=Y("\u25CB"," "),ez=Y("\u25FB","[\u2022]"),Ok=Y("\u25FC","[+]"),Pk=Y("\u25FB","[ ]"),tz=Y("\u25AA","\u2022"),Ck=Y("\u2500","-"),rz=Y("\u256E","+"),nz=Y("\u251C","+"),iz=Y("\u256F","+"),oz=Y("\u2570","+"),EZ=Y("\u256D","+"),sz=Y("\u25CF","\u2022"),az=Y("\u25C6","*"),cz=Y("\u25B2","!"),uz=Y("\u25A0","x"),ko=t=>{switch(t){case"initial":case"active":return _("cyan",XM);case"cancel":return _("red",Dk);case"error":return _("yellow",Nk);case"submit":return _("green",eu)}},Lk=t=>{switch(t){case"initial":case"active":return _("cyan",Z);case"cancel":return _("red",Z);case"error":return _("yellow",Z);case"submit":return _("green",Z)}},Rk=(t,e,r,i,n,o=!1)=>{let s=e,a=0;if(o)for(let c=i-1;c>=r&&(s-=t[c].length,a++,!(s<=n));c--);else for(let c=r;c<i&&(s-=t[c].length,a++,!(s<=n));c++);return{lineCount:s,removals:a}},sv=({cursor:t,options:e,style:r,output:i=process.stdout,maxItems:n=Number.POSITIVE_INFINITY,columnPadding:o=0,rowPadding:s=4})=>{let a=xo(i)-o,c=nv(i),u=_("dim","..."),l=Math.max(c-s,0),d=Math.max(Math.min(n,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,y=Math.min(h+d,e.length),b=[],k=0;f&&k++,p&&k++;let T=h+(f?1:0),A=y-(p?1:0);for(let E=T;E<A;E++){let z=_t(r(e[E],E===t),a,{hard:!0,trim:!1}).split(`
|
|
288
|
+
`);b.push(z),k+=z.length}if(k>l){let E=0,z=0,M=k,H=t-T,oe=l,Se=()=>Rk(b,M,0,H,oe),ge=()=>Rk(b,M,H+1,b.length,oe,!0);f?({lineCount:M,removals:E}=Se(),M>oe&&(p||(oe-=1),{lineCount:M,removals:z}=ge())):(p||(oe-=1),{lineCount:M,removals:z}=ge(),M>oe&&(oe-=1,{lineCount:M,removals:E}=Se())),E>0&&(f=!0,b.splice(0,E)),z>0&&(p=!0,b.splice(b.length-z,z))}let $=[];f&&$.push(u);for(let E of b)for(let z of E)$.push(z);return p&&$.push(u),$};var tu=t=>{let e=t.active??"Yes",r=t.inactive??"No";return new Hc({active:e,inactive:r,signal:t.signal,input:t.input,output:t.output,initialValue:t.initialValue??!0,render(){let i=t.withGuide??pe.withGuide,n=`${ko(this.state)} `,o=i?`${_("gray",Z)} `:"",s=dr(t.output,t.message,o,n),a=`${i?`${_("gray",Z)}
|
|
277
289
|
`:""}${s}
|
|
278
|
-
`,c=this.value?e:
|
|
279
|
-
${_("gray",Z)}`:""}`}default:{let u=i?`${_("cyan",Z)} `:"",l=i?_("cyan",bt):"";return`${a}${u}${this.value?`${_("green",
|
|
290
|
+
`,c=this.value?e:r;switch(this.state){case"submit":{let u=i?`${_("gray",Z)} `:"";return`${a}${u}${_("dim",c)}`}case"cancel":{let u=i?`${_("gray",Z)} `:"";return`${a}${u}${_(["strikethrough","dim"],c)}${i?`
|
|
291
|
+
${_("gray",Z)}`:""}`}default:{let u=i?`${_("cyan",Z)} `:"",l=i?_("cyan",bt):"";return`${a}${u}${this.value?`${_("green",ov)} ${e}`:`${_("dim",Qc)} ${_("dim",e)}`}${t.vertical?i?`
|
|
280
292
|
${_("cyan",Z)} `:`
|
|
281
|
-
`:` ${_("dim","/")} `}${this.value?`${_("dim",
|
|
293
|
+
`:` ${_("dim","/")} `}${this.value?`${_("dim",Qc)} ${_("dim",r)}`:`${_("green",ov)} ${r}`}
|
|
282
294
|
${l}
|
|
283
|
-
`}}}}).prompt()};var me={message:(t=[],{symbol:e=_("gray",Z),secondarySymbol:
|
|
284
|
-
`);if(d.length>0){let[h,...f]=d;h.length>0?s.push(`${u}${h}`):s.push(a?e:"");for(let p of f)p.length>0?s.push(`${l}${p}`):s.push(a?
|
|
295
|
+
`}}}}).prompt()};var me={message:(t=[],{symbol:e=_("gray",Z),secondarySymbol:r=_("gray",Z),output:i=process.stdout,spacing:n=1,withGuide:o}={})=>{let s=[],a=o??pe.withGuide,c=a?r:"",u=a?`${e} `:"",l=a?`${r} `:"";for(let h=0;h<n;h++)s.push(c);let d=Array.isArray(t)?t:t.split(`
|
|
296
|
+
`);if(d.length>0){let[h,...f]=d;h.length>0?s.push(`${u}${h}`):s.push(a?e:"");for(let p of f)p.length>0?s.push(`${l}${p}`):s.push(a?r:"")}i.write(`${s.join(`
|
|
285
297
|
`)}
|
|
286
|
-
`)},info:(t,e)=>{me.message(t,{...e,symbol:_("blue",
|
|
298
|
+
`)},info:(t,e)=>{me.message(t,{...e,symbol:_("blue",sz)})},success:(t,e)=>{me.message(t,{...e,symbol:_("green",az)})},step:(t,e)=>{me.message(t,{...e,symbol:_("green",eu)})},warn:(t,e)=>{me.message(t,{...e,symbol:_("yellow",cz)})},warning:(t,e)=>{me.warn(t,e)},error:(t,e)=>{me.message(t,{...e,symbol:_("red",uz)})}},Mk=(t="",e)=>{let r=e?.output??process.stdout,i=e?.withGuide??pe.withGuide?`${_("gray",bt)} `:"";r.write(`${i}${_("red",t)}
|
|
287
299
|
|
|
288
|
-
`)},
|
|
289
|
-
`)},
|
|
290
|
-
${_("gray",bt)} `:"";
|
|
300
|
+
`)},zk=(t="",e)=>{let r=e?.output??process.stdout,i=e?.withGuide??pe.withGuide?`${_("gray",QM)} `:"";r.write(`${i}${t}
|
|
301
|
+
`)},Uk=(t="",e)=>{let r=e?.output??process.stdout,i=e?.withGuide??pe.withGuide?`${_("gray",Z)}
|
|
302
|
+
${_("gray",bt)} `:"";r.write(`${i}${t}
|
|
291
303
|
|
|
292
304
|
`)};var So=(t,e)=>t.split(`
|
|
293
|
-
`).map(
|
|
294
|
-
`),
|
|
295
|
-
${_("reset",_("dim",`Press ${_(["gray","bgWhite","inverse"]," space ")} to select, ${_("gray",_("bgWhite",_("inverse"," enter ")))} to submit`))}`},render(){let i=t.withGuide??pe.withGuide,
|
|
296
|
-
`:""}${
|
|
297
|
-
`,s=this.value??[],a=(c,u)=>{if(c.disabled)return e(c,"disabled");let l=s.includes(c.value);return u&&l?e(c,"active-selected"):l?e(c,"selected"):e(c,u?"active":"inactive")};switch(this.state){case"submit":{let c=this.options.filter(({value:l})=>s.includes(l)).map(l=>e(l,"submitted")).join(_("dim",", "))||_("dim","none"),u=
|
|
305
|
+
`).map(r=>e(r)).join(`
|
|
306
|
+
`),jk=t=>{let e=(i,n)=>{let o=i.label??String(i.value);return n==="disabled"?`${_("gray",Pk)} ${So(o,s=>_(["strikethrough","gray"],s))}${i.hint?` ${_("dim",`(${i.hint??"disabled"})`)}`:""}`:n==="active"?`${_("cyan",ez)} ${o}${i.hint?` ${_("dim",`(${i.hint})`)}`:""}`:n==="selected"?`${_("green",Ok)} ${So(o,s=>_("dim",s))}${i.hint?` ${_("dim",`(${i.hint})`)}`:""}`:n==="cancelled"?`${So(o,s=>_(["strikethrough","dim"],s))}`:n==="active-selected"?`${_("green",Ok)} ${o}${i.hint?` ${_("dim",`(${i.hint})`)}`:""}`:n==="submitted"?`${So(o,s=>_("dim",s))}`:`${_("dim",Pk)} ${So(o,s=>_("dim",s))}`},r=t.required??!0;return new Ak({options:t.options,signal:t.signal,input:t.input,output:t.output,initialValues:t.initialValues,required:r,cursorAt:t.cursorAt,validate(i){if(r&&(i===void 0||i.length===0))return`Please select at least one option.
|
|
307
|
+
${_("reset",_("dim",`Press ${_(["gray","bgWhite","inverse"]," space ")} to select, ${_("gray",_("bgWhite",_("inverse"," enter ")))} to submit`))}`},render(){let i=t.withGuide??pe.withGuide,n=dr(t.output,t.message,i?`${Lk(this.state)} `:"",`${ko(this.state)} `),o=`${i?`${_("gray",Z)}
|
|
308
|
+
`:""}${n}
|
|
309
|
+
`,s=this.value??[],a=(c,u)=>{if(c.disabled)return e(c,"disabled");let l=s.includes(c.value);return u&&l?e(c,"active-selected"):l?e(c,"selected"):e(c,u?"active":"inactive")};switch(this.state){case"submit":{let c=this.options.filter(({value:l})=>s.includes(l)).map(l=>e(l,"submitted")).join(_("dim",", "))||_("dim","none"),u=dr(t.output,c,i?`${_("gray",Z)} `:"");return`${o}${u}`}case"cancel":{let c=this.options.filter(({value:l})=>s.includes(l)).map(l=>e(l,"cancelled")).join(_("dim",", "));if(c.trim()==="")return`${o}${_("gray",Z)}`;let u=dr(t.output,c,i?`${_("gray",Z)} `:"");return`${o}${u}${i?`
|
|
298
310
|
${_("gray",Z)}`:""}`}case"error":{let c=i?`${_("yellow",Z)} `:"",u=this.error.split(`
|
|
299
311
|
`).map((h,f)=>f===0?`${i?`${_("yellow",bt)} `:""}${_("yellow",h)}`:` ${h}`).join(`
|
|
300
312
|
`),l=o.split(`
|
|
301
313
|
`).length,d=u.split(`
|
|
302
|
-
`).length+1;return`${o}${c}${
|
|
314
|
+
`).length+1;return`${o}${c}${sv({output:t.output,options:this.options,cursor:this.cursor,maxItems:t.maxItems,columnPadding:c.length,rowPadding:l+d,style:a}).join(`
|
|
303
315
|
${c}`)}
|
|
304
316
|
${u}
|
|
305
317
|
`}default:{let c=i?`${_("cyan",Z)} `:"",u=o.split(`
|
|
306
|
-
`).length,l=i?2:1;return`${o}${c}${
|
|
318
|
+
`).length,l=i?2:1;return`${o}${c}${sv({output:t.output,options:this.options,cursor:this.cursor,maxItems:t.maxItems,columnPadding:c.length,rowPadding:u+l,style:a}).join(`
|
|
307
319
|
${c}`)}
|
|
308
320
|
${i?_("cyan",bt):""}
|
|
309
|
-
`}}}}).prompt()}
|
|
310
|
-
`),o=
|
|
311
|
-
`).map(o),""],a=
|
|
312
|
-
`),l=
|
|
313
|
-
`:"",d=
|
|
321
|
+
`}}}}).prompt()},lz=t=>_("dim",t),dz=(t,e,r)=>{let i={hard:!0,trim:!1},n=_t(t,e,i).split(`
|
|
322
|
+
`),o=n.reduce((c,u)=>Math.max(Le(u),c),0),s=n.map(r).reduce((c,u)=>Math.max(Le(u),c),0),a=e-(s-o);return _t(t,a,i)},av=(t="",e="",r)=>{let i=r?.output??ot.stdout,n=r?.withGuide??pe.withGuide,o=r?.format??lz,s=["",...dz(t,xo(i)-6,o).split(`
|
|
323
|
+
`).map(o),""],a=Le(e),c=Math.max(s.reduce((h,f)=>{let p=Le(f);return p>h?p:h},0),a)+2,u=s.map(h=>`${_("gray",Z)} ${h}${" ".repeat(c-Le(h))}${_("gray",Z)}`).join(`
|
|
324
|
+
`),l=n?`${_("gray",Z)}
|
|
325
|
+
`:"",d=n?nz:oz;i.write(`${l}${_("green",eu)} ${_("reset",e)} ${_("gray",Ck.repeat(Math.max(c-a-1,1))+rz)}
|
|
314
326
|
${u}
|
|
315
|
-
${_("gray",d+
|
|
316
|
-
`)},
|
|
317
|
-
`:""}${
|
|
318
|
-
`,i=this.userInputWithCursor,
|
|
327
|
+
${_("gray",d+Ck.repeat(c+2)+iz)}
|
|
328
|
+
`)},Fk=t=>new qc({validate:t.validate,mask:t.mask??tz,signal:t.signal,input:t.input,output:t.output,render(){let e=t.withGuide??pe.withGuide,r=`${e?`${_("gray",Z)}
|
|
329
|
+
`:""}${ko(this.state)} ${t.message}
|
|
330
|
+
`,i=this.userInputWithCursor,n=this.masked;switch(this.state){case"error":{let o=e?`${_("yellow",Z)} `:"",s=e?`${_("yellow",bt)} `:"",a=n??"";return t.clearOnError&&this.clear(),`${r.trim()}
|
|
319
331
|
${o}${a}
|
|
320
332
|
${s}${_("yellow",this.error)}
|
|
321
|
-
`}case"submit":{let o=e?`${_("gray",Z)} `:"",s=
|
|
322
|
-
${_("gray",Z)}`:""}`}default:{let o=e?`${_("cyan",Z)} `:"",s=e?_("cyan",bt):"";return`${
|
|
333
|
+
`}case"submit":{let o=e?`${_("gray",Z)} `:"",s=n?_("dim",n):"";return`${r}${o}${s}`}case"cancel":{let o=e?`${_("gray",Z)} `:"",s=n?_(["strikethrough","dim"],n):"";return`${r}${o}${s}${n&&e?`
|
|
334
|
+
${_("gray",Z)}`:""}`}default:{let o=e?`${_("cyan",Z)} `:"",s=e?_("cyan",bt):"";return`${r}${o}${i}
|
|
323
335
|
${s}
|
|
324
|
-
`}}}}).prompt();var
|
|
325
|
-
`);let Q=_t(y,
|
|
326
|
-
`);Q.length>1&&
|
|
327
|
-
`);let L=0,
|
|
328
|
-
`):
|
|
329
|
-
`)),
|
|
336
|
+
`}}}}).prompt();var hz=t=>_("magenta",t),Vk=({indicator:t="dots",onCancel:e,output:r=process.stdout,cancelMessage:i,errorMessage:n,frames:o=iv?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:s=iv?80:120,signal:a,...c}={})=>{let u=YM(),l,d,h=!1,f=!1,p="",y,b=performance.now(),k=xo(r),T=c?.styleFrame??hz,A=Q=>{let L=Q>1?n??pe.messages.error:i??pe.messages.cancel;f=Q===1,h&&(Ae(L,Q),f&&typeof e=="function"&&e())},$=()=>A(2),E=()=>A(1),z=()=>{process.on("uncaughtExceptionMonitor",$),process.on("unhandledRejection",$),process.on("SIGINT",E),process.on("SIGTERM",E),process.on("exit",A),a&&a.addEventListener("abort",E)},M=()=>{process.removeListener("uncaughtExceptionMonitor",$),process.removeListener("unhandledRejection",$),process.removeListener("SIGINT",E),process.removeListener("SIGTERM",E),process.removeListener("exit",A),a&&a.removeEventListener("abort",E)},H=()=>{if(y===void 0)return;u&&r.write(`
|
|
337
|
+
`);let Q=_t(y,k,{hard:!0,trim:!1}).split(`
|
|
338
|
+
`);Q.length>1&&r.write(Eo.cursor.up(Q.length-1)),r.write(Eo.cursor.to(0)),r.write(Eo.erase.down())},oe=Q=>Q.replace(/\.+$/,""),Se=Q=>{let L=(performance.now()-Q)/1e3,le=Math.floor(L/60),st=Math.floor(L%60);return le>0?`[${le}m ${st}s]`:`[${st}s]`},ge=c.withGuide??pe.withGuide,Te=(Q="")=>{h=!0,l=Ik({output:r}),p=oe(Q),b=performance.now(),ge&&r.write(`${_("gray",Z)}
|
|
339
|
+
`);let L=0,le=0;z(),d=setInterval(()=>{if(u&&p===y)return;H(),y=p;let st=T(o[L]),Ze;if(u)Ze=`${st} ${p}...`;else if(t==="timer")Ze=`${st} ${p} ${Se(b)}`;else{let de=".".repeat(Math.floor(le)).slice(0,3);Ze=`${st} ${p}${de}`}let Hr=_t(Ze,k,{hard:!0,trim:!1});r.write(Hr),L=L+1<o.length?L+1:0,le=le<4?le+.125:0},s)},Ae=(Q="",L=0,le=!1)=>{if(!h)return;h=!1,clearInterval(d),H();let st=L===0?_("green",eu):L===1?_("red",Dk):_("red",Nk);p=Q??p,le||(t==="timer"?r.write(`${st} ${p} ${Se(b)}
|
|
340
|
+
`):r.write(`${st} ${p}
|
|
341
|
+
`)),M(),l()};return{start:Te,stop:(Q="")=>Ae(Q,0),message:(Q="")=>{p=oe(Q??p)},cancel:(Q="")=>Ae(Q,1),error:(Q="")=>Ae(Q,2),clear:()=>Ae("",0,!0),get isCancelled(){return f}}},kZ={light:Y("\u2500","-"),heavy:Y("\u2501","="),block:Y("\u2588","#")};var Xc=(t,e)=>t.includes(`
|
|
330
342
|
`)?t.split(`
|
|
331
|
-
`).map(
|
|
332
|
-
`):e(t),Wr=t=>{let e=(
|
|
343
|
+
`).map(r=>e(r)).join(`
|
|
344
|
+
`):e(t),Wr=t=>{let e=(r,i)=>{let n=r.label??String(r.value);switch(i){case"disabled":return`${_("gray",Qc)} ${Xc(n,o=>_("gray",o))}${r.hint?` ${_("dim",`(${r.hint??"disabled"})`)}`:""}`;case"selected":return`${Xc(n,o=>_("dim",o))}`;case"active":return`${_("green",ov)} ${n}${r.hint?` ${_("dim",`(${r.hint})`)}`:""}`;case"cancelled":return`${Xc(n,o=>_(["strikethrough","dim"],o))}`;default:return`${_("dim",Qc)} ${Xc(n,o=>_("dim",o))}`}};return new Jc({options:t.options,signal:t.signal,input:t.input,output:t.output,initialValue:t.initialValue,render(){let r=t.withGuide??pe.withGuide,i=`${ko(this.state)} `,n=`${Lk(this.state)} `,o=dr(t.output,t.message,n,i),s=`${r?`${_("gray",Z)}
|
|
333
345
|
`:""}${o}
|
|
334
|
-
`;switch(this.state){case"submit":{let a=
|
|
335
|
-
${_("gray",Z)}`:""}`}default:{let a=
|
|
336
|
-
`).length,l=
|
|
346
|
+
`;switch(this.state){case"submit":{let a=r?`${_("gray",Z)} `:"",c=dr(t.output,e(this.options[this.cursor],"selected"),a);return`${s}${c}`}case"cancel":{let a=r?`${_("gray",Z)} `:"",c=dr(t.output,e(this.options[this.cursor],"cancelled"),a);return`${s}${c}${r?`
|
|
347
|
+
${_("gray",Z)}`:""}`}default:{let a=r?`${_("cyan",Z)} `:"",c=r?_("cyan",bt):"",u=s.split(`
|
|
348
|
+
`).length,l=r?2:1;return`${s}${a}${sv({output:t.output,cursor:this.cursor,options:this.options,maxItems:t.maxItems,columnPadding:a.length,rowPadding:u+l,style:(d,h)=>e(d,d.disabled?"disabled":h?"active":"inactive")}).join(`
|
|
337
349
|
${a}`)}
|
|
338
350
|
${c}
|
|
339
|
-
`}}}}).prompt()};var
|
|
340
|
-
`:""}${
|
|
341
|
-
`,i=t.placeholder?_("inverse",t.placeholder[0])+_("dim",t.placeholder.slice(1)):_(["inverse","hidden"],"_"),
|
|
342
|
-
${a}${
|
|
351
|
+
`}}}}).prompt()};var IZ=`${_("gray",Z)} `;var Zk=t=>new Kc({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??pe.withGuide,r=`${`${e?`${_("gray",Z)}
|
|
352
|
+
`:""}${ko(this.state)} `}${t.message}
|
|
353
|
+
`,i=t.placeholder?_("inverse",t.placeholder[0])+_("dim",t.placeholder.slice(1)):_(["inverse","hidden"],"_"),n=this.userInput?this.userInputWithCursor:i,o=this.value??"";switch(this.state){case"error":{let s=this.error?` ${_("yellow",this.error)}`:"",a=e?`${_("yellow",Z)} `:"",c=e?_("yellow",bt):"";return`${r.trim()}
|
|
354
|
+
${a}${n}
|
|
343
355
|
${c}${s}
|
|
344
|
-
`}case"submit":{let s=o?` ${_("dim",o)}`:"",a=e?_("gray",Z):"";return`${
|
|
345
|
-
${a}`:""}`}default:{let s=e?`${_("cyan",Z)} `:"",a=e?_("cyan",bt):"";return`${
|
|
356
|
+
`}case"submit":{let s=o?` ${_("dim",o)}`:"",a=e?_("gray",Z):"";return`${r}${a}${s}`}case"cancel":{let s=o?` ${_(["strikethrough","dim"],o)}`:"",a=e?_("gray",Z):"";return`${r}${a}${s}${o.trim()?`
|
|
357
|
+
${a}`:""}`}default:{let s=e?`${_("cyan",Z)} `:"",a=e?_("cyan",bt):"";return`${r}${s}${n}
|
|
346
358
|
${a}
|
|
347
|
-
`}}}}).prompt();he();
|
|
348
|
-
A config already exists - values are prefilled; edit or keep them.`:""),"setup");let
|
|
359
|
+
`}}}}).prompt();he();Xt();Ur();var fz={brain:["text"],voice:["stt","tts"],memory:["embedding"]},Bk=["brain","voice","memory"],cv="brain",pz=["text","stt","tts","embedding"];function mz(t){return t==="text"}function Gk(t){let e=new Set;for(let r of t)for(let i of fz[r])e.add(i);return pz.filter(r=>e.has(r))}function Wk(t){let e=["brain"],r=t.routes;return(r?.stt||r?.tts)&&e.push("voice"),r?.embedding&&e.push("memory"),e}function Hk(t,e){if(e==="valid")return[];let r=mz(t);return e==="invalid"?r?["retry","change"]:["retry","change","skip"]:r?["save","retry","change"]:["save","retry","change","skip"]}function qk(t){let e={},r={};for(let n of t.routes){let o=t.existing.routes?.[n.capability],s=o?.provider===n.provider,a=n.voiceId??(s?o.voiceId:void 0);e[n.capability]={provider:n.provider,model:n.model,...s&&o.gateway!==void 0&&{gateway:o.gateway},...s&&o.url!==void 0&&{url:o.url},...a!==void 0&&{voiceId:a}};let c=t.keys.get(n.provider),u=t.existing.secrets?.[n.provider];c!==void 0&&c.length>0?r[n.provider]=c:c===void 0&&u!==void 0&&(r[n.provider]=u)}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(r).length>0&&(i.secrets=r),i}function Jk(t,e){return!!t.isTTY&&!!e.isTTY}var Io=class extends Error{},Kk={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"}},ru=class{config;probe;catalogue;io;stdin;stdout;constructor(e){this.config=e.config,this.probe=e.probe,this.catalogue=e.catalogue,this.io=e.io??ie,this.stdin=e.stdin??process.stdin,this.stdout=e.stdout??process.stdout}async run(){if(!Jk(this.stdin,this.stdout))return this.printHeadlessGuidance(),1;try{return await this.wizard()}catch(e){if(e instanceof Io)return Mk("no changes written."),130;throw e}}loadExisting(){try{return{config:this.config.resolved(),corrupt:!1}}catch{return{config:xr.parse({}),corrupt:!0}}}async wizard(){let{config:e,corrupt:r}=this.loadExisting(),i=!r&&!!(e.routes??e.secrets);zk(R.bold("jarvis init")),r&&me.warn("the existing config.json is invalid; init will replace it with a fresh config."),av(`Writes ${R.accent(ke.resolve("config.json"))} (owner-only).`+(i?`
|
|
360
|
+
A config already exists - values are prefilled; edit or keep them.`:""),"setup");let n=await this.pickCapabilities(e),o=n.includes("voice"),s=new Map,a=[];for(let h of Gk(n)){let f=await this.configureCapability(h,e,s,o);f&&a.push(f)}let c=this.ensure(await Wr({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 Wr({message:"Log level",options:["debug","info","warn","error"].map(h=>({value:h,label:h})),initialValue:e.defaults.logLevel}));if(this.review(a,s,c,u),!this.ensure(await tu({message:"Write this configuration?"})))throw new Io;return this.config.write(qk({existing:e,routes:a,keys:s,modality:c,logLevel:u})),me.success(`wrote ${ke.resolve("config.json")}`),await tu({message:"Start Jarvis now?",initialValue:!1})===!0&&me.info("starting is not wired yet in v0.1 - run `jarvis` to begin a session."),Uk(R.ok("done.")),0}async pickCapabilities(e){let r=this.ensure(await jk({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:Wk(e),required:!1}));r.includes(cv)||me.warn("Brain (text) is required; keeping it selected.");let i=new Set(r);return i.add(cv),Bk.filter(n=>i.has(n))}async configureCapability(e,r,i,n){let o=this.probe.providersFor(e);if(o.length===0)return me.warn(`no providers available for ${e}; skipping.`),null;for(;;){let s=await this.pickProvider(e,o,r);if(!this.probe.requiresKey(s))me.info(`${s} needs no API key (a self-hosted server).`);else if(!i.has(s)){let u=await this.resolveKey(e,s,r,i);if(u==="change-provider")continue;if(u==="skip")return null}let a=await this.pickModel(e,s,r,i,n),c=await this.maybePickVoice(e,s,r,i);return{capability:e,provider:s,model:a,...c!==void 0&&{voiceId:c}}}}async resolveKey(e,r,i,n){let o=await this.firstKey(r,i);for(;;){let s=await this.validateKey(r,o);if(s==="valid")return n.set(r,o),"keyed";let a=await this.pickAfterFailure(e,s);if(a==="save")return n.set(r,o),"keyed";if(a==="skip")return me.info(`skipped ${e} (optional).`),"skip";if(a==="change")return"change-provider";o=await this.promptPassword(r)}}async maybePickVoice(e,r,i,n){if(e!=="tts")return;let o=n.get(r);if(o===void 0)return;let s=await this.probe.listVoices(r,o);if(!s.ok){this.reportVoiceListFailure(r,s.reason,s.detail);return}let a=s.voices,c=i.routes?.tts,u=c?.provider===r?c.voiceId:void 0,l=f=>f!==void 0&&a.some(p=>p.voiceId===f),d=u!==void 0&&!l(u)?null:[u,_c].find(l)??a[0].voiceId;return this.ensure(await Wr({message:`${e} voice`,options:[...a.map(f=>({value:f.voiceId,label:f.name,hint:f.category?`${f.voiceId} (${f.category})`:f.voiceId})),{value:null,label:"keep the current voice",hint:"change later with jarvis config set routes.tts.voiceId <id>"}],initialValue:d}))??void 0}reportVoiceListFailure(e,r,i){if(r!=="no_catalogue")if(r==="unauthorized")me.warn(`this ${e} key can't read its voice catalogue (missing an optional read scope - see "Provider API keys" in the README); keeping the current voice.`);else if(r==="empty")me.warn(`the ${e} voice catalogue came back empty; keeping the current voice.`);else{let n=i?` (${i})`:"";me.warn(`couldn't fetch the ${e} voice list${n}; keeping the current voice.`)}}async pickProvider(e,r,i){let n=i.routes?.[e]?.provider;return this.ensure(await Wr({message:`${e} provider`,options:r.map(o=>({value:o,label:o})),initialValue:n&&r.includes(n)?n:void 0}))}async pickModel(e,r,i,n,o){let s=i.routes?.[e],a=s?.provider===r?s.model:void 0,c=a!==void 0&&a.trim().length>0?a:void 0,u=c??this.probe.defaultModel(r,e)??"",l=n.get(r),d=this.catalogue?await this.catalogue.models(r,e,{...l!==void 0&&{key:l}}):void 0;if(d===void 0||d.source==="prefill"||d.models.length===0)return this.editModelId(e,u);let h=new Set(d.models.map($=>$.id)),f=e==="text"&&o&&d.recommendedFast!==void 0&&h.has(d.recommendedFast),p=f?d.recommendedFast:d.recommended,y=($,E)=>{let z=[];return E!==void 0&&z.push(E),$===p&&z.push(f?"recommended for voice":"recommended"),$===c&&z.push("current"),z.length>0?z.join(", "):void 0},b=d.models.map($=>{let E=y($.id,$.label);return{value:$.id,label:$.id,...E!==void 0&&{hint:E}}});c!==void 0&&!h.has(c)&&b.push({value:c,label:c,hint:"current, not in the fetched list"}),b.push({value:null,label:"enter a different model id",hint:"free text"}),f&&me.message(R.dim("voice replies feel as fast as the model's first token"));let k=c??(p!==void 0&&h.has(p)?p:d.models[0].id),T=this.ensure(await Wr({message:`${e} model`,options:b,initialValue:k}));if(T!==null)return T;let A=await this.editModelId(e,u);return h.has(A)||me.warn(`'${A}' is not in ${r}'s current list - saving anyway`),A}async editModelId(e,r){return this.ensure(await Zk({message:`${e} model`,initialValue:r,validate:i=>i?.trim()?void 0:"a model is required"}))}async firstKey(e,r){let i=r.secrets?.[e];return i&&this.ensure(await tu({message:`Reuse the saved key for ${e}?`,initialValue:!0}))?i.trim():this.promptPassword(e)}async promptPassword(e){return this.ensure(await Fk({message:`${e} API key`,validate:i=>i?.trim()?void 0:"a key is required"})).trim()}async validateKey(e,r){let i=Vk();i.start(`validating ${e} key...`);let n=await this.probe.probe(e,r),o=n.detail?` (${n.detail})`:"";return n.ok?i.stop(R.ok(`${e} key valid`)):n.status==="invalid"?i.stop(R.fail(`${e} key rejected${o}`)):n.status==="unverifiable"?i.stop(R.warn(`could not verify ${e} here${o}`)):i.stop(R.warn(`could not validate ${e}${o}`)),n.status}async pickAfterFailure(e,r){let i=Hk(e,r);return this.ensure(await Wr({message:`${e}: how do you want to proceed?`,options:i.map(n=>({value:n,label:Kk[n].label,hint:Kk[n].hint}))}))}review(e,r,i,n){let o=[];if(e.length===0)o.push("routes: none");else for(let s of e){let a=r.has(s.provider)?R.ok("key set"):R.warn("no key"),c=s.voiceId!==void 0?`, voice ${s.voiceId}`:"";o.push(`${s.capability}: ${s.provider}/${s.model} (${a}${c})`)}o.push(`defaults: modality=${i}, logLevel=${n}`),av(o.join(`
|
|
349
361
|
`),"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(`
|
|
350
362
|
`)+`
|
|
351
|
-
`)}ensure(e){if(
|
|
352
|
-
`),1}let i=
|
|
363
|
+
`)}ensure(e){if(Yc(e))throw new Io;return e}};var gz=["text","stt","tts","embedding"],nu=class{config;catalogue;probe;io;constructor(e){this.config=e.config,this.catalogue=e.catalogue,this.probe=e.probe,this.io=e.io??ie}async run(e={}){let r;try{r=this.config.resolved()}catch(s){return this.io.err(`error: ${yz(s)}
|
|
364
|
+
`),1}let i=r.routes??{},n=[];for(let s of gz){let a=i[s];a!==void 0&&n.push({capability:s,route:a})}if(n.length===0)return this.io.out("no routes configured - run `jarvis init` to set up providers.\n"),0;this.io.out(`
|
|
353
365
|
${R.bold("jarvis models")}
|
|
354
366
|
|
|
355
|
-
`);let o=new Map;if(e.refresh===!0){let s=[...new Set(
|
|
367
|
+
`);let o=new Map;if(e.refresh===!0){let s=[...new Set(n.map(({route:c})=>c.provider))],a=!1;for(let c of s){let u=r.secrets?.[c],l=await this.catalogue.refresh(c,{...u!==void 0&&{key:u}});if(o.set(c,l),!l.ok&&l.status==="failed"){a=!0;let d=l.cached!==void 0?`; showing cached list from ${Yk(l.cached.cacheAgeMs)} ago`:"",h=vz(l.detail,r.secrets);this.io.out(`${R.warn(`could not refresh ${c} (${h})${d}`)}
|
|
356
368
|
`)}}a&&this.io.out(`
|
|
357
|
-
`)}for(let{capability:s,route:a}of
|
|
358
|
-
`);let
|
|
359
|
-
`)}i.cacheAgeMs!==void 0&&i.cacheAgeMs>=6e4&&this.io.out(` ${R.dim(`(cached ${
|
|
369
|
+
`)}for(let{capability:s,route:a}of n){let c=await this.choicesFor(s,a,r,o);this.render(s,a.provider,c)}return 0}async choicesFor(e,r,i,n){let o=r.provider,s,a,c=n.get(o);if(c!==void 0)c.ok?s=c.models[e]:c.status==="failed"&&c.cached!==void 0&&(s=c.cached.models[e],s!==void 0&&(a=c.cached.cacheAgeMs));else{let p=i.secrets?.[o],y=await this.catalogue.models(o,e,{...p!==void 0&&{key:p}});y.source!=="prefill"&&(s=y.models,y.source==="cache"&&(a=y.cacheAgeMs))}let u=s!==void 0;if(s===void 0){let p=this.probe.defaultModel(o,e);s=p===void 0?[]:[{id:p}]}let l=this.probe.defaultModel(o,e),d=i.routes?.stt!==void 0||i.routes?.tts!==void 0,h=e==="text"&&d?this.probe.fastModel(o,e):void 0,f=s.map(p=>({id:p.id,...p.label!==void 0&&{label:p.label},markers:[...p.id===l?["recommended"]:[],...p.id===h?["recommended for voice"]:[],...p.id===r.model?["configured"]:[]]}));return s.some(p=>p.id===r.model)||f.push({id:r.model,markers:[u?`configured, not in ${o}'s current list`:"configured"]}),{rows:f,...a!==void 0&&{cacheAgeMs:a}}}render(e,r,i){this.io.out(`${R.bold(e)}: ${R.accent(r)}
|
|
370
|
+
`);let n=Math.max(...i.rows.map(o=>o.id.length));for(let o of i.rows){let s=[];o.label!==void 0&&s.push(o.label),o.markers.length>0&&s.push(R.dim(`(${o.markers.join(", ")})`));let a=s.length>0?`${o.id.padEnd(n)} ${s.join(" ")}`:o.id;this.io.out(` ${a}
|
|
371
|
+
`)}i.cacheAgeMs!==void 0&&i.cacheAgeMs>=6e4&&this.io.out(` ${R.dim(`(cached ${Yk(i.cacheAgeMs)} ago)`)}
|
|
360
372
|
`),this.io.out(`
|
|
361
|
-
`)}};function
|
|
373
|
+
`)}};function vz(t,e){let r=t;for(let i of Object.values(e??{}))for(let n of new Set([i,i.trim()]))n.length>0&&(r=r.split(n).join("<redacted>"));return r.replace(/\s+/g," ").trim()}function Yk(t){let e=Math.floor(t/6e4);if(e<1)return"moments";if(e<60)return`${e}m`;let r=Math.floor(e/60);return r<24?`${r}h`:`${Math.floor(r/24)}d`}function yz(t){return t instanceof Error?t.message:String(t)}ji();import{randomUUID as _z}from"node:crypto";var uv=class{constructor(e,r,i=ie){this.session=e;this.reader=r;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"tool.start":return this.labelShown&&(this.io.out(`
|
|
374
|
+
`),this.labelShown=!1),this.io.out(R.dim(` $ ${e.summary}`)+`
|
|
375
|
+
`),!0;case"tool.result":return this.io.out(R.dim(` ${e.summary}`)+`
|
|
376
|
+
`),!0;case"response.done":return this.labelShown&&this.io.out(`
|
|
362
377
|
`),this.promptAndSend();case"error":return this.labelShown&&this.io.out(`
|
|
363
|
-
`),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
|
|
378
|
+
`),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 r=e.trim();if(r.length!==0)try{return await this.session.send({type:"input.text",sessionId:this.session.sessionId,commandId:_z(),atMs:Date.now(),text:r}),!0}catch(i){if(i instanceof Fe){if(i.reason==="closed")return!1;this.renderSendError(i);continue}throw i}}}greet(){this.io.out(R.dim("jarvis is ready. type a message, or press ctrl-c to exit.")+`
|
|
364
379
|
`)}showLabel(){this.labelShown||(this.io.out(R.dim("jarvis")+" "),this.labelShown=!0)}renderError(e){if(e.reason==="no_text_route"){this.io.out(R.warn("no brain configured yet - run `jarvis init` to add one.")+`
|
|
365
380
|
`);return}this.io.out(R.fail(`something went wrong - ${e.message}`)+`
|
|
366
381
|
`)}renderSendError(e){this.io.out(R.warn(`could not send that (${e.reason}) - ${e.message}`)+`
|
|
367
|
-
`)}};async function
|
|
382
|
+
`)}};async function Xk(t){if(!t.stdin.isTTY)return t.io.err(R.dim("jarvis is interactive - run it in a terminal.")+`
|
|
368
383
|
`),1;let e;try{e=await t.openSession()}catch{return t.io.err(R.fail("could not start jarvis - your config may be invalid. run `jarvis doctor`.")+`
|
|
369
|
-
`),1}let
|
|
384
|
+
`),1}let r=t.createReader();return await new uv(e,r,t.io).run(),0}import{createInterface as bz}from"node:readline";var iu=class{rl;closed=!1;pending=null;constructor(e,r){this.rl=bz({input:e,output:r}),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(r=>{this.pending=r,this.rl.setPrompt(e),this.rl.prompt()})}close(){this.closed||(this.closed=!0,this.rl.close())}settle(e){let r=this.pending;this.pending=null,r?.(e)}};Ur();var Kn=class extends Error{constructor(e){super(e),this.name="AudioUnavailableError"}};function Qk(t){let e=t.routes?.stt,r=t.routes?.tts;if(!e||!r)return!1;let i=n=>!!t.secrets?.[n]||!Cr(n);return i(e.provider)&&i(r.provider)}async function eI(t){if(!t.stdin.isTTY)return t.io.err(R.dim("jarvis is interactive - run it in a terminal.")+`
|
|
370
385
|
`),1;if(t.textOnly||!t.voiceConfigured)return t.runText();if(!await t.micAvailable())return t.io.err(R.warn("no microphone detected - check it is plugged in and mic access / privacy is enabled. starting in text mode.")+`
|
|
371
386
|
`),t.runText();let e;try{e=await t.openVoiceSession()}catch{return t.io.err(R.fail("could not start jarvis - your config may be invalid. run `jarvis doctor`.")+`
|
|
372
|
-
`),1}try{return await t.runVoice(e),0}catch(
|
|
373
|
-
`),t.runText();throw n}}import{randomUUID as ov}from"node:crypto";function rv({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 CM=rv();function nv(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(CM,"")}var UI=[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],jI=12288,FI=65510,VI=[12288,12288,65281,65376,65504,65510];var ZI=4352,BI=262141,iv=[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 Qc=(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 GI=19968,[DM,LM]=MM(iv);function MM(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(GI>=r&&GI<=o)return[r,o];o-r>n-e&&(e=r,n=o)}return[e,n]}var WI=t=>t<161||t>1114109?!1:Qc(UI,t),HI=t=>t<jI||t>FI?!1:Qc(VI,t);var qI=t=>t>=DM&&t<=LM?!0:t<ZI||t>BI?!1:Qc(iv,t);function zM(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function To(t,{ambiguousAsWide:e=!1}={}){return zM(t),HI(t)||qI(t)||e&&WI(t)?2:1}var UM=new Intl.Segmenter,JI=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Mark}|\p{Surrogate})+$/v,jM=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,FM=/^\p{RGI_Emoji}$/v,VM=/^[\d#*]\u20E3$/,ZM=/\p{Extended_Pictographic}/gu;function BM(t){if(t.length>50)return!1;if(VM.test(t))return!0;if(t.includes("\u200D")){let e=t.match(ZM);return e!==null&&e.length>=2}return!1}function GM(t){return t.replace(jM,"")}function WM(t){return JI.test(t)}function KI(t){return t>=4352&&t<=4447||t>=43360&&t<=43388}function YI(t){return t>=4448&&t<=4519||t>=55216&&t<=55238}function XI(t){return t>=4520&&t<=4607||t>=55243&&t<=55291}function HM(t){return KI(t)||YI(t)||XI(t)}function qM(t,e){let n=[];for(let r of t)JI.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(!HM(o)){if(i===0)return;for(let s=r;s<n.length;s++)i+=To(n[s],e);return i}if(KI(o)&&YI(n[r+1])){i+=2,r+=XI(n[r+2])?2:1;continue}i+=To(o,e)}return i}function JM(t,e){let n=0,i=!0;for(let r of t){if(i){i=!1;continue}r>="\uFF00"&&r<="\uFFEF"&&(n+=To(r.codePointAt(0),e))}return n}function eu(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=nv(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 UM.segment(r)){if(WM(a))continue;if(FM.test(a)||BM(a)){o+=2;continue}let c=GM(a),u=qM(c,s);if(u!==void 0){o+=u;continue}let l=c.codePointAt(0);o+=To(l,s),o+=JM(c,s)}return o}ji();he();var tu=class{now;refRing=new Float32Array(4096);sessionGain=2;sessionDelayMs;sessionMargin=2;gain=2;delayMs;corr;margin=2;frozen=!1;micHops=[];refObserved=!1;inExceed=!1;exceedRunMs=0;calmRunMs=0;lastRefResumeAtMs;prevNarrowActive=!1;narrowQuietFrames=0;closest;closestOffsetMs;replyMicStartMs;windowExceedMs=0;ratioP10;ratioP90;onsetVetoes=0;onsetVetoesInGap=0;firedRead;suppTrend=[];residRatios=[];suppressedRunFrames=0;sessionProven=!1;quietFloorRms=[];clampAdmitted=!0;floorEverWarm=!1;residualSeen=!1;constructor(e={}){this.now=e.now??Date.now}beginReply(){this.refRing.fill(0),this.micHops.length=0,this.frozen=!1,this.gain=this.sessionGain,this.delayMs=this.sessionDelayMs,this.margin=this.sessionMargin,this.corr=void 0,this.refObserved=!1,this.inExceed=!1,this.exceedRunMs=0,this.calmRunMs=0,this.lastRefResumeAtMs=void 0,this.prevNarrowActive=!1,this.narrowQuietFrames=0,this.closest=void 0,this.closestOffsetMs=void 0,this.replyMicStartMs=void 0,this.windowExceedMs=0,this.ratioP10=void 0,this.ratioP90=void 0,this.onsetVetoes=0,this.onsetVetoesInGap=0,this.firedRead=void 0,this.suppTrend.length=0,this.residualSeen=!1,this.suppressedRunFrames=0}ingestReference(e,n){e.byteLength<2||(this.refObserved=!0,ek(e,n,(i,r)=>{let o=Yn(i);r>this.refRing[o]&&(this.refRing[o]=r)}))}feedMic(e,n,i){let r=e.byteLength>>1;if(r===0)return!1;let o=r/16,s=n-o;this.replyMicStartMs??=s;let a=!this.frozen;!this.frozen&&this.refObserved&&(this.micHops.length<200&&ek(e,s,(x,k)=>{this.micHops.length<200&&this.micHops.push({slot:x,rms:k})}),this.micHops.length>=80&&this.tryFreeze());let c=this.alignedRefMax(s,n),u=i??null,l=u!==null&&u.length>0?KM(u):null;l!==null&&(this.residualSeen=!0);let d=l!==null&&this.residualConverged,h=tk(e),f=d&&l!==null?l:h,p=this.gain*c*this.margin,y=d?.01:Math.max(.01,p),$=this.delayMs===void 0?c>=.005:this.narrowAlignedMax(s,n,this.delayMs)>=.005;$?(!this.prevNarrowActive&&this.narrowQuietFrames>=2&&(this.lastRefResumeAtMs=n),this.narrowQuietFrames=0):this.narrowQuietFrames++,this.prevNarrowActive=$;let I=d&&this.lastRefResumeAtMs!==void 0&&n-this.lastRefResumeAtMs<700,A=this.exceedanceArmed&&p>.01&&f>y&&!I;if(c<.005&&!A&&!this.inExceed&&(this.quietFloorRms.push(h),this.quietFloorRms.length>150&&this.quietFloorRms.shift()),this.updateClampAdmission(),u!==null&&l!==null&&!A&&!this.inExceed){if(this.frozen&&this.delayMs!==void 0){let x=Math.round(this.delayMs/20);YM(u,s,(k,z)=>{let U=this.refRing[Yn(k-x)];U<.005||(this.residRatios.push(z/U),this.residRatios.length>120&&this.residRatios.shift())})}if(c>=.005&&h>.02){let x=l/h<=.25&&l<=.01;this.suppressedRunFrames=x?this.suppressedRunFrames+1:0,this.suppressedRunFrames>=40&&(this.sessionProven=!0),this.suppTrend.length<2048&&this.replyMicStartMs!==void 0&&this.suppTrend.push({offsetMs:n-this.replyMicStartMs,ratio:l/h})}}if(this.exceedanceArmed&&p>.01){let x=f/y;(this.closest===void 0||x>this.closest)&&(this.closest=x,this.closestOffsetMs=n-this.replyMicStartMs),a&&A&&(this.windowExceedMs+=o)}let O=this.applyVerdict(A,o,d?150:64);return O&&(this.firedRead=d?"clamped":"raw"),O}get exceedanceArmed(){return this.refObserved&&this.gain>.02}observeQuietFrame(e){e.byteLength>>1!==0&&(this.quietFloorRms.push(tk(e)),this.quietFloorRms.length>150&&this.quietFloorRms.shift())}shouldFireOnSpeechOnset(){if(!this.exceedanceArmed)return!0;let e=this.now(),n=this.alignedRefMax(e,e),i=this.gain*n*this.margin<=.01;return i||(this.onsetVetoes++,n<.005&&this.onsetVetoesInGap++),i}replyEnded(e){!this.frozen&&this.micHops.length>0&&this.tryFreeze();let n={refObserved:this.refObserved,gain:this.gain,gainSource:this.frozen?"learned":"seed",margin:this.margin,delayMs:this.delayMs,corr:this.corr,closest:this.closest,closestOffsetMs:this.closestOffsetMs,windowExceedMs:this.windowExceedMs,ratioP10:this.ratioP10,ratioP90:this.ratioP90,quietFloor:this.quietFloorEstimate(),onsetVetoes:this.onsetVetoes,onsetVetoesInGap:this.onsetVetoesInGap,fired:e,firedRead:e==="exceedance"?this.firedRead:void 0,residTrend:this.computeResidTrend(),aec:this.residualSeen?{converged:this.residualConverged,residualGain:this.residualGain()}:void 0};return this.residualSeen&&e==="exceedance"&&(this.residRatios.length=0,this.suppressedRunFrames=0,this.sessionProven=!1),n}computeResidTrend(){if(this.suppTrend.length<8)return;let e=this.suppTrend[this.suppTrend.length-1].offsetMs;if(e<=0)return;let n=[[],[],[],[]];for(let{offsetMs:r,ratio:o}of this.suppTrend)n[Math.min(3,Math.max(0,Math.floor(r/e*4)))].push(o);let i=r=>r.length>0?QI(r):void 0;return[i(n[0]),i(n[1]),i(n[2]),i(n[3])]}residualGain(){return this.residRatios.length<50?this.gain:Math.min(4,QI(this.residRatios))}get residualConverged(){return this.quietFloorAllowsClamp&&this.sessionProven&&this.suppressedRunFrames>=10&&this.residRatios.length>=50&&this.residualGain()<=this.gain/4}get quietFloorAllowsClamp(){return this.clampAdmitted}updateClampAdmission(){let e=this.quietFloorEstimate();e!==void 0&&(e<=.008?this.clampAdmitted=!0:(e>.01||!this.floorEverWarm)&&(this.clampAdmitted=!1),this.floorEverWarm=!0)}quietFloorEstimate(){if(this.quietFloorRms.length<20)return;let e=[...this.quietFloorRms].sort((n,i)=>n-i);return e[Math.floor(.1*(e.length-1))]}alignedRefMax(e,n){let i=this.frozen?this.delayMs:void 0,r=i===void 0?e-700-300:e-i-300,o=i===void 0?n+300:n-i+300,s=0;for(let a=Math.floor(r/20);a<=Math.floor(o/20);a++){let c=this.refRing[Yn(a)];c>s&&(s=c)}return s}narrowAlignedMax(e,n,i){let r=0,o=Math.floor((e-i)/20),s=Math.floor((n-i)/20);for(let a=o;a<=s;a++){let c=this.refRing[Yn(a)];c>r&&(r=c)}return r}tryFreeze(){let{lag:e,corr:n}=this.bestLag(),i=[];for(let{slot:a,rms:c}of this.micHops){let u=this.refRing[Yn(a-e)];u>=.005&&i.push(c/u)}if(i.length<25)return;i.sort((a,c)=>a-c);let r=i.length>>1,o=i.length%2===1?i[r]:(i[r-1]+i[r])/2;this.gain=Math.min(4,o),this.delayMs=e*20,this.corr=n,this.ratioP10=i[Math.floor(.1*(i.length-1))],this.ratioP90=i[Math.floor(.9*(i.length-1))];let s=o>0?this.ratioP90/o:1;this.margin=Math.min(6,Math.max(2,1.25*s)),this.frozen=!0,this.sessionGain=this.gain,this.sessionDelayMs=this.delayMs,this.sessionMargin=this.margin}bestLag(){let e=Math.floor(35),n=0,i=-1/0;for(let r=0;r<=e;r++){let o=0,s=0,a=0,c=0,u=0,l=0;for(let{slot:y,rms:$}of this.micHops){let I=this.refRing[Yn(y-r)];o++,s+=$,a+=I,c+=$*$,u+=I*I,l+=$*I}let d=o*l-s*a,h=o*c-s*s,f=o*u-a*a,p=h>0&&f>0?d/Math.sqrt(h*f):0;p>i&&(i=p,n=r)}return{lag:n,corr:i===-1/0?0:i}}applyVerdict(e,n,i){if(e){if(this.calmRunMs=0,this.exceedRunMs+=n,!this.inExceed&&this.exceedRunMs>=i)return this.inExceed=!0,!0}else this.exceedRunMs=0,this.inExceed&&(this.calmRunMs+=n,this.calmRunMs>=300&&(this.inExceed=!1,this.calmRunMs=0));return!1}};function Yn(t){return(t%4096+4096)%4096}function QI(t){let e=[...t].sort((i,r)=>i-r),n=e.length>>1;return e.length%2===1?e[n]:(e[n-1]+e[n])/2}function ek(t,e,n){let i=t.byteLength>>1,r=new DataView(t.buffer,t.byteOffset,t.byteLength),o=0;for(;o<i;){let s=Math.floor((e+o/16)/20),a=(s+1)*20,c=Math.min(i,Math.ceil((a-e)*16-1e-6));c<=o&&(c=o+1);let u=0;for(let l=o;l<c;l++){let d=r.getInt16(l*2,!0)/32768;u+=d*d}n(s,Math.sqrt(u/(c-o))),o=c}}function KM(t){let e=0;for(let n of t)e+=n*n;return Math.sqrt(e/t.length)}function YM(t,e,n){let i=0;for(;i<t.length;){let r=Math.floor((e+i/16)/20),o=(r+1)*20,s=Math.min(t.length,Math.ceil((o-e)*16-1e-6));s<=i&&(s=i+1);let a=0;for(let c=i;c<s;c++)a+=t[c]*t[c];n(r,Math.sqrt(a/(s-i))),i=s}}function tk(t){let e=t.byteLength>>1;if(e===0)return 0;let n=new DataView(t.buffer,t.byteOffset,t.byteLength),i=0;for(let r=0;r<e;r++){let o=n.getInt16(r*2,!0)/32768;i+=o*o}return Math.sqrt(i/e)}function sv(t){return t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}var Ao="\x1B[2K\r",XM=new Intl.Segmenter(void 0,{granularity:"grapheme"}),ru=class{session;capture;playback;io;terminalWidth;ptt;halfDuplex;signal;phase="listening";echo=new tu;aec;labelShown=!1;partialShown=!1;statusShown=!1;listenEpoch=0;asideActive=!1;turnStats={};replyStartFeed=null;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??ne,this.terminalWidth=e.terminalWidth??(()=>process.stdout.columns),this.ptt=e.pushToTalk,this.halfDuplex=e.options?.halfDuplex??!1,this.signal=e.signal,this.aec=this.bargeInCapable?e.echoCanceller??null:null,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})}this.bargeInCapable&&this.playback.setPlayoutTap((e,n)=>{this.echo.ingestReference(e,n),this.aec?.ingestReference(e,n)});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 Kn(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()}}get bargeInCapable(){return!this.halfDuplex&&this.ptt===void 0}handleFrame(e,n){if(this.phase!=="listening"){this.bargeInCapable&&this.echo.feedMic(e,n,this.aec?.process(e,n))&&this.triggerBargeIn("exceedance");return}this.bargeInCapable&&this.echo.observeQuietFrame(e),this.aec?.process(e,n),this.talking&&this.sendFrame(e,n)}async sendFrame(e,n){try{await this.session.send({type:"input.audio.frame",sessionId:this.session.sessionId,commandId:ov(),atMs:n,audio:e})}catch(i){if(i instanceof Fe&&i.reason==="closed"){this.capture.stop();return}j.debug("dropped an audio frame",{error:i})}}handleSpeechStart(){this.phase==="responding"&&this.bargeInCapable&&this.echo.shouldFireOnSpeechOnset()&&this.triggerBargeIn("onset")}triggerBargeIn(e){let n=this.currentTurnId;this.playback.flush(),this.aec?.dropQueuedReference(),this.closeOpenLine(),this.printEchoSummary(this.echo.replyEnded(e)),this.toListening(),this.cancelTurn(n,"barge_in")}async cancelTurn(e,n){try{await this.session.send({type:"turn.cancel",sessionId:this.session.sessionId,commandId:ov(),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:ov(),atMs:Date.now()})}catch{}}handleCaptureError(e){this.cleanedUp||(this.closeOpenLine(),this.io.out(R.fail(`the microphone stopped - ${e.message}`)+`
|
|
374
|
-
`),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,this.bargeInCapable&&(this.echo.beginReply(),this.replyStartFeed=this.aec?.diagnostics()??null,this.aec?.ensureStarted())),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"
|
|
375
|
-
`),this.renderStatus("
|
|
387
|
+
`),1}try{return await t.runVoice(e),0}catch(r){if(r instanceof Kn)return t.io.err(R.warn("could not start the microphone - check mic access / privacy. starting in text mode.")+`
|
|
388
|
+
`),t.runText();throw r}}import{randomUUID as fv}from"node:crypto";function lv({onlyFirst:t=!1}={}){let n="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(n,t?void 0:"g")}var $z=lv();function dv(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace($z,"")}var tI=[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],rI=12288,nI=65510,iI=[12288,12288,65281,65376,65504,65510];var oI=4352,sI=262141,hv=[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 ou=(t,e)=>{let r=0,i=Math.floor(t.length/2)-1;for(;r<=i;){let n=Math.floor((r+i)/2),o=n*2;if(e<t[o])i=n-1;else if(e>t[o+1])r=n+1;else return!0}return!1};var aI=19968,[Sz,Ez]=kz(hv);function kz(t){let e=t[0],r=t[1];for(let i=0;i<t.length;i+=2){let n=t[i],o=t[i+1];if(aI>=n&&aI<=o)return[n,o];o-n>r-e&&(e=n,r=o)}return[e,r]}var cI=t=>t<161||t>1114109?!1:ou(tI,t),uI=t=>t<rI||t>nI?!1:ou(iI,t);var lI=t=>t>=Sz&&t<=Ez?!0:t<oI||t>sI?!1:ou(hv,t);function Iz(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function To(t,{ambiguousAsWide:e=!1}={}){return Iz(t),uI(t)||lI(t)||e&&cI(t)?2:1}var Tz=new Intl.Segmenter,dI=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Mark}|\p{Surrogate})+$/v,Az=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,Oz=/^\p{RGI_Emoji}$/v,Pz=/^[\d#*]\u20E3$/,Cz=/\p{Extended_Pictographic}/gu;function Rz(t){if(t.length>50)return!1;if(Pz.test(t))return!0;if(t.includes("\u200D")){let e=t.match(Cz);return e!==null&&e.length>=2}return!1}function Dz(t){return t.replace(Az,"")}function Nz(t){return dI.test(t)}function hI(t){return t>=4352&&t<=4447||t>=43360&&t<=43388}function fI(t){return t>=4448&&t<=4519||t>=55216&&t<=55238}function pI(t){return t>=4520&&t<=4607||t>=55243&&t<=55291}function Lz(t){return hI(t)||fI(t)||pI(t)}function Mz(t,e){let r=[];for(let n of t)dI.test(n)||r.push(n.codePointAt(0));if(r.length===0)return;let i=0;for(let n=0;n<r.length;n++){let o=r[n];if(!Lz(o)){if(i===0)return;for(let s=n;s<r.length;s++)i+=To(r[s],e);return i}if(hI(o)&&fI(r[n+1])){i+=2,n+=pI(r[n+2])?2:1;continue}i+=To(o,e)}return i}function zz(t,e){let r=0,i=!0;for(let n of t){if(i){i=!1;continue}n>="\uFF00"&&n<="\uFFEF"&&(r+=To(n.codePointAt(0),e))}return r}function su(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:i=!1}=e,n=t;if(!i&&(n.includes("\x1B")||n.includes("\x9B"))&&(n=dv(n)),n.length===0)return 0;if(/^[\u0020-\u007E]*$/.test(n))return n.length;let o=0,s={ambiguousAsWide:!r};for(let{segment:a}of Tz.segment(n)){if(Nz(a))continue;if(Oz.test(a)||Rz(a)){o+=2;continue}let c=Dz(a),u=Mz(c,s);if(u!==void 0){o+=u;continue}let l=c.codePointAt(0);o+=To(l,s),o+=zz(c,s)}return o}ji();he();var au=class{now;refRing=new Float32Array(4096);sessionGain=2;sessionDelayMs;sessionMargin=2;gain=2;delayMs;corr;margin=2;frozen=!1;micHops=[];refObserved=!1;inExceed=!1;exceedRunMs=0;calmRunMs=0;lastRefResumeAtMs;prevNarrowActive=!1;narrowQuietFrames=0;closest;closestOffsetMs;replyMicStartMs;windowExceedMs=0;ratioP10;ratioP90;onsetVetoes=0;onsetVetoesInGap=0;firedRead;suppTrend=[];residRatios=[];suppressedRunFrames=0;sessionProven=!1;quietFloorRms=[];clampAdmitted=!0;floorEverWarm=!1;residualSeen=!1;constructor(e={}){this.now=e.now??Date.now}beginReply(){this.refRing.fill(0),this.micHops.length=0,this.frozen=!1,this.gain=this.sessionGain,this.delayMs=this.sessionDelayMs,this.margin=this.sessionMargin,this.corr=void 0,this.refObserved=!1,this.inExceed=!1,this.exceedRunMs=0,this.calmRunMs=0,this.lastRefResumeAtMs=void 0,this.prevNarrowActive=!1,this.narrowQuietFrames=0,this.closest=void 0,this.closestOffsetMs=void 0,this.replyMicStartMs=void 0,this.windowExceedMs=0,this.ratioP10=void 0,this.ratioP90=void 0,this.onsetVetoes=0,this.onsetVetoesInGap=0,this.firedRead=void 0,this.suppTrend.length=0,this.residualSeen=!1,this.suppressedRunFrames=0}ingestReference(e,r){e.byteLength<2||(this.refObserved=!0,gI(e,r,(i,n)=>{let o=Yn(i);n>this.refRing[o]&&(this.refRing[o]=n)}))}feedMic(e,r,i){let n=e.byteLength>>1;if(n===0)return!1;let o=n/16,s=r-o;this.replyMicStartMs??=s;let a=!this.frozen;!this.frozen&&this.refObserved&&(this.micHops.length<200&&gI(e,s,($,E)=>{this.micHops.length<200&&this.micHops.push({slot:$,rms:E})}),this.micHops.length>=80&&this.tryFreeze());let c=this.alignedRefMax(s,r),u=i??null,l=u!==null&&u.length>0?Uz(u):null;l!==null&&(this.residualSeen=!0);let d=l!==null&&this.residualConverged,h=vI(e),f=d&&l!==null?l:h,p=this.gain*c*this.margin,y=d?.01:Math.max(.01,p),b=this.delayMs===void 0?c>=.005:this.narrowAlignedMax(s,r,this.delayMs)>=.005;b?(!this.prevNarrowActive&&this.narrowQuietFrames>=2&&(this.lastRefResumeAtMs=r),this.narrowQuietFrames=0):this.narrowQuietFrames++,this.prevNarrowActive=b;let k=d&&this.lastRefResumeAtMs!==void 0&&r-this.lastRefResumeAtMs<700,T=this.exceedanceArmed&&p>.01&&f>y&&!k;if(c<.005&&!T&&!this.inExceed&&(this.quietFloorRms.push(h),this.quietFloorRms.length>150&&this.quietFloorRms.shift()),this.updateClampAdmission(),u!==null&&l!==null&&!T&&!this.inExceed){if(this.frozen&&this.delayMs!==void 0){let $=Math.round(this.delayMs/20);jz(u,s,(E,z)=>{let M=this.refRing[Yn(E-$)];M<.005||(this.residRatios.push(z/M),this.residRatios.length>120&&this.residRatios.shift())})}if(c>=.005&&h>.02){let $=l/h<=.25&&l<=.01;this.suppressedRunFrames=$?this.suppressedRunFrames+1:0,this.suppressedRunFrames>=40&&(this.sessionProven=!0),this.suppTrend.length<2048&&this.replyMicStartMs!==void 0&&this.suppTrend.push({offsetMs:r-this.replyMicStartMs,ratio:l/h})}}if(this.exceedanceArmed&&p>.01){let $=f/y;(this.closest===void 0||$>this.closest)&&(this.closest=$,this.closestOffsetMs=r-this.replyMicStartMs),a&&T&&(this.windowExceedMs+=o)}let A=this.applyVerdict(T,o,d?150:64);return A&&(this.firedRead=d?"clamped":"raw"),A}get exceedanceArmed(){return this.refObserved&&this.gain>.02}observeQuietFrame(e){e.byteLength>>1!==0&&(this.quietFloorRms.push(vI(e)),this.quietFloorRms.length>150&&this.quietFloorRms.shift())}shouldFireOnSpeechOnset(){if(!this.exceedanceArmed)return!0;let e=this.now(),r=this.alignedRefMax(e,e),i=this.gain*r*this.margin<=.01;return i||(this.onsetVetoes++,r<.005&&this.onsetVetoesInGap++),i}replyEnded(e){!this.frozen&&this.micHops.length>0&&this.tryFreeze();let r={refObserved:this.refObserved,gain:this.gain,gainSource:this.frozen?"learned":"seed",margin:this.margin,delayMs:this.delayMs,corr:this.corr,closest:this.closest,closestOffsetMs:this.closestOffsetMs,windowExceedMs:this.windowExceedMs,ratioP10:this.ratioP10,ratioP90:this.ratioP90,quietFloor:this.quietFloorEstimate(),onsetVetoes:this.onsetVetoes,onsetVetoesInGap:this.onsetVetoesInGap,fired:e,firedRead:e==="exceedance"?this.firedRead:void 0,residTrend:this.computeResidTrend(),aec:this.residualSeen?{converged:this.residualConverged,residualGain:this.residualGain()}:void 0};return this.residualSeen&&e==="exceedance"&&(this.residRatios.length=0,this.suppressedRunFrames=0,this.sessionProven=!1),r}computeResidTrend(){if(this.suppTrend.length<8)return;let e=this.suppTrend[this.suppTrend.length-1].offsetMs;if(e<=0)return;let r=[[],[],[],[]];for(let{offsetMs:n,ratio:o}of this.suppTrend)r[Math.min(3,Math.max(0,Math.floor(n/e*4)))].push(o);let i=n=>n.length>0?mI(n):void 0;return[i(r[0]),i(r[1]),i(r[2]),i(r[3])]}residualGain(){return this.residRatios.length<50?this.gain:Math.min(4,mI(this.residRatios))}get residualConverged(){return this.quietFloorAllowsClamp&&this.sessionProven&&this.suppressedRunFrames>=10&&this.residRatios.length>=50&&this.residualGain()<=this.gain/4}get quietFloorAllowsClamp(){return this.clampAdmitted}updateClampAdmission(){let e=this.quietFloorEstimate();e!==void 0&&(e<=.008?this.clampAdmitted=!0:(e>.01||!this.floorEverWarm)&&(this.clampAdmitted=!1),this.floorEverWarm=!0)}quietFloorEstimate(){if(this.quietFloorRms.length<20)return;let e=[...this.quietFloorRms].sort((r,i)=>r-i);return e[Math.floor(.1*(e.length-1))]}alignedRefMax(e,r){let i=this.frozen?this.delayMs:void 0,n=i===void 0?e-700-300:e-i-300,o=i===void 0?r+300:r-i+300,s=0;for(let a=Math.floor(n/20);a<=Math.floor(o/20);a++){let c=this.refRing[Yn(a)];c>s&&(s=c)}return s}narrowAlignedMax(e,r,i){let n=0,o=Math.floor((e-i)/20),s=Math.floor((r-i)/20);for(let a=o;a<=s;a++){let c=this.refRing[Yn(a)];c>n&&(n=c)}return n}tryFreeze(){let{lag:e,corr:r}=this.bestLag(),i=[];for(let{slot:a,rms:c}of this.micHops){let u=this.refRing[Yn(a-e)];u>=.005&&i.push(c/u)}if(i.length<25)return;i.sort((a,c)=>a-c);let n=i.length>>1,o=i.length%2===1?i[n]:(i[n-1]+i[n])/2;this.gain=Math.min(4,o),this.delayMs=e*20,this.corr=r,this.ratioP10=i[Math.floor(.1*(i.length-1))],this.ratioP90=i[Math.floor(.9*(i.length-1))];let s=o>0?this.ratioP90/o:1;this.margin=Math.min(6,Math.max(2,1.25*s)),this.frozen=!0,this.sessionGain=this.gain,this.sessionDelayMs=this.delayMs,this.sessionMargin=this.margin}bestLag(){let e=Math.floor(35),r=0,i=-1/0;for(let n=0;n<=e;n++){let o=0,s=0,a=0,c=0,u=0,l=0;for(let{slot:y,rms:b}of this.micHops){let k=this.refRing[Yn(y-n)];o++,s+=b,a+=k,c+=b*b,u+=k*k,l+=b*k}let d=o*l-s*a,h=o*c-s*s,f=o*u-a*a,p=h>0&&f>0?d/Math.sqrt(h*f):0;p>i&&(i=p,r=n)}return{lag:r,corr:i===-1/0?0:i}}applyVerdict(e,r,i){if(e){if(this.calmRunMs=0,this.exceedRunMs+=r,!this.inExceed&&this.exceedRunMs>=i)return this.inExceed=!0,!0}else this.exceedRunMs=0,this.inExceed&&(this.calmRunMs+=r,this.calmRunMs>=300&&(this.inExceed=!1,this.calmRunMs=0));return!1}};function Yn(t){return(t%4096+4096)%4096}function mI(t){let e=[...t].sort((i,n)=>i-n),r=e.length>>1;return e.length%2===1?e[r]:(e[r-1]+e[r])/2}function gI(t,e,r){let i=t.byteLength>>1,n=new DataView(t.buffer,t.byteOffset,t.byteLength),o=0;for(;o<i;){let s=Math.floor((e+o/16)/20),a=(s+1)*20,c=Math.min(i,Math.ceil((a-e)*16-1e-6));c<=o&&(c=o+1);let u=0;for(let l=o;l<c;l++){let d=n.getInt16(l*2,!0)/32768;u+=d*d}r(s,Math.sqrt(u/(c-o))),o=c}}function Uz(t){let e=0;for(let r of t)e+=r*r;return Math.sqrt(e/t.length)}function jz(t,e,r){let i=0;for(;i<t.length;){let n=Math.floor((e+i/16)/20),o=(n+1)*20,s=Math.min(t.length,Math.ceil((o-e)*16-1e-6));s<=i&&(s=i+1);let a=0;for(let c=i;c<s;c++)a+=t[c]*t[c];r(n,Math.sqrt(a/(s-i))),i=s}}function vI(t){let e=t.byteLength>>1;if(e===0)return 0;let r=new DataView(t.buffer,t.byteOffset,t.byteLength),i=0;for(let n=0;n<e;n++){let o=r.getInt16(n*2,!0)/32768;i+=o*o}return Math.sqrt(i/e)}function pv(t){return t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}var Ao="\x1B[2K\r",Fz=new Intl.Segmenter(void 0,{granularity:"grapheme"}),cu=class{session;capture;playback;io;terminalWidth;ptt;halfDuplex;signal;phase="listening";echo=new au;aec;labelShown=!1;partialShown=!1;statusShown=!1;listenEpoch=0;asideActive=!1;turnStats={};replyStartFeed=null;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??ie,this.terminalWidth=e.terminalWidth??(()=>process.stdout.columns),this.ptt=e.pushToTalk,this.halfDuplex=e.options?.halfDuplex??!1,this.signal=e.signal,this.aec=this.bargeInCapable?e.echoCanceller??null:null,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})}this.bargeInCapable&&this.playback.setPlayoutTap((e,r)=>{this.echo.ingestReference(e,r),this.aec?.ingestReference(e,r)});try{await this.capture.start({onFrame:(e,r)=>this.handleFrame(e,r),onSpeechStart:()=>this.handleSpeechStart(),onError:e=>this.handleCaptureError(e)})}catch(e){throw await this.cleanup(),new Kn(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()}}get bargeInCapable(){return!this.halfDuplex&&this.ptt===void 0}handleFrame(e,r){if(this.phase!=="listening"){this.bargeInCapable&&this.echo.feedMic(e,r,this.aec?.process(e,r))&&this.triggerBargeIn("exceedance");return}this.bargeInCapable&&this.echo.observeQuietFrame(e),this.aec?.process(e,r),this.talking&&this.sendFrame(e,r)}async sendFrame(e,r){try{await this.session.send({type:"input.audio.frame",sessionId:this.session.sessionId,commandId:fv(),atMs:r,audio:e})}catch(i){if(i instanceof Fe&&i.reason==="closed"){this.capture.stop();return}j.debug("dropped an audio frame",{error:i})}}handleSpeechStart(){this.phase==="responding"&&this.bargeInCapable&&this.echo.shouldFireOnSpeechOnset()&&this.triggerBargeIn("onset")}triggerBargeIn(e){let r=this.currentTurnId;this.playback.flush(),this.aec?.dropQueuedReference(),this.closeOpenLine(),this.printEchoSummary(this.echo.replyEnded(e)),this.toListening(),this.cancelTurn(r,"barge_in")}async cancelTurn(e,r){try{await this.session.send({type:"turn.cancel",sessionId:this.session.sessionId,commandId:fv(),atMs:Date.now(),reason:r,...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:fv(),atMs:Date.now()})}catch{}}handleCaptureError(e){this.cleanedUp||(this.closeOpenLine(),this.io.out(R.fail(`the microphone stopped - ${e.message}`)+`
|
|
389
|
+
`),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,this.bargeInCapable&&(this.echo.beginReply(),this.replyStartFeed=this.aec?.diagnostics()??null,this.aec?.ensureStarted())),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"tool.start":if(this.phase!=="responding")return;this.closeOpenLine(),this.io.out(R.dim(` $ ${e.summary}`)+`
|
|
390
|
+
`),this.renderStatus("running");return;case"tool.result":if(this.phase!=="responding")return;this.closeOpenLine(),this.io.out(R.dim(` ${e.summary}`)+`
|
|
391
|
+
`),this.renderStatus("thinking");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 r=this.currentTurnId;this.playback.flush(),this.aec?.dropQueuedReference(),this.closeOpenLine(),this.renderError(e),this.toListening(),this.cancelTurn(r,"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.",r=this.halfDuplex?" half-duplex: barge-in is off.":"";this.io.out(R.dim(`${e}${r} press ctrl-c to exit.`)+`
|
|
392
|
+
`),this.renderStatus("listening")}renderPartial(e){this.io.out(`${Ao}you ${R.dim(this.clampPartialToOneRow(e))}`),this.partialShown=!0,this.statusShown=!1}clampPartialToOneRow(e){let r=this.visibleColumns()-5;if(su(e)<=r)return e;let i=r-3;if(i<=0)return"...";let n=[...Fz.segment(e)],o=n.length,s=0;for(;o>0;){let a=s+su(n[o-1].segment);if(a>i)break;s=a,o-=1}return o<n.length?"..."+e.slice(n[o].index):"..."}renderFinalUser(e){this.io.out(`${Ao}you ${e.text}
|
|
376
393
|
`),this.partialShown=!1,this.statusShown=!1}renderAside(e){this.io.out(`${Ao}${R.dim(`you (aside) ${e.text}`)}
|
|
377
|
-
`),this.partialShown=!1,this.statusShown=!1}showLabel(){this.labelShown||(this.eraseStatusLine(),this.io.out(R.dim("jarvis")+" "),this.labelShown=!0)}renderStatus(e){this.partialShown||this.labelShown||(this.io.out(Ao+R.dim(this.statusText(e))),this.statusShown=!0)}statusText(e){if(e!=="listening"||!this.asideActive)return`${e}...`;let
|
|
394
|
+
`),this.partialShown=!1,this.statusShown=!1}showLabel(){this.labelShown||(this.eraseStatusLine(),this.io.out(R.dim("jarvis")+" "),this.labelShown=!0)}renderStatus(e){this.partialShown||this.labelShown||(this.io.out(Ao+R.dim(this.statusText(e))),this.statusShown=!0)}statusText(e){if(e!=="listening"||!this.asideActive)return`${e}...`;let r=this.ptt?"listening (aside - press to talk to resume)":'listening (aside - say "Jarvis" to resume)',i=this.visibleColumns();if(r.length<=i)return r;let n="listening (aside)";return n.length<=i?n:`${e}...`}visibleColumns(){let e=this.terminalWidth();return e!==void 0&&e>0?e:80}eraseStatusLine(){this.statusShown&&(this.io.out(Ao),this.statusShown=!1)}renderError(e){if(e.reason==="no_voice_route"){this.io.out(R.warn("no voice configured yet - run `jarvis init` to add speech routes.")+`
|
|
378
395
|
`);return}if(e.reason==="no_text_route"){this.io.out(R.warn("no brain configured yet - run `jarvis init` to add one.")+`
|
|
379
396
|
`);return}this.io.out(R.fail(`something went wrong - ${e.message}`)+`
|
|
380
397
|
`)}closeOpenLine(){if(this.labelShown||this.partialShown){this.io.out(`
|
|
381
|
-
`),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.bargeInCapable&&this.printEchoSummary(this.echo.replyEnded()),this.toListening())})}printTurnSummary(){if(j.getLevel()!=="debug")return;let{finalAtMs:e,firstTokenAtMs:
|
|
382
|
-
`))}printEchoSummary(e){if(j.getLevel()!=="debug"||!e.refObserved)return;let
|
|
383
|
-
`)}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(),this.bargeInCapable&&this.playback.setPlayoutTap(null),this.aec?.close(),await this.capture.stop().catch(()=>{}),await this.playback.close().catch(()=>{}),await this.session.close().catch(()=>{}))}};he();var
|
|
384
|
-
`),
|
|
385
|
-
`),0)}}try{let t=
|
|
398
|
+
`),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.bargeInCapable&&this.printEchoSummary(this.echo.replyEnded()),this.toListening())})}printTurnSummary(){if(j.getLevel()!=="debug")return;let{finalAtMs:e,firstTokenAtMs:r,firstAudioAtMs:i,playbackStartAtMs:n}=this.turnStats,o=[];e!==void 0&&r!==void 0&&o.push(`commit->token ${pv(r-e)}`),r!==void 0&&i!==void 0&&o.push(`token->audio ${pv(i-r)}`),n!==void 0&&o.push(`spoke ${pv(Date.now()-n)}`),o.length!==0&&(this.eraseStatusLine(),this.io.out(R.dim(`turn ${o.join(", ")}`)+`
|
|
399
|
+
`))}printEchoSummary(e){if(j.getLevel()!=="debug"||!e.refObserved)return;let r=[`gain ${e.gain.toFixed(2)} ${e.gainSource}`];if(e.margin>2&&r.push(`margin x${e.margin.toFixed(1)}`),r.push(e.delayMs===void 0?"delay unlearned":`delay ${Math.round(e.delayMs)}ms`),e.corr!==void 0&&r.push(`corr ${e.corr.toFixed(2)}`),e.ratioP10!==void 0&&e.ratioP90!==void 0&&r.push(`ratio ${e.ratioP10.toFixed(2)}-${e.ratioP90.toFixed(2)}`),e.closest!==void 0&&e.closestOffsetMs!==void 0&&r.push(`closest ${e.closest.toFixed(2)}x@${(e.closestOffsetMs/1e3).toFixed(1)}s`),r.push(`window-exceed ${Math.round(e.windowExceedMs)}ms`),e.quietFloor!==void 0&&r.push(`quiet-floor ${e.quietFloor.toFixed(3)}`),r.push(`onset-veto ${e.onsetVetoes} (${e.onsetVetoesInGap} gap)`),e.aec){let o=e.aec.converged?"converged":"converging";r.push(`aec on (${o}, resid ${e.aec.residualGain.toFixed(2)})`)}else this.aec&&r.push(`aec off (${this.aec.status()})`);e.residTrend&&r.push(`sup ${e.residTrend.map(o=>o===void 0?"-":o.toFixed(2)).join("/")}`);let i=this.aec?.diagnostics();if(i){let o=`feed skew ${i.skewMs.toFixed(1)}ms`,s=this.replyStartFeed,a=s?i.sinceAnchorMs-s.sinceAnchorMs:0;if(s&&a>=15e3){let c=i.skewMs+i.slewMs-(s.skewMs+s.slewMs),u=Math.round(c/a*1e6),l=c>=0?"+":"";r.push(`${o} (${l}${c.toFixed(1)}ms this reply, ${u}ppm)`)}else r.push(o);Math.abs(i.slewMs)>=.5&&r.push(`slew ${i.slewMs.toFixed(0)}ms`),r.push(`resync ${i.resyncs}`)}let n=e.fired==="exceedance"&&e.firedRead!==void 0?`exceedance ${e.firedRead}`:e.fired;r.push(e.fired===void 0?"no barge":`barge (${n})`),this.eraseStatusLine(),this.io.out(R.dim(`echo ${r.join(", ")}`)+`
|
|
400
|
+
`)}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(),this.bargeInCapable&&this.playback.setPlayoutTap(null),this.aec?.close(),await this.capture.stop().catch(()=>{}),await this.playback.close().catch(()=>{}),await this.session.close().catch(()=>{}))}};he();var _I=16e3,$t=16,hr=160,Vz=120*_I,Zz=1e3,Bz=.1,Gz=30,Wz=16,Hz=.1,qz=500,uu=class{load;log;blockTap;state="idle";startPromise=null;aec=null;closed=!1;refQueue=[];refQueuedSamples=0;cursorSample=null;pendingMic=new Float32Array(0);anchorSample=0;lastStampSample=0;skewEmaMs=0;resyncs=0;slewSamples=0;constructor(e={}){this.load=e.load??Jz,this.log=e.log??j,this.blockTap=e.blockTap}ensureStarted(){return this.startPromise??=this.start(),this.startPromise}async start(){this.state="loading";try{let e=await this.load();if(this.closed)return;this.aec=new e.AEC3(_I,1,1),this.state="active"}catch(e){this.fail(e)}}ingestReference(e,r){if(!(this.closed||this.state==="unavailable")&&!(e.byteLength<2))for(this.refQueue.push({startSample:Math.round(r*$t),samples:yI(e)}),this.refQueuedSamples+=e.byteLength>>1;this.refQueuedSamples>Vz&&this.refQueue.length>1;)this.refQueuedSamples-=this.refQueue[0].samples.length,this.refQueue.shift()}process(e,r){if(this.closed||this.state!=="active"||this.aec===null)return null;let i=e.byteLength>>1;if(i===0)return null;let n=Math.round((r-i/$t)*$t);if(this.cursorSample===null)this.cursorSample=n,this.anchorSample=n,this.skewEmaMs=0;else{let c=this.cursorSample+this.pendingMic.length,u=(n-c)/$t;if(Math.abs(n-c)>Zz*$t)this.pendingMic=new Float32Array(0),this.cursorSample=n,this.anchorSample=n,this.skewEmaMs=0,this.slewSamples=0,this.resyncs++;else{this.skewEmaMs+=Bz*(u-this.skewEmaMs);let l=Math.abs(this.skewEmaMs)-Gz;if(l>0){let d=Math.min(Wz,Math.max(1,Math.round(l*$t*Hz))),h=this.skewEmaMs>0?d:-d;Math.abs(this.slewSamples+h)<=qz*$t&&(this.cursorSample+=h,this.slewSamples+=h,this.skewEmaMs-=h/$t)}}}this.lastStampSample=n+i;let o=Kz(this.pendingMic,yI(e)),s=Math.floor(o.length/hr);if(s===0)return this.pendingMic=o,null;let a=[];try{for(let c=0;c<s;c++){let u=o.subarray(c*hr,(c+1)*hr),l=this.readReference(this.cursorSample+c*hr);this.aec.analyze([l]);let d=this.aec.processSize([u]),h=new Float32Array(d);this.aec.process([h],[u]),a.push(h),this.blockTap?.(u,l,h)}}catch(c){return this.fail(c),null}return this.pendingMic=o.slice(s*hr),this.cursorSample+=s*hr,this.dropConsumedReference(),a.length===1?a[0]:Yz(a)}dropQueuedReference(){this.refQueue.length=0,this.refQueuedSamples=0}diagnostics(){return this.cursorSample===null?null:{skewMs:this.skewEmaMs,sinceAnchorMs:(this.lastStampSample-this.anchorSample)/$t,resyncs:this.resyncs,slewMs:this.slewSamples/$t}}status(){return this.state}close(){this.closed=!0,this.dropQueuedReference(),this.pendingMic=new Float32Array(0),this.freeInstance()}readReference(e){let r=new Float32Array(hr),i=e+hr;for(let n of this.refQueue){if(n.startSample>=i)break;let o=n.startSample+n.samples.length;if(o<=e)continue;let s=Math.max(e,n.startSample),a=Math.min(i,o);for(let c=s;c<a;c++){let u=n.samples[c-n.startSample],l=c-e;Math.abs(u)>Math.abs(r[l])&&(r[l]=u)}}return r}dropConsumedReference(){let e=this.cursorSample??0;for(;this.refQueue.length>0&&this.refQueue[0].startSample+this.refQueue[0].samples.length<=e;)this.refQueuedSamples-=this.refQueue[0].samples.length,this.refQueue.shift()}fail(e){this.state!=="unavailable"&&(this.state="unavailable",this.freeInstance(),this.dropQueuedReference(),this.pendingMic=new Float32Array(0),this.log.debug("echo canceller unavailable; barge-in stays on reference-aware gating",{error:e instanceof Error?e.message:String(e)}))}freeInstance(){let e=this.aec;this.aec=null;try{e?.free()}catch{}}};async function Jz(){let t=await import("@ennuicastr/webrtcaec3.js");return("default"in t?t.default:t)()}function yI(t){let e=t.byteLength>>1,r=new DataView(t.buffer,t.byteOffset,t.byteLength),i=new Float32Array(e);for(let n=0;n<e;n++)i[n]=r.getInt16(n*2,!0)/32768;return i}function Kz(t,e){if(t.length===0)return e;let r=new Float32Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r}function Yz(t){let e=new Float32Array(t.reduce((i,n)=>i+n.length,0)),r=0;for(let i of t)e.set(i,r),r+=i.length;return e}import{emitKeypressEvents as Xz}from"node:readline";var lu=class{constructor(e,r,i=Qz){this.input=e;this.onQuit=r;this.prepare=i}input;onQuit;prepare;handlers=null;talking=!1;listening=!1;onKeypress=(e,r)=>{if(r.ctrl&&r.name==="c"){this.onQuit();return}r.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 Qz(t){Xz(t)}var f4={start:"starting...",stop:"stopping...",restart:"restarting...",devices:"listing devices..."};function p4(){try{let t=d4(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 m4(t,e){let r=new Zc(t),i=r.notice();i!==null&&ie.err(`${i}
|
|
401
|
+
`),r.isStale(Date.now())&&r.refreshInBackground();let n=!1,o=!1;try{let u=new je().resolved();n=Qk(u),o=u.defaults.modality==="text"}catch{}let s=h4(),a=u=>(j.debug("opening interactive session",{project:e.project,capabilities:u}),xg().openSession({deviceId:s,projectId:e.project,clientCapabilities:u,launchDir:process.cwd()})),c=()=>Xk({stdin:process.stdin,io:ie,openSession:()=>a(["text"]),createReader:()=>new iu(process.stdin,process.stdout)});return eI({stdin:process.stdin,io:ie,textOnly:e.textOnly||o,voiceConfigured:n,micAvailable:v4,openVoiceSession:()=>a(["text","audio-in","audio-out"]),runVoice:u=>g4(u,e),runText:c})}async function g4(t,e){let{DecibriCapture:r,DecibriPlayback:i}=await Promise.resolve().then(()=>(yv(),vv)),n=new AbortController,o=e.ptt?new lu(process.stdin,()=>n.abort()):void 0,s=()=>n.abort();process.once("SIGINT",s);try{await new cu({session:t,capture:new r,playback:new i,io:ie,echoCanceller:new uu,...o&&{pushToTalk:o},options:{halfDuplex:e.halfDuplex},signal:n.signal}).run()}finally{process.removeListener("SIGINT",s)}}async function v4(){try{let{hasInputDevice:t}=await Promise.resolve().then(()=>(yv(),vv));return t()}catch(t){return j.debug("audio module unavailable; treating as no microphone",{error:t}),!1}}function y4(t){return{activate:e=>m4(t,e),status:()=>new Fr(t).status(),upgrade:()=>new Fr(t).upgrade(),init:()=>new ru({config:new je,probe:new Pr,catalogue:new Mt}).run(),doctor:()=>new Bc({config:new je,probe:new Pr,version:t}).run(),models:e=>new nu({config:new je,catalogue:new Mt,probe:new Pr}).run(e),configList:()=>new Zr(new je).list(),configGet:e=>new Zr(new je).get(e),configSet:(e,r)=>new Zr(new je,ie,new Mt).set(e,r),configUnset:e=>new Zr(new je).unset(e),stub:e=>(ie.err(`${f4[e]??`${e}: not implemented yet`}
|
|
402
|
+
`),0)}}try{let t=p4();process.exitCode=await u0(process.argv.slice(2),t,y4(t))}catch(t){j.error("jarvis failed",{error:t}),process.exitCode=1}
|