@neuvybe/jarvis 0.27.0 → 0.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +162 -150
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,88 +1,88 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __cliCreateRequire } from 'node:module'; const require = __cliCreateRequire(import.meta.url);
3
- var QI=Object.create;var nu=Object.defineProperty;var ek=Object.getOwnPropertyDescriptor;var tk=Object.getOwnPropertyNames;var rk=Object.getPrototypeOf,nk=Object.prototype.hasOwnProperty;var ae=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var g=(t,e)=>()=>(t&&(e=t(t=0)),e);var R=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),qe=(t,e)=>{for(var n in e)nu(t,n,{get:e[n],enumerable:!0})},ik=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of tk(e))!nk.call(t,r)&&r!==n&&nu(t,r,{get:()=>e[r],enumerable:!(i=ek(e,r))||i.enumerable});return t};var Je=(t,e,n)=>(n=t!=null?QI(rk(t)):{},ik(e||!t||!t.__esModule?nu(n,"default",{value:t,enumerable:!0}):n,t));function ok(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 ov,iu,U,sv=g(()=>{"use strict";ov={debug:0,info:1,warn:2,error:3};iu=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(ov[e]<ov[this.level])return;let o=`[${new Date().toISOString()}] ${e.toUpperCase()}`,s=i!==void 0?`${o} ${n} ${ok(i)}`:`${o} ${n}`;e==="warn"?console.warn(s):console.error(s)}},U=new iu});var av=g(()=>{"use strict"});var cv,ou=g(()=>{"use strict";cv="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 oe(t){return t&&Object.assign(ar,t),ar}var uv,su,au,st,Nt,ar,cr=g(()=>{su=Object.freeze({status:"aborted"});au=Symbol("zod_brand"),st=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Nt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(uv=globalThis).__zod_globalConfig??(uv.__zod_globalConfig={});ar=globalThis.__zod_globalConfig});var w={};qe(w,{BIGINT_FORMAT_RANGES:()=>vu,Class:()=>uu,NUMBER_FORMAT_RANGES:()=>gu,aborted:()=>Mt,allowsEval:()=>hu,assert:()=>lk,assertEqual:()=>sk,assertIs:()=>ck,assertNever:()=>uk,assertNotEqual:()=>ak,assignProp:()=>Lt,base64ToUint8Array:()=>dv,base64urlToUint8Array:()=>kk,cached:()=>Vr,captureStackTrace:()=>Ao,cleanEnum:()=>Ik,cleanRegex:()=>Yn,clone:()=>Te,cloneDef:()=>hk,createTransparentProxy:()=>yk,defineLazy:()=>Z,esc:()=>To,escapeRegex:()=>Ke,explicitlyAborted:()=>yu,extend:()=>$k,finalizeIssue:()=>Ae,floatSafeRemainder:()=>lu,getElementAtPath:()=>fk,getEnumValues:()=>Kn,getLengthableOrigin:()=>ei,getParsedType:()=>vk,getSizableOrigin:()=>Qn,hexToUint8Array:()=>Ak,isObject:()=>ur,isPlainObject:()=>Ut,issue:()=>Zr,joinValues:()=>v,jsonStringifyReplacer:()=>Fr,merge:()=>wk,mergeDefs:()=>$t,normalizeParams:()=>S,nullish:()=>zt,numKeys:()=>gk,objectClone:()=>dk,omit:()=>bk,optionalKeys:()=>mu,parsedType:()=>x,partial:()=>Sk,pick:()=>_k,prefixIssues:()=>Ne,primitiveTypes:()=>pu,promiseAllObject:()=>pk,propertyKeyTypes:()=>Xn,randomString:()=>mk,required:()=>Ek,safeExtend:()=>xk,shallowClone:()=>fu,slugify:()=>du,stringifyPrimitive:()=>$,uint8ArrayToBase64:()=>hv,uint8ArrayToBase64url:()=>Tk,uint8ArrayToHex:()=>Ok,unwrapMessage:()=>Jn});function sk(t){return t}function ak(t){return t}function ck(t){}function uk(t){throw new Error("Unexpected value in exhaustive check")}function lk(t){}function Kn(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=>$(n)).join(e)}function Fr(t,e){return typeof e=="bigint"?e.toString():e}function Vr(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 Yn(t){let e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}function lu(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 Z(t,e,n){let i;Object.defineProperty(t,e,{get(){if(i!==lv)return i===void 0&&(i=lv,i=n()),i},set(r){Object.defineProperty(t,e,{value:r})},configurable:!0})}function dk(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function Lt(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}function $t(...t){let e={};for(let n of t){let i=Object.getOwnPropertyDescriptors(n);Object.assign(e,i)}return Object.defineProperties({},e)}function hk(t){return $t(t._zod.def)}function fk(t,e){return e?e.reduce((n,i)=>n?.[i],t):t}function pk(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 mk(t=10){let e="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<t;i++)n+=e[Math.floor(Math.random()*e.length)];return n}function To(t){return JSON.stringify(t)}function du(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function ur(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ut(t){if(ur(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let n=e.prototype;return!(ur(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function fu(t){return Ut(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function gk(t){let e=0;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function Ke(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Te(t,e,n){let i=new t._zod.constr(e??t._zod.def);return(!e||n?.parent)&&(i._zod.parent=t),i}function S(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 yk(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 $(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function mu(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function _k(t,e){let n=t._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=$t(t._zod.def,{get shape(){let s={};for(let a in e){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(s[a]=n.shape[a])}return Lt(this,"shape",s),s},checks:[]});return Te(t,o)}function bk(t,e){let n=t._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=$t(t._zod.def,{get shape(){let s={...t._zod.def.shape};for(let a in e){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete s[a]}return Lt(this,"shape",s),s},checks:[]});return Te(t,o)}function $k(t,e){if(!Ut(e))throw new Error("Invalid input to extend: expected a plain object");let n=t._zod.def.checks;if(n&&n.length>0){let o=t._zod.def.shape;for(let s in e)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=$t(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return Lt(this,"shape",o),o}});return Te(t,r)}function xk(t,e){if(!Ut(e))throw new Error("Invalid input to safeExtend: expected a plain object");let n=$t(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e};return Lt(this,"shape",i),i}});return Te(t,n)}function wk(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=$t(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e._zod.def.shape};return Lt(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Te(t,n)}function Sk(t,e,n){let r=e._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=$t(e._zod.def,{get shape(){let a=e._zod.def.shape,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 Lt(this,"shape",c),c},checks:[]});return Te(e,s)}function Ek(t,e,n){let i=$t(e._zod.def,{get shape(){let r=e._zod.def.shape,o={...r};if(n)for(let s in n){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(o[s]=new t({type:"nonoptional",innerType:r[s]}))}else for(let s in r)o[s]=new t({type:"nonoptional",innerType:r[s]});return Lt(this,"shape",o),o}});return Te(e,i)}function Mt(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 yu(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 Ne(t,e){return e.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(t),n})}function Jn(t){return typeof t=="string"?t:t?.message}function Ae(t,e,n){let i=t.message?t.message:Jn(t.inst?._zod.def?.error?.(t))??Jn(e?.error?.(t))??Jn(n.customError?.(t))??Jn(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 Qn(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function ei(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 n=t;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return e}function Zr(...t){let[e,n,i]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:i}:{...e}}function Ik(t){return Object.entries(t).filter(([e,n])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function dv(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 hv(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}function kk(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-e.length%4)%4);return dv(e+n)}function Tk(t){return hv(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ak(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 Ok(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var lv,Ao,hu,vk,Xn,pu,gu,vu,uu,D=g(()=>{cr();lv=Symbol("evaluating");Ao="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};hu=Vr(()=>{if(ar.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});vk=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}`)}},Xn=new Set(["string","number","symbol"]),pu=new Set(["string","number","bigint","boolean","symbol","undefined"]);gu={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]},vu={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};uu=class{constructor(...e){}}});function ri(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 ni(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 _u(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 pv(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 bu(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 ${pv(i.path)}`);return e.join(`
4
- `)}var fv,ti,ze,$u=g(()=>{cr();D();fv=(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,Fr,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},ti=m("$ZodError",fv),ze=m("$ZodError",fv,{Parent:Error})});var Br,Oo,Gr,Po,Wr,xu,Hr,wu,Co,Ck,Ro,Rk,Do,Dk,No,Nk,zo,zk,Lo,Lk,Uo,Uk,Mo,Mk,Su=g(()=>{cr();$u();D();Br=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 st;if(s.issues.length){let a=new(r?.Err??t)(s.issues.map(c=>Ae(c,o,oe())));throw Ao(a,r?.callee),a}return s.value},Oo=Br(ze),Gr=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=>Ae(c,o,oe())));throw Ao(a,r?.callee),a}return s.value},Po=Gr(ze),Wr=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 st;return o.issues.length?{success:!1,error:new(t??ti)(o.issues.map(s=>Ae(s,r,oe())))}:{success:!0,data:o.value}},xu=Wr(ze),Hr=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=>Ae(s,r,oe())))}:{success:!0,data:o.value}},wu=Hr(ze),Co=t=>(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Br(t)(e,n,r)},Ck=Co(ze),Ro=t=>(e,n,i)=>Br(t)(e,n,i),Rk=Ro(ze),Do=t=>async(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Gr(t)(e,n,r)},Dk=Do(ze),No=t=>async(e,n,i)=>Gr(t)(e,n,i),Nk=No(ze),zo=t=>(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Wr(t)(e,n,r)},zk=zo(ze),Lo=t=>(e,n,i)=>Wr(t)(e,n,i),Lk=Lo(ze),Uo=t=>async(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Hr(t)(e,n,r)},Uk=Uo(ze),Mo=t=>async(e,n,i)=>Hr(t)(e,n,i),Mk=Mo(ze)});var Ve={};qe(Ve,{base64:()=>ju,base64url:()=>jo,bigint:()=>Hu,boolean:()=>Ju,browserEmail:()=>Hk,cidrv4:()=>Uu,cidrv6:()=>Mu,cuid:()=>Eu,cuid2:()=>Iu,date:()=>Zu,datetime:()=>Gu,domain:()=>Kk,duration:()=>Pu,e164:()=>Vu,email:()=>Ru,emoji:()=>Du,extendedDuration:()=>jk,guid:()=>Cu,hex:()=>Yk,hostname:()=>Jk,html5Email:()=>Bk,httpProtocol:()=>Fu,idnEmail:()=>Wk,integer:()=>qu,ipv4:()=>Nu,ipv6:()=>zu,ksuid:()=>Au,lowercase:()=>Xu,mac:()=>Lu,md5_base64:()=>Qk,md5_base64url:()=>e1,md5_hex:()=>Xk,nanoid:()=>Ou,null:()=>Ku,number:()=>Fo,rfc5322Email:()=>Gk,sha1_base64:()=>r1,sha1_base64url:()=>n1,sha1_hex:()=>t1,sha256_base64:()=>o1,sha256_base64url:()=>s1,sha256_hex:()=>i1,sha384_base64:()=>c1,sha384_base64url:()=>u1,sha384_hex:()=>a1,sha512_base64:()=>d1,sha512_base64url:()=>h1,sha512_hex:()=>l1,string:()=>Wu,time:()=>Bu,ulid:()=>ku,undefined:()=>Yu,unicodeEmail:()=>mv,uppercase:()=>Qu,uuid:()=>lr,uuid4:()=>Fk,uuid6:()=>Vk,uuid7:()=>Zk,xid:()=>Tu});function Du(){return new RegExp(qk,"u")}function vv(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 Bu(t){return new RegExp(`^${vv(t)}$`)}function Gu(t){let e=vv({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(`^${gv}T(?:${i})$`)}function ii(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function oi(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var Eu,Iu,ku,Tu,Au,Ou,Pu,jk,Cu,lr,Fk,Vk,Zk,Ru,Bk,Gk,mv,Wk,Hk,qk,Nu,zu,Lu,Uu,Mu,ju,jo,Jk,Kk,Fu,Vu,gv,Zu,Wu,Hu,qu,Fo,Ju,Ku,Yu,Xu,Qu,Yk,Xk,Qk,e1,t1,r1,n1,i1,o1,s1,a1,c1,u1,l1,d1,h1,Vo=g(()=>{D();Eu=/^[cC][0-9a-z]{6,}$/,Iu=/^[0-9a-z]+$/,ku=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Tu=/^[0-9a-vA-V]{20}$/,Au=/^[A-Za-z0-9]{27}$/,Ou=/^[a-zA-Z0-9_-]{21}$/,Pu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,jk=/^[-+]?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)?)??$/,Cu=/^([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})$/,lr=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)$/,Fk=lr(4),Vk=lr(6),Zk=lr(7),Ru=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Bk=/^[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])?)*$/,Gk=/^(([^<>()\[\]\\.,;:\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,}))$/,mv=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Wk=mv,Hk=/^[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])?)*$/,qk="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";Nu=/^(?:(?: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])$/,zu=/^(([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}|:))$/,Lu=t=>{let e=Ke(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},Uu=/^((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])$/,Mu=/^(([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])$/,ju=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,jo=/^[A-Za-z0-9_-]*$/,Jk=/^(?=.{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])?)*\.?$/,Kk=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Fu=/^https?$/,Vu=/^\+[1-9]\d{6,14}$/,gv="(?:(?:\\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])))",Zu=new RegExp(`^${gv}$`);Wu=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Hu=/^-?\d+n?$/,qu=/^-?\d+$/,Fo=/^-?\d+(?:\.\d+)?$/,Ju=/^(?:true|false)$/i,Ku=/^null$/i,Yu=/^undefined$/i,Xu=/^[^A-Z]*$/,Qu=/^[^a-z]*$/,Yk=/^[0-9a-fA-F]*$/;Xk=/^[0-9a-fA-F]{32}$/,Qk=ii(22,"=="),e1=oi(22),t1=/^[0-9a-fA-F]{40}$/,r1=ii(27,"="),n1=oi(27),i1=/^[0-9a-fA-F]{64}$/,o1=ii(43,"="),s1=oi(43),a1=/^[0-9a-fA-F]{96}$/,c1=ii(64,""),u1=oi(64),l1=/^[0-9a-fA-F]{128}$/,d1=ii(86,"=="),h1=oi(86)});function yv(t,e,n){t.issues.length&&e.issues.push(...Ne(n,t.issues))}var X,_v,Zo,Bo,el,tl,rl,nl,il,ol,sl,al,cl,qr,ul,ll,dl,hl,fl,pl,ml,gl,vl,Go=g(()=>{cr();Vo();D();X=m("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),_v={number:"number",bigint:"bigint",object:"date"},Zo=m("$ZodCheckLessThan",(t,e)=>{X.init(t,e);let n=_v[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})}}),Bo=m("$ZodCheckGreaterThan",(t,e)=>{X.init(t,e);let n=_v[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})}}),el=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):lu(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})}}),tl=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]=gu[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=qu)}),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})}}),rl=m("$ZodCheckBigIntFormat",(t,e)=>{X.init(t,e);let[n,i]=vu[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})}}),nl=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:Qn(r),code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),il=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:Qn(r),code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),ol=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:Qn(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})}}),sl=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=ei(r);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),al=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=ei(r);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),cl=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=ei(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})}}),qr=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=()=>{})}),ul=m("$ZodCheckRegex",(t,e)=>{qr.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})}}),ll=m("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Xu),qr.init(t,e)}),dl=m("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Qu),qr.init(t,e)}),hl=m("$ZodCheckIncludes",(t,e)=>{X.init(t,e);let n=Ke(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${n}`:n);e.pattern=i,t._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),t._zod.check=r=>{r.value.includes(e.includes,e.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:r.value,inst:t,continue:!e.abort})}}),fl=m("$ZodCheckStartsWith",(t,e)=>{X.init(t,e);let n=new RegExp(`^${Ke(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),t._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:t,continue:!e.abort})}}),pl=m("$ZodCheckEndsWith",(t,e)=>{X.init(t,e);let n=new RegExp(`.*${Ke(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),t._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:t,continue:!e.abort})}});ml=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=>yv(r,n,e.property));yv(i,n,e.property)}}),gl=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})}}),vl=m("$ZodCheckOverwrite",(t,e)=>{X.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}})});var si,yl=g(()=>{si=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let i=e.split(`
3
+ var ck=Object.create;var au=Object.defineProperty;var uk=Object.getOwnPropertyDescriptor;var lk=Object.getOwnPropertyNames;var dk=Object.getPrototypeOf,hk=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),qe=(t,e)=>{for(var n in e)au(t,n,{get:e[n],enumerable:!0})},fk=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of lk(e))!hk.call(t,r)&&r!==n&&au(t,r,{get:()=>e[r],enumerable:!(i=uk(e,r))||i.enumerable});return t};var Je=(t,e,n)=>(n=t!=null?ck(dk(t)):{},fk(e||!t||!t.__esModule?au(n,"default",{value:t,enumerable:!0}):n,t));function pk(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 cv,cu,j,uv=g(()=>{"use strict";cv={debug:0,info:1,warn:2,error:3};cu=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(cv[e]<cv[this.level])return;let o=`[${new Date().toISOString()}] ${e.toUpperCase()}`,s=i!==void 0?`${o} ${n} ${pk(i)}`:`${o} ${n}`;e==="warn"?console.warn(s):console.error(s)}},j=new cu});var lv=g(()=>{"use strict"});var dv,uu=g(()=>{"use strict";dv="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(lr,t),lr}var hv,lu,du,st,Mt,lr,dr=g(()=>{lu=Object.freeze({status:"aborted"});du=Symbol("zod_brand"),st=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Mt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(hv=globalThis).__zod_globalConfig??(hv.__zod_globalConfig={});lr=globalThis.__zod_globalConfig});var S={};qe(S,{BIGINT_FORMAT_RANGES:()=>$u,Class:()=>fu,NUMBER_FORMAT_RANGES:()=>bu,aborted:()=>Ft,allowsEval:()=>gu,assert:()=>_k,assertEqual:()=>mk,assertIs:()=>vk,assertNever:()=>yk,assertNotEqual:()=>gk,assignProp:()=>Ut,base64ToUint8Array:()=>pv,base64urlToUint8Array:()=>Lk,cached:()=>Hr,captureStackTrace:()=>Co,cleanEnum:()=>Dk,cleanRegex:()=>ei,clone:()=>Te,cloneDef:()=>$k,createTransparentProxy:()=>kk,defineLazy:()=>B,esc:()=>Po,escapeRegex:()=>Ke,explicitlyAborted:()=>xu,extend:()=>Ok,finalizeIssue:()=>Ae,floatSafeRemainder:()=>pu,getElementAtPath:()=>xk,getEnumValues:()=>Qn,getLengthableOrigin:()=>ni,getParsedType:()=>Ik,getSizableOrigin:()=>ri,hexToUint8Array:()=>zk,isObject:()=>hr,isPlainObject:()=>jt,issue:()=>qr,joinValues:()=>v,jsonStringifyReplacer:()=>Wr,merge:()=>Ck,mergeDefs:()=>xt,normalizeParams:()=>E,nullish:()=>zt,numKeys:()=>Ek,objectClone:()=>bk,omit:()=>Ak,optionalKeys:()=>_u,parsedType:()=>x,partial:()=>Rk,pick:()=>Tk,prefixIssues:()=>De,primitiveTypes:()=>yu,promiseAllObject:()=>wk,propertyKeyTypes:()=>ti,randomString:()=>Sk,required:()=>Nk,safeExtend:()=>Pk,shallowClone:()=>vu,slugify:()=>mu,stringifyPrimitive:()=>b,uint8ArrayToBase64:()=>mv,uint8ArrayToBase64url:()=>Mk,uint8ArrayToHex:()=>Uk,unwrapMessage:()=>Xn});function mk(t){return t}function gk(t){return t}function vk(t){}function yk(t){throw new Error("Unexpected value in exhaustive check")}function _k(t){}function Qn(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 Wr(t,e){return typeof e=="bigint"?e.toString():e}function Hr(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 ei(t){let e=t.startsWith("^")?1:0,n=t.endsWith("$")?t.length-1:t.length;return t.slice(e,n)}function pu(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!==fv)return i===void 0&&(i=fv,i=n()),i},set(r){Object.defineProperty(t,e,{value:r})},configurable:!0})}function bk(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function Ut(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 $k(t){return xt(t._zod.def)}function xk(t,e){return e?e.reduce((n,i)=>n?.[i],t):t}function wk(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 Sk(t=10){let e="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<t;i++)n+=e[Math.floor(Math.random()*e.length)];return n}function Po(t){return JSON.stringify(t)}function mu(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function hr(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function jt(t){if(hr(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let n=e.prototype;return!(hr(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function vu(t){return jt(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function Ek(t){let e=0;for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function Ke(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Te(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 kk(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 Tk(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 Ut(this,"shape",s),s},checks:[]});return Te(t,o)}function Ak(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 Ut(this,"shape",s),s},checks:[]});return Te(t,o)}function Ok(t,e){if(!jt(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 Ut(this,"shape",o),o}});return Te(t,r)}function Pk(t,e){if(!jt(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 Ut(this,"shape",i),i}});return Te(t,n)}function Ck(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 Ut(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Te(t,n)}function Rk(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 Ut(this,"shape",c),c},checks:[]});return Te(e,s)}function Nk(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 Ut(this,"shape",o),o}});return Te(e,i)}function Ft(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 xu(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 De(t,e){return e.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(t),n})}function Xn(t){return typeof t=="string"?t:t?.message}function Ae(t,e,n){let i=t.message?t.message:Xn(t.inst?._zod.def?.error?.(t))??Xn(e?.error?.(t))??Xn(n.customError?.(t))??Xn(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 ri(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function ni(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 n=t;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return e}function qr(...t){let[e,n,i]=t;return typeof e=="string"?{message:e,code:"custom",input:n,inst:i}:{...e}}function Dk(t){return Object.entries(t).filter(([e,n])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function pv(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 mv(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return btoa(e)}function Lk(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-e.length%4)%4);return pv(e+n)}function Mk(t){return mv(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function zk(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 Uk(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var fv,Co,gu,Ik,ti,yu,bu,$u,fu,D=g(()=>{dr();fv=Symbol("evaluating");Co="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};gu=Hr(()=>{if(lr.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});Ik=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}`)}},ti=new Set(["string","number","symbol"]),yu=new Set(["string","number","bigint","boolean","symbol","undefined"]);bu={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]},$u={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};fu=class{constructor(...e){}}});function oi(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 si(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 wu(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 vv(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 Su(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 ${vv(i.path)}`);return e.join(`
4
+ `)}var gv,ii,Le,Eu=g(()=>{dr();D();gv=(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,Wr,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},ii=m("$ZodError",gv),Le=m("$ZodError",gv,{Parent:Error})});var Jr,Ro,Kr,No,Yr,Iu,Xr,ku,Do,Fk,Lo,Vk,Mo,Zk,zo,Bk,Uo,Gk,jo,Wk,Fo,Hk,Vo,qk,Tu=g(()=>{dr();Eu();D();Jr=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 st;if(s.issues.length){let a=new(r?.Err??t)(s.issues.map(c=>Ae(c,o,se())));throw Co(a,r?.callee),a}return s.value},Ro=Jr(Le),Kr=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=>Ae(c,o,se())));throw Co(a,r?.callee),a}return s.value},No=Kr(Le),Yr=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 st;return o.issues.length?{success:!1,error:new(t??ii)(o.issues.map(s=>Ae(s,r,se())))}:{success:!0,data:o.value}},Iu=Yr(Le),Xr=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=>Ae(s,r,se())))}:{success:!0,data:o.value}},ku=Xr(Le),Do=t=>(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Jr(t)(e,n,r)},Fk=Do(Le),Lo=t=>(e,n,i)=>Jr(t)(e,n,i),Vk=Lo(Le),Mo=t=>async(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Kr(t)(e,n,r)},Zk=Mo(Le),zo=t=>async(e,n,i)=>Kr(t)(e,n,i),Bk=zo(Le),Uo=t=>(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Yr(t)(e,n,r)},Gk=Uo(Le),jo=t=>(e,n,i)=>Yr(t)(e,n,i),Wk=jo(Le),Fo=t=>async(e,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Xr(t)(e,n,r)},Hk=Fo(Le),Vo=t=>async(e,n,i)=>Xr(t)(e,n,i),qk=Vo(Le)});var Be={};qe(Be,{base64:()=>Bu,base64url:()=>Zo,bigint:()=>Yu,boolean:()=>Qu,browserEmail:()=>r1,cidrv4:()=>Vu,cidrv6:()=>Zu,cuid:()=>Au,cuid2:()=>Ou,date:()=>Hu,datetime:()=>Ju,domain:()=>o1,duration:()=>Du,e164:()=>Wu,email:()=>Mu,emoji:()=>zu,extendedDuration:()=>Jk,guid:()=>Lu,hex:()=>s1,hostname:()=>i1,html5Email:()=>Qk,httpProtocol:()=>Gu,idnEmail:()=>t1,integer:()=>Xu,ipv4:()=>Uu,ipv6:()=>ju,ksuid:()=>Ru,lowercase:()=>rl,mac:()=>Fu,md5_base64:()=>c1,md5_base64url:()=>u1,md5_hex:()=>a1,nanoid:()=>Nu,null:()=>el,number:()=>Bo,rfc5322Email:()=>e1,sha1_base64:()=>d1,sha1_base64url:()=>h1,sha1_hex:()=>l1,sha256_base64:()=>p1,sha256_base64url:()=>m1,sha256_hex:()=>f1,sha384_base64:()=>v1,sha384_base64url:()=>y1,sha384_hex:()=>g1,sha512_base64:()=>b1,sha512_base64url:()=>$1,sha512_hex:()=>_1,string:()=>Ku,time:()=>qu,ulid:()=>Pu,undefined:()=>tl,unicodeEmail:()=>yv,uppercase:()=>nl,uuid:()=>fr,uuid4:()=>Kk,uuid6:()=>Yk,uuid7:()=>Xk,xid:()=>Cu});function zu(){return new RegExp(n1,"u")}function bv(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 qu(t){return new RegExp(`^${bv(t)}$`)}function Ju(t){let e=bv({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(`^${_v}T(?:${i})$`)}function ai(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function ci(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var Au,Ou,Pu,Cu,Ru,Nu,Du,Jk,Lu,fr,Kk,Yk,Xk,Mu,Qk,e1,yv,t1,r1,n1,Uu,ju,Fu,Vu,Zu,Bu,Zo,i1,o1,Gu,Wu,_v,Hu,Ku,Yu,Xu,Bo,Qu,el,tl,rl,nl,s1,a1,c1,u1,l1,d1,h1,f1,p1,m1,g1,v1,y1,_1,b1,$1,Go=g(()=>{D();Au=/^[cC][0-9a-z]{6,}$/,Ou=/^[0-9a-z]+$/,Pu=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Cu=/^[0-9a-vA-V]{20}$/,Ru=/^[A-Za-z0-9]{27}$/,Nu=/^[a-zA-Z0-9_-]{21}$/,Du=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Jk=/^[-+]?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)?)??$/,Lu=/^([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})$/,fr=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)$/,Kk=fr(4),Yk=fr(6),Xk=fr(7),Mu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Qk=/^[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])?)*$/,e1=/^(([^<>()\[\]\\.,;:\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,}))$/,yv=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,t1=yv,r1=/^[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])?)*$/,n1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";Uu=/^(?:(?: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])$/,ju=/^(([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}|:))$/,Fu=t=>{let e=Ke(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},Vu=/^((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])$/,Zu=/^(([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])$/,Bu=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Zo=/^[A-Za-z0-9_-]*$/,i1=/^(?=.{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])?)*\.?$/,o1=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Gu=/^https?$/,Wu=/^\+[1-9]\d{6,14}$/,_v="(?:(?:\\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])))",Hu=new RegExp(`^${_v}$`);Ku=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Yu=/^-?\d+n?$/,Xu=/^-?\d+$/,Bo=/^-?\d+(?:\.\d+)?$/,Qu=/^(?:true|false)$/i,el=/^null$/i,tl=/^undefined$/i,rl=/^[^A-Z]*$/,nl=/^[^a-z]*$/,s1=/^[0-9a-fA-F]*$/;a1=/^[0-9a-fA-F]{32}$/,c1=ai(22,"=="),u1=ci(22),l1=/^[0-9a-fA-F]{40}$/,d1=ai(27,"="),h1=ci(27),f1=/^[0-9a-fA-F]{64}$/,p1=ai(43,"="),m1=ci(43),g1=/^[0-9a-fA-F]{96}$/,v1=ai(64,""),y1=ci(64),_1=/^[0-9a-fA-F]{128}$/,b1=ai(86,"=="),$1=ci(86)});function $v(t,e,n){t.issues.length&&e.issues.push(...De(n,t.issues))}var X,xv,Wo,Ho,il,ol,sl,al,cl,ul,ll,dl,hl,Qr,fl,pl,ml,gl,vl,yl,_l,bl,$l,qo=g(()=>{dr();Go();D();X=m("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),xv={number:"number",bigint:"bigint",object:"date"},Wo=m("$ZodCheckLessThan",(t,e)=>{X.init(t,e);let n=xv[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})}}),Ho=m("$ZodCheckGreaterThan",(t,e)=>{X.init(t,e);let n=xv[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})}}),il=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):pu(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})}}),ol=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]=bu[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=Xu)}),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})}}),sl=m("$ZodCheckBigIntFormat",(t,e)=>{X.init(t,e);let[n,i]=$u[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})}}),al=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:ri(r),code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),cl=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:ri(r),code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),ul=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:ri(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})}}),ll=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=ni(r);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),dl=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=ni(r);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:r,inst:t,continue:!e.abort})}}),hl=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=ni(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})}}),Qr=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=()=>{})}),fl=m("$ZodCheckRegex",(t,e)=>{Qr.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})}}),pl=m("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=rl),Qr.init(t,e)}),ml=m("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=nl),Qr.init(t,e)}),gl=m("$ZodCheckIncludes",(t,e)=>{X.init(t,e);let n=Ke(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${n}`:n);e.pattern=i,t._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),t._zod.check=r=>{r.value.includes(e.includes,e.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:r.value,inst:t,continue:!e.abort})}}),vl=m("$ZodCheckStartsWith",(t,e)=>{X.init(t,e);let n=new RegExp(`^${Ke(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),t._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:t,continue:!e.abort})}}),yl=m("$ZodCheckEndsWith",(t,e)=>{X.init(t,e);let n=new RegExp(`.*${Ke(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.onattach.push(i=>{let r=i._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),t._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:t,continue:!e.abort})}});_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=>$v(r,n,e.property));$v(i,n,e.property)}}),bl=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})}}),$l=m("$ZodCheckOverwrite",(t,e)=>{X.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}})});var ui,xl=g(()=>{ui=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let i=e.split(`
5
5
  `).filter(s=>s),r=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(r)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let e=Function,n=this?.args,r=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...n,r.join(`
6
- `))}}});var _l,bl=g(()=>{_l={major:4,minor:4,patch:3}});function Vl(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function Nv(t){if(!jo.test(t))return!1;let e=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return Vl(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 $v(t,e,n){t.issues.length&&e.issues.push(...Ne(n,t.issues)),e.value[n]=t.value}function Jo(t,e,n,i,r,o){let s=n in i;if(t.issues.length){if(r&&o&&!s)return;e.issues.push(...Ne(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 Lv(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=mu(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}}function Uv(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=>Jo(p,n,h,e,l,d))):Jo(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 xv(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=>!Mt(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=>Ae(s,i,oe())))}),e)}function wv(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=>Ae(s,i,oe())))}):e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:[],inclusive:!1}),e)}function $l(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(Ut(t)&&Ut(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=$l(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=$l(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 Sv(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}),Mt(t))return t;let s=$l(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 Ev(t,e){for(let n=t.length-1;n>=0;n--)if(t[n]._zod[e]!=="optional")return n+1;return 0}function Iv(t,e,n){t.issues.length&&e.issues.push(...Ne(n,t.issues)),e.value[n]=t.value}function kv(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(...Ne(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 Tv(t,e,n,i,r,o,s){t.issues.length&&(Xn.has(typeof i)?n.issues.push(...Ne(i,t.issues)):n.issues.push({code:"invalid_key",origin:"map",input:r,inst:o,issues:t.issues.map(a=>Ae(a,s,oe()))})),e.issues.length&&(Xn.has(typeof i)?n.issues.push(...Ne(i,e.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:o,key:i,issues:e.issues.map(a=>Ae(a,s,oe()))})),n.value.set(t.value,e.value)}function Av(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}function Ov(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}function Pv(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function Cv(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}function Wo(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 Ho(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=>qo(t,o,e.out,n)):qo(t,r,e.out,n)}else{let r=e.reverseTransform(t.value,t);return r instanceof Promise?r.then(o=>qo(t,o,e.in,n)):qo(t,r,e.in,n)}}function qo(t,e,n,i){return t.issues.length?(t.aborted=!0,t):n._zod.run({value:e,issues:t.issues},i)}function Rv(t){return t.value=Object.freeze(t.value),t}function Dv(t,e,n,i){if(!t){let r={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(r.params=i._zod.def.params),e.issues.push(Zr(r))}}var L,dr,q,xl,wl,Sl,El,Il,kl,Tl,Al,Ol,Pl,Cl,Rl,Dl,Nl,zl,Ll,Ul,Ml,jl,Fl,Zl,Bl,Gl,Wl,Hl,Ko,ql,ai,Yo,Jl,Kl,Yl,Xl,Ql,ed,td,rd,nd,id,Mv,od,ci,sd,ad,cd,Xo,ud,ld,dd,hd,fd,pd,md,Qo,gd,vd,yd,_d,bd,$d,xd,wd,es,ui,Sd,Ed,Id,kd,Td,Ad,Od,Pd=g(()=>{Go();cr();yl();Su();Vo();D();bl();D();L=m("$ZodType",(t,e)=>{var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=_l;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=Mt(s),l;for(let d of a){if(d._zod.def.when){if(yu(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 st;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await f,s.issues.length!==h&&(u||(u=Mt(s,h)))});else{if(s.issues.length===h)continue;u||(u=Mt(s,h))}}return l?l.then(()=>s):s},o=(s,a,c)=>{if(Mt(s))return s.aborted=!0,s;let u=r(a,i,c);if(u instanceof Promise){if(c.async===!1)throw new st;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 st;return c.then(u=>r(u,i,a))}return r(c,i,a)}}Z(t,"~standard",()=>({validate:r=>{try{let o=xu(t,r);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return wu(t,r).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),dr=m("$ZodString",(t,e)=>{L.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Wu(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)=>{qr.init(t,e),dr.init(t,e)}),xl=m("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Cu),q.init(t,e)}),wl=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=lr(i))}else e.pattern??(e.pattern=lr());q.init(t,e)}),Sl=m("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Ru),q.init(t,e)}),El=m("$ZodURL",(t,e)=>{q.init(t,e),t._zod.check=n=>{try{let i=n.value.trim();if(!e.normalize&&e.protocol?.source===Fu.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})}}}),Il=m("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Du()),q.init(t,e)}),kl=m("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Ou),q.init(t,e)}),Tl=m("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Eu),q.init(t,e)}),Al=m("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Iu),q.init(t,e)}),Ol=m("$ZodULID",(t,e)=>{e.pattern??(e.pattern=ku),q.init(t,e)}),Pl=m("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Tu),q.init(t,e)}),Cl=m("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Au),q.init(t,e)}),Rl=m("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Gu(e)),q.init(t,e)}),Dl=m("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Zu),q.init(t,e)}),Nl=m("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Bu(e)),q.init(t,e)}),zl=m("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Pu),q.init(t,e)}),Ll=m("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Nu),q.init(t,e),t._zod.bag.format="ipv4"}),Ul=m("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=zu),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})}}}),Ml=m("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=Lu(e.delimiter)),q.init(t,e),t._zod.bag.format="mac"}),jl=m("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Uu),q.init(t,e)}),Fl=m("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Mu),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})}}});Zl=m("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=ju),q.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=n=>{Vl(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}});Bl=m("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=jo),q.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=n=>{Nv(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),Gl=m("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Vu),q.init(t,e)});Wl=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})}}),Hl=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})}}),Ko=m("$ZodNumber",(t,e)=>{L.init(t,e),t._zod.pattern=t._zod.bag.pattern??Fo,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}}),ql=m("$ZodNumberFormat",(t,e)=>{tl.init(t,e),Ko.init(t,e)}),ai=m("$ZodBoolean",(t,e)=>{L.init(t,e),t._zod.pattern=Ju,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}}),Yo=m("$ZodBigInt",(t,e)=>{L.init(t,e),t._zod.pattern=Hu,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}}),Jl=m("$ZodBigIntFormat",(t,e)=>{rl.init(t,e),Yo.init(t,e)}),Kl=m("$ZodSymbol",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:t}),n}}),Yl=m("$ZodUndefined",(t,e)=>{L.init(t,e),t._zod.pattern=Yu,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}}),Xl=m("$ZodNull",(t,e)=>{L.init(t,e),t._zod.pattern=Ku,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}}),Ql=m("$ZodAny",(t,e)=>{L.init(t,e),t._zod.parse=n=>n}),ed=m("$ZodUnknown",(t,e)=>{L.init(t,e),t._zod.parse=n=>n}),td=m("$ZodNever",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)}),rd=m("$ZodVoid",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:t}),n}}),nd=m("$ZodDate",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{if(e.coerce)try{n.value=new Date(n.value)}catch{}let r=n.value,o=r instanceof Date;return o&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...o?{received:"Invalid Date"}:{},inst:t}),n}});id=m("$ZodArray",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:t}),n;n.value=Array(r.length);let o=[];for(let s=0;s<r.length;s++){let a=r[s],c=e.element._zod.run({value:a,issues:[]},i);c instanceof Promise?o.push(c.then(u=>$v(u,n,s))):$v(c,n,s)}return o.length?Promise.all(o).then(()=>n):n}});Mv=m("$ZodObject",(t,e)=>{if(L.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=Vr(()=>Lv(e));Z(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=ur,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",_=f._zod.optout==="optional",b=f._zod.run({value:u[h],issues:[]},c);b instanceof Promise?l.push(b.then(E=>Jo(E,a,h,u,p,_))):Jo(b,a,h,u,p,_)}return o?Uv(l,u,a,c,i.value,t):l.length?Promise.all(l).then(()=>a):a}}),od=m("$ZodObjectJIT",(t,e)=>{Mv.init(t,e);let n=t._zod.parse,i=Vr(()=>Lv(e)),r=h=>{let f=new si(["shape","payload","ctx"]),p=i.value,_=A=>{let I=To(A);return`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`};f.write("const input = payload.value;");let b=Object.create(null),E=0;for(let A of p.keys)b[A]=`key_${E++}`;f.write("const newResult = {};");for(let A of p.keys){let I=b[A],T=To(A),B=h[A],V=B?._zod?.optin==="optional",H=B?._zod?.optout==="optional";f.write(`const ${I} = ${_(A)};`),V&&H?f.write(`
7
- if (${I}.issues.length) {
8
- if (${T} in input) {
9
- payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
6
+ `))}}});var wl,Sl=g(()=>{wl={major:4,minor:4,patch:3}});function Wl(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function zv(t){if(!Zo.test(t))return!1;let e=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return Wl(n)}function Uv(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 Sv(t,e,n){t.issues.length&&e.issues.push(...De(n,t.issues)),e.value[n]=t.value}function Xo(t,e,n,i,r,o){let s=n in i;if(t.issues.length){if(r&&o&&!s)return;e.issues.push(...De(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 jv(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 Fv(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=>Xo(p,n,h,e,l,d))):Xo(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 Ev(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=>!Ft(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=>Ae(s,i,se())))}),e)}function Iv(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=>Ae(s,i,se())))}):e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:[],inclusive:!1}),e)}function El(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(jt(t)&&jt(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=El(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=El(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 kv(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}),Ft(t))return t;let s=El(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 Tv(t,e){for(let n=t.length-1;n>=0;n--)if(t[n]._zod[e]!=="optional")return n+1;return 0}function Av(t,e,n){t.issues.length&&e.issues.push(...De(n,t.issues)),e.value[n]=t.value}function Ov(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(...De(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 Pv(t,e,n,i,r,o,s){t.issues.length&&(ti.has(typeof i)?n.issues.push(...De(i,t.issues)):n.issues.push({code:"invalid_key",origin:"map",input:r,inst:o,issues:t.issues.map(a=>Ae(a,s,se()))})),e.issues.length&&(ti.has(typeof i)?n.issues.push(...De(i,e.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:o,key:i,issues:e.issues.map(a=>Ae(a,s,se()))})),n.value.set(t.value,e.value)}function Cv(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}function Rv(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}function Nv(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function Dv(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 Jo(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 Ko(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=>Yo(t,o,e.out,n)):Yo(t,r,e.out,n)}else{let r=e.reverseTransform(t.value,t);return r instanceof Promise?r.then(o=>Yo(t,o,e.in,n)):Yo(t,r,e.in,n)}}function Yo(t,e,n,i){return t.issues.length?(t.aborted=!0,t):n._zod.run({value:e,issues:t.issues},i)}function Lv(t){return t.value=Object.freeze(t.value),t}function Mv(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(qr(r))}}var M,pr,q,Il,kl,Tl,Al,Ol,Pl,Cl,Rl,Nl,Dl,Ll,Ml,zl,Ul,jl,Fl,Vl,Zl,Bl,Gl,Hl,ql,Jl,Kl,Yl,Qo,Xl,li,es,Ql,ed,td,rd,nd,id,od,sd,ad,cd,Vv,ud,di,ld,dd,hd,ts,fd,pd,md,gd,vd,yd,_d,rs,bd,$d,xd,wd,Sd,Ed,Id,kd,ns,hi,Td,Ad,Od,Pd,Cd,Rd,Nd,Dd=g(()=>{qo();dr();xl();Tu();Go();D();Sl();D();M=m("$ZodType",(t,e)=>{var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=wl;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=Ft(s),l;for(let d of a){if(d._zod.def.when){if(xu(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 st;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await f,s.issues.length!==h&&(u||(u=Ft(s,h)))});else{if(s.issues.length===h)continue;u||(u=Ft(s,h))}}return l?l.then(()=>s):s},o=(s,a,c)=>{if(Ft(s))return s.aborted=!0,s;let u=r(a,i,c);if(u instanceof Promise){if(c.async===!1)throw new st;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 st;return c.then(u=>r(u,i,a))}return r(c,i,a)}}B(t,"~standard",()=>({validate:r=>{try{let o=Iu(t,r);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return ku(t,r).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),pr=m("$ZodString",(t,e)=>{M.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Ku(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)=>{Qr.init(t,e),pr.init(t,e)}),Il=m("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Lu),q.init(t,e)}),kl=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=fr(i))}else e.pattern??(e.pattern=fr());q.init(t,e)}),Tl=m("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Mu),q.init(t,e)}),Al=m("$ZodURL",(t,e)=>{q.init(t,e),t._zod.check=n=>{try{let i=n.value.trim();if(!e.normalize&&e.protocol?.source===Gu.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})}}}),Ol=m("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=zu()),q.init(t,e)}),Pl=m("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Nu),q.init(t,e)}),Cl=m("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Au),q.init(t,e)}),Rl=m("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Ou),q.init(t,e)}),Nl=m("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Pu),q.init(t,e)}),Dl=m("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Cu),q.init(t,e)}),Ll=m("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Ru),q.init(t,e)}),Ml=m("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Ju(e)),q.init(t,e)}),zl=m("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Hu),q.init(t,e)}),Ul=m("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=qu(e)),q.init(t,e)}),jl=m("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Du),q.init(t,e)}),Fl=m("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Uu),q.init(t,e),t._zod.bag.format="ipv4"}),Vl=m("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=ju),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})}}}),Zl=m("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=Fu(e.delimiter)),q.init(t,e),t._zod.bag.format="mac"}),Bl=m("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Vu),q.init(t,e)}),Gl=m("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Zu),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})}}});Hl=m("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Bu),q.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=n=>{Wl(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}});ql=m("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Zo),q.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=n=>{zv(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),Jl=m("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Wu),q.init(t,e)});Kl=m("$ZodJWT",(t,e)=>{q.init(t,e),t._zod.check=n=>{Uv(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),Yl=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})}}),Qo=m("$ZodNumber",(t,e)=>{M.init(t,e),t._zod.pattern=t._zod.bag.pattern??Bo,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}}),Xl=m("$ZodNumberFormat",(t,e)=>{ol.init(t,e),Qo.init(t,e)}),li=m("$ZodBoolean",(t,e)=>{M.init(t,e),t._zod.pattern=Qu,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}}),es=m("$ZodBigInt",(t,e)=>{M.init(t,e),t._zod.pattern=Yu,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}}),Ql=m("$ZodBigIntFormat",(t,e)=>{sl.init(t,e),es.init(t,e)}),ed=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}}),td=m("$ZodUndefined",(t,e)=>{M.init(t,e),t._zod.pattern=tl,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}}),rd=m("$ZodNull",(t,e)=>{M.init(t,e),t._zod.pattern=el,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}}),nd=m("$ZodAny",(t,e)=>{M.init(t,e),t._zod.parse=n=>n}),id=m("$ZodUnknown",(t,e)=>{M.init(t,e),t._zod.parse=n=>n}),od=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)}),sd=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}}),ad=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}});cd=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=>Sv(u,n,s))):Sv(c,n,s)}return o.length?Promise.all(o).then(()=>n):n}});Vv=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=Hr(()=>jv(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=hr,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",_=f._zod.optout==="optional",$=f._zod.run({value:u[h],issues:[]},c);$ instanceof Promise?l.push($.then(I=>Xo(I,a,h,u,p,_))):Xo($,a,h,u,p,_)}return o?Fv(l,u,a,c,i.value,t):l.length?Promise.all(l).then(()=>a):a}}),ud=m("$ZodObjectJIT",(t,e)=>{Vv.init(t,e);let n=t._zod.parse,i=Hr(()=>jv(e)),r=h=>{let f=new ui(["shape","payload","ctx"]),p=i.value,_=O=>{let w=Po(O);return`shape[${w}]._zod.run({ value: input[${w}], 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 w=$[O],k=Po(O),z=h[O],U=z?._zod?.optin==="optional",H=z?._zod?.optout==="optional";f.write(`const ${w} = ${_(O)};`),U&&H?f.write(`
7
+ if (${w}.issues.length) {
8
+ if (${k} in input) {
9
+ payload.issues = payload.issues.concat(${w}.issues.map(iss => ({
10
10
  ...iss,
11
- path: iss.path ? [${T}, ...iss.path] : [${T}]
11
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
12
12
  })));
13
13
  }
14
14
  }
15
15
 
16
- if (${I}.value === undefined) {
17
- if (${T} in input) {
18
- newResult[${T}] = undefined;
16
+ if (${w}.value === undefined) {
17
+ if (${k} in input) {
18
+ newResult[${k}] = undefined;
19
19
  }
20
20
  } else {
21
- newResult[${T}] = ${I}.value;
21
+ newResult[${k}] = ${w}.value;
22
22
  }
23
23
 
24
- `):V?f.write(`
25
- if (${I}.issues.length) {
26
- payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
24
+ `):U?f.write(`
25
+ if (${w}.issues.length) {
26
+ payload.issues = payload.issues.concat(${w}.issues.map(iss => ({
27
27
  ...iss,
28
- path: iss.path ? [${T}, ...iss.path] : [${T}]
28
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
29
29
  })));
30
30
  }
31
31
 
32
- if (${I}.value === undefined) {
33
- if (${T} in input) {
34
- newResult[${T}] = undefined;
32
+ if (${w}.value === undefined) {
33
+ if (${k} in input) {
34
+ newResult[${k}] = undefined;
35
35
  }
36
36
  } else {
37
- newResult[${T}] = ${I}.value;
37
+ newResult[${k}] = ${w}.value;
38
38
  }
39
39
 
40
40
  `):f.write(`
41
- const ${I}_present = ${T} in input;
42
- if (${I}.issues.length) {
43
- payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
41
+ const ${w}_present = ${k} in input;
42
+ if (${w}.issues.length) {
43
+ payload.issues = payload.issues.concat(${w}.issues.map(iss => ({
44
44
  ...iss,
45
- path: iss.path ? [${T}, ...iss.path] : [${T}]
45
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
46
46
  })));
47
47
  }
48
- if (!${I}_present && !${I}.issues.length) {
48
+ if (!${w}_present && !${w}.issues.length) {
49
49
  payload.issues.push({
50
50
  code: "invalid_type",
51
51
  expected: "nonoptional",
52
52
  input: undefined,
53
- path: [${T}]
53
+ path: [${k}]
54
54
  });
55
55
  }
56
56
 
57
- if (${I}_present) {
58
- if (${I}.value === undefined) {
59
- newResult[${T}] = undefined;
57
+ if (${w}_present) {
58
+ if (${w}.value === undefined) {
59
+ newResult[${k}] = undefined;
60
60
  } else {
61
- newResult[${T}] = ${I}.value;
61
+ newResult[${k}] = ${w}.value;
62
62
  }
63
63
  }
64
64
 
65
- `)}f.write("payload.value = newResult;"),f.write("return payload;");let C=f.compile();return(A,I)=>C(h,A,I)},o,s=ur,a=!ar.jitless,u=a&&hu.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?Uv([],p,h,f,d,t):h):n(h,f):(h.issues.push({expected:"object",code:"invalid_type",input:p,inst:t}),h)}});ci=m("$ZodUnion",(t,e)=>{L.init(t,e),Z(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Z(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Z(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),Z(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=>Yn(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=>xv(a,i,t,r)):xv(s,i,t,r)}});sd=m("$ZodXor",(t,e)=>{ci.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=>wv(a,i,t,r)):wv(s,i,t,r)}}),ad=m("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,ci.init(t,e);let n=t._zod.parse;Z(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=Vr(()=>{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(!ur(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)}}),cd=m("$ZodIntersection",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{let r=n.value,o=e.left._zod.run({value:r,issues:[]},i),s=e.right._zod.run({value:r,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([c,u])=>Sv(n,c,u)):Sv(n,o,s)}});Xo=m("$ZodTuple",(t,e)=>{L.init(t,e);let n=e.items;t._zod.parse=(i,r)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:t,expected:"tuple",code:"invalid_type"}),i;i.value=[];let s=[],a=Ev(n,"optin"),c=Ev(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=>Iv(p,i,l))):Iv(f,i,l)}}return s.length?Promise.all(s).then(()=>kv(u,i,n,o,c)):kv(u,i,n,o,c)}});ud=m("$ZodRecord",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!Ut(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=>Ae(f,i,oe())),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(...Ne(u,f.issues)),n.value[d]=f.value})):(h.issues.length&&n.issues.push(...Ne(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"&&Fo.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=>Ae(d,i,oe())),input:a,path:[a],inst:t});continue}let l=e.valueType._zod.run({value:r[a],issues:[]},i);l instanceof Promise?o.push(l.then(d=>{d.issues.length&&n.issues.push(...Ne(a,d.issues)),n.value[c.value]=d.value})):(l.issues.length&&n.issues.push(...Ne(a,l.issues)),n.value[c.value]=l.value)}}return o.length?Promise.all(o).then(()=>n):n}}),ld=m("$ZodMap",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!(r instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:r,inst:t}),n;let o=[];n.value=new Map;for(let[s,a]of r){let 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])=>{Tv(l,d,n,s,r,t,i)})):Tv(c,u,n,s,r,t,i)}return o.length?Promise.all(o).then(()=>n):n}});dd=m("$ZodSet",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:t,expected:"set",code:"invalid_type"}),n;let o=[];n.value=new Set;for(let s of r){let a=e.valueType._zod.run({value:s,issues:[]},i);a instanceof Promise?o.push(a.then(c=>Av(c,n))):Av(a,n)}return o.length?Promise.all(o).then(()=>n):n}});hd=m("$ZodEnum",(t,e)=>{L.init(t,e);let n=Kn(e.entries),i=new Set(n);t._zod.values=i,t._zod.pattern=new RegExp(`^(${n.filter(r=>Xn.has(typeof r)).map(r=>typeof r=="string"?Ke(r):r.toString()).join("|")})$`),t._zod.parse=(r,o)=>{let s=r.value;return i.has(s)||r.issues.push({code:"invalid_value",values:n,input:s,inst:t}),r}}),fd=m("$ZodLiteral",(t,e)=>{if(L.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let n=new Set(e.values);t._zod.values=n,t._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?Ke(i):i?Ke(i.toString()):String(i)).join("|")})$`),t._zod.parse=(i,r)=>{let o=i.value;return n.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),i}}),pd=m("$ZodFile",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:t}),n}}),md=m("$ZodTransform",(t,e)=>{L.init(t,e),t._zod.optin="optional",t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new Nt(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 st;return n.value=r,n.fallback=!0,n}});Qo=m("$ZodOptional",(t,e)=>{L.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Z(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Z(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${Yn(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=>Ov(s,r)):Ov(o,r)}return n.value===void 0?n:e.innerType._zod.run(n,i)}}),gd=m("$ZodExactOptional",(t,e)=>{Qo.init(t,e),Z(t._zod,"values",()=>e.innerType._zod.values),Z(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(n,i)=>e.innerType._zod.run(n,i)}),vd=m("$ZodNullable",(t,e)=>{L.init(t,e),Z(t._zod,"optin",()=>e.innerType._zod.optin),Z(t._zod,"optout",()=>e.innerType._zod.optout),Z(t._zod,"pattern",()=>{let n=e.innerType._zod.pattern;return n?new RegExp(`^(${Yn(n.source)}|null)$`):void 0}),Z(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)}),yd=m("$ZodDefault",(t,e)=>{L.init(t,e),t._zod.optin="optional",Z(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=>Pv(o,e)):Pv(r,e)}});_d=m("$ZodPrefault",(t,e)=>{L.init(t,e),t._zod.optin="optional",Z(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))}),bd=m("$ZodNonOptional",(t,e)=>{L.init(t,e),Z(t._zod,"values",()=>{let n=e.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),t._zod.parse=(n,i)=>{let r=e.innerType._zod.run(n,i);return r instanceof Promise?r.then(o=>Cv(o,t)):Cv(r,t)}});$d=m("$ZodSuccess",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new Nt("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)}}),xd=m("$ZodCatch",(t,e)=>{L.init(t,e),t._zod.optin="optional",Z(t._zod,"optout",()=>e.innerType._zod.optout),Z(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=>Ae(s,i,oe()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=r.value,r.issues.length&&(n.value=e.catchValue({...n,error:{issues:r.issues.map(o=>Ae(o,i,oe()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),wd=m("$ZodNaN",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:t,expected:"nan",code:"invalid_type"}),n)}),es=m("$ZodPipe",(t,e)=>{L.init(t,e),Z(t._zod,"values",()=>e.in._zod.values),Z(t._zod,"optin",()=>e.in._zod.optin),Z(t._zod,"optout",()=>e.out._zod.optout),Z(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=>Wo(s,e.in,i)):Wo(o,e.in,i)}let r=e.in._zod.run(n,i);return r instanceof Promise?r.then(o=>Wo(o,e.out,i)):Wo(r,e.out,i)}});ui=m("$ZodCodec",(t,e)=>{L.init(t,e),Z(t._zod,"values",()=>e.in._zod.values),Z(t._zod,"optin",()=>e.in._zod.optin),Z(t._zod,"optout",()=>e.out._zod.optout),Z(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=>Ho(s,e,i)):Ho(o,e,i)}else{let o=e.out._zod.run(n,i);return o instanceof Promise?o.then(s=>Ho(s,e,i)):Ho(o,e,i)}}});Sd=m("$ZodPreprocess",(t,e)=>{es.init(t,e)}),Ed=m("$ZodReadonly",(t,e)=>{L.init(t,e),Z(t._zod,"propValues",()=>e.innerType._zod.propValues),Z(t._zod,"values",()=>e.innerType._zod.values),Z(t._zod,"optin",()=>e.innerType?._zod?.optin),Z(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(Rv):Rv(r)}});Id=m("$ZodTemplateLiteral",(t,e)=>{L.init(t,e);let n=[];for(let i of e.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let r=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!r)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=r.startsWith("^")?1:0,s=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(o,s))}else if(i===null||pu.has(typeof i))n.push(Ke(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);t._zod.pattern=new RegExp(`^${n.join("")}$`),t._zod.parse=(i,r)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:t,expected:"string",code:"invalid_type"}),i):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),i)}),kd=m("$ZodFunction",(t,e)=>(L.init(t,e),t._def=e,t._zod.def=e,t.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return function(...i){let r=t._def.input?Oo(t._def.input,i):i,o=Reflect.apply(n,this,r);return t._def.output?Oo(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 Po(t._def.input,i):i,o=await Reflect.apply(n,this,r);return t._def.output?await Po(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 Xo({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)),Td=m("$ZodPromise",(t,e)=>{L.init(t,e),t._zod.parse=(n,i)=>Promise.resolve(n.value).then(r=>e.innerType._zod.run({value:r,issues:[]},i))}),Ad=m("$ZodLazy",(t,e)=>{L.init(t,e),Z(t._zod,"innerType",()=>{let n=e;return n._cachedInner||(n._cachedInner=e.getter()),n._cachedInner}),Z(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),Z(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),Z(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),Z(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(n,i)=>t._zod.innerType._zod.run(n,i)}),Od=m("$ZodCustom",(t,e)=>{X.init(t,e),L.init(t,e),t._zod.parse=(n,i)=>n,t._zod.check=n=>{let i=n.value,r=e.fn(i);if(r instanceof Promise)return r.then(o=>Dv(o,n,i,t));Dv(r,n,i,t)}})});function jv(){return{localeError:p1()}}var p1,Fv=g(()=>{D();p1=()=>{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=x(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 ${$(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 Vv(){return{localeError:m1()}}var m1,Zv=g(()=>{D();m1=()=>{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=x(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 ${$(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 Bv(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 Gv(){return{localeError:g1()}}var g1,Wv=g(()=>{D();g1=()=>{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=x(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 ${$(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=Bv(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=Bv(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 Hv(){return{localeError:v1()}}var v1,qv=g(()=>{D();v1=()=>{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=x(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 ${$(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 Jv(){return{localeError:y1()}}var y1,Kv=g(()=>{D();y1=()=>{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=x(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 ${$(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 Yv(){return{localeError:_1()}}var _1,Xv=g(()=>{D();_1=()=>{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=x(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 ${$(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 Qv(){return{localeError:b1()}}var b1,ey=g(()=>{D();b1=()=>{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=x(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 ${$(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 ty(){return{localeError:$1()}}var $1,ry=g(()=>{D();$1=()=>{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=x(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 ${$(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 ny(){return{localeError:x1()}}var x1,iy=g(()=>{D();x1=()=>{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=x(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 ${$(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 ts(){return{localeError:w1()}}var w1,Cd=g(()=>{D();w1=()=>{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=x(r.input),a=i[s]??s;return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${$(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 oy(){return{localeError:S1()}}var S1,sy=g(()=>{D();S1=()=>{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=x(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 ${$(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 ay(){return{localeError:E1()}}var E1,cy=g(()=>{D();E1=()=>{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=x(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 ${$(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 uy(){return{localeError:I1()}}var I1,ly=g(()=>{D();I1=()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(r){return t[r]??null}let n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(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 ${$(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 dy(){return{localeError:k1()}}var k1,hy=g(()=>{D();k1=()=>{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=x(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 ${$(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 fy(){return{localeError:T1()}}var T1,py=g(()=>{D();T1=()=>{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=x(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 : ${$(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 my(){return{localeError:A1()}}var A1,gy=g(()=>{D();A1=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(r){return t[r]??null}let n={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(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 ${$(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 vy(){return{localeError:O1()}}var O1,yy=g(()=>{D();O1=()=>{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=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 ${$(u.values[0])}`;let l=u.values.map(f=>$(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",_=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 ${_}`.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 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 _=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 ${_}`.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 _y(){return{localeError:P1()}}var P1,by=g(()=>{D();P1=()=>{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=x(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 ${$(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 $y(){return{localeError:C1()}}var C1,xy=g(()=>{D();C1=()=>{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=x(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 ${$(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 wy(t,e,n){return Math.abs(t)===1?e:n}function Jr(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 Sy(){return{localeError:R1()}}var R1,Ey=g(()=>{D();R1=()=>{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=x(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 ${$(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=wy(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 ${Jr(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 ${Jr(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=wy(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 ${Jr(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 ${Jr(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 ${Jr(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 ${Jr(r.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}}});function Iy(){return{localeError:D1()}}var D1,ky=g(()=>{D();D1=()=>{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=x(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 ${$(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 Ty(){return{localeError:N1()}}var N1,Ay=g(()=>{D();N1=()=>{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=x(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 ${$(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 Oy(){return{localeError:z1()}}var z1,Py=g(()=>{D();z1=()=>{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=x(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 ${$(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 Cy(){return{localeError:L1()}}var L1,Ry=g(()=>{D();L1=()=>{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=x(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: ${$(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 Dy(){return{localeError:U1()}}var U1,Ny=g(()=>{D();U1=()=>{let t={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(r){return t[r]??null}let n={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(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 ${$(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 rs(){return{localeError:M1()}}var M1,Rd=g(()=>{D();M1=()=>{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=x(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 ${$(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 rs()}var Ly=g(()=>{Rd()});function Uy(){return{localeError:j1()}}var j1,My=g(()=>{D();j1=()=>{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=x(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 ${$(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 jy(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 Fy(){return{localeError:F1()}}var li,F1,Vy=g(()=>{D();li=t=>t.charAt(0).toUpperCase()+t.slice(1);F1=()=>{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=x(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 ${$(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,jy(Number(r.maximum)),r.inclusive??!1,"smaller");if(s?.verb)return`${li(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`${li(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,jy(Number(r.minimum)),r.inclusive??!1,"bigger");if(s?.verb)return`${li(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`${li(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`${li(o??r.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}}});function Zy(){return{localeError:V1()}}var V1,By=g(()=>{D();V1=()=>{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=x(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 ${$(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 Gy(){return{localeError:Z1()}}var Z1,Wy=g(()=>{D();Z1=()=>{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=x(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 ${$(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 Hy(){return{localeError:B1()}}var B1,qy=g(()=>{D();B1=()=>{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=x(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 ${$(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 Jy(){return{localeError:G1()}}var G1,Ky=g(()=>{D();G1=()=>{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=x(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 ${$(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 Yy(){return{localeError:W1()}}var W1,Xy=g(()=>{D();W1=()=>{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=x(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 ${$(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 Qy(){return{localeError:H1()}}var H1,e_=g(()=>{D();H1=()=>{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=x(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 ${$(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 t_(){return{localeError:q1()}}var q1,r_=g(()=>{D();q1=()=>{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=x(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 ${$(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 n_(){return{localeError:J1()}}var J1,i_=g(()=>{D();J1=()=>{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=x(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 ${$(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 o_(){return{localeError:K1()}}var K1,s_=g(()=>{D();K1=()=>{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=x(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 ${$(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 a_(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 c_(){return{localeError:Y1()}}var Y1,u_=g(()=>{D();Y1=()=>{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=x(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 ${$(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=a_(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=a_(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 l_(){return{localeError:X1()}}var X1,d_=g(()=>{D();X1=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(r){return t[r]??null}let n={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(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 ${$(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 h_(){return{localeError:Q1()}}var Q1,f_=g(()=>{D();Q1=()=>{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=x(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 ${$(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 p_(){return{localeError:eT()}}var eT,m_=g(()=>{D();eT=()=>{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=x(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 ${$(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 g_(){return{localeError:tT()}}var tT,v_=g(()=>{D();tT=()=>{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=x(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 ${$(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 y_(){return{localeError:rT()}}var rT,__=g(()=>{D();rT=()=>{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=x(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 ${$(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 ns(){return{localeError:nT()}}var nT,Dd=g(()=>{D();nT=()=>{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=x(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 ${$(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 b_(){return ns()}var $_=g(()=>{Dd()});function x_(){return{localeError:iT()}}var iT,w_=g(()=>{D();iT=()=>{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=x(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: ${$(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 S_(){return{localeError:oT()}}var oT,E_=g(()=>{D();oT=()=>{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=x(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 ${$(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 I_(){return{localeError:sT()}}var sT,k_=g(()=>{D();sT=()=>{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=x(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 ${$(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 T_(){return{localeError:aT()}}var aT,A_=g(()=>{D();aT=()=>{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=x(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 ${$(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 O_(){return{localeError:cT()}}var cT,P_=g(()=>{D();cT=()=>{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=x(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 ${$(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 C_(){return{localeError:uT()}}var uT,R_=g(()=>{D();uT=()=>{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=x(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 ${$(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 di={};qe(di,{ar:()=>jv,az:()=>Vv,be:()=>Gv,bg:()=>Hv,ca:()=>Jv,cs:()=>Yv,da:()=>Qv,de:()=>ty,el:()=>ny,en:()=>ts,eo:()=>oy,es:()=>ay,fa:()=>uy,fi:()=>dy,fr:()=>fy,frCA:()=>my,he:()=>vy,hr:()=>_y,hu:()=>$y,hy:()=>Sy,id:()=>Iy,is:()=>Ty,it:()=>Oy,ja:()=>Cy,ka:()=>Dy,kh:()=>zy,km:()=>rs,ko:()=>Uy,lt:()=>Fy,mk:()=>Zy,ms:()=>Gy,nl:()=>Hy,no:()=>Jy,ota:()=>Yy,pl:()=>t_,ps:()=>Qy,pt:()=>n_,ro:()=>o_,ru:()=>c_,sl:()=>l_,sv:()=>h_,ta:()=>p_,th:()=>g_,tr:()=>y_,ua:()=>b_,uk:()=>ns,ur:()=>x_,uz:()=>S_,vi:()=>I_,yo:()=>C_,zhCN:()=>T_,zhTW:()=>O_});var Nd=g(()=>{Fv();Zv();Wv();qv();Kv();Xv();ey();ry();iy();Cd();sy();cy();ly();hy();py();gy();yy();by();xy();Ey();ky();Ay();Py();Ry();Ny();Ly();Rd();My();Vy();By();Wy();qy();Ky();Xy();e_();r_();i_();s_();u_();d_();f_();m_();v_();__();$_();Dd();w_();E_();k_();A_();P_();R_()});function os(){return new is}var D_,zd,Ld,is,ye,hi=g(()=>{zd=Symbol("ZodOutput"),Ld=Symbol("ZodInput"),is=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...n){let i=n[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){let n=e._zod.parent;if(n){let i={...this.get(n)??{}};delete i.id;let r={...i,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};(D_=globalThis).__zod_globalRegistry??(D_.__zod_globalRegistry=os());ye=globalThis.__zod_globalRegistry});function Ud(t,e){return new t({type:"string",...S(e)})}function Md(t,e){return new t({type:"string",coerce:!0,...S(e)})}function ss(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...S(e)})}function fi(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...S(e)})}function as(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...S(e)})}function cs(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...S(e)})}function us(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...S(e)})}function ls(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...S(e)})}function pi(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...S(e)})}function ds(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...S(e)})}function hs(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...S(e)})}function fs(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...S(e)})}function ps(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...S(e)})}function ms(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...S(e)})}function gs(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...S(e)})}function vs(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...S(e)})}function ys(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...S(e)})}function _s(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...S(e)})}function jd(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...S(e)})}function bs(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...S(e)})}function $s(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...S(e)})}function xs(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...S(e)})}function ws(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...S(e)})}function Ss(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...S(e)})}function Es(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...S(e)})}function Vd(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...S(e)})}function Zd(t,e){return new t({type:"string",format:"date",check:"string_format",...S(e)})}function Bd(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...S(e)})}function Gd(t,e){return new t({type:"string",format:"duration",check:"string_format",...S(e)})}function Wd(t,e){return new t({type:"number",checks:[],...S(e)})}function Hd(t,e){return new t({type:"number",coerce:!0,checks:[],...S(e)})}function qd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...S(e)})}function Jd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...S(e)})}function Kd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...S(e)})}function Yd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...S(e)})}function Xd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...S(e)})}function Qd(t,e){return new t({type:"boolean",...S(e)})}function eh(t,e){return new t({type:"boolean",coerce:!0,...S(e)})}function th(t,e){return new t({type:"bigint",...S(e)})}function rh(t,e){return new t({type:"bigint",coerce:!0,...S(e)})}function nh(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...S(e)})}function ih(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...S(e)})}function oh(t,e){return new t({type:"symbol",...S(e)})}function sh(t,e){return new t({type:"undefined",...S(e)})}function ah(t,e){return new t({type:"null",...S(e)})}function ch(t){return new t({type:"any"})}function uh(t){return new t({type:"unknown"})}function lh(t,e){return new t({type:"never",...S(e)})}function dh(t,e){return new t({type:"void",...S(e)})}function hh(t,e){return new t({type:"date",...S(e)})}function fh(t,e){return new t({type:"date",coerce:!0,...S(e)})}function ph(t,e){return new t({type:"nan",...S(e)})}function dt(t,e){return new Zo({check:"less_than",...S(e),value:t,inclusive:!1})}function Ze(t,e){return new Zo({check:"less_than",...S(e),value:t,inclusive:!0})}function ht(t,e){return new Bo({check:"greater_than",...S(e),value:t,inclusive:!1})}function Oe(t,e){return new Bo({check:"greater_than",...S(e),value:t,inclusive:!0})}function Is(t){return ht(0,t)}function ks(t){return dt(0,t)}function Ts(t){return Ze(0,t)}function As(t){return Oe(0,t)}function jt(t,e){return new el({check:"multiple_of",...S(e),value:t})}function Ft(t,e){return new nl({check:"max_size",...S(e),maximum:t})}function ft(t,e){return new il({check:"min_size",...S(e),minimum:t})}function hr(t,e){return new ol({check:"size_equals",...S(e),size:t})}function fr(t,e){return new sl({check:"max_length",...S(e),maximum:t})}function xt(t,e){return new al({check:"min_length",...S(e),minimum:t})}function pr(t,e){return new cl({check:"length_equals",...S(e),length:t})}function Kr(t,e){return new ul({check:"string_format",format:"regex",...S(e),pattern:t})}function Yr(t){return new ll({check:"string_format",format:"lowercase",...S(t)})}function Xr(t){return new dl({check:"string_format",format:"uppercase",...S(t)})}function Qr(t,e){return new hl({check:"string_format",format:"includes",...S(e),includes:t})}function en(t,e){return new fl({check:"string_format",format:"starts_with",...S(e),prefix:t})}function tn(t,e){return new pl({check:"string_format",format:"ends_with",...S(e),suffix:t})}function Os(t,e,n){return new ml({check:"property",property:t,schema:e,...S(n)})}function rn(t,e){return new gl({check:"mime_type",mime:t,...S(e)})}function at(t){return new vl({check:"overwrite",tx:t})}function nn(t){return at(e=>e.normalize(t))}function on(){return at(t=>t.trim())}function sn(){return at(t=>t.toLowerCase())}function an(){return at(t=>t.toUpperCase())}function cn(){return at(t=>du(t))}function mh(t,e,n){return new t({type:"array",element:e,...S(n)})}function dT(t,e,n){return new t({type:"union",options:e,...S(n)})}function hT(t,e,n){return new t({type:"union",options:e,inclusive:!1,...S(n)})}function fT(t,e,n,i){return new t({type:"union",options:n,discriminator:e,...S(i)})}function pT(t,e,n){return new t({type:"intersection",left:e,right:n})}function mT(t,e,n,i){let r=n instanceof L,o=r?i:n,s=r?n:null;return new t({type:"tuple",items:e,rest:s,...S(o)})}function gT(t,e,n,i){return new t({type:"record",keyType:e,valueType:n,...S(i)})}function vT(t,e,n,i){return new t({type:"map",keyType:e,valueType:n,...S(i)})}function yT(t,e,n){return new t({type:"set",valueType:e,...S(n)})}function _T(t,e,n){let i=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new t({type:"enum",entries:i,...S(n)})}function bT(t,e,n){return new t({type:"enum",entries:e,...S(n)})}function $T(t,e,n){return new t({type:"literal",values:Array.isArray(e)?e:[e],...S(n)})}function gh(t,e){return new t({type:"file",...S(e)})}function xT(t,e){return new t({type:"transform",transform:e})}function wT(t,e){return new t({type:"optional",innerType:e})}function ST(t,e){return new t({type:"nullable",innerType:e})}function ET(t,e,n){return new t({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():fu(n)}})}function IT(t,e,n){return new t({type:"nonoptional",innerType:e,...S(n)})}function kT(t,e){return new t({type:"success",innerType:e})}function TT(t,e,n){return new t({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}function AT(t,e,n){return new t({type:"pipe",in:e,out:n})}function OT(t,e){return new t({type:"readonly",innerType:e})}function PT(t,e,n){return new t({type:"template_literal",parts:e,...S(n)})}function CT(t,e){return new t({type:"lazy",getter:e})}function RT(t,e){return new t({type:"promise",innerType:e})}function vh(t,e,n){let i=S(n);return i.abort??(i.abort=!0),new t({type:"custom",check:"custom",fn:e,...i})}function yh(t,e,n){return new t({type:"custom",check:"custom",fn:e,...S(n)})}function _h(t,e){let n=N_(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(Zr(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(Zr(o))}},t(i.value,i)),e);return n}function N_(t,e){let n=new X({check:"custom",...S(e)});return n._zod.check=t,n}function bh(t){let e=new X({check:"describe"});return e._zod.onattach=[n=>{let i=ye.get(n)??{};ye.add(n,{...i,description:t})}],e._zod.check=()=>{},e}function $h(t){let e=new X({check:"meta"});return e._zod.onattach=[n=>{let i=ye.get(n)??{};ye.add(n,{...i,...t})}],e._zod.check=()=>{},e}function xh(t,e){let n=S(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??ui,c=t.Boolean??ai,u=t.String??dr,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 _=f;return n.case!=="sensitive"&&(_=_.toLowerCase()),o.has(_)?!0:s.has(_)?!1:(p.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:p.value,inst:h,continue:!1}),{})}),reverseTransform:((f,p)=>f===!0?i[0]||"true":r[0]||"false"),error:n.error});return h}function un(t,e,n,i={}){let r=S(i),o={...S(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 Fd,z_=g(()=>{Go();hi();Pd();D();Fd={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function Vt(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??ye,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"&&Pe(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 Zt(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 A=f.compile();return(O,w)=>A(h,O,w)},o,s=hr,a=!lr.jitless,u=a&&gu.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?Fv([],p,h,f,d,t):h):n(h,f):(h.issues.push({expected:"object",code:"invalid_type",input:p,inst:t}),h)}});di=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=>ei(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=>Ev(a,i,t,r)):Ev(s,i,t,r)}});ld=m("$ZodXor",(t,e)=>{di.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=>Iv(a,i,t,r)):Iv(s,i,t,r)}}),dd=m("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,di.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=Hr(()=>{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(!hr(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)}}),hd=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])=>kv(n,c,u)):kv(n,o,s)}});ts=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=Tv(n,"optin"),c=Tv(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=>Av(p,i,l))):Av(f,i,l)}}return s.length?Promise.all(s).then(()=>Ov(u,i,n,o,c)):Ov(u,i,n,o,c)}});fd=m("$ZodRecord",(t,e)=>{M.init(t,e),t._zod.parse=(n,i)=>{let r=n.value;if(!jt(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=>Ae(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(...De(u,f.issues)),n.value[d]=f.value})):(h.issues.length&&n.issues.push(...De(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"&&Bo.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=>Ae(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(...De(a,d.issues)),n.value[c.value]=d.value})):(l.issues.length&&n.issues.push(...De(a,l.issues)),n.value[c.value]=l.value)}}return o.length?Promise.all(o).then(()=>n):n}}),pd=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])=>{Pv(l,d,n,s,r,t,i)})):Pv(c,u,n,s,r,t,i)}return o.length?Promise.all(o).then(()=>n):n}});md=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=>Cv(c,n))):Cv(a,n)}return o.length?Promise.all(o).then(()=>n):n}});gd=m("$ZodEnum",(t,e)=>{M.init(t,e);let n=Qn(e.entries),i=new Set(n);t._zod.values=i,t._zod.pattern=new RegExp(`^(${n.filter(r=>ti.has(typeof r)).map(r=>typeof r=="string"?Ke(r):r.toString()).join("|")})$`),t._zod.parse=(r,o)=>{let s=r.value;return i.has(s)||r.issues.push({code:"invalid_value",values:n,input:s,inst:t}),r}}),vd=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"?Ke(i):i?Ke(i.toString()):String(i)).join("|")})$`),t._zod.parse=(i,r)=>{let o=i.value;return n.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),i}}),yd=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 Mt(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 st;return n.value=r,n.fallback=!0,n}});rs=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(`^(${ei(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=>Rv(s,r)):Rv(o,r)}return n.value===void 0?n:e.innerType._zod.run(n,i)}}),bd=m("$ZodExactOptional",(t,e)=>{rs.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)}),$d=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(`^(${ei(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)}),xd=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=>Nv(o,e)):Nv(r,e)}});wd=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))}),Sd=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=>Dv(o,t)):Dv(r,t)}});Ed=m("$ZodSuccess",(t,e)=>{M.init(t,e),t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new Mt("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)}}),Id=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=>Ae(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=>Ae(o,i,se()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),kd=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)}),ns=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=>Jo(s,e.in,i)):Jo(o,e.in,i)}let r=e.in._zod.run(n,i);return r instanceof Promise?r.then(o=>Jo(o,e.out,i)):Jo(r,e.out,i)}});hi=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=>Ko(s,e,i)):Ko(o,e,i)}else{let o=e.out._zod.run(n,i);return o instanceof Promise?o.then(s=>Ko(s,e,i)):Ko(o,e,i)}}});Td=m("$ZodPreprocess",(t,e)=>{ns.init(t,e)}),Ad=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(Lv):Lv(r)}});Od=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||yu.has(typeof i))n.push(Ke(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);t._zod.pattern=new RegExp(`^${n.join("")}$`),t._zod.parse=(i,r)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:t,expected:"string",code:"invalid_type"}),i):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),i)}),Pd=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?Ro(t._def.input,i):i,o=Reflect.apply(n,this,r);return t._def.output?Ro(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 No(t._def.input,i):i,o=await Reflect.apply(n,this,r);return t._def.output?await No(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 ts({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)),Cd=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))}),Rd=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)}),Nd=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=>Mv(o,n,i,t));Mv(r,n,i,t)}})});function Zv(){return{localeError:w1()}}var w1,Bv=g(()=>{D();w1=()=>{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=x(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 Gv(){return{localeError:S1()}}var S1,Wv=g(()=>{D();S1=()=>{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=x(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 Hv(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 qv(){return{localeError:E1()}}var E1,Jv=g(()=>{D();E1=()=>{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=x(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=Hv(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=Hv(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 Kv(){return{localeError:I1()}}var I1,Yv=g(()=>{D();I1=()=>{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=x(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 Xv(){return{localeError:k1()}}var k1,Qv=g(()=>{D();k1=()=>{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=x(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 ey(){return{localeError:T1()}}var T1,ty=g(()=>{D();T1=()=>{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=x(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 ry(){return{localeError:A1()}}var A1,ny=g(()=>{D();A1=()=>{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=x(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 iy(){return{localeError:O1()}}var O1,oy=g(()=>{D();O1=()=>{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=x(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 sy(){return{localeError:P1()}}var P1,ay=g(()=>{D();P1=()=>{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=x(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 is(){return{localeError:C1()}}var C1,Ld=g(()=>{D();C1=()=>{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=x(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 cy(){return{localeError:R1()}}var R1,uy=g(()=>{D();R1=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(r){return t[r]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(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 ly(){return{localeError:N1()}}var N1,dy=g(()=>{D();N1=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(r){return t[r]??null}let n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return r=>{switch(r.code){case"invalid_type":{let o=i[r.expected]??r.expected,s=x(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 hy(){return{localeError:D1()}}var D1,fy=g(()=>{D();D1=()=>{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=x(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 py(){return{localeError:L1()}}var L1,my=g(()=>{D();L1=()=>{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=x(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 gy(){return{localeError:M1()}}var M1,vy=g(()=>{D();M1=()=>{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=x(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 yy(){return{localeError:z1()}}var z1,_y=g(()=>{D();z1=()=>{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=x(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 by(){return{localeError:U1()}}var U1,$y=g(()=>{D();U1=()=>{let t={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},n=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=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 ${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",_=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 ${_}`.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 _=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 ${_}`.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 xy(){return{localeError:j1()}}var j1,wy=g(()=>{D();j1=()=>{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=x(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 Sy(){return{localeError:F1()}}var F1,Ey=g(()=>{D();F1=()=>{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=x(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 Iy(t,e,n){return Math.abs(t)===1?e:n}function en(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 ky(){return{localeError:V1()}}var V1,Ty=g(()=>{D();V1=()=>{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=x(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=Iy(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 ${en(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 ${en(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=Iy(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 ${en(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 ${en(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 ${en(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 ${en(r.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}}});function Ay(){return{localeError:Z1()}}var Z1,Oy=g(()=>{D();Z1=()=>{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=x(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 Py(){return{localeError:B1()}}var B1,Cy=g(()=>{D();B1=()=>{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=x(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 Ry(){return{localeError:G1()}}var G1,Ny=g(()=>{D();G1=()=>{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=x(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 Dy(){return{localeError:W1()}}var W1,Ly=g(()=>{D();W1=()=>{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=x(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 My(){return{localeError:H1()}}var H1,zy=g(()=>{D();H1=()=>{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=x(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 os(){return{localeError:q1()}}var q1,Md=g(()=>{D();q1=()=>{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=x(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 Uy(){return os()}var jy=g(()=>{Md()});function Fy(){return{localeError:J1()}}var J1,Vy=g(()=>{D();J1=()=>{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=x(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 Zy(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 By(){return{localeError:K1()}}var fi,K1,Gy=g(()=>{D();fi=t=>t.charAt(0).toUpperCase()+t.slice(1);K1=()=>{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=x(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,Zy(Number(r.maximum)),r.inclusive??!1,"smaller");if(s?.verb)return`${fi(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`${fi(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,Zy(Number(r.minimum)),r.inclusive??!1,"bigger");if(s?.verb)return`${fi(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`${fi(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`${fi(o??r.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}}});function Wy(){return{localeError:Y1()}}var Y1,Hy=g(()=>{D();Y1=()=>{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=x(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 qy(){return{localeError:X1()}}var X1,Jy=g(()=>{D();X1=()=>{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=x(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 Ky(){return{localeError:Q1()}}var Q1,Yy=g(()=>{D();Q1=()=>{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=x(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 Xy(){return{localeError:eT()}}var eT,Qy=g(()=>{D();eT=()=>{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=x(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 e_(){return{localeError:tT()}}var tT,t_=g(()=>{D();tT=()=>{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=x(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 r_(){return{localeError:rT()}}var rT,n_=g(()=>{D();rT=()=>{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=x(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 i_(){return{localeError:nT()}}var nT,o_=g(()=>{D();nT=()=>{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=x(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 s_(){return{localeError:iT()}}var iT,a_=g(()=>{D();iT=()=>{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=x(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 c_(){return{localeError:oT()}}var oT,u_=g(()=>{D();oT=()=>{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=x(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 l_(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 d_(){return{localeError:sT()}}var sT,h_=g(()=>{D();sT=()=>{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=x(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=l_(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=l_(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 f_(){return{localeError:aT()}}var aT,p_=g(()=>{D();aT=()=>{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=x(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 m_(){return{localeError:cT()}}var cT,g_=g(()=>{D();cT=()=>{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=x(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 v_(){return{localeError:uT()}}var uT,y_=g(()=>{D();uT=()=>{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=x(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 __(){return{localeError:lT()}}var lT,b_=g(()=>{D();lT=()=>{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=x(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 $_(){return{localeError:dT()}}var dT,x_=g(()=>{D();dT=()=>{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=x(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 ss(){return{localeError:hT()}}var hT,zd=g(()=>{D();hT=()=>{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=x(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 w_(){return ss()}var S_=g(()=>{zd()});function E_(){return{localeError:fT()}}var fT,I_=g(()=>{D();fT=()=>{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=x(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 k_(){return{localeError:pT()}}var pT,T_=g(()=>{D();pT=()=>{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=x(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 A_(){return{localeError:mT()}}var mT,O_=g(()=>{D();mT=()=>{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=x(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 P_(){return{localeError:gT()}}var gT,C_=g(()=>{D();gT=()=>{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=x(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 R_(){return{localeError:vT()}}var vT,N_=g(()=>{D();vT=()=>{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=x(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 D_(){return{localeError:yT()}}var yT,L_=g(()=>{D();yT=()=>{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=x(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 pi={};qe(pi,{ar:()=>Zv,az:()=>Gv,be:()=>qv,bg:()=>Kv,ca:()=>Xv,cs:()=>ey,da:()=>ry,de:()=>iy,el:()=>sy,en:()=>is,eo:()=>cy,es:()=>ly,fa:()=>hy,fi:()=>py,fr:()=>gy,frCA:()=>yy,he:()=>by,hr:()=>xy,hu:()=>Sy,hy:()=>ky,id:()=>Ay,is:()=>Py,it:()=>Ry,ja:()=>Dy,ka:()=>My,kh:()=>Uy,km:()=>os,ko:()=>Fy,lt:()=>By,mk:()=>Wy,ms:()=>qy,nl:()=>Ky,no:()=>Xy,ota:()=>e_,pl:()=>i_,ps:()=>r_,pt:()=>s_,ro:()=>c_,ru:()=>d_,sl:()=>f_,sv:()=>m_,ta:()=>v_,th:()=>__,tr:()=>$_,ua:()=>w_,uk:()=>ss,ur:()=>E_,uz:()=>k_,vi:()=>A_,yo:()=>D_,zhCN:()=>P_,zhTW:()=>R_});var Ud=g(()=>{Bv();Wv();Jv();Yv();Qv();ty();ny();oy();ay();Ld();uy();dy();fy();my();vy();_y();$y();wy();Ey();Ty();Oy();Cy();Ny();Ly();zy();jy();Md();Vy();Gy();Hy();Jy();Yy();Qy();t_();n_();o_();a_();u_();h_();p_();g_();y_();b_();x_();S_();zd();I_();T_();O_();C_();N_();L_()});function cs(){return new as}var M_,jd,Fd,as,_e,mi=g(()=>{jd=Symbol("ZodOutput"),Fd=Symbol("ZodInput"),as=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)}};(M_=globalThis).__zod_globalRegistry??(M_.__zod_globalRegistry=cs());_e=globalThis.__zod_globalRegistry});function Vd(t,e){return new t({type:"string",...E(e)})}function Zd(t,e){return new t({type:"string",coerce:!0,...E(e)})}function us(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...E(e)})}function gi(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...E(e)})}function ls(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...E(e)})}function ds(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...E(e)})}function hs(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...E(e)})}function fs(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...E(e)})}function vi(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...E(e)})}function ps(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...E(e)})}function ms(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...E(e)})}function gs(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...E(e)})}function vs(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...E(e)})}function ys(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...E(e)})}function _s(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...E(e)})}function bs(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...E(e)})}function $s(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 Bd(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...E(e)})}function ws(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...E(e)})}function Ss(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...E(e)})}function Es(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...E(e)})}function Is(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...E(e)})}function ks(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...E(e)})}function Ts(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...E(e)})}function Wd(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...E(e)})}function Hd(t,e){return new t({type:"string",format:"date",check:"string_format",...E(e)})}function qd(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...E(e)})}function Jd(t,e){return new t({type:"string",format:"duration",check:"string_format",...E(e)})}function Kd(t,e){return new t({type:"number",checks:[],...E(e)})}function Yd(t,e){return new t({type:"number",coerce:!0,checks:[],...E(e)})}function Xd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...E(e)})}function Qd(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...E(e)})}function eh(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...E(e)})}function th(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...E(e)})}function rh(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...E(e)})}function nh(t,e){return new t({type:"boolean",...E(e)})}function ih(t,e){return new t({type:"boolean",coerce:!0,...E(e)})}function oh(t,e){return new t({type:"bigint",...E(e)})}function sh(t,e){return new t({type:"bigint",coerce:!0,...E(e)})}function ah(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...E(e)})}function ch(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...E(e)})}function uh(t,e){return new t({type:"symbol",...E(e)})}function lh(t,e){return new t({type:"undefined",...E(e)})}function dh(t,e){return new t({type:"null",...E(e)})}function hh(t){return new t({type:"any"})}function fh(t){return new t({type:"unknown"})}function ph(t,e){return new t({type:"never",...E(e)})}function mh(t,e){return new t({type:"void",...E(e)})}function gh(t,e){return new t({type:"date",...E(e)})}function vh(t,e){return new t({type:"date",coerce:!0,...E(e)})}function yh(t,e){return new t({type:"nan",...E(e)})}function dt(t,e){return new Wo({check:"less_than",...E(e),value:t,inclusive:!1})}function Ge(t,e){return new Wo({check:"less_than",...E(e),value:t,inclusive:!0})}function ht(t,e){return new Ho({check:"greater_than",...E(e),value:t,inclusive:!1})}function Oe(t,e){return new Ho({check:"greater_than",...E(e),value:t,inclusive:!0})}function As(t){return ht(0,t)}function Os(t){return dt(0,t)}function Ps(t){return Ge(0,t)}function Cs(t){return Oe(0,t)}function Vt(t,e){return new il({check:"multiple_of",...E(e),value:t})}function Zt(t,e){return new al({check:"max_size",...E(e),maximum:t})}function ft(t,e){return new cl({check:"min_size",...E(e),minimum:t})}function mr(t,e){return new ul({check:"size_equals",...E(e),size:t})}function gr(t,e){return new ll({check:"max_length",...E(e),maximum:t})}function wt(t,e){return new dl({check:"min_length",...E(e),minimum:t})}function vr(t,e){return new hl({check:"length_equals",...E(e),length:t})}function tn(t,e){return new fl({check:"string_format",format:"regex",...E(e),pattern:t})}function rn(t){return new pl({check:"string_format",format:"lowercase",...E(t)})}function nn(t){return new ml({check:"string_format",format:"uppercase",...E(t)})}function on(t,e){return new gl({check:"string_format",format:"includes",...E(e),includes:t})}function sn(t,e){return new vl({check:"string_format",format:"starts_with",...E(e),prefix:t})}function an(t,e){return new yl({check:"string_format",format:"ends_with",...E(e),suffix:t})}function Rs(t,e,n){return new _l({check:"property",property:t,schema:e,...E(n)})}function cn(t,e){return new bl({check:"mime_type",mime:t,...E(e)})}function at(t){return new $l({check:"overwrite",tx:t})}function un(t){return at(e=>e.normalize(t))}function ln(){return at(t=>t.trim())}function dn(){return at(t=>t.toLowerCase())}function hn(){return at(t=>t.toUpperCase())}function fn(){return at(t=>mu(t))}function _h(t,e,n){return new t({type:"array",element:e,...E(n)})}function bT(t,e,n){return new t({type:"union",options:e,...E(n)})}function $T(t,e,n){return new t({type:"union",options:e,inclusive:!1,...E(n)})}function xT(t,e,n,i){return new t({type:"union",options:n,discriminator:e,...E(i)})}function wT(t,e,n){return new t({type:"intersection",left:e,right:n})}function ST(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 ET(t,e,n,i){return new t({type:"record",keyType:e,valueType:n,...E(i)})}function IT(t,e,n,i){return new t({type:"map",keyType:e,valueType:n,...E(i)})}function kT(t,e,n){return new t({type:"set",valueType:e,...E(n)})}function TT(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 AT(t,e,n){return new t({type:"enum",entries:e,...E(n)})}function OT(t,e,n){return new t({type:"literal",values:Array.isArray(e)?e:[e],...E(n)})}function bh(t,e){return new t({type:"file",...E(e)})}function PT(t,e){return new t({type:"transform",transform:e})}function CT(t,e){return new t({type:"optional",innerType:e})}function RT(t,e){return new t({type:"nullable",innerType:e})}function NT(t,e,n){return new t({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():vu(n)}})}function DT(t,e,n){return new t({type:"nonoptional",innerType:e,...E(n)})}function LT(t,e){return new t({type:"success",innerType:e})}function MT(t,e,n){return new t({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}function zT(t,e,n){return new t({type:"pipe",in:e,out:n})}function UT(t,e){return new t({type:"readonly",innerType:e})}function jT(t,e,n){return new t({type:"template_literal",parts:e,...E(n)})}function FT(t,e){return new t({type:"lazy",getter:e})}function VT(t,e){return new t({type:"promise",innerType:e})}function $h(t,e,n){let i=E(n);return i.abort??(i.abort=!0),new t({type:"custom",check:"custom",fn:e,...i})}function xh(t,e,n){return new t({type:"custom",check:"custom",fn:e,...E(n)})}function wh(t,e){let n=z_(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(qr(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(qr(o))}},t(i.value,i)),e);return n}function z_(t,e){let n=new X({check:"custom",...E(e)});return n._zod.check=t,n}function Sh(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 Eh(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 Ih(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??hi,c=t.Boolean??li,u=t.String??pr,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 _=f;return n.case!=="sensitive"&&(_=_.toLowerCase()),o.has(_)?!0:s.has(_)?!1:(p.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:p.value,inst:h,continue:!1}),{})}),reverseTransform:((f,p)=>f===!0?i[0]||"true":r[0]||"false"),error:n.error});return h}function pn(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 Gd,U_=g(()=>{qo();mi();Dd();D();Gd={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function Bt(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"&&Pe(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 Gt(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>
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 Bt(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 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 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:ln(e,"input",t.processors),output:ln(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Pe(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 Pe(i.element,n);if(i.type==="set")return Pe(i.valueType,n);if(i.type==="lazy")return Pe(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 Pe(i.innerType,n);if(i.type==="intersection")return Pe(i.left,n)||Pe(i.right,n);if(i.type==="record"||i.type==="map")return Pe(i.keyType,n)||Pe(i.valueType,n);if(i.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Pe(i.in,n)||Pe(i.out,n);if(i.type==="object"){for(let r in i.shape)if(Pe(i.shape[r],n))return!0;return!1}if(i.type==="union"){for(let r of i.options)if(Pe(r,n))return!0;return!1}if(i.type==="tuple"){for(let r of i.items)if(Pe(r,n))return!0;return!!(i.rest&&Pe(i.rest,n))}return!1}var wh,ln,mi=g(()=>{hi();wh=(t,e={})=>n=>{let i=Vt({...n,processors:e});return W(t,i),Zt(i,t),Bt(i,t)},ln=(t,e,n={})=>i=>{let{libraryOptions:r,target:o}=i??{},s=Vt({...r??{},target:o,io:e,processors:n});return W(t,s),Zt(s,t),Bt(s,t)}});function Ds(t,e){if("_idmap"in t){let i=t,r=Vt({...e,processors:Ps}),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;Zt(r,l),s[u]=Bt(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=Vt({...e,processors:Ps});return W(t,n),Zt(n,t),Bt(n,t)}var DT,Sh,Eh,Ih,kh,Th,Ah,Oh,Ph,Ch,Rh,Dh,Nh,zh,Lh,Uh,Mh,jh,Fh,Vh,Zh,Bh,Gh,Wh,Hh,qh,Cs,Jh,Kh,Yh,Xh,Qh,ef,tf,rf,nf,of,sf,Rs,af,Ps,gi=g(()=>{mi();D();DT={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Sh=(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=DT[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}))])}},Eh=(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)},Ih=(t,e,n,i)=>{n.type="boolean"},kh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Th=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Ah=(t,e,n,i)=>{e.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},Oh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Ph=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Ch=(t,e,n,i)=>{n.not={}},Rh=(t,e,n,i)=>{},Dh=(t,e,n,i)=>{},Nh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},zh=(t,e,n,i)=>{let r=t._zod.def,o=Kn(r.entries);o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),n.enum=o},Lh=(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},Uh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Mh=(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},jh=(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)},Fh=(t,e,n,i)=>{n.type="boolean"},Vh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Zh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Bh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Gh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Wh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Hh=(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"]})},qh=(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)},Cs=(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},Jh=(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},Kh=(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)},Yh=(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)}},Xh=(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"}]},Qh=(t,e,n,i)=>{let r=t._zod.def;W(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},ef=(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))},tf=(t,e,n,i)=>{let r=t._zod.def;W(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType,e.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},rf=(t,e,n,i)=>{let r=t._zod.def;W(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType;let s;try{s=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s},nf=(t,e,n,i)=>{let r=t._zod.def,o=r.in._zod.traits.has("$ZodTransform"),s=e.io==="input"?o?r.out:r.in:r.out;W(s,e,i);let a=e.seen.get(t);a.ref=s},of=(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},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},Rs=(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.innerType;W(r,e,i);let o=e.seen.get(t);o.ref=r},Ps={string:Sh,number:Eh,boolean:Ih,bigint:kh,symbol:Th,null:Ah,undefined:Oh,void:Ph,never:Ch,any:Rh,unknown:Dh,date:Nh,enum:zh,literal:Lh,nan:Uh,template_literal:Mh,file:jh,success:Fh,custom:Vh,function:Zh,transform:Bh,map:Gh,set:Wh,array:Hh,object:qh,union:Cs,intersection:Jh,tuple:Kh,record:Yh,nullable:Xh,nonoptional:Qh,default:ef,prefault:tf,catch:rf,pipe:nf,readonly:of,promise:sf,optional:Rs,lazy:af}});var Ns,L_=g(()=>{gi();mi();Ns=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=Vt({processors:Ps,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)),Zt(this.ctx,e);let i=Bt(this.ctx,e),{"~standard":r,...o}=i;return o}}});var U_={};var M_=g(()=>{});var wt={};qe(wt,{$ZodAny:()=>Ql,$ZodArray:()=>id,$ZodAsyncError:()=>st,$ZodBase64:()=>Zl,$ZodBase64URL:()=>Bl,$ZodBigInt:()=>Yo,$ZodBigIntFormat:()=>Jl,$ZodBoolean:()=>ai,$ZodCIDRv4:()=>jl,$ZodCIDRv6:()=>Fl,$ZodCUID:()=>Tl,$ZodCUID2:()=>Al,$ZodCatch:()=>xd,$ZodCheck:()=>X,$ZodCheckBigIntFormat:()=>rl,$ZodCheckEndsWith:()=>pl,$ZodCheckGreaterThan:()=>Bo,$ZodCheckIncludes:()=>hl,$ZodCheckLengthEquals:()=>cl,$ZodCheckLessThan:()=>Zo,$ZodCheckLowerCase:()=>ll,$ZodCheckMaxLength:()=>sl,$ZodCheckMaxSize:()=>nl,$ZodCheckMimeType:()=>gl,$ZodCheckMinLength:()=>al,$ZodCheckMinSize:()=>il,$ZodCheckMultipleOf:()=>el,$ZodCheckNumberFormat:()=>tl,$ZodCheckOverwrite:()=>vl,$ZodCheckProperty:()=>ml,$ZodCheckRegex:()=>ul,$ZodCheckSizeEquals:()=>ol,$ZodCheckStartsWith:()=>fl,$ZodCheckStringFormat:()=>qr,$ZodCheckUpperCase:()=>dl,$ZodCodec:()=>ui,$ZodCustom:()=>Od,$ZodCustomStringFormat:()=>Hl,$ZodDate:()=>nd,$ZodDefault:()=>yd,$ZodDiscriminatedUnion:()=>ad,$ZodE164:()=>Gl,$ZodEmail:()=>Sl,$ZodEmoji:()=>Il,$ZodEncodeError:()=>Nt,$ZodEnum:()=>hd,$ZodError:()=>ti,$ZodExactOptional:()=>gd,$ZodFile:()=>pd,$ZodFunction:()=>kd,$ZodGUID:()=>xl,$ZodIPv4:()=>Ll,$ZodIPv6:()=>Ul,$ZodISODate:()=>Dl,$ZodISODateTime:()=>Rl,$ZodISODuration:()=>zl,$ZodISOTime:()=>Nl,$ZodIntersection:()=>cd,$ZodJWT:()=>Wl,$ZodKSUID:()=>Cl,$ZodLazy:()=>Ad,$ZodLiteral:()=>fd,$ZodMAC:()=>Ml,$ZodMap:()=>ld,$ZodNaN:()=>wd,$ZodNanoID:()=>kl,$ZodNever:()=>td,$ZodNonOptional:()=>bd,$ZodNull:()=>Xl,$ZodNullable:()=>vd,$ZodNumber:()=>Ko,$ZodNumberFormat:()=>ql,$ZodObject:()=>Mv,$ZodObjectJIT:()=>od,$ZodOptional:()=>Qo,$ZodPipe:()=>es,$ZodPrefault:()=>_d,$ZodPreprocess:()=>Sd,$ZodPromise:()=>Td,$ZodReadonly:()=>Ed,$ZodRealError:()=>ze,$ZodRecord:()=>ud,$ZodRegistry:()=>is,$ZodSet:()=>dd,$ZodString:()=>dr,$ZodStringFormat:()=>q,$ZodSuccess:()=>$d,$ZodSymbol:()=>Kl,$ZodTemplateLiteral:()=>Id,$ZodTransform:()=>md,$ZodTuple:()=>Xo,$ZodType:()=>L,$ZodULID:()=>Ol,$ZodURL:()=>El,$ZodUUID:()=>wl,$ZodUndefined:()=>Yl,$ZodUnion:()=>ci,$ZodUnknown:()=>ed,$ZodVoid:()=>rd,$ZodXID:()=>Pl,$ZodXor:()=>sd,$brand:()=>au,$constructor:()=>m,$input:()=>Ld,$output:()=>zd,Doc:()=>si,JSONSchema:()=>U_,JSONSchemaGenerator:()=>Ns,NEVER:()=>su,TimePrecision:()=>Fd,_any:()=>ch,_array:()=>mh,_base64:()=>xs,_base64url:()=>ws,_bigint:()=>th,_boolean:()=>Qd,_catch:()=>TT,_check:()=>N_,_cidrv4:()=>bs,_cidrv6:()=>$s,_coercedBigint:()=>rh,_coercedBoolean:()=>eh,_coercedDate:()=>fh,_coercedNumber:()=>Hd,_coercedString:()=>Md,_cuid:()=>fs,_cuid2:()=>ps,_custom:()=>vh,_date:()=>hh,_decode:()=>Ro,_decodeAsync:()=>No,_default:()=>ET,_discriminatedUnion:()=>fT,_e164:()=>Ss,_email:()=>ss,_emoji:()=>ds,_encode:()=>Co,_encodeAsync:()=>Do,_endsWith:()=>tn,_enum:()=>_T,_file:()=>gh,_float32:()=>Jd,_float64:()=>Kd,_gt:()=>ht,_gte:()=>Oe,_guid:()=>fi,_includes:()=>Qr,_int:()=>qd,_int32:()=>Yd,_int64:()=>nh,_intersection:()=>pT,_ipv4:()=>ys,_ipv6:()=>_s,_isoDate:()=>Zd,_isoDateTime:()=>Vd,_isoDuration:()=>Gd,_isoTime:()=>Bd,_jwt:()=>Es,_ksuid:()=>vs,_lazy:()=>CT,_length:()=>pr,_literal:()=>$T,_lowercase:()=>Yr,_lt:()=>dt,_lte:()=>Ze,_mac:()=>jd,_map:()=>vT,_max:()=>Ze,_maxLength:()=>fr,_maxSize:()=>Ft,_mime:()=>rn,_min:()=>Oe,_minLength:()=>xt,_minSize:()=>ft,_multipleOf:()=>jt,_nan:()=>ph,_nanoid:()=>hs,_nativeEnum:()=>bT,_negative:()=>ks,_never:()=>lh,_nonnegative:()=>As,_nonoptional:()=>IT,_nonpositive:()=>Ts,_normalize:()=>nn,_null:()=>ah,_nullable:()=>ST,_number:()=>Wd,_optional:()=>wT,_overwrite:()=>at,_parse:()=>Br,_parseAsync:()=>Gr,_pipe:()=>AT,_positive:()=>Is,_promise:()=>RT,_property:()=>Os,_readonly:()=>OT,_record:()=>gT,_refine:()=>yh,_regex:()=>Kr,_safeDecode:()=>Lo,_safeDecodeAsync:()=>Mo,_safeEncode:()=>zo,_safeEncodeAsync:()=>Uo,_safeParse:()=>Wr,_safeParseAsync:()=>Hr,_set:()=>yT,_size:()=>hr,_slugify:()=>cn,_startsWith:()=>en,_string:()=>Ud,_stringFormat:()=>un,_stringbool:()=>xh,_success:()=>kT,_superRefine:()=>_h,_symbol:()=>oh,_templateLiteral:()=>PT,_toLowerCase:()=>sn,_toUpperCase:()=>an,_transform:()=>xT,_trim:()=>on,_tuple:()=>mT,_uint32:()=>Xd,_uint64:()=>ih,_ulid:()=>ms,_undefined:()=>sh,_union:()=>dT,_unknown:()=>uh,_uppercase:()=>Xr,_url:()=>pi,_uuid:()=>as,_uuidv4:()=>cs,_uuidv6:()=>us,_uuidv7:()=>ls,_void:()=>dh,_xid:()=>gs,_xor:()=>hT,clone:()=>Te,config:()=>oe,createStandardJSONSchemaMethod:()=>ln,createToJSONSchemaMethod:()=>wh,decode:()=>Rk,decodeAsync:()=>Nk,describe:()=>bh,encode:()=>Ck,encodeAsync:()=>Dk,extractDefs:()=>Zt,finalize:()=>Bt,flattenError:()=>ri,formatError:()=>ni,globalConfig:()=>ar,globalRegistry:()=>ye,initializeContext:()=>Vt,isValidBase64:()=>Vl,isValidBase64URL:()=>Nv,isValidJWT:()=>zv,locales:()=>di,meta:()=>$h,parse:()=>Oo,parseAsync:()=>Po,prettifyError:()=>bu,process:()=>W,regexes:()=>Ve,registry:()=>os,safeDecode:()=>Lk,safeDecodeAsync:()=>Mk,safeEncode:()=>zk,safeEncodeAsync:()=>Uk,safeParse:()=>xu,safeParseAsync:()=>wu,toDotPath:()=>pv,toJSONSchema:()=>Ds,treeifyError:()=>_u,util:()=>w,version:()=>_l});var Be=g(()=>{cr();Su();$u();Pd();Go();bl();D();Vo();Nd();hi();yl();z_();mi();gi();L_();M_()});var zs={};qe(zs,{endsWith:()=>tn,gt:()=>ht,gte:()=>Oe,includes:()=>Qr,length:()=>pr,lowercase:()=>Yr,lt:()=>dt,lte:()=>Ze,maxLength:()=>fr,maxSize:()=>Ft,mime:()=>rn,minLength:()=>xt,minSize:()=>ft,multipleOf:()=>jt,negative:()=>ks,nonnegative:()=>As,nonpositive:()=>Ts,normalize:()=>nn,overwrite:()=>at,positive:()=>Is,property:()=>Os,regex:()=>Kr,size:()=>hr,slugify:()=>cn,startsWith:()=>en,toLowerCase:()=>sn,toUpperCase:()=>an,trim:()=>on,uppercase:()=>Xr});var Ls=g(()=>{Be()});var dn={};qe(dn,{ZodISODate:()=>Ms,ZodISODateTime:()=>Us,ZodISODuration:()=>Fs,ZodISOTime:()=>js,date:()=>uf,datetime:()=>cf,duration:()=>df,time:()=>lf});function cf(t){return Vd(Us,t)}function uf(t){return Zd(Ms,t)}function lf(t){return Bd(js,t)}function df(t){return Gd(Fs,t)}var Us,Ms,js,Fs,vi=g(()=>{Be();_i();Us=m("ZodISODateTime",(t,e)=>{Rl.init(t,e),J.init(t,e)});Ms=m("ZodISODate",(t,e)=>{Dl.init(t,e),J.init(t,e)});js=m("ZodISOTime",(t,e)=>{Nl.init(t,e),J.init(t,e)});Fs=m("ZodISODuration",(t,e)=>{zl.init(t,e),J.init(t,e)})});var j_,zT,Le,hf=g(()=>{Be();Be();D();j_=(t,e)=>{ti.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>ni(t,n)},flatten:{value:n=>ri(t,n)},addIssue:{value:n=>{t.issues.push(n),t.message=JSON.stringify(t.issues,Fr,2)}},addIssues:{value:n=>{t.issues.push(...n),t.message=JSON.stringify(t.issues,Fr,2)}},isEmpty:{get(){return t.issues.length===0}}})},zT=m("ZodError",j_),Le=m("ZodError",j_,{Parent:Error})});var ff,pf,mf,gf,vf,yf,_f,bf,$f,xf,wf,Sf,Ef=g(()=>{Be();hf();ff=Br(Le),pf=Gr(Le),mf=Wr(Le),gf=Hr(Le),vf=Co(Le),yf=Ro(Le),_f=Do(Le),bf=No(Le),$f=zo(Le),xf=Lo(Le),wf=Uo(Le),Sf=Mo(Le)});var yi={};qe(yi,{ZodAny:()=>Rf,ZodArray:()=>Lf,ZodBase64:()=>na,ZodBase64URL:()=>ia,ZodBigInt:()=>yn,ZodBigIntFormat:()=>aa,ZodBoolean:()=>vn,ZodCIDRv4:()=>ta,ZodCIDRv6:()=>ra,ZodCUID:()=>qs,ZodCUID2:()=>Js,ZodCatch:()=>op,ZodCodec:()=>Pi,ZodCustom:()=>Ci,ZodCustomStringFormat:()=>mn,ZodDate:()=>Ii,ZodDefault:()=>Qf,ZodDiscriminatedUnion:()=>Mf,ZodE164:()=>oa,ZodEmail:()=>Gs,ZodEmoji:()=>Ws,ZodEnum:()=>fn,ZodExactOptional:()=>Kf,ZodFile:()=>qf,ZodFunction:()=>mp,ZodGUID:()=>$i,ZodIPv4:()=>Qs,ZodIPv6:()=>ea,ZodIntersection:()=>jf,ZodJWT:()=>sa,ZodKSUID:()=>Xs,ZodLazy:()=>hp,ZodLiteral:()=>Hf,ZodMAC:()=>If,ZodMap:()=>Gf,ZodNaN:()=>ap,ZodNanoID:()=>Hs,ZodNever:()=>Nf,ZodNonOptional:()=>fa,ZodNull:()=>Pf,ZodNullable:()=>Xf,ZodNumber:()=>gn,ZodNumberFormat:()=>gr,ZodObject:()=>Ti,ZodOptional:()=>ha,ZodPipe:()=>Oi,ZodPrefault:()=>tp,ZodPreprocess:()=>cp,ZodPromise:()=>pp,ZodReadonly:()=>up,ZodRecord:()=>hn,ZodSet:()=>Wf,ZodString:()=>pn,ZodStringFormat:()=>J,ZodSuccess:()=>ip,ZodSymbol:()=>Af,ZodTemplateLiteral:()=>dp,ZodTransform:()=>Jf,ZodTuple:()=>Vf,ZodType:()=>j,ZodULID:()=>Ks,ZodURL:()=>Ei,ZodUUID:()=>pt,ZodUndefined:()=>Of,ZodUnion:()=>Ai,ZodUnknown:()=>Df,ZodVoid:()=>zf,ZodXID:()=>Ys,ZodXor:()=>Uf,_ZodString:()=>Bs,_default:()=>ep,_function:()=>qb,any:()=>Eb,array:()=>ki,base64:()=>cb,base64url:()=>ub,bigint:()=>bb,boolean:()=>Tf,catch:()=>sp,check:()=>Jb,cidrv4:()=>sb,cidrv6:()=>ab,codec:()=>Bb,cuid:()=>X_,cuid2:()=>Q_,custom:()=>Kb,date:()=>kb,describe:()=>Yb,discriminatedUnion:()=>Rb,e164:()=>lb,email:()=>V_,emoji:()=>K_,enum:()=>la,exactOptional:()=>Yf,file:()=>jb,float32:()=>gb,float64:()=>vb,function:()=>qb,guid:()=>Z_,hash:()=>mb,hex:()=>pb,hostname:()=>fb,httpUrl:()=>J_,instanceof:()=>Qb,int:()=>Vs,int32:()=>yb,int64:()=>$b,intersection:()=>Ff,invertCodec:()=>Gb,ipv4:()=>nb,ipv6:()=>ob,json:()=>t$,jwt:()=>db,keyof:()=>Tb,ksuid:()=>rb,lazy:()=>fp,literal:()=>Mb,looseObject:()=>Pb,looseRecord:()=>Nb,mac:()=>ib,map:()=>zb,meta:()=>Xb,nan:()=>Zb,nanoid:()=>Y_,nativeEnum:()=>Ub,never:()=>ca,nonoptional:()=>np,null:()=>Cf,nullable:()=>wi,nullish:()=>Fb,number:()=>kf,object:()=>Ab,optional:()=>xi,partialRecord:()=>Db,pipe:()=>Zs,prefault:()=>rp,preprocess:()=>r$,promise:()=>Hb,readonly:()=>lp,record:()=>Bf,refine:()=>gp,set:()=>Lb,strictObject:()=>Ob,string:()=>bi,stringFormat:()=>hb,stringbool:()=>e$,success:()=>Vb,superRefine:()=>vp,symbol:()=>wb,templateLiteral:()=>Wb,transform:()=>da,tuple:()=>Zf,uint32:()=>_b,uint64:()=>xb,ulid:()=>eb,undefined:()=>Sb,union:()=>ua,unknown:()=>mr,url:()=>q_,uuid:()=>B_,uuidv4:()=>G_,uuidv6:()=>W_,uuidv7:()=>H_,void:()=>Ib,xid:()=>tb,xor:()=>Cb});function Si(t,e,n){let i=Object.getPrototypeOf(t),r=F_.get(i);if(r||(r=new Set,F_.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 bi(t){return Ud(pn,t)}function V_(t){return ss(Gs,t)}function Z_(t){return fi($i,t)}function B_(t){return as(pt,t)}function G_(t){return cs(pt,t)}function W_(t){return us(pt,t)}function H_(t){return ls(pt,t)}function q_(t){return pi(Ei,t)}function J_(t){return pi(Ei,{protocol:Ve.httpProtocol,hostname:Ve.domain,...w.normalizeParams(t)})}function K_(t){return ds(Ws,t)}function Y_(t){return hs(Hs,t)}function X_(t){return fs(qs,t)}function Q_(t){return ps(Js,t)}function eb(t){return ms(Ks,t)}function tb(t){return gs(Ys,t)}function rb(t){return vs(Xs,t)}function nb(t){return ys(Qs,t)}function ib(t){return jd(If,t)}function ob(t){return _s(ea,t)}function sb(t){return bs(ta,t)}function ab(t){return $s(ra,t)}function cb(t){return xs(na,t)}function ub(t){return ws(ia,t)}function lb(t){return Ss(oa,t)}function db(t){return Es(sa,t)}function hb(t,e,n={}){return un(mn,t,e,n)}function fb(t){return un(mn,"hostname",Ve.hostname,t)}function pb(t){return un(mn,"hex",Ve.hex,t)}function mb(t,e){let n=e?.enc??"hex",i=`${t}_${n}`,r=Ve[i];if(!r)throw new Error(`Unrecognized hash format: ${i}`);return un(mn,i,r,e)}function kf(t){return Wd(gn,t)}function Vs(t){return qd(gr,t)}function gb(t){return Jd(gr,t)}function vb(t){return Kd(gr,t)}function yb(t){return Yd(gr,t)}function _b(t){return Xd(gr,t)}function Tf(t){return Qd(vn,t)}function bb(t){return th(yn,t)}function $b(t){return nh(aa,t)}function xb(t){return ih(aa,t)}function wb(t){return oh(Af,t)}function Sb(t){return sh(Of,t)}function Cf(t){return ah(Pf,t)}function Eb(){return ch(Rf)}function mr(){return uh(Df)}function ca(t){return lh(Nf,t)}function Ib(t){return dh(zf,t)}function kb(t){return hh(Ii,t)}function ki(t,e){return mh(Lf,t,e)}function Tb(t){let e=t._zod.def.shape;return la(Object.keys(e))}function Ab(t,e){let n={type:"object",shape:t??{},...w.normalizeParams(e)};return new Ti(n)}function Ob(t,e){return new Ti({type:"object",shape:t,catchall:ca(),...w.normalizeParams(e)})}function Pb(t,e){return new Ti({type:"object",shape:t,catchall:mr(),...w.normalizeParams(e)})}function ua(t,e){return new Ai({type:"union",options:t,...w.normalizeParams(e)})}function Cb(t,e){return new Uf({type:"union",options:t,inclusive:!1,...w.normalizeParams(e)})}function Rb(t,e,n){return new Mf({type:"union",options:e,discriminator:t,...w.normalizeParams(n)})}function Ff(t,e){return new jf({type:"intersection",left:t,right:e})}function Zf(t,e,n){let i=e instanceof L,r=i?n:e,o=i?e:null;return new Vf({type:"tuple",items:t,rest:o,...w.normalizeParams(r)})}function Bf(t,e,n){return!e||!e._zod?new hn({type:"record",keyType:bi(),valueType:t,...w.normalizeParams(e)}):new hn({type:"record",keyType:t,valueType:e,...w.normalizeParams(n)})}function Db(t,e,n){let i=Te(t);return i._zod.values=void 0,new hn({type:"record",keyType:i,valueType:e,...w.normalizeParams(n)})}function Nb(t,e,n){return new hn({type:"record",keyType:t,valueType:e,mode:"loose",...w.normalizeParams(n)})}function zb(t,e,n){return new Gf({type:"map",keyType:t,valueType:e,...w.normalizeParams(n)})}function Lb(t,e){return new Wf({type:"set",valueType:t,...w.normalizeParams(e)})}function la(t,e){let n=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new fn({type:"enum",entries:n,...w.normalizeParams(e)})}function Ub(t,e){return new fn({type:"enum",entries:t,...w.normalizeParams(e)})}function Mb(t,e){return new Hf({type:"literal",values:Array.isArray(t)?t:[t],...w.normalizeParams(e)})}function jb(t){return gh(qf,t)}function da(t){return new Jf({type:"transform",transform:t})}function xi(t){return new ha({type:"optional",innerType:t})}function Yf(t){return new Kf({type:"optional",innerType:t})}function wi(t){return new Xf({type:"nullable",innerType:t})}function Fb(t){return xi(wi(t))}function ep(t,e){return new Qf({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():w.shallowClone(e)}})}function rp(t,e){return new tp({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():w.shallowClone(e)}})}function np(t,e){return new fa({type:"nonoptional",innerType:t,...w.normalizeParams(e)})}function Vb(t){return new ip({type:"success",innerType:t})}function sp(t,e){return new op({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function Zb(t){return ph(ap,t)}function Zs(t,e){return new Oi({type:"pipe",in:t,out:e})}function Bb(t,e,n){return new Pi({type:"pipe",in:t,out:e,transform:n.decode,reverseTransform:n.encode})}function Gb(t){let e=t._zod.def;return new Pi({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}function lp(t){return new up({type:"readonly",innerType:t})}function Wb(t,e){return new dp({type:"template_literal",parts:t,...w.normalizeParams(e)})}function fp(t){return new hp({type:"lazy",getter:t})}function Hb(t){return new pp({type:"promise",innerType:t})}function qb(t){return new mp({type:"function",input:Array.isArray(t?.input)?Zf(t?.input):t?.input??ki(mr()),output:t?.output??mr()})}function Jb(t){let e=new X({check:"custom"});return e._zod.check=t,e}function Kb(t,e){return vh(Ci,t??(()=>!0),e)}function gp(t,e={}){return yh(Ci,t,e)}function vp(t,e){return _h(t,e)}function Qb(t,e={}){let n=new Ci({type:"custom",check:"custom",fn:i=>i instanceof t,abort:!0,...w.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 t$(t){let e=fp(()=>ua([bi(t),kf(),Tf(),Cf(),ki(e),Bf(bi(),e)]));return e}function r$(t,e){return new cp({type:"pipe",in:da(t),out:e})}var F_,j,Bs,pn,J,Gs,$i,pt,Ei,Ws,Hs,qs,Js,Ks,Ys,Xs,Qs,If,ea,ta,ra,na,ia,oa,sa,mn,gn,gr,vn,yn,aa,Af,Of,Pf,Rf,Df,Nf,zf,Ii,Lf,Ti,Ai,Uf,Mf,jf,Vf,hn,Gf,Wf,fn,Hf,qf,Jf,ha,Kf,Xf,Qf,tp,fa,ip,op,ap,Oi,Pi,cp,up,dp,hp,pp,mp,Ci,Yb,Xb,e$,_i=g(()=>{Be();Be();gi();mi();Ls();vi();Ef();F_=new WeakMap;j=m("ZodType",(t,e)=>(L.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:ln(t,"input"),output:ln(t,"output")}}),t.toJSONSchema=wh(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(n,i)=>ff(t,n,i,{callee:t.parse}),t.safeParse=(n,i)=>mf(t,n,i),t.parseAsync=async(n,i)=>pf(t,n,i,{callee:t.parseAsync}),t.safeParseAsync=async(n,i)=>gf(t,n,i),t.spa=t.safeParseAsync,t.encode=(n,i)=>vf(t,n,i),t.decode=(n,i)=>yf(t,n,i),t.encodeAsync=async(n,i)=>_f(t,n,i),t.decodeAsync=async(n,i)=>bf(t,n,i),t.safeEncode=(n,i)=>$f(t,n,i),t.safeDecode=(n,i)=>xf(t,n,i),t.safeEncodeAsync=async(n,i)=>wf(t,n,i),t.safeDecodeAsync=async(n,i)=>Sf(t,n,i),Si(t,"ZodType",{check(...n){let i=this.def;return this.clone(w.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 Te(this,n,i)},brand(){return this},register(n,i){return n.add(this,i),this},refine(n,i){return this.check(gp(n,i))},superRefine(n,i){return this.check(vp(n,i))},overwrite(n){return this.check(at(n))},optional(){return xi(this)},exactOptional(){return Yf(this)},nullable(){return wi(this)},nullish(){return xi(wi(this))},nonoptional(n){return np(this,n)},array(){return ki(this)},or(n){return ua([this,n])},and(n){return Ff(this,n)},transform(n){return Zs(this,da(n))},default(n){return ep(this,n)},prefault(n){return rp(this,n)},catch(n){return sp(this,n)},pipe(n){return Zs(this,n)},readonly(){return lp(this)},describe(n){let i=this.clone();return ye.add(i,{description:n}),i},meta(...n){if(n.length===0)return ye.get(this);let i=this.clone();return ye.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 ye.get(t)?.description},configurable:!0}),t)),Bs=m("_ZodString",(t,e)=>{dr.init(t,e),j.init(t,e),t._zod.processJSONSchema=(i,r,o)=>Sh(t,i,r,o);let n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,Si(t,"_ZodString",{regex(...i){return this.check(Kr(...i))},includes(...i){return this.check(Qr(...i))},startsWith(...i){return this.check(en(...i))},endsWith(...i){return this.check(tn(...i))},min(...i){return this.check(xt(...i))},max(...i){return this.check(fr(...i))},length(...i){return this.check(pr(...i))},nonempty(...i){return this.check(xt(1,...i))},lowercase(i){return this.check(Yr(i))},uppercase(i){return this.check(Xr(i))},trim(){return this.check(on())},normalize(...i){return this.check(nn(...i))},toLowerCase(){return this.check(sn())},toUpperCase(){return this.check(an())},slugify(){return this.check(cn())}})}),pn=m("ZodString",(t,e)=>{dr.init(t,e),Bs.init(t,e),t.email=n=>t.check(ss(Gs,n)),t.url=n=>t.check(pi(Ei,n)),t.jwt=n=>t.check(Es(sa,n)),t.emoji=n=>t.check(ds(Ws,n)),t.guid=n=>t.check(fi($i,n)),t.uuid=n=>t.check(as(pt,n)),t.uuidv4=n=>t.check(cs(pt,n)),t.uuidv6=n=>t.check(us(pt,n)),t.uuidv7=n=>t.check(ls(pt,n)),t.nanoid=n=>t.check(hs(Hs,n)),t.guid=n=>t.check(fi($i,n)),t.cuid=n=>t.check(fs(qs,n)),t.cuid2=n=>t.check(ps(Js,n)),t.ulid=n=>t.check(ms(Ks,n)),t.base64=n=>t.check(xs(na,n)),t.base64url=n=>t.check(ws(ia,n)),t.xid=n=>t.check(gs(Ys,n)),t.ksuid=n=>t.check(vs(Xs,n)),t.ipv4=n=>t.check(ys(Qs,n)),t.ipv6=n=>t.check(_s(ea,n)),t.cidrv4=n=>t.check(bs(ta,n)),t.cidrv6=n=>t.check($s(ra,n)),t.e164=n=>t.check(Ss(oa,n)),t.datetime=n=>t.check(cf(n)),t.date=n=>t.check(uf(n)),t.time=n=>t.check(lf(n)),t.duration=n=>t.check(df(n))});J=m("ZodStringFormat",(t,e)=>{q.init(t,e),Bs.init(t,e)}),Gs=m("ZodEmail",(t,e)=>{Sl.init(t,e),J.init(t,e)});$i=m("ZodGUID",(t,e)=>{xl.init(t,e),J.init(t,e)});pt=m("ZodUUID",(t,e)=>{wl.init(t,e),J.init(t,e)});Ei=m("ZodURL",(t,e)=>{El.init(t,e),J.init(t,e)});Ws=m("ZodEmoji",(t,e)=>{Il.init(t,e),J.init(t,e)});Hs=m("ZodNanoID",(t,e)=>{kl.init(t,e),J.init(t,e)});qs=m("ZodCUID",(t,e)=>{Tl.init(t,e),J.init(t,e)});Js=m("ZodCUID2",(t,e)=>{Al.init(t,e),J.init(t,e)});Ks=m("ZodULID",(t,e)=>{Ol.init(t,e),J.init(t,e)});Ys=m("ZodXID",(t,e)=>{Pl.init(t,e),J.init(t,e)});Xs=m("ZodKSUID",(t,e)=>{Cl.init(t,e),J.init(t,e)});Qs=m("ZodIPv4",(t,e)=>{Ll.init(t,e),J.init(t,e)});If=m("ZodMAC",(t,e)=>{Ml.init(t,e),J.init(t,e)});ea=m("ZodIPv6",(t,e)=>{Ul.init(t,e),J.init(t,e)});ta=m("ZodCIDRv4",(t,e)=>{jl.init(t,e),J.init(t,e)});ra=m("ZodCIDRv6",(t,e)=>{Fl.init(t,e),J.init(t,e)});na=m("ZodBase64",(t,e)=>{Zl.init(t,e),J.init(t,e)});ia=m("ZodBase64URL",(t,e)=>{Bl.init(t,e),J.init(t,e)});oa=m("ZodE164",(t,e)=>{Gl.init(t,e),J.init(t,e)});sa=m("ZodJWT",(t,e)=>{Wl.init(t,e),J.init(t,e)});mn=m("ZodCustomStringFormat",(t,e)=>{Hl.init(t,e),J.init(t,e)});gn=m("ZodNumber",(t,e)=>{Ko.init(t,e),j.init(t,e),t._zod.processJSONSchema=(i,r,o)=>Eh(t,i,r,o),Si(t,"ZodNumber",{gt(i,r){return this.check(ht(i,r))},gte(i,r){return this.check(Oe(i,r))},min(i,r){return this.check(Oe(i,r))},lt(i,r){return this.check(dt(i,r))},lte(i,r){return this.check(Ze(i,r))},max(i,r){return this.check(Ze(i,r))},int(i){return this.check(Vs(i))},safe(i){return this.check(Vs(i))},positive(i){return this.check(ht(0,i))},nonnegative(i){return this.check(Oe(0,i))},negative(i){return this.check(dt(0,i))},nonpositive(i){return this.check(Ze(0,i))},multipleOf(i,r){return this.check(jt(i,r))},step(i,r){return this.check(jt(i,r))},finite(){return this}});let n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null});gr=m("ZodNumberFormat",(t,e)=>{ql.init(t,e),gn.init(t,e)});vn=m("ZodBoolean",(t,e)=>{ai.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ih(t,n,i,r)});yn=m("ZodBigInt",(t,e)=>{Yo.init(t,e),j.init(t,e),t._zod.processJSONSchema=(i,r,o)=>kh(t,i,r,o),t.gte=(i,r)=>t.check(Oe(i,r)),t.min=(i,r)=>t.check(Oe(i,r)),t.gt=(i,r)=>t.check(ht(i,r)),t.gte=(i,r)=>t.check(Oe(i,r)),t.min=(i,r)=>t.check(Oe(i,r)),t.lt=(i,r)=>t.check(dt(i,r)),t.lte=(i,r)=>t.check(Ze(i,r)),t.max=(i,r)=>t.check(Ze(i,r)),t.positive=i=>t.check(ht(BigInt(0),i)),t.negative=i=>t.check(dt(BigInt(0),i)),t.nonpositive=i=>t.check(Ze(BigInt(0),i)),t.nonnegative=i=>t.check(Oe(BigInt(0),i)),t.multipleOf=(i,r)=>t.check(jt(i,r));let n=t._zod.bag;t.minValue=n.minimum??null,t.maxValue=n.maximum??null,t.format=n.format??null});aa=m("ZodBigIntFormat",(t,e)=>{Jl.init(t,e),yn.init(t,e)});Af=m("ZodSymbol",(t,e)=>{Kl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Th(t,n,i,r)});Of=m("ZodUndefined",(t,e)=>{Yl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Oh(t,n,i,r)});Pf=m("ZodNull",(t,e)=>{Xl.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ah(t,n,i,r)});Rf=m("ZodAny",(t,e)=>{Ql.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Rh(t,n,i,r)});Df=m("ZodUnknown",(t,e)=>{ed.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Dh(t,n,i,r)});Nf=m("ZodNever",(t,e)=>{td.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ch(t,n,i,r)});zf=m("ZodVoid",(t,e)=>{rd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ph(t,n,i,r)});Ii=m("ZodDate",(t,e)=>{nd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(i,r,o)=>Nh(t,i,r,o),t.min=(i,r)=>t.check(Oe(i,r)),t.max=(i,r)=>t.check(Ze(i,r));let n=t._zod.bag;t.minDate=n.minimum?new Date(n.minimum):null,t.maxDate=n.maximum?new Date(n.maximum):null});Lf=m("ZodArray",(t,e)=>{id.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Hh(t,n,i,r),t.element=e.element,Si(t,"ZodArray",{min(n,i){return this.check(xt(n,i))},nonempty(n){return this.check(xt(1,n))},max(n,i){return this.check(fr(n,i))},length(n,i){return this.check(pr(n,i))},unwrap(){return this.element}})});Ti=m("ZodObject",(t,e)=>{od.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>qh(t,n,i,r),w.defineLazy(t,"shape",()=>e.shape),Si(t,"ZodObject",{keyof(){return la(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:mr()})},loose(){return this.clone({...this._zod.def,catchall:mr()})},strict(){return this.clone({...this._zod.def,catchall:ca()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return w.extend(this,n)},safeExtend(n){return w.safeExtend(this,n)},merge(n){return w.merge(this,n)},pick(n){return w.pick(this,n)},omit(n){return w.omit(this,n)},partial(...n){return w.partial(ha,this,n[0])},required(...n){return w.required(fa,this,n[0])}})});Ai=m("ZodUnion",(t,e)=>{ci.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Cs(t,n,i,r),t.options=e.options});Uf=m("ZodXor",(t,e)=>{Ai.init(t,e),sd.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Cs(t,n,i,r),t.options=e.options});Mf=m("ZodDiscriminatedUnion",(t,e)=>{Ai.init(t,e),ad.init(t,e)});jf=m("ZodIntersection",(t,e)=>{cd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Jh(t,n,i,r)});Vf=m("ZodTuple",(t,e)=>{Xo.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Kh(t,n,i,r),t.rest=n=>t.clone({...t._zod.def,rest:n})});hn=m("ZodRecord",(t,e)=>{ud.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Yh(t,n,i,r),t.keyType=e.keyType,t.valueType=e.valueType});Gf=m("ZodMap",(t,e)=>{ld.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Gh(t,n,i,r),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...n)=>t.check(ft(...n)),t.nonempty=n=>t.check(ft(1,n)),t.max=(...n)=>t.check(Ft(...n)),t.size=(...n)=>t.check(hr(...n))});Wf=m("ZodSet",(t,e)=>{dd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Wh(t,n,i,r),t.min=(...n)=>t.check(ft(...n)),t.nonempty=n=>t.check(ft(1,n)),t.max=(...n)=>t.check(Ft(...n)),t.size=(...n)=>t.check(hr(...n))});fn=m("ZodEnum",(t,e)=>{hd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(i,r,o)=>zh(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 fn({...e,checks:[],...w.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 fn({...e,checks:[],...w.normalizeParams(r),entries:o})}});Hf=m("ZodLiteral",(t,e)=>{fd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Lh(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]}})});qf=m("ZodFile",(t,e)=>{pd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>jh(t,n,i,r),t.min=(n,i)=>t.check(ft(n,i)),t.max=(n,i)=>t.check(Ft(n,i)),t.mime=(n,i)=>t.check(rn(Array.isArray(n)?n:[n],i))});Jf=m("ZodTransform",(t,e)=>{md.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Bh(t,n,i,r),t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new Nt(t.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(w.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(w.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)}});ha=m("ZodOptional",(t,e)=>{Qo.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Rs(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});Kf=m("ZodExactOptional",(t,e)=>{gd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Rs(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});Xf=m("ZodNullable",(t,e)=>{vd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Xh(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});Qf=m("ZodDefault",(t,e)=>{yd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>ef(t,n,i,r),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});tp=m("ZodPrefault",(t,e)=>{_d.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>tf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});fa=m("ZodNonOptional",(t,e)=>{bd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Qh(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});ip=m("ZodSuccess",(t,e)=>{$d.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Fh(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});op=m("ZodCatch",(t,e)=>{xd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>rf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});ap=m("ZodNaN",(t,e)=>{wd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Uh(t,n,i,r)});Oi=m("ZodPipe",(t,e)=>{es.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>nf(t,n,i,r),t.in=e.in,t.out=e.out});Pi=m("ZodCodec",(t,e)=>{Oi.init(t,e),ui.init(t,e)});cp=m("ZodPreprocess",(t,e)=>{Oi.init(t,e),Sd.init(t,e)}),up=m("ZodReadonly",(t,e)=>{Ed.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>of(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});dp=m("ZodTemplateLiteral",(t,e)=>{Id.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Mh(t,n,i,r)});hp=m("ZodLazy",(t,e)=>{Ad.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>af(t,n,i,r),t.unwrap=()=>t._zod.def.getter()});pp=m("ZodPromise",(t,e)=>{Td.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>sf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});mp=m("ZodFunction",(t,e)=>{kd.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Zh(t,n,i,r)});Ci=m("ZodCustom",(t,e)=>{Od.init(t,e),j.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Vh(t,n,i,r)});Yb=bh,Xb=$h;e$=(...t)=>xh({Codec:Pi,Boolean:vn,String:pn},...t)});function MT(t){oe({customError:t})}function jT(){return oe().customError}var UT,yp,n$=g(()=>{Be();UT={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};yp||(yp={})});function VT(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 ZT(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 i$(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return k.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 k.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=ZT(r,e),s=Se(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 k.null();if(r.length===0)return k.never();if(r.length===1)return k.literal(r[0]);if(r.every(s=>typeof s=="string"))return k.enum(r);let o=r.map(s=>k.literal(s));return o.length<2?o[0]:k.union([o[0],o[1],...o.slice(2)])}if(t.const!==void 0)return k.literal(t.const);let n=t.type;if(Array.isArray(n)){let r=n.map(o=>{let s={...t,type:o};return i$(s,e)});return r.length===0?k.never():r.length===1?r[0]:k.union(r)}if(!n)return k.any();let i;switch(n){case"string":{let r=k.string();if(t.format){let o=t.format;o==="email"?r=r.check(k.email()):o==="uri"||o==="uri-reference"?r=r.check(k.url()):o==="uuid"||o==="guid"?r=r.check(k.uuid()):o==="date-time"?r=r.check(k.iso.datetime()):o==="date"?r=r.check(k.iso.date()):o==="time"?r=r.check(k.iso.time()):o==="duration"?r=r.check(k.iso.duration()):o==="ipv4"?r=r.check(k.ipv4()):o==="ipv6"?r=r.check(k.ipv6()):o==="mac"?r=r.check(k.mac()):o==="cidr"?r=r.check(k.cidrv4()):o==="cidr-v6"?r=r.check(k.cidrv6()):o==="base64"?r=r.check(k.base64()):o==="base64url"?r=r.check(k.base64url()):o==="e164"?r=r.check(k.e164()):o==="jwt"?r=r.check(k.jwt()):o==="emoji"?r=r.check(k.emoji()):o==="nanoid"?r=r.check(k.nanoid()):o==="cuid"?r=r.check(k.cuid()):o==="cuid2"?r=r.check(k.cuid2()):o==="ulid"?r=r.check(k.ulid()):o==="xid"?r=r.check(k.xid()):o==="ksuid"&&(r=r.check(k.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"?k.number().int():k.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=k.boolean();break}case"null":{i=k.null();break}case"object":{let r={},o=t.properties||{},s=new Set(t.required||[]);for(let[c,u]of Object.entries(o)){let l=Se(u,e);r[c]=s.has(c)?l:l.optional()}if(t.propertyNames){let c=Se(t.propertyNames,e),u=t.additionalProperties&&typeof t.additionalProperties=="object"?Se(t.additionalProperties,e):k.any();if(Object.keys(r).length===0){i=k.record(c,u);break}let l=k.object(r).passthrough(),d=k.looseRecord(c,u);i=k.intersection(l,d);break}if(t.patternProperties){let c=t.patternProperties,u=Object.keys(c),l=[];for(let h of u){let f=Se(c[h],e),p=k.string().regex(new RegExp(h));l.push(k.looseRecord(p,f))}let d=[];if(Object.keys(r).length>0&&d.push(k.object(r).passthrough()),d.push(...l),d.length===0)i=k.object({}).passthrough();else if(d.length===1)i=d[0];else{let h=k.intersection(d[0],d[1]);for(let f=2;f<d.length;f++)h=k.intersection(h,d[f]);i=h}break}let a=k.object(r);t.additionalProperties===!1?i=a.strict():typeof t.additionalProperties=="object"?i=a.catchall(Se(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=>Se(c,e)),a=o&&typeof o=="object"&&!Array.isArray(o)?Se(o,e):void 0;a?i=k.tuple(s).rest(a):i=k.tuple(s),typeof t.minItems=="number"&&(i=i.check(k.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(k.maxLength(t.maxItems)))}else if(Array.isArray(o)){let s=o.map(c=>Se(c,e)),a=t.additionalItems&&typeof t.additionalItems=="object"?Se(t.additionalItems,e):void 0;a?i=k.tuple(s).rest(a):i=k.tuple(s),typeof t.minItems=="number"&&(i=i.check(k.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(k.maxLength(t.maxItems)))}else if(o!==void 0){let s=Se(o,e),a=k.array(s);typeof t.minItems=="number"&&(a=a.min(t.minItems)),typeof t.maxItems=="number"&&(a=a.max(t.maxItems)),i=a}else i=k.array(k.any());break}default:throw new Error(`Unsupported type: ${n}`)}return i}function Se(t,e){if(typeof t=="boolean")return t?k.any():k.never();let n=i$(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=>Se(u,e)),c=k.union(a);n=i?k.intersection(n,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let a=t.oneOf.map(u=>Se(u,e)),c=k.xor(a);n=i?k.intersection(n,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)n=i?n:k.any();else{let a=i?n:Se(t.allOf[0],e),c=i?0:1;for(let u=c;u<t.allOf.length;u++)a=k.intersection(a,Se(t.allOf[u],e));n=a}t.nullable===!0&&e.version==="openapi-3.0"&&(n=k.nullable(n)),t.readOnly===!0&&(n=k.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))FT.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 o$(t,e){if(typeof t=="boolean")return t?k.any():k.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=VT(n,e?.defaultTarget),r=n.$defs||n.definitions||{},o={version:i,defs:r,refs:new Map,processing:new Set,rootSchema:n,registry:e?.registry??ye};return Se(n,o)}var k,FT,s$=g(()=>{hi();Ls();vi();_i();k={...yi,...zs,iso:dn},FT=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 _p={};qe(_p,{bigint:()=>HT,boolean:()=>WT,date:()=>qT,number:()=>GT,string:()=>BT});function BT(t){return Md(pn,t)}function GT(t){return Hd(gn,t)}function WT(t){return eh(vn,t)}function HT(t){return rh(yn,t)}function qT(t){return fh(Ii,t)}var a$=g(()=>{Be();_i()});var de={};qe(de,{$brand:()=>au,$input:()=>Ld,$output:()=>zd,NEVER:()=>su,TimePrecision:()=>Fd,ZodAny:()=>Rf,ZodArray:()=>Lf,ZodBase64:()=>na,ZodBase64URL:()=>ia,ZodBigInt:()=>yn,ZodBigIntFormat:()=>aa,ZodBoolean:()=>vn,ZodCIDRv4:()=>ta,ZodCIDRv6:()=>ra,ZodCUID:()=>qs,ZodCUID2:()=>Js,ZodCatch:()=>op,ZodCodec:()=>Pi,ZodCustom:()=>Ci,ZodCustomStringFormat:()=>mn,ZodDate:()=>Ii,ZodDefault:()=>Qf,ZodDiscriminatedUnion:()=>Mf,ZodE164:()=>oa,ZodEmail:()=>Gs,ZodEmoji:()=>Ws,ZodEnum:()=>fn,ZodError:()=>zT,ZodExactOptional:()=>Kf,ZodFile:()=>qf,ZodFirstPartyTypeKind:()=>yp,ZodFunction:()=>mp,ZodGUID:()=>$i,ZodIPv4:()=>Qs,ZodIPv6:()=>ea,ZodISODate:()=>Ms,ZodISODateTime:()=>Us,ZodISODuration:()=>Fs,ZodISOTime:()=>js,ZodIntersection:()=>jf,ZodIssueCode:()=>UT,ZodJWT:()=>sa,ZodKSUID:()=>Xs,ZodLazy:()=>hp,ZodLiteral:()=>Hf,ZodMAC:()=>If,ZodMap:()=>Gf,ZodNaN:()=>ap,ZodNanoID:()=>Hs,ZodNever:()=>Nf,ZodNonOptional:()=>fa,ZodNull:()=>Pf,ZodNullable:()=>Xf,ZodNumber:()=>gn,ZodNumberFormat:()=>gr,ZodObject:()=>Ti,ZodOptional:()=>ha,ZodPipe:()=>Oi,ZodPrefault:()=>tp,ZodPreprocess:()=>cp,ZodPromise:()=>pp,ZodReadonly:()=>up,ZodRealError:()=>Le,ZodRecord:()=>hn,ZodSet:()=>Wf,ZodString:()=>pn,ZodStringFormat:()=>J,ZodSuccess:()=>ip,ZodSymbol:()=>Af,ZodTemplateLiteral:()=>dp,ZodTransform:()=>Jf,ZodTuple:()=>Vf,ZodType:()=>j,ZodULID:()=>Ks,ZodURL:()=>Ei,ZodUUID:()=>pt,ZodUndefined:()=>Of,ZodUnion:()=>Ai,ZodUnknown:()=>Df,ZodVoid:()=>zf,ZodXID:()=>Ys,ZodXor:()=>Uf,_ZodString:()=>Bs,_default:()=>ep,_function:()=>qb,any:()=>Eb,array:()=>ki,base64:()=>cb,base64url:()=>ub,bigint:()=>bb,boolean:()=>Tf,catch:()=>sp,check:()=>Jb,cidrv4:()=>sb,cidrv6:()=>ab,clone:()=>Te,codec:()=>Bb,coerce:()=>_p,config:()=>oe,core:()=>wt,cuid:()=>X_,cuid2:()=>Q_,custom:()=>Kb,date:()=>kb,decode:()=>yf,decodeAsync:()=>bf,describe:()=>Yb,discriminatedUnion:()=>Rb,e164:()=>lb,email:()=>V_,emoji:()=>K_,encode:()=>vf,encodeAsync:()=>_f,endsWith:()=>tn,enum:()=>la,exactOptional:()=>Yf,file:()=>jb,flattenError:()=>ri,float32:()=>gb,float64:()=>vb,formatError:()=>ni,fromJSONSchema:()=>o$,function:()=>qb,getErrorMap:()=>jT,globalRegistry:()=>ye,gt:()=>ht,gte:()=>Oe,guid:()=>Z_,hash:()=>mb,hex:()=>pb,hostname:()=>fb,httpUrl:()=>J_,includes:()=>Qr,instanceof:()=>Qb,int:()=>Vs,int32:()=>yb,int64:()=>$b,intersection:()=>Ff,invertCodec:()=>Gb,ipv4:()=>nb,ipv6:()=>ob,iso:()=>dn,json:()=>t$,jwt:()=>db,keyof:()=>Tb,ksuid:()=>rb,lazy:()=>fp,length:()=>pr,literal:()=>Mb,locales:()=>di,looseObject:()=>Pb,looseRecord:()=>Nb,lowercase:()=>Yr,lt:()=>dt,lte:()=>Ze,mac:()=>ib,map:()=>zb,maxLength:()=>fr,maxSize:()=>Ft,meta:()=>Xb,mime:()=>rn,minLength:()=>xt,minSize:()=>ft,multipleOf:()=>jt,nan:()=>Zb,nanoid:()=>Y_,nativeEnum:()=>Ub,negative:()=>ks,never:()=>ca,nonnegative:()=>As,nonoptional:()=>np,nonpositive:()=>Ts,normalize:()=>nn,null:()=>Cf,nullable:()=>wi,nullish:()=>Fb,number:()=>kf,object:()=>Ab,optional:()=>xi,overwrite:()=>at,parse:()=>ff,parseAsync:()=>pf,partialRecord:()=>Db,pipe:()=>Zs,positive:()=>Is,prefault:()=>rp,preprocess:()=>r$,prettifyError:()=>bu,promise:()=>Hb,property:()=>Os,readonly:()=>lp,record:()=>Bf,refine:()=>gp,regex:()=>Kr,regexes:()=>Ve,registry:()=>os,safeDecode:()=>xf,safeDecodeAsync:()=>Sf,safeEncode:()=>$f,safeEncodeAsync:()=>wf,safeParse:()=>mf,safeParseAsync:()=>gf,set:()=>Lb,setErrorMap:()=>MT,size:()=>hr,slugify:()=>cn,startsWith:()=>en,strictObject:()=>Ob,string:()=>bi,stringFormat:()=>hb,stringbool:()=>e$,success:()=>Vb,superRefine:()=>vp,symbol:()=>wb,templateLiteral:()=>Wb,toJSONSchema:()=>Ds,toLowerCase:()=>sn,toUpperCase:()=>an,transform:()=>da,treeifyError:()=>_u,trim:()=>on,tuple:()=>Zf,uint32:()=>_b,uint64:()=>xb,ulid:()=>eb,undefined:()=>Sb,union:()=>ua,unknown:()=>mr,uppercase:()=>Xr,url:()=>q_,util:()=>w,uuid:()=>B_,uuidv4:()=>G_,uuidv6:()=>W_,uuidv7:()=>H_,void:()=>Ib,xid:()=>tb,xor:()=>Cb});var bp=g(()=>{Be();_i();Ls();hf();Ef();n$();Be();Cd();Be();gi();s$();Nd();vi();vi();a$();oe(ts())});var c$=g(()=>{bp();bp()});function XT(t){try{return new URL(t)}catch{return null}}var JT,KT,YT,pa,vr,u$=g(()=>{"use strict";c$();JT=de.enum(["debug","info","warn","error"]),KT=["ws:","wss:","http:","https:"],YT=de.string().superRefine((t,e)=>{let n=XT(t);if(n===null){e.addIssue({code:"custom",message:"must be a valid ws://, wss://, http:// or https:// URL"});return}KT.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"})});pa=de.object({provider:de.string(),model:de.string(),gateway:de.string().nullable().optional(),url:YT.optional(),voiceId:de.string().min(1).optional()}),vr=de.object({version:de.number().default(1),routes:de.object({stt:pa.optional(),tts:pa.optional(),text:pa.optional(),embedding:pa.optional()}).optional(),secrets:de.record(de.string(),de.string()).optional(),defaults:de.object({logLevel:JT.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";sv();av();ou();u$()});import{mkdirSync as QT}from"node:fs";import{homedir as eA}from"node:os";import{join as l$,resolve as tA}from"node:path";var $p,Ge,yr=g(()=>{"use strict";ou();$p=class{dirName=".jarvis";dir(){let e=process.env[cv]?.trim();return e?tA(e):l$(eA(),this.dirName)}resolve(...e){return l$(this.dir(),...e)}ensureDir(){let e=this.dir();return QT(e,{recursive:!0,mode:448}),e}},Ge=new $p});import{chmodSync as rA,existsSync as nA,readFileSync as iA,writeFileSync as oA}from"node:fs";function h$(t){switch(t){case"debug":case"info":case"warn":case"error":return t;default:return}}var d$,_r,xp=g(()=>{"use strict";he();yr();d$="config.json",_r=class t{home;config;constructor(e=Ge){this.home=e,this.config=this.load()}configPath(){return this.home.resolve(d$)}load(){let e=this.configPath(),n=nA(e)?this.readFile(e):{},i=vr.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=iA(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 h$(process.env.JARVIS_LOG_LEVEL)??h$(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=vr.parse(n);e.ensureDir();let r=e.resolve(d$);oA(r,JSON.stringify(i,null,2)+`
68
- `,{mode:384}),rA(r,384)}}});function f$(t,e){let n=t;for(let i of e){if(n===null||typeof n!="object")return;n=n[i]}return n}function dA(t,e,n){let i=t;for(let r=0;r<e.length-1;r++){let o=e[r],s=i[o];(s===null||typeof s!="object")&&(i[o]={}),i=i[o]}i[e[e.length-1]]=n}function hA(t,e){let n=t;for(let r=0;r<e.length-1;r++){let o=n[e[r]];if(o===null||typeof o!="object")return!1;n=o}let i=e[e.length-1];return i in n?(delete n[i],!0):!1}var sA,aA,cA,uA,lA,We,wp=g(()=>{"use strict";he();yr();xp();sA="<set>",aA=new Set(["upgrade.auto"]),cA=new Set(["version"]),uA=["url","voiceId"],lA=new Set(["__proto__","prototype","constructor"]),We=class{home;constructor(e=Ge){this.home=e}freshResolver(){return new _r(this.home)}resolved(){return this.freshResolver().resolved()}list(){return this.redact(this.freshResolver().resolved())}get(e){return f$(this.list(),this.parsePath(e))}set(e,n){let i=this.parsePath(e);this.assertMutable(e);let r=this.freshResolver(),o=structuredClone(r.resolved()),s=this.coerce(e,n);this.dropProviderScopedOnSwitch(o,i,s),dA(o,i,s),r.save(this.validate(o,e))}unset(e){let n=this.parsePath(e);this.assertMutable(e);let i=this.freshResolver(),r=structuredClone(i.resolved());if(!hA(r,n))throw new Error(`nothing to unset: '${e}' is not set`);i.save(this.validate(r,e))}write(e){_r.persist(this.home,e)}validate(e,n){let i=vr.safeParse(e);if(i.success)return i.data;let r=i.error.issues.map(s=>`${s.path.join(".")}: ${s.message}`).join("; "),o=n.startsWith("routes.")?" A route needs both a provider and a model - run 'jarvis init' to configure one.":"";throw new Error(`'${n}' would make the config invalid (${r}).${o}`)}coerce(e,n){if(aA.has(e)){if(n==="true")return!0;if(n==="false")return!1;throw new Error(`'${e}' expects 'true' or 'false', got '${n}'`)}return n}dropProviderScopedOnSwitch(e,n,i){if(n.length!==3||n[0]!=="routes"||n[2]!=="provider")return;let r=f$(e,n.slice(0,2));if(r===null||typeof r!="object")return;let o=r;if(o.provider!==i)for(let s of uA)delete o[s]}assertMutable(e){if(cA.has(e))throw new Error(`'${e}' is managed by Jarvis and cannot be changed`)}parsePath(e){let n=e.split(".");if(e.length===0||n.some(i=>i.length===0||lA.has(i)))throw new Error(`invalid config path: '${e}'`);return n}redact(e){let n=structuredClone(e);if(n.secrets)for(let i of Object.keys(n.secrets))n.secrets[i]=sA;return n}}});async function*m$(t,e={}){let{signal:n,idleTimeoutMs:i}=e,r=t.getReader(),o=new TextDecoder,s="",a=[];try{for(;;){let{value:c,done:u}=await fA(r,n,i);if(u)break;s+=o.decode(c,{stream:!0});let l;for(;(l=s.indexOf(`
67
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of t.seen.entries()){let a=s[1];if(e===s[0]){o(s);continue}if(t.external){let 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 Wt(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:mn(e,"input",t.processors),output:mn(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Pe(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 Pe(i.element,n);if(i.type==="set")return Pe(i.valueType,n);if(i.type==="lazy")return Pe(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 Pe(i.innerType,n);if(i.type==="intersection")return Pe(i.left,n)||Pe(i.right,n);if(i.type==="record"||i.type==="map")return Pe(i.keyType,n)||Pe(i.valueType,n);if(i.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Pe(i.in,n)||Pe(i.out,n);if(i.type==="object"){for(let r in i.shape)if(Pe(i.shape[r],n))return!0;return!1}if(i.type==="union"){for(let r of i.options)if(Pe(r,n))return!0;return!1}if(i.type==="tuple"){for(let r of i.items)if(Pe(r,n))return!0;return!!(i.rest&&Pe(i.rest,n))}return!1}var kh,mn,yi=g(()=>{mi();kh=(t,e={})=>n=>{let i=Bt({...n,processors:e});return W(t,i),Gt(i,t),Wt(i,t)},mn=(t,e,n={})=>i=>{let{libraryOptions:r,target:o}=i??{},s=Bt({...r??{},target:o,io:e,processors:n});return W(t,s),Gt(s,t),Wt(s,t)}});function Ms(t,e){if("_idmap"in t){let i=t,r=Bt({...e,processors:Ns}),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;Gt(r,l),s[u]=Wt(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=Bt({...e,processors:Ns});return W(t,n),Gt(n,t),Wt(n,t)}var ZT,Th,Ah,Oh,Ph,Ch,Rh,Nh,Dh,Lh,Mh,zh,Uh,jh,Fh,Vh,Zh,Bh,Gh,Wh,Hh,qh,Jh,Kh,Yh,Xh,Ds,Qh,ef,tf,rf,nf,of,sf,af,cf,uf,lf,Ls,df,Ns,_i=g(()=>{yi();D();ZT={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Th=(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=ZT[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}))])}},Ah=(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)},Oh=(t,e,n,i)=>{n.type="boolean"},Ph=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Ch=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Rh=(t,e,n,i)=>{e.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},Nh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Dh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Lh=(t,e,n,i)=>{n.not={}},Mh=(t,e,n,i)=>{},zh=(t,e,n,i)=>{},Uh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},jh=(t,e,n,i)=>{let r=t._zod.def,o=Qn(r.entries);o.every(s=>typeof s=="number")&&(n.type="number"),o.every(s=>typeof s=="string")&&(n.type="string"),n.enum=o},Fh=(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},Vh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Zh=(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},Bh=(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)},Gh=(t,e,n,i)=>{n.type="boolean"},Wh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Hh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},qh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Jh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Kh=(t,e,n,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Yh=(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"]})},Xh=(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)},Ds=(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},Qh=(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},ef=(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)},tf=(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)}},rf=(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"}]},nf=(t,e,n,i)=>{let r=t._zod.def;W(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},of=(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))},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,e.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},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;let s;try{s=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s},cf=(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},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,n.readOnly=!0},lf=(t,e,n,i)=>{let r=t._zod.def;W(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},Ls=(t,e,n,i)=>{let r=t._zod.def;W(r.innerType,e,i);let o=e.seen.get(t);o.ref=r.innerType},df=(t,e,n,i)=>{let r=t._zod.innerType;W(r,e,i);let o=e.seen.get(t);o.ref=r},Ns={string:Th,number:Ah,boolean:Oh,bigint:Ph,symbol:Ch,null:Rh,undefined:Nh,void:Dh,never:Lh,any:Mh,unknown:zh,date:Uh,enum:jh,literal:Fh,nan:Vh,template_literal:Zh,file:Bh,success:Gh,custom:Wh,function:Hh,transform:qh,map:Jh,set:Kh,array:Yh,object:Xh,union:Ds,intersection:Qh,tuple:ef,record:tf,nullable:rf,nonoptional:nf,default:of,prefault:sf,catch:af,pipe:cf,readonly:uf,promise:lf,optional:Ls,lazy:df}});var zs,j_=g(()=>{_i();yi();zs=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=Bt({processors:Ns,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)),Gt(this.ctx,e);let i=Wt(this.ctx,e),{"~standard":r,...o}=i;return o}}});var F_={};var V_=g(()=>{});var St={};qe(St,{$ZodAny:()=>nd,$ZodArray:()=>cd,$ZodAsyncError:()=>st,$ZodBase64:()=>Hl,$ZodBase64URL:()=>ql,$ZodBigInt:()=>es,$ZodBigIntFormat:()=>Ql,$ZodBoolean:()=>li,$ZodCIDRv4:()=>Bl,$ZodCIDRv6:()=>Gl,$ZodCUID:()=>Cl,$ZodCUID2:()=>Rl,$ZodCatch:()=>Id,$ZodCheck:()=>X,$ZodCheckBigIntFormat:()=>sl,$ZodCheckEndsWith:()=>yl,$ZodCheckGreaterThan:()=>Ho,$ZodCheckIncludes:()=>gl,$ZodCheckLengthEquals:()=>hl,$ZodCheckLessThan:()=>Wo,$ZodCheckLowerCase:()=>pl,$ZodCheckMaxLength:()=>ll,$ZodCheckMaxSize:()=>al,$ZodCheckMimeType:()=>bl,$ZodCheckMinLength:()=>dl,$ZodCheckMinSize:()=>cl,$ZodCheckMultipleOf:()=>il,$ZodCheckNumberFormat:()=>ol,$ZodCheckOverwrite:()=>$l,$ZodCheckProperty:()=>_l,$ZodCheckRegex:()=>fl,$ZodCheckSizeEquals:()=>ul,$ZodCheckStartsWith:()=>vl,$ZodCheckStringFormat:()=>Qr,$ZodCheckUpperCase:()=>ml,$ZodCodec:()=>hi,$ZodCustom:()=>Nd,$ZodCustomStringFormat:()=>Yl,$ZodDate:()=>ad,$ZodDefault:()=>xd,$ZodDiscriminatedUnion:()=>dd,$ZodE164:()=>Jl,$ZodEmail:()=>Tl,$ZodEmoji:()=>Ol,$ZodEncodeError:()=>Mt,$ZodEnum:()=>gd,$ZodError:()=>ii,$ZodExactOptional:()=>bd,$ZodFile:()=>yd,$ZodFunction:()=>Pd,$ZodGUID:()=>Il,$ZodIPv4:()=>Fl,$ZodIPv6:()=>Vl,$ZodISODate:()=>zl,$ZodISODateTime:()=>Ml,$ZodISODuration:()=>jl,$ZodISOTime:()=>Ul,$ZodIntersection:()=>hd,$ZodJWT:()=>Kl,$ZodKSUID:()=>Ll,$ZodLazy:()=>Rd,$ZodLiteral:()=>vd,$ZodMAC:()=>Zl,$ZodMap:()=>pd,$ZodNaN:()=>kd,$ZodNanoID:()=>Pl,$ZodNever:()=>od,$ZodNonOptional:()=>Sd,$ZodNull:()=>rd,$ZodNullable:()=>$d,$ZodNumber:()=>Qo,$ZodNumberFormat:()=>Xl,$ZodObject:()=>Vv,$ZodObjectJIT:()=>ud,$ZodOptional:()=>rs,$ZodPipe:()=>ns,$ZodPrefault:()=>wd,$ZodPreprocess:()=>Td,$ZodPromise:()=>Cd,$ZodReadonly:()=>Ad,$ZodRealError:()=>Le,$ZodRecord:()=>fd,$ZodRegistry:()=>as,$ZodSet:()=>md,$ZodString:()=>pr,$ZodStringFormat:()=>q,$ZodSuccess:()=>Ed,$ZodSymbol:()=>ed,$ZodTemplateLiteral:()=>Od,$ZodTransform:()=>_d,$ZodTuple:()=>ts,$ZodType:()=>M,$ZodULID:()=>Nl,$ZodURL:()=>Al,$ZodUUID:()=>kl,$ZodUndefined:()=>td,$ZodUnion:()=>di,$ZodUnknown:()=>id,$ZodVoid:()=>sd,$ZodXID:()=>Dl,$ZodXor:()=>ld,$brand:()=>du,$constructor:()=>m,$input:()=>Fd,$output:()=>jd,Doc:()=>ui,JSONSchema:()=>F_,JSONSchemaGenerator:()=>zs,NEVER:()=>lu,TimePrecision:()=>Gd,_any:()=>hh,_array:()=>_h,_base64:()=>Es,_base64url:()=>Is,_bigint:()=>oh,_boolean:()=>nh,_catch:()=>MT,_check:()=>z_,_cidrv4:()=>ws,_cidrv6:()=>Ss,_coercedBigint:()=>sh,_coercedBoolean:()=>ih,_coercedDate:()=>vh,_coercedNumber:()=>Yd,_coercedString:()=>Zd,_cuid:()=>gs,_cuid2:()=>vs,_custom:()=>$h,_date:()=>gh,_decode:()=>Lo,_decodeAsync:()=>zo,_default:()=>NT,_discriminatedUnion:()=>xT,_e164:()=>ks,_email:()=>us,_emoji:()=>ps,_encode:()=>Do,_encodeAsync:()=>Mo,_endsWith:()=>an,_enum:()=>TT,_file:()=>bh,_float32:()=>Qd,_float64:()=>eh,_gt:()=>ht,_gte:()=>Oe,_guid:()=>gi,_includes:()=>on,_int:()=>Xd,_int32:()=>th,_int64:()=>ah,_intersection:()=>wT,_ipv4:()=>$s,_ipv6:()=>xs,_isoDate:()=>Hd,_isoDateTime:()=>Wd,_isoDuration:()=>Jd,_isoTime:()=>qd,_jwt:()=>Ts,_ksuid:()=>bs,_lazy:()=>FT,_length:()=>vr,_literal:()=>OT,_lowercase:()=>rn,_lt:()=>dt,_lte:()=>Ge,_mac:()=>Bd,_map:()=>IT,_max:()=>Ge,_maxLength:()=>gr,_maxSize:()=>Zt,_mime:()=>cn,_min:()=>Oe,_minLength:()=>wt,_minSize:()=>ft,_multipleOf:()=>Vt,_nan:()=>yh,_nanoid:()=>ms,_nativeEnum:()=>AT,_negative:()=>Os,_never:()=>ph,_nonnegative:()=>Cs,_nonoptional:()=>DT,_nonpositive:()=>Ps,_normalize:()=>un,_null:()=>dh,_nullable:()=>RT,_number:()=>Kd,_optional:()=>CT,_overwrite:()=>at,_parse:()=>Jr,_parseAsync:()=>Kr,_pipe:()=>zT,_positive:()=>As,_promise:()=>VT,_property:()=>Rs,_readonly:()=>UT,_record:()=>ET,_refine:()=>xh,_regex:()=>tn,_safeDecode:()=>jo,_safeDecodeAsync:()=>Vo,_safeEncode:()=>Uo,_safeEncodeAsync:()=>Fo,_safeParse:()=>Yr,_safeParseAsync:()=>Xr,_set:()=>kT,_size:()=>mr,_slugify:()=>fn,_startsWith:()=>sn,_string:()=>Vd,_stringFormat:()=>pn,_stringbool:()=>Ih,_success:()=>LT,_superRefine:()=>wh,_symbol:()=>uh,_templateLiteral:()=>jT,_toLowerCase:()=>dn,_toUpperCase:()=>hn,_transform:()=>PT,_trim:()=>ln,_tuple:()=>ST,_uint32:()=>rh,_uint64:()=>ch,_ulid:()=>ys,_undefined:()=>lh,_union:()=>bT,_unknown:()=>fh,_uppercase:()=>nn,_url:()=>vi,_uuid:()=>ls,_uuidv4:()=>ds,_uuidv6:()=>hs,_uuidv7:()=>fs,_void:()=>mh,_xid:()=>_s,_xor:()=>$T,clone:()=>Te,config:()=>se,createStandardJSONSchemaMethod:()=>mn,createToJSONSchemaMethod:()=>kh,decode:()=>Vk,decodeAsync:()=>Bk,describe:()=>Sh,encode:()=>Fk,encodeAsync:()=>Zk,extractDefs:()=>Gt,finalize:()=>Wt,flattenError:()=>oi,formatError:()=>si,globalConfig:()=>lr,globalRegistry:()=>_e,initializeContext:()=>Bt,isValidBase64:()=>Wl,isValidBase64URL:()=>zv,isValidJWT:()=>Uv,locales:()=>pi,meta:()=>Eh,parse:()=>Ro,parseAsync:()=>No,prettifyError:()=>Su,process:()=>W,regexes:()=>Be,registry:()=>cs,safeDecode:()=>Wk,safeDecodeAsync:()=>qk,safeEncode:()=>Gk,safeEncodeAsync:()=>Hk,safeParse:()=>Iu,safeParseAsync:()=>ku,toDotPath:()=>vv,toJSONSchema:()=>Ms,treeifyError:()=>wu,util:()=>S,version:()=>wl});var We=g(()=>{dr();Tu();Eu();Dd();qo();Sl();D();Go();Ud();mi();xl();U_();yi();_i();j_();V_()});var Us={};qe(Us,{endsWith:()=>an,gt:()=>ht,gte:()=>Oe,includes:()=>on,length:()=>vr,lowercase:()=>rn,lt:()=>dt,lte:()=>Ge,maxLength:()=>gr,maxSize:()=>Zt,mime:()=>cn,minLength:()=>wt,minSize:()=>ft,multipleOf:()=>Vt,negative:()=>Os,nonnegative:()=>Cs,nonpositive:()=>Ps,normalize:()=>un,overwrite:()=>at,positive:()=>As,property:()=>Rs,regex:()=>tn,size:()=>mr,slugify:()=>fn,startsWith:()=>sn,toLowerCase:()=>dn,toUpperCase:()=>hn,trim:()=>ln,uppercase:()=>nn});var js=g(()=>{We()});var gn={};qe(gn,{ZodISODate:()=>Vs,ZodISODateTime:()=>Fs,ZodISODuration:()=>Bs,ZodISOTime:()=>Zs,date:()=>ff,datetime:()=>hf,duration:()=>mf,time:()=>pf});function hf(t){return Wd(Fs,t)}function ff(t){return Hd(Vs,t)}function pf(t){return qd(Zs,t)}function mf(t){return Jd(Bs,t)}var Fs,Vs,Zs,Bs,bi=g(()=>{We();xi();Fs=m("ZodISODateTime",(t,e)=>{Ml.init(t,e),J.init(t,e)});Vs=m("ZodISODate",(t,e)=>{zl.init(t,e),J.init(t,e)});Zs=m("ZodISOTime",(t,e)=>{Ul.init(t,e),J.init(t,e)});Bs=m("ZodISODuration",(t,e)=>{jl.init(t,e),J.init(t,e)})});var Z_,GT,Me,gf=g(()=>{We();We();D();Z_=(t,e)=>{ii.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>si(t,n)},flatten:{value:n=>oi(t,n)},addIssue:{value:n=>{t.issues.push(n),t.message=JSON.stringify(t.issues,Wr,2)}},addIssues:{value:n=>{t.issues.push(...n),t.message=JSON.stringify(t.issues,Wr,2)}},isEmpty:{get(){return t.issues.length===0}}})},GT=m("ZodError",Z_),Me=m("ZodError",Z_,{Parent:Error})});var vf,yf,_f,bf,$f,xf,wf,Sf,Ef,If,kf,Tf,Af=g(()=>{We();gf();vf=Jr(Me),yf=Kr(Me),_f=Yr(Me),bf=Xr(Me),$f=Do(Me),xf=Lo(Me),wf=Mo(Me),Sf=zo(Me),Ef=Uo(Me),If=jo(Me),kf=Fo(Me),Tf=Vo(Me)});var $i={};qe($i,{ZodAny:()=>Mf,ZodArray:()=>Ff,ZodBase64:()=>sa,ZodBase64URL:()=>aa,ZodBigInt:()=>wn,ZodBigIntFormat:()=>la,ZodBoolean:()=>xn,ZodCIDRv4:()=>ia,ZodCIDRv6:()=>oa,ZodCUID:()=>Ys,ZodCUID2:()=>Xs,ZodCatch:()=>up,ZodCodec:()=>Ni,ZodCustom:()=>Di,ZodCustomStringFormat:()=>bn,ZodDate:()=>Ai,ZodDefault:()=>np,ZodDiscriminatedUnion:()=>Zf,ZodE164:()=>ca,ZodEmail:()=>qs,ZodEmoji:()=>Js,ZodEnum:()=>yn,ZodExactOptional:()=>ep,ZodFile:()=>Xf,ZodFunction:()=>_p,ZodGUID:()=>Si,ZodIPv4:()=>ra,ZodIPv6:()=>na,ZodIntersection:()=>Bf,ZodJWT:()=>ua,ZodKSUID:()=>ta,ZodLazy:()=>gp,ZodLiteral:()=>Yf,ZodMAC:()=>Of,ZodMap:()=>Jf,ZodNaN:()=>dp,ZodNanoID:()=>Ks,ZodNever:()=>Uf,ZodNonOptional:()=>ga,ZodNull:()=>Df,ZodNullable:()=>rp,ZodNumber:()=>$n,ZodNumberFormat:()=>_r,ZodObject:()=>Pi,ZodOptional:()=>ma,ZodPipe:()=>Ri,ZodPrefault:()=>op,ZodPreprocess:()=>hp,ZodPromise:()=>yp,ZodReadonly:()=>fp,ZodRecord:()=>vn,ZodSet:()=>Kf,ZodString:()=>_n,ZodStringFormat:()=>J,ZodSuccess:()=>cp,ZodSymbol:()=>Rf,ZodTemplateLiteral:()=>mp,ZodTransform:()=>Qf,ZodTuple:()=>Wf,ZodType:()=>V,ZodULID:()=>Qs,ZodURL:()=>Ti,ZodUUID:()=>pt,ZodUndefined:()=>Nf,ZodUnion:()=>Ci,ZodUnknown:()=>zf,ZodVoid:()=>jf,ZodXID:()=>ea,ZodXor:()=>Vf,_ZodString:()=>Hs,_default:()=>ip,_function:()=>Yb,any:()=>Tb,array:()=>Oi,base64:()=>db,base64url:()=>hb,bigint:()=>wb,boolean:()=>Cf,catch:()=>lp,check:()=>Xb,cidrv4:()=>ub,cidrv6:()=>lb,codec:()=>Hb,cuid:()=>tb,cuid2:()=>rb,custom:()=>Qb,date:()=>Ob,describe:()=>e$,discriminatedUnion:()=>Lb,e164:()=>fb,email:()=>G_,emoji:()=>Q_,enum:()=>fa,exactOptional:()=>tp,file:()=>Zb,float32:()=>_b,float64:()=>bb,function:()=>Yb,guid:()=>W_,hash:()=>yb,hex:()=>vb,hostname:()=>gb,httpUrl:()=>X_,instanceof:()=>r$,int:()=>Gs,int32:()=>$b,int64:()=>Sb,intersection:()=>Gf,invertCodec:()=>qb,ipv4:()=>sb,ipv6:()=>cb,json:()=>i$,jwt:()=>pb,keyof:()=>Pb,ksuid:()=>ob,lazy:()=>vp,literal:()=>Vb,looseObject:()=>Nb,looseRecord:()=>zb,mac:()=>ab,map:()=>Ub,meta:()=>t$,nan:()=>Wb,nanoid:()=>eb,nativeEnum:()=>Fb,never:()=>da,nonoptional:()=>ap,null:()=>Lf,nullable:()=>Ii,nullish:()=>Bb,number:()=>Pf,object:()=>Cb,optional:()=>Ei,partialRecord:()=>Mb,pipe:()=>Ws,prefault:()=>sp,preprocess:()=>o$,promise:()=>Kb,readonly:()=>pp,record:()=>qf,refine:()=>bp,set:()=>jb,strictObject:()=>Rb,string:()=>wi,stringFormat:()=>mb,stringbool:()=>n$,success:()=>Gb,superRefine:()=>$p,symbol:()=>Ib,templateLiteral:()=>Jb,transform:()=>pa,tuple:()=>Hf,uint32:()=>xb,uint64:()=>Eb,ulid:()=>nb,undefined:()=>kb,union:()=>ha,unknown:()=>yr,url:()=>Y_,uuid:()=>H_,uuidv4:()=>q_,uuidv6:()=>J_,uuidv7:()=>K_,void:()=>Ab,xid:()=>ib,xor:()=>Db});function ki(t,e,n){let i=Object.getPrototypeOf(t),r=B_.get(i);if(r||(r=new Set,B_.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 wi(t){return Vd(_n,t)}function G_(t){return us(qs,t)}function W_(t){return gi(Si,t)}function H_(t){return ls(pt,t)}function q_(t){return ds(pt,t)}function J_(t){return hs(pt,t)}function K_(t){return fs(pt,t)}function Y_(t){return vi(Ti,t)}function X_(t){return vi(Ti,{protocol:Be.httpProtocol,hostname:Be.domain,...S.normalizeParams(t)})}function Q_(t){return ps(Js,t)}function eb(t){return ms(Ks,t)}function tb(t){return gs(Ys,t)}function rb(t){return vs(Xs,t)}function nb(t){return ys(Qs,t)}function ib(t){return _s(ea,t)}function ob(t){return bs(ta,t)}function sb(t){return $s(ra,t)}function ab(t){return Bd(Of,t)}function cb(t){return xs(na,t)}function ub(t){return ws(ia,t)}function lb(t){return Ss(oa,t)}function db(t){return Es(sa,t)}function hb(t){return Is(aa,t)}function fb(t){return ks(ca,t)}function pb(t){return Ts(ua,t)}function mb(t,e,n={}){return pn(bn,t,e,n)}function gb(t){return pn(bn,"hostname",Be.hostname,t)}function vb(t){return pn(bn,"hex",Be.hex,t)}function yb(t,e){let n=e?.enc??"hex",i=`${t}_${n}`,r=Be[i];if(!r)throw new Error(`Unrecognized hash format: ${i}`);return pn(bn,i,r,e)}function Pf(t){return Kd($n,t)}function Gs(t){return Xd(_r,t)}function _b(t){return Qd(_r,t)}function bb(t){return eh(_r,t)}function $b(t){return th(_r,t)}function xb(t){return rh(_r,t)}function Cf(t){return nh(xn,t)}function wb(t){return oh(wn,t)}function Sb(t){return ah(la,t)}function Eb(t){return ch(la,t)}function Ib(t){return uh(Rf,t)}function kb(t){return lh(Nf,t)}function Lf(t){return dh(Df,t)}function Tb(){return hh(Mf)}function yr(){return fh(zf)}function da(t){return ph(Uf,t)}function Ab(t){return mh(jf,t)}function Ob(t){return gh(Ai,t)}function Oi(t,e){return _h(Ff,t,e)}function Pb(t){let e=t._zod.def.shape;return fa(Object.keys(e))}function Cb(t,e){let n={type:"object",shape:t??{},...S.normalizeParams(e)};return new Pi(n)}function Rb(t,e){return new Pi({type:"object",shape:t,catchall:da(),...S.normalizeParams(e)})}function Nb(t,e){return new Pi({type:"object",shape:t,catchall:yr(),...S.normalizeParams(e)})}function ha(t,e){return new Ci({type:"union",options:t,...S.normalizeParams(e)})}function Db(t,e){return new Vf({type:"union",options:t,inclusive:!1,...S.normalizeParams(e)})}function Lb(t,e,n){return new Zf({type:"union",options:e,discriminator:t,...S.normalizeParams(n)})}function Gf(t,e){return new Bf({type:"intersection",left:t,right:e})}function Hf(t,e,n){let i=e instanceof M,r=i?n:e,o=i?e:null;return new Wf({type:"tuple",items:t,rest:o,...S.normalizeParams(r)})}function qf(t,e,n){return!e||!e._zod?new vn({type:"record",keyType:wi(),valueType:t,...S.normalizeParams(e)}):new vn({type:"record",keyType:t,valueType:e,...S.normalizeParams(n)})}function Mb(t,e,n){let i=Te(t);return i._zod.values=void 0,new vn({type:"record",keyType:i,valueType:e,...S.normalizeParams(n)})}function zb(t,e,n){return new vn({type:"record",keyType:t,valueType:e,mode:"loose",...S.normalizeParams(n)})}function Ub(t,e,n){return new Jf({type:"map",keyType:t,valueType:e,...S.normalizeParams(n)})}function jb(t,e){return new Kf({type:"set",valueType:t,...S.normalizeParams(e)})}function fa(t,e){let n=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new yn({type:"enum",entries:n,...S.normalizeParams(e)})}function Fb(t,e){return new yn({type:"enum",entries:t,...S.normalizeParams(e)})}function Vb(t,e){return new Yf({type:"literal",values:Array.isArray(t)?t:[t],...S.normalizeParams(e)})}function Zb(t){return bh(Xf,t)}function pa(t){return new Qf({type:"transform",transform:t})}function Ei(t){return new ma({type:"optional",innerType:t})}function tp(t){return new ep({type:"optional",innerType:t})}function Ii(t){return new rp({type:"nullable",innerType:t})}function Bb(t){return Ei(Ii(t))}function ip(t,e){return new np({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():S.shallowClone(e)}})}function sp(t,e){return new op({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():S.shallowClone(e)}})}function ap(t,e){return new ga({type:"nonoptional",innerType:t,...S.normalizeParams(e)})}function Gb(t){return new cp({type:"success",innerType:t})}function lp(t,e){return new up({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function Wb(t){return yh(dp,t)}function Ws(t,e){return new Ri({type:"pipe",in:t,out:e})}function Hb(t,e,n){return new Ni({type:"pipe",in:t,out:e,transform:n.decode,reverseTransform:n.encode})}function qb(t){let e=t._zod.def;return new Ni({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}function pp(t){return new fp({type:"readonly",innerType:t})}function Jb(t,e){return new mp({type:"template_literal",parts:t,...S.normalizeParams(e)})}function vp(t){return new gp({type:"lazy",getter:t})}function Kb(t){return new yp({type:"promise",innerType:t})}function Yb(t){return new _p({type:"function",input:Array.isArray(t?.input)?Hf(t?.input):t?.input??Oi(yr()),output:t?.output??yr()})}function Xb(t){let e=new X({check:"custom"});return e._zod.check=t,e}function Qb(t,e){return $h(Di,t??(()=>!0),e)}function bp(t,e={}){return xh(Di,t,e)}function $p(t,e){return wh(t,e)}function r$(t,e={}){let n=new Di({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 i$(t){let e=vp(()=>ha([wi(t),Pf(),Cf(),Lf(),Oi(e),qf(wi(),e)]));return e}function o$(t,e){return new hp({type:"pipe",in:pa(t),out:e})}var B_,V,Hs,_n,J,qs,Si,pt,Ti,Js,Ks,Ys,Xs,Qs,ea,ta,ra,Of,na,ia,oa,sa,aa,ca,ua,bn,$n,_r,xn,wn,la,Rf,Nf,Df,Mf,zf,Uf,jf,Ai,Ff,Pi,Ci,Vf,Zf,Bf,Wf,vn,Jf,Kf,yn,Yf,Xf,Qf,ma,ep,rp,np,op,ga,cp,up,dp,Ri,Ni,hp,fp,mp,gp,yp,_p,Di,e$,t$,n$,xi=g(()=>{We();We();_i();yi();js();bi();Af();B_=new WeakMap;V=m("ZodType",(t,e)=>(M.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:mn(t,"input"),output:mn(t,"output")}}),t.toJSONSchema=kh(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(n,i)=>vf(t,n,i,{callee:t.parse}),t.safeParse=(n,i)=>_f(t,n,i),t.parseAsync=async(n,i)=>yf(t,n,i,{callee:t.parseAsync}),t.safeParseAsync=async(n,i)=>bf(t,n,i),t.spa=t.safeParseAsync,t.encode=(n,i)=>$f(t,n,i),t.decode=(n,i)=>xf(t,n,i),t.encodeAsync=async(n,i)=>wf(t,n,i),t.decodeAsync=async(n,i)=>Sf(t,n,i),t.safeEncode=(n,i)=>Ef(t,n,i),t.safeDecode=(n,i)=>If(t,n,i),t.safeEncodeAsync=async(n,i)=>kf(t,n,i),t.safeDecodeAsync=async(n,i)=>Tf(t,n,i),ki(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 Te(this,n,i)},brand(){return this},register(n,i){return n.add(this,i),this},refine(n,i){return this.check(bp(n,i))},superRefine(n,i){return this.check($p(n,i))},overwrite(n){return this.check(at(n))},optional(){return Ei(this)},exactOptional(){return tp(this)},nullable(){return Ii(this)},nullish(){return Ei(Ii(this))},nonoptional(n){return ap(this,n)},array(){return Oi(this)},or(n){return ha([this,n])},and(n){return Gf(this,n)},transform(n){return Ws(this,pa(n))},default(n){return ip(this,n)},prefault(n){return sp(this,n)},catch(n){return lp(this,n)},pipe(n){return Ws(this,n)},readonly(){return pp(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)),Hs=m("_ZodString",(t,e)=>{pr.init(t,e),V.init(t,e),t._zod.processJSONSchema=(i,r,o)=>Th(t,i,r,o);let n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,ki(t,"_ZodString",{regex(...i){return this.check(tn(...i))},includes(...i){return this.check(on(...i))},startsWith(...i){return this.check(sn(...i))},endsWith(...i){return this.check(an(...i))},min(...i){return this.check(wt(...i))},max(...i){return this.check(gr(...i))},length(...i){return this.check(vr(...i))},nonempty(...i){return this.check(wt(1,...i))},lowercase(i){return this.check(rn(i))},uppercase(i){return this.check(nn(i))},trim(){return this.check(ln())},normalize(...i){return this.check(un(...i))},toLowerCase(){return this.check(dn())},toUpperCase(){return this.check(hn())},slugify(){return this.check(fn())}})}),_n=m("ZodString",(t,e)=>{pr.init(t,e),Hs.init(t,e),t.email=n=>t.check(us(qs,n)),t.url=n=>t.check(vi(Ti,n)),t.jwt=n=>t.check(Ts(ua,n)),t.emoji=n=>t.check(ps(Js,n)),t.guid=n=>t.check(gi(Si,n)),t.uuid=n=>t.check(ls(pt,n)),t.uuidv4=n=>t.check(ds(pt,n)),t.uuidv6=n=>t.check(hs(pt,n)),t.uuidv7=n=>t.check(fs(pt,n)),t.nanoid=n=>t.check(ms(Ks,n)),t.guid=n=>t.check(gi(Si,n)),t.cuid=n=>t.check(gs(Ys,n)),t.cuid2=n=>t.check(vs(Xs,n)),t.ulid=n=>t.check(ys(Qs,n)),t.base64=n=>t.check(Es(sa,n)),t.base64url=n=>t.check(Is(aa,n)),t.xid=n=>t.check(_s(ea,n)),t.ksuid=n=>t.check(bs(ta,n)),t.ipv4=n=>t.check($s(ra,n)),t.ipv6=n=>t.check(xs(na,n)),t.cidrv4=n=>t.check(ws(ia,n)),t.cidrv6=n=>t.check(Ss(oa,n)),t.e164=n=>t.check(ks(ca,n)),t.datetime=n=>t.check(hf(n)),t.date=n=>t.check(ff(n)),t.time=n=>t.check(pf(n)),t.duration=n=>t.check(mf(n))});J=m("ZodStringFormat",(t,e)=>{q.init(t,e),Hs.init(t,e)}),qs=m("ZodEmail",(t,e)=>{Tl.init(t,e),J.init(t,e)});Si=m("ZodGUID",(t,e)=>{Il.init(t,e),J.init(t,e)});pt=m("ZodUUID",(t,e)=>{kl.init(t,e),J.init(t,e)});Ti=m("ZodURL",(t,e)=>{Al.init(t,e),J.init(t,e)});Js=m("ZodEmoji",(t,e)=>{Ol.init(t,e),J.init(t,e)});Ks=m("ZodNanoID",(t,e)=>{Pl.init(t,e),J.init(t,e)});Ys=m("ZodCUID",(t,e)=>{Cl.init(t,e),J.init(t,e)});Xs=m("ZodCUID2",(t,e)=>{Rl.init(t,e),J.init(t,e)});Qs=m("ZodULID",(t,e)=>{Nl.init(t,e),J.init(t,e)});ea=m("ZodXID",(t,e)=>{Dl.init(t,e),J.init(t,e)});ta=m("ZodKSUID",(t,e)=>{Ll.init(t,e),J.init(t,e)});ra=m("ZodIPv4",(t,e)=>{Fl.init(t,e),J.init(t,e)});Of=m("ZodMAC",(t,e)=>{Zl.init(t,e),J.init(t,e)});na=m("ZodIPv6",(t,e)=>{Vl.init(t,e),J.init(t,e)});ia=m("ZodCIDRv4",(t,e)=>{Bl.init(t,e),J.init(t,e)});oa=m("ZodCIDRv6",(t,e)=>{Gl.init(t,e),J.init(t,e)});sa=m("ZodBase64",(t,e)=>{Hl.init(t,e),J.init(t,e)});aa=m("ZodBase64URL",(t,e)=>{ql.init(t,e),J.init(t,e)});ca=m("ZodE164",(t,e)=>{Jl.init(t,e),J.init(t,e)});ua=m("ZodJWT",(t,e)=>{Kl.init(t,e),J.init(t,e)});bn=m("ZodCustomStringFormat",(t,e)=>{Yl.init(t,e),J.init(t,e)});$n=m("ZodNumber",(t,e)=>{Qo.init(t,e),V.init(t,e),t._zod.processJSONSchema=(i,r,o)=>Ah(t,i,r,o),ki(t,"ZodNumber",{gt(i,r){return this.check(ht(i,r))},gte(i,r){return this.check(Oe(i,r))},min(i,r){return this.check(Oe(i,r))},lt(i,r){return this.check(dt(i,r))},lte(i,r){return this.check(Ge(i,r))},max(i,r){return this.check(Ge(i,r))},int(i){return this.check(Gs(i))},safe(i){return this.check(Gs(i))},positive(i){return this.check(ht(0,i))},nonnegative(i){return this.check(Oe(0,i))},negative(i){return this.check(dt(0,i))},nonpositive(i){return this.check(Ge(0,i))},multipleOf(i,r){return this.check(Vt(i,r))},step(i,r){return this.check(Vt(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)=>{Xl.init(t,e),$n.init(t,e)});xn=m("ZodBoolean",(t,e)=>{li.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Oh(t,n,i,r)});wn=m("ZodBigInt",(t,e)=>{es.init(t,e),V.init(t,e),t._zod.processJSONSchema=(i,r,o)=>Ph(t,i,r,o),t.gte=(i,r)=>t.check(Oe(i,r)),t.min=(i,r)=>t.check(Oe(i,r)),t.gt=(i,r)=>t.check(ht(i,r)),t.gte=(i,r)=>t.check(Oe(i,r)),t.min=(i,r)=>t.check(Oe(i,r)),t.lt=(i,r)=>t.check(dt(i,r)),t.lte=(i,r)=>t.check(Ge(i,r)),t.max=(i,r)=>t.check(Ge(i,r)),t.positive=i=>t.check(ht(BigInt(0),i)),t.negative=i=>t.check(dt(BigInt(0),i)),t.nonpositive=i=>t.check(Ge(BigInt(0),i)),t.nonnegative=i=>t.check(Oe(BigInt(0),i)),t.multipleOf=(i,r)=>t.check(Vt(i,r));let n=t._zod.bag;t.minValue=n.minimum??null,t.maxValue=n.maximum??null,t.format=n.format??null});la=m("ZodBigIntFormat",(t,e)=>{Ql.init(t,e),wn.init(t,e)});Rf=m("ZodSymbol",(t,e)=>{ed.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ch(t,n,i,r)});Nf=m("ZodUndefined",(t,e)=>{td.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Nh(t,n,i,r)});Df=m("ZodNull",(t,e)=>{rd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Rh(t,n,i,r)});Mf=m("ZodAny",(t,e)=>{nd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Mh(t,n,i,r)});zf=m("ZodUnknown",(t,e)=>{id.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>zh(t,n,i,r)});Uf=m("ZodNever",(t,e)=>{od.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Lh(t,n,i,r)});jf=m("ZodVoid",(t,e)=>{sd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Dh(t,n,i,r)});Ai=m("ZodDate",(t,e)=>{ad.init(t,e),V.init(t,e),t._zod.processJSONSchema=(i,r,o)=>Uh(t,i,r,o),t.min=(i,r)=>t.check(Oe(i,r)),t.max=(i,r)=>t.check(Ge(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});Ff=m("ZodArray",(t,e)=>{cd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Yh(t,n,i,r),t.element=e.element,ki(t,"ZodArray",{min(n,i){return this.check(wt(n,i))},nonempty(n){return this.check(wt(1,n))},max(n,i){return this.check(gr(n,i))},length(n,i){return this.check(vr(n,i))},unwrap(){return this.element}})});Pi=m("ZodObject",(t,e)=>{ud.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Xh(t,n,i,r),S.defineLazy(t,"shape",()=>e.shape),ki(t,"ZodObject",{keyof(){return fa(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:yr()})},loose(){return this.clone({...this._zod.def,catchall:yr()})},strict(){return this.clone({...this._zod.def,catchall:da()})},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(ma,this,n[0])},required(...n){return S.required(ga,this,n[0])}})});Ci=m("ZodUnion",(t,e)=>{di.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ds(t,n,i,r),t.options=e.options});Vf=m("ZodXor",(t,e)=>{Ci.init(t,e),ld.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ds(t,n,i,r),t.options=e.options});Zf=m("ZodDiscriminatedUnion",(t,e)=>{Ci.init(t,e),dd.init(t,e)});Bf=m("ZodIntersection",(t,e)=>{hd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Qh(t,n,i,r)});Wf=m("ZodTuple",(t,e)=>{ts.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>ef(t,n,i,r),t.rest=n=>t.clone({...t._zod.def,rest:n})});vn=m("ZodRecord",(t,e)=>{fd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>tf(t,n,i,r),t.keyType=e.keyType,t.valueType=e.valueType});Jf=m("ZodMap",(t,e)=>{pd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Jh(t,n,i,r),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...n)=>t.check(ft(...n)),t.nonempty=n=>t.check(ft(1,n)),t.max=(...n)=>t.check(Zt(...n)),t.size=(...n)=>t.check(mr(...n))});Kf=m("ZodSet",(t,e)=>{md.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Kh(t,n,i,r),t.min=(...n)=>t.check(ft(...n)),t.nonempty=n=>t.check(ft(1,n)),t.max=(...n)=>t.check(Zt(...n)),t.size=(...n)=>t.check(mr(...n))});yn=m("ZodEnum",(t,e)=>{gd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(i,r,o)=>jh(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 yn({...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 yn({...e,checks:[],...S.normalizeParams(r),entries:o})}});Yf=m("ZodLiteral",(t,e)=>{vd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Fh(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]}})});Xf=m("ZodFile",(t,e)=>{yd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Bh(t,n,i,r),t.min=(n,i)=>t.check(ft(n,i)),t.max=(n,i)=>t.check(Zt(n,i)),t.mime=(n,i)=>t.check(cn(Array.isArray(n)?n:[n],i))});Qf=m("ZodTransform",(t,e)=>{_d.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>qh(t,n,i,r),t._zod.parse=(n,i)=>{if(i.direction==="backward")throw new Mt(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)}});ma=m("ZodOptional",(t,e)=>{rs.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ls(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});ep=m("ZodExactOptional",(t,e)=>{bd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Ls(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});rp=m("ZodNullable",(t,e)=>{$d.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>rf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});np=m("ZodDefault",(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,t.removeDefault=t.unwrap});op=m("ZodPrefault",(t,e)=>{wd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>sf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});ga=m("ZodNonOptional",(t,e)=>{Sd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>nf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});cp=m("ZodSuccess",(t,e)=>{Ed.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Gh(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});up=m("ZodCatch",(t,e)=>{Id.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.removeCatch=t.unwrap});dp=m("ZodNaN",(t,e)=>{kd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Vh(t,n,i,r)});Ri=m("ZodPipe",(t,e)=>{ns.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>cf(t,n,i,r),t.in=e.in,t.out=e.out});Ni=m("ZodCodec",(t,e)=>{Ri.init(t,e),hi.init(t,e)});hp=m("ZodPreprocess",(t,e)=>{Ri.init(t,e),Td.init(t,e)}),fp=m("ZodReadonly",(t,e)=>{Ad.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>uf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});mp=m("ZodTemplateLiteral",(t,e)=>{Od.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Zh(t,n,i,r)});gp=m("ZodLazy",(t,e)=>{Rd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>df(t,n,i,r),t.unwrap=()=>t._zod.def.getter()});yp=m("ZodPromise",(t,e)=>{Cd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>lf(t,n,i,r),t.unwrap=()=>t._zod.def.innerType});_p=m("ZodFunction",(t,e)=>{Pd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Hh(t,n,i,r)});Di=m("ZodCustom",(t,e)=>{Nd.init(t,e),V.init(t,e),t._zod.processJSONSchema=(n,i,r)=>Wh(t,n,i,r)});e$=Sh,t$=Eh;n$=(...t)=>Ih({Codec:Ni,Boolean:xn,String:_n},...t)});function qT(t){se({customError:t})}function JT(){return se().customError}var HT,xp,s$=g(()=>{We();HT={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"};xp||(xp={})});function YT(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 XT(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 a$(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=XT(r,e),s=Se(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 a$(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=Se(u,e);r[c]=s.has(c)?l:l.optional()}if(t.propertyNames){let c=Se(t.propertyNames,e),u=t.additionalProperties&&typeof t.additionalProperties=="object"?Se(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=Se(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(Se(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=>Se(c,e)),a=o&&typeof o=="object"&&!Array.isArray(o)?Se(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=>Se(c,e)),a=t.additionalItems&&typeof t.additionalItems=="object"?Se(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=Se(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 Se(t,e){if(typeof t=="boolean")return t?T.any():T.never();let n=a$(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=>Se(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=>Se(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:Se(t.allOf[0],e),c=i?0:1;for(let u=c;u<t.allOf.length;u++)a=T.intersection(a,Se(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))KT.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 c$(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=YT(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 Se(n,o)}var T,KT,u$=g(()=>{mi();js();bi();xi();T={...$i,...Us,iso:gn},KT=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 wp={};qe(wp,{bigint:()=>rA,boolean:()=>tA,date:()=>nA,number:()=>eA,string:()=>QT});function QT(t){return Zd(_n,t)}function eA(t){return Yd($n,t)}function tA(t){return ih(xn,t)}function rA(t){return sh(wn,t)}function nA(t){return vh(Ai,t)}var l$=g(()=>{We();xi()});var de={};qe(de,{$brand:()=>du,$input:()=>Fd,$output:()=>jd,NEVER:()=>lu,TimePrecision:()=>Gd,ZodAny:()=>Mf,ZodArray:()=>Ff,ZodBase64:()=>sa,ZodBase64URL:()=>aa,ZodBigInt:()=>wn,ZodBigIntFormat:()=>la,ZodBoolean:()=>xn,ZodCIDRv4:()=>ia,ZodCIDRv6:()=>oa,ZodCUID:()=>Ys,ZodCUID2:()=>Xs,ZodCatch:()=>up,ZodCodec:()=>Ni,ZodCustom:()=>Di,ZodCustomStringFormat:()=>bn,ZodDate:()=>Ai,ZodDefault:()=>np,ZodDiscriminatedUnion:()=>Zf,ZodE164:()=>ca,ZodEmail:()=>qs,ZodEmoji:()=>Js,ZodEnum:()=>yn,ZodError:()=>GT,ZodExactOptional:()=>ep,ZodFile:()=>Xf,ZodFirstPartyTypeKind:()=>xp,ZodFunction:()=>_p,ZodGUID:()=>Si,ZodIPv4:()=>ra,ZodIPv6:()=>na,ZodISODate:()=>Vs,ZodISODateTime:()=>Fs,ZodISODuration:()=>Bs,ZodISOTime:()=>Zs,ZodIntersection:()=>Bf,ZodIssueCode:()=>HT,ZodJWT:()=>ua,ZodKSUID:()=>ta,ZodLazy:()=>gp,ZodLiteral:()=>Yf,ZodMAC:()=>Of,ZodMap:()=>Jf,ZodNaN:()=>dp,ZodNanoID:()=>Ks,ZodNever:()=>Uf,ZodNonOptional:()=>ga,ZodNull:()=>Df,ZodNullable:()=>rp,ZodNumber:()=>$n,ZodNumberFormat:()=>_r,ZodObject:()=>Pi,ZodOptional:()=>ma,ZodPipe:()=>Ri,ZodPrefault:()=>op,ZodPreprocess:()=>hp,ZodPromise:()=>yp,ZodReadonly:()=>fp,ZodRealError:()=>Me,ZodRecord:()=>vn,ZodSet:()=>Kf,ZodString:()=>_n,ZodStringFormat:()=>J,ZodSuccess:()=>cp,ZodSymbol:()=>Rf,ZodTemplateLiteral:()=>mp,ZodTransform:()=>Qf,ZodTuple:()=>Wf,ZodType:()=>V,ZodULID:()=>Qs,ZodURL:()=>Ti,ZodUUID:()=>pt,ZodUndefined:()=>Nf,ZodUnion:()=>Ci,ZodUnknown:()=>zf,ZodVoid:()=>jf,ZodXID:()=>ea,ZodXor:()=>Vf,_ZodString:()=>Hs,_default:()=>ip,_function:()=>Yb,any:()=>Tb,array:()=>Oi,base64:()=>db,base64url:()=>hb,bigint:()=>wb,boolean:()=>Cf,catch:()=>lp,check:()=>Xb,cidrv4:()=>ub,cidrv6:()=>lb,clone:()=>Te,codec:()=>Hb,coerce:()=>wp,config:()=>se,core:()=>St,cuid:()=>tb,cuid2:()=>rb,custom:()=>Qb,date:()=>Ob,decode:()=>xf,decodeAsync:()=>Sf,describe:()=>e$,discriminatedUnion:()=>Lb,e164:()=>fb,email:()=>G_,emoji:()=>Q_,encode:()=>$f,encodeAsync:()=>wf,endsWith:()=>an,enum:()=>fa,exactOptional:()=>tp,file:()=>Zb,flattenError:()=>oi,float32:()=>_b,float64:()=>bb,formatError:()=>si,fromJSONSchema:()=>c$,function:()=>Yb,getErrorMap:()=>JT,globalRegistry:()=>_e,gt:()=>ht,gte:()=>Oe,guid:()=>W_,hash:()=>yb,hex:()=>vb,hostname:()=>gb,httpUrl:()=>X_,includes:()=>on,instanceof:()=>r$,int:()=>Gs,int32:()=>$b,int64:()=>Sb,intersection:()=>Gf,invertCodec:()=>qb,ipv4:()=>sb,ipv6:()=>cb,iso:()=>gn,json:()=>i$,jwt:()=>pb,keyof:()=>Pb,ksuid:()=>ob,lazy:()=>vp,length:()=>vr,literal:()=>Vb,locales:()=>pi,looseObject:()=>Nb,looseRecord:()=>zb,lowercase:()=>rn,lt:()=>dt,lte:()=>Ge,mac:()=>ab,map:()=>Ub,maxLength:()=>gr,maxSize:()=>Zt,meta:()=>t$,mime:()=>cn,minLength:()=>wt,minSize:()=>ft,multipleOf:()=>Vt,nan:()=>Wb,nanoid:()=>eb,nativeEnum:()=>Fb,negative:()=>Os,never:()=>da,nonnegative:()=>Cs,nonoptional:()=>ap,nonpositive:()=>Ps,normalize:()=>un,null:()=>Lf,nullable:()=>Ii,nullish:()=>Bb,number:()=>Pf,object:()=>Cb,optional:()=>Ei,overwrite:()=>at,parse:()=>vf,parseAsync:()=>yf,partialRecord:()=>Mb,pipe:()=>Ws,positive:()=>As,prefault:()=>sp,preprocess:()=>o$,prettifyError:()=>Su,promise:()=>Kb,property:()=>Rs,readonly:()=>pp,record:()=>qf,refine:()=>bp,regex:()=>tn,regexes:()=>Be,registry:()=>cs,safeDecode:()=>If,safeDecodeAsync:()=>Tf,safeEncode:()=>Ef,safeEncodeAsync:()=>kf,safeParse:()=>_f,safeParseAsync:()=>bf,set:()=>jb,setErrorMap:()=>qT,size:()=>mr,slugify:()=>fn,startsWith:()=>sn,strictObject:()=>Rb,string:()=>wi,stringFormat:()=>mb,stringbool:()=>n$,success:()=>Gb,superRefine:()=>$p,symbol:()=>Ib,templateLiteral:()=>Jb,toJSONSchema:()=>Ms,toLowerCase:()=>dn,toUpperCase:()=>hn,transform:()=>pa,treeifyError:()=>wu,trim:()=>ln,tuple:()=>Hf,uint32:()=>xb,uint64:()=>Eb,ulid:()=>nb,undefined:()=>kb,union:()=>ha,unknown:()=>yr,uppercase:()=>nn,url:()=>Y_,util:()=>S,uuid:()=>H_,uuidv4:()=>q_,uuidv6:()=>J_,uuidv7:()=>K_,void:()=>Ab,xid:()=>ib,xor:()=>Db});var Sp=g(()=>{We();xi();js();gf();Af();s$();We();Ld();We();_i();u$();Ud();bi();bi();l$();se(is())});var d$=g(()=>{Sp();Sp()});function aA(t){try{return new URL(t)}catch{return null}}var iA,oA,sA,va,br,h$=g(()=>{"use strict";d$();iA=de.enum(["debug","info","warn","error"]),oA=["ws:","wss:","http:","https:"],sA=de.string().superRefine((t,e)=>{let n=aA(t);if(n===null){e.addIssue({code:"custom",message:"must be a valid ws://, wss://, http:// or https:// URL"});return}oA.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"})});va=de.object({provider:de.string(),model:de.string(),gateway:de.string().nullable().optional(),url:sA.optional(),voiceId:de.string().min(1).optional()}),br=de.object({version:de.number().default(1),routes:de.object({stt:va.optional(),tts:va.optional(),text:va.optional(),embedding:va.optional()}).optional(),secrets:de.record(de.string(),de.string()).optional(),defaults:de.object({logLevel:iA.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";uv();lv();uu();h$()});import{mkdirSync as cA}from"node:fs";import{homedir as uA}from"node:os";import{join as f$,resolve as lA}from"node:path";var Ep,ze,$r=g(()=>{"use strict";uu();Ep=class{dirName=".jarvis";dir(){let e=process.env[dv]?.trim();return e?lA(e):f$(uA(),this.dirName)}resolve(...e){return f$(this.dir(),...e)}ensureDir(){let e=this.dir();return cA(e,{recursive:!0,mode:448}),e}},ze=new Ep});import{chmodSync as dA,existsSync as hA,readFileSync as fA,writeFileSync as pA}from"node:fs";function m$(t){switch(t){case"debug":case"info":case"warn":case"error":return t;default:return}}var p$,xr,Ip=g(()=>{"use strict";he();$r();p$="config.json",xr=class t{home;config;constructor(e=ze){this.home=e,this.config=this.load()}configPath(){return this.home.resolve(p$)}load(){let e=this.configPath(),n=hA(e)?this.readFile(e):{},i=br.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=fA(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 m$(process.env.JARVIS_LOG_LEVEL)??m$(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=br.parse(n);e.ensureDir();let r=e.resolve(p$);pA(r,JSON.stringify(i,null,2)+`
68
+ `,{mode:384}),dA(r,384)}}});function g$(t,e){let n=t;for(let i of e){if(n===null||typeof n!="object")return;n=n[i]}return n}function bA(t,e,n){let i=t;for(let r=0;r<e.length-1;r++){let o=e[r],s=i[o];(s===null||typeof s!="object")&&(i[o]={}),i=i[o]}i[e[e.length-1]]=n}function $A(t,e){let n=t;for(let r=0;r<e.length-1;r++){let o=n[e[r]];if(o===null||typeof o!="object")return!1;n=o}let i=e[e.length-1];return i in n?(delete n[i],!0):!1}var mA,gA,vA,yA,_A,Ue,kp=g(()=>{"use strict";he();$r();Ip();mA="<set>",gA=new Set(["upgrade.auto"]),vA=new Set(["version"]),yA=["url","voiceId"],_A=new Set(["__proto__","prototype","constructor"]),Ue=class{home;constructor(e=ze){this.home=e}freshResolver(){return new xr(this.home)}resolved(){return this.freshResolver().resolved()}list(){return this.redact(this.freshResolver().resolved())}get(e){return g$(this.list(),this.parsePath(e))}set(e,n){let i=this.parsePath(e);this.assertMutable(e);let r=this.freshResolver(),o=structuredClone(r.resolved()),s=this.coerce(e,n);this.dropProviderScopedOnSwitch(o,i,s),bA(o,i,s),r.save(this.validate(o,e))}unset(e){let n=this.parsePath(e);this.assertMutable(e);let i=this.freshResolver(),r=structuredClone(i.resolved());if(!$A(r,n))throw new Error(`nothing to unset: '${e}' is not set`);i.save(this.validate(r,e))}write(e){xr.persist(this.home,e)}validate(e,n){let i=br.safeParse(e);if(i.success)return i.data;let r=i.error.issues.map(s=>`${s.path.join(".")}: ${s.message}`).join("; "),o=n.startsWith("routes.")?" A route needs both a provider and a model - run 'jarvis init' to configure one.":"";throw new Error(`'${n}' would make the config invalid (${r}).${o}`)}coerce(e,n){if(gA.has(e)){if(n==="true")return!0;if(n==="false")return!1;throw new Error(`'${e}' expects 'true' or 'false', got '${n}'`)}return n}dropProviderScopedOnSwitch(e,n,i){if(n.length!==3||n[0]!=="routes"||n[2]!=="provider")return;let r=g$(e,n.slice(0,2));if(r===null||typeof r!="object")return;let o=r;if(o.provider!==i)for(let s of yA)delete o[s]}assertMutable(e){if(vA.has(e))throw new Error(`'${e}' is managed by Jarvis and cannot be changed`)}parsePath(e){let n=e.split(".");if(e.length===0||n.some(i=>i.length===0||_A.has(i)))throw new Error(`invalid config path: '${e}'`);return n}redact(e){let n=structuredClone(e);if(n.secrets)for(let i of Object.keys(n.secrets))n.secrets[i]=mA;return n}}});async function*y$(t,e={}){let{signal:n,idleTimeoutMs:i}=e,r=t.getReader(),o=new TextDecoder,s="",a=[];try{for(;;){let{value:c,done:u}=await xA(r,n,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 fA(t,e,n){return e?.aborted?Promise.reject(p$(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(p$(e))),c=n!==void 0?setTimeout(()=>s(()=>r(new ma(n))),n):void 0;e?.addEventListener("abort",a,{once:!0}),t.read().then(u=>s(()=>i(u)),u=>s(()=>r(pA(u))))})}function p$(t){let e=t?.reason;return e instanceof Error?e:new Error("text stream aborted")}function pA(t){return t instanceof Error?t:new Error(String(t))}var ma,Sp=g(()=>{"use strict";ma=class extends Error{constructor(e){super(`text stream idle for ${e}ms`),this.name="IdleTimeoutError"}}});var Gt,Ep=g(()=>{"use strict";Gt=class extends Error{status;constructor(e,n){super(e),this.status=n,this.name="TextAdapterError"}}});function g$(t){try{return JSON.parse(t)}catch{return}}function _n(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0}function _A(t){return Array.isArray(t)?t:void 0}function v$(t){let e=_n(t)?.message;return typeof e=="string"?e:"unknown error"}var va,mA,gA,vA,yA,ga,Ri,Di,Ip=g(()=>{"use strict";Sp();Ep();va=3e4,mA=4096,gA="https://api.anthropic.com/v1/messages",vA="2023-06-01",yA="https://api.openai.com/v1/chat/completions",ga=class{key;fetchImpl;idleTimeoutMs;constructor(e,n=fetch,i=va){this.key=e,this.fetchImpl=n,this.idleTimeoutMs=i}async*stream(e){let{url:n,init:i}=this.buildRequest(e),r=await this.fetchImpl(n,{...i,signal:e.signal});if(!r.ok)throw new Gt(`text provider request failed (HTTP ${r.status})`,r.status);if(!r.body)throw new Gt("text provider response had no body");for await(let o of m$(r.body,{signal:e.signal,idleTimeoutMs:this.idleTimeoutMs})){if(this.isDone(o))return;let s=this.decode(o);s&&(yield s)}}},Ri=class extends ga{buildRequest(e){let n={model:e.model,max_tokens:mA,stream:!0,messages:e.messages.map(i=>({role:i.role,content:i.content})),...e.system!==void 0&&{system:e.system}};return{url:gA,init:{method:"POST",headers:{"x-api-key":this.key,"anthropic-version":vA,"content-type":"application/json"},body:JSON.stringify(n)}}}isDone(){return!1}decode(e){let n=_n(g$(e));if(!n)return null;if(n.type==="error")throw new Gt(`anthropic stream error: ${v$(n.error)}`);if(n.type==="content_block_delta"){let i=_n(n.delta);if(i?.type==="text_delta"&&typeof i.text=="string")return{type:"text",text:i.text}}return null}},Di=class extends ga{buildRequest(e){let n=e.system!==void 0?[{role:"system",content:e.system},...e.messages]:e.messages,i={model:e.model,stream:!0,messages:n};return{url:yA,init:{method:"POST",headers:{Authorization:`Bearer ${this.key}`,"content-type":"application/json"},body:JSON.stringify(i)}}}isDone(e){return e==="[DONE]"}decode(e){let n=_n(g$(e));if(!n)return null;if(n.error)throw new Gt(`openai stream error: ${v$(n.error)}`);let i=_A(n.choices),r=i?_n(i[0])?.delta:void 0,o=_n(r)?.content;return typeof o=="string"&&o.length>0?{type:"text",text:o}:null}}});var Ni,kp=g(()=>{"use strict";Ip();Ni=class{fetchImpl;idleTimeoutMs;constructor(e=fetch,n=va){this.fetchImpl=e,this.idleTimeoutMs=n}textAdapter(e,n){switch(e.provider){case"anthropic":return new Ri(n,this.fetchImpl,this.idleTimeoutMs);case"openai":return new Di(n,this.fetchImpl,this.idleTimeoutMs);default:throw new Error(`no text adapter for provider '${e.provider}'`)}}}});var Ue,y$=g(()=>{"use strict";Ue=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 _$=g(()=>{"use strict"});var zi=g(()=>{"use strict";y$();_$()});var St,Li=g(()=>{"use strict";St=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 Ye(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 bA(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 Wt,Ui,Mi,br=g(()=>{"use strict";he();Wt=.02;Ui=class{threshold;constructor(e){this.threshold=e}classify(e,n){n(Ye(e,this.threshold))}},Mi=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??Wt,this.log=n.log??U}classify(e,n){if(this.degraded){this.announce("energy (fallback)"),n(Ye(e,this.energyThreshold));return}this.vad.process(bA(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(Ye(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 Tp(t){return new Error(`openai-compat ASR decode failed (HTTP ${t})`)}function Ap(t){t.body?.cancel().catch(()=>{})}function xA(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function IA(t){return t.replace(EA," ")}function kA(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 TA(t){for(let e=0;e<t.length;e+=1){let n=t.charCodeAt(e);if(n<32||n===127)throw new Error("openai-compat ASR key contains a control character (check for a pasted trailing newline) - it cannot be sent as an HTTP header")}}function AA(t,e){let n=new Uint8Array(e),i=0;for(let r of t)n.set(r,i),i+=r.byteLength;return n}function OA(t,e){let n=new Uint8Array(44+t.byteLength),i=new DataView(n.buffer);return ya(n,0,"RIFF"),i.setUint32(4,36+t.byteLength,!0),ya(n,8,"WAVE"),ya(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),ya(n,36,"data"),i.setUint32(40,t.byteLength,!0),n.set(t,44),n}function ya(t,e,n){for(let i=0;i<n.length;i+=1)t[e+i]=n.charCodeAt(i)}function x$(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")?x$(t.cause,e+1):t.message.length>0?t.message:t.name.length>0?t.name:"network error"}var Pp,Cp,b$,$A,_a,Op,$$,wA,SA,EA,Rp=g(()=>{"use strict";he();Li();br();Pp="http://localhost:8081",Cp="large-v3-turbo",b$=1e3,$A=1e4,_a=class{fetchImpl;model;clock;id="openai-compat";partialStability="redecode";baseUrl;key;negotiation={dialect:null};constructor(e,n=Pp,i=Cp,r,o=new St){this.fetchImpl=e,this.model=i,this.clock=o,this.baseUrl=kA(n),this.key=r!==void 0&&r.length>0?r:void 0,this.key!==void 0&&TA(this.key)}open(e){return e.biasTerms!==void 0&&e.biasTerms.length>0&&U.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 Op({fetchImpl:this.fetchImpl,baseUrl:this.baseUrl,model:this.model,key:this.key,negotiation:this.negotiation,clock:this.clock},e)}},Op=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&&Ye(e,Wt)&&(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*(b$/1e3))return;let e=this.ctx.clock.now();e-this.lastDecodeAtMs<b$||(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=>{U.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=OA(AA(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=xA(s)&&typeof s.text=="string"?s.text:"";return IA(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 Ap(s),Tp(s.status);return s}let r=await this.post("standard",e,n);if(r.ok)return this.ctx.negotiation.dialect="standard",r;if(Ap(r),r.status!==404)throw Tp(r.status);let o=await this.post("inference",e,n);if(o.ok)return this.ctx.negotiation.dialect="inference",o;throw Ap(o),Tp(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: ${x$(s)}`,{cause:s})}}decodeReplyTimeoutMs(){let e=this.bufferedBytes/2/this.opts.sampleRate*1e3;return $A+Math.ceil(e)}teardown(){this.closed||(this.closed=!0,this.inFlightAbort?.abort(),this.inFlightAbort=null)}};$$=" ",wA="\r",SA=`
71
- `,EA=new RegExp(`[ ${$$}]*[${wA}${SA}]+[ ${$$}]*`,"g")});function bn(t){try{let e=JSON.parse(t);return typeof e=="object"&&e!==null?e:void 0}catch{return}}function ji(t){return typeof t=="string"?t:""}function ba(t){let e=t.message_type;return typeof e=="string"&&(PA.has(e)||e.endsWith("_error"))?e:typeof t.error=="string"&&t.error.length>0?"error":null}function w$(t){return Buffer.from(t).toString("base64")}function S$(t){return new Uint8Array(Buffer.from(t,"base64"))}function $n(t,e){return new Error(`${t} connection error: ${e.message}`)}var PA,$a=g(()=>{"use strict";PA=new Set(["error","auth_error","quota_exceeded","rate_limited"])});function k$(t,e){let n=new Uint8Array(e),i=0;for(let r of t)n.set(r,i),i+=r.byteLength;return n}function RA(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 DA(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 xa,E$,I$,CA,Fi,Dp,wa=g(()=>{"use strict";he();Li();br();$a();xa="ws://localhost:6007",E$=1e3,I$=10240,CA=1e4,Fi=class{socketFactory;url;clock;id="sherpa-onnx";partialStability="redecode";constructor(e,n=xa,i=new St){this.socketFactory=e,this.url=n,this.clock=i}open(e){return e.biasTerms!==void 0&&e.biasTerms.length>0&&U.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 Dp(this.socketFactory,this.url,this.clock,e)}},Dp=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&&Ye(e,Wt)&&(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=bn(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(ji(n.text))}}}handleError(e){if(this.closed)return;let n=$n("sherpa ASR",new Error(RA(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*(E$/1e3))return;let e=this.clock.now();e-this.lastDecodeAtMs<E$||(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=DA(k$(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=k$([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+=I$)this.socket.send(o.subarray(a,Math.min(a+I$,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 CA+Math.ceil(e)}teardown(){this.closed||(this.closed=!0,this.rejectPendingReply(new Error("sherpa ASR stream closed")),this.socket.close())}}});var Et=R((V2,O$)=>{"use strict";var T$=["nodebuffer","arraybuffer","fragments"],A$=typeof Blob<"u";A$&&T$.push("blob");O$.exports={BINARY_TYPES:T$,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:A$,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Vi=R((Z2,Sa)=>{"use strict";var{EMPTY_BUFFER:NA}=Et(),Np=Buffer[Symbol.species];function zA(t,e){if(t.length===0)return NA;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 Np(n.buffer,n.byteOffset,i):n}function P$(t,e,n,i,r){for(let o=0;o<r;o++)n[i+o]=t[o]^e[o&3]}function C$(t,e){for(let n=0;n<t.length;n++)t[n]^=e[n&3]}function LA(t){return t.length===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.length)}function zp(t){if(zp.readOnly=!0,Buffer.isBuffer(t))return t;let e;return t instanceof ArrayBuffer?e=new Np(t):ArrayBuffer.isView(t)?e=new Np(t.buffer,t.byteOffset,t.byteLength):(e=Buffer.from(t),zp.readOnly=!1),e}Sa.exports={concat:zA,mask:P$,toArrayBuffer:LA,toBuffer:zp,unmask:C$};if(!process.env.WS_NO_BUFFER_UTIL)try{let t=ae("bufferutil");Sa.exports.mask=function(e,n,i,r,o){o<48?P$(e,n,i,r,o):t.mask(e,n,i,r,o)},Sa.exports.unmask=function(e,n){e.length<32?C$(e,n):t.unmask(e,n)}}catch{}});var N$=R((B2,D$)=>{"use strict";var R$=Symbol("kDone"),Lp=Symbol("kRun"),Up=class{constructor(e){this[R$]=()=>{this.pending--,this[Lp]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Lp]()}[Lp](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[R$])}}};D$.exports=Up});var Sn=R((G2,M$)=>{"use strict";var Zi=ae("zlib"),z$=Vi(),UA=N$(),{kStatusCode:L$}=Et(),MA=Buffer[Symbol.species],jA=Buffer.from([0,0,255,255]),Ia=Symbol("permessage-deflate"),It=Symbol("total-length"),xn=Symbol("callback"),Ht=Symbol("buffers"),wn=Symbol("error"),Ea,Mp=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,!Ea){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Ea=new UA(n)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[xn];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let n=this._options,i=e.find(r=>!(n.serverNoContextTakeover===!1&&r.server_no_context_takeover||r.server_max_window_bits&&(n.serverMaxWindowBits===!1||typeof n.serverMaxWindowBits=="number"&&n.serverMaxWindowBits>r.server_max_window_bits)||typeof n.clientMaxWindowBits=="number"&&!r.client_max_window_bits));if(!i)throw new Error("None of the extension offers can be accepted");return n.serverNoContextTakeover&&(i.server_no_context_takeover=!0),n.clientNoContextTakeover&&(i.client_no_context_takeover=!0),typeof n.serverMaxWindowBits=="number"&&(i.server_max_window_bits=n.serverMaxWindowBits),typeof n.clientMaxWindowBits=="number"?i.client_max_window_bits=n.clientMaxWindowBits:(i.client_max_window_bits===!0||n.clientMaxWindowBits===!1)&&delete i.client_max_window_bits,i}acceptAsClient(e){let n=e[0];if(this._options.clientNoContextTakeover===!1&&n.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!n.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(n.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&n.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return n}normalizeParams(e){return e.forEach(n=>{Object.keys(n).forEach(i=>{let r=n[i];if(r.length>1)throw new Error(`Parameter "${i}" must have only a single value`);if(r=r[0],i==="client_max_window_bits"){if(r!==!0){let o=+r;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${i}": ${r}`);r=o}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${i}": ${r}`)}else if(i==="server_max_window_bits"){let o=+r;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${i}": ${r}`);r=o}else if(i==="client_no_context_takeover"||i==="server_no_context_takeover"){if(r!==!0)throw new TypeError(`Invalid value for parameter "${i}": ${r}`)}else throw new Error(`Unknown parameter "${i}"`);n[i]=r})}),e}decompress(e,n,i){Ea.add(r=>{this._decompress(e,n,(o,s)=>{r(),i(o,s)})})}compress(e,n,i){Ea.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"?Zi.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=Zi.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[Ia]=this,this._inflate[It]=0,this._inflate[Ht]=[],this._inflate.on("error",VA),this._inflate.on("data",U$)}this._inflate[xn]=i,this._inflate.write(e),n&&this._inflate.write(jA),this._inflate.flush(()=>{let o=this._inflate[wn];if(o){this._inflate.close(),this._inflate=null,i(o);return}let s=z$.concat(this._inflate[Ht],this._inflate[It]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[It]=0,this._inflate[Ht]=[],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"?Zi.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=Zi.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[It]=0,this._deflate[Ht]=[],this._deflate.on("data",FA)}this._deflate[xn]=i,this._deflate.write(e),this._deflate.flush(Zi.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=z$.concat(this._deflate[Ht],this._deflate[It]);n&&(o=new MA(o.buffer,o.byteOffset,o.length-4)),this._deflate[xn]=null,this._deflate[It]=0,this._deflate[Ht]=[],n&&this.params[`${r}_no_context_takeover`]&&this._deflate.reset(),i(null,o)})}};M$.exports=Mp;function FA(t){this[Ht].push(t),this[It]+=t.length}function U$(t){if(this[It]+=t.length,this[Ia]._maxPayload<1||this[It]<=this[Ia]._maxPayload){this[Ht].push(t);return}this[wn]=new RangeError("Max payload size exceeded"),this[wn].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[wn][L$]=1009,this.removeListener("data",U$),this.reset()}function VA(t){if(this[Ia]._inflate=null,this[wn]){this[xn](this[wn]);return}t[L$]=1007,this[xn](t)}});var En=R((W2,ka)=>{"use strict";var{isUtf8:j$}=ae("buffer"),{hasBlob:ZA}=Et(),BA=[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 GA(t){return t>=1e3&&t<=1014&&t!==1004&&t!==1005&&t!==1006||t>=3e3&&t<=4999}function jp(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 WA(t){return ZA&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&(t[Symbol.toStringTag]==="Blob"||t[Symbol.toStringTag]==="File")}ka.exports={isBlob:WA,isValidStatusCode:GA,isValidUTF8:jp,tokenChars:BA};if(j$)ka.exports.isValidUTF8=function(t){return t.length<24?jp(t):j$(t)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let t=ae("utf-8-validate");ka.exports.isValidUTF8=function(e){return e.length<32?jp(e):t(e)}}catch{}});var Gp=R((H2,H$)=>{"use strict";var{Writable:HA}=ae("stream"),F$=Sn(),{BINARY_TYPES:qA,EMPTY_BUFFER:V$,kStatusCode:JA,kWebSocket:KA}=Et(),{concat:Fp,toArrayBuffer:YA,unmask:XA}=Vi(),{isValidStatusCode:QA,isValidUTF8:Z$}=En(),Ta=Buffer[Symbol.species],Xe=0,B$=1,G$=2,W$=3,Vp=4,Zp=5,Aa=6,Bp=class extends HA{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||qA[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[KA]=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=Xe}_write(e,n,i){if(this._opcode===8&&this._state==Xe)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 Ta(i.buffer,i.byteOffset+e,i.length-e),new Ta(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 Ta(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 Xe:this.getInfo(e);break;case B$:this.getPayloadLength16(e);break;case G$:this.getPayloadLength64(e);break;case W$:this.getMask();break;case Vp:this.getData(e);break;case Zp:case Aa: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[F$.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=B$:this._payloadLength===127?this._state=G$: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=W$:this._state=Vp}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Vp}getData(e){let n=V$;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&&XA(n,this._mask)}if(this._opcode>7){this.controlMessage(n,e);return}if(this._compressed){this._state=Zp,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[F$.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===Xe&&this.startLoop(n)})}dataMessage(e){if(!this._fin){this._state=Xe;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=Fp(i,n):this._binaryType==="arraybuffer"?r=YA(Fp(i,n)):this._binaryType==="blob"?r=new Blob(i):r=i,this._allowSynchronousEvents?(this.emit("message",r,!0),this._state=Xe):(this._state=Aa,setImmediate(()=>{this.emit("message",r,!0),this._state=Xe,this.startLoop(e)}))}else{let r=Fp(i,n);if(!this._skipUTF8Validation&&!Z$(r)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(o);return}this._state===Zp||this._allowSynchronousEvents?(this.emit("message",r,!1),this._state=Xe):(this._state=Aa,setImmediate(()=>{this.emit("message",r,!1),this._state=Xe,this.startLoop(e)}))}}controlMessage(e,n){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,V$),this.end();else{let i=e.readUInt16BE(0);if(!QA(i)){let o=this.createError(RangeError,`invalid status code ${i}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");n(o);return}let r=new Ta(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!Z$(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=Xe;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=Xe):(this._state=Aa,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=Xe,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[JA]=r,s}};H$.exports=Bp});var qp=R((J2,K$)=>{"use strict";var{Duplex:q2}=ae("stream"),{randomFillSync:eO}=ae("crypto"),{types:{isUint8Array:tO}}=ae("util"),q$=Sn(),{EMPTY_BUFFER:rO,kWebSocket:nO,NOOP:iO}=Et(),{isBlob:In,isValidStatusCode:oO}=En(),{mask:J$,toBuffer:$r}=Vi(),Qe=Symbol("kByteLength"),sO=Buffer.alloc(4),Oa=8*1024,xr,kn=Oa,ct=0,aO=1,cO=2,Wp=class t{constructor(e,n,i){this._extensions=n||{},i&&(this._generateMask=i,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=ct,this.onerror=iO,this[nO]=void 0}static frame(e,n){let i,r=!1,o=2,s=!1;n.mask&&(i=n.maskBuffer||sO,n.generateMask?n.generateMask(i):(kn===Oa&&(xr===void 0&&(xr=Buffer.alloc(Oa)),eO(xr,0,Oa),kn=0),i[0]=xr[kn++],i[1]=xr[kn++],i[2]=xr[kn++],i[3]=xr[kn++]),s=(i[0]|i[1]|i[2]|i[3])===0,o=6);let a;typeof e=="string"?(!n.mask||s)&&n[Qe]!==void 0?a=n[Qe]:(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?(J$(e,i,u,o,a),[u]):(J$(e,i,e,0,a),[u,e])):[u,e]}close(e,n,i,r){let o;if(e===void 0)o=rO;else{if(typeof e!="number"||!oO(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(tO(n))o.set(n,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let s={[Qe]:o.length,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==ct?this.enqueue([this.dispatch,o,!1,s,r]):this.sendFrame(t.frame(o,s),r)}ping(e,n,i){let r,o;if(typeof e=="string"?(r=Buffer.byteLength(e),o=!1):In(e)?(r=e.size,o=!1):(e=$r(e),r=e.length,o=$r.readOnly),r>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[Qe]:r,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};In(e)?this._state!==ct?this.enqueue([this.getBlobData,e,!1,s,i]):this.getBlobData(e,!1,s,i):this._state!==ct?this.enqueue([this.dispatch,e,!1,s,i]):this.sendFrame(t.frame(e,s),i)}pong(e,n,i){let r,o;if(typeof e=="string"?(r=Buffer.byteLength(e),o=!1):In(e)?(r=e.size,o=!1):(e=$r(e),r=e.length,o=$r.readOnly),r>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[Qe]:r,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};In(e)?this._state!==ct?this.enqueue([this.getBlobData,e,!1,s,i]):this.getBlobData(e,!1,s,i):this._state!==ct?this.enqueue([this.dispatch,e,!1,s,i]):this.sendFrame(t.frame(e,s),i)}send(e,n,i){let r=this._extensions[q$.extensionName],o=n.binary?2:1,s=n.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):In(e)?(a=e.size,c=!1):(e=$r(e),a=e.length,c=$r.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={[Qe]:a,fin:n.fin,generateMask:this._generateMask,mask:n.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:c,rsv1:s};In(e)?this._state!==ct?this.enqueue([this.getBlobData,e,this._compress,u,i]):this.getBlobData(e,this._compress,u,i):this._state!==ct?this.enqueue([this.dispatch,e,this._compress,u,i]):this.dispatch(e,this._compress,u,i)}getBlobData(e,n,i,r){this._bufferedBytes+=i[Qe],this._state=cO,e.arrayBuffer().then(o=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Hp,this,a,r);return}this._bufferedBytes-=i[Qe];let s=$r(o);n?this.dispatch(s,n,i,r):(this._state=ct,this.sendFrame(t.frame(s,i),r),this.dequeue())}).catch(o=>{process.nextTick(uO,this,o,r)})}dispatch(e,n,i,r){if(!n){this.sendFrame(t.frame(e,i),r);return}let o=this._extensions[q$.extensionName];this._bufferedBytes+=i[Qe],this._state=aO,o.compress(e,i.fin,(s,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");Hp(this,c,r);return}this._bufferedBytes-=i[Qe],this._state=ct,i.readOnly=!1,this.sendFrame(t.frame(a,i),r),this.dequeue()})}dequeue(){for(;this._state===ct&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][Qe],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][Qe],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)}};K$.exports=Wp;function Hp(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 uO(t,e,n){Hp(t,e,n),t.onerror(e)}});var ox=R((K2,ix)=>{"use strict";var{kForOnEventAttribute:Bi,kListener:Jp}=Et(),Y$=Symbol("kCode"),X$=Symbol("kData"),Q$=Symbol("kError"),ex=Symbol("kMessage"),tx=Symbol("kReason"),Tn=Symbol("kTarget"),rx=Symbol("kType"),nx=Symbol("kWasClean"),kt=class{constructor(e){this[Tn]=null,this[rx]=e}get target(){return this[Tn]}get type(){return this[rx]}};Object.defineProperty(kt.prototype,"target",{enumerable:!0});Object.defineProperty(kt.prototype,"type",{enumerable:!0});var wr=class extends kt{constructor(e,n={}){super(e),this[Y$]=n.code===void 0?0:n.code,this[tx]=n.reason===void 0?"":n.reason,this[nx]=n.wasClean===void 0?!1:n.wasClean}get code(){return this[Y$]}get reason(){return this[tx]}get wasClean(){return this[nx]}};Object.defineProperty(wr.prototype,"code",{enumerable:!0});Object.defineProperty(wr.prototype,"reason",{enumerable:!0});Object.defineProperty(wr.prototype,"wasClean",{enumerable:!0});var An=class extends kt{constructor(e,n={}){super(e),this[Q$]=n.error===void 0?null:n.error,this[ex]=n.message===void 0?"":n.message}get error(){return this[Q$]}get message(){return this[ex]}};Object.defineProperty(An.prototype,"error",{enumerable:!0});Object.defineProperty(An.prototype,"message",{enumerable:!0});var Gi=class extends kt{constructor(e,n={}){super(e),this[X$]=n.data===void 0?null:n.data}get data(){return this[X$]}};Object.defineProperty(Gi.prototype,"data",{enumerable:!0});var lO={addEventListener(t,e,n={}){for(let r of this.listeners(t))if(!n[Bi]&&r[Jp]===e&&!r[Bi])return;let i;if(t==="message")i=function(o,s){let a=new Gi("message",{data:s?o:o.toString()});a[Tn]=this,Pa(e,this,a)};else if(t==="close")i=function(o,s){let a=new wr("close",{code:o,reason:s.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[Tn]=this,Pa(e,this,a)};else if(t==="error")i=function(o){let s=new An("error",{error:o,message:o.message});s[Tn]=this,Pa(e,this,s)};else if(t==="open")i=function(){let o=new kt("open");o[Tn]=this,Pa(e,this,o)};else return;i[Bi]=!!n[Bi],i[Jp]=e,n.once?this.once(t,i):this.on(t,i)},removeEventListener(t,e){for(let n of this.listeners(t))if(n[Jp]===e&&!n[Bi]){this.removeListener(t,n);break}}};ix.exports={CloseEvent:wr,ErrorEvent:An,Event:kt,EventTarget:lO,MessageEvent:Gi};function Pa(t,e,n){typeof t=="object"&&t.handleEvent?t.handleEvent.call(t,n):t.call(e,n)}});var Ca=R((Y2,sx)=>{"use strict";var{tokenChars:Wi}=En();function mt(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}function dO(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&&Wi[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?(mt(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&&Wi[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),mt(n,t.slice(c,l),!0),u===44&&(mt(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(Wi[u]!==1)throw new SyntaxError(`Unexpected character at index ${d}`);c===-1?c=d:i||(i=!0),r=!1}else if(o)if(Wi[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&&Wi[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),mt(n,a,f),u===44&&(mt(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?mt(e,h,n):(a===void 0?mt(n,h,!0):i?mt(n,a,h.replace(/\\/g,"")):mt(n,a,h),mt(e,s,n)),e}function hO(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(", ")}sx.exports={format:hO,parse:dO}});var za=R((eM,yx)=>{"use strict";var fO=ae("events"),pO=ae("https"),mO=ae("http"),ux=ae("net"),gO=ae("tls"),{randomBytes:vO,createHash:yO}=ae("crypto"),{Duplex:X2,Readable:Q2}=ae("stream"),{URL:Kp}=ae("url"),qt=Sn(),_O=Gp(),bO=qp(),{isBlob:$O}=En(),{BINARY_TYPES:ax,CLOSE_TIMEOUT:xO,EMPTY_BUFFER:Ra,GUID:wO,kForOnEventAttribute:Yp,kListener:SO,kStatusCode:EO,kWebSocket:ve,NOOP:lx}=Et(),{EventTarget:{addEventListener:IO,removeEventListener:kO}}=ox(),{format:TO,parse:AO}=Ca(),{toBuffer:OO}=Vi(),dx=Symbol("kAborted"),Xp=[8,13],Tt=["CONNECTING","OPEN","CLOSING","CLOSED"],PO=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,re=class t extends fO{constructor(e,n,i){super(),this._binaryType=ax[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Ra,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]),hx(this,e,n,i)):(this._autoPong=i.autoPong,this._closeTimeout=i.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){ax.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 _O({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 bO(e,this._extensions,i.generateMask);this._receiver=r,this._sender=o,this._socket=e,r[ve]=this,o[ve]=this,e[ve]=this,r.on("conclude",DO),r.on("drain",NO),r.on("error",zO),r.on("message",LO),r.on("ping",UO),r.on("pong",MO),o.onerror=jO,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),n.length>0&&e.unshift(n),e.on("close",mx),e.on("data",Na),e.on("end",gx),e.on("error",vx),this._readyState=t.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[qt.extensionName]&&this._extensions[qt.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,n){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){He(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())}),px(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){Qp(this,e,i);return}n===void 0&&(n=!this._isServer),this._sender.ping(e||Ra,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){Qp(this,e,i);return}n===void 0&&(n=!this._isServer),this._sender.pong(e||Ra,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){Qp(this,e,i);return}let r={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...n};this._extensions[qt.extensionName]||(r.compress=!1),this._sender.send(e||Ra,r,i)}terminate(){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){He(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=t.CLOSING,this._socket.destroy())}}};Object.defineProperty(re,"CONNECTING",{enumerable:!0,value:Tt.indexOf("CONNECTING")});Object.defineProperty(re.prototype,"CONNECTING",{enumerable:!0,value:Tt.indexOf("CONNECTING")});Object.defineProperty(re,"OPEN",{enumerable:!0,value:Tt.indexOf("OPEN")});Object.defineProperty(re.prototype,"OPEN",{enumerable:!0,value:Tt.indexOf("OPEN")});Object.defineProperty(re,"CLOSING",{enumerable:!0,value:Tt.indexOf("CLOSING")});Object.defineProperty(re.prototype,"CLOSING",{enumerable:!0,value:Tt.indexOf("CLOSING")});Object.defineProperty(re,"CLOSED",{enumerable:!0,value:Tt.indexOf("CLOSED")});Object.defineProperty(re.prototype,"CLOSED",{enumerable:!0,value:Tt.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(t=>{Object.defineProperty(re.prototype,t,{enumerable:!0})});["open","error","close","message"].forEach(t=>{Object.defineProperty(re.prototype,`on${t}`,{enumerable:!0,get(){for(let e of this.listeners(t))if(e[Yp])return e[SO];return null},set(e){for(let n of this.listeners(t))if(n[Yp]){this.removeListener(t,n);break}typeof e=="function"&&this.addEventListener(t,e,{[Yp]:!0})}})});re.prototype.addEventListener=IO;re.prototype.removeEventListener=kO;yx.exports=re;function hx(t,e,n,i){let r={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:xO,protocolVersion:Xp[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,!Xp.includes(r.protocolVersion))throw new RangeError(`Unsupported protocol version: ${r.protocolVersion} (supported versions: ${Xp.join(", ")})`);let o;if(e instanceof Kp)o=e;else try{o=new Kp(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 _=new SyntaxError(c);if(t._redirects===0)throw _;Da(t,_);return}let u=s?443:80,l=vO(16).toString("base64"),d=s?pO.request:mO.request,h=new Set,f;if(r.createConnection=r.createConnection||(s?RO:CO),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 qt({...r.perMessageDeflate,isServer:!1,maxPayload:r.maxPayload}),r.headers["Sec-WebSocket-Extensions"]=TO({[qt.extensionName]:f.offer()})),n.length){for(let _ of n){if(typeof _!="string"||!PO.test(_)||h.has(_))throw new SyntaxError("An invalid or duplicated subprotocol was specified");h.add(_)}r.headers["Sec-WebSocket-Protocol"]=n.join(",")}if(r.origin&&(r.protocolVersion<13?r.headers["Sec-WebSocket-Origin"]=r.origin:r.headers.Origin=r.origin),(o.username||o.password)&&(r.auth=`${o.username}:${o.password}`),a){let _=r.path.split(":");r.socketPath=_[0],r.path=_[1]}let p;if(r.followRedirects){if(t._redirects===0){t._originalIpc=a,t._originalSecure=s,t._originalHostOrSocketPath=a?r.socketPath:o.host;let _=i&&i.headers;if(i={...i,headers:{}},_)for(let[b,E]of Object.entries(_))i.headers[b.toLowerCase()]=E}else if(t.listenerCount("redirect")===0){let _=a?t._originalIpc?r.socketPath===t._originalHostOrSocketPath:!1:t._originalIpc?!1:o.host===t._originalHostOrSocketPath;(!_||t._originalSecure&&!s)&&(delete r.headers.authorization,delete r.headers.cookie,_||delete r.headers.host,r.auth=void 0)}r.auth&&!i.headers.authorization&&(i.headers.authorization="Basic "+Buffer.from(r.auth).toString("base64")),p=t._req=d(r),t._redirects&&t.emit("redirect",t.url,p)}else p=t._req=d(r);r.timeout&&p.on("timeout",()=>{He(t,p,"Opening handshake has timed out")}),p.on("error",_=>{p===null||p[dx]||(p=t._req=null,Da(t,_))}),p.on("response",_=>{let b=_.headers.location,E=_.statusCode;if(b&&r.followRedirects&&E>=300&&E<400){if(++t._redirects>r.maxRedirects){He(t,p,"Maximum redirects exceeded");return}p.abort();let C;try{C=new Kp(b,e)}catch{let I=new SyntaxError(`Invalid URL: ${b}`);Da(t,I);return}hx(t,C,n,i)}else t.emit("unexpected-response",p,_)||He(t,p,`Unexpected server response: ${_.statusCode}`)}),p.on("upgrade",(_,b,E)=>{if(t.emit("upgrade",_),t.readyState!==re.CONNECTING)return;p=t._req=null;let C=_.headers.upgrade;if(C===void 0||C.toLowerCase()!=="websocket"){He(t,b,"Invalid Upgrade header");return}let A=yO("sha1").update(l+wO).digest("base64");if(_.headers["sec-websocket-accept"]!==A){He(t,b,"Invalid Sec-WebSocket-Accept header");return}let I=_.headers["sec-websocket-protocol"],T;if(I!==void 0?h.size?h.has(I)||(T="Server sent an invalid subprotocol"):T="Server sent a subprotocol but none was requested":h.size&&(T="Server sent no subprotocol"),T){He(t,b,T);return}I&&(t._protocol=I);let B=_.headers["sec-websocket-extensions"];if(B!==void 0){if(!f){He(t,b,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let V;try{V=AO(B)}catch{He(t,b,"Invalid Sec-WebSocket-Extensions header");return}let H=Object.keys(V);if(H.length!==1||H[0]!==qt.extensionName){He(t,b,"Server indicated an extension that was not requested");return}try{f.accept(V[qt.extensionName])}catch{He(t,b,"Invalid Sec-WebSocket-Extensions header");return}t._extensions[qt.extensionName]=f}t.setSocket(b,E,{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 Da(t,e){t._readyState=re.CLOSING,t._errorEmitted=!0,t.emit("error",e),t.emitClose()}function CO(t){return t.path=t.socketPath,ux.connect(t)}function RO(t){return t.path=void 0,!t.servername&&t.servername!==""&&(t.servername=ux.isIP(t.host)?"":t.host),gO.connect(t)}function He(t,e,n){t._readyState=re.CLOSING;let i=new Error(n);Error.captureStackTrace(i,He),e.setHeader?(e[dx]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Da,t,i)):(e.destroy(i),e.once("error",t.emit.bind(t,"error")),e.once("close",t.emitClose.bind(t)))}function Qp(t,e,n){if(e){let i=$O(e)?e.size:OO(e).length;t._socket?t._sender._bufferedBytes+=i:t._bufferedAmount+=i}if(n){let i=new Error(`WebSocket is not open: readyState ${t.readyState} (${Tt[t.readyState]})`);process.nextTick(n,i)}}function DO(t,e){let n=this[ve];n._closeFrameReceived=!0,n._closeMessage=e,n._closeCode=t,n._socket[ve]!==void 0&&(n._socket.removeListener("data",Na),process.nextTick(fx,n._socket),t===1005?n.close():n.close(t,e))}function NO(){let t=this[ve];t.isPaused||t._socket.resume()}function zO(t){let e=this[ve];e._socket[ve]!==void 0&&(e._socket.removeListener("data",Na),process.nextTick(fx,e._socket),e.close(t[EO])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t))}function cx(){this[ve].emitClose()}function LO(t,e){this[ve].emit("message",t,e)}function UO(t){let e=this[ve];e._autoPong&&e.pong(t,!this._isServer,lx),e.emit("ping",t)}function MO(t){this[ve].emit("pong",t)}function fx(t){t.resume()}function jO(t){let e=this[ve];e.readyState!==re.CLOSED&&(e.readyState===re.OPEN&&(e._readyState=re.CLOSING,px(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t)))}function px(t){t._closeTimer=setTimeout(t._socket.destroy.bind(t._socket),t._closeTimeout)}function mx(){let t=this[ve];if(this.removeListener("close",mx),this.removeListener("data",Na),this.removeListener("end",gx),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[ve]=void 0,clearTimeout(t._closeTimer),t._receiver._writableState.finished||t._receiver._writableState.errorEmitted?t.emitClose():(t._receiver.on("error",cx),t._receiver.on("finish",cx))}function Na(t){this[ve]._receiver.write(t)||this.pause()}function gx(){let t=this[ve];t._readyState=re.CLOSING,t._receiver.end(),this.end()}function vx(){let t=this[ve];this.removeListener("error",vx),this.on("error",lx),t&&(t._readyState=re.CLOSING,this.destroy())}});var xx=R((rM,$x)=>{"use strict";var tM=za(),{Duplex:FO}=ae("stream");function _x(t){t.emit("close")}function VO(){!this.destroyed&&this._writableState.finished&&this.destroy()}function bx(t){this.removeListener("error",bx),this.destroy(),this.listenerCount("error")===0&&this.emit("error",t)}function ZO(t,e){let n=!0,i=new FO({...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(_x,i);return}let s=!1;t.once("error",function(c){s=!0,o(c)}),t.once("close",function(){s||o(r),process.nextTick(_x,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",VO),i.on("error",bx),i}$x.exports=ZO});var em=R((nM,wx)=>{"use strict";var{tokenChars:BO}=En();function GO(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&&BO[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}wx.exports={parse:GO}});var Ox=R((oM,Ax)=>{"use strict";var WO=ae("events"),La=ae("http"),{Duplex:iM}=ae("stream"),{createHash:HO}=ae("crypto"),Sx=Ca(),Sr=Sn(),qO=em(),JO=za(),{CLOSE_TIMEOUT:KO,GUID:YO,kWebSocket:XO}=Et(),QO=/^[+/0-9A-Za-z]{22}==$/,Ex=0,Ix=1,Tx=2,tm=class extends WO{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:KO,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:JO,...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=La.createServer((i,r)=>{let o=La.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=eP(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=Ex}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===Tx){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Hi,this);return}if(e&&this.once("close",e),this._state!==Ix)if(this._state=Ix,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(Hi,this):process.nextTick(Hi,this);else{let n=this._server;this._removeListeners(),this._removeListeners=this._server=null,n.close(()=>{Hi(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",kx);let o=e.headers["sec-websocket-key"],s=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){Er(this,e,n,405,"Invalid HTTP method");return}if(s===void 0||s.toLowerCase()!=="websocket"){Er(this,e,n,400,"Invalid Upgrade header");return}if(o===void 0||!QO.test(o)){Er(this,e,n,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){Er(this,e,n,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){qi(n,400);return}let c=e.headers["sec-websocket-protocol"],u=new Set;if(c!==void 0)try{u=qO.parse(c)}catch{Er(this,e,n,400,"Invalid Sec-WebSocket-Protocol header");return}let l=e.headers["sec-websocket-extensions"],d={};if(this.options.perMessageDeflate&&l!==void 0){let h=new Sr({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let f=Sx.parse(l);f[Sr.extensionName]&&(h.accept(f[Sr.extensionName]),d[Sr.extensionName]=h)}catch{Er(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,_,b)=>{if(!f)return qi(n,p||401,_,b);this.completeUpgrade(d,o,u,e,n,i,r)});return}if(!this.options.verifyClient(h))return qi(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[XO])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Ex)return qi(o,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${HO("sha1").update(n+YO).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[Sr.extensionName]){let d=e[Sr.extensionName].params,h=Sx.format({[Sr.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{r.cancel().catch(()=>{})}}function xA(t,e,n){return e?.aborted?Promise.reject(v$(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(v$(e))),c=n!==void 0?setTimeout(()=>s(()=>r(new ya(n))),n):void 0;e?.addEventListener("abort",a,{once:!0}),t.read().then(u=>s(()=>i(u)),u=>s(()=>r(wA(u))))})}function v$(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 ya,Tp=g(()=>{"use strict";ya=class extends Error{constructor(e){super(`text stream idle for ${e}ms`),this.name="IdleTimeoutError"}}});var Ht,Ap=g(()=>{"use strict";Ht=class extends Error{status;constructor(e,n){super(e),this.status=n,this.name="TextAdapterError"}}});function _$(t){try{return JSON.parse(t)}catch{return}}function Sn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0}function TA(t){return Array.isArray(t)?t:void 0}function b$(t){let e=Sn(t)?.message;return typeof e=="string"?e:"unknown error"}var ba,SA,EA,IA,kA,_a,Li,Mi,Op=g(()=>{"use strict";Tp();Ap();ba=3e4,SA=4096,EA="https://api.anthropic.com/v1/messages",IA="2023-06-01",kA="https://api.openai.com/v1/chat/completions",_a=class{key;fetchImpl;idleTimeoutMs;constructor(e,n=fetch,i=ba){this.key=e,this.fetchImpl=n,this.idleTimeoutMs=i}async*stream(e){let{url:n,init:i}=this.buildRequest(e),r=await this.fetchImpl(n,{...i,signal:e.signal});if(!r.ok)throw new Ht(`text provider request failed (HTTP ${r.status})`,r.status);if(!r.body)throw new Ht("text provider response had no body");for await(let o of y$(r.body,{signal:e.signal,idleTimeoutMs:this.idleTimeoutMs})){if(this.isDone(o))return;let s=this.decode(o);s&&(yield s)}}},Li=class extends _a{buildRequest(e){let n={model:e.model,max_tokens:SA,stream:!0,messages:e.messages.map(i=>({role:i.role,content:i.content})),...e.system!==void 0&&{system:e.system}};return{url:EA,init:{method:"POST",headers:{"x-api-key":this.key,"anthropic-version":IA,"content-type":"application/json"},body:JSON.stringify(n)}}}isDone(){return!1}decode(e){let n=Sn(_$(e));if(!n)return null;if(n.type==="error")throw new Ht(`anthropic stream error: ${b$(n.error)}`);if(n.type==="content_block_delta"){let i=Sn(n.delta);if(i?.type==="text_delta"&&typeof i.text=="string")return{type:"text",text:i.text}}return null}},Mi=class extends _a{buildRequest(e){let n=e.system!==void 0?[{role:"system",content:e.system},...e.messages]:e.messages,i={model:e.model,stream:!0,messages:n};return{url:kA,init:{method:"POST",headers:{Authorization:`Bearer ${this.key}`,"content-type":"application/json"},body:JSON.stringify(i)}}}isDone(e){return e==="[DONE]"}decode(e){let n=Sn(_$(e));if(!n)return null;if(n.error)throw new Ht(`openai stream error: ${b$(n.error)}`);let i=TA(n.choices),r=i?Sn(i[0])?.delta:void 0,o=Sn(r)?.content;return typeof o=="string"&&o.length>0?{type:"text",text:o}:null}}});var zi,Pp=g(()=>{"use strict";Op();zi=class{fetchImpl;idleTimeoutMs;constructor(e=fetch,n=ba){this.fetchImpl=e,this.idleTimeoutMs=n}textAdapter(e,n){switch(e.provider){case"anthropic":return new Li(n,this.fetchImpl,this.idleTimeoutMs);case"openai":return new Mi(n,this.fetchImpl,this.idleTimeoutMs);default:throw new Error(`no text adapter for provider '${e.provider}'`)}}}});var je,$$=g(()=>{"use strict";je=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 x$=g(()=>{"use strict"});var Ui=g(()=>{"use strict";$$();x$()});var Et,ji=g(()=>{"use strict";Et=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 Ye(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 AA(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,Fi,Vi,wr=g(()=>{"use strict";he();qt=.02;Fi=class{threshold;constructor(e){this.threshold=e}classify(e,n){n(Ye(e,this.threshold))}},Vi=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(Ye(e,this.energyThreshold));return}this.vad.process(AA(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(Ye(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 Cp(t){return new Error(`openai-compat ASR decode failed (HTTP ${t})`)}function Rp(t){t.body?.cancel().catch(()=>{})}function PA(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function DA(t){return t.replace(NA," ")}function LA(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 MA(t){for(let e=0;e<t.length;e+=1){let n=t.charCodeAt(e);if(n<32||n===127)throw new Error("openai-compat ASR key contains a control character (check for a pasted trailing newline) - it cannot be sent as an HTTP header")}}function zA(t,e){let n=new Uint8Array(e),i=0;for(let r of t)n.set(r,i),i+=r.byteLength;return n}function UA(t,e){let n=new Uint8Array(44+t.byteLength),i=new DataView(n.buffer);return $a(n,0,"RIFF"),i.setUint32(4,36+t.byteLength,!0),$a(n,8,"WAVE"),$a(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),$a(n,36,"data"),i.setUint32(40,t.byteLength,!0),n.set(t,44),n}function $a(t,e,n){for(let i=0;i<n.length;i+=1)t[e+i]=n.charCodeAt(i)}function E$(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")?E$(t.cause,e+1):t.message.length>0?t.message:t.name.length>0?t.name:"network error"}var Dp,Lp,w$,OA,xa,Np,S$,CA,RA,NA,Mp=g(()=>{"use strict";he();ji();wr();Dp="http://localhost:8081",Lp="large-v3-turbo",w$=1e3,OA=1e4,xa=class{fetchImpl;model;clock;id="openai-compat";partialStability="redecode";baseUrl;key;negotiation={dialect:null};constructor(e,n=Dp,i=Lp,r,o=new Et){this.fetchImpl=e,this.model=i,this.clock=o,this.baseUrl=LA(n),this.key=r!==void 0&&r.length>0?r:void 0,this.key!==void 0&&MA(this.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 Np({fetchImpl:this.fetchImpl,baseUrl:this.baseUrl,model:this.model,key:this.key,negotiation:this.negotiation,clock:this.clock},e)}},Np=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&&Ye(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*(w$/1e3))return;let e=this.ctx.clock.now();e-this.lastDecodeAtMs<w$||(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=UA(zA(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=PA(s)&&typeof s.text=="string"?s.text:"";return DA(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 Rp(s),Cp(s.status);return s}let r=await this.post("standard",e,n);if(r.ok)return this.ctx.negotiation.dialect="standard",r;if(Rp(r),r.status!==404)throw Cp(r.status);let o=await this.post("inference",e,n);if(o.ok)return this.ctx.negotiation.dialect="inference",o;throw Rp(o),Cp(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: ${E$(s)}`,{cause:s})}}decodeReplyTimeoutMs(){let e=this.bufferedBytes/2/this.opts.sampleRate*1e3;return OA+Math.ceil(e)}teardown(){this.closed||(this.closed=!0,this.inFlightAbort?.abort(),this.inFlightAbort=null)}};S$=" ",CA="\r",RA=`
71
+ `,NA=new RegExp(`[ ${S$}]*[${CA}${RA}]+[ ${S$}]*`,"g")});function En(t){try{let e=JSON.parse(t);return typeof e=="object"&&e!==null?e:void 0}catch{return}}function Zi(t){return typeof t=="string"?t:""}function wa(t){let e=t.message_type;return typeof e=="string"&&(jA.has(e)||e.endsWith("_error"))?e:typeof t.error=="string"&&t.error.length>0?"error":null}function I$(t){return Buffer.from(t).toString("base64")}function k$(t){return new Uint8Array(Buffer.from(t,"base64"))}function In(t,e){return new Error(`${t} connection error: ${e.message}`)}var jA,Sa=g(()=>{"use strict";jA=new Set(["error","auth_error","quota_exceeded","rate_limited"])});function O$(t,e){let n=new Uint8Array(e),i=0;for(let r of t)n.set(r,i),i+=r.byteLength;return n}function VA(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 ZA(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 Ea,T$,A$,FA,Bi,zp,Ia=g(()=>{"use strict";he();ji();wr();Sa();Ea="ws://localhost:6007",T$=1e3,A$=10240,FA=1e4,Bi=class{socketFactory;url;clock;id="sherpa-onnx";partialStability="redecode";constructor(e,n=Ea,i=new Et){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 zp(this.socketFactory,this.url,this.clock,e)}},zp=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&&Ye(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=En(e);if(n){if(this.staleReplies>0){this.staleReplies-=1;return}if(this.pendingReply){let{resolve:i,timer:r}=this.pendingReply;this.pendingReply=null,this.clock.clearTimer(r),i(Zi(n.text))}}}handleError(e){if(this.closed)return;let n=In("sherpa ASR",new Error(VA(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*(T$/1e3))return;let e=this.clock.now();e-this.lastDecodeAtMs<T$||(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=ZA(O$(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=O$([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+=A$)this.socket.send(o.subarray(a,Math.min(a+A$,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 FA+Math.ceil(e)}teardown(){this.closed||(this.closed=!0,this.rejectPendingReply(new Error("sherpa ASR stream closed")),this.socket.close())}}});var It=N((a2,R$)=>{"use strict";var P$=["nodebuffer","arraybuffer","fragments"],C$=typeof Blob<"u";C$&&P$.push("blob");R$.exports={BINARY_TYPES:P$,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:C$,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Gi=N((c2,ka)=>{"use strict";var{EMPTY_BUFFER:BA}=It(),Up=Buffer[Symbol.species];function GA(t,e){if(t.length===0)return BA;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 Up(n.buffer,n.byteOffset,i):n}function N$(t,e,n,i,r){for(let o=0;o<r;o++)n[i+o]=t[o]^e[o&3]}function D$(t,e){for(let n=0;n<t.length;n++)t[n]^=e[n&3]}function WA(t){return t.length===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.length)}function jp(t){if(jp.readOnly=!0,Buffer.isBuffer(t))return t;let e;return t instanceof ArrayBuffer?e=new Up(t):ArrayBuffer.isView(t)?e=new Up(t.buffer,t.byteOffset,t.byteLength):(e=Buffer.from(t),jp.readOnly=!1),e}ka.exports={concat:GA,mask:N$,toArrayBuffer:WA,toBuffer:jp,unmask:D$};if(!process.env.WS_NO_BUFFER_UTIL)try{let t=ce("bufferutil");ka.exports.mask=function(e,n,i,r,o){o<48?N$(e,n,i,r,o):t.mask(e,n,i,r,o)},ka.exports.unmask=function(e,n){e.length<32?D$(e,n):t.unmask(e,n)}}catch{}});var z$=N((u2,M$)=>{"use strict";var L$=Symbol("kDone"),Fp=Symbol("kRun"),Vp=class{constructor(e){this[L$]=()=>{this.pending--,this[Fp]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Fp]()}[Fp](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[L$])}}};M$.exports=Vp});var An=N((l2,V$)=>{"use strict";var Wi=ce("zlib"),U$=Gi(),HA=z$(),{kStatusCode:j$}=It(),qA=Buffer[Symbol.species],JA=Buffer.from([0,0,255,255]),Aa=Symbol("permessage-deflate"),kt=Symbol("total-length"),kn=Symbol("callback"),Jt=Symbol("buffers"),Tn=Symbol("error"),Ta,Zp=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,!Ta){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Ta=new HA(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[kn];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){Ta.add(r=>{this._decompress(e,n,(o,s)=>{r(),i(o,s)})})}compress(e,n,i){Ta.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"?Wi.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=Wi.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[Aa]=this,this._inflate[kt]=0,this._inflate[Jt]=[],this._inflate.on("error",YA),this._inflate.on("data",F$)}this._inflate[kn]=i,this._inflate.write(e),n&&this._inflate.write(JA),this._inflate.flush(()=>{let o=this._inflate[Tn];if(o){this._inflate.close(),this._inflate=null,i(o);return}let s=U$.concat(this._inflate[Jt],this._inflate[kt]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[kt]=0,this._inflate[Jt]=[],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"?Wi.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=Wi.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[kt]=0,this._deflate[Jt]=[],this._deflate.on("data",KA)}this._deflate[kn]=i,this._deflate.write(e),this._deflate.flush(Wi.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=U$.concat(this._deflate[Jt],this._deflate[kt]);n&&(o=new qA(o.buffer,o.byteOffset,o.length-4)),this._deflate[kn]=null,this._deflate[kt]=0,this._deflate[Jt]=[],n&&this.params[`${r}_no_context_takeover`]&&this._deflate.reset(),i(null,o)})}};V$.exports=Zp;function KA(t){this[Jt].push(t),this[kt]+=t.length}function F$(t){if(this[kt]+=t.length,this[Aa]._maxPayload<1||this[kt]<=this[Aa]._maxPayload){this[Jt].push(t);return}this[Tn]=new RangeError("Max payload size exceeded"),this[Tn].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Tn][j$]=1009,this.removeListener("data",F$),this.reset()}function YA(t){if(this[Aa]._inflate=null,this[Tn]){this[kn](this[Tn]);return}t[j$]=1007,this[kn](t)}});var On=N((d2,Oa)=>{"use strict";var{isUtf8:Z$}=ce("buffer"),{hasBlob:XA}=It(),QA=[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 eO(t){return t>=1e3&&t<=1014&&t!==1004&&t!==1005&&t!==1006||t>=3e3&&t<=4999}function Bp(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 tO(t){return XA&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&(t[Symbol.toStringTag]==="Blob"||t[Symbol.toStringTag]==="File")}Oa.exports={isBlob:tO,isValidStatusCode:eO,isValidUTF8:Bp,tokenChars:QA};if(Z$)Oa.exports.isValidUTF8=function(t){return t.length<24?Bp(t):Z$(t)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let t=ce("utf-8-validate");Oa.exports.isValidUTF8=function(e){return e.length<32?Bp(e):t(e)}}catch{}});var Jp=N((h2,K$)=>{"use strict";var{Writable:rO}=ce("stream"),B$=An(),{BINARY_TYPES:nO,EMPTY_BUFFER:G$,kStatusCode:iO,kWebSocket:oO}=It(),{concat:Gp,toArrayBuffer:sO,unmask:aO}=Gi(),{isValidStatusCode:cO,isValidUTF8:W$}=On(),Pa=Buffer[Symbol.species],Xe=0,H$=1,q$=2,J$=3,Wp=4,Hp=5,Ca=6,qp=class extends rO{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||nO[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[oO]=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=Xe}_write(e,n,i){if(this._opcode===8&&this._state==Xe)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 Pa(i.buffer,i.byteOffset+e,i.length-e),new Pa(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 Pa(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 Xe:this.getInfo(e);break;case H$:this.getPayloadLength16(e);break;case q$:this.getPayloadLength64(e);break;case J$:this.getMask();break;case Wp:this.getData(e);break;case Hp:case Ca: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[B$.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=H$:this._payloadLength===127?this._state=q$: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=J$:this._state=Wp}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Wp}getData(e){let n=G$;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&&aO(n,this._mask)}if(this._opcode>7){this.controlMessage(n,e);return}if(this._compressed){this._state=Hp,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[B$.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===Xe&&this.startLoop(n)})}dataMessage(e){if(!this._fin){this._state=Xe;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=Gp(i,n):this._binaryType==="arraybuffer"?r=sO(Gp(i,n)):this._binaryType==="blob"?r=new Blob(i):r=i,this._allowSynchronousEvents?(this.emit("message",r,!0),this._state=Xe):(this._state=Ca,setImmediate(()=>{this.emit("message",r,!0),this._state=Xe,this.startLoop(e)}))}else{let r=Gp(i,n);if(!this._skipUTF8Validation&&!W$(r)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(o);return}this._state===Hp||this._allowSynchronousEvents?(this.emit("message",r,!1),this._state=Xe):(this._state=Ca,setImmediate(()=>{this.emit("message",r,!1),this._state=Xe,this.startLoop(e)}))}}controlMessage(e,n){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,G$),this.end();else{let i=e.readUInt16BE(0);if(!cO(i)){let o=this.createError(RangeError,`invalid status code ${i}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");n(o);return}let r=new Pa(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!W$(r)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");n(o);return}this._loop=!1,this.emit("conclude",i,r),this.end()}this._state=Xe;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=Xe):(this._state=Ca,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=Xe,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[iO]=r,s}};K$.exports=qp});var Xp=N((p2,Q$)=>{"use strict";var{Duplex:f2}=ce("stream"),{randomFillSync:uO}=ce("crypto"),{types:{isUint8Array:lO}}=ce("util"),Y$=An(),{EMPTY_BUFFER:dO,kWebSocket:hO,NOOP:fO}=It(),{isBlob:Pn,isValidStatusCode:pO}=On(),{mask:X$,toBuffer:Sr}=Gi(),Qe=Symbol("kByteLength"),mO=Buffer.alloc(4),Ra=8*1024,Er,Cn=Ra,ct=0,gO=1,vO=2,Kp=class t{constructor(e,n,i){this._extensions=n||{},i&&(this._generateMask=i,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=ct,this.onerror=fO,this[hO]=void 0}static frame(e,n){let i,r=!1,o=2,s=!1;n.mask&&(i=n.maskBuffer||mO,n.generateMask?n.generateMask(i):(Cn===Ra&&(Er===void 0&&(Er=Buffer.alloc(Ra)),uO(Er,0,Ra),Cn=0),i[0]=Er[Cn++],i[1]=Er[Cn++],i[2]=Er[Cn++],i[3]=Er[Cn++]),s=(i[0]|i[1]|i[2]|i[3])===0,o=6);let a;typeof e=="string"?(!n.mask||s)&&n[Qe]!==void 0?a=n[Qe]:(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?(X$(e,i,u,o,a),[u]):(X$(e,i,e,0,a),[u,e])):[u,e]}close(e,n,i,r){let o;if(e===void 0)o=dO;else{if(typeof e!="number"||!pO(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(lO(n))o.set(n,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let s={[Qe]:o.length,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==ct?this.enqueue([this.dispatch,o,!1,s,r]):this.sendFrame(t.frame(o,s),r)}ping(e,n,i){let r,o;if(typeof e=="string"?(r=Buffer.byteLength(e),o=!1):Pn(e)?(r=e.size,o=!1):(e=Sr(e),r=e.length,o=Sr.readOnly),r>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[Qe]:r,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};Pn(e)?this._state!==ct?this.enqueue([this.getBlobData,e,!1,s,i]):this.getBlobData(e,!1,s,i):this._state!==ct?this.enqueue([this.dispatch,e,!1,s,i]):this.sendFrame(t.frame(e,s),i)}pong(e,n,i){let r,o;if(typeof e=="string"?(r=Buffer.byteLength(e),o=!1):Pn(e)?(r=e.size,o=!1):(e=Sr(e),r=e.length,o=Sr.readOnly),r>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[Qe]:r,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};Pn(e)?this._state!==ct?this.enqueue([this.getBlobData,e,!1,s,i]):this.getBlobData(e,!1,s,i):this._state!==ct?this.enqueue([this.dispatch,e,!1,s,i]):this.sendFrame(t.frame(e,s),i)}send(e,n,i){let r=this._extensions[Y$.extensionName],o=n.binary?2:1,s=n.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):Pn(e)?(a=e.size,c=!1):(e=Sr(e),a=e.length,c=Sr.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={[Qe]:a,fin:n.fin,generateMask:this._generateMask,mask:n.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:c,rsv1:s};Pn(e)?this._state!==ct?this.enqueue([this.getBlobData,e,this._compress,u,i]):this.getBlobData(e,this._compress,u,i):this._state!==ct?this.enqueue([this.dispatch,e,this._compress,u,i]):this.dispatch(e,this._compress,u,i)}getBlobData(e,n,i,r){this._bufferedBytes+=i[Qe],this._state=vO,e.arrayBuffer().then(o=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Yp,this,a,r);return}this._bufferedBytes-=i[Qe];let s=Sr(o);n?this.dispatch(s,n,i,r):(this._state=ct,this.sendFrame(t.frame(s,i),r),this.dequeue())}).catch(o=>{process.nextTick(yO,this,o,r)})}dispatch(e,n,i,r){if(!n){this.sendFrame(t.frame(e,i),r);return}let o=this._extensions[Y$.extensionName];this._bufferedBytes+=i[Qe],this._state=gO,o.compress(e,i.fin,(s,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");Yp(this,c,r);return}this._bufferedBytes-=i[Qe],this._state=ct,i.readOnly=!1,this.sendFrame(t.frame(a,i),r),this.dequeue()})}dequeue(){for(;this._state===ct&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][Qe],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][Qe],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)}};Q$.exports=Kp;function Yp(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 yO(t,e,n){Yp(t,e,n),t.onerror(e)}});var cx=N((m2,ax)=>{"use strict";var{kForOnEventAttribute:Hi,kListener:Qp}=It(),ex=Symbol("kCode"),tx=Symbol("kData"),rx=Symbol("kError"),nx=Symbol("kMessage"),ix=Symbol("kReason"),Rn=Symbol("kTarget"),ox=Symbol("kType"),sx=Symbol("kWasClean"),Tt=class{constructor(e){this[Rn]=null,this[ox]=e}get target(){return this[Rn]}get type(){return this[ox]}};Object.defineProperty(Tt.prototype,"target",{enumerable:!0});Object.defineProperty(Tt.prototype,"type",{enumerable:!0});var Ir=class extends Tt{constructor(e,n={}){super(e),this[ex]=n.code===void 0?0:n.code,this[ix]=n.reason===void 0?"":n.reason,this[sx]=n.wasClean===void 0?!1:n.wasClean}get code(){return this[ex]}get reason(){return this[ix]}get wasClean(){return this[sx]}};Object.defineProperty(Ir.prototype,"code",{enumerable:!0});Object.defineProperty(Ir.prototype,"reason",{enumerable:!0});Object.defineProperty(Ir.prototype,"wasClean",{enumerable:!0});var Nn=class extends Tt{constructor(e,n={}){super(e),this[rx]=n.error===void 0?null:n.error,this[nx]=n.message===void 0?"":n.message}get error(){return this[rx]}get message(){return this[nx]}};Object.defineProperty(Nn.prototype,"error",{enumerable:!0});Object.defineProperty(Nn.prototype,"message",{enumerable:!0});var qi=class extends Tt{constructor(e,n={}){super(e),this[tx]=n.data===void 0?null:n.data}get data(){return this[tx]}};Object.defineProperty(qi.prototype,"data",{enumerable:!0});var _O={addEventListener(t,e,n={}){for(let r of this.listeners(t))if(!n[Hi]&&r[Qp]===e&&!r[Hi])return;let i;if(t==="message")i=function(o,s){let a=new qi("message",{data:s?o:o.toString()});a[Rn]=this,Na(e,this,a)};else if(t==="close")i=function(o,s){let a=new Ir("close",{code:o,reason:s.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[Rn]=this,Na(e,this,a)};else if(t==="error")i=function(o){let s=new Nn("error",{error:o,message:o.message});s[Rn]=this,Na(e,this,s)};else if(t==="open")i=function(){let o=new Tt("open");o[Rn]=this,Na(e,this,o)};else return;i[Hi]=!!n[Hi],i[Qp]=e,n.once?this.once(t,i):this.on(t,i)},removeEventListener(t,e){for(let n of this.listeners(t))if(n[Qp]===e&&!n[Hi]){this.removeListener(t,n);break}}};ax.exports={CloseEvent:Ir,ErrorEvent:Nn,Event:Tt,EventTarget:_O,MessageEvent:qi};function Na(t,e,n){typeof t=="object"&&t.handleEvent?t.handleEvent.call(t,n):t.call(e,n)}});var Da=N((g2,ux)=>{"use strict";var{tokenChars:Ji}=On();function mt(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}function bO(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&&Ji[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?(mt(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&&Ji[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),mt(n,t.slice(c,l),!0),u===44&&(mt(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(Ji[u]!==1)throw new SyntaxError(`Unexpected character at index ${d}`);c===-1?c=d:i||(i=!0),r=!1}else if(o)if(Ji[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&&Ji[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),mt(n,a,f),u===44&&(mt(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?mt(e,h,n):(a===void 0?mt(n,h,!0):i?mt(n,a,h.replace(/\\/g,"")):mt(n,a,h),mt(e,s,n)),e}function $O(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(", ")}ux.exports={format:$O,parse:bO}});var Ua=N((_2,$x)=>{"use strict";var xO=ce("events"),wO=ce("https"),SO=ce("http"),hx=ce("net"),EO=ce("tls"),{randomBytes:IO,createHash:kO}=ce("crypto"),{Duplex:v2,Readable:y2}=ce("stream"),{URL:em}=ce("url"),Kt=An(),TO=Jp(),AO=Xp(),{isBlob:OO}=On(),{BINARY_TYPES:lx,CLOSE_TIMEOUT:PO,EMPTY_BUFFER:La,GUID:CO,kForOnEventAttribute:tm,kListener:RO,kStatusCode:NO,kWebSocket:ye,NOOP:fx}=It(),{EventTarget:{addEventListener:DO,removeEventListener:LO}}=cx(),{format:MO,parse:zO}=Da(),{toBuffer:UO}=Gi(),px=Symbol("kAborted"),rm=[8,13],At=["CONNECTING","OPEN","CLOSING","CLOSED"],jO=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,re=class t extends xO{constructor(e,n,i){super(),this._binaryType=lx[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=La,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]),mx(this,e,n,i)):(this._autoPong=i.autoPong,this._closeTimeout=i.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){lx.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 TO({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 AO(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",ZO),r.on("drain",BO),r.on("error",GO),r.on("message",WO),r.on("ping",HO),r.on("pong",qO),o.onerror=JO,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),n.length>0&&e.unshift(n),e.on("close",yx),e.on("data",za),e.on("end",_x),e.on("error",bx),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[Kt.extensionName]&&this._extensions[Kt.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){He(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())}),vx(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){nm(this,e,i);return}n===void 0&&(n=!this._isServer),this._sender.ping(e||La,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){nm(this,e,i);return}n===void 0&&(n=!this._isServer),this._sender.pong(e||La,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){nm(this,e,i);return}let r={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...n};this._extensions[Kt.extensionName]||(r.compress=!1),this._sender.send(e||La,r,i)}terminate(){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){He(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:At.indexOf("CONNECTING")});Object.defineProperty(re.prototype,"CONNECTING",{enumerable:!0,value:At.indexOf("CONNECTING")});Object.defineProperty(re,"OPEN",{enumerable:!0,value:At.indexOf("OPEN")});Object.defineProperty(re.prototype,"OPEN",{enumerable:!0,value:At.indexOf("OPEN")});Object.defineProperty(re,"CLOSING",{enumerable:!0,value:At.indexOf("CLOSING")});Object.defineProperty(re.prototype,"CLOSING",{enumerable:!0,value:At.indexOf("CLOSING")});Object.defineProperty(re,"CLOSED",{enumerable:!0,value:At.indexOf("CLOSED")});Object.defineProperty(re.prototype,"CLOSED",{enumerable:!0,value:At.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[tm])return e[RO];return null},set(e){for(let n of this.listeners(t))if(n[tm]){this.removeListener(t,n);break}typeof e=="function"&&this.addEventListener(t,e,{[tm]:!0})}})});re.prototype.addEventListener=DO;re.prototype.removeEventListener=LO;$x.exports=re;function mx(t,e,n,i){let r={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:PO,protocolVersion:rm[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,!rm.includes(r.protocolVersion))throw new RangeError(`Unsupported protocol version: ${r.protocolVersion} (supported versions: ${rm.join(", ")})`);let o;if(e instanceof em)o=e;else try{o=new em(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 _=new SyntaxError(c);if(t._redirects===0)throw _;Ma(t,_);return}let u=s?443:80,l=IO(16).toString("base64"),d=s?wO.request:SO.request,h=new Set,f;if(r.createConnection=r.createConnection||(s?VO:FO),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 Kt({...r.perMessageDeflate,isServer:!1,maxPayload:r.maxPayload}),r.headers["Sec-WebSocket-Extensions"]=MO({[Kt.extensionName]:f.offer()})),n.length){for(let _ of n){if(typeof _!="string"||!jO.test(_)||h.has(_))throw new SyntaxError("An invalid or duplicated subprotocol was specified");h.add(_)}r.headers["Sec-WebSocket-Protocol"]=n.join(",")}if(r.origin&&(r.protocolVersion<13?r.headers["Sec-WebSocket-Origin"]=r.origin:r.headers.Origin=r.origin),(o.username||o.password)&&(r.auth=`${o.username}:${o.password}`),a){let _=r.path.split(":");r.socketPath=_[0],r.path=_[1]}let p;if(r.followRedirects){if(t._redirects===0){t._originalIpc=a,t._originalSecure=s,t._originalHostOrSocketPath=a?r.socketPath:o.host;let _=i&&i.headers;if(i={...i,headers:{}},_)for(let[$,I]of Object.entries(_))i.headers[$.toLowerCase()]=I}else if(t.listenerCount("redirect")===0){let _=a?t._originalIpc?r.socketPath===t._originalHostOrSocketPath:!1:t._originalIpc?!1:o.host===t._originalHostOrSocketPath;(!_||t._originalSecure&&!s)&&(delete r.headers.authorization,delete r.headers.cookie,_||delete r.headers.host,r.auth=void 0)}r.auth&&!i.headers.authorization&&(i.headers.authorization="Basic "+Buffer.from(r.auth).toString("base64")),p=t._req=d(r),t._redirects&&t.emit("redirect",t.url,p)}else p=t._req=d(r);r.timeout&&p.on("timeout",()=>{He(t,p,"Opening handshake has timed out")}),p.on("error",_=>{p===null||p[px]||(p=t._req=null,Ma(t,_))}),p.on("response",_=>{let $=_.headers.location,I=_.statusCode;if($&&r.followRedirects&&I>=300&&I<400){if(++t._redirects>r.maxRedirects){He(t,p,"Maximum redirects exceeded");return}p.abort();let A;try{A=new em($,e)}catch{let w=new SyntaxError(`Invalid URL: ${$}`);Ma(t,w);return}mx(t,A,n,i)}else t.emit("unexpected-response",p,_)||He(t,p,`Unexpected server response: ${_.statusCode}`)}),p.on("upgrade",(_,$,I)=>{if(t.emit("upgrade",_),t.readyState!==re.CONNECTING)return;p=t._req=null;let A=_.headers.upgrade;if(A===void 0||A.toLowerCase()!=="websocket"){He(t,$,"Invalid Upgrade header");return}let O=kO("sha1").update(l+CO).digest("base64");if(_.headers["sec-websocket-accept"]!==O){He(t,$,"Invalid Sec-WebSocket-Accept header");return}let w=_.headers["sec-websocket-protocol"],k;if(w!==void 0?h.size?h.has(w)||(k="Server sent an invalid subprotocol"):k="Server sent a subprotocol but none was requested":h.size&&(k="Server sent no subprotocol"),k){He(t,$,k);return}w&&(t._protocol=w);let z=_.headers["sec-websocket-extensions"];if(z!==void 0){if(!f){He(t,$,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let U;try{U=zO(z)}catch{He(t,$,"Invalid Sec-WebSocket-Extensions header");return}let H=Object.keys(U);if(H.length!==1||H[0]!==Kt.extensionName){He(t,$,"Server indicated an extension that was not requested");return}try{f.accept(U[Kt.extensionName])}catch{He(t,$,"Invalid Sec-WebSocket-Extensions header");return}t._extensions[Kt.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 Ma(t,e){t._readyState=re.CLOSING,t._errorEmitted=!0,t.emit("error",e),t.emitClose()}function FO(t){return t.path=t.socketPath,hx.connect(t)}function VO(t){return t.path=void 0,!t.servername&&t.servername!==""&&(t.servername=hx.isIP(t.host)?"":t.host),EO.connect(t)}function He(t,e,n){t._readyState=re.CLOSING;let i=new Error(n);Error.captureStackTrace(i,He),e.setHeader?(e[px]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Ma,t,i)):(e.destroy(i),e.once("error",t.emit.bind(t,"error")),e.once("close",t.emitClose.bind(t)))}function nm(t,e,n){if(e){let i=OO(e)?e.size:UO(e).length;t._socket?t._sender._bufferedBytes+=i:t._bufferedAmount+=i}if(n){let i=new Error(`WebSocket is not open: readyState ${t.readyState} (${At[t.readyState]})`);process.nextTick(n,i)}}function ZO(t,e){let n=this[ye];n._closeFrameReceived=!0,n._closeMessage=e,n._closeCode=t,n._socket[ye]!==void 0&&(n._socket.removeListener("data",za),process.nextTick(gx,n._socket),t===1005?n.close():n.close(t,e))}function BO(){let t=this[ye];t.isPaused||t._socket.resume()}function GO(t){let e=this[ye];e._socket[ye]!==void 0&&(e._socket.removeListener("data",za),process.nextTick(gx,e._socket),e.close(t[NO])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t))}function dx(){this[ye].emitClose()}function WO(t,e){this[ye].emit("message",t,e)}function HO(t){let e=this[ye];e._autoPong&&e.pong(t,!this._isServer,fx),e.emit("ping",t)}function qO(t){this[ye].emit("pong",t)}function gx(t){t.resume()}function JO(t){let e=this[ye];e.readyState!==re.CLOSED&&(e.readyState===re.OPEN&&(e._readyState=re.CLOSING,vx(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t)))}function vx(t){t._closeTimer=setTimeout(t._socket.destroy.bind(t._socket),t._closeTimeout)}function yx(){let t=this[ye];if(this.removeListener("close",yx),this.removeListener("data",za),this.removeListener("end",_x),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",dx),t._receiver.on("finish",dx))}function za(t){this[ye]._receiver.write(t)||this.pause()}function _x(){let t=this[ye];t._readyState=re.CLOSING,t._receiver.end(),this.end()}function bx(){let t=this[ye];this.removeListener("error",bx),this.on("error",fx),t&&(t._readyState=re.CLOSING,this.destroy())}});var Ex=N(($2,Sx)=>{"use strict";var b2=Ua(),{Duplex:KO}=ce("stream");function xx(t){t.emit("close")}function YO(){!this.destroyed&&this._writableState.finished&&this.destroy()}function wx(t){this.removeListener("error",wx),this.destroy(),this.listenerCount("error")===0&&this.emit("error",t)}function XO(t,e){let n=!0,i=new KO({...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(xx,i);return}let s=!1;t.once("error",function(c){s=!0,o(c)}),t.once("close",function(){s||o(r),process.nextTick(xx,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",YO),i.on("error",wx),i}Sx.exports=XO});var im=N((x2,Ix)=>{"use strict";var{tokenChars:QO}=On();function eP(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&&QO[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}Ix.exports={parse:eP}});var Rx=N((S2,Cx)=>{"use strict";var tP=ce("events"),ja=ce("http"),{Duplex:w2}=ce("stream"),{createHash:rP}=ce("crypto"),kx=Da(),kr=An(),nP=im(),iP=Ua(),{CLOSE_TIMEOUT:oP,GUID:sP,kWebSocket:aP}=It(),cP=/^[+/0-9A-Za-z]{22}==$/,Tx=0,Ax=1,Px=2,om=class extends tP{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:oP,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:iP,...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=ja.createServer((i,r)=>{let o=ja.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=uP(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=Tx}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===Px){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Ki,this);return}if(e&&this.once("close",e),this._state!==Ax)if(this._state=Ax,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(Ki,this):process.nextTick(Ki,this);else{let n=this._server;this._removeListeners(),this._removeListeners=this._server=null,n.close(()=>{Ki(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",Ox);let o=e.headers["sec-websocket-key"],s=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){Tr(this,e,n,405,"Invalid HTTP method");return}if(s===void 0||s.toLowerCase()!=="websocket"){Tr(this,e,n,400,"Invalid Upgrade header");return}if(o===void 0||!cP.test(o)){Tr(this,e,n,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){Tr(this,e,n,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){Yi(n,400);return}let c=e.headers["sec-websocket-protocol"],u=new Set;if(c!==void 0)try{u=nP.parse(c)}catch{Tr(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 kr({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let f=kx.parse(l);f[kr.extensionName]&&(h.accept(f[kr.extensionName]),d[kr.extensionName]=h)}catch{Tr(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,_,$)=>{if(!f)return Yi(n,p||401,_,$);this.completeUpgrade(d,o,u,e,n,i,r)});return}if(!this.options.verifyClient(h))return Yi(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[aP])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Tx)return Yi(o,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${rP("sha1").update(n+sP).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[kr.extensionName]){let d=e[kr.extensionName].params,h=kx.format({[kr.extensionName]:[d]});u.push(`Sec-WebSocket-Extensions: ${h}`),l._extensions=e}this.emit("headers",u,r),o.write(u.concat(`\r
72
72
  `).join(`\r
73
- `)),o.removeListener("error",kx),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(Hi,this)})),a(l,r)}};Ax.exports=tm;function eP(t,e){for(let n of Object.keys(e))t.on(n,e[n]);return function(){for(let i of Object.keys(e))t.removeListener(i,e[i])}}function Hi(t){t._state=Tx,t.emit("close")}function kx(){this.destroy()}function qi(t,e,n,i){n=n||La.STATUS_CODES[e],i={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(n),...i},t.once("finish",t.destroy),t.end(`HTTP/1.1 ${e} ${La.STATUS_CODES[e]}\r
73
+ `)),o.removeListener("error",Ox),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(Ki,this)})),a(l,r)}};Cx.exports=om;function uP(t,e){for(let n of Object.keys(e))t.on(n,e[n]);return function(){for(let i of Object.keys(e))t.removeListener(i,e[i])}}function Ki(t){t._state=Px,t.emit("close")}function Ox(){this.destroy()}function Yi(t,e,n,i){n=n||ja.STATUS_CODES[e],i={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(n),...i},t.once("finish",t.destroy),t.end(`HTTP/1.1 ${e} ${ja.STATUS_CODES[e]}\r
74
74
  `+Object.keys(i).map(r=>`${r}: ${i[r]}`).join(`\r
75
75
  `)+`\r
76
76
  \r
77
- `+n)}function Er(t,e,n,i,r,o){if(t.listenerCount("wsClientError")){let s=new Error(r);Error.captureStackTrace(s,Er),t.emit("wsClientError",s,n,e)}else qi(n,i,r,o)}});var tP,rP,nP,iP,oP,sP,rm,aP,Px=g(()=>{tP=Je(xx(),1),rP=Je(Ca(),1),nP=Je(Sn(),1),iP=Je(Gp(),1),oP=Je(qp(),1),sP=Je(em(),1),rm=Je(za(),1),aP=Je(Ox(),1)});function cP(t){return Array.isArray(t)?Buffer.concat(t).toString("utf8"):Buffer.isBuffer(t)?t.toString("utf8"):Buffer.from(t).toString("utf8")}var On,Ua=g(()=>{"use strict";Px();On=(t,e)=>{let n=new rm.default(t,{headers:e});return{send:i=>n.send(i),close:()=>n.close(),onOpen:i=>{n.on("open",i)},onMessage:i=>{n.on("message",r=>i(cP(r)))},onError:i=>{n.on("error",i)},onClose:i=>{n.on("close",()=>i())}}}});function ja(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 Ir(t){return t instanceof Error?t.name==="TimeoutError"||t.name==="AbortError"?"request timed out":t.message:"network error"}function mP(t){try{let e=new URL(t);return e.username="",e.password="",e.toString()}catch{return"the configured url"}}function Jt(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}async function Fa(t,e,n,i){let r=await n(t,{headers:e,signal:i});if(!r.ok)throw new Ma(r.status);try{return await r.json()}catch{throw new Error("invalid JSON response")}}function nm(t){let e={};for(let[n,i]of Object.entries(t))i!==void 0&&i.length>0&&(e[n]=i);if(Object.keys(e).length===0)throw new Error("catalogue curated to nothing");return e}function yP(t){return!/^gpt-(4\.1|4o|5)/.test(t)&&!/^o\d/.test(t)||vP.test(t)?!1:!/-(audio|realtime|transcribe|tts|image|search|codex|chat-latest|instruct|deep-research|pro)\b/.test(t)}function kr(t){let e=im[t];return e===void 0||e.keyEnv!==void 0}var uP,lP,dP,hP,fP,pP,Ma,gP,vP,_P,bP,$P,im,Pn,Va=g(()=>{"use strict";he();Rp();wa();Ua();uP=async(t,e,n)=>{let i=await e("https://api.openai.com/v1/models",{headers:{Authorization:`Bearer ${t}`},signal:n});return ja(i.status)},lP=async(t,e,n)=>{let i=await e("https://api.anthropic.com/v1/models",{headers:{"x-api-key":t,"anthropic-version":"2023-06-01"},signal:n});return ja(i.status)},dP=async(t,e,n)=>{let i=await e("https://api.deepgram.com/v1/projects",{headers:{Authorization:`Token ${t}`},signal:n});return ja(i.status)},hP=async(t,e,n)=>{let i=await e("https://api.elevenlabs.io/v1/user",{headers:{"xi-api-key":t},signal:n});return i.status===401||i.status===403?{ok:!1,status:"unverifiable",detail:"an ElevenLabs key scoped to the voice endpoints cannot reach a free validation endpoint; it will be confirmed at first use"}:ja(i.status)},fP=(t,e,n,i)=>new Promise(r=>{let o=!1,s=null,a=l=>{o||(o=!0,s?.close(),r(l))};if(n.aborted){a({ok:!1,status:"unreachable",detail:"request timed out"});return}n.addEventListener("abort",()=>a({ok:!1,status:"unreachable",detail:"request timed out"}),{once:!0});let c=i?.url??xa,u=i?.socketFactory??On;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:Ir(d)})),l.onClose(()=>a({ok:!1,status:"unreachable",detail:"connection closed before open"}))}catch(l){a({ok:!1,status:"unreachable",detail:Ir(l)})}}),pP=async(t,e,n,i)=>{let r=i?.url??Pp;try{return(await e(r,{signal:n})).body?.cancel().catch(()=>{}),{ok:!0,status:"valid",detail:`server reachable at ${mP(r)}`}}catch(o){return{ok:!1,status:"unreachable",detail:Ir(o)}}};Ma=class extends Error{status;constructor(e){super(`HTTP ${e}`),this.status=e,this.name="CatalogueHttpError"}};gP=async(t,e,n)=>{if(!t)throw new Error("API key required");let i=await Fa("https://api.anthropic.com/v1/models?limit=100",{"x-api-key":t,"anthropic-version":"2023-06-01"},e,n),r=Jt(i)&&Array.isArray(i.data)?i.data:[],o=[];for(let s of r){if(!Jt(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 nm({text:o})},vP=/-\d{4}-\d{2}-\d{2}$/;_P=async(t,e,n)=>{if(!t)throw new Error("API key required");let i=await Fa("https://api.openai.com/v1/models",{Authorization:`Bearer ${t}`},e,n),r=Jt(i)&&Array.isArray(i.data)?i.data:[],o=[];for(let a of r)Jt(a)&&typeof a.id=="string"&&o.push(a.id);o.sort();let s=a=>o.filter(a).map(c=>({id:c}));return nm({text:s(yP),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-"))})},bP=async(t,e,n)=>{let i=await Fa("https://api.deepgram.com/v1/models",{},e,n),r=Jt(i)&&Array.isArray(i.stt)?i.stt:[],o=new Set,s=[];for(let a of r){if(!Jt(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})),nm({stt:s.map(({id:a})=>({id:a}))})},$P=async(t,e,n)=>{let i=await Fa("https://api.elevenlabs.io/v2/voices?page_size=100",{"xi-api-key":t},e,n),r=Jt(i)&&Array.isArray(i.voices)?i.voices:[],o=[];for(let s of r){if(!Jt(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},im={elevenlabs:{capabilities:["stt","tts"],defaultModel:{stt:"scribe_v2_realtime",tts:"eleven_flash_v2_5"},keyEnv:"ELEVENLABS_API_KEY",probe:hP,listVoices:$P},anthropic:{capabilities:["text"],defaultModel:{text:"claude-opus-4-8"},fastModel:{text:"claude-sonnet-5"},keyEnv:"ANTHROPIC_API_KEY",probe:lP,listModels:gP},openai:{capabilities:["text","stt","tts","embedding"],defaultModel:{text:"gpt-4o",stt:"whisper-1",tts:"tts-1",embedding:"text-embedding-3-small"},fastModel:{text:"gpt-4o-mini"},keyEnv:"OPENAI_API_KEY",probe:uP,listModels:_P},deepgram:{capabilities:["stt"],defaultModel:{stt:"nova-3-general"},keyEnv:"DEEPGRAM_API_KEY",probe:dP,listModels:bP,keylessLister:!0},"sherpa-onnx":{capabilities:["stt"],defaultModel:{stt:"parakeet-tdt-0.6b-v3"},probe:fP},"openai-compat":{capabilities:["stt"],defaultModel:{stt:Cp},probe:pP}};Pn=class{fetchImpl;socketFactory;timeoutMs=3e3;providers;constructor(e=fetch,n=On){this.fetchImpl=e,this.socketFactory=n,this.providers=im}async probe(e,n,i){let r=this.providers[e]?.probe;if(!r)return{ok:!1,status:"unimplemented",detail:`no probe for provider '${e}'`};let o=i?.signal??AbortSignal.timeout(this.timeoutMs),s={socketFactory:this.socketFactory,...i?.url!==void 0&&{url:i.url}};try{return await r(n,this.fetchImpl,o,s)}catch(a){return{ok:!1,status:"unreachable",detail:Ir(a)}}}async listVoices(e,n,i){let r=this.providers[e]?.listVoices;if(!r)return{ok:!1,reason:"no_catalogue"};let o=i?.signal??AbortSignal.timeout(this.timeoutMs);try{let s=await r(n,this.fetchImpl,o);return s.length===0?{ok:!1,reason:"empty"}:{ok:!0,voices:s}}catch(s){return U.debug("voice catalogue unavailable",{provider:e,detail:Ir(s)}),s instanceof Ma&&(s.status===401||s.status===403)?{ok:!1,reason:"unauthorized"}:{ok:!1,reason:"unreachable",detail:Ir(s)}}}providersFor(e){return Object.keys(this.providers).filter(n=>this.providers[n].capabilities.includes(e))}defaultModel(e,n){return this.providers[e]?.defaultModel[n]}requiresKey(e){return kr(e)}}});var Cx,Rx,Ji,om=g(()=>{"use strict";Cx="You are Jarvis, a voice-first personal agent and a continuous, trusted collaborator - not a disposable chat assistant. You help with software engineering work. Be concise, direct, and technical; skip filler and preamble. When you are unsure, say so plainly rather than guessing. You reason and explain; you do not yet take actions or use tools, so propose the next steps for the human to run rather than claiming to have run them.",Rx=`This conversation is spoken aloud. Follow the voice register:
77
+ `+n)}function Tr(t,e,n,i,r,o){if(t.listenerCount("wsClientError")){let s=new Error(r);Error.captureStackTrace(s,Tr),t.emit("wsClientError",s,n,e)}else Yi(n,i,r,o)}});var lP,dP,hP,fP,pP,mP,sm,gP,Nx=g(()=>{lP=Je(Ex(),1),dP=Je(Da(),1),hP=Je(An(),1),fP=Je(Jp(),1),pP=Je(Xp(),1),mP=Je(im(),1),sm=Je(Ua(),1),gP=Je(Rx(),1)});function vP(t){return Array.isArray(t)?Buffer.concat(t).toString("utf8"):Buffer.isBuffer(t)?t.toString("utf8"):Buffer.from(t).toString("utf8")}var Dn,Fa=g(()=>{"use strict";Nx();Dn=(t,e)=>{let n=new sm.default(t,{headers:e});return{send:i=>n.send(i),close:()=>n.close(),onOpen:i=>{n.on("open",i)},onMessage:i=>{n.on("message",r=>i(vP(r)))},onError:i=>{n.on("error",i)},onClose:i=>{n.on("close",()=>i())}}}});function Za(t){return t>=200&&t<300?{ok:!0,status:"valid"}:t===401||t===403?{ok:!1,status:"invalid",detail:`key rejected (HTTP ${t})`}:{ok:!1,status:"unreachable",detail:`unexpected response (HTTP ${t})`}}function Yt(t,e){return t instanceof Error?t.name==="TimeoutError"||t.name==="AbortError"?"request timed out":yP(t.message,e):"network error"}function yP(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 EP(t){try{let e=new URL(t);return e.username="",e.password="",e.toString()}catch{return"the configured url"}}function Xt(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}async function Ba(t,e,n,i){let r=await n(t,{headers:e,signal:i});if(!r.ok)throw new Va(r.status);try{return await r.json()}catch{throw new Error("invalid JSON response")}}function am(t){let e={};for(let[n,i]of Object.entries(t))i!==void 0&&i.length>0&&(e[n]=i);if(Object.keys(e).length===0)throw new Error("catalogue curated to nothing");return e}function TP(t){return!/^gpt-(4\.1|4o|5)/.test(t)&&!/^o\d/.test(t)||kP.test(t)?!1:!/-(audio|realtime|transcribe|tts|image|search|codex|chat-latest|instruct|deep-research|pro)\b/.test(t)}function Or(t){let e=Ga[t];return e===void 0||e.keyEnv!==void 0}var _P,bP,$P,xP,wP,SP,Va,IP,kP,AP,OP,PP,Ga,Ar,Wa=g(()=>{"use strict";he();Mp();Ia();Fa();_P=async(t,e,n)=>{let i=await e("https://api.openai.com/v1/models",{headers:{Authorization:`Bearer ${t}`},signal:n});return Za(i.status)},bP=async(t,e,n)=>{let i=await e("https://api.anthropic.com/v1/models",{headers:{"x-api-key":t,"anthropic-version":"2023-06-01"},signal:n});return Za(i.status)},$P=async(t,e,n)=>{let i=await e("https://api.deepgram.com/v1/projects",{headers:{Authorization:`Token ${t}`},signal:n});return Za(i.status)},xP=async(t,e,n)=>{let i=await e("https://api.elevenlabs.io/v1/user",{headers:{"xi-api-key":t},signal:n});return i.status===401||i.status===403?{ok:!1,status:"unverifiable",detail:"an ElevenLabs key scoped to the voice endpoints cannot reach a free validation endpoint; it will be confirmed at first use"}:Za(i.status)},wP=(t,e,n,i)=>new Promise(r=>{let o=!1,s=null,a=l=>{o||(o=!0,s?.close(),r(l))};if(n.aborted){a({ok:!1,status:"unreachable",detail:"request timed out"});return}n.addEventListener("abort",()=>a({ok:!1,status:"unreachable",detail:"request timed out"}),{once:!0});let c=i?.url??Ea,u=i?.socketFactory??Dn;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:Yt(d,t)})),l.onClose(()=>a({ok:!1,status:"unreachable",detail:"connection closed before open"}))}catch(l){a({ok:!1,status:"unreachable",detail:Yt(l,t)})}}),SP=async(t,e,n,i)=>{let r=i?.url??Dp;try{return(await e(r,{signal:n})).body?.cancel().catch(()=>{}),{ok:!0,status:"valid",detail:`server reachable at ${EP(r)}`}}catch(o){return{ok:!1,status:"unreachable",detail:Yt(o,t)}}};Va=class extends Error{status;constructor(e){super(`HTTP ${e}`),this.status=e,this.name="CatalogueHttpError"}};IP=async(t,e,n)=>{if(!t)throw new Error("API key required");let i=await Ba("https://api.anthropic.com/v1/models?limit=100",{"x-api-key":t,"anthropic-version":"2023-06-01"},e,n),r=Xt(i)&&Array.isArray(i.data)?i.data:[],o=[];for(let s of r){if(!Xt(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 am({text:o})},kP=/-\d{4}-\d{2}-\d{2}$/;AP=async(t,e,n)=>{if(!t)throw new Error("API key required");let i=await Ba("https://api.openai.com/v1/models",{Authorization:`Bearer ${t}`},e,n),r=Xt(i)&&Array.isArray(i.data)?i.data:[],o=[];for(let a of r)Xt(a)&&typeof a.id=="string"&&o.push(a.id);o.sort();let s=a=>o.filter(a).map(c=>({id:c}));return am({text:s(TP),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-"))})},OP=async(t,e,n)=>{let i=await Ba("https://api.deepgram.com/v1/models",{},e,n),r=Xt(i)&&Array.isArray(i.stt)?i.stt:[],o=new Set,s=[];for(let a of r){if(!Xt(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})),am({stt:s.map(({id:a})=>({id:a}))})},PP=async(t,e,n)=>{let i=await Ba("https://api.elevenlabs.io/v2/voices?page_size=100",{"xi-api-key":t},e,n),r=Xt(i)&&Array.isArray(i.voices)?i.voices:[],o=[];for(let s of r){if(!Xt(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},Ga={elevenlabs:{capabilities:["stt","tts"],defaultModel:{stt:"scribe_v2_realtime",tts:"eleven_flash_v2_5"},keyEnv:"ELEVENLABS_API_KEY",probe:xP,listVoices:PP},anthropic:{capabilities:["text"],defaultModel:{text:"claude-opus-4-8"},fastModel:{text:"claude-sonnet-5"},keyEnv:"ANTHROPIC_API_KEY",probe:bP,listModels:IP},openai:{capabilities:["text","stt","tts","embedding"],defaultModel:{text:"gpt-4o",stt:"whisper-1",tts:"tts-1",embedding:"text-embedding-3-small"},fastModel:{text:"gpt-4o-mini"},keyEnv:"OPENAI_API_KEY",probe:_P,listModels:AP},deepgram:{capabilities:["stt"],defaultModel:{stt:"nova-3-general"},keyEnv:"DEEPGRAM_API_KEY",probe:$P,listModels:OP,keylessLister:!0},"sherpa-onnx":{capabilities:["stt"],defaultModel:{stt:"parakeet-tdt-0.6b-v3"},probe:wP},"openai-compat":{capabilities:["stt"],defaultModel:{stt:Lp},probe:SP}};Ar=class{fetchImpl;socketFactory;timeoutMs=3e3;providers;constructor(e=fetch,n=Dn){this.fetchImpl=e,this.socketFactory=n,this.providers=Ga}async probe(e,n,i){let r=this.providers[e]?.probe;if(!r)return{ok:!1,status:"unimplemented",detail:`no probe for provider '${e}'`};let o=i?.signal??AbortSignal.timeout(this.timeoutMs),s={socketFactory:this.socketFactory,...i?.url!==void 0&&{url:i.url}};try{return await r(n,this.fetchImpl,o,s)}catch(a){return{ok:!1,status:"unreachable",detail:Yt(a,n)}}}async listVoices(e,n,i){let r=this.providers[e]?.listVoices;if(!r)return{ok:!1,reason:"no_catalogue"};let o=i?.signal??AbortSignal.timeout(this.timeoutMs);try{let s=await r(n,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:Yt(s,n)}),s instanceof Va&&(s.status===401||s.status===403)?{ok:!1,reason:"unauthorized"}:{ok:!1,reason:"unreachable",detail:Yt(s,n)}}}providersFor(e){return Object.keys(this.providers).filter(n=>this.providers[n].capabilities.includes(e))}defaultModel(e,n){return this.providers[e]?.defaultModel[n]}requiresKey(e){return Or(e)}}});var Dx,Lx,Xi,cm=g(()=>{"use strict";Dx="You are Jarvis, a voice-first personal agent and a continuous, trusted collaborator - not a disposable chat assistant. You help with software engineering work. Be concise, direct, and technical; skip filler and preamble. When you are unsure, say so plainly rather than guessing. You reason and explain; you do not yet take actions or use tools, so propose the next steps for the human to run rather than claiming to have run them.",Lx=`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.`,Ji=class{adapter;model;systemPrompt;history=[];constructor(e,n,i=Cx){this.adapter=e,this.model=n,this.systemPrompt=i}async*run(e,n,i){if(e.trim()==="")return;let r=this.assemble(e),o=i?.register==="voice"?`${this.systemPrompt}
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.`,Xi=class{adapter;model;systemPrompt;history=[];constructor(e,n,i=Dx){this.adapter=e,this.model=n,this.systemPrompt=i}async*run(e,n,i){if(e.trim()==="")return;let r=this.assemble(e),o=i?.register==="voice"?`${this.systemPrompt}
83
83
 
84
- ${Rx}`:this.systemPrompt,s="";for await(let a of this.adapter.stream({model:this.model,system:o,messages:r,...n!==void 0&&{signal:n}}))s+=a.text,yield a;this.history.push({role:"user",content:e},{role:"assistant",content:s})}historySnapshot(){return[...this.history]}assemble(e){return[...this.history,{role:"user",content:e}]}}});var Za,Dx=g(()=>{"use strict";Za=class{buffer=[];pending=null;closed=!1;push(e){if(this.closed)return;let n=this.pending;if(n){this.pending=null,n({value:e,done:!1});return}this.buffer.push(e)}close(){if(this.closed)return;this.closed=!0;let e=this.pending;e&&(this.pending=null,e({value:void 0,done:!0}))}async*drain(){for(;;){if(this.buffer.length>0){yield this.buffer.shift();continue}if(this.closed)return;let e=await new Promise(n=>{this.pending=n});if(e.done)return;yield e.value}}}});function TP(t){let e=[];if(t.recentTurns.length>0){e.push("Recent conversation:");for(let n of t.recentTurns)e.push(`${n.role==="assistant"?"Assistant":"User"}: ${n.text}`)}else e.push("Recent conversation: (none)");return e.push(""),e.push("Committed utterance (what the user just said):"),e.push(JSON.stringify(t.utterance)),e.join(`
85
- `)}function AP(t){let e=sm(t)?.content,n=(Array.isArray(e)?e:[]).map(l=>sm(l)).filter(l=>l?.type==="text").map(l=>typeof l?.text=="string"?l.text:"").join(""),i=Nx+n;i.includes("}")||(i+="}");let r=i.indexOf("{"),o=i.lastIndexOf("}");if(r===-1||o<=r)throw new Kt("addressee evaluator reply carried no JSON object");let s;try{s=JSON.parse(i.slice(r,o+1))}catch{throw new Kt("addressee evaluator reply was not valid JSON")}let a=sm(s),c=a?.verdict;if(typeof c!="string"||!IP.includes(c))throw new Kt("addressee evaluator reply carried an unknown verdict");let u=a?.confidence;if(typeof u!="number"||!Number.isFinite(u)||u<0||u>1)throw new Kt("addressee evaluator confidence missing or out of range");return{verdict:c,confidence:u}}function sm(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0}var xP,wP,SP,Nx,EP,IP,kP,Kt,Cn,Ba=g(()=>{"use strict";xP="claude-haiku-4-5-20251001",wP="https://api.anthropic.com/v1/messages",SP="2023-06-01",Nx='{"verdict":"',EP=["}"],IP=["to_jarvis","to_other","self_talk"],kP=`You are the addressee evaluator inside a real-time voice assistant's
84
+ ${Lx}`:this.systemPrompt,s="";for await(let a of this.adapter.stream({model:this.model,system:o,messages:r,...n!==void 0&&{signal:n}}))s+=a.text,yield a;this.history.push({role:"user",content:e},{role:"assistant",content:s})}historySnapshot(){return[...this.history]}assemble(e){return[...this.history,{role:"user",content:e}]}}});var Ha,Mx=g(()=>{"use strict";Ha=class{buffer=[];pending=null;closed=!1;push(e){if(this.closed)return;let n=this.pending;if(n){this.pending=null,n({value:e,done:!1});return}this.buffer.push(e)}close(){if(this.closed)return;this.closed=!0;let e=this.pending;e&&(this.pending=null,e({value:void 0,done:!0}))}async*drain(){for(;;){if(this.buffer.length>0){yield this.buffer.shift();continue}if(this.closed)return;let e=await new Promise(n=>{this.pending=n});if(e.done)return;yield e.value}}}});function zP(t){let e=[];if(t.recentTurns.length>0){e.push("Recent conversation:");for(let n of t.recentTurns)e.push(`${n.role==="assistant"?"Assistant":"User"}: ${n.text}`)}else e.push("Recent conversation: (none)");return e.push(""),e.push("Committed utterance (what the user just said):"),e.push(JSON.stringify(t.utterance)),e.join(`
85
+ `)}function UP(t){let e=um(t)?.content,n=(Array.isArray(e)?e:[]).map(l=>um(l)).filter(l=>l?.type==="text").map(l=>typeof l?.text=="string"?l.text:"").join(""),i=zx+n;i.includes("}")||(i+="}");let r=i.indexOf("{"),o=i.lastIndexOf("}");if(r===-1||o<=r)throw new Qt("addressee evaluator reply carried no JSON object");let s;try{s=JSON.parse(i.slice(r,o+1))}catch{throw new Qt("addressee evaluator reply was not valid JSON")}let a=um(s),c=a?.verdict;if(typeof c!="string"||!LP.includes(c))throw new Qt("addressee evaluator reply carried an unknown verdict");let u=a?.confidence;if(typeof u!="number"||!Number.isFinite(u)||u<0||u>1)throw new Qt("addressee evaluator confidence missing or out of range");return{verdict:c,confidence:u}}function um(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0}var CP,RP,NP,zx,DP,LP,MP,Qt,Ln,qa=g(()=>{"use strict";CP="claude-haiku-4-5-20251001",RP="https://api.anthropic.com/v1/messages",NP="2023-06-01",zx='{"verdict":"',DP=["}"],LP=["to_jarvis","to_other","self_talk"],MP=`You are the addressee evaluator inside a real-time voice assistant's
86
86
  turn-taking system. The assistant is in an active voice session with its
87
87
  user; an open microphone commits everything the user says, but not
88
88
  everything the user says is FOR the assistant. Your only job is to judge
@@ -142,9 +142,9 @@ Rules:
142
142
  Output exactly one line of strict JSON and nothing else:
143
143
  {"verdict":"to_jarvis"|"to_other"|"self_talk","confidence":<number 0..1>}
144
144
  confidence is your certainty in the verdict.
145
- `,Kt=class extends Error{status;constructor(e,n){super(e),this.status=n,this.name="AddresseeEvaluatorError"}},Cn=class{key;fetchImpl;timeoutMs;constructor(e,n=fetch,i=1200){this.key=e,this.fetchImpl=n,this.timeoutMs=i}async evaluate(e,n,i){let r={model:xP,max_tokens:64,temperature:0,stop_sequences:EP,system:kP,messages:[{role:"user",content:TP(e)},{role:"assistant",content:Nx}]},o=await this.fetchImpl(wP,{method:"POST",headers:{"x-api-key":this.key,"anthropic-version":SP,"content-type":"application/json"},body:JSON.stringify(r),signal:AbortSignal.any([n,AbortSignal.timeout(i?.timeoutMs??this.timeoutMs)])});if(!o.ok)throw new Kt(`addressee evaluator request failed (HTTP ${o.status})`,o.status);let s;try{s=await o.json()}catch{throw new Kt("addressee evaluator response body was not JSON")}return AP(s)}}});var OP,PP,zx,Ki,am=g(()=>{"use strict";OP=new Set([".","!","?"]),PP=new Set([",",";",":"]),zx={minClauseLength:12},Ki=class{buffer="";minClauseLength;constructor(e=zx){this.minClauseLength=e.minClauseLength}push(e){this.buffer+=e;let n=[];for(let i=this.findBoundary();i!==-1;i=this.findBoundary()){let r=this.buffer.slice(0,i+1).trim();this.buffer=this.buffer.slice(i+1).replace(/^\s+/,""),r.length>0&&n.push(r)}return n}flush(){let e=this.buffer.trim();return this.buffer="",e.length>0?[e]:[]}findBoundary(){for(let e=0;e<this.buffer.length;e++){let n=this.buffer[e];if(n===`
146
- `)return e;let i=e+1<this.buffer.length?this.buffer[e+1]:"";if(i!==""&&/\s/.test(i)&&(OP.has(n)||PP.has(n)&&e+1>=this.minClauseLength))return e}return-1}}});var Ga,Tr,Rn,CP,Lx,cm=g(()=>{Ga=new Map,Tr=[],Rn=(t,e,n)=>{if(e&&typeof e.init=="function"&&typeof e.createInferenceSessionHandler=="function"){let i=Ga.get(t);if(i===void 0)Ga.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=Tr.indexOf(t);r!==-1&&Tr.splice(r,1);for(let o=0;o<Tr.length;o++)if(Ga.get(Tr[o]).priority<=n){Tr.splice(o,0,t);return}Tr.push(t)}return}throw new TypeError("not a valid backend")},CP=async t=>{let e=Ga.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}}},Lx=async t=>{let e=t.executionProviders||[],n=e.map(c=>typeof c=="string"?c:c.name),i=n.length===0?Tr:n,r,o=[],s=new Set;for(let c of i){let u=await CP(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 Ux=g(()=>{cm()});var Mx,jx=g(()=>{Mx="1.26.0"});var Fx,fe,um=g(()=>{jx();Fx="warning",fe={wasm:{},webgl:{},webgpu:{},versions:{common:Mx},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}`);Fx=t}},get logLevel(){return Fx}};Object.defineProperty(fe,"logLevel",{enumerable:!0})});var ie,Vx=g(()=>{um();ie=fe});var Zx,Bx,Gx=g(()=>{Zx=(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 _=0;_<o;_++)for(let b=0;b<r;b++){let E=(t.data[d++]-u[0])*c[0],C=(t.data[h++]-u[1])*c[1],A=(t.data[f++]-u[2])*c[2],I=p===-1?255:(t.data[p++]-u[3])*c[3];i.fillStyle="rgba("+E+","+C+","+A+","+I+")",i.fillRect(b,_,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")},Bx=(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,_=2,b=3,E=0,C=d,A=d*2,I=-1;a==="RGBA"?(E=0,C=d,A=d*2,I=d*3):a==="RGB"?(E=0,C=d,A=d*2):a==="RBG"&&(E=0,A=d,C=d*2),i=n.createImageData(r,o);for(let T=0;T<o*r;f+=h,p+=h,_+=h,b+=h,T++)i.data[f]=(t.data[E++]-l[0])*u[0],i.data[p]=(t.data[C++]-l[1])*u[1],i.data[_]=(t.data[A++]-l[2])*u[2],i.data[b]=I===-1?255:(t.data[I++]-l[3])*u[3]}else throw new Error("Can not access image data");return i}});var lm,Wx,Hx,qx,Jx,Kx,Yx=g(()=>{Wa();lm=(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,_=3,b=0,E=u,C=u*2,A=-1;a==="RGB"&&(d=3,h=0,f=1,p=2,_=-1),c==="RGBA"?A=u*3:c==="RBG"?(b=0,C=u,E=u*2):c==="BGR"&&(C=0,E=u,b=u*2);for(let T=0;T<u;T++,h+=d,p+=d,f+=d,_+=d)l[b++]=(t[h]+s[0])/o[0],l[E++]=(t[f]+s[1])/o[1],l[C++]=(t[p]+s[2])/o[2],A!==-1&&_!==-1&&(l[A++]=(t[_]+s[3])/o[3]);return c==="RGBA"?new _e("float32",l,[1,4,n,i]):new _e("float32",l,[1,3,n,i])},Wx=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,lm(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 _=f.getImageData(0,0,h.width,h.height);a.height=h.height,a.width=h.width,l(lm(_.data,a))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(s!==void 0)return lm(s,a);throw new Error("Input data provided is not supported - aborted tensor creation")},Hx=(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})},qx=(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})},Jx=(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})},Kx=(t,e,n)=>new _e({location:"cpu-pinned",type:t,data:e,dims:n??[e.length]})});var Ar,Yi,Xx,Qx,ew=g(()=>{Ar=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),Yi=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]),Xx=!1,Qx=()=>{if(!Xx){Xx=!0;let t=typeof BigInt64Array<"u"&&BigInt64Array.from,e=typeof BigUint64Array<"u"&&BigUint64Array.from,n=globalThis.Float16Array,i=typeof n<"u"&&n.from;t&&(Ar.set("int64",BigInt64Array),Yi.set(BigInt64Array,"int64")),e&&(Ar.set("uint64",BigUint64Array),Yi.set(BigUint64Array,"uint64")),i?(Ar.set("float16",n),Yi.set(n,"float16")):Ar.set("float16",Uint16Array)}}});var tw,rw,nw=g(()=>{Wa();tw=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},rw=(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,Wa=g(()=>{Gx();Yx();ew();nw();_e=class{constructor(e,n,i){Qx();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=Ar.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=Ar.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=Yi.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=tw(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 Wx(e,n)}static fromTexture(e,n){return Hx(e,n)}static fromGpuBuffer(e,n){return qx(e,n)}static fromMLTensor(e,n){return Jx(e,n)}static fromPinnedBuffer(e,n,i){return Kx(e,n,i)}toDataURL(e){return Zx(this,e)}toImageData(e){return Bx(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 rw(this,e)}}});var et,dm=g(()=>{Wa();et=_e});var hm,iw,Yt,Xt,Qt,er,fm=g(()=>{um();hm=(t,e)=>{(typeof fe.trace>"u"?!fe.wasm.trace:!fe.trace)||console.timeStamp(`${t}::ORT::${e}`)},iw=(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}`),hm("CPU",o);return}n[r].includes("TRACE_FUNC")&&(i=!0)}},Yt=t=>{(typeof fe.trace>"u"?!fe.wasm.trace:!fe.trace)||iw("BEGIN",t)},Xt=t=>{(typeof fe.trace>"u"?!fe.wasm.trace:!fe.trace)||iw("END",t)},Qt=t=>{(typeof fe.trace>"u"?!fe.wasm.trace:!fe.trace)||console.time(`ORT::${t}`)},er=t=>{(typeof fe.trace>"u"?!fe.wasm.trace:!fe.trace)||console.timeEnd(`ORT::${t}`)}});var Ha,ow=g(()=>{cm();dm();fm();Ha=class t{constructor(e){this.handler=e}async run(e,n,i){Yt(),Qt("InferenceSession.run");let r={},o={};if(typeof e!="object"||e===null||e instanceof et||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 et)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 et)&&(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 et?c[u]=l:c[u]=new et(l.type,l.data,l.dims)}return er("InferenceSession.run"),Xt(),c}async release(){return this.handler.dispose()}static async create(e,n,i,r){Yt(),Qt("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 Lx(s),u=await a.createInferenceSessionHandler(o,c);return er("InferenceSession.create"),Xt(),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 sw,aw=g(()=>{ow();sw=Ha});var cw=g(()=>{});var uw=g(()=>{});var lw=g(()=>{});var dw=g(()=>{});var pm={};qe(pm,{InferenceSession:()=>sw,TRACE:()=>hm,TRACE_EVENT_BEGIN:()=>Qt,TRACE_EVENT_END:()=>er,TRACE_FUNC_BEGIN:()=>Yt,TRACE_FUNC_END:()=>Xt,Tensor:()=>et,env:()=>ie,registerBackend:()=>Rn});var tr=g(()=>{Ux();Vx();aw();dm();cw();uw();fm();lw();dw()});var rS={};qe(rS,{InferenceSession:()=>sw,TRACE:()=>hm,TRACE_EVENT_BEGIN:()=>Qt,TRACE_EVENT_END:()=>er,TRACE_FUNC_BEGIN:()=>Yt,TRACE_FUNC_END:()=>Xt,Tensor:()=>et,default:()=>WP,env:()=>ie,registerBackend:()=>Rn});import{createRequire as RP}from"module";var Dn,Am,DP,NP,zP,Em,tt,LP,UP,MP,Ln,Om,mm,hw,fw,At,Tw,gm,pw,mw,gw,vw,vm,Aw,Ow,ym,qa,Xi,_m,yw,_w,bw,Pw,ee,Qi,ut,Ya,K,Pm,Cw,jP,$w,xw,ww,Or,Sw,Rw,FP,Nn,Ka,zn,Dw,Nw,Cm,Rm,zw,Lw,Xa,Uw,Ew,Mw,jw,Pr,Iw,bm,Im,Fw,Vw,$m,Zw,Bw,VP,Ja,xm,wm,Gw,Ww,Hw,qw,Jw,Kw,Yw,Xw,Sm,kw,Qw,ZP,eS,km,Tm,tS,BP,GP,WP,nS=g(()=>{tr();tr();tr();tr();tr();tr();tr();Dn=RP(import.meta.url),Am=Object.defineProperty,DP=Object.getOwnPropertyDescriptor,NP=Object.getOwnPropertyNames,zP=Object.prototype.hasOwnProperty,Em=(t=>typeof Dn<"u"?Dn:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof Dn<"u"?Dn:e)[n]}):t)(function(t){if(typeof Dn<"u")return Dn.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),tt=(t,e)=>()=>(t&&(e=t(t=0)),e),LP=(t,e)=>{for(var n in e)Am(t,n,{get:e[n],enumerable:!0})},UP=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of NP(e))!zP.call(t,r)&&r!==n&&Am(t,r,{get:()=>e[r],enumerable:!(i=DP(e,r))||i.enumerable});return t},MP=t=>UP(Am({},"__esModule",{value:!0}),t),Om=tt(()=>{"use strict";Ln=!!(typeof process<"u"&&process.versions&&process.versions.node)}),Ow=tt(()=>{"use strict";Om(),mm=Ln||typeof location>"u"?void 0:location.origin,hw=import.meta.url>"file:"&&import.meta.url<"file;",fw=()=>{if(!Ln){if(hw){let t=URL;return new URL(new t("ort.node.min.mjs",import.meta.url).href,mm).href}return import.meta.url}},At=fw(),Tw=()=>{if(At&&!At.startsWith("blob:"))return At.substring(0,At.lastIndexOf("/")+1)},gm=(t,e)=>{try{let n=e??At;return(n?new URL(t,n):new URL(t)).origin===mm}catch{return!1}},pw=(t,e)=>{let n=e??At;try{return(n?new URL(t,n):new URL(t)).href}catch{return}},mw=(t,e)=>`${e??"./"}${t}`,gw=async t=>{let e=await(await fetch(t,{credentials:"same-origin"})).blob();return URL.createObjectURL(e)},vw=async t=>(await import(t)).default,vm=void 0,Aw=async(t,e,n,i)=>{let r=vm&&!(t||e);if(r)if(At)r=gm(At)||i&&!n;else if(i&&!n)r=!0;else throw new Error("cannot determine the script source URL.");if(r)return[void 0,vm];{let o="ort-wasm-simd-threaded.mjs",s=t??pw(o,e),a=!Ln&&n&&s&&!gm(s,e),c=a?await gw(s):s??mw(o,e);return[a?c:void 0,await vw(c)]}}}),Qi=tt(()=>{"use strict";Ow(),qa=!1,Xi=!1,_m=!1,yw=()=>{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}},_w=()=>{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}},bw=()=>{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}},Pw=async t=>{if(qa)return Promise.resolve();if(Xi)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(_m)throw new Error("previous call to 'initializeWebAssembly()' failed.");Xi=!0;let e=t.initTimeout,n=t.numThreads;if(t.simd!==!1){if(t.simd==="relaxed"){if(!bw())throw new Error("Relaxed WebAssembly SIMD is not supported in the current environment.")}else if(!_w())throw new Error("WebAssembly SIMD is not supported in the current environment.")}let i=yw();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 Aw(a,o,n>1,!!l||!!u),f=!1,p=[];if(e>0&&p.push(new Promise(_=>{setTimeout(()=>{f=!0,_()},e)})),p.push(new Promise((_,b)=>{let E={numThreads:n};if(l)E.wasmBinary=l,E.locateFile=C=>C;else if(u||o)E.locateFile=C=>u??o+C;else if(a&&a.indexOf("blob:")!==0)E.locateFile=C=>new URL(C,a).href;else if(d){let C=Tw();C&&(E.locateFile=A=>C+A)}h(E).then(C=>{Xi=!1,qa=!0,ym=C,_(),d&&URL.revokeObjectURL(d)},C=>{Xi=!1,_m=!0,b(C)})})),await Promise.race(p),f)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},ee=()=>{if(qa&&ym)return ym;throw new Error("WebAssembly is not initialized yet.")}}),Pm=tt(()=>{"use strict";Qi(),ut=(t,e)=>{let n=ee(),i=n.lengthBytesUTF8(t)+1,r=n._malloc(i);return n.stringToUTF8(t,r,i),e.push(r),r},Ya=(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")Ya(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)}}}),jP=tt(()=>{"use strict";Qi(),Pm(),Cw=t=>{let e=ee(),n=0,i=[],r=t||{};try{if(t?.logSeverityLevel===void 0)r.logSeverityLevel=2;else if(typeof t.logSeverityLevel!="number"||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log severity level is not valid: ${t.logSeverityLevel}`);if(t?.logVerbosityLevel===void 0)r.logVerbosityLevel=0;else if(typeof t.logVerbosityLevel!="number"||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);t?.terminate===void 0&&(r.terminate=!1);let o=0;return t?.tag!==void 0&&(o=ut(t.tag,i)),n=e._OrtCreateRunOptions(r.logSeverityLevel,r.logVerbosityLevel,!!r.terminate,o),n===0&&K("Can't create run options."),t?.extra!==void 0&&Ya(t.extra,"",new WeakSet,(s,a)=>{let c=ut(s,i),u=ut(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}}}),FP=tt(()=>{"use strict";Qi(),Pm(),$w=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}`)}},xw=t=>{switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}},ww=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)},Or=(t,e,n,i)=>{let r=ut(e,i),o=ut(n,i);ee()._OrtAddSessionConfigEntry(t,r,o)!==0&&K(`Can't set a session config entry: ${e} - ${n}.`)},Sw=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",Or(t,"session.disable_quant_qdq","1",n),Or(t,"session.disable_qdq_constant_folding","1",n),typeof r!="string"){let d=r?.deviceType;d&&Or(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}`);Or(t,"preferredLayout",d.preferredLayout,n)}}break;case"wasm":case"cpu":continue;default:throw new Error(`not supported execution provider: ${o}`)}let a=ut(o,n),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}.`)}},Rw=async t=>{let e=ee(),n=0,i=[],r=t||{};ww(r);try{let o=$w(r.graphOptimizationLevel??"all"),s=xw(r.executionMode??"sequential"),a=typeof r.logId=="string"?ut(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"?ut(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 Sw(n,r,i),r.enableGraphCapture!==void 0){if(typeof r.enableGraphCapture!="boolean")throw new Error(`enableGraphCapture must be a boolean value: ${r.enableGraphCapture}`);Or(n,"enableGraphCapture",r.enableGraphCapture.toString(),i)}if(r.freeDimensionOverrides)for(let[d,h]of Object.entries(r.freeDimensionOverrides)){if(typeof d!="string")throw new Error(`free dimension override name must be a string: ${d}`);if(typeof h!="number"||!Number.isInteger(h)||h<0)throw new Error(`free dimension override value must be a non-negative integer: ${h}`);let f=ut(d,i);e._OrtAddFreeDimensionOverride(n,f,h)!==0&&K(`Can't set a free dimension override: ${d} - ${h}.`)}return r.extra!==void 0&&Ya(r.extra,"",new WeakSet,(d,h)=>{Or(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}}}),Lw=tt(()=>{"use strict";Nn=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}`)}},Ka=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}`)}},zn=(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},Dw=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}`)}},Nw=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}`)}},Cm=t=>t==="float32"||t==="float16"||t==="int32"||t==="int64"||t==="uint32"||t==="uint8"||t==="bool"||t==="uint4"||t==="int4",Rm=t=>t==="float32"||t==="float16"||t==="int32"||t==="int64"||t==="uint32"||t==="uint64"||t==="int8"||t==="uint8"||t==="bool"||t==="uint4"||t==="int4",zw=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}`)}}}),Uw=tt(()=>{"use strict";Om(),Xa=async t=>{if(typeof t=="string")if(Ln)try{let{readFile:e}=Em("node:fs/promises");return new Uint8Array(await e(t))}catch(e){if(e.code==="ERR_FS_FILE_TOO_LARGE"){let{createReadStream:n}=Em("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)}}),VP=tt(()=>{"use strict";jP(),FP(),Lw(),Qi(),Pm(),Uw(),Ew=(t,e)=>{ee()._OrtInit(t,e)!==0&&K("Can't initialize onnxruntime.")},Mw=async t=>{Ew(t.wasm.numThreads,Nw(t.logLevel))},jw=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")},Pr=new Map,Iw=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)}},bm=(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)}},Im=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]},Fw=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]=Im(t);let o=0,s=0,a=0,c=[],u=[],l=[];try{if([s,c]=await Rw(e),e?.externalData&&r.mountExternalData){let A=[];for(let I of e.externalData){let T=typeof I=="string"?I:I.path;A.push(Xa(typeof I=="string"?I:I.data).then(B=>{r.mountExternalData(T,B)}))}await Promise.all(A)}for(let A of e?.executionProviders??[])if((typeof A=="string"?A:A.name)==="webnn"){if(r.shouldTransferToMLTensor=!1,typeof A!="string"){let I=A,T=I?.context,B=I?.gpuDevice,V=I?.deviceType,H=I?.powerPreference;T?r.currentContext=T:B?r.currentContext=await r.webnnCreateMLContext(B):r.currentContext=await r.webnnCreateMLContext({deviceType:V,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]=Iw(o),f=!!e?.enableGraphCapture,p=[],_=[],b=[],E=[],C=[];for(let A=0;A<d;A++){let[I,T,B]=bm(o,A);I===0&&K("Can't get an input name."),u.push(I);let V=r.UTF8ToString(I);p.push(V),b.push(T===0?{name:V,isTensor:!1}:{name:V,isTensor:!0,type:Ka(T),shape:B})}for(let A=0;A<h;A++){let[I,T,B]=bm(o,A+d);I===0&&K("Can't get an output name."),l.push(I);let V=r.UTF8ToString(I);_.push(V),E.push(T===0?{name:V,isTensor:!1}:{name:V,isTensor:!0,type:Ka(T),shape:B})}return Pr.set(o,[o,u,l,null,f,!1]),[o,p,_,b,E]}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?.()}},Vw=t=>{let e=ee(),n=Pr.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."),Pr.delete(t)},$m=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 E=t[2].gpuBuffer;p=zn(Nn(u),l);{let C=a.jsepRegisterBuffer;if(!C)throw new Error('Tensor location "gpu-buffer" is not supported without using WebGPU.');f=C(i,o,E,p)}}else if(d==="ml-tensor"){let E=t[2].mlTensor;p=zn(Nn(u),l);let C=a.webnnRegisterMLTensor;if(!C)throw new Error('Tensor location "ml-tensor" is not supported without using WebNN.');f=C(i,E,Nn(u),l)}else{let E=t[2];if(Array.isArray(E)){p=c*E.length,f=a._malloc(p),n.push(f);for(let C=0;C<E.length;C++){if(typeof E[C]!="string")throw new TypeError(`tensor data at index ${C} is not a string`);a.setValue(f+C*c,ut(E[C],n),"*")}}else{let C=a.webnnIsGraphInput,A=a.webnnIsGraphOutput;if(u!=="string"&&C&&A){let I=a.UTF8ToString(r);if(C(i,I)||A(i,I)){let T=Nn(u);p=zn(T,l),h="ml-tensor";let B=a.webnnCreateTemporaryTensor,V=a.webnnUploadTensor;if(!B||!V)throw new Error('Tensor location "ml-tensor" is not supported without using WebNN.');let H=await B(i,T,l);V(H,new Uint8Array(E.buffer,E.byteOffset,E.byteLength)),f=H}else p=E.byteLength,f=a._malloc(p),n.push(f),a.HEAPU8.set(new Uint8Array(E.buffer,E.byteOffset,p),f)}else p=E.byteLength,f=a._malloc(p),n.push(f),a.HEAPU8.set(new Uint8Array(E.buffer,E.byteOffset,p),f)}}let _=a.stackSave(),b=a.stackAlloc(4*l.length);try{l.forEach((C,A)=>a.setValue(b+A*c,C,c===4?"i32":"i64"));let E=a._OrtCreateTensor(Nn(u),f,p,b,l.length,zw(h));E===0&&K(`Can't create tensor for input/output. session=${i}, index=${o}.`),e.push(E)}finally{a.stackRestore(_)}},Zw=async(t,e,n,i,r,o)=>{let s=ee(),a=s.PTR_SIZE,c=Pr.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],_=e.length,b=i.length,E=0,C=[],A=[],I=[],T=[],B=[],V=s.stackSave(),H=s.stackAlloc(_*a),ne=s.stackAlloc(_*a),we=s.stackAlloc(b*a),me=s.stackAlloc(b*a);try{[E,C]=Cw(o),Qt("wasm prepareInputOutputTensor");for(let z=0;z<_;z++)await $m(n[z],A,T,t,l[e[z]],e[z],f);for(let z=0;z<b;z++)await $m(r[z],I,T,t,d[i[z]],_+i[z],f);er("wasm prepareInputOutputTensor");for(let z=0;z<_;z++)s.setValue(H+z*a,A[z],"*"),s.setValue(ne+z*a,l[e[z]],"*");for(let z=0;z<b;z++)s.setValue(we+z*a,I[z],"*"),s.setValue(me+z*a,d[i[z]],"*");s.jsepOnRunStart?.(u),s.webnnOnRunStart?.(u);let Ie;Ie=await s._OrtRun(u,ne,H,_,me,b,we,E),Ie!==0&&K("failed to call OrtRun().");let ke=[],Q=[];Qt("wasm ProcessOutputTensor");for(let z=0;z<b;z++){let ue=Number(s.getValue(we+z*a,"*"));if(ue===I[z]||B.includes(I[z])){ke.push(r[z]),ue!==I[z]&&s._OrtReleaseTensor(ue)!==0&&K("Can't release tensor.");continue}let ot=s.stackSave(),je=s.stackAlloc(4*a),jr=!1,le,Fe=0;try{s._OrtGetTensorData(ue,je,je+a,je+2*a,je+3*a)!==0&&K(`Can't access output tensor data on index ${z}.`);let ru=a===4?"i32":"i64",ko=Number(s.getValue(je,ru));Fe=s.getValue(je+a,"*");let iv=s.getValue(je+a*2,"*"),KI=Number(s.getValue(je+a*3,ru)),Rt=[];for(let ge=0;ge<KI;ge++)Rt.push(Number(s.getValue(iv+ge*a,ru)));s._OrtFree(iv)!==0&&K("Can't free memory for tensor dims.");let Dt=Rt.reduce((ge,se)=>ge*se,1);le=Ka(ko);let qn=h?.outputPreferredLocations[i[z]];if(le==="string"){if(qn==="gpu-buffer"||qn==="ml-tensor")throw new Error("String tensor is not supported on GPU.");let ge=[];for(let se=0;se<Dt;se++){let bt=s.getValue(Fe+se*a,"*"),YI=s.getValue(Fe+(se+1)*a,"*"),XI=se===Dt-1?void 0:YI-bt;ge.push(s.UTF8ToString(bt,XI))}ke.push([le,Rt,ge,"cpu"])}else if(qn==="gpu-buffer"&&Dt>0){let ge=s.jsepGetBuffer;if(!ge)throw new Error('preferredLocation "gpu-buffer" is not supported without using WebGPU.');let se=ge(Fe),bt=zn(ko,Dt);if(bt===void 0||!Cm(le))throw new Error(`Unsupported data type: ${le}`);jr=!0,ke.push([le,Rt,{gpuBuffer:se,download:s.jsepCreateDownloader(se,bt,le),dispose:()=>{s._OrtReleaseTensor(ue)!==0&&K("Can't release tensor.")}},"gpu-buffer"])}else if(qn==="ml-tensor"&&Dt>0){let ge=s.webnnEnsureTensor,se=s.webnnIsGraphInputOutputTypeSupported;if(!ge||!se)throw new Error('preferredLocation "ml-tensor" is not supported without using WebNN.');if(zn(ko,Dt)===void 0||!Rm(le))throw new Error(`Unsupported data type: ${le}`);if(!se(t,le,!1))throw new Error(`preferredLocation "ml-tensor" for ${le} output is not supported by current WebNN Context.`);let bt=await ge(t,Fe,ko,Rt,!1);jr=!0,ke.push([le,Rt,{mlTensor:bt,download:s.webnnCreateMLTensorDownloader(Fe,le),dispose:()=>{s.webnnReleaseTensorId(Fe),s._OrtReleaseTensor(ue)}},"ml-tensor"])}else if(qn==="ml-tensor-cpu-output"&&Dt>0){let ge=s.webnnCreateMLTensorDownloader(Fe,le)(),se=ke.length;jr=!0,Q.push((async()=>{let bt=[se,await ge];return s.webnnReleaseTensorId(Fe),s._OrtReleaseTensor(ue),bt})()),ke.push([le,Rt,[],"cpu"])}else{let ge=Dw(le),se=new ge(Dt);new Uint8Array(se.buffer,se.byteOffset,se.byteLength).set(s.HEAPU8.subarray(Fe,Fe+se.byteLength)),ke.push([le,Rt,se,"cpu"])}}finally{s.stackRestore(ot),le==="string"&&Fe&&s._free(Fe),jr||s._OrtReleaseTensor(ue)}}h&&!f&&(s._OrtClearBoundOutputs(h.handle)!==0&&K("Can't clear bound outputs."),Pr.set(t,[u,l,d,h,f,!1]));for(let[z,ue]of await Promise.all(Q))ke[z][2]=ue;return er("wasm ProcessOutputTensor"),ke}finally{s.webnnOnRunEnd?.(u),s.stackRestore(V),A.forEach(Ie=>s._OrtReleaseTensor(Ie)),I.forEach(Ie=>s._OrtReleaseTensor(Ie)),T.forEach(Ie=>s._free(Ie)),E!==0&&s._OrtReleaseRunOptions(E),C.forEach(Ie=>s._free(Ie))}},Bw=t=>{let e=ee(),n=Pr.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)}}),Xw=tt(()=>{"use strict";VP(),Qi(),Ow(),Ja=!1,xm=!1,wm=!1,Gw=async()=>{if(!xm){if(Ja)throw new Error("multiple calls to 'initWasm()' detected.");if(wm)throw new Error("previous call to 'initWasm()' failed.");Ja=!0;try{await Pw(ie.wasm),await Mw(ie),xm=!0}catch(t){throw wm=!0,t}finally{Ja=!1}}},Ww=async t=>{await jw(ie,t)},Hw=async t=>Im(t),qw=async(t,e)=>Fw(t,e),Jw=async t=>{Vw(t)},Kw=async(t,e,n,i,r,o)=>Zw(t,e,n,i,r,o),Yw=async t=>{Bw(t)}}),ZP=tt(()=>{"use strict";Xw(),Lw(),Om(),Uw(),Sm=(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()}`)}},kw=t=>{switch(t[3]){case"cpu":return new et(t[0],t[2],t[1]);case"gpu-buffer":{let e=t[0];if(!Cm(e))throw new Error(`not supported data type: ${e} for deserializing GPU tensor`);let{gpuBuffer:n,download:i,dispose:r}=t[2];return et.fromGpuBuffer(n,{dataType:e,dims:t[1],download:i,dispose:r})}case"ml-tensor":{let e=t[0];if(!Rm(e))throw new Error(`not supported data type: ${e} for deserializing MLTensor tensor`);let{mlTensor:n,download:i,dispose:r}=t[2];return et.fromMLTensor(n,{dataType:e,dims:t[1],download:i,dispose:r})}default:throw new Error(`invalid data location: ${t[3]}`)}},Qw=class{async fetchModelAndCopyToWasmMemory(t){return Hw(await Xa(t))}async loadModel(t,e){Yt();let n;typeof t=="string"?Ln?n=await Xa(t):n=await this.fetchModelAndCopyToWasmMemory(t):n=t,[this.sessionId,this.inputNames,this.outputNames,this.inputMetadata,this.outputMetadata]=await qw(n,e),Xt()}async dispose(){return Jw(this.sessionId)}async run(t,e,n){Yt();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)=>Sm(d,()=>`input "${this.inputNames[r[h]]}"`)),c=o.map((d,h)=>d?Sm(d,()=>`output "${this.outputNames[s[h]]}"`):null),u=await Kw(this.sessionId,r,a,s,c,n),l={};for(let d=0;d<u.length;d++)l[this.outputNames[s[d]]]=o[d]??kw(u[d]);return Xt(),l}startProfiling(){}endProfiling(){Yw(this.sessionId)}}}),eS={};LP(eS,{OnnxruntimeWebAssemblyBackend:()=>Tm,initializeFlags:()=>km,wasmBackend:()=>tS});BP=tt(()=>{"use strict";Xw(),ZP(),km=()=>{(typeof ie.wasm.initTimeout!="number"||ie.wasm.initTimeout<0)&&(ie.wasm.initTimeout=0);let t=ie.wasm.simd;if(typeof t!="boolean"&&t!==void 0&&t!=="fixed"&&t!=="relaxed"&&(console.warn(`Property "env.wasm.simd" is set to unknown value "${t}". Reset it to \`false\` and ignore SIMD feature checking.`),ie.wasm.simd=!1),typeof ie.wasm.proxy!="boolean"&&(ie.wasm.proxy=!1),typeof ie.wasm.trace!="boolean"&&(ie.wasm.trace=!1),typeof ie.wasm.numThreads!="number"||!Number.isInteger(ie.wasm.numThreads)||ie.wasm.numThreads<=0)if(typeof self<"u"&&!self.crossOriginIsolated)ie.wasm.numThreads=1;else{let e=typeof navigator>"u"?Em("node:os").cpus().length:navigator.hardwareConcurrency;ie.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},Tm=class{async init(t){km(),await Gw(),await Ww(t)}async createInferenceSessionHandler(t,e){let n=new Qw;return await n.loadModel(t,e),n}},tS=new Tm}),GP="1.26.0",WP=pm;{let t=(BP(),MP(eS)).wasmBackend;Rn("cpu",t,10),Rn("wasm",t,10)}Object.defineProperty(ie.versions,"web",{value:GP,enumerable:!0})});import{existsSync as HP}from"node:fs";import{createRequire as qP}from"node:module";import{dirname as JP,join as KP,sep as iS}from"node:path";import{fileURLToPath as YP,pathToFileURL as XP}from"node:url";async function Qa(){let t=await Promise.resolve().then(()=>(nS(),rS));return t.default??t}function ec(t,e){t.env.wasm.numThreads=1,t.env.wasm.wasmPaths=eC(e)}function QP(t){return[new URL("./",t),new URL("../",t)].map(e=>YP(e))}function eC(t=import.meta.url){let e=QP(t);try{e.push(JP(qP(t).resolve("onnxruntime-web")))}catch{}let n=null;for(let i of e){let r=oS.filter(o=>!HP(KP(i,o)));if(r.length===0)return tC(i);r.length<oS.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 ('${sS}' + '${aS}') not found beside the bundle or in node_modules`)}function tC(t){return XP(t.endsWith(iS)?t:t+iS).href}var sS,aS,oS,Dm=g(()=>{"use strict";sS="ort-wasm-simd-threaded.wasm",aS="ort-wasm-simd-threaded.mjs",oS=[sS,aS]});import{existsSync as rC}from"node:fs";import{fileURLToPath as nC}from"node:url";function Nm(t,e){return[new URL(`../../assets/${t}`,e),new URL(`./assets/${t}`,e),new URL(`../assets/${t}`,e)].map(n=>nC(n))}function tc(t,e,n,i={}){let r=i.baseUrl??n,o=i.exists??rC,s="envPath"in i?i.envPath:process.env[e];if(s&&o(s))return s;let a=Nm(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 Lm(t={}){return tc(cS,uS,import.meta.url,t)}var cS,uS,Um=g(()=>{"use strict";zm();cS="silero_vad.onnx",uS="JARVIS_SILERO_VAD_MODEL_PATH"});var Un,eo,lS,Cr,Mm=g(()=>{"use strict";Dm();Um();Un=512,eo=64,lS=256,Cr=class{modelPath;sessionPromise=null;session=null;ort=null;disposed=!1;pending=new Int16Array(Un);pendingLen=0;state=new Float32Array(lS);context=new Float32Array(eo);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(lS),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(Un-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<Un)break;this.pendingLen=0,r.push(await this.inferWindow(n,i))}return r}async inferWindow(e,n){let i=new Float32Array(eo+Un);i.set(this.context,0);for(let a=0;a<Un;a++)i[eo+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-eo));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 Qa();this.ort=e,ec(e);let n=this.modelPath??Lm(),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 iC(t){let e=1;for(;e<t;)e<<=1;return e}var jm,rc,dS=g(()=>{"use strict";jm=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,_=p+a,b=e[_]*h-n[_]*f,E=e[_]*f+n[_]*h;e[_]=e[p]-b,n[_]=n[p]-E,e[p]+=b,n[p]+=E}}if(i){let s=1/r;for(let a=0;a<r;a++)e[a]*=s,n[a]*=s}}};rc=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=iC(2*e-1),this.fft=new jm(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 pS(t){let i=27/Math.log(6.4);return t>=1e3?15+Math.log(t/1e3)*i:3*t/200}function aC(t){let i=Math.log(6.4)/27;return t>=15?1e3*Math.exp(i*(t-15)):200*t/3}function mS(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 cC(){let t=pS(0),e=pS(Fm/2),n=mS(t,e,Ot+2),i=new Float64Array(Ot+2);for(let a=0;a<n.length;a++)i[a]=aC(n[a]);let r=mS(0,Fm/2,to),o=new Float64Array(Ot+1);for(let a=0;a<Ot+1;a++)o[a]=i[a+1]-i[a];let s=[];for(let a=0;a<Ot;a++){let c=2/(i[a+2]-i[a]),u=new Float64Array(to),l=to,d=0;for(let h=0;h<to;h++){let f=-(i[a]-r[h])/o[a],p=(i[a+2]-r[h])/o[a+1],_=Math.max(0,Math.min(f,p))*c;u[h]=_,_>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 uC(){let t=new Float64Array(lt);for(let e=0;e<lt;e++)t[e]=.5-.5*Math.cos(2*Math.PI*e/lt);return t}var Fm,lt,oC,Ot,to,hS,sC,fS,Me,Rr,Vm,ro,nc=g(()=>{"use strict";dS();Fm=16e3,lt=400,oC=160,Ot=80,to=(lt>>1)+1,hS=1e-10,sC=1e-7,fS=32768,Me=Fm*8,Rr=800,Vm=Ot;ro=class{hann=uC();filters=cC();spectrum=new rc(lt);padded=new Float64Array(Me+lt);frame=new Float64Array(lt);power=new Float64Array(to);logBuf=new Float64Array(Ot*Rr);fromPcm16(e){return this.window(e),this.normalize(),this.reflectPad(),this.melSpectrogram()}window(e){let n=this.padded,i=lt/2,r=e.length;if(r>=Me){let o=r-Me;for(let s=0;s<Me;s++)n[i+s]=e[o+s]/fS}else{let o=Me-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]/fS}}normalize(){let e=this.padded,n=lt/2,i=Me,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+sC);for(let a=0;a<i;a++)e[n+a]=(e[n+a]-r)*s}reflectPad(){let e=this.padded,n=lt/2,i=Me;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<Rr;l++){let d=l*oC;for(let h=0;h<lt;h++)n[h]=e[d+h]*r[h];this.spectrum.computePower(n,i);for(let h=0;h<Ot;h++){let{lo:f,hi:p,weights:_}=o[h],b=0;for(let E=f;E<p;E++)b+=_[E-f]*i[E];s[h*Rr+l]=Math.log10(b<hS?hS:b)}}let a=-1/0;for(let l of s)l>a&&(a=l);let c=a-8,u=new Float32Array(Ot*Rr);for(let l=0;l<s.length;l++){let d=s[l]<c?c:s[l];u[l]=(d+4)/4}return u}}});function lC(t){return t.toLowerCase().replace(/[.,!?;:]+$/g,"").trim()}function ic(t,e){return e.some(n=>vS(t,n))}function vS(t,e){if(!t.endsWith(e))return!1;let n=t.length-e.length-1;return n<0||t[n]===" "}function dC(t,e){let n=hC(t);return n===""?null:e.find(i=>fC(n,i))??null}function hC(t){let e=/^.*[.!?\u3002\uFF01\uFF1F]\s+/s.exec(t);return(e?t.slice(e[0].length):t).trim()}function fC(t,e){for(let n=t.indexOf(e);n!==-1;n=t.indexOf(e,n+1)){let i=n===0||!gS(t[n-1]),r=n+e.length===t.length||!gS(t[n+e.length]);if(i&&r)return!0}return!1}function gS(t){return/[a-z0-9']/.test(t)}var oc,Zm,no,Bm=g(()=>{"use strict";br();br();oc={silenceEnergyThreshold:Wt,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"]},Zm="semantic",no=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={...oc,...n},this.classifier=i??new Ui(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=lC(e),ic(this.lastNormPartial,this.config.commitCues)){this.commit("lexical");return}let n=this.strongHoldCue,i=dC(this.lastNormPartial,this.config.strongHoldCues);if(i===null&&n!==null&&this.partialStability==="redecode"&&!this.pendingVetoClear){this.pendingVetoClear=!0,this.telemetry?.strongHoldClearDebounced?.(n),ic(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(vS(this.lastNormPartial,this.strongHoldCue)){this.enterHeld(this.strongHoldCue);return}this.holdFloor();return}if(ic(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:ic(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===Zm)){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 yS,io,Gm=g(()=>{"use strict";nc();Bm();yS={...oc,commitThreshold:.65,holdThreshold:.35},io=class extends no{smartConfig;inference;buffer=new Int16Array(Me*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={...yS,...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(Zm),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>Me?n-Me:0,o=n-r;if(this.bufferLen+o>this.buffer.length){let s=Math.min(this.bufferLen,Me);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-Me);return this.buffer.slice(e,this.bufferLen)}}});function Wm(t={}){return tc(_S,bS,import.meta.url,t)}var _S,bS,Hm=g(()=>{"use strict";zm();_S="smart-turn-v3.1-cpu.onnx",bS="JARVIS_SMART_TURN_MODEL_PATH"});var oo,qm=g(()=>{"use strict";nc();Dm();Hm();oo=class{logMel;modelPath;sessionPromise=null;session=null;ort=null;disposed=!1;constructor(e={}){this.logMel=e.logMel??new ro,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,Vm,Rr]),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 Qa();this.ort=e,ec(e);let n=this.modelPath??Wm(),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 bC(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 $C(t){let e=Jm(t)?.content,n=(Array.isArray(e)?e:[]).map(l=>Jm(l)).filter(l=>l?.type==="text").map(l=>typeof l?.text=="string"?l.text:"").join(""),i=$S+n;i.includes("}")||(i+="}");let r=i.indexOf("{"),o=i.lastIndexOf("}");if(r===-1||o<=r)throw new rr("turn evaluator reply carried no JSON object");let s;try{s=JSON.parse(i.slice(r,o+1))}catch{throw new rr("turn evaluator reply was not valid JSON")}let a=Jm(s),c=a?.verdict;if(typeof c!="string"||!yC.includes(c))throw new rr("turn evaluator reply carried an unknown verdict");let u=a?.confidence;if(typeof u!="number"||!Number.isFinite(u)||u<0||u>1)throw new rr("turn evaluator confidence missing or out of range");return{verdict:c,confidence:u}}function Jm(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0}var pC,mC,gC,$S,vC,yC,_C,rr,Mn,Km=g(()=>{"use strict";pC="claude-haiku-4-5-20251001",mC="https://api.anthropic.com/v1/messages",gC="2023-06-01",$S='{"verdict":"',vC=["}"],yC=["done","mid_thought","hold_floor"],_C=`You are the semantic turn evaluator inside a real-time voice assistant's
145
+ `,Qt=class extends Error{status;constructor(e,n){super(e),this.status=n,this.name="AddresseeEvaluatorError"}},Ln=class{key;fetchImpl;timeoutMs;constructor(e,n=fetch,i=1200){this.key=e,this.fetchImpl=n,this.timeoutMs=i}async evaluate(e,n,i){let r={model:CP,max_tokens:64,temperature:0,stop_sequences:DP,system:MP,messages:[{role:"user",content:zP(e)},{role:"assistant",content:zx}]},o=await this.fetchImpl(RP,{method:"POST",headers:{"x-api-key":this.key,"anthropic-version":NP,"content-type":"application/json"},body:JSON.stringify(r),signal:AbortSignal.any([n,AbortSignal.timeout(i?.timeoutMs??this.timeoutMs)])});if(!o.ok)throw new Qt(`addressee evaluator request failed (HTTP ${o.status})`,o.status);let s;try{s=await o.json()}catch{throw new Qt("addressee evaluator response body was not JSON")}return UP(s)}}});var jP,FP,Ux,Qi,lm=g(()=>{"use strict";jP=new Set([".","!","?"]),FP=new Set([",",";",":"]),Ux={minClauseLength:12},Qi=class{buffer="";minClauseLength;constructor(e=Ux){this.minClauseLength=e.minClauseLength}push(e){this.buffer+=e;let n=[];for(let i=this.findBoundary();i!==-1;i=this.findBoundary()){let r=this.buffer.slice(0,i+1).trim();this.buffer=this.buffer.slice(i+1).replace(/^\s+/,""),r.length>0&&n.push(r)}return n}flush(){let e=this.buffer.trim();return this.buffer="",e.length>0?[e]:[]}findBoundary(){for(let e=0;e<this.buffer.length;e++){let n=this.buffer[e];if(n===`
146
+ `)return e;let i=e+1<this.buffer.length?this.buffer[e+1]:"";if(i!==""&&/\s/.test(i)&&(jP.has(n)||FP.has(n)&&e+1>=this.minClauseLength))return e}return-1}}});var Ja,Pr,Mn,VP,jx,dm=g(()=>{Ja=new Map,Pr=[],Mn=(t,e,n)=>{if(e&&typeof e.init=="function"&&typeof e.createInferenceSessionHandler=="function"){let i=Ja.get(t);if(i===void 0)Ja.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=Pr.indexOf(t);r!==-1&&Pr.splice(r,1);for(let o=0;o<Pr.length;o++)if(Ja.get(Pr[o]).priority<=n){Pr.splice(o,0,t);return}Pr.push(t)}return}throw new TypeError("not a valid backend")},VP=async t=>{let e=Ja.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}}},jx=async t=>{let e=t.executionProviders||[],n=e.map(c=>typeof c=="string"?c:c.name),i=n.length===0?Pr:n,r,o=[],s=new Set;for(let c of i){let u=await VP(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 Fx=g(()=>{dm()});var Vx,Zx=g(()=>{Vx="1.26.0"});var Bx,fe,hm=g(()=>{Zx();Bx="warning",fe={wasm:{},webgl:{},webgpu:{},versions:{common:Vx},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}`);Bx=t}},get logLevel(){return Bx}};Object.defineProperty(fe,"logLevel",{enumerable:!0})});var oe,Gx=g(()=>{hm();oe=fe});var Wx,Hx,qx=g(()=>{Wx=(t,e)=>{let n=typeof document<"u"?document.createElement("canvas"):new OffscreenCanvas(1,1);n.width=t.dims[3],n.height=t.dims[2];let i=n.getContext("2d");if(i!=null){let r,o;e?.tensorLayout!==void 0&&e.tensorLayout==="NHWC"?(r=t.dims[2],o=t.dims[3]):(r=t.dims[3],o=t.dims[2]);let s=e?.format!==void 0?e.format:"RGB",a=e?.norm,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 _=0;_<o;_++)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],w=p===-1?255:(t.data[p++]-u[3])*c[3];i.fillStyle="rgba("+I+","+A+","+O+","+w+")",i.fillRect($,_,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")},Hx=(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,_=2,$=3,I=0,A=d,O=d*2,w=-1;a==="RGBA"?(I=0,A=d,O=d*2,w=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,_+=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[_]=(t.data[O++]-l[2])*u[2],i.data[$]=w===-1?255:(t.data[w++]-l[3])*u[3]}else throw new Error("Can not access image data");return i}});var fm,Jx,Kx,Yx,Xx,Qx,ew=g(()=>{Ka();fm=(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,_=3,$=0,I=u,A=u*2,O=-1;a==="RGB"&&(d=3,h=0,f=1,p=2,_=-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,_+=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&&_!==-1&&(l[O++]=(t[_]+s[3])/o[3]);return c==="RGBA"?new be("float32",l,[1,4,n,i]):new be("float32",l,[1,3,n,i])},Jx=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,fm(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 _=f.getImageData(0,0,h.width,h.height);a.height=h.height,a.width=h.width,l(fm(_.data,a))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(s!==void 0)return fm(s,a);throw new Error("Input data provided is not supported - aborted tensor creation")},Kx=(t,e)=>{let{width:n,height:i,download:r,dispose:o}=e,s=[1,i,n,4];return new be({location:"texture",type:"float32",texture:t,dims:s,download:r,dispose:o})},Yx=(t,e)=>{let{dataType:n,dims:i,download:r,dispose:o}=e;return new be({location:"gpu-buffer",type:n??"float32",gpuBuffer:t,dims:i,download:r,dispose:o})},Xx=(t,e)=>{let{dataType:n,dims:i,download:r,dispose:o}=e;return new be({location:"ml-tensor",type:n??"float32",mlTensor:t,dims:i,download:r,dispose:o})},Qx=(t,e,n)=>new be({location:"cpu-pinned",type:t,data:e,dims:n??[e.length]})});var Cr,eo,tw,rw,nw=g(()=>{Cr=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array],["int4",Uint8Array],["uint4",Uint8Array]]),eo=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]),tw=!1,rw=()=>{if(!tw){tw=!0;let t=typeof BigInt64Array<"u"&&BigInt64Array.from,e=typeof BigUint64Array<"u"&&BigUint64Array.from,n=globalThis.Float16Array,i=typeof n<"u"&&n.from;t&&(Cr.set("int64",BigInt64Array),eo.set(BigInt64Array,"int64")),e&&(Cr.set("uint64",BigUint64Array),eo.set(BigUint64Array,"uint64")),i?(Cr.set("float16",n),eo.set(n,"float16")):Cr.set("float16",Uint16Array)}}});var iw,ow,sw=g(()=>{Ka();iw=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},ow=(t,e)=>{switch(t.location){case"cpu":return new be(t.type,t.data,e);case"cpu-pinned":return new be({location:"cpu-pinned",data:t.data,type:t.type,dims:e});case"texture":return new be({location:"texture",texture:t.texture,type:t.type,dims:e});case"gpu-buffer":return new be({location:"gpu-buffer",gpuBuffer:t.gpuBuffer,type:t.type,dims:e});case"ml-tensor":return new be({location:"ml-tensor",mlTensor:t.mlTensor,type:t.type,dims:e});default:throw new Error(`tensorReshape: tensor location ${t.location} is not supported`)}}});var be,Ka=g(()=>{qx();ew();nw();sw();be=class{constructor(e,n,i){rw();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=Cr.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=Cr.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=eo.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=iw(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 Jx(e,n)}static fromTexture(e,n){return Kx(e,n)}static fromGpuBuffer(e,n){return Yx(e,n)}static fromMLTensor(e,n){return Xx(e,n)}static fromPinnedBuffer(e,n,i){return Qx(e,n,i)}toDataURL(e){return Wx(this,e)}toImageData(e){return Hx(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 ow(this,e)}}});var et,pm=g(()=>{Ka();et=be});var mm,aw,er,tr,rr,nr,gm=g(()=>{hm();mm=(t,e)=>{(typeof fe.trace>"u"?!fe.wasm.trace:!fe.trace)||console.timeStamp(`${t}::ORT::${e}`)},aw=(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}`),mm("CPU",o);return}n[r].includes("TRACE_FUNC")&&(i=!0)}},er=t=>{(typeof fe.trace>"u"?!fe.wasm.trace:!fe.trace)||aw("BEGIN",t)},tr=t=>{(typeof fe.trace>"u"?!fe.wasm.trace:!fe.trace)||aw("END",t)},rr=t=>{(typeof fe.trace>"u"?!fe.wasm.trace:!fe.trace)||console.time(`ORT::${t}`)},nr=t=>{(typeof fe.trace>"u"?!fe.wasm.trace:!fe.trace)||console.timeEnd(`ORT::${t}`)}});var Ya,cw=g(()=>{dm();pm();gm();Ya=class t{constructor(e){this.handler=e}async run(e,n,i){er(),rr("InferenceSession.run");let r={},o={};if(typeof e!="object"||e===null||e instanceof et||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 et)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 et)&&(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 et?c[u]=l:c[u]=new et(l.type,l.data,l.dims)}return nr("InferenceSession.run"),tr(),c}async release(){return this.handler.dispose()}static async create(e,n,i,r){er(),rr("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 jx(s),u=await a.createInferenceSessionHandler(o,c);return nr("InferenceSession.create"),tr(),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 uw,lw=g(()=>{cw();uw=Ya});var dw=g(()=>{});var hw=g(()=>{});var fw=g(()=>{});var pw=g(()=>{});var vm={};qe(vm,{InferenceSession:()=>uw,TRACE:()=>mm,TRACE_EVENT_BEGIN:()=>rr,TRACE_EVENT_END:()=>nr,TRACE_FUNC_BEGIN:()=>er,TRACE_FUNC_END:()=>tr,Tensor:()=>et,env:()=>oe,registerBackend:()=>Mn});var ir=g(()=>{Fx();Gx();lw();pm();dw();hw();gm();fw();pw()});var oS={};qe(oS,{InferenceSession:()=>uw,TRACE:()=>mm,TRACE_EVENT_BEGIN:()=>rr,TRACE_EVENT_END:()=>nr,TRACE_FUNC_BEGIN:()=>er,TRACE_FUNC_END:()=>tr,Tensor:()=>et,default:()=>rC,env:()=>oe,registerBackend:()=>Mn});import{createRequire as ZP}from"module";var zn,Cm,BP,GP,WP,Tm,tt,HP,qP,JP,Fn,Rm,ym,mw,gw,Ot,Pw,_m,vw,yw,_w,bw,bm,Cw,Rw,$m,Xa,to,xm,$w,xw,ww,Nw,ee,ro,ut,tc,K,Nm,Dw,KP,Sw,Ew,Iw,Rr,kw,Lw,YP,Un,ec,jn,Mw,zw,Dm,Lm,Uw,jw,rc,Fw,Tw,Vw,Zw,Nr,Aw,wm,Am,Bw,Gw,Sm,Ww,Hw,XP,Qa,Em,Im,qw,Jw,Kw,Yw,Xw,Qw,eS,tS,km,Ow,rS,QP,nS,Om,Pm,iS,eC,tC,rC,sS=g(()=>{ir();ir();ir();ir();ir();ir();ir();zn=ZP(import.meta.url),Cm=Object.defineProperty,BP=Object.getOwnPropertyDescriptor,GP=Object.getOwnPropertyNames,WP=Object.prototype.hasOwnProperty,Tm=(t=>typeof zn<"u"?zn:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof zn<"u"?zn:e)[n]}):t)(function(t){if(typeof zn<"u")return zn.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),tt=(t,e)=>()=>(t&&(e=t(t=0)),e),HP=(t,e)=>{for(var n in e)Cm(t,n,{get:e[n],enumerable:!0})},qP=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of GP(e))!WP.call(t,r)&&r!==n&&Cm(t,r,{get:()=>e[r],enumerable:!(i=BP(e,r))||i.enumerable});return t},JP=t=>qP(Cm({},"__esModule",{value:!0}),t),Rm=tt(()=>{"use strict";Fn=!!(typeof process<"u"&&process.versions&&process.versions.node)}),Rw=tt(()=>{"use strict";Rm(),ym=Fn||typeof location>"u"?void 0:location.origin,mw=import.meta.url>"file:"&&import.meta.url<"file;",gw=()=>{if(!Fn){if(mw){let t=URL;return new URL(new t("ort.node.min.mjs",import.meta.url).href,ym).href}return import.meta.url}},Ot=gw(),Pw=()=>{if(Ot&&!Ot.startsWith("blob:"))return Ot.substring(0,Ot.lastIndexOf("/")+1)},_m=(t,e)=>{try{let n=e??Ot;return(n?new URL(t,n):new URL(t)).origin===ym}catch{return!1}},vw=(t,e)=>{let n=e??Ot;try{return(n?new URL(t,n):new URL(t)).href}catch{return}},yw=(t,e)=>`${e??"./"}${t}`,_w=async t=>{let e=await(await fetch(t,{credentials:"same-origin"})).blob();return URL.createObjectURL(e)},bw=async t=>(await import(t)).default,bm=void 0,Cw=async(t,e,n,i)=>{let r=bm&&!(t||e);if(r)if(Ot)r=_m(Ot)||i&&!n;else if(i&&!n)r=!0;else throw new Error("cannot determine the script source URL.");if(r)return[void 0,bm];{let o="ort-wasm-simd-threaded.mjs",s=t??vw(o,e),a=!Fn&&n&&s&&!_m(s,e),c=a?await _w(s):s??yw(o,e);return[a?c:void 0,await bw(c)]}}}),ro=tt(()=>{"use strict";Rw(),Xa=!1,to=!1,xm=!1,$w=()=>{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}},xw=()=>{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}},ww=()=>{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}},Nw=async t=>{if(Xa)return Promise.resolve();if(to)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(xm)throw new Error("previous call to 'initializeWebAssembly()' failed.");to=!0;let e=t.initTimeout,n=t.numThreads;if(t.simd!==!1){if(t.simd==="relaxed"){if(!ww())throw new Error("Relaxed WebAssembly SIMD is not supported in the current environment.")}else if(!xw())throw new Error("WebAssembly SIMD is not supported in the current environment.")}let i=$w();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 Cw(a,o,n>1,!!l||!!u),f=!1,p=[];if(e>0&&p.push(new Promise(_=>{setTimeout(()=>{f=!0,_()},e)})),p.push(new Promise((_,$)=>{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=Pw();A&&(I.locateFile=O=>A+O)}h(I).then(A=>{to=!1,Xa=!0,$m=A,_(),d&&URL.revokeObjectURL(d)},A=>{to=!1,xm=!0,$(A)})})),await Promise.race(p),f)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},ee=()=>{if(Xa&&$m)return $m;throw new Error("WebAssembly is not initialized yet.")}}),Nm=tt(()=>{"use strict";ro(),ut=(t,e)=>{let n=ee(),i=n.lengthBytesUTF8(t)+1,r=n._malloc(i);return n.stringToUTF8(t,r,i),e.push(r),r},tc=(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")tc(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)}}}),KP=tt(()=>{"use strict";ro(),Nm(),Dw=t=>{let e=ee(),n=0,i=[],r=t||{};try{if(t?.logSeverityLevel===void 0)r.logSeverityLevel=2;else if(typeof t.logSeverityLevel!="number"||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log severity level is not valid: ${t.logSeverityLevel}`);if(t?.logVerbosityLevel===void 0)r.logVerbosityLevel=0;else if(typeof t.logVerbosityLevel!="number"||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);t?.terminate===void 0&&(r.terminate=!1);let o=0;return t?.tag!==void 0&&(o=ut(t.tag,i)),n=e._OrtCreateRunOptions(r.logSeverityLevel,r.logVerbosityLevel,!!r.terminate,o),n===0&&K("Can't create run options."),t?.extra!==void 0&&tc(t.extra,"",new WeakSet,(s,a)=>{let c=ut(s,i),u=ut(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}}}),YP=tt(()=>{"use strict";ro(),Nm(),Sw=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}`)}},Ew=t=>{switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}},Iw=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)},Rr=(t,e,n,i)=>{let r=ut(e,i),o=ut(n,i);ee()._OrtAddSessionConfigEntry(t,r,o)!==0&&K(`Can't set a session config entry: ${e} - ${n}.`)},kw=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",Rr(t,"session.disable_quant_qdq","1",n),Rr(t,"session.disable_qdq_constant_folding","1",n),typeof r!="string"){let d=r?.deviceType;d&&Rr(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}`);Rr(t,"preferredLayout",d.preferredLayout,n)}}break;case"wasm":case"cpu":continue;default:throw new Error(`not supported execution provider: ${o}`)}let a=ut(o,n),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}.`)}},Lw=async t=>{let e=ee(),n=0,i=[],r=t||{};Iw(r);try{let o=Sw(r.graphOptimizationLevel??"all"),s=Ew(r.executionMode??"sequential"),a=typeof r.logId=="string"?ut(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"?ut(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 kw(n,r,i),r.enableGraphCapture!==void 0){if(typeof r.enableGraphCapture!="boolean")throw new Error(`enableGraphCapture must be a boolean value: ${r.enableGraphCapture}`);Rr(n,"enableGraphCapture",r.enableGraphCapture.toString(),i)}if(r.freeDimensionOverrides)for(let[d,h]of Object.entries(r.freeDimensionOverrides)){if(typeof d!="string")throw new Error(`free dimension override name must be a string: ${d}`);if(typeof h!="number"||!Number.isInteger(h)||h<0)throw new Error(`free dimension override value must be a non-negative integer: ${h}`);let f=ut(d,i);e._OrtAddFreeDimensionOverride(n,f,h)!==0&&K(`Can't set a free dimension override: ${d} - ${h}.`)}return r.extra!==void 0&&tc(r.extra,"",new WeakSet,(d,h)=>{Rr(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}}}),jw=tt(()=>{"use strict";Un=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}`)}},ec=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}`)}},jn=(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},Mw=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}`)}},zw=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}`)}},Dm=t=>t==="float32"||t==="float16"||t==="int32"||t==="int64"||t==="uint32"||t==="uint8"||t==="bool"||t==="uint4"||t==="int4",Lm=t=>t==="float32"||t==="float16"||t==="int32"||t==="int64"||t==="uint32"||t==="uint64"||t==="int8"||t==="uint8"||t==="bool"||t==="uint4"||t==="int4",Uw=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}`)}}}),Fw=tt(()=>{"use strict";Rm(),rc=async t=>{if(typeof t=="string")if(Fn)try{let{readFile:e}=Tm("node:fs/promises");return new Uint8Array(await e(t))}catch(e){if(e.code==="ERR_FS_FILE_TOO_LARGE"){let{createReadStream:n}=Tm("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)}}),XP=tt(()=>{"use strict";KP(),YP(),jw(),ro(),Nm(),Fw(),Tw=(t,e)=>{ee()._OrtInit(t,e)!==0&&K("Can't initialize onnxruntime.")},Vw=async t=>{Tw(t.wasm.numThreads,zw(t.logLevel))},Zw=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")},Nr=new Map,Aw=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)}},wm=(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)}},Am=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]},Bw=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]=Am(t);let o=0,s=0,a=0,c=[],u=[],l=[];try{if([s,c]=await Lw(e),e?.externalData&&r.mountExternalData){let O=[];for(let w of e.externalData){let k=typeof w=="string"?w:w.path;O.push(rc(typeof w=="string"?w:w.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 w=O,k=w?.context,z=w?.gpuDevice,U=w?.deviceType,H=w?.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]=Aw(o),f=!!e?.enableGraphCapture,p=[],_=[],$=[],I=[],A=[];for(let O=0;O<d;O++){let[w,k,z]=wm(o,O);w===0&&K("Can't get an input name."),u.push(w);let U=r.UTF8ToString(w);p.push(U),$.push(k===0?{name:U,isTensor:!1}:{name:U,isTensor:!0,type:ec(k),shape:z})}for(let O=0;O<h;O++){let[w,k,z]=wm(o,O+d);w===0&&K("Can't get an output name."),l.push(w);let U=r.UTF8ToString(w);_.push(U),I.push(k===0?{name:U,isTensor:!1}:{name:U,isTensor:!0,type:ec(k),shape:z})}return Nr.set(o,[o,u,l,null,f,!1]),[o,p,_,$,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?.()}},Gw=t=>{let e=ee(),n=Nr.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."),Nr.delete(t)},Sm=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=jn(Un(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=jn(Un(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,Un(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,ut(I[A],n),"*")}}else{let A=a.webnnIsGraphInput,O=a.webnnIsGraphOutput;if(u!=="string"&&A&&O){let w=a.UTF8ToString(r);if(A(i,w)||O(i,w)){let k=Un(u);p=jn(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 _=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(Un(u),f,p,$,l.length,Uw(h));I===0&&K(`Can't create tensor for input/output. session=${i}, index=${o}.`),e.push(I)}finally{a.stackRestore(_)}},Ww=async(t,e,n,i,r,o)=>{let s=ee(),a=s.PTR_SIZE,c=Nr.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],_=e.length,$=i.length,I=0,A=[],O=[],w=[],k=[],z=[],U=s.stackSave(),H=s.stackAlloc(_*a),ie=s.stackAlloc(_*a),we=s.stackAlloc($*a),ge=s.stackAlloc($*a);try{[I,A]=Dw(o),rr("wasm prepareInputOutputTensor");for(let L=0;L<_;L++)await Sm(n[L],O,k,t,l[e[L]],e[L],f);for(let L=0;L<$;L++)await Sm(r[L],w,k,t,d[i[L]],_+i[L],f);nr("wasm prepareInputOutputTensor");for(let L=0;L<_;L++)s.setValue(H+L*a,O[L],"*"),s.setValue(ie+L*a,l[e[L]],"*");for(let L=0;L<$;L++)s.setValue(we+L*a,w[L],"*"),s.setValue(ge+L*a,d[i[L]],"*");s.jsepOnRunStart?.(u),s.webnnOnRunStart?.(u);let Ie;Ie=await s._OrtRun(u,ie,H,_,ge,$,we,I),Ie!==0&&K("failed to call OrtRun().");let ke=[],Q=[];rr("wasm ProcessOutputTensor");for(let L=0;L<$;L++){let ue=Number(s.getValue(we+L*a,"*"));if(ue===w[L]||z.includes(w[L])){ke.push(r[L]),ue!==w[L]&&s._OrtReleaseTensor(ue)!==0&&K("Can't release tensor.");continue}let ot=s.stackSave(),Ve=s.stackAlloc(4*a),Gr=!1,le,Ze=0;try{s._OrtGetTensorData(ue,Ve,Ve+a,Ve+2*a,Ve+3*a)!==0&&K(`Can't access output tensor data on index ${L}.`);let su=a===4?"i32":"i64",Oo=Number(s.getValue(Ve,su));Ze=s.getValue(Ve+a,"*");let av=s.getValue(Ve+a*2,"*"),ok=Number(s.getValue(Ve+a*3,su)),Dt=[];for(let ve=0;ve<ok;ve++)Dt.push(Number(s.getValue(av+ve*a,su)));s._OrtFree(av)!==0&&K("Can't free memory for tensor dims.");let Lt=Dt.reduce((ve,ae)=>ve*ae,1);le=ec(Oo);let Yn=h?.outputPreferredLocations[i[L]];if(le==="string"){if(Yn==="gpu-buffer"||Yn==="ml-tensor")throw new Error("String tensor is not supported on GPU.");let ve=[];for(let ae=0;ae<Lt;ae++){let $t=s.getValue(Ze+ae*a,"*"),sk=s.getValue(Ze+(ae+1)*a,"*"),ak=ae===Lt-1?void 0:sk-$t;ve.push(s.UTF8ToString($t,ak))}ke.push([le,Dt,ve,"cpu"])}else if(Yn==="gpu-buffer"&&Lt>0){let ve=s.jsepGetBuffer;if(!ve)throw new Error('preferredLocation "gpu-buffer" is not supported without using WebGPU.');let ae=ve(Ze),$t=jn(Oo,Lt);if($t===void 0||!Dm(le))throw new Error(`Unsupported data type: ${le}`);Gr=!0,ke.push([le,Dt,{gpuBuffer:ae,download:s.jsepCreateDownloader(ae,$t,le),dispose:()=>{s._OrtReleaseTensor(ue)!==0&&K("Can't release tensor.")}},"gpu-buffer"])}else if(Yn==="ml-tensor"&&Lt>0){let ve=s.webnnEnsureTensor,ae=s.webnnIsGraphInputOutputTypeSupported;if(!ve||!ae)throw new Error('preferredLocation "ml-tensor" is not supported without using WebNN.');if(jn(Oo,Lt)===void 0||!Lm(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 $t=await ve(t,Ze,Oo,Dt,!1);Gr=!0,ke.push([le,Dt,{mlTensor:$t,download:s.webnnCreateMLTensorDownloader(Ze,le),dispose:()=>{s.webnnReleaseTensorId(Ze),s._OrtReleaseTensor(ue)}},"ml-tensor"])}else if(Yn==="ml-tensor-cpu-output"&&Lt>0){let ve=s.webnnCreateMLTensorDownloader(Ze,le)(),ae=ke.length;Gr=!0,Q.push((async()=>{let $t=[ae,await ve];return s.webnnReleaseTensorId(Ze),s._OrtReleaseTensor(ue),$t})()),ke.push([le,Dt,[],"cpu"])}else{let ve=Mw(le),ae=new ve(Lt);new Uint8Array(ae.buffer,ae.byteOffset,ae.byteLength).set(s.HEAPU8.subarray(Ze,Ze+ae.byteLength)),ke.push([le,Dt,ae,"cpu"])}}finally{s.stackRestore(ot),le==="string"&&Ze&&s._free(Ze),Gr||s._OrtReleaseTensor(ue)}}h&&!f&&(s._OrtClearBoundOutputs(h.handle)!==0&&K("Can't clear bound outputs."),Nr.set(t,[u,l,d,h,f,!1]));for(let[L,ue]of await Promise.all(Q))ke[L][2]=ue;return nr("wasm ProcessOutputTensor"),ke}finally{s.webnnOnRunEnd?.(u),s.stackRestore(U),O.forEach(Ie=>s._OrtReleaseTensor(Ie)),w.forEach(Ie=>s._OrtReleaseTensor(Ie)),k.forEach(Ie=>s._free(Ie)),I!==0&&s._OrtReleaseRunOptions(I),A.forEach(Ie=>s._free(Ie))}},Hw=t=>{let e=ee(),n=Nr.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)}}),tS=tt(()=>{"use strict";XP(),ro(),Rw(),Qa=!1,Em=!1,Im=!1,qw=async()=>{if(!Em){if(Qa)throw new Error("multiple calls to 'initWasm()' detected.");if(Im)throw new Error("previous call to 'initWasm()' failed.");Qa=!0;try{await Nw(oe.wasm),await Vw(oe),Em=!0}catch(t){throw Im=!0,t}finally{Qa=!1}}},Jw=async t=>{await Zw(oe,t)},Kw=async t=>Am(t),Yw=async(t,e)=>Bw(t,e),Xw=async t=>{Gw(t)},Qw=async(t,e,n,i,r,o)=>Ww(t,e,n,i,r,o),eS=async t=>{Hw(t)}}),QP=tt(()=>{"use strict";tS(),jw(),Rm(),Fw(),km=(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()}`)}},Ow=t=>{switch(t[3]){case"cpu":return new et(t[0],t[2],t[1]);case"gpu-buffer":{let e=t[0];if(!Dm(e))throw new Error(`not supported data type: ${e} for deserializing GPU tensor`);let{gpuBuffer:n,download:i,dispose:r}=t[2];return et.fromGpuBuffer(n,{dataType:e,dims:t[1],download:i,dispose:r})}case"ml-tensor":{let e=t[0];if(!Lm(e))throw new Error(`not supported data type: ${e} for deserializing MLTensor tensor`);let{mlTensor:n,download:i,dispose:r}=t[2];return et.fromMLTensor(n,{dataType:e,dims:t[1],download:i,dispose:r})}default:throw new Error(`invalid data location: ${t[3]}`)}},rS=class{async fetchModelAndCopyToWasmMemory(t){return Kw(await rc(t))}async loadModel(t,e){er();let n;typeof t=="string"?Fn?n=await rc(t):n=await this.fetchModelAndCopyToWasmMemory(t):n=t,[this.sessionId,this.inputNames,this.outputNames,this.inputMetadata,this.outputMetadata]=await Yw(n,e),tr()}async dispose(){return Xw(this.sessionId)}async run(t,e,n){er();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)=>km(d,()=>`input "${this.inputNames[r[h]]}"`)),c=o.map((d,h)=>d?km(d,()=>`output "${this.outputNames[s[h]]}"`):null),u=await Qw(this.sessionId,r,a,s,c,n),l={};for(let d=0;d<u.length;d++)l[this.outputNames[s[d]]]=o[d]??Ow(u[d]);return tr(),l}startProfiling(){}endProfiling(){eS(this.sessionId)}}}),nS={};HP(nS,{OnnxruntimeWebAssemblyBackend:()=>Pm,initializeFlags:()=>Om,wasmBackend:()=>iS});eC=tt(()=>{"use strict";tS(),QP(),Om=()=>{(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"?Tm("node:os").cpus().length:navigator.hardwareConcurrency;oe.wasm.numThreads=Math.min(4,Math.ceil((e||1)/2))}},Pm=class{async init(t){Om(),await qw(),await Jw(t)}async createInferenceSessionHandler(t,e){let n=new rS;return await n.loadModel(t,e),n}},iS=new Pm}),tC="1.26.0",rC=vm;{let t=(eC(),JP(nS)).wasmBackend;Mn("cpu",t,10),Mn("wasm",t,10)}Object.defineProperty(oe.versions,"web",{value:tC,enumerable:!0})});import{existsSync as nC}from"node:fs";import{createRequire as iC}from"node:module";import{dirname as oC,join as sC,sep as aS}from"node:path";import{fileURLToPath as aC,pathToFileURL as cC}from"node:url";async function nc(){let t=await Promise.resolve().then(()=>(sS(),oS));return t.default??t}function ic(t,e){t.env.wasm.numThreads=1,t.env.wasm.wasmPaths=lC(e)}function uC(t){return[new URL("./",t),new URL("../",t)].map(e=>aC(e))}function lC(t=import.meta.url){let e=uC(t);try{e.push(oC(iC(t).resolve("onnxruntime-web")))}catch{}let n=null;for(let i of e){let r=cS.filter(o=>!nC(sC(i,o)));if(r.length===0)return dC(i);r.length<cS.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 ('${uS}' + '${lS}') not found beside the bundle or in node_modules`)}function dC(t){return cC(t.endsWith(aS)?t:t+aS).href}var uS,lS,cS,Mm=g(()=>{"use strict";uS="ort-wasm-simd-threaded.wasm",lS="ort-wasm-simd-threaded.mjs",cS=[uS,lS]});import{existsSync as hC}from"node:fs";import{fileURLToPath as fC}from"node:url";function zm(t,e){return[new URL(`../../assets/${t}`,e),new URL(`./assets/${t}`,e),new URL(`../assets/${t}`,e)].map(n=>fC(n))}function oc(t,e,n,i={}){let r=i.baseUrl??n,o=i.exists??hC,s="envPath"in i?i.envPath:process.env[e];if(s&&o(s))return s;let a=zm(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 Um=g(()=>{"use strict"});function jm(t={}){return oc(dS,hS,import.meta.url,t)}var dS,hS,Fm=g(()=>{"use strict";Um();dS="silero_vad.onnx",hS="JARVIS_SILERO_VAD_MODEL_PATH"});var Vn,no,fS,Dr,Vm=g(()=>{"use strict";Mm();Fm();Vn=512,no=64,fS=256,Dr=class{modelPath;sessionPromise=null;session=null;ort=null;disposed=!1;pending=new Int16Array(Vn);pendingLen=0;state=new Float32Array(fS);context=new Float32Array(no);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(fS),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(Vn-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<Vn)break;this.pendingLen=0,r.push(await this.inferWindow(n,i))}return r}async inferWindow(e,n){let i=new Float32Array(no+Vn);i.set(this.context,0);for(let a=0;a<Vn;a++)i[no+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-no));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 nc();this.ort=e,ic(e);let n=this.modelPath??jm(),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 pC(t){let e=1;for(;e<t;)e<<=1;return e}var Zm,sc,pS=g(()=>{"use strict";Zm=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,_=p+a,$=e[_]*h-n[_]*f,I=e[_]*f+n[_]*h;e[_]=e[p]-$,n[_]=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}}};sc=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=pC(2*e-1),this.fft=new Zm(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 vS(t){let i=27/Math.log(6.4);return t>=1e3?15+Math.log(t/1e3)*i:3*t/200}function vC(t){let i=Math.log(6.4)/27;return t>=15?1e3*Math.exp(i*(t-15)):200*t/3}function yS(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 yC(){let t=vS(0),e=vS(Bm/2),n=yS(t,e,Pt+2),i=new Float64Array(Pt+2);for(let a=0;a<n.length;a++)i[a]=vC(n[a]);let r=yS(0,Bm/2,io),o=new Float64Array(Pt+1);for(let a=0;a<Pt+1;a++)o[a]=i[a+1]-i[a];let s=[];for(let a=0;a<Pt;a++){let c=2/(i[a+2]-i[a]),u=new Float64Array(io),l=io,d=0;for(let h=0;h<io;h++){let f=-(i[a]-r[h])/o[a],p=(i[a+2]-r[h])/o[a+1],_=Math.max(0,Math.min(f,p))*c;u[h]=_,_>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 _C(){let t=new Float64Array(lt);for(let e=0;e<lt;e++)t[e]=.5-.5*Math.cos(2*Math.PI*e/lt);return t}var Bm,lt,mC,Pt,io,mS,gC,gS,Fe,Lr,Gm,oo,ac=g(()=>{"use strict";pS();Bm=16e3,lt=400,mC=160,Pt=80,io=(lt>>1)+1,mS=1e-10,gC=1e-7,gS=32768,Fe=Bm*8,Lr=800,Gm=Pt;oo=class{hann=_C();filters=yC();spectrum=new sc(lt);padded=new Float64Array(Fe+lt);frame=new Float64Array(lt);power=new Float64Array(io);logBuf=new Float64Array(Pt*Lr);fromPcm16(e){return this.window(e),this.normalize(),this.reflectPad(),this.melSpectrogram()}window(e){let n=this.padded,i=lt/2,r=e.length;if(r>=Fe){let o=r-Fe;for(let s=0;s<Fe;s++)n[i+s]=e[o+s]/gS}else{let o=Fe-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]/gS}}normalize(){let e=this.padded,n=lt/2,i=Fe,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+gC);for(let a=0;a<i;a++)e[n+a]=(e[n+a]-r)*s}reflectPad(){let e=this.padded,n=lt/2,i=Fe;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<Lr;l++){let d=l*mC;for(let h=0;h<lt;h++)n[h]=e[d+h]*r[h];this.spectrum.computePower(n,i);for(let h=0;h<Pt;h++){let{lo:f,hi:p,weights:_}=o[h],$=0;for(let I=f;I<p;I++)$+=_[I-f]*i[I];s[h*Lr+l]=Math.log10($<mS?mS:$)}}let a=-1/0;for(let l of s)l>a&&(a=l);let c=a-8,u=new Float32Array(Pt*Lr);for(let l=0;l<s.length;l++){let d=s[l]<c?c:s[l];u[l]=(d+4)/4}return u}}});function bC(t){return t.toLowerCase().replace(/[.,!?;:]+$/g,"").trim()}function cc(t,e){return e.some(n=>bS(t,n))}function bS(t,e){if(!t.endsWith(e))return!1;let n=t.length-e.length-1;return n<0||t[n]===" "}function $C(t,e){let n=xC(t);return n===""?null:e.find(i=>wC(n,i))??null}function xC(t){let e=/^.*[.!?\u3002\uFF01\uFF1F]\s+/s.exec(t);return(e?t.slice(e[0].length):t).trim()}function wC(t,e){for(let n=t.indexOf(e);n!==-1;n=t.indexOf(e,n+1)){let i=n===0||!_S(t[n-1]),r=n+e.length===t.length||!_S(t[n+e.length]);if(i&&r)return!0}return!1}function _S(t){return/[a-z0-9']/.test(t)}var uc,Wm,so,Hm=g(()=>{"use strict";wr();wr();uc={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"]},Wm="semantic",so=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={...uc,...n},this.classifier=i??new Fi(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=bC(e),cc(this.lastNormPartial,this.config.commitCues)){this.commit("lexical");return}let n=this.strongHoldCue,i=$C(this.lastNormPartial,this.config.strongHoldCues);if(i===null&&n!==null&&this.partialStability==="redecode"&&!this.pendingVetoClear){this.pendingVetoClear=!0,this.telemetry?.strongHoldClearDebounced?.(n),cc(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(bS(this.lastNormPartial,this.strongHoldCue)){this.enterHeld(this.strongHoldCue);return}this.holdFloor();return}if(cc(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:cc(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===Wm)){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 $S,ao,qm=g(()=>{"use strict";ac();Hm();$S={...uc,commitThreshold:.65,holdThreshold:.35},ao=class extends so{smartConfig;inference;buffer=new Int16Array(Fe*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={...$S,...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(Wm),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>Fe?n-Fe:0,o=n-r;if(this.bufferLen+o>this.buffer.length){let s=Math.min(this.bufferLen,Fe);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-Fe);return this.buffer.slice(e,this.bufferLen)}}});function Jm(t={}){return oc(xS,wS,import.meta.url,t)}var xS,wS,Km=g(()=>{"use strict";Um();xS="smart-turn-v3.1-cpu.onnx",wS="JARVIS_SMART_TURN_MODEL_PATH"});var co,Ym=g(()=>{"use strict";ac();Mm();Km();co=class{logMel;modelPath;sessionPromise=null;session=null;ort=null;disposed=!1;constructor(e={}){this.logMel=e.logMel??new oo,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,Gm,Lr]),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 nc();this.ort=e,ic(e);let n=this.modelPath??Jm(),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 OC(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 PC(t){let e=Xm(t)?.content,n=(Array.isArray(e)?e:[]).map(l=>Xm(l)).filter(l=>l?.type==="text").map(l=>typeof l?.text=="string"?l.text:"").join(""),i=SS+n;i.includes("}")||(i+="}");let r=i.indexOf("{"),o=i.lastIndexOf("}");if(r===-1||o<=r)throw new or("turn evaluator reply carried no JSON object");let s;try{s=JSON.parse(i.slice(r,o+1))}catch{throw new or("turn evaluator reply was not valid JSON")}let a=Xm(s),c=a?.verdict;if(typeof c!="string"||!TC.includes(c))throw new or("turn evaluator reply carried an unknown verdict");let u=a?.confidence;if(typeof u!="number"||!Number.isFinite(u)||u<0||u>1)throw new or("turn evaluator confidence missing or out of range");return{verdict:c,confidence:u}}function Xm(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:void 0}var SC,EC,IC,SS,kC,TC,AC,or,Zn,Qm=g(()=>{"use strict";SC="claude-haiku-4-5-20251001",EC="https://api.anthropic.com/v1/messages",IC="2023-06-01",SS='{"verdict":"',kC=["}"],TC=["done","mid_thought","hold_floor"],AC=`You are the semantic turn evaluator inside a real-time voice assistant's
148
148
  turn-taking system. The user is speaking; a streaming ASR produces a live
149
149
  partial transcript. Your only job is to judge whether the user's turn reads
150
150
  as finished. You advise a policy layer; you never answer the user.
@@ -185,46 +185,47 @@ Rules:
185
185
  Output exactly one line of strict JSON and nothing else:
186
186
  {"verdict":"done"|"mid_thought"|"hold_floor","confidence":<number 0..1>}
187
187
  confidence is your certainty in the verdict.
188
- `,rr=class extends Error{status;constructor(e,n){super(e),this.status=n,this.name="TurnEvaluatorError"}},Mn=class{key;fetchImpl;timeoutMs;constructor(e,n=fetch,i=2e3){this.key=e,this.fetchImpl=n,this.timeoutMs=i}async evaluate(e,n){let i={model:pC,max_tokens:64,temperature:0,stop_sequences:vC,system:_C,messages:[{role:"user",content:bC(e)},{role:"assistant",content:$S}]},r=await this.fetchImpl(mC,{method:"POST",headers:{"x-api-key":this.key,"anthropic-version":gC,"content-type":"application/json"},body:JSON.stringify(i),signal:AbortSignal.any([n,AbortSignal.timeout(this.timeoutMs)])});if(!r.ok)throw new rr(`turn evaluator request failed (HTTP ${r.status})`,r.status);let o;try{o=await r.json()}catch{throw new rr("turn evaluator response body was not JSON")}return $C(o)}}});function Ym(t){return t===void 0?sc:{id:sc.id,engineVoice:{...sc.engineVoice,"elevenlabs-flash":{kind:"preset",voiceId:t}}}}var ac,sc,Xm=g(()=>{"use strict";ac="21m00Tcm4TlvDq8ikWAM",sc={id:"jarvis-primary",engineVoice:{"elevenlabs-flash":{kind:"preset",voiceId:ac}}}});var cc,xS=g(()=>{"use strict";he();cc=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=U){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 IC(t){return EC.test(t)}var wS,SS,wC,SC,uc,EC,lc,ES=g(()=>{"use strict";Ba();xS();wS=16e3,SS="pcm_s16le",wC="en",SC=["Jarvis"],uc=.7,EC=/\bjarvis\b/i;lc=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 cc(e.turnId,e.clock.now()),e.controller.attachTelemetry?.(this.timeline),e.controller.setPartialStability?.(e.asrEngine.partialStability??"stable"),this.asrStream=e.asrEngine.open({sampleRate:wS,encoding:SS,language:wC,biasTerms:SC,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(),!IC(e.text)){this.finishAsideAbsorbed(e,n);return}let i=this.deps.clock.now();this.timeline.confirmationFired();let r;try{r=await n.evaluator.evaluate({recentTurns:n.recentTurns(),utterance:e.text},this.reasonAbort.signal,{timeoutMs:3e3})}catch(s){if(this.settled)return;this.timeline.confirmationFailed(this.deps.clock.now()-i,s)}if(this.settled)return;let o=!0;if(r&&(o=!((r.verdict==="to_other"||r.verdict==="self_talk")&&r.confidence>=uc),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<uc){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:wS,encoding:SS});this.ttsStream=r,r.onAudio(s=>{if(!this.settled){if(i||(i=!0,this.timeline.firstTtsAudio(this.deps.clock.now())),this.absorbPending){this.pendingDispatch?.audio.push(s);return}this.resolveDispatched(),this.deps.emit({type:"response.audio",turnId:this.deps.turnId,audio:s})}}),r.onError(s=>this.finishError("turn_failed",s));let o=this.deps.reasoner.run(e,this.reasonAbort.signal,{register:"voice"});for await(let s of o){if(this.settled)return;if(this.absorbPending){this.finishAbsorbed();return}n||(n=!0,this.timeline.firstReasonerDelta(this.deps.clock.now())),this.pendingDispatch?this.pendingDispatch.deltas.push(s.text):this.deps.emit({type:"response.delta",turnId:this.deps.turnId,text:s.text});for(let a of this.deps.segmenter.push(s.text))r.pushText(a)}if(!this.settled){if(this.absorbPending){let{verdict:s,confidence:a,latencyMs: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 Qm}from"node:crypto";var eg,tg,jn,so,dc,IS=g(()=>{"use strict";he();zi();Va();om();Dx();Ba();am();Li();br();Mm();Gm();qm();Km();Xm();ES();eg=6,tg=45e3,jn=class extends Error{constructor(e){super(e),this.name="ReasonerUnavailableError"}},so=class extends Error{constructor(e){super(e),this.name="VoiceUnavailableError"}},dc=class{deps;sessionId;deviceId;projectId;queue=new Za;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 St,this.newSmartTurnInference=i.createSmartTurnInference??(()=>new oo),this.newFrameClassifier=i.createFrameClassifier??(()=>new Mi(new Cr)),this.newTurnEvaluator=i.createTurnEvaluator??(r=>new Mn(r)),this.newAddresseeEvaluator=i.createAddresseeEvaluator??(r=>new Cn(r)),this.newTurnController=i.createTurnController??(r=>{let o=this.ensureFrameClassifier();return o.reset?.(),new io(r,this.ensureSmartTurnInference(),{},this.speechObservingClassifier(o),this.semanticHook())}),this.newSegmenter=i.createSegmenter??(()=>new Ki),this.emit({type:"session.ready"})}async send(e){let{commandId:n}=e;if(this.closed)throw new Ue(n,"closed");if(e.sessionId!==this.sessionId)throw new Ue(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 Ue(n,"unsupported");default:throw new Ue(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 Ue(e.commandId,"invalid","input.text requires non-empty text");if(this.inFlight)throw new Ue(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=Qm();this.emit({type:"turn.accepted",turnId:n,clientTurnId:e.clientTurnId,source:"text",commandId:e.commandId}),this.emit({type:"turn.final",turnId:n,turn:this.toTextUserTurn(n,e),commandId:e.commandId}),this.runTextTurn(n,e)}async runTextTurn(e,n){let i=new AbortController;this.turnAbort=i;try{let r=this.ensureReasoner();this.emit({type:"state",turnId:e,state:"responding"});for await(let o of r.run(n.text,i.signal))this.emit({type:"response.delta",turnId:e,text:o.text});this.emit({type:"response.done",turnId:e})}catch(r){let o=r instanceof jn?"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 Ue(e.commandId,"backpressured","a turn is already in progress (one turn at a time in v0.1)");this.inFlight=!0;let n=Qm();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 lc({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 jn?"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 so("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 so("no voice route configured - run 'jarvis init' to set routes.stt and routes.tts");let r=!e.secrets?.[n.provider]&&kr(n.provider),o=!e.secrets?.[i.provider]&&kr(i.provider);if(r||o){let u=r?n.provider:i.provider;throw new so(`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??Ym(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(-eg)}}}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,U.debug("addressee evaluator construction failed - the layer is absent",{error:i instanceof Error?i.message:String(i)})}}return this.addresseeEvaluator===null?void 0:{evaluator:this.addresseeEvaluator,recentTurns:()=>this.addresseeContext(),onAbsorbed:(n,i)=>{this.recordAbsorbedFinal(n),this.noteSpeech(),i?.verdict==="to_other"&&i.confidence>=uc&&this.enterAside(i.confidence)},floorState:()=>this.floorState,onFloorReleased:n=>this.exitAside(n)}}enterAside(e){this.floorState!=="aside"&&(this.floorState="aside",this.noteSpeech(),this.armAsideDecay(tg),U.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),U.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>=tg?this.exitAside("decay"):this.armAsideDecay(tg-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(-eg)}recordAbsorbedFinal(e){this.absorbedFinals.push({afterHistoryLen:this.reasoner?.historySnapshot().length??0,text:e}),this.absorbedFinals.length>eg&&this.absorbedFinals.shift()}ensureReasoner(){if(this.reasoner)return this.reasoner;let e=this.deps.configService.resolved(),n=e.routes?.text;if(!n)throw new jn("no text model is configured - run 'jarvis init' to set routes.text");let i=e.secrets?.[n.provider];if(!i)throw new jn(`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 Ji(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:Qm(),atMs:Date.now()})}}});function kC(t,e,n){let i=new URL(t);i.searchParams.set("model_id",e),i.searchParams.set("audio_format",TC(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 TC(t){return t.encoding==="pcm_s16le"?`pcm_${t.sampleRate}`:"pcm_16000"}var kS,ao,rg,ng=g(()=>{"use strict";$a();kS="wss://api.elevenlabs.io/v1/speech-to-text/realtime",ao=class{apiKey;socketFactory;model;endpoint;id="elevenlabs-scribe";constructor(e,n,i,r=kS){this.apiKey=e,this.socketFactory=n,this.model=i,this.endpoint=r}open(e){return new rg(this.apiKey,this.socketFactory,this.model,this.endpoint,e)}},rg=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(kC(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=bn(e);if(!n)return;let i=ba(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:ji(n.text),isFinal:!1,startMs:0});return}if(r==="committed_transcript"||r==="committed_transcript_with_timestamps"){let o=ji(n.text);o.length>0&&this.committed.push(o),this.endPending&&this.resolveEnd()}}handleError(e){if(this.closed)return;let n=$n("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:w$(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 AC}from"node:crypto";function PC(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 CC(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",RC(i)),r.searchParams.set("auto_mode","true"),r.toString()}function RC(t){return t.encoding==="pcm_s16le"?`pcm_${t.sampleRate}`:"pcm_16000"}var TS,OC,co,ig,og=g(()=>{"use strict";$a();TS="wss://api.elevenlabs.io/v1/text-to-speech/{voice_id}/multi-stream-input",OC={stability:.5,similarity_boost:.75,use_speaker_boost:!0},co=class{apiKey;socketFactory;model;endpointTemplate;id="elevenlabs-flash";constructor(e,n,i,r=TS){this.apiKey=e,this.socketFactory=n,this.model=i,this.endpointTemplate=r}speak(e){return new ig(this.apiKey,this.socketFactory,this.model,this.endpointTemplate,this.id,e)}},ig=class{socket;contextId=AC();opened=!1;cancelled=!1;closed=!1;endRequested=!1;closeContextSent=!1;pending=[];audioCb;errorCb;endPending=null;constructor(e,n,i,r,o,s){let a=PC(s.voice,o);this.socket=n(CC(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=bn(e);if(!n)return;let i=ba(n);if(i){this.handleError(new Error(`stream error (${i})`));return}typeof n.audio=="string"&&n.audio.length>0&&this.audioCb?.(S$(n.audio)),(n.isFinal===!0||n.is_final===!0)&&this.resolveEnd()}handleError(e){if(this.closed)return;let n=$n("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:OC,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 DC(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 uo,sg=g(()=>{"use strict";ng();og();Rp();wa();Ua();uo=class{socketFactory;fetchImpl;constructor(e=On,n=fetch){this.socketFactory=e,this.fetchImpl=n}asrEngine(e,n){switch(e.provider){case"elevenlabs":return new ao(n,this.socketFactory,e.model);case"sherpa-onnx":return DC(e.url),new Fi(this.socketFactory,e.url);case"openai-compat":return new _a(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 co(n,this.socketFactory,e.model);throw new Error(`no tts adapter for provider '${e.provider}'`)}}});import{randomUUID as NC}from"node:crypto";function cg(t={}){let e=new _r;U.setLevel(e.logLevel),U.debug("core created",{logLevel:e.logLevel});let{fetchImpl:n}=t,i={configService:t.configService??new We,registry:t.registry??new Ni(n),voiceRegistry:t.voiceRegistry??new uo(t.voiceSocketFactory,n),createTurnEvaluator:t.createTurnEvaluator??(r=>new Mn(r,n)),createAddresseeEvaluator:t.createAddresseeEvaluator??(r=>new Cn(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 ag(i)}var zC,LC,ag,AS=g(()=>{"use strict";he();xp();wp();kp();IS();Ba();Km();sg();zC="jarvis-core",LC="0.1.0-dev",ag=class{deps;constructor(e){this.deps=e}describe(){return Promise.resolve({name:zC,version:LC})}openSession(e){let n=NC();return U.debug("core opened session",{sessionId:n,capabilities:e.clientCapabilities}),Promise.resolve(new dc(n,e,this.deps))}}});var UC,MC,CF,OS=g(()=>{"use strict";yr();Va();UC=1440*60*1e3,MC={stt:!0,tts:!0,text:!0,embedding:!0},CF=Object.keys(MC)});var Fn=g(()=>{"use strict";AS();wp();Va();OS();kp();Ip();om();Ep();Sp();Ua();ng();og();wa();sg();Xm();Bm();Gm();qm();br();Mm();Um();nc();Hm();am();Li()});var Bn=R((FV,NS)=>{"use strict";var JC="2.0.0",KC=Number.MAX_SAFE_INTEGER||9007199254740991,YC=16,XC=250,QC=["major","premajor","minor","preminor","patch","prepatch","prerelease"];NS.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:YC,MAX_SAFE_BUILD_LENGTH:XC,MAX_SAFE_INTEGER:KC,RELEASE_TYPES:QC,SEMVER_SPEC_VERSION:JC,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var fo=R((VV,zS)=>{"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):()=>{};zS.exports=eR});var Gn=R((vt,LS)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:dg,MAX_SAFE_BUILD_LENGTH:tR,MAX_LENGTH:rR}=Bn(),nR=fo();vt=LS.exports={};var iR=vt.re=[],oR=vt.safeRe=[],O=vt.src=[],sR=vt.safeSrc=[],P=vt.t={},aR=0,hg="[a-zA-Z0-9-]",cR=[["\\s",1],["\\d",rR],[hg,tR]],uR=t=>{for(let[e,n]of cR)t=t.split(`${e}*`).join(`${e}{0,${n}}`).split(`${e}+`).join(`${e}{1,${n}}`);return t},M=(t,e,n)=>{let i=uR(e),r=aR++;nR(t,r,e),P[t]=r,O[r]=e,sR[r]=i,iR[r]=new RegExp(e,n?"g":void 0),oR[r]=new RegExp(i,n?"g":void 0)};M("NUMERICIDENTIFIER","0|[1-9]\\d*");M("NUMERICIDENTIFIERLOOSE","\\d+");M("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${hg}*`);M("MAINVERSION",`(${O[P.NUMERICIDENTIFIER]})\\.(${O[P.NUMERICIDENTIFIER]})\\.(${O[P.NUMERICIDENTIFIER]})`);M("MAINVERSIONLOOSE",`(${O[P.NUMERICIDENTIFIERLOOSE]})\\.(${O[P.NUMERICIDENTIFIERLOOSE]})\\.(${O[P.NUMERICIDENTIFIERLOOSE]})`);M("PRERELEASEIDENTIFIER",`(?:${O[P.NONNUMERICIDENTIFIER]}|${O[P.NUMERICIDENTIFIER]})`);M("PRERELEASEIDENTIFIERLOOSE",`(?:${O[P.NONNUMERICIDENTIFIER]}|${O[P.NUMERICIDENTIFIERLOOSE]})`);M("PRERELEASE",`(?:-(${O[P.PRERELEASEIDENTIFIER]}(?:\\.${O[P.PRERELEASEIDENTIFIER]})*))`);M("PRERELEASELOOSE",`(?:-?(${O[P.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${O[P.PRERELEASEIDENTIFIERLOOSE]})*))`);M("BUILDIDENTIFIER",`${hg}+`);M("BUILD",`(?:\\+(${O[P.BUILDIDENTIFIER]}(?:\\.${O[P.BUILDIDENTIFIER]})*))`);M("FULLPLAIN",`v?${O[P.MAINVERSION]}${O[P.PRERELEASE]}?${O[P.BUILD]}?`);M("FULL",`^${O[P.FULLPLAIN]}$`);M("LOOSEPLAIN",`[v=\\s]*${O[P.MAINVERSIONLOOSE]}${O[P.PRERELEASELOOSE]}?${O[P.BUILD]}?`);M("LOOSE",`^${O[P.LOOSEPLAIN]}$`);M("GTLT","((?:<|>)?=?)");M("XRANGEIDENTIFIERLOOSE",`${O[P.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);M("XRANGEIDENTIFIER",`${O[P.NUMERICIDENTIFIER]}|x|X|\\*`);M("XRANGEPLAIN",`[v=\\s]*(${O[P.XRANGEIDENTIFIER]})(?:\\.(${O[P.XRANGEIDENTIFIER]})(?:\\.(${O[P.XRANGEIDENTIFIER]})(?:${O[P.PRERELEASE]})?${O[P.BUILD]}?)?)?`);M("XRANGEPLAINLOOSE",`[v=\\s]*(${O[P.XRANGEIDENTIFIERLOOSE]})(?:\\.(${O[P.XRANGEIDENTIFIERLOOSE]})(?:\\.(${O[P.XRANGEIDENTIFIERLOOSE]})(?:${O[P.PRERELEASELOOSE]})?${O[P.BUILD]}?)?)?`);M("XRANGE",`^${O[P.GTLT]}\\s*${O[P.XRANGEPLAIN]}$`);M("XRANGELOOSE",`^${O[P.GTLT]}\\s*${O[P.XRANGEPLAINLOOSE]}$`);M("COERCEPLAIN",`(^|[^\\d])(\\d{1,${dg}})(?:\\.(\\d{1,${dg}}))?(?:\\.(\\d{1,${dg}}))?`);M("COERCE",`${O[P.COERCEPLAIN]}(?:$|[^\\d])`);M("COERCEFULL",O[P.COERCEPLAIN]+`(?:${O[P.PRERELEASE]})?(?:${O[P.BUILD]})?(?:$|[^\\d])`);M("COERCERTL",O[P.COERCE],!0);M("COERCERTLFULL",O[P.COERCEFULL],!0);M("LONETILDE","(?:~>?)");M("TILDETRIM",`(\\s*)${O[P.LONETILDE]}\\s+`,!0);vt.tildeTrimReplace="$1~";M("TILDE",`^${O[P.LONETILDE]}${O[P.XRANGEPLAIN]}$`);M("TILDELOOSE",`^${O[P.LONETILDE]}${O[P.XRANGEPLAINLOOSE]}$`);M("LONECARET","(?:\\^)");M("CARETTRIM",`(\\s*)${O[P.LONECARET]}\\s+`,!0);vt.caretTrimReplace="$1^";M("CARET",`^${O[P.LONECARET]}${O[P.XRANGEPLAIN]}$`);M("CARETLOOSE",`^${O[P.LONECARET]}${O[P.XRANGEPLAINLOOSE]}$`);M("COMPARATORLOOSE",`^${O[P.GTLT]}\\s*(${O[P.LOOSEPLAIN]})$|^$`);M("COMPARATOR",`^${O[P.GTLT]}\\s*(${O[P.FULLPLAIN]})$|^$`);M("COMPARATORTRIM",`(\\s*)${O[P.GTLT]}\\s*(${O[P.LOOSEPLAIN]}|${O[P.XRANGEPLAIN]})`,!0);vt.comparatorTrimReplace="$1$2$3";M("HYPHENRANGE",`^\\s*(${O[P.XRANGEPLAIN]})\\s+-\\s+(${O[P.XRANGEPLAIN]})\\s*$`);M("HYPHENRANGELOOSE",`^\\s*(${O[P.XRANGEPLAINLOOSE]})\\s+-\\s+(${O[P.XRANGEPLAINLOOSE]})\\s*$`);M("STAR","(<|>)?=?\\s*\\*");M("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");M("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var gc=R((ZV,US)=>{"use strict";var lR=Object.freeze({loose:!0}),dR=Object.freeze({}),hR=t=>t?typeof t!="object"?lR:t:dR;US.exports=hR});var fg=R((BV,FS)=>{"use strict";var MS=/^[0-9]+$/,jS=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let n=MS.test(t),i=MS.test(e);return n&&i&&(t=+t,e=+e),t===e?0:n&&!i?-1:i&&!n?1:t<e?-1:1},fR=(t,e)=>jS(e,t);FS.exports={compareIdentifiers:jS,rcompareIdentifiers:fR}});var be=R((GV,ZS)=>{"use strict";var vc=fo(),{MAX_LENGTH:VS,MAX_SAFE_INTEGER:yc}=Bn(),{safeRe:_c,t:bc}=Gn(),pR=gc(),{compareIdentifiers:pg}=fg(),mR=(t,e)=>{let n=e.split(".");if(n.length>t.length)return!1;for(let i=0;i<n.length;i++)if(pg(t[i],n[i])!==0)return!1;return!0},mg=class t{constructor(e,n){if(n=pR(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>VS)throw new TypeError(`version is longer than ${VS} characters`);vc("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let i=e.trim().match(n.loose?_c[bc.LOOSE]:_c[bc.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>yc||this.major<0)throw new TypeError("Invalid major version");if(this.minor>yc||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>yc||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<yc)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(vc("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(vc("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 pg(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(vc("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 pg(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?_c[bc.PRERELEASELOOSE]:_c[bc.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]),mR(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}};ZS.exports=mg});var nr=R((WV,GS)=>{"use strict";var BS=be(),gR=(t,e,n=!1)=>{if(t instanceof BS)return t;try{return new BS(t,e)}catch(i){if(!n)return null;throw i}};GS.exports=gR});var HS=R((HV,WS)=>{"use strict";var vR=nr(),yR=(t,e)=>{let n=vR(t,e);return n?n.version:null};WS.exports=yR});var JS=R((qV,qS)=>{"use strict";var _R=nr(),bR=(t,e)=>{let n=_R(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};qS.exports=bR});var XS=R((JV,YS)=>{"use strict";var KS=be(),$R=(t,e,n,i,r)=>{typeof n=="string"&&(r=i,i=n,n=void 0);try{return new KS(t instanceof KS?t.version:t,n).inc(e,i,r).version}catch{return null}};YS.exports=$R});var t0=R((KV,e0)=>{"use strict";var QS=nr(),xR=(t,e)=>{let n=QS(t,null,!0),i=QS(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"};e0.exports=xR});var n0=R((YV,r0)=>{"use strict";var wR=be(),SR=(t,e)=>new wR(t,e).major;r0.exports=SR});var o0=R((XV,i0)=>{"use strict";var ER=be(),IR=(t,e)=>new ER(t,e).minor;i0.exports=IR});var a0=R((QV,s0)=>{"use strict";var kR=be(),TR=(t,e)=>new kR(t,e).patch;s0.exports=TR});var u0=R((e3,c0)=>{"use strict";var AR=nr(),OR=(t,e)=>{let n=AR(t,e);return n&&n.prerelease.length?n.prerelease:null};c0.exports=OR});var rt=R((t3,d0)=>{"use strict";var l0=be(),PR=(t,e,n)=>new l0(t,n).compare(new l0(e,n));d0.exports=PR});var f0=R((r3,h0)=>{"use strict";var CR=rt(),RR=(t,e,n)=>CR(e,t,n);h0.exports=RR});var m0=R((n3,p0)=>{"use strict";var DR=rt(),NR=(t,e)=>DR(t,e,!0);p0.exports=NR});var $c=R((i3,v0)=>{"use strict";var g0=be(),zR=(t,e,n)=>{let i=new g0(t,n),r=new g0(e,n);return i.compare(r)||i.compareBuild(r)};v0.exports=zR});var _0=R((o3,y0)=>{"use strict";var LR=$c(),UR=(t,e)=>t.sort((n,i)=>LR(n,i,e));y0.exports=UR});var $0=R((s3,b0)=>{"use strict";var MR=$c(),jR=(t,e)=>t.sort((n,i)=>MR(i,n,e));b0.exports=jR});var po=R((a3,x0)=>{"use strict";var FR=rt(),VR=(t,e,n)=>FR(t,e,n)>0;x0.exports=VR});var xc=R((c3,w0)=>{"use strict";var ZR=rt(),BR=(t,e,n)=>ZR(t,e,n)<0;w0.exports=BR});var gg=R((u3,S0)=>{"use strict";var GR=rt(),WR=(t,e,n)=>GR(t,e,n)===0;S0.exports=WR});var vg=R((l3,E0)=>{"use strict";var HR=rt(),qR=(t,e,n)=>HR(t,e,n)!==0;E0.exports=qR});var wc=R((d3,I0)=>{"use strict";var JR=rt(),KR=(t,e,n)=>JR(t,e,n)>=0;I0.exports=KR});var Sc=R((h3,k0)=>{"use strict";var YR=rt(),XR=(t,e,n)=>YR(t,e,n)<=0;k0.exports=XR});var yg=R((f3,T0)=>{"use strict";var QR=gg(),eD=vg(),tD=po(),rD=wc(),nD=xc(),iD=Sc(),oD=(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 QR(t,n,i);case"!=":return eD(t,n,i);case">":return tD(t,n,i);case">=":return rD(t,n,i);case"<":return nD(t,n,i);case"<=":return iD(t,n,i);default:throw new TypeError(`Invalid operator: ${e}`)}};T0.exports=oD});var O0=R((p3,A0)=>{"use strict";var sD=be(),aD=nr(),{safeRe:Ec,t:Ic}=Gn(),cD=(t,e)=>{if(t instanceof sD)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?Ec[Ic.COERCEFULL]:Ec[Ic.COERCE]);else{let c=e.includePrerelease?Ec[Ic.COERCERTLFULL]:Ec[Ic.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 aD(`${i}.${r}.${o}${s}${a}`,e)};A0.exports=cD});var C0=R((m3,P0)=>{"use strict";var uD=nr(),lD=Bn(),dD=be(),hD=(t,e,n)=>{if(!lD.RELEASE_TYPES.includes(e))return null;let i=fD(t,n);return i&&pD(i,e)},fD=(t,e)=>{let n=t instanceof dD?t.version:t;return uD(n,e)},pD=(t,e)=>{if(mD(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()},mD=t=>t.startsWith("pre");P0.exports=hD});var D0=R((g3,R0)=>{"use strict";var _g=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}};R0.exports=_g});var nt=R((v3,U0)=>{"use strict";var gD=/\s+/g,bg=class t{constructor(e,n){if(n=yD(n),e instanceof t)return e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease?e:new t(e.raw,n);if(e instanceof $g)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(gD," "),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=>!z0(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&&kD(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(ID,"");let i=((this.options.includePrerelease&&SD)|(this.options.loose&&ED))+":"+e,r=N0.get(i);if(r)return r;let o=this.options.loose,s=o?Ce[$e.HYPHENRANGELOOSE]:Ce[$e.HYPHENRANGE];e=e.replace(s,LD(this.options.includePrerelease)),te("hyphen replace",e),e=e.replace(Ce[$e.COMPARATORTRIM],$D),te("comparator trim",e),e=e.replace(Ce[$e.TILDETRIM],xD),te("tilde trim",e),e=e.replace(Ce[$e.CARETTRIM],wD),te("caret trim",e);let a=e.split(" ").map(d=>TD(d,this.options)).join(" ").split(/\s+/).map(d=>zD(d,this.options));o&&(a=a.filter(d=>(te("loose invalid filter",d,this.options),!!d.match(Ce[$e.COMPARATORLOOSE])))),te("range list",a);let c=new Map,u=a.map(d=>new $g(d,this.options));for(let d of u){if(z0(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let l=[...c.values()];return N0.set(i,l),l}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(i=>L0(i,n)&&e.set.some(r=>L0(r,n)&&i.every(o=>r.every(s=>o.intersects(s,n)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new _D(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}};U0.exports=bg;var vD=D0(),N0=new vD,yD=gc(),$g=mo(),te=fo(),_D=be(),{safeRe:Ce,src:bD,t:$e,comparatorTrimReplace:$D,tildeTrimReplace:xD,caretTrimReplace:wD}=Gn(),{FLAG_INCLUDE_PRERELEASE:SD,FLAG_LOOSE:ED}=Bn(),ID=new RegExp(bD[$e.BUILD],"g"),z0=t=>t.value==="<0.0.0-0",kD=t=>t.value==="",L0=(t,e)=>{let n=!0,i=t.slice(),r=i.pop();for(;n&&i.length;)n=i.every(o=>r.intersects(o,e)),r=i.pop();return n},TD=(t,e)=>(t=t.replace(Ce[$e.BUILD],""),te("comp",t,e),t=PD(t,e),te("caret",t),t=AD(t,e),te("tildes",t),t=RD(t,e),te("xrange",t),t=ND(t,e),te("stars",t),t),Re=t=>!t||t.toLowerCase()==="x"||t==="*",AD=(t,e)=>t.trim().split(/\s+/).map(n=>OD(n,e)).join(" "),OD=(t,e)=>{let n=e.loose?Ce[$e.TILDELOOSE]:Ce[$e.TILDE];return t.replace(n,(i,r,o,s,a)=>{te("tilde",t,i,r,o,s,a);let c;return Re(r)?c="":Re(o)?c=`>=${r}.0.0 <${+r+1}.0.0-0`:Re(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})},PD=(t,e)=>t.trim().split(/\s+/).map(n=>CD(n,e)).join(" "),CD=(t,e)=>{te("caret",t,e);let n=e.loose?Ce[$e.CARETLOOSE]:Ce[$e.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 Re(o)?u="":Re(s)?u=`>=${o}.0.0${i} <${+o+1}.0.0-0`:Re(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})},RD=(t,e)=>(te("replaceXRanges",t,e),t.split(/\s+/).map(n=>DD(n,e)).join(" ")),DD=(t,e)=>{t=t.trim();let n=e.loose?Ce[$e.XRANGELOOSE]:Ce[$e.XRANGE];return t.replace(n,(i,r,o,s,a,c)=>{te("xRange",t,i,r,o,s,a,c);let u=Re(o),l=u||Re(s),d=l||Re(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})},ND=(t,e)=>(te("replaceStars",t,e),t.trim().replace(Ce[$e.STAR],"")),zD=(t,e)=>(te("replaceGTE0",t,e),t.trim().replace(Ce[e.includePrerelease?$e.GTE0PRE:$e.GTE0],"")),LD=t=>(e,n,i,r,o,s,a,c,u,l,d,h)=>(Re(i)?n="":Re(r)?n=`>=${i}.0.0${t?"-0":""}`:Re(o)?n=`>=${i}.${r}.0${t?"-0":""}`:s?n=`>=${n}`:n=`>=${n}${t?"-0":""}`,Re(u)?c="":Re(l)?c=`<${+u+1}.0.0-0`:Re(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!==$g.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 mo=R((y3,B0)=>{"use strict";var go=Symbol("SemVer ANY"),Sg=class t{static get ANY(){return go}constructor(e,n){if(n=M0(n),e instanceof t){if(e.loose===!!n.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),wg("comparator",e,n),this.options=n,this.loose=!!n.loose,this.parse(e),this.semver===go?this.value="":this.value=this.operator+this.semver.version,wg("comp",this)}parse(e){let n=this.options.loose?j0[F0.COMPARATORLOOSE]:j0[F0.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 V0(i[2],this.options.loose):this.semver=go}toString(){return this.value}test(e){if(wg("Comparator.test",e,this.options.loose),this.semver===go||e===go)return!0;if(typeof e=="string")try{e=new V0(e,this.options)}catch{return!1}return xg(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 Z0(e.value,n).test(this.value):e.operator===""?e.value===""?!0:new Z0(this.value,n).test(e.semver):(n=M0(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("=")||xg(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||xg(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};B0.exports=Sg;var M0=gc(),{safeRe:j0,t:F0}=Gn(),xg=yg(),wg=fo(),V0=be(),Z0=nt()});var vo=R((_3,G0)=>{"use strict";var MD=nt(),jD=(t,e,n)=>{try{e=new MD(e,n)}catch{return!1}return e.test(t)};G0.exports=jD});var H0=R((b3,W0)=>{"use strict";var FD=nt(),VD=(t,e)=>new FD(t,e).set.map(n=>n.map(i=>i.value).join(" ").trim().split(" "));W0.exports=VD});var J0=R(($3,q0)=>{"use strict";var ZD=be(),BD=nt(),GD=(t,e,n)=>{let i=null,r=null,o=null;try{o=new BD(e,n)}catch{return null}return t.forEach(s=>{o.test(s)&&(!i||r.compare(s)===-1)&&(i=s,r=new ZD(i,n))}),i};q0.exports=GD});var Y0=R((x3,K0)=>{"use strict";var WD=be(),HD=nt(),qD=(t,e,n)=>{let i=null,r=null,o=null;try{o=new HD(e,n)}catch{return null}return t.forEach(s=>{o.test(s)&&(!i||r.compare(s)===1)&&(i=s,r=new WD(i,n))}),i};K0.exports=qD});var eE=R((w3,Q0)=>{"use strict";var Eg=be(),JD=nt(),X0=po(),KD=(t,e)=>{t=new JD(t,e);let n=new Eg("0.0.0");if(t.test(n)||(n=new Eg("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 Eg(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||X0(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!n||X0(n,o))&&(n=o)}return n&&t.test(n)?n:null};Q0.exports=KD});var rE=R((S3,tE)=>{"use strict";var YD=nt(),XD=(t,e)=>{try{return new YD(t,e).range||"*"}catch{return null}};tE.exports=XD});var kc=R((E3,sE)=>{"use strict";var QD=be(),oE=mo(),{ANY:eN}=oE,tN=nt(),rN=vo(),nE=po(),iE=xc(),nN=Sc(),iN=wc(),oN=(t,e,n,i)=>{t=new QD(t,i),e=new tN(e,i);let r,o,s,a,c;switch(n){case">":r=nE,o=nN,s=iE,a=">",c=">=";break;case"<":r=iE,o=iN,s=nE,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(rN(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===eN&&(f=new oE(">=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};sE.exports=oN});var cE=R((I3,aE)=>{"use strict";var sN=kc(),aN=(t,e,n)=>sN(t,e,">",n);aE.exports=aN});var lE=R((k3,uE)=>{"use strict";var cN=kc(),uN=(t,e,n)=>cN(t,e,"<",n);uE.exports=uN});var fE=R((T3,hE)=>{"use strict";var dE=nt(),lN=(t,e,n)=>(t=new dE(t,n),e=new dE(e,n),t.intersects(e,n));hE.exports=lN});var mE=R((A3,pE)=>{"use strict";var dN=vo(),hN=rt();pE.exports=(t,e,n)=>{let i=[],r=null,o=null,s=t.sort((l,d)=>hN(l,d,n));for(let l of s)dN(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 $E=R((O3,bE)=>{"use strict";var gE=nt(),Tg=mo(),{ANY:Ig}=Tg,kg=vo(),Ag=rt(),fN=(t,e,n={})=>{if(t===e)return!0;t=new gE(t,n),e=new gE(e,n);let i=!1;e:for(let r of t.set){for(let o of e.set){let s=mN(r,o,n);if(i=i||s!==null,s)continue e}if(i)return!1}return!0},pN=[new Tg(">=0.0.0-0")],vE=[new Tg(">=0.0.0")],mN=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Ig){if(e.length===1&&e[0].semver===Ig)return!0;n.includePrerelease?t=pN:t=vE}if(e.length===1&&e[0].semver===Ig){if(n.includePrerelease)return!0;e=vE}let i=new Set,r,o;for(let f of t)f.operator===">"||f.operator===">="?r=yE(r,f,n):f.operator==="<"||f.operator==="<="?o=_E(o,f,n):i.add(f.semver);if(i.size>1)return null;let s;if(r&&o){if(s=Ag(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&&!kg(f,String(r),n)||o&&!kg(f,String(o),n))return null;for(let p of e)if(!kg(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=yE(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=_E(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)},yE=(t,e,n)=>{if(!t)return e;let i=Ag(t.semver,e.semver,n);return i>0?t:i<0||e.operator===">"&&t.operator===">="?e:t},_E=(t,e,n)=>{if(!t)return e;let i=Ag(t.semver,e.semver,n);return i<0?t:i>0||e.operator==="<"&&t.operator==="<="?e:t};bE.exports=fN});var EE=R((P3,SE)=>{"use strict";var Og=Gn(),xE=Bn(),gN=be(),wE=fg(),vN=nr(),yN=HS(),_N=JS(),bN=XS(),$N=t0(),xN=n0(),wN=o0(),SN=a0(),EN=u0(),IN=rt(),kN=f0(),TN=m0(),AN=$c(),ON=_0(),PN=$0(),CN=po(),RN=xc(),DN=gg(),NN=vg(),zN=wc(),LN=Sc(),UN=yg(),MN=O0(),jN=C0(),FN=mo(),VN=nt(),ZN=vo(),BN=H0(),GN=J0(),WN=Y0(),HN=eE(),qN=rE(),JN=kc(),KN=cE(),YN=lE(),XN=fE(),QN=mE(),ez=$E();SE.exports={parse:vN,valid:yN,clean:_N,inc:bN,diff:$N,major:xN,minor:wN,patch:SN,prerelease:EN,compare:IN,rcompare:kN,compareLoose:TN,compareBuild:AN,sort:ON,rsort:PN,gt:CN,lt:RN,eq:DN,neq:NN,gte:zN,lte:LN,cmp:UN,coerce:MN,truncate:jN,Comparator:FN,Range:VN,satisfies:ZN,toComparators:BN,maxSatisfying:GN,minSatisfying:WN,minVersion:HN,validRange:qN,outside:JN,gtr:KN,ltr:YN,intersects:XN,simplifyRange:QN,subset:ez,SemVer:gN,re:Og.re,src:Og.src,tokens:Og.t,SEMVER_SPEC_VERSION:xE.SEMVER_SPEC_VERSION,RELEASE_TYPES:xE.RELEASE_TYPES,compareIdentifiers:wE.compareIdentifiers,rcompareIdentifiers:wE.rcompareIdentifiers}});var OE=R((j3,Pg)=>{var Oc=process||{},TE=Oc.argv||[],Ac=Oc.env||{},iz=!(Ac.NO_COLOR||TE.includes("--no-color"))&&(!!Ac.FORCE_COLOR||TE.includes("--color")||Oc.platform==="win32"||(Oc.stdout||{}).isTTY&&Ac.TERM!=="dumb"||!!Ac.CI),oz=(t,e,n=t)=>i=>{let r=""+i,o=r.indexOf(e,t.length);return~o?t+sz(r,e,n,o)+e:t+r+e},sz=(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)},AE=(t=iz)=>{let e=t?oz:()=>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")}};Pg.exports=AE();Pg.exports.createColors=AE});var Lg=R((h8,JE)=>{"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"},Az={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},Oz={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}};JE.exports={cursor:zg,scroll:Az,erase:Oz,beep:"\x07"}});function VI(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 Qc,ZI=g(()=>{"use strict";Qc=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 GI(t){return t.byteLength/2/DL}function NL(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 BI,DL,eu,WI=g(()=>{"use strict";he();Fn();BI=32,DL=16,eu=class{constructor(e,n,i={}){this.vad=e;this.onSpeech=n;this.speechThreshold=i.speechThreshold??.5,this.onsetMs=i.onsetMs??2*BI,this.holdoffMs=i.holdoffMs??300,this.energyThreshold=i.energyThreshold??.01,this.log=i.log??U}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(Ye(e,this.energyThreshold),GI(e));return}this.vad.process(NL(e)).then(n=>{if(!this.closed)for(let i of n)this.applyVerdict(i>=this.speechThreshold,BI)},n=>{this.closed||(this.degrade(n),this.applyVerdict(Ye(e,this.energyThreshold),GI(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 rv={};qe(rv,{DecibriCapture:()=>ev,DecibriPlayback:()=>tv,hasInputDevice:()=>UL});import{Microphone as zL,Speaker as LL,inputDevices as qI}from"decibri";function UL(){try{return qI().length>0}catch(t){return U.debug("audio input enumeration failed; treating as no microphone",{error:t}),!1}}function ML(){try{let t=qI(),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){U.debug("could not read default input device; opening at 16k mono",{error:t})}return{sampleRate:Io,channels:tu}}function jL(t){return Math.max(64,Math.min(65536,Math.round(t/10)))}function FL(t,e,n){let i=new Uint8Array(t),r=new Int16Array(i.buffer,0,i.byteLength>>1),o=n.process(VI(r,e));return Buffer.from(o.buffer,o.byteOffset,o.byteLength)}function BL(t){return Buffer.from(t.buffer,t.byteOffset,t.byteLength)}var Io,tu,JI,HI,ev,VL,ZL,tv,nv=g(()=>{"use strict";he();Fn();ZI();WI();Io=16e3,tu=1,JI="int16",HI=.01;ev=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}=ML(),r=(this.deps.createVad??(()=>new Cr))(),o=null;try{await r.load(),o=new eu(r,()=>e.onSpeechStart(),{energyThreshold:HI})}catch(c){U.debug("silero vad unavailable; barge-in falls back to decibri energy vad",{error:c}),r.dispose().catch(()=>{})}let s;try{s=await zL.open({sampleRate:n,channels:i,dtype:JI,...o?{vad:!1}:{vad:"energy",vadThreshold:HI},framesPerBuffer:jL(n)})}catch(c){throw o?.close(),o&&r.dispose().catch(()=>{}),c}this.vad=o?r:null,this.detector=o;let a=n===Io&&i===tu?null:new Qc(n,Io);this.onData=a?c=>{let u=FL(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(()=>{})}},VL=Io*tu*2/1e3,ZL=250,tv=class{speaker=null;writeChain=Promise.resolve();generation=0;closed=!1;playoutEndAtMs=0;drainWakes=new Set;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(BL(e)),this.closed||n!==this.generation)return;let r=Math.max(this.playoutEndAtMs,Date.now());this.playoutEndAtMs=r+e.byteLength/VL;try{this.playoutTap?.(e,r)}catch(o){U.debug("playout tap failed",{error:o})}}catch(i){U.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;let n=Promise.resolve().then(()=>e.drainAsync()).catch(s=>{U.debug("playback drain interrupted",{error:s})}),i=Math.max(0,this.playoutEndAtMs-Date.now())+ZL,r=this.sleep(i);await Promise.race([n,r.done]),r.wake();let o=this.playoutEndAtMs-Date.now();o>0&&await this.sleep(o).done}sleep(e){let n;return{done:new Promise(r=>{let o=setTimeout(()=>n(),e);n=()=>{clearTimeout(o),this.drainWakes.delete(n),r()},this.drainWakes.add(n)}),wake:n}}close(){return this.closed=!0,this.flush(),Promise.resolve()}ensureSpeaker(){return this.speaker??=new LL({sampleRate:Io,channels:tu,dtype:JI}),this.speaker}}});he();Fn();zi();import{readFileSync as GL}from"node:fs";import{randomUUID as WL}from"node:crypto";var gt=class extends Error{constructor(e,n,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=n,this.exitCode=e,this.nestedError=void 0}},Pt=class extends gt{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var lo=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 Pt(`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 hc(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}import{EventEmitter as ZC}from"node:events";import lg from"node:child_process";import Ct from"node:path";import pc from"node:fs";import G from"node:process";import{stripVTControlCharacters as BC}from"node:util";import{stripVTControlCharacters as jC}from"node:util";var ho=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=>hc(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(`
189
- `)}displayWidth(e){return jC(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(n=>n==="[options]"?this.styleOptionText(n):n==="[command]"?this.styleSubcommandText(n):n[0]==="["||n[0]==="<"?this.styleArgumentText(n):this.styleCommandText(n)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(n=>n==="[options]"?this.styleOptionText(n):n[0]==="["||n[0]==="<"?this.styleArgumentText(n):this.styleSubcommandText(n)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,n){return Math.max(n.longestOptionTermLength(e,n),n.longestGlobalOptionTermLength(e,n),n.longestSubcommandTermLength(e,n),n.longestArgumentTermLength(e,n))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,n,i,r){let s=" ".repeat(2);if(!i)return s+e;let a=e.padEnd(n+e.length-r.displayWidth(e)),c=2,l=(this.helpWidth??80)-n-c-2,d;return l<this.minWidthToWrap||r.preformatted(i)?d=i:d=r.boxWrap(i,l).replace(/\n/g,`
188
+ `,or=class extends Error{status;constructor(e,n){super(e),this.status=n,this.name="TurnEvaluatorError"}},Zn=class{key;fetchImpl;timeoutMs;constructor(e,n=fetch,i=2e3){this.key=e,this.fetchImpl=n,this.timeoutMs=i}async evaluate(e,n){let i={model:SC,max_tokens:64,temperature:0,stop_sequences:kC,system:AC,messages:[{role:"user",content:OC(e)},{role:"assistant",content:SS}]},r=await this.fetchImpl(EC,{method:"POST",headers:{"x-api-key":this.key,"anthropic-version":IC,"content-type":"application/json"},body:JSON.stringify(i),signal:AbortSignal.any([n,AbortSignal.timeout(this.timeoutMs)])});if(!r.ok)throw new or(`turn evaluator request failed (HTTP ${r.status})`,r.status);let o;try{o=await r.json()}catch{throw new or("turn evaluator response body was not JSON")}return PC(o)}}});function eg(t){return t===void 0?lc:{id:lc.id,engineVoice:{...lc.engineVoice,"elevenlabs-flash":{kind:"preset",voiceId:t}}}}var dc,lc,tg=g(()=>{"use strict";dc="21m00Tcm4TlvDq8ikWAM",lc={id:"jarvis-primary",engineVoice:{"elevenlabs-flash":{kind:"preset",voiceId:dc}}}});var hc,ES=g(()=>{"use strict";he();hc=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 LC(t){return DC.test(t)}var IS,kS,RC,NC,fc,DC,pc,TS=g(()=>{"use strict";qa();ES();IS=16e3,kS="pcm_s16le",RC="en",NC=["Jarvis"],fc=.7,DC=/\bjarvis\b/i;pc=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 hc(e.turnId,e.clock.now()),e.controller.attachTelemetry?.(this.timeline),e.controller.setPartialStability?.(e.asrEngine.partialStability??"stable"),this.asrStream=e.asrEngine.open({sampleRate:IS,encoding:kS,language:RC,biasTerms:NC,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(),!LC(e.text)){this.finishAsideAbsorbed(e,n);return}let i=this.deps.clock.now();this.timeline.confirmationFired();let r;try{r=await n.evaluator.evaluate({recentTurns:n.recentTurns(),utterance:e.text},this.reasonAbort.signal,{timeoutMs:3e3})}catch(s){if(this.settled)return;this.timeline.confirmationFailed(this.deps.clock.now()-i,s)}if(this.settled)return;let o=!0;if(r&&(o=!((r.verdict==="to_other"||r.verdict==="self_talk")&&r.confidence>=fc),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<fc){this.timeline.addresseeResolved(e,n,i,"agreed"),this.resolveDispatched();return}this.absorbPending={verdict:e,confidence:n,latencyMs:i},this.reasonAbort.abort()}onAddresseeFailed(e,n){this.settled||(this.timeline.addresseeFailed(e,n),this.resolveDispatched())}async respond(e){let n=!1,i=!1,r=this.deps.ttsEngine.speak({voice:this.deps.voice,sampleRate:IS,encoding:kS});this.ttsStream=r,r.onAudio(s=>{if(!this.settled){if(i||(i=!0,this.timeline.firstTtsAudio(this.deps.clock.now())),this.absorbPending){this.pendingDispatch?.audio.push(s);return}this.resolveDispatched(),this.deps.emit({type:"response.audio",turnId:this.deps.turnId,audio:s})}}),r.onError(s=>this.finishError("turn_failed",s));let o=this.deps.reasoner.run(e,this.reasonAbort.signal,{register:"voice"});for await(let s of o){if(this.settled)return;if(this.absorbPending){this.finishAbsorbed();return}n||(n=!0,this.timeline.firstReasonerDelta(this.deps.clock.now())),this.pendingDispatch?this.pendingDispatch.deltas.push(s.text):this.deps.emit({type:"response.delta",turnId:this.deps.turnId,text:s.text});for(let a of this.deps.segmenter.push(s.text))r.pushText(a)}if(!this.settled){if(this.absorbPending){let{verdict:s,confidence:a,latencyMs: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 rg}from"node:crypto";var ng,ig,Bn,uo,mc,AS=g(()=>{"use strict";he();Ui();Wa();cm();Mx();qa();lm();ji();wr();Vm();qm();Ym();Qm();tg();TS();ng=6,ig=45e3,Bn=class extends Error{constructor(e){super(e),this.name="ReasonerUnavailableError"}},uo=class extends Error{constructor(e){super(e),this.name="VoiceUnavailableError"}},mc=class{deps;sessionId;deviceId;projectId;queue=new Ha;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 Et,this.newSmartTurnInference=i.createSmartTurnInference??(()=>new co),this.newFrameClassifier=i.createFrameClassifier??(()=>new Vi(new Dr)),this.newTurnEvaluator=i.createTurnEvaluator??(r=>new Zn(r)),this.newAddresseeEvaluator=i.createAddresseeEvaluator??(r=>new Ln(r)),this.newTurnController=i.createTurnController??(r=>{let o=this.ensureFrameClassifier();return o.reset?.(),new ao(r,this.ensureSmartTurnInference(),{},this.speechObservingClassifier(o),this.semanticHook())}),this.newSegmenter=i.createSegmenter??(()=>new Qi),this.emit({type:"session.ready"})}async send(e){let{commandId:n}=e;if(this.closed)throw new je(n,"closed");if(e.sessionId!==this.sessionId)throw new je(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 je(n,"unsupported");default:throw new je(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 je(e.commandId,"invalid","input.text requires non-empty text");if(this.inFlight)throw new je(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=rg();this.emit({type:"turn.accepted",turnId:n,clientTurnId:e.clientTurnId,source:"text",commandId:e.commandId}),this.emit({type:"turn.final",turnId:n,turn:this.toTextUserTurn(n,e),commandId:e.commandId}),this.runTextTurn(n,e)}async runTextTurn(e,n){let i=new AbortController;this.turnAbort=i;try{let r=this.ensureReasoner();this.emit({type:"state",turnId:e,state:"responding"});for await(let o of r.run(n.text,i.signal))this.emit({type:"response.delta",turnId:e,text:o.text});this.emit({type:"response.done",turnId:e})}catch(r){let o=r instanceof Bn?"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 je(e.commandId,"backpressured","a turn is already in progress (one turn at a time in v0.1)");this.inFlight=!0;let n=rg();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 pc({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 Bn?"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 uo("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 uo("no voice route configured - run 'jarvis init' to set routes.stt and routes.tts");let r=!e.secrets?.[n.provider]&&Or(n.provider),o=!e.secrets?.[i.provider]&&Or(i.provider);if(r||o){let u=r?n.provider:i.provider;throw new uo(`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??eg(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(-ng)}}}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:i instanceof Error?i.message:String(i)})}}return this.addresseeEvaluator===null?void 0:{evaluator:this.addresseeEvaluator,recentTurns:()=>this.addresseeContext(),onAbsorbed:(n,i)=>{this.recordAbsorbedFinal(n),this.noteSpeech(),i?.verdict==="to_other"&&i.confidence>=fc&&this.enterAside(i.confidence)},floorState:()=>this.floorState,onFloorReleased:n=>this.exitAside(n)}}enterAside(e){this.floorState!=="aside"&&(this.floorState="aside",this.noteSpeech(),this.armAsideDecay(ig),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>=ig?this.exitAside("decay"):this.armAsideDecay(ig-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(-ng)}recordAbsorbedFinal(e){this.absorbedFinals.push({afterHistoryLen:this.reasoner?.historySnapshot().length??0,text:e}),this.absorbedFinals.length>ng&&this.absorbedFinals.shift()}ensureReasoner(){if(this.reasoner)return this.reasoner;let e=this.deps.configService.resolved(),n=e.routes?.text;if(!n)throw new Bn("no text model is configured - run 'jarvis init' to set routes.text");let i=e.secrets?.[n.provider];if(!i)throw new Bn(`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 Xi(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:rg(),atMs:Date.now()})}}});function MC(t,e,n){let i=new URL(t);i.searchParams.set("model_id",e),i.searchParams.set("audio_format",zC(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 zC(t){return t.encoding==="pcm_s16le"?`pcm_${t.sampleRate}`:"pcm_16000"}var OS,lo,og,sg=g(()=>{"use strict";Sa();OS="wss://api.elevenlabs.io/v1/speech-to-text/realtime",lo=class{apiKey;socketFactory;model;endpoint;id="elevenlabs-scribe";constructor(e,n,i,r=OS){this.apiKey=e,this.socketFactory=n,this.model=i,this.endpoint=r}open(e){return new og(this.apiKey,this.socketFactory,this.model,this.endpoint,e)}},og=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(MC(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=En(e);if(!n)return;let i=wa(n);if(i){this.handleError(new Error(`stream error (${i})`));return}let r=n.message_type;if(r==="partial_transcript"){this.opts.emitPartials&&this.transcriptCb?.({text:Zi(n.text),isFinal:!1,startMs:0});return}if(r==="committed_transcript"||r==="committed_transcript_with_timestamps"){let o=Zi(n.text);o.length>0&&this.committed.push(o),this.endPending&&this.resolveEnd()}}handleError(e){if(this.closed)return;let n=In("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:I$(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 UC}from"node:crypto";function FC(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 VC(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",ZC(i)),r.searchParams.set("auto_mode","true"),r.toString()}function ZC(t){return t.encoding==="pcm_s16le"?`pcm_${t.sampleRate}`:"pcm_16000"}var PS,jC,ho,ag,cg=g(()=>{"use strict";Sa();PS="wss://api.elevenlabs.io/v1/text-to-speech/{voice_id}/multi-stream-input",jC={stability:.5,similarity_boost:.75,use_speaker_boost:!0},ho=class{apiKey;socketFactory;model;endpointTemplate;id="elevenlabs-flash";constructor(e,n,i,r=PS){this.apiKey=e,this.socketFactory=n,this.model=i,this.endpointTemplate=r}speak(e){return new ag(this.apiKey,this.socketFactory,this.model,this.endpointTemplate,this.id,e)}},ag=class{socket;contextId=UC();opened=!1;cancelled=!1;closed=!1;endRequested=!1;closeContextSent=!1;pending=[];audioCb;errorCb;endPending=null;constructor(e,n,i,r,o,s){let a=FC(s.voice,o);this.socket=n(VC(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=En(e);if(!n)return;let i=wa(n);if(i){this.handleError(new Error(`stream error (${i})`));return}typeof n.audio=="string"&&n.audio.length>0&&this.audioCb?.(k$(n.audio)),(n.isFinal===!0||n.is_final===!0)&&this.resolveEnd()}handleError(e){if(this.closed)return;let n=In("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:jC,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 BC(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 fo,ug=g(()=>{"use strict";sg();cg();Mp();Ia();Fa();fo=class{socketFactory;fetchImpl;constructor(e=Dn,n=fetch){this.socketFactory=e,this.fetchImpl=n}asrEngine(e,n){switch(e.provider){case"elevenlabs":return new lo(n,this.socketFactory,e.model);case"sherpa-onnx":return BC(e.url),new Bi(this.socketFactory,e.url);case"openai-compat":return new xa(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 ho(n,this.socketFactory,e.model);throw new Error(`no tts adapter for provider '${e.provider}'`)}}});import{randomUUID as GC}from"node:crypto";function dg(t={}){let e=new xr;j.setLevel(e.logLevel),j.debug("core created",{logLevel:e.logLevel});let{fetchImpl:n}=t,i={configService:t.configService??new Ue,registry:t.registry??new zi(n),voiceRegistry:t.voiceRegistry??new fo(t.voiceSocketFactory,n),createTurnEvaluator:t.createTurnEvaluator??(r=>new Zn(r,n)),createAddresseeEvaluator:t.createAddresseeEvaluator??(r=>new Ln(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 lg(i)}var WC,HC,lg,CS=g(()=>{"use strict";he();Ip();kp();Pp();AS();qa();Qm();ug();WC="jarvis-core",HC="0.1.0-dev",lg=class{deps;constructor(e){this.deps=e}describe(){return Promise.resolve({name:WC,version:HC})}openSession(e){let n=GC();return j.debug("core opened session",{sessionId:n,capabilities:e.clientCapabilities}),Promise.resolve(new mc(n,e,this.deps))}}});import{readFileSync as qC,writeFileSync as JC}from"node:fs";function po(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function XC(t){let e={};if(!po(t))return e;for(let n of YC){let i=t[n];if(!Array.isArray(i))continue;let r=[];for(let o of i)!po(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 NS,DS,RS,KC,YC,Ct,LS=g(()=>{"use strict";$r();Wa();NS="model-catalogue.json",DS=1440*60*1e3,RS=1,KC={stt:!0,tts:!0,text:!0,embedding:!0},YC=Object.keys(KC);Ct=class{fetchImpl;timeoutMs=3e3;home;now;ttlMs;providers;constructor(e=fetch,n){this.fetchImpl=e,this.home=n?.home??ze,this.now=n?.now??(()=>Date.now()),this.ttlMs=n?.ttlMs??DS,this.providers=Ga}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"};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(Yt(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&&!(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{return}}cachePath(){return this.home.resolve(NS)}readCacheFile(){let e;try{e=JSON.parse(qC(this.cachePath(),"utf8"))}catch{return}if(!(!po(e)||e.version!==RS))return po(e.providers)?e.providers:void 0}readCacheEntry(e){let n=this.readCacheFile()?.[e];if(!po(n))return;let{fetchedAtMs:i}=n;if(typeof i!="number"||!Number.isFinite(i))return;let r=XC(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(),JC(this.cachePath(),`${JSON.stringify({version:RS,providers:i},null,2)}
189
+ `)}catch{}}}});var Mr=g(()=>{"use strict";CS();kp();Wa();LS();Pp();Op();cm();Ap();Tp();Fa();sg();cg();Ia();ug();tg();Hm();qm();Ym();wr();Vm();Fm();ac();Km();lm();ji()});var Hn=N((i3,FS)=>{"use strict";var cR="2.0.0",uR=Number.MAX_SAFE_INTEGER||9007199254740991,lR=16,dR=250,hR=["major","premajor","minor","preminor","patch","prepatch","prerelease"];FS.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:lR,MAX_SAFE_BUILD_LENGTH:dR,MAX_SAFE_INTEGER:uR,RELEASE_TYPES:hR,SEMVER_SPEC_VERSION:cR,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var vo=N((o3,VS)=>{"use strict";var fR=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};VS.exports=fR});var qn=N((vt,ZS)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:pg,MAX_SAFE_BUILD_LENGTH:pR,MAX_LENGTH:mR}=Hn(),gR=vo();vt=ZS.exports={};var vR=vt.re=[],yR=vt.safeRe=[],P=vt.src=[],_R=vt.safeSrc=[],C=vt.t={},bR=0,mg="[a-zA-Z0-9-]",$R=[["\\s",1],["\\d",mR],[mg,pR]],xR=t=>{for(let[e,n]of $R)t=t.split(`${e}*`).join(`${e}{0,${n}}`).split(`${e}+`).join(`${e}{1,${n}}`);return t},F=(t,e,n)=>{let i=xR(e),r=bR++;gR(t,r,e),C[t]=r,P[r]=e,_R[r]=i,vR[r]=new RegExp(e,n?"g":void 0),yR[r]=new RegExp(i,n?"g":void 0)};F("NUMERICIDENTIFIER","0|[1-9]\\d*");F("NUMERICIDENTIFIERLOOSE","\\d+");F("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${mg}*`);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",`${mg}+`);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,${pg}})(?:\\.(\\d{1,${pg}}))?(?:\\.(\\d{1,${pg}}))?`);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);vt.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);vt.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);vt.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 bc=N((s3,BS)=>{"use strict";var wR=Object.freeze({loose:!0}),SR=Object.freeze({}),ER=t=>t?typeof t!="object"?wR:t:SR;BS.exports=ER});var gg=N((a3,HS)=>{"use strict";var GS=/^[0-9]+$/,WS=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let n=GS.test(t),i=GS.test(e);return n&&i&&(t=+t,e=+e),t===e?0:n&&!i?-1:i&&!n?1:t<e?-1:1},IR=(t,e)=>WS(e,t);HS.exports={compareIdentifiers:WS,rcompareIdentifiers:IR}});var $e=N((c3,JS)=>{"use strict";var $c=vo(),{MAX_LENGTH:qS,MAX_SAFE_INTEGER:xc}=Hn(),{safeRe:wc,t:Sc}=qn(),kR=bc(),{compareIdentifiers:vg}=gg(),TR=(t,e)=>{let n=e.split(".");if(n.length>t.length)return!1;for(let i=0;i<n.length;i++)if(vg(t[i],n[i])!==0)return!1;return!0},yg=class t{constructor(e,n){if(n=kR(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>qS)throw new TypeError(`version is longer than ${qS} characters`);$c("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let i=e.trim().match(n.loose?wc[Sc.LOOSE]:wc[Sc.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>xc||this.major<0)throw new TypeError("Invalid major version");if(this.minor>xc||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>xc||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<xc)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($c("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($c("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 vg(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($c("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 vg(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?wc[Sc.PRERELEASELOOSE]:wc[Sc.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]),TR(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}};JS.exports=yg});var sr=N((u3,YS)=>{"use strict";var KS=$e(),AR=(t,e,n=!1)=>{if(t instanceof KS)return t;try{return new KS(t,e)}catch(i){if(!n)return null;throw i}};YS.exports=AR});var QS=N((l3,XS)=>{"use strict";var OR=sr(),PR=(t,e)=>{let n=OR(t,e);return n?n.version:null};XS.exports=PR});var t0=N((d3,e0)=>{"use strict";var CR=sr(),RR=(t,e)=>{let n=CR(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};e0.exports=RR});var i0=N((h3,n0)=>{"use strict";var r0=$e(),NR=(t,e,n,i,r)=>{typeof n=="string"&&(r=i,i=n,n=void 0);try{return new r0(t instanceof r0?t.version:t,n).inc(e,i,r).version}catch{return null}};n0.exports=NR});var a0=N((f3,s0)=>{"use strict";var o0=sr(),DR=(t,e)=>{let n=o0(t,null,!0),i=o0(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"};s0.exports=DR});var u0=N((p3,c0)=>{"use strict";var LR=$e(),MR=(t,e)=>new LR(t,e).major;c0.exports=MR});var d0=N((m3,l0)=>{"use strict";var zR=$e(),UR=(t,e)=>new zR(t,e).minor;l0.exports=UR});var f0=N((g3,h0)=>{"use strict";var jR=$e(),FR=(t,e)=>new jR(t,e).patch;h0.exports=FR});var m0=N((v3,p0)=>{"use strict";var VR=sr(),ZR=(t,e)=>{let n=VR(t,e);return n&&n.prerelease.length?n.prerelease:null};p0.exports=ZR});var rt=N((y3,v0)=>{"use strict";var g0=$e(),BR=(t,e,n)=>new g0(t,n).compare(new g0(e,n));v0.exports=BR});var _0=N((_3,y0)=>{"use strict";var GR=rt(),WR=(t,e,n)=>GR(e,t,n);y0.exports=WR});var $0=N((b3,b0)=>{"use strict";var HR=rt(),qR=(t,e)=>HR(t,e,!0);b0.exports=qR});var Ec=N(($3,w0)=>{"use strict";var x0=$e(),JR=(t,e,n)=>{let i=new x0(t,n),r=new x0(e,n);return i.compare(r)||i.compareBuild(r)};w0.exports=JR});var E0=N((x3,S0)=>{"use strict";var KR=Ec(),YR=(t,e)=>t.sort((n,i)=>KR(n,i,e));S0.exports=YR});var k0=N((w3,I0)=>{"use strict";var XR=Ec(),QR=(t,e)=>t.sort((n,i)=>XR(i,n,e));I0.exports=QR});var yo=N((S3,T0)=>{"use strict";var eN=rt(),tN=(t,e,n)=>eN(t,e,n)>0;T0.exports=tN});var Ic=N((E3,A0)=>{"use strict";var rN=rt(),nN=(t,e,n)=>rN(t,e,n)<0;A0.exports=nN});var _g=N((I3,O0)=>{"use strict";var iN=rt(),oN=(t,e,n)=>iN(t,e,n)===0;O0.exports=oN});var bg=N((k3,P0)=>{"use strict";var sN=rt(),aN=(t,e,n)=>sN(t,e,n)!==0;P0.exports=aN});var kc=N((T3,C0)=>{"use strict";var cN=rt(),uN=(t,e,n)=>cN(t,e,n)>=0;C0.exports=uN});var Tc=N((A3,R0)=>{"use strict";var lN=rt(),dN=(t,e,n)=>lN(t,e,n)<=0;R0.exports=dN});var $g=N((O3,N0)=>{"use strict";var hN=_g(),fN=bg(),pN=yo(),mN=kc(),gN=Ic(),vN=Tc(),yN=(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 hN(t,n,i);case"!=":return fN(t,n,i);case">":return pN(t,n,i);case">=":return mN(t,n,i);case"<":return gN(t,n,i);case"<=":return vN(t,n,i);default:throw new TypeError(`Invalid operator: ${e}`)}};N0.exports=yN});var L0=N((P3,D0)=>{"use strict";var _N=$e(),bN=sr(),{safeRe:Ac,t:Oc}=qn(),$N=(t,e)=>{if(t instanceof _N)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?Ac[Oc.COERCEFULL]:Ac[Oc.COERCE]);else{let c=e.includePrerelease?Ac[Oc.COERCERTLFULL]:Ac[Oc.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 bN(`${i}.${r}.${o}${s}${a}`,e)};D0.exports=$N});var z0=N((C3,M0)=>{"use strict";var xN=sr(),wN=Hn(),SN=$e(),EN=(t,e,n)=>{if(!wN.RELEASE_TYPES.includes(e))return null;let i=IN(t,n);return i&&kN(i,e)},IN=(t,e)=>{let n=t instanceof SN?t.version:t;return xN(n,e)},kN=(t,e)=>{if(TN(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()},TN=t=>t.startsWith("pre");M0.exports=EN});var j0=N((R3,U0)=>{"use strict";var xg=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}};U0.exports=xg});var nt=N((N3,B0)=>{"use strict";var AN=/\s+/g,wg=class t{constructor(e,n){if(n=PN(n),e instanceof t)return e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease?e:new t(e.raw,n);if(e instanceof Sg)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(AN," "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(r=>!V0(r[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let r of this.set)if(r.length===1&&jN(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(UN,"");let i=((this.options.includePrerelease&&MN)|(this.options.loose&&zN))+":"+e,r=F0.get(i);if(r)return r;let o=this.options.loose,s=o?Ce[xe.HYPHENRANGELOOSE]:Ce[xe.HYPHENRANGE];e=e.replace(s,KN(this.options.includePrerelease)),te("hyphen replace",e),e=e.replace(Ce[xe.COMPARATORTRIM],NN),te("comparator trim",e),e=e.replace(Ce[xe.TILDETRIM],DN),te("tilde trim",e),e=e.replace(Ce[xe.CARETTRIM],LN),te("caret trim",e);let a=e.split(" ").map(d=>FN(d,this.options)).join(" ").split(/\s+/).map(d=>JN(d,this.options));o&&(a=a.filter(d=>(te("loose invalid filter",d,this.options),!!d.match(Ce[xe.COMPARATORLOOSE])))),te("range list",a);let c=new Map,u=a.map(d=>new Sg(d,this.options));for(let d of u){if(V0(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let l=[...c.values()];return F0.set(i,l),l}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(i=>Z0(i,n)&&e.set.some(r=>Z0(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 CN(e,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(YN(this.set[n],e,this.options))return!0;return!1}};B0.exports=wg;var ON=j0(),F0=new ON,PN=bc(),Sg=_o(),te=vo(),CN=$e(),{safeRe:Ce,src:RN,t:xe,comparatorTrimReplace:NN,tildeTrimReplace:DN,caretTrimReplace:LN}=qn(),{FLAG_INCLUDE_PRERELEASE:MN,FLAG_LOOSE:zN}=Hn(),UN=new RegExp(RN[xe.BUILD],"g"),V0=t=>t.value==="<0.0.0-0",jN=t=>t.value==="",Z0=(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},FN=(t,e)=>(t=t.replace(Ce[xe.BUILD],""),te("comp",t,e),t=BN(t,e),te("caret",t),t=VN(t,e),te("tildes",t),t=WN(t,e),te("xrange",t),t=qN(t,e),te("stars",t),t),Re=t=>!t||t.toLowerCase()==="x"||t==="*",VN=(t,e)=>t.trim().split(/\s+/).map(n=>ZN(n,e)).join(" "),ZN=(t,e)=>{let n=e.loose?Ce[xe.TILDELOOSE]:Ce[xe.TILDE];return t.replace(n,(i,r,o,s,a)=>{te("tilde",t,i,r,o,s,a);let c;return Re(r)?c="":Re(o)?c=`>=${r}.0.0 <${+r+1}.0.0-0`:Re(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})},BN=(t,e)=>t.trim().split(/\s+/).map(n=>GN(n,e)).join(" "),GN=(t,e)=>{te("caret",t,e);let n=e.loose?Ce[xe.CARETLOOSE]:Ce[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 Re(o)?u="":Re(s)?u=`>=${o}.0.0${i} <${+o+1}.0.0-0`:Re(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})},WN=(t,e)=>(te("replaceXRanges",t,e),t.split(/\s+/).map(n=>HN(n,e)).join(" ")),HN=(t,e)=>{t=t.trim();let n=e.loose?Ce[xe.XRANGELOOSE]:Ce[xe.XRANGE];return t.replace(n,(i,r,o,s,a,c)=>{te("xRange",t,i,r,o,s,a,c);let u=Re(o),l=u||Re(s),d=l||Re(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})},qN=(t,e)=>(te("replaceStars",t,e),t.trim().replace(Ce[xe.STAR],"")),JN=(t,e)=>(te("replaceGTE0",t,e),t.trim().replace(Ce[e.includePrerelease?xe.GTE0PRE:xe.GTE0],"")),KN=t=>(e,n,i,r,o,s,a,c,u,l,d,h)=>(Re(i)?n="":Re(r)?n=`>=${i}.0.0${t?"-0":""}`:Re(o)?n=`>=${i}.${r}.0${t?"-0":""}`:s?n=`>=${n}`:n=`>=${n}${t?"-0":""}`,Re(u)?c="":Re(l)?c=`<${+u+1}.0.0-0`:Re(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()),YN=(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!==Sg.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 _o=N((D3,K0)=>{"use strict";var bo=Symbol("SemVer ANY"),kg=class t{static get ANY(){return bo}constructor(e,n){if(n=G0(n),e instanceof t){if(e.loose===!!n.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Ig("comparator",e,n),this.options=n,this.loose=!!n.loose,this.parse(e),this.semver===bo?this.value="":this.value=this.operator+this.semver.version,Ig("comp",this)}parse(e){let n=this.options.loose?W0[H0.COMPARATORLOOSE]:W0[H0.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 q0(i[2],this.options.loose):this.semver=bo}toString(){return this.value}test(e){if(Ig("Comparator.test",e,this.options.loose),this.semver===bo||e===bo)return!0;if(typeof e=="string")try{e=new q0(e,this.options)}catch{return!1}return Eg(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 J0(e.value,n).test(this.value):e.operator===""?e.value===""?!0:new J0(this.value,n).test(e.semver):(n=G0(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("=")||Eg(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Eg(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};K0.exports=kg;var G0=bc(),{safeRe:W0,t:H0}=qn(),Eg=$g(),Ig=vo(),q0=$e(),J0=nt()});var $o=N((L3,Y0)=>{"use strict";var XN=nt(),QN=(t,e,n)=>{try{e=new XN(e,n)}catch{return!1}return e.test(t)};Y0.exports=QN});var Q0=N((M3,X0)=>{"use strict";var eD=nt(),tD=(t,e)=>new eD(t,e).set.map(n=>n.map(i=>i.value).join(" ").trim().split(" "));X0.exports=tD});var tE=N((z3,eE)=>{"use strict";var rD=$e(),nD=nt(),iD=(t,e,n)=>{let i=null,r=null,o=null;try{o=new nD(e,n)}catch{return null}return t.forEach(s=>{o.test(s)&&(!i||r.compare(s)===-1)&&(i=s,r=new rD(i,n))}),i};eE.exports=iD});var nE=N((U3,rE)=>{"use strict";var oD=$e(),sD=nt(),aD=(t,e,n)=>{let i=null,r=null,o=null;try{o=new sD(e,n)}catch{return null}return t.forEach(s=>{o.test(s)&&(!i||r.compare(s)===1)&&(i=s,r=new oD(i,n))}),i};rE.exports=aD});var sE=N((j3,oE)=>{"use strict";var Tg=$e(),cD=nt(),iE=yo(),uD=(t,e)=>{t=new cD(t,e);let n=new Tg("0.0.0");if(t.test(n)||(n=new Tg("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 Tg(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&&(!n||iE(n,o))&&(n=o)}return n&&t.test(n)?n:null};oE.exports=uD});var cE=N((F3,aE)=>{"use strict";var lD=nt(),dD=(t,e)=>{try{return new lD(t,e).range||"*"}catch{return null}};aE.exports=dD});var Pc=N((V3,hE)=>{"use strict";var hD=$e(),dE=_o(),{ANY:fD}=dE,pD=nt(),mD=$o(),uE=yo(),lE=Ic(),gD=Tc(),vD=kc(),yD=(t,e,n,i)=>{t=new hD(t,i),e=new pD(e,i);let r,o,s,a,c;switch(n){case">":r=uE,o=gD,s=lE,a=">",c=">=";break;case"<":r=lE,o=vD,s=uE,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(mD(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===fD&&(f=new dE(">=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};hE.exports=yD});var pE=N((Z3,fE)=>{"use strict";var _D=Pc(),bD=(t,e,n)=>_D(t,e,">",n);fE.exports=bD});var gE=N((B3,mE)=>{"use strict";var $D=Pc(),xD=(t,e,n)=>$D(t,e,"<",n);mE.exports=xD});var _E=N((G3,yE)=>{"use strict";var vE=nt(),wD=(t,e,n)=>(t=new vE(t,n),e=new vE(e,n),t.intersects(e,n));yE.exports=wD});var $E=N((W3,bE)=>{"use strict";var SD=$o(),ED=rt();bE.exports=(t,e,n)=>{let i=[],r=null,o=null,s=t.sort((l,d)=>ED(l,d,n));for(let l of s)SD(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 kE=N((H3,IE)=>{"use strict";var xE=nt(),Pg=_o(),{ANY:Ag}=Pg,Og=$o(),Cg=rt(),ID=(t,e,n={})=>{if(t===e)return!0;t=new xE(t,n),e=new xE(e,n);let i=!1;e:for(let r of t.set){for(let o of e.set){let s=TD(r,o,n);if(i=i||s!==null,s)continue e}if(i)return!1}return!0},kD=[new Pg(">=0.0.0-0")],wE=[new Pg(">=0.0.0")],TD=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Ag){if(e.length===1&&e[0].semver===Ag)return!0;n.includePrerelease?t=kD:t=wE}if(e.length===1&&e[0].semver===Ag){if(n.includePrerelease)return!0;e=wE}let i=new Set,r,o;for(let f of t)f.operator===">"||f.operator===">="?r=SE(r,f,n):f.operator==="<"||f.operator==="<="?o=EE(o,f,n):i.add(f.semver);if(i.size>1)return null;let s;if(r&&o){if(s=Cg(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&&!Og(f,String(r),n)||o&&!Og(f,String(o),n))return null;for(let p of e)if(!Og(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=SE(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=EE(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)},SE=(t,e,n)=>{if(!t)return e;let i=Cg(t.semver,e.semver,n);return i>0?t:i<0||e.operator===">"&&t.operator===">="?e:t},EE=(t,e,n)=>{if(!t)return e;let i=Cg(t.semver,e.semver,n);return i<0?t:i>0||e.operator==="<"&&t.operator==="<="?e:t};IE.exports=ID});var PE=N((q3,OE)=>{"use strict";var Rg=qn(),TE=Hn(),AD=$e(),AE=gg(),OD=sr(),PD=QS(),CD=t0(),RD=i0(),ND=a0(),DD=u0(),LD=d0(),MD=f0(),zD=m0(),UD=rt(),jD=_0(),FD=$0(),VD=Ec(),ZD=E0(),BD=k0(),GD=yo(),WD=Ic(),HD=_g(),qD=bg(),JD=kc(),KD=Tc(),YD=$g(),XD=L0(),QD=z0(),eL=_o(),tL=nt(),rL=$o(),nL=Q0(),iL=tE(),oL=nE(),sL=sE(),aL=cE(),cL=Pc(),uL=pE(),lL=gE(),dL=_E(),hL=$E(),fL=kE();OE.exports={parse:OD,valid:PD,clean:CD,inc:RD,diff:ND,major:DD,minor:LD,patch:MD,prerelease:zD,compare:UD,rcompare:jD,compareLoose:FD,compareBuild:VD,sort:ZD,rsort:BD,gt:GD,lt:WD,eq:HD,neq:qD,gte:JD,lte:KD,cmp:YD,coerce:XD,truncate:QD,Comparator:eL,Range:tL,satisfies:rL,toComparators:nL,maxSatisfying:iL,minSatisfying:oL,minVersion:sL,validRange:aL,outside:cL,gtr:uL,ltr:lL,intersects:dL,simplifyRange:hL,subset:fL,SemVer:AD,re:Rg.re,src:Rg.src,tokens:Rg.t,SEMVER_SPEC_VERSION:TE.SEMVER_SPEC_VERSION,RELEASE_TYPES:TE.RELEASE_TYPES,compareIdentifiers:AE.compareIdentifiers,rcompareIdentifiers:AE.rcompareIdentifiers}});var LE=N((n8,Ng)=>{var Nc=process||{},NE=Nc.argv||[],Rc=Nc.env||{},vL=!(Rc.NO_COLOR||NE.includes("--no-color"))&&(!!Rc.FORCE_COLOR||NE.includes("--color")||Nc.platform==="win32"||(Nc.stdout||{}).isTTY&&Rc.TERM!=="dumb"||!!Rc.CI),yL=(t,e,n=t)=>i=>{let r=""+i,o=r.indexOf(e,t.length);return~o?t+_L(r,e,n,o)+e:t+r+e},_L=(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)},DE=(t=vL)=>{let e=t?yL:()=>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")}};Ng.exports=DE();Ng.exports.createColors=DE});var jg=N((O8,tI)=>{"use strict";var Ug={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"},VL={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},ZL={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?Ug.up():"");return t&&(e+=Ug.left),e}};tI.exports={cursor:Ug,scroll:VL,erase:ZL,beep:"\x07"}});function YI(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 nu,XI=g(()=>{"use strict";nu=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 ek(t){return t.byteLength/2/QM}function ez(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 QI,QM,iu,tk=g(()=>{"use strict";he();Mr();QI=32,QM=16,iu=class{constructor(e,n,i={}){this.vad=e;this.onSpeech=n;this.speechThreshold=i.speechThreshold??.5,this.onsetMs=i.onsetMs??2*QI,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(Ye(e,this.energyThreshold),ek(e));return}this.vad.process(ez(e)).then(n=>{if(!this.closed)for(let i of n)this.applyVerdict(i>=this.speechThreshold,QI)},n=>{this.closed||(this.degrade(n),this.applyVerdict(Ye(e,this.energyThreshold),ek(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 ov={};qe(ov,{DecibriCapture:()=>nv,DecibriPlayback:()=>iv,hasInputDevice:()=>nz});import{Microphone as tz,Speaker as rz,inputDevices as nk}from"decibri";function nz(){try{return nk().length>0}catch(t){return j.debug("audio input enumeration failed; treating as no microphone",{error:t}),!1}}function iz(){try{let t=nk(),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:Ao,channels:ou}}function oz(t){return Math.max(64,Math.min(65536,Math.round(t/10)))}function sz(t,e,n){let i=new Uint8Array(t),r=new Int16Array(i.buffer,0,i.byteLength>>1),o=n.process(YI(r,e));return Buffer.from(o.buffer,o.byteOffset,o.byteLength)}function uz(t){return Buffer.from(t.buffer,t.byteOffset,t.byteLength)}var Ao,ou,ik,rk,nv,az,cz,iv,sv=g(()=>{"use strict";he();Mr();XI();tk();Ao=16e3,ou=1,ik="int16",rk=.01;nv=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}=iz(),r=(this.deps.createVad??(()=>new Dr))(),o=null;try{await r.load(),o=new iu(r,()=>e.onSpeechStart(),{energyThreshold:rk})}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 tz.open({sampleRate:n,channels:i,dtype:ik,...o?{vad:!1}:{vad:"energy",vadThreshold:rk},framesPerBuffer:oz(n)})}catch(c){throw o?.close(),o&&r.dispose().catch(()=>{}),c}this.vad=o?r:null,this.detector=o;let a=n===Ao&&i===ou?null:new nu(n,Ao);this.onData=a?c=>{let u=sz(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(()=>{})}},az=Ao*ou*2/1e3,cz=250,iv=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(uz(e)),this.closed||n!==this.generation)return;let r=Math.max(this.playoutEndAtMs,Date.now());this.playoutEndAtMs=r+e.byteLength/az;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())+cz,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 rz({sampleRate:Ao,channels:ou,dtype:ik}),this.nativeDrainSpent=!1),this.speaker}}});he();Mr();Ui();import{readFileSync as lz}from"node:fs";import{randomUUID as dz}from"node:crypto";var gt=class extends Error{constructor(e,n,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=n,this.exitCode=e,this.nestedError=void 0}},Rt=class extends gt{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var mo=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 Rt(`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 gc(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}import{EventEmitter as rR}from"node:events";import fg from"node:child_process";import Nt from"node:path";import yc from"node:fs";import G from"node:process";import{stripVTControlCharacters as nR}from"node:util";import{stripVTControlCharacters as QC}from"node:util";var go=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=>gc(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 QC(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(n=>n==="[options]"?this.styleOptionText(n):n==="[command]"?this.styleSubcommandText(n):n[0]==="["||n[0]==="<"?this.styleArgumentText(n):this.styleCommandText(n)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(n=>n==="[options]"?this.styleOptionText(n):n[0]==="["||n[0]==="<"?this.styleArgumentText(n):this.styleSubcommandText(n)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,n){return Math.max(n.longestOptionTermLength(e,n),n.longestGlobalOptionTermLength(e,n),n.longestSubcommandTermLength(e,n),n.longestArgumentTermLength(e,n))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,n,i,r){let s=" ".repeat(2);if(!i)return s+e;let a=e.padEnd(n+e.length-r.displayWidth(e)),c=2,l=(this.helpWidth??80)-n-c-2,d;return l<this.minWidthToWrap||r.preformatted(i)?d=i:d=r.boxWrap(i,l).replace(/\n/g,`
190
191
  `+" ".repeat(n+c)),s+a+" ".repeat(c)+d.replace(/\n/g,`
191
192
  ${s}`)}boxWrap(e,n){if(n<this.minWidthToWrap)return e;let i=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,o=[];return i.forEach(s=>{let a=s.match(r);if(a===null){o.push("");return}let c=[a.shift()],u=this.displayWidth(c[0]);a.forEach(l=>{let d=this.displayWidth(l);if(u+d<=n){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(`
192
- `)}};var Vn=class{constructor(e,n){this.flags=e,this.description=n||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let i=FC(e);this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,n){return this.defaultValue=e,this.defaultValueDescription=n,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let n=e;return typeof e=="string"&&(n={[e]:!0}),this.implied=Object.assign(this.implied||{},n),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,n){return n===this.defaultValue||!Array.isArray(n)?[e]:(n.push(e),n)}choices(e){return this.argChoices=e.slice(),this.parseArg=(n,i)=>{if(!this.argChoices.includes(n))throw new Pt(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(n,i):n},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?PS(this.name().replace(/^no-/,"")):PS(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}},fc=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(n=>{n.negate?this.negativeOptions.set(n.attributeName(),n):this.positiveOptions.set(n.attributeName(),n)}),this.negativeOptions.forEach((n,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i)})}valueFromOption(e,n){let i=n.attributeName();if(!this.dualOptions.has(i))return!0;let r=this.negativeOptions.get(i).presetArg,o=r!==void 0?r:!1;return n.negate===(o===e)}};function PS(t){return t.split("-").reduce((e,n)=>e+n[0].toUpperCase()+n.slice(1))}function FC(t){let e,n,i=/^-[^-]$/,r=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(i.test(o[0])&&(e=o.shift()),r.test(o[0])&&(n=o.shift()),!e&&i.test(o[0])&&(e=o.shift()),!e&&r.test(o[0])&&(e=n,n=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${t}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a}
193
+ `)}};var Gn=class{constructor(e,n){this.flags=e,this.description=n||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let i=eR(e);this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,n){return this.defaultValue=e,this.defaultValueDescription=n,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let n=e;return typeof e=="string"&&(n={[e]:!0}),this.implied=Object.assign(this.implied||{},n),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,n){return n===this.defaultValue||!Array.isArray(n)?[e]:(n.push(e),n)}choices(e){return this.argChoices=e.slice(),this.parseArg=(n,i)=>{if(!this.argChoices.includes(n))throw new Rt(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(n,i):n},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?MS(this.name().replace(/^no-/,"")):MS(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}},vc=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(n=>{n.negate?this.negativeOptions.set(n.attributeName(),n):this.positiveOptions.set(n.attributeName(),n)}),this.negativeOptions.forEach((n,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i)})}valueFromOption(e,n){let i=n.attributeName();if(!this.dualOptions.has(i))return!0;let r=this.negativeOptions.get(i).presetArg,o=r!==void 0?r:!1;return n.negate===(o===e)}};function MS(t){return t.split("-").reduce((e,n)=>e+n[0].toUpperCase()+n.slice(1))}function eR(t){let e,n,i=/^-[^-]$/,r=/^--[^-]/,o=t.split(/[ |,]+/).concat("guard");if(i.test(o[0])&&(e=o.shift()),r.test(o[0])&&(n=o.shift()),!e&&i.test(o[0])&&(e=o.shift()),!e&&r.test(o[0])&&(e=n,n=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${t}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a}
193
194
  - a short flag is a single dash and a single character
194
195
  - either use a single dash and a single character (for a short flag)
195
196
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):i.test(s)?new Error(`${a}
196
197
  - too many short flags`):r.test(s)?new Error(`${a}
197
198
  - too many long flags`):new Error(`${a}
198
- - unrecognised flag format`)}if(e===void 0&&n===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:n}}function VC(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let n=[];for(let i=0;i<=t.length;i++)n[i]=[i];for(let i=0;i<=e.length;i++)n[0][i]=i;for(let i=1;i<=e.length;i++)for(let r=1;r<=t.length;r++){let o;t[r-1]===e[i-1]?o=0:o=1,n[r][i]=Math.min(n[r-1][i]+1,n[r][i-1]+1,n[r-1][i-1]+o),r>1&&i>1&&t[r-1]===e[i-2]&&t[r-2]===e[i-1]&&(n[r][i]=Math.min(n[r][i],n[r-2][i-2]+1))}return n[t.length][e.length]}function ug(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let n=t.startsWith("--");n&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let i=[],r=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=VC(t,s),c=Math.max(t.length,s.length);(c-a)/c>o&&(a<r?(r=a,i=[s]):a===r&&i.push(s))}),i.sort((s,a)=>s.localeCompare(a)),n&&(i=i.map(s=>`--${s}`)),i.length>1?`
199
+ - unrecognised flag format`)}if(e===void 0&&n===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:n}}function tR(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let n=[];for(let i=0;i<=t.length;i++)n[i]=[i];for(let i=0;i<=e.length;i++)n[0][i]=i;for(let i=1;i<=e.length;i++)for(let r=1;r<=t.length;r++){let o;t[r-1]===e[i-1]?o=0:o=1,n[r][i]=Math.min(n[r-1][i]+1,n[r][i-1]+1,n[r-1][i-1]+o),r>1&&i>1&&t[r-1]===e[i-2]&&t[r-2]===e[i-1]&&(n[r][i]=Math.min(n[r][i],n[r-2][i-2]+1))}return n[t.length][e.length]}function hg(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let n=t.startsWith("--");n&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let i=[],r=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=tR(t,s),c=Math.max(t.length,s.length);(c-a)/c>o&&(a<r?(r=a,i=[s]):a===r&&i.push(s))}),i.sort((s,a)=>s.localeCompare(a)),n&&(i=i.map(s=>`--${s}`)),i.length>1?`
199
200
  (Did you mean one of ${i.join(", ")}?)`:i.length===1?`
200
- (Did you mean ${i[0]}?)`:""}var Zn=class t extends ZC{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:n=>G.stdout.write(n),writeErr:n=>G.stderr.write(n),outputError:(n,i)=>i(n),getOutHelpWidth:()=>G.stdout.isTTY?G.stdout.columns:void 0,getErrHelpWidth:()=>G.stderr.isTTY?G.stderr.columns:void 0,getOutHasColors:()=>RS()??(G.stdout.isTTY&&G.stdout.hasColors?.()),getErrHasColors:()=>RS()??(G.stderr.isTTY&&G.stderr.hasColors?.()),stripColor:n=>BC(n)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let n=this;n;n=n.parent)e.push(n);return e}command(e,n,i){let r=n,o=i;typeof r=="object"&&r!==null&&(o=r,r=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(s);return r&&(c.description(r),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),r?this:c}createCommand(e){return new t(e)}createHelp(){return Object.assign(new ho,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,n){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
201
- - specify the name in Command constructor or using .name()`);return n=n||{},n.isDefault&&(this._defaultCommandName=e._name),(n.noHelp||n.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,n){return new lo(e,n)}argument(e,n,i,r){let o=this.createArgument(e,n);return typeof i=="function"?o.default(r).argParser(i):o.default(i),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(n=>{this.argument(n)}),this}addArgument(e){let n=this.registeredArguments.slice(-1)[0];if(n?.variadic)throw new Error(`only the last argument can be variadic '${n.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,n){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let i=e??"help [command]",[,r,o]=i.match(/([^ ]+) *(.*)/),s=n??"display help for command",a=this.createCommand(r);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||n)&&this._initCommandGroup(a),this}addHelpCommand(e,n){return typeof e!="object"?(this.helpCommand(e,n),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,n){let i=["preSubcommand","preAction","postAction"];if(!i.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
202
- Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(n):this._lifeCycleHooks[e]=[n],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=n=>{if(n.code!=="commander.executeSubCommandAsync")throw n},this}_exit(e,n,i){this._exitCallback&&this._exitCallback(new gt(e,n,i)),G.exit(e)}action(e){let n=i=>{let r=this.registeredArguments.length,o=i.slice(0,r);return this._storeOptionsAsProperties?o[r]=this:o[r]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=n,this}createOption(e,n){return new Vn(e,n)}_callParseArg(e,n,i,r){try{return e.parseArg(n,i)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${r} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let n=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(n){let i=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'
203
- - already used by option '${n.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let n=r=>[r.name()].concat(r.aliases()),i=n(e).find(r=>this._findCommand(r));if(i){let r=n(this._findCommand(i)).join("|"),o=n(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${r}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let n=e.name(),i=e.attributeName();e.defaultValue!==void 0&&this.setOptionValueWithSource(i,e.defaultValue,"default");let r=(o,s,a)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let 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:"+n,o=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;r(o,s,"cli")}),e.envVar&&this.on("optionEnv:"+n,o=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;r(o,s,"env")}),this}_optionEx(e,n,i,r,o){if(typeof n=="object"&&n instanceof Vn)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(n,i);if(s.makeOptionMandatory(!!e.mandatory),typeof r=="function")s.default(o).argParser(r);else if(r instanceof RegExp){let a=r;r=(c,u)=>{let l=a.exec(c);return l?l[0]:u},s.default(o).argParser(r)}else s.default(r);return this.addOption(s)}option(e,n,i,r){return this._optionEx({},e,n,i,r)}requiredOption(e,n,i,r){return this._optionEx({mandatory:!0},e,n,i,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,n){return this.setOptionValueWithSource(e,n,void 0)}setOptionValueWithSource(e,n,i){return this._storeOptionsAsProperties?this[e]=n:this._optionValues[e]=n,this._optionValueSources[e]=i,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let n;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(e)!==void 0&&(n=i.getOptionValueSource(e))}),n}_prepareUserArgs(e,n){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(n=n||{},e===void 0&&n.from===void 0){G.versions?.electron&&(n.from="electron");let r=G.execArgv??[];(r.includes("-e")||r.includes("--eval")||r.includes("-p")||r.includes("--print"))&&(n.from="eval")}e===void 0&&(e=G.argv),this.rawArgs=e.slice();let i;switch(n.from){case void 0:case"node":this._scriptPath=e[1],i=e.slice(2);break;case"electron":G.defaultApp?(this._scriptPath=e[1],i=e.slice(2)):i=e.slice(1);break;case"user":i=e.slice(0);break;case"eval":i=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${n.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(e,n){this._prepareForParse();let i=this._prepareUserArgs(e,n);return this._parseCommand([],i),this}async parseAsync(e,n){this._prepareForParse();let i=this._prepareUserArgs(e,n);return await this._parseCommand([],i),this}_prepareForParse(){this._savedState===null?(this.options.filter(e=>e.negate&&e.defaultValue===void 0&&this.getOptionValue(e.attributeName())===void 0).forEach(e=>{let n=e.long.replace(/^--no-/,"--");this._findOption(n)||this.setOptionValueWithSource(e.attributeName(),!0,"default")}),this.saveStateBeforeParse()):this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
204
- - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,n,i){if(pc.existsSync(e))return;let r=n?`searched for local subcommand relative to directory '${n}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist
201
+ (Did you mean ${i[0]}?)`:""}var Wn=class t extends rR{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:n=>G.stdout.write(n),writeErr:n=>G.stderr.write(n),outputError:(n,i)=>i(n),getOutHelpWidth:()=>G.stdout.isTTY?G.stdout.columns:void 0,getErrHelpWidth:()=>G.stderr.isTTY?G.stderr.columns:void 0,getOutHasColors:()=>US()??(G.stdout.isTTY&&G.stdout.hasColors?.()),getErrHasColors:()=>US()??(G.stderr.isTTY&&G.stderr.hasColors?.()),stripColor:n=>nR(n)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let n=this;n;n=n.parent)e.push(n);return e}command(e,n,i){let r=n,o=i;typeof r=="object"&&r!==null&&(o=r,r=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),c=this.createCommand(s);return r&&(c.description(r),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),r?this:c}createCommand(e){return new t(e)}createHelp(){return Object.assign(new go,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...e},this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,n){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
202
+ - specify the name in Command constructor or using .name()`);return n=n||{},n.isDefault&&(this._defaultCommandName=e._name),(n.noHelp||n.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,n){return new mo(e,n)}argument(e,n,i,r){let o=this.createArgument(e,n);return typeof i=="function"?o.default(r).argParser(i):o.default(i),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(n=>{this.argument(n)}),this}addArgument(e){let n=this.registeredArguments.slice(-1)[0];if(n?.variadic)throw new Error(`only the last argument can be variadic '${n.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,n){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let i=e??"help [command]",[,r,o]=i.match(/([^ ]+) *(.*)/),s=n??"display help for command",a=this.createCommand(r);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(e||n)&&this._initCommandGroup(a),this}addHelpCommand(e,n){return typeof e!="object"?(this.helpCommand(e,n),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,n){let i=["preSubcommand","preAction","postAction"];if(!i.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
203
+ Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(n):this._lifeCycleHooks[e]=[n],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=n=>{if(n.code!=="commander.executeSubCommandAsync")throw n},this}_exit(e,n,i){this._exitCallback&&this._exitCallback(new gt(e,n,i)),G.exit(e)}action(e){let n=i=>{let r=this.registeredArguments.length,o=i.slice(0,r);return this._storeOptionsAsProperties?o[r]=this:o[r]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=n,this}createOption(e,n){return new Gn(e,n)}_callParseArg(e,n,i,r){try{return e.parseArg(n,i)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${r} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let n=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(n){let i=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'
204
+ - already used by option '${n.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let n=r=>[r.name()].concat(r.aliases()),i=n(e).find(r=>this._findCommand(r));if(i){let r=n(this._findCommand(i)).join("|"),o=n(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${r}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let n=e.name(),i=e.attributeName();e.defaultValue!==void 0&&this.setOptionValueWithSource(i,e.defaultValue,"default");let r=(o,s,a)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let 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:"+n,o=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;r(o,s,"cli")}),e.envVar&&this.on("optionEnv:"+n,o=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;r(o,s,"env")}),this}_optionEx(e,n,i,r,o){if(typeof n=="object"&&n instanceof Gn)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(n,i);if(s.makeOptionMandatory(!!e.mandatory),typeof r=="function")s.default(o).argParser(r);else if(r instanceof RegExp){let a=r;r=(c,u)=>{let l=a.exec(c);return l?l[0]:u},s.default(o).argParser(r)}else s.default(r);return this.addOption(s)}option(e,n,i,r){return this._optionEx({},e,n,i,r)}requiredOption(e,n,i,r){return this._optionEx({mandatory:!0},e,n,i,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,n){return this.setOptionValueWithSource(e,n,void 0)}setOptionValueWithSource(e,n,i){return this._storeOptionsAsProperties?this[e]=n:this._optionValues[e]=n,this._optionValueSources[e]=i,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let n;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(e)!==void 0&&(n=i.getOptionValueSource(e))}),n}_prepareUserArgs(e,n){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(n=n||{},e===void 0&&n.from===void 0){G.versions?.electron&&(n.from="electron");let r=G.execArgv??[];(r.includes("-e")||r.includes("--eval")||r.includes("-p")||r.includes("--print"))&&(n.from="eval")}e===void 0&&(e=G.argv),this.rawArgs=e.slice();let i;switch(n.from){case void 0:case"node":this._scriptPath=e[1],i=e.slice(2);break;case"electron":G.defaultApp?(this._scriptPath=e[1],i=e.slice(2)):i=e.slice(1);break;case"user":i=e.slice(0);break;case"eval":i=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${n.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(e,n){this._prepareForParse();let i=this._prepareUserArgs(e,n);return this._parseCommand([],i),this}async parseAsync(e,n){this._prepareForParse();let i=this._prepareUserArgs(e,n);return await this._parseCommand([],i),this}_prepareForParse(){this._savedState===null?(this.options.filter(e=>e.negate&&e.defaultValue===void 0&&this.getOptionValue(e.attributeName())===void 0).forEach(e=>{let n=e.long.replace(/^--no-/,"--");this._findOption(n)||this.setOptionValueWithSource(e.attributeName(),!0,"default")}),this.saveStateBeforeParse()):this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
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,n,i){if(yc.existsSync(e))return;let r=n?`searched for local subcommand relative to directory '${n}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist
205
206
  - if '${i}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
206
207
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
207
- - ${r}`;throw new Error(o)}_executeSubCommand(e,n){n=n.slice();let i=[".js",".ts",".tsx",".mjs",".cjs"];function r(l,d){let h=Ct.resolve(l,d);if(pc.existsSync(h))return h;if(i.includes(Ct.extname(d)))return;let f=i.find(p=>pc.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=pc.realpathSync(this._scriptPath)}catch{l=this._scriptPath}s=Ct.resolve(Ct.dirname(l),s)}if(s){let l=r(s,o);if(!l&&!e._executableFile&&this._scriptPath){let d=Ct.basename(this._scriptPath,Ct.extname(this._scriptPath));d!==this._name&&(l=r(s,`${d}-${e._name}`))}o=l||o}let a=i.includes(Ct.extname(o)),c;G.platform!=="win32"?a?(n.unshift(o),n=CS(G.execArgv).concat(n),c=lg.spawn(G.argv[0],n,{stdio:"inherit"})):c=lg.spawn(o,n,{stdio:"inherit"}):(this._checkForMissingExecutable(o,s,e._name),n.unshift(o),n=CS(G.execArgv).concat(n),c=lg.spawn(G.execPath,n,{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 gt(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 gt(1,"commander.executeSubCommandAsync","(error)");d.nestedError=l,u(d)}}),this.runningCommand=c}_dispatchSubcommand(e,n,i){let r=this._findCommand(e);r||this.help({error:!0}),r._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,r,"preSubcommand"),o=this._chainOrCall(o,()=>{if(r._executableHandler)this._executeSubCommand(r,n.concat(i));else return r._parseCommand(n,i)}),o}_dispatchHelpCommand(e){e||this.help();let n=this._findCommand(e);return n&&!n._executableHandler&&n.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,n)=>{e.required&&this.args[n]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(i,r,o)=>{let s=r;if(r!==null&&i.parseArg){let a=`error: command-argument value '${r}' is invalid for argument '${i.name()}'.`;s=this._callParseArg(i,r,o,a)}return s};this._checkNumberOfArguments();let n=[];this.registeredArguments.forEach((i,r)=>{let o=i.defaultValue;i.variadic?r<this.args.length?(o=this.args.slice(r),i.parseArg&&(o=o.reduce((s,a)=>e(i,a,s),i.defaultValue))):o===void 0&&(o=[]):r<this.args.length&&(o=this.args[r],i.parseArg&&(o=e(i,o,i.defaultValue))),n[r]=o}),this.processedArgs=n}_chainOrCall(e,n){return e?.then&&typeof e.then=="function"?e.then(()=>n()):n()}_chainOrCallHooks(e,n){let i=e,r=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[n]!==void 0).forEach(o=>{o._lifeCycleHooks[n].forEach(s=>{r.push({hookedCommand:o,callback:s})})}),n==="postAction"&&r.reverse(),r.forEach(o=>{i=this._chainOrCall(i,()=>o.callback(o.hookedCommand,this))}),i}_chainOrCallSubCommandHook(e,n,i){let r=e;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(o=>{r=this._chainOrCall(r,()=>o(this,n))}),r}_parseCommand(e,n){let i=this.parseOptions(n);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(i.operands),n=i.unknown,this.args=e.concat(n),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),n);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(n),this._dispatchSubcommand(this._defaultCommandName,e,n);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){r(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,e,n)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))r(),this._processArguments(),this.parent.emit(o,e,n);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,n);this.listenerCount("command:*")?this.emit("command:*",e,n):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(n=>n._name===e||n._aliases.includes(e))}_findOption(e){return this.options.find(n=>n.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(n=>{n.mandatory&&e.getOptionValue(n.attributeName())===void 0&&e.missingMandatoryOptionValue(n)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(i=>{let r=i.attributeName();return this.getOptionValue(r)===void 0?!1:this.getOptionValueSource(r)!=="default"});e.filter(i=>i.conflictsWith.length>0).forEach(i=>{let r=e.find(o=>i.conflictsWith.includes(o.attributeName()));r&&this._conflictingOption(i,r)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let n=[],i=[],r=n;function o(l){return l.length>1&&l[0]==="-"}let s=l=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(d=>d.options.map(h=>h.short).some(h=>/^-\d$/.test(h))):!1,a=null,c=null,u=0;for(;u<e.length||c;){let l=c??e[u++];if(c=null,l==="--"){r===i&&r.push(l),r.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(r===n&&o(l)&&!(this.commands.length===0&&s(l))&&(r=i),(this._enablePositionalOptions||this._passThroughOptions)&&n.length===0&&i.length===0){if(this._findCommand(l)){n.push(l),i.push(...e.slice(u));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){n.push(l,...e.slice(u));break}else if(this._defaultCommandName){i.push(l,...e.slice(u));break}}if(this._passThroughOptions){r.push(l,...e.slice(u));break}r.push(l)}return{operands:n,unknown:i}}opts(){if(this._storeOptionsAsProperties){let e={},n=this.options.length;for(let i=0;i<n;i++){let r=this.options[i].attributeName();e[r]=r===this._versionOptionName?this._version:this[r]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,n)=>Object.assign(e,n.opts()),{})}error(e,n){this._outputConfiguration.outputError(`${e}
208
+ - ${r}`;throw new Error(o)}_executeSubCommand(e,n){n=n.slice();let i=[".js",".ts",".tsx",".mjs",".cjs"];function r(l,d){let h=Nt.resolve(l,d);if(yc.existsSync(h))return h;if(i.includes(Nt.extname(d)))return;let f=i.find(p=>yc.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=yc.realpathSync(this._scriptPath)}catch{l=this._scriptPath}s=Nt.resolve(Nt.dirname(l),s)}if(s){let l=r(s,o);if(!l&&!e._executableFile&&this._scriptPath){let d=Nt.basename(this._scriptPath,Nt.extname(this._scriptPath));d!==this._name&&(l=r(s,`${d}-${e._name}`))}o=l||o}let a=i.includes(Nt.extname(o)),c;G.platform!=="win32"?a?(n.unshift(o),n=zS(G.execArgv).concat(n),c=fg.spawn(G.argv[0],n,{stdio:"inherit"})):c=fg.spawn(o,n,{stdio:"inherit"}):(this._checkForMissingExecutable(o,s,e._name),n.unshift(o),n=zS(G.execArgv).concat(n),c=fg.spawn(G.execPath,n,{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 gt(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 gt(1,"commander.executeSubCommandAsync","(error)");d.nestedError=l,u(d)}}),this.runningCommand=c}_dispatchSubcommand(e,n,i){let r=this._findCommand(e);r||this.help({error:!0}),r._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,r,"preSubcommand"),o=this._chainOrCall(o,()=>{if(r._executableHandler)this._executeSubCommand(r,n.concat(i));else return r._parseCommand(n,i)}),o}_dispatchHelpCommand(e){e||this.help();let n=this._findCommand(e);return n&&!n._executableHandler&&n.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,n)=>{e.required&&this.args[n]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(i,r,o)=>{let s=r;if(r!==null&&i.parseArg){let a=`error: command-argument value '${r}' is invalid for argument '${i.name()}'.`;s=this._callParseArg(i,r,o,a)}return s};this._checkNumberOfArguments();let n=[];this.registeredArguments.forEach((i,r)=>{let o=i.defaultValue;i.variadic?r<this.args.length?(o=this.args.slice(r),i.parseArg&&(o=o.reduce((s,a)=>e(i,a,s),i.defaultValue))):o===void 0&&(o=[]):r<this.args.length&&(o=this.args[r],i.parseArg&&(o=e(i,o,i.defaultValue))),n[r]=o}),this.processedArgs=n}_chainOrCall(e,n){return e?.then&&typeof e.then=="function"?e.then(()=>n()):n()}_chainOrCallHooks(e,n){let i=e,r=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[n]!==void 0).forEach(o=>{o._lifeCycleHooks[n].forEach(s=>{r.push({hookedCommand:o,callback:s})})}),n==="postAction"&&r.reverse(),r.forEach(o=>{i=this._chainOrCall(i,()=>o.callback(o.hookedCommand,this))}),i}_chainOrCallSubCommandHook(e,n,i){let r=e;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(o=>{r=this._chainOrCall(r,()=>o(this,n))}),r}_parseCommand(e,n){let i=this.parseOptions(n);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(i.operands),n=i.unknown,this.args=e.concat(n),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),n);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(n),this._dispatchSubcommand(this._defaultCommandName,e,n);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){r(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,e,n)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))r(),this._processArguments(),this.parent.emit(o,e,n);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,n);this.listenerCount("command:*")?this.emit("command:*",e,n):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(n=>n._name===e||n._aliases.includes(e))}_findOption(e){return this.options.find(n=>n.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(n=>{n.mandatory&&e.getOptionValue(n.attributeName())===void 0&&e.missingMandatoryOptionValue(n)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(i=>{let r=i.attributeName();return this.getOptionValue(r)===void 0?!1:this.getOptionValueSource(r)!=="default"});e.filter(i=>i.conflictsWith.length>0).forEach(i=>{let r=e.find(o=>i.conflictsWith.includes(o.attributeName()));r&&this._conflictingOption(i,r)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let n=[],i=[],r=n;function o(l){return l.length>1&&l[0]==="-"}let s=l=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(d=>d.options.map(h=>h.short).some(h=>/^-\d$/.test(h))):!1,a=null,c=null,u=0;for(;u<e.length||c;){let l=c??e[u++];if(c=null,l==="--"){r===i&&r.push(l),r.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(r===n&&o(l)&&!(this.commands.length===0&&s(l))&&(r=i),(this._enablePositionalOptions||this._passThroughOptions)&&n.length===0&&i.length===0){if(this._findCommand(l)){n.push(l),i.push(...e.slice(u));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){n.push(l,...e.slice(u));break}else if(this._defaultCommandName){i.push(l,...e.slice(u));break}}if(this._passThroughOptions){r.push(l,...e.slice(u));break}r.push(l)}return{operands:n,unknown:i}}opts(){if(this._storeOptionsAsProperties){let e={},n=this.options.length;for(let i=0;i<n;i++){let r=this.options[i].attributeName();e[r]=r===this._versionOptionName?this._version:this[r]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,n)=>Object.assign(e,n.opts()),{})}error(e,n){this._outputConfiguration.outputError(`${e}
208
209
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
209
210
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
210
- `),this.outputHelp({error:!0}));let i=n||{},r=i.exitCode||1,o=i.code||"commander.error";this._exit(r,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in G.env){let n=e.attributeName();(this.getOptionValue(n)===void 0||["default","config","env"].includes(this.getOptionValueSource(n)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,G.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new fc(this.options),n=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&n(i.attributeName())&&e.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(r=>!n(r)).forEach(r=>{this.setOptionValueWithSource(r,i.implied[r],"implied")})})}missingArgument(e){let n=`error: missing required argument '${e}'`;this.error(n,{code:"commander.missingArgument"})}optionMissingArgument(e){let n=`error: option '${e.flags}' argument missing`;this.error(n,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let n=`error: required option '${e.flags}' not specified`;this.error(n,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,n){let i=s=>{let a=s.attributeName(),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},r=s=>{let a=i(s),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${r(e)} cannot be used with ${r(n)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let n="";if(e.startsWith("--")&&this._showSuggestionAfterError){let r=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);r=r.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);n=ug(e,r)}let i=`error: unknown option '${e}'${n}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let n=this.registeredArguments.length,i=n===1?"":"s",r=e.length,o=this.parent?` for '${this.name()}'`:"",s=e.join(", "),a=`error: too many arguments${o}. Expected ${n} argument${i} but got ${r}: ${s}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],n="";if(this._showSuggestionAfterError){let r=[];this.createHelp().visibleCommands(this).forEach(o=>{r.push(o.name()),o.alias()&&r.push(o.alias())}),n=ug(e,r)}let i=`error: unknown command '${e}'${n}`;this.error(i,{code:"commander.unknownCommand"})}version(e,n,i){if(e===void 0)return this._version;this._version=e,n=n||"-V, --version",i=i||"output the version number";let r=this.createOption(n,i);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on("option:"+r.name(),()=>{this._outputConfiguration.writeOut(`${e}
211
- `),this._exit(0,"commander.version",e)}),this}description(e,n){return e===void 0&&n===void 0?this._description:(this._description=e,n&&(this._argsDescription=n),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let n=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(n=this.commands[this.commands.length-1]),e===n._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(e);if(i){let r=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${r}'`)}return n._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(n=>this.alias(n)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let n=this.registeredArguments.map(i=>hc(i));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?n:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=Ct.basename(e,Ct.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let n=this.createHelp(),i=this._getOutputContext(e);n.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let r=n.formatHelp(this,n);return i.hasColors?r:this._outputConfiguration.stripColor(r)}_getOutputContext(e){e=e||{};let n=!!e.error,i,r,o;return n?(i=a=>this._outputConfiguration.writeErr(a),r=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(i=a=>this._outputConfiguration.writeOut(a),r=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:n,write:a=>(r||(a=this._outputConfiguration.stripColor(a)),i(a)),hasColors:r,helpWidth:o}}outputHelp(e){let n;typeof e=="function"&&(n=e,e=void 0);let i=this._getOutputContext(e),r={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",r)),this.emit("beforeHelp",r);let o=this.helpInformation({error:i.error});if(n&&(o=n(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",r),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",r))}helpOption(e,n){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",n??"display help for command"),(e||n)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let n=Number(G.exitCode??0);n===0&&e&&typeof e!="function"&&e.error&&(n=1),this._exit(n,"commander.help","(outputHelp)")}addHelpText(e,n){let i=["beforeAll","before","after","afterAll"];if(!i.includes(e))throw new Error(`Unexpected value for position to addHelpText.
211
+ `),this.outputHelp({error:!0}));let i=n||{},r=i.exitCode||1,o=i.code||"commander.error";this._exit(r,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in G.env){let n=e.attributeName();(this.getOptionValue(n)===void 0||["default","config","env"].includes(this.getOptionValueSource(n)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,G.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new vc(this.options),n=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&n(i.attributeName())&&e.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(r=>!n(r)).forEach(r=>{this.setOptionValueWithSource(r,i.implied[r],"implied")})})}missingArgument(e){let n=`error: missing required argument '${e}'`;this.error(n,{code:"commander.missingArgument"})}optionMissingArgument(e){let n=`error: option '${e.flags}' argument missing`;this.error(n,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let n=`error: required option '${e.flags}' not specified`;this.error(n,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,n){let i=s=>{let a=s.attributeName(),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},r=s=>{let a=i(s),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${r(e)} cannot be used with ${r(n)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let n="";if(e.startsWith("--")&&this._showSuggestionAfterError){let r=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);r=r.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);n=hg(e,r)}let i=`error: unknown option '${e}'${n}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let n=this.registeredArguments.length,i=n===1?"":"s",r=e.length,o=this.parent?` for '${this.name()}'`:"",s=e.join(", "),a=`error: too many arguments${o}. Expected ${n} argument${i} but got ${r}: ${s}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],n="";if(this._showSuggestionAfterError){let r=[];this.createHelp().visibleCommands(this).forEach(o=>{r.push(o.name()),o.alias()&&r.push(o.alias())}),n=hg(e,r)}let i=`error: unknown command '${e}'${n}`;this.error(i,{code:"commander.unknownCommand"})}version(e,n,i){if(e===void 0)return this._version;this._version=e,n=n||"-V, --version",i=i||"output the version number";let r=this.createOption(n,i);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on("option:"+r.name(),()=>{this._outputConfiguration.writeOut(`${e}
212
+ `),this._exit(0,"commander.version",e)}),this}description(e,n){return e===void 0&&n===void 0?this._description:(this._description=e,n&&(this._argsDescription=n),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let n=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(n=this.commands[this.commands.length-1]),e===n._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(e);if(i){let r=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${r}'`)}return n._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(n=>this.alias(n)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let n=this.registeredArguments.map(i=>gc(i));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?n:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=Nt.basename(e,Nt.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let n=this.createHelp(),i=this._getOutputContext(e);n.prepareContext({error:i.error,helpWidth:i.helpWidth,outputHasColors:i.hasColors});let r=n.formatHelp(this,n);return i.hasColors?r:this._outputConfiguration.stripColor(r)}_getOutputContext(e){e=e||{};let n=!!e.error,i,r,o;return n?(i=a=>this._outputConfiguration.writeErr(a),r=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(i=a=>this._outputConfiguration.writeOut(a),r=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:n,write:a=>(r||(a=this._outputConfiguration.stripColor(a)),i(a)),hasColors:r,helpWidth:o}}outputHelp(e){let n;typeof e=="function"&&(n=e,e=void 0);let i=this._getOutputContext(e),r={error:i.error,write:i.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",r)),this.emit("beforeHelp",r);let o=this.helpInformation({error:i.error});if(n&&(o=n(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",r),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",r))}helpOption(e,n){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",n??"display help for command"),(e||n)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let n=Number(G.exitCode??0);n===0&&e&&typeof e!="function"&&e.error&&(n=1),this._exit(n,"commander.help","(outputHelp)")}addHelpText(e,n){let i=["beforeAll","before","after","afterAll"];if(!i.includes(e))throw new Error(`Unexpected value for position to addHelpText.
212
213
  Expecting one of '${i.join("', '")}'`);let r=`${e}Help`;return this.on(r,o=>{let s;typeof n=="function"?s=n({error:o.error,command:o.command}):s=n,s&&o.write(`${s}
213
- `)}),this}_outputHelpIfRequested(e){let n=this._getHelpOption();n&&e.find(r=>n.is(r))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function CS(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let n,i="127.0.0.1",r="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?n=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(n=o[1],/^\d+$/.test(o[3])?r=o[3]:i=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(n=o[1],i=o[3],r=o[4]),n&&r!=="0"?`${n}=${i}:${parseInt(r)+1}`:e})}function RS(){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 DV=new Zn;he();var ce={out:t=>process.stdout.write(t),err:t=>process.stderr.write(t)};function GC(t){if(t==="debug"||t==="info"||t==="warn"||t==="error")return t;throw new Pt("expected one of debug|info|warn|error")}function mc(t){return t.option("--log-level <level>","set log verbosity (debug|info|warn|error)",GC).option("--project <path>","approved project scope (default: cwd)").option("--text","force text-only operation").option("--no-voice","force text-only operation (disable voice)").option("--half-duplex","mute barge-in; mute the mic while jarvis speaks (no headphones)").option("--ptt","push-to-talk: press space to talk, again to send")}function WC(t){return t.text===!0||t.voice===!1}function HC(t,e,n,i=ce){let r=new Zn;r.name("jarvis").description("jarvis - voice-first personal agent").configureOutput({writeOut:s=>i.out(s),writeErr:s=>i.err(s)}).showHelpAfterError().exitOverride().allowExcessArguments(!0).version(t,"-v, --version","print version"),mc(r),r.hook("preAction",(s,a)=>{let c=a.optsWithGlobals();c.logLevel&&U.setLevel(c.logLevel)}),r.action(async(s,a)=>{if(a.args.length>0){a.error(`error: unknown command '${a.args[0]}'`,{exitCode:1,code:"commander.unknownCommand"});return}n.exitCode=await e.activate({project:s.project??process.cwd(),textOnly:WC(s),halfDuplex:s.halfDuplex===!0,ptt:s.ptt===!0})});let o=(s,a)=>{let c=r.command(s).description(a).allowExcessArguments(!1);return mc(c)};return o("init","first-run setup (interactive wizard)").action(async()=>{n.exitCode=await e.init()}),o("start","start the local core service").action(()=>{n.exitCode=e.stub("start")}),o("stop","stop the local core service").action(()=>{n.exitCode=e.stub("stop")}),o("restart","restart the local core service").action(()=>{n.exitCode=e.stub("restart")}),o("status","show version and check for updates").action(async()=>{n.exitCode=await e.status()}),o("doctor","run diagnostics").action(async()=>{n.exitCode=await e.doctor()}),o("devices","list audio devices").action(()=>{n.exitCode=e.stub("devices")}),o("upgrade","upgrade the installed CLI to the latest published version").action(async()=>{n.exitCode=await e.upgrade()}),qC(r,e,n),r}function qC(t,e,n){let i=t.command("config").description("inspect and edit configuration").allowExcessArguments(!0);mc(i),i.action((o,s)=>{if(s.args.length>0){s.error(`error: unknown command 'config ${s.args[0]}'`,{exitCode:1,code:"commander.unknownCommand"});return}s.outputHelp(),n.exitCode=0});let r=(o,s)=>{let a=i.command(o).description(s).allowExcessArguments(!1);return mc(a)};r("list","print the resolved config (secrets redacted)").action(async()=>{n.exitCode=await e.configList()}),r("get <path>","print one config value by dotted path").action(async o=>{n.exitCode=await e.configGet(o)}),r("set <path> <value>","set one config value by dotted path").action(async(o,s)=>{n.exitCode=await e.configSet(o,s)}),r("unset <path>","remove one config value by dotted path").action(async o=>{n.exitCode=await e.configUnset(o)})}async function DS(t,e,n,i=ce){let r={exitCode:0},o=HC(e,n,r,i);try{return await o.parseAsync(t,{from:"user"}),r.exitCode}catch(s){if(s instanceof gt)return s.exitCode;throw s}}he();import{execSync as kE,spawnSync as tz}from"node:child_process";import{existsSync as rz}from"node:fs";import{join as nz}from"node:path";var Tc=Je(EE(),1);function Dr(t,e){let n=IE(t),i=IE(e);return n===null||i===null?!1:Tc.default.gt(n,i)}function IE(t){return Tc.default.valid(t)??Tc.default.coerce(t)?.version??null}var Nr=class{constructor(e,n=ce){this.currentVersion=e;this.io=n}currentVersion;io;packageName="@neuvybe/jarvis";registryTimeoutMs=3e3;safeVersion=/^[0-9A-Za-z.\-+]+$/;npmCmd(){return process.platform==="win32"?"npm.cmd":"npm"}async fetchLatest(){try{let e=await fetch(`https://registry.npmjs.org/${this.packageName}/latest`,{headers:{accept:"application/json"},signal:AbortSignal.timeout(this.registryTimeoutMs)});if(!e.ok)return null;let n=await e.json();return typeof n.version=="string"?n.version:null}catch{return null}}async status(){this.io.out(`jarvis ${this.currentVersion}
214
+ `)}),this}_outputHelpIfRequested(e){let n=this._getHelpOption();n&&e.find(r=>n.is(r))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function zS(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let n,i="127.0.0.1",r="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?n=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(n=o[1],/^\d+$/.test(o[3])?r=o[3]:i=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(n=o[1],i=o[3],r=o[4]),n&&r!=="0"?`${n}=${i}:${parseInt(r)+1}`:e})}function US(){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 YV=new Wn;he();var ne={out:t=>process.stdout.write(t),err:t=>process.stderr.write(t)};function iR(t){if(t==="debug"||t==="info"||t==="warn"||t==="error")return t;throw new Rt("expected one of debug|info|warn|error")}function _c(t){return t.option("--log-level <level>","set log verbosity (debug|info|warn|error)",iR).option("--project <path>","approved project scope (default: cwd)").option("--text","force text-only operation").option("--no-voice","force text-only operation (disable voice)").option("--half-duplex","mute barge-in; mute the mic while jarvis speaks (no headphones)").option("--ptt","push-to-talk: press space to talk, again to send")}function oR(t){return t.text===!0||t.voice===!1}function sR(t,e,n,i=ne){let r=new Wn;r.name("jarvis").description("jarvis - voice-first personal agent").configureOutput({writeOut:s=>i.out(s),writeErr:s=>i.err(s)}).showHelpAfterError().exitOverride().allowExcessArguments(!0).version(t,"-v, --version","print version"),_c(r),r.hook("preAction",(s,a)=>{let c=a.optsWithGlobals();c.logLevel&&j.setLevel(c.logLevel)}),r.action(async(s,a)=>{if(a.args.length>0){a.error(`error: unknown command '${a.args[0]}'`,{exitCode:1,code:"commander.unknownCommand"});return}n.exitCode=await e.activate({project:s.project??process.cwd(),textOnly:oR(s),halfDuplex:s.halfDuplex===!0,ptt:s.ptt===!0})});let o=(s,a)=>{let c=r.command(s).description(a).allowExcessArguments(!1);return _c(c)};return o("init","first-run setup (interactive wizard)").action(async()=>{n.exitCode=await e.init()}),o("start","start the local core service").action(()=>{n.exitCode=e.stub("start")}),o("stop","stop the local core service").action(()=>{n.exitCode=e.stub("stop")}),o("restart","restart the local core service").action(()=>{n.exitCode=e.stub("restart")}),o("status","show version and check for updates").action(async()=>{n.exitCode=await e.status()}),o("doctor","run diagnostics").action(async()=>{n.exitCode=await e.doctor()}),o("models","list model choices for the configured providers").option("--refresh","fetch fresh provider catalogues (bypass the cache TTL)").action(async s=>{n.exitCode=await e.models({refresh:s.refresh===!0})}),o("devices","list audio devices").action(()=>{n.exitCode=e.stub("devices")}),o("upgrade","upgrade the installed CLI to the latest published version").action(async()=>{n.exitCode=await e.upgrade()}),aR(r,e,n),r}function aR(t,e,n){let i=t.command("config").description("inspect and edit configuration").allowExcessArguments(!0);_c(i),i.action((o,s)=>{if(s.args.length>0){s.error(`error: unknown command 'config ${s.args[0]}'`,{exitCode:1,code:"commander.unknownCommand"});return}s.outputHelp(),n.exitCode=0});let r=(o,s)=>{let a=i.command(o).description(s).allowExcessArguments(!1);return _c(a)};r("list","print the resolved config (secrets redacted)").action(async()=>{n.exitCode=await e.configList()}),r("get <path>","print one config value by dotted path").action(async o=>{n.exitCode=await e.configGet(o)}),r("set <path> <value>","set one config value by dotted path").action(async(o,s)=>{n.exitCode=await e.configSet(o,s)}),r("unset <path>","remove one config value by dotted path").action(async o=>{n.exitCode=await e.configUnset(o)})}async function jS(t,e,n,i=ne){let r={exitCode:0},o=sR(e,n,r,i);try{return await o.parseAsync(t,{from:"user"}),r.exitCode}catch(s){if(s instanceof gt)return s.exitCode;throw s}}he();import{execSync as RE,spawnSync as pL}from"node:child_process";import{existsSync as mL}from"node:fs";import{join as gL}from"node:path";var Cc=Je(PE(),1);function zr(t,e){let n=CE(t),i=CE(e);return n===null||i===null?!1:Cc.default.gt(n,i)}function CE(t){return Cc.default.valid(t)??Cc.default.coerce(t)?.version??null}var Ur=class{constructor(e,n=ne){this.currentVersion=e;this.io=n}currentVersion;io;packageName="@neuvybe/jarvis";registryTimeoutMs=3e3;safeVersion=/^[0-9A-Za-z.\-+]+$/;npmCmd(){return process.platform==="win32"?"npm.cmd":"npm"}async fetchLatest(){try{let e=await fetch(`https://registry.npmjs.org/${this.packageName}/latest`,{headers:{accept:"application/json"},signal:AbortSignal.timeout(this.registryTimeoutMs)});if(!e.ok)return null;let n=await e.json();return typeof n.version=="string"?n.version:null}catch{return null}}async status(){this.io.out(`jarvis ${this.currentVersion}
214
215
  `);let e=await this.fetchLatest();return e===null?this.io.out(`could not check for updates (offline?)
215
- `):Dr(e,this.currentVersion)?this.io.out(`upgrade available: ${this.currentVersion} -> ${e} (run: jarvis upgrade)
216
+ `):zr(e,this.currentVersion)?this.io.out(`upgrade available: ${this.currentVersion} -> ${e} (run: jarvis upgrade)
216
217
  `):this.io.out(`up to date
217
218
  `),0}async upgrade(){this.io.err(`checking for updates...
218
219
  `);let e=await this.fetchLatest();if(e===null)return this.io.err(`could not reach the npm registry; try again later
219
- `),1;if(!Dr(e,this.currentVersion))return this.io.out(`already on the latest version (${this.currentVersion})
220
+ `),1;if(!zr(e,this.currentVersion))return this.io.out(`already on the latest version (${this.currentVersion})
220
221
  `),0;if(!this.safeVersion.test(e))return this.io.err(`refusing to install unexpected version string: ${e}
221
222
  `),1;this.io.err(`upgrading ${this.currentVersion} -> ${e}...
222
- `),await this.stopCore();let n=`${this.npmCmd()} install -g ${this.packageName}@${e}`;try{kE(n,{stdio:"inherit"})}catch{return this.io.err(`upgrade failed; run manually: ${this.npmCmd()} install -g ${this.packageName}@latest
223
+ `),await this.stopCore();let n=`${this.npmCmd()} install -g ${this.packageName}@${e}`;try{RE(n,{stdio:"inherit"})}catch{return this.io.err(`upgrade failed; run manually: ${this.npmCmd()} install -g ${this.packageName}@latest
223
224
  `),1}let i=this.resolveFreshEntrypoint();return i===null?(this.io.out(`upgraded to ${e}. run "jarvis --version" to confirm.
224
225
  `),0):(this.io.err(`verifying the freshly installed jarvis...
225
- `),tz(process.execPath,[i,"--version"],{stdio:"inherit"}).status!==0?(this.io.err(`upgrade installed but the fresh entrypoint exited abnormally; run "jarvis --version" to confirm
226
+ `),pL(process.execPath,[i,"--version"],{stdio:"inherit"}).status!==0?(this.io.err(`upgrade installed but the fresh entrypoint exited abnormally; run "jarvis --version" to confirm
226
227
  `),0):(this.io.out(`upgraded to ${e}.
227
- `),0))}async stopCore(){return U.debug("stop-core hook: no daemon in v0.1; nothing to stop (proposal 0013 fills this in)"),Promise.resolve()}resolveFreshEntrypoint(){try{let e=kE(`${this.npmCmd()} root -g`,{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();if(!e)return null;let n=nz(e,this.packageName,"dist","index.js");return rz(n)?n:null}catch{return null}}};he();yr();import{spawn as az}from"node:child_process";import{existsSync as cz,readFileSync as uz,writeFileSync as lz}from"node:fs";var zr=Je(OE(),1),N={dim:t=>zr.default.dim(t),bold:t=>zr.default.bold(t),ok:t=>zr.default.green(t),warn:t=>zr.default.yellow(t),fail:t=>zr.default.red(t),accent:t=>zr.default.cyan(t)};var Pc=class{constructor(e,n=Ge){this.currentVersion=e;this.home=n}currentVersion;home;packageName="@neuvybe/jarvis";cacheFile="update-check.json";ttlMs=360*60*1e3;cachePath(){return this.home.resolve(this.cacheFile)}read(){let e=this.cachePath();if(!cz(e))return null;try{let n=JSON.parse(uz(e,"utf8"));return typeof n.lastCheckedAt=="number"&&typeof n.latestVersion=="string"?{lastCheckedAt:n.lastCheckedAt,latestVersion:n.latestVersion}:null}catch{return null}}write(e,n){let i={lastCheckedAt:n,latestVersion:e};try{this.home.ensureDir(),lz(this.cachePath(),JSON.stringify(i))}catch{}}isStale(e){let n=this.read();return!n||e-n.lastCheckedAt>this.ttlMs}notice(){let e=this.read();return!e||!Dr(e.latestVersion,this.currentVersion)?null:N.dim(`upgrade available: ${this.currentVersion} -> ${e.latestVersion} (run: jarvis upgrade)`)}refreshInBackground(){try{let e=this.cachePath();this.home.ensureDir();let n=`
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=RE(`${this.npmCmd()} root -g`,{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();if(!e)return null;let n=gL(e,this.packageName,"dist","index.js");return mL(n)?n:null}catch{return null}}};he();$r();import{spawn as bL}from"node:child_process";import{existsSync as $L,readFileSync as xL,writeFileSync as wL}from"node:fs";var jr=Je(LE(),1),R={dim:t=>jr.default.dim(t),bold:t=>jr.default.bold(t),ok:t=>jr.default.green(t),warn:t=>jr.default.yellow(t),fail:t=>jr.default.red(t),accent:t=>jr.default.cyan(t)};var Dc=class{constructor(e,n=ze){this.currentVersion=e;this.home=n}currentVersion;home;packageName="@neuvybe/jarvis";cacheFile="update-check.json";ttlMs=360*60*1e3;cachePath(){return this.home.resolve(this.cacheFile)}read(){let e=this.cachePath();if(!$L(e))return null;try{let n=JSON.parse(xL(e,"utf8"));return typeof n.lastCheckedAt=="number"&&typeof n.latestVersion=="string"?{lastCheckedAt:n.lastCheckedAt,latestVersion:n.latestVersion}:null}catch{return null}}write(e,n){let i={lastCheckedAt:n,latestVersion:e};try{this.home.ensureDir(),wL(this.cachePath(),JSON.stringify(i))}catch{}}isStale(e){let n=this.read();return!n||e-n.lastCheckedAt>this.ttlMs}notice(){let e=this.read();return!e||!zr(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 n=`
228
229
  import { writeFileSync } from 'node:fs';
229
230
  try {
230
231
  const res = await fetch('https://registry.npmjs.org/${this.packageName}/latest', {
@@ -241,133 +242,144 @@ try {
241
242
  }
242
243
  }
243
244
  } catch {}
244
- `;az(process.execPath,["--input-type=module","-e",n],{detached:!0,stdio:"ignore"}).unref()}catch{U.debug("background update check skipped (could not refresh cache)")}}};var Lr=class{constructor(e,n=ce){this.config=e;this.io=n}config;io;list(){let e=PE(this.config.list());for(let[n,i]of e)this.io.out(`${N.accent(n)} = ${this.renderValue(n,i)}
245
- `);return 0}get(e){let n;try{n=this.config.get(e)}catch(i){return this.io.err(`error: ${Cg(i)}
245
+ `;bL(process.execPath,["--input-type=module","-e",n],{detached:!0,stdio:"ignore"}).unref()}catch{j.debug("background update check skipped (could not refresh cache)")}}};var Fr=class{constructor(e,n=ne,i){this.config=e;this.io=n;this.catalogue=i}config;io;catalogue;list(){let e=ME(this.config.list());for(let[n,i]of e)this.io.out(`${R.accent(n)} = ${this.renderValue(n,i)}
246
+ `);return 0}get(e){let n;try{n=this.config.get(e)}catch(i){return this.io.err(`error: ${Dg(i)}
246
247
  `),1}return n===void 0?(this.io.err(`config: '${e}' is not set
247
- `),1):(this.io.out(`${dz(n)}
248
- `),0)}set(e,n){try{this.config.set(e,n)}catch(i){return this.io.err(`error: ${Cg(i)}
249
- `),1}return this.io.out(`${N.ok("set")} ${N.accent(e)}
250
- `),0}unset(e){try{this.config.unset(e)}catch(n){return this.io.err(`error: ${Cg(n)}
251
- `),1}return this.io.out(`${N.ok("unset")} ${N.accent(e)}
252
- `),0}renderValue(e,n){return e.startsWith("secrets.")?N.dim(String(n)):String(n)}};function PE(t,e=""){let n=[];for(let[i,r]of Object.entries(t)){let o=e?`${e}.${i}`:i;r!==null&&typeof r=="object"&&!Array.isArray(r)?n.push(...PE(r,o)):n.push([o,r])}return n}function dz(t){return t!==null&&typeof t=="object"?JSON.stringify(t,null,2):String(t)}function Cg(t){return t instanceof Error?t.message:String(t)}yr();import{existsSync as CE,statSync as RE}from"node:fs";var DE=["text","stt","tts","embedding"],hz={text:"Brain",stt:"Voice",tts:"Voice",embedding:"Memory"},Cc=class{config;probe;version;io;homeCheck;checkUpdate;constructor(e){this.config=e.config,this.probe=e.probe,this.version=e.version,this.io=e.io??ce,this.homeCheck=e.homeCheck??pz,this.checkUpdate=e.checkUpdate??(async()=>({latest:await new Nr(this.version).fetchLatest()}))}async run(){let e=[],n;try{n=this.config.resolved(),e.push({level:"ok",label:"config",detail:"valid"})}catch(r){e.push({level:"fail",label:"config",detail:`invalid - ${mz(r)}`})}e.push(this.homeLine()),n&&e.push(...await this.routeLines(n)),e.push(await this.versionLine()),e.push({level:"info",label:"project",detail:process.cwd()});let i=e.some(r=>r.level==="fail")?1:0;return this.render(e,i),i}homeLine(){let e=this.homeCheck();return e.permsOk===!1?{level:"fail",label:"home",detail:`${e.dir} - ${e.detail??"permissions wrong"}`}:e.exists?{level:"ok",label:"home",detail:`${e.dir} (${e.detail??"owner-only"})`}:{level:"info",label:"home",detail:`${e.dir} (${e.detail??"not created yet"})`}}async routeLines(e){let n=e.routes??{},i=new Map;for(let s of DE){let a=n[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 r=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}});r.set(s,u.status)}));let o=[];for(let s of DE){let a=n[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,r.get(a.provider),u))}return o}unconfiguredLine(e){return e==="text"?{level:"fail",label:"text route",detail:"not configured - Jarvis cannot reason (run: jarvis init)"}:{level:"info",label:`${e} route`,detail:`not configured (optional, ${hz[e]})`}}probedLine(e,n,i,r,o=!1){let s=`${e} route`,a=e==="text";if(o)return r==="valid"?{level:"ok",label:s,detail:`${n} (server reachable; no key needed)`}:{level:"warn",label:s,detail:`${n} (no key needed; server not reachable - is it running?)`};switch(r){case"valid":return{level:"ok",label:s,detail:`${n} (key valid)`};case"invalid":return{level:a?"fail":"warn",label:s,detail:`${n} - key rejected by ${i}`};case"unreachable":return{level:"warn",label:s,detail:`${n} (key present; could not verify - offline/unreachable)`};case"unimplemented":return{level:"warn",label:s,detail:`${n} (key present; no probe for ${i})`};case"unverifiable":return{level:"warn",label:s,detail:`${n} (key present; reached ${i} but cannot verify this key here - confirmed at first use)`};default:return{level:"warn",label:s,detail:`${n} (key present; not verified)`}}}async versionLine(){let{latest:e}=await this.checkUpdate();return e===null?{level:"info",label:"version",detail:`${this.version} (could not check for updates)`}:Dr(e,this.version)?{level:"warn",label:"version",detail:`${this.version} -> ${e} available (run: jarvis upgrade)`}:{level:"ok",label:"version",detail:`${this.version} (up to date)`}}render(e,n){this.io.out(`
253
- ${N.bold("jarvis doctor")}
248
+ `),1):(this.io.out(`${SL(n)}
249
+ `),0)}set(e,n){try{this.config.set(e,n)}catch(i){return this.io.err(`error: ${Dg(i)}
250
+ `),1}return this.warnUnlistedModel(e,n),this.io.out(`${R.ok("set")} ${R.accent(e)}
251
+ `),0}warnUnlistedModel(e,n){if(this.catalogue===void 0)return;let i=/^routes\.(text|stt|tts|embedding)\.model$/.exec(e);if(i===null)return;let r=i[1];try{let o=this.config.resolved().routes?.[r]?.provider;if(o===void 0)return;let s=this.catalogue.cached(o,r);if(s===void 0||s.models.some(a=>a.id===n))return;this.io.err(`${R.warn("warn:")} '${n}' is not in ${o}'s current list - saving anyway
252
+ `)}catch{}}unset(e){try{this.config.unset(e)}catch(n){return this.io.err(`error: ${Dg(n)}
253
+ `),1}return this.io.out(`${R.ok("unset")} ${R.accent(e)}
254
+ `),0}renderValue(e,n){return e.startsWith("secrets.")?R.dim(String(n)):String(n)}};function ME(t,e=""){let n=[];for(let[i,r]of Object.entries(t)){let o=e?`${e}.${i}`:i;r!==null&&typeof r=="object"&&!Array.isArray(r)?n.push(...ME(r,o)):n.push([o,r])}return n}function SL(t){return t!==null&&typeof t=="object"?JSON.stringify(t,null,2):String(t)}function Dg(t){return t instanceof Error?t.message:String(t)}$r();Mr();import{existsSync as zE,statSync as UE}from"node:fs";var jE=["text","stt","tts","embedding"],EL={text:"Brain",stt:"Voice",tts:"Voice",embedding:"Memory"},Lc=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??ne,this.homeCheck=e.homeCheck??kL,this.checkUpdate=e.checkUpdate??(async()=>({latest:await new Ur(this.version).fetchLatest()})),this.catalogue=e.catalogue??new Ct}async run(){let e=[],n;try{n=this.config.resolved(),e.push({level:"ok",label:"config",detail:"valid"})}catch(r){e.push({level:"fail",label:"config",detail:`invalid - ${TL(r)}`})}e.push(this.homeLine()),n&&e.push(...await this.routeLines(n)),e.push(await this.versionLine()),e.push({level:"info",label:"project",detail:process.cwd()});let i=e.some(r=>r.level==="fail")?1:0;return this.render(e,i),i}homeLine(){let e=this.homeCheck();return e.permsOk===!1?{level:"fail",label:"home",detail:`${e.dir} - ${e.detail??"permissions wrong"}`}:e.exists?{level:"ok",label:"home",detail:`${e.dir} (${e.detail??"owner-only"})`}:{level:"info",label:"home",detail:`${e.dir} (${e.detail??"not created yet"})`}}async routeLines(e){let n=e.routes??{},i=new Map;for(let s of jE){let a=n[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 r=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}});r.set(s,u.status)}));let o=[];for(let s of jE){let a=n[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,r.get(a.provider),u));let l=this.modelRotLine(s,a.provider,a.model);l!==void 0&&o.push(l)}return o}modelRotLine(e,n,i){let r=this.catalogue.cached(n,e);if(r?.fresh&&!r.models.some(o=>o.id===i))return{level:"info",label:`${e} route`,detail:`model '${i}' not in ${n}'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, ${EL[e]})`}}probedLine(e,n,i,r,o=!1){let s=`${e} route`,a=e==="text";if(o)return r==="valid"?{level:"ok",label:s,detail:`${n} (server reachable; no key needed)`}:{level:"warn",label:s,detail:`${n} (no key needed; server not reachable - is it running?)`};switch(r){case"valid":return{level:"ok",label:s,detail:`${n} (key valid)`};case"invalid":return{level:a?"fail":"warn",label:s,detail:`${n} - key rejected by ${i}`};case"unreachable":return{level:"warn",label:s,detail:`${n} (key present; could not verify - offline/unreachable)`};case"unimplemented":return{level:"warn",label:s,detail:`${n} (key present; no probe for ${i})`};case"unverifiable":return{level:"warn",label:s,detail:`${n} (key present; reached ${i} but cannot verify this key here - confirmed at first use)`};default:return{level:"warn",label:s,detail:`${n} (key present; not verified)`}}}async versionLine(){let{latest:e}=await this.checkUpdate();return e===null?{level:"info",label:"version",detail:`${this.version} (could not check for updates)`}:zr(e,this.version)?{level:"warn",label:"version",detail:`${this.version} -> ${e} available (run: jarvis upgrade)`}:{level:"ok",label:"version",detail:`${this.version} (up to date)`}}render(e,n){this.io.out(`
255
+ ${R.bold("jarvis doctor")}
254
256
 
255
- `);for(let i of e){let r=i.detail?`: ${i.detail}`:"";this.io.out(` ${fz(i.level)} ${i.label}${r}
257
+ `);for(let i of e){let r=i.detail?`: ${i.detail}`:"";this.io.out(` ${IL(i.level)} ${i.label}${r}
256
258
  `)}this.io.out(`
257
- `),n!==0?this.io.out(`${N.fail("not ready")} - resolve the failing checks above (start with: jarvis init)
258
- `):e.some(i=>i.level==="warn")?this.io.out(`${N.warn("ready, with warnings")}
259
- `):this.io.out(`${N.ok("all checks passed")}
260
- `)}};function fz(t){switch(t){case"ok":return N.ok("OK ");case"warn":return N.warn("WARN");case"fail":return N.fail("FAIL");case"info":return N.dim("INFO")}}function pz(){let t=Ge.dir();if(!CE(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=(RE(t).mode&63)===0,n=Ge.resolve("config.json"),i=!CE(n)||(RE(n).mode&63)===0,r=e&&i;return{dir:t,exists:!0,permsOk:r,detail:r?"owner-only":"should be owner-only (chmod 700 ~/.jarvis; chmod 600 ~/.jarvis/config.json)"}}function mz(t){return t instanceof Error?t.message:String(t)}import{styleText as Ug}from"node:util";import{stdout as jg,stdin as YE}from"node:process";import*as ir from"node:readline";import Pz from"node:readline";var NE=(()=>{let t=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return e=>{let n=0;for(t.lastIndex=0;t.test(e);)n+=1;return e.length-n}})(),zE=t=>t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510,LE=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 gz=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,vz=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,UE=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,yz=/\t{1,1000}/y,ME=/[\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,_z=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,bz=/\p{M}+/gu,$z={limit:1/0,ellipsis:""},jE=(t,e={},n={})=>{let i=e.limit??1/0,r=e.ellipsis??"",o=e?.ellipsisWidth??(r?jE(r,$z,n).width:0),s=0,a=n.controlWidth??0,c=n.tabWidth??8,u=n.emojiWidth??2,l=2,d=n.regularWidth??1,h=n.wideWidth??l,f=[[_z,d],[gz,s],[vz,a],[yz,c],[ME,u],[UE,h]],p=0,_=0,b=t.length,E=0,C=!1,A=b,I=Math.max(0,i-o),T=0,B=0,V=0,H=0;e:for(;;){if(B>T||_>=b&&_>p){let ne=t.slice(T,B)||t.slice(p,_);E=0;for(let we of ne.replaceAll(bz,"")){let me=we.codePointAt(0)||0;if(zE(me)?H=l:LE(me)?H=h:H=d,V+H>I&&(A=Math.min(A,Math.max(T,p)+E)),V+H>i){C=!0;break e}E+=we.length,V+=H}T=B=0}if(_>=b)break e;for(let ne=0,we=f.length;ne<we;ne++){let[me,Ie]=f[ne];if(me.lastIndex=_,me.test(t)){if(E=me===UE?NE(t.slice(_,me.lastIndex)):me===ME?1:me.lastIndex-_,H=E*Ie,V+H>I&&(A=Math.min(A,_+Math.floor((I-V)/Ie))),V+H>i){C=!0;break e}V+=H,T=p,B=_,_=p=me.lastIndex;continue e}}_+=1}return{width:C?I:V,index:C?A:b,truncated:C,ellipsed:C&&i>=o}},FE=jE;var xz={limit:1/0,ellipsis:"",ellipsisWidth:0},wz=(t,e={})=>FE(t,xz,e).width,De=wz;var Rc="\x1B",WE="\x9B",Sz=39,Dg="\x07",HE="[",Ez="]",qE="m",Ng=`${Ez}8;;`,VE=new RegExp(`(?:\\${HE}(?<code>\\d+)m|\\${Ng}(?<uri>.*)${Dg})`,"y"),ZE=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},BE=t=>`${Rc}${HE}${t}${qE}`,GE=t=>`${Rc}${Ng}${t}${Dg}`,Rg=(t,e,n)=>{let i=e[Symbol.iterator](),r=!1,o=!1,s=t.at(-1),a=s===void 0?0:De(s),c=i.next(),u=i.next(),l=0;for(;!c.done;){let d=c.value,h=De(d);a+h<=n?t[t.length-1]+=d:(t.push(d),a=0),(d===Rc||d===WE)&&(r=!0,o=e.startsWith(Ng,l+1)),r?o?d===Dg&&(r=!1,o=!1):d===qE&&(r=!1):(a+=h,a===n&&!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())},Iz=t=>{let e=t.split(" "),n=e.length;for(;n&&!De(e[n-1]);)n--;return n===e.length?t:e.slice(0,n).join(" ")+e.slice(n).join("")},kz=(t,e,n={})=>{if(n.trim!==!1&&t.trim()==="")return"";let i="",r,o,s=t.split(" "),a=[""],c=0;for(let d=0;d<s.length;d++){let h=s[d];if(n.trim!==!1){let p=a.at(-1)??"",_=p.trimStart();p.length!==_.length&&(a[a.length-1]=_,c=De(_))}d!==0&&(c>=e&&(n.wordWrap===!1||n.trim===!1)&&(a.push(""),c=0),(c||n.trim===!1)&&(a[a.length-1]+=" ",c++));let f=De(h);if(n.hard&&f>e){let p=e-c,_=1+Math.floor((f-p-1)/e);Math.floor((f-1)/e)<_&&a.push(""),Rg(a,h,e),c=De(a.at(-1)??"");continue}if(c+f>e&&c&&f){if(n.wordWrap===!1&&c<e){Rg(a,h,e),c=De(a.at(-1)??"");continue}a.push(""),c=0}if(c+f>e&&n.wordWrap===!1){Rg(a,h,e),c=De(a.at(-1)??"");continue}a[a.length-1]+=h,c+=f}n.trim!==!1&&(a=a.map(d=>Iz(d)));let u=a.join(`
261
- `),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===Rc||h===WE){VE.lastIndex=d+1;let p=VE.exec(u)?.groups;if(p?.code!==void 0){let _=Number.parseFloat(p.code);r=_===Sz?void 0:_}else p?.uri!==void 0&&(o=p.uri.length===0?void 0:p.uri)}if(u[d+1]===`
262
- `){o&&(i+=GE(""));let f=r?ZE(r):void 0;r&&f&&(i+=BE(f))}else h===`
263
- `&&(r&&ZE(r)&&(i+=BE(r)),o&&(i+=GE(o)))}return i},Tz=/\r?\n/;function yt(t,e,n){return String(t).normalize().split(Tz).map(i=>kz(i,e,n)).join(`
264
- `)}var Ee=Je(Lg(),1);import{ReadStream as KE}from"node:tty";function Ur(t,e,n){if(!n.some(s=>!s.disabled))return t;let i=t+e,r=Math.max(n.length-1,0),o=i<0?r:i>r?0:i;return n[o].disabled?Ur(o,e<0?-1:1,n):o}var Cz=["up","down","left","right","space","enter","cancel"],Rz=["January","February","March","April","May","June","July","August","September","October","November","December"],pe={actions:new Set(Cz),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:[...Rz],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 Fg(t,e){if(typeof t=="string")return pe.aliases.get(t)===e;for(let n of t)if(n!==void 0&&Fg(n,e))return!0;return!1}function Dz(t,e){if(t===e)return;let n=t.split(`
259
+ `),n!==0?this.io.out(`${R.fail("not ready")} - resolve the failing checks above (start with: jarvis init)
260
+ `):e.some(i=>i.level==="warn")?this.io.out(`${R.warn("ready, with warnings")}
261
+ `):this.io.out(`${R.ok("all checks passed")}
262
+ `)}};function IL(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 kL(){let t=ze.dir();if(!zE(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=(UE(t).mode&63)===0,n=ze.resolve("config.json"),i=!zE(n)||(UE(n).mode&63)===0,r=e&&i;return{dir:t,exists:!0,permsOk:r,detail:r?"owner-only":"should be owner-only (chmod 700 ~/.jarvis; chmod 600 ~/.jarvis/config.json)"}}function TL(t){return t instanceof Error?t.message:String(t)}import{styleText as Fg}from"node:util";import{stdout as Zg,stdin as nI}from"node:process";import*as ar from"node:readline";import BL from"node:readline";var FE=(()=>{let t=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return e=>{let n=0;for(t.lastIndex=0;t.test(e);)n+=1;return e.length-n}})(),VE=t=>t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510,ZE=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 AL=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,OL=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,BE=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,PL=/\t{1,1000}/y,GE=/[\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,CL=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,RL=/\p{M}+/gu,NL={limit:1/0,ellipsis:""},WE=(t,e={},n={})=>{let i=e.limit??1/0,r=e.ellipsis??"",o=e?.ellipsisWidth??(r?WE(r,NL,n).width:0),s=0,a=n.controlWidth??0,c=n.tabWidth??8,u=n.emojiWidth??2,l=2,d=n.regularWidth??1,h=n.wideWidth??l,f=[[CL,d],[AL,s],[OL,a],[PL,c],[GE,u],[BE,h]],p=0,_=0,$=t.length,I=0,A=!1,O=$,w=Math.max(0,i-o),k=0,z=0,U=0,H=0;e:for(;;){if(z>k||_>=$&&_>p){let ie=t.slice(k,z)||t.slice(p,_);I=0;for(let we of ie.replaceAll(RL,"")){let ge=we.codePointAt(0)||0;if(VE(ge)?H=l:ZE(ge)?H=h:H=d,U+H>w&&(O=Math.min(O,Math.max(k,p)+I)),U+H>i){A=!0;break e}I+=we.length,U+=H}k=z=0}if(_>=$)break e;for(let ie=0,we=f.length;ie<we;ie++){let[ge,Ie]=f[ie];if(ge.lastIndex=_,ge.test(t)){if(I=ge===BE?FE(t.slice(_,ge.lastIndex)):ge===GE?1:ge.lastIndex-_,H=I*Ie,U+H>w&&(O=Math.min(O,_+Math.floor((w-U)/Ie))),U+H>i){A=!0;break e}U+=H,k=p,z=_,_=p=ge.lastIndex;continue e}}_+=1}return{width:A?w:U,index:A?O:$,truncated:A,ellipsed:A&&i>=o}},HE=WE;var DL={limit:1/0,ellipsis:"",ellipsisWidth:0},LL=(t,e={})=>HE(t,DL,e).width,Ne=LL;var Mc="\x1B",XE="\x9B",ML=39,Mg="\x07",QE="[",zL="]",eI="m",zg=`${zL}8;;`,qE=new RegExp(`(?:\\${QE}(?<code>\\d+)m|\\${zg}(?<uri>.*)${Mg})`,"y"),JE=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},KE=t=>`${Mc}${QE}${t}${eI}`,YE=t=>`${Mc}${zg}${t}${Mg}`,Lg=(t,e,n)=>{let i=e[Symbol.iterator](),r=!1,o=!1,s=t.at(-1),a=s===void 0?0:Ne(s),c=i.next(),u=i.next(),l=0;for(;!c.done;){let d=c.value,h=Ne(d);a+h<=n?t[t.length-1]+=d:(t.push(d),a=0),(d===Mc||d===XE)&&(r=!0,o=e.startsWith(zg,l+1)),r?o?d===Mg&&(r=!1,o=!1):d===eI&&(r=!1):(a+=h,a===n&&!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())},UL=t=>{let e=t.split(" "),n=e.length;for(;n&&!Ne(e[n-1]);)n--;return n===e.length?t:e.slice(0,n).join(" ")+e.slice(n).join("")},jL=(t,e,n={})=>{if(n.trim!==!1&&t.trim()==="")return"";let i="",r,o,s=t.split(" "),a=[""],c=0;for(let d=0;d<s.length;d++){let h=s[d];if(n.trim!==!1){let p=a.at(-1)??"",_=p.trimStart();p.length!==_.length&&(a[a.length-1]=_,c=Ne(_))}d!==0&&(c>=e&&(n.wordWrap===!1||n.trim===!1)&&(a.push(""),c=0),(c||n.trim===!1)&&(a[a.length-1]+=" ",c++));let f=Ne(h);if(n.hard&&f>e){let p=e-c,_=1+Math.floor((f-p-1)/e);Math.floor((f-1)/e)<_&&a.push(""),Lg(a,h,e),c=Ne(a.at(-1)??"");continue}if(c+f>e&&c&&f){if(n.wordWrap===!1&&c<e){Lg(a,h,e),c=Ne(a.at(-1)??"");continue}a.push(""),c=0}if(c+f>e&&n.wordWrap===!1){Lg(a,h,e),c=Ne(a.at(-1)??"");continue}a[a.length-1]+=h,c+=f}n.trim!==!1&&(a=a.map(d=>UL(d)));let u=a.join(`
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===Mc||h===XE){qE.lastIndex=d+1;let p=qE.exec(u)?.groups;if(p?.code!==void 0){let _=Number.parseFloat(p.code);r=_===ML?void 0:_}else p?.uri!==void 0&&(o=p.uri.length===0?void 0:p.uri)}if(u[d+1]===`
264
+ `){o&&(i+=YE(""));let f=r?JE(r):void 0;r&&f&&(i+=KE(f))}else h===`
265
+ `&&(r&&JE(r)&&(i+=KE(r)),o&&(i+=YE(o)))}return i},FL=/\r?\n/;function yt(t,e,n){return String(t).normalize().split(FL).map(i=>jL(i,e,n)).join(`
266
+ `)}var Ee=Je(jg(),1);import{ReadStream as rI}from"node:tty";function Vr(t,e,n){if(!n.some(s=>!s.disabled))return t;let i=t+e,r=Math.max(n.length-1,0),o=i<0?r:i>r?0:i;return n[o].disabled?Vr(o,e<0?-1:1,n):o}var GL=["up","down","left","right","space","enter","cancel"],WL=["January","February","March","April","May","June","July","August","September","October","November","December"],pe={actions:new Set(GL),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:[...WL],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 Bg(t,e){if(typeof t=="string")return pe.aliases.get(t)===e;for(let n of t)if(n!==void 0&&Bg(n,e))return!0;return!1}function HL(t,e){if(t===e)return;let n=t.split(`
265
267
  `),i=e.split(`
266
- `),r=Math.max(n.length,i.length),o=[];for(let s=0;s<r;s++)n[s]!==i[s]&&o.push(s);return{lines:o,numLinesBefore:n.length,numLinesAfter:i.length,numLines:r}}var Nz=globalThis.process.platform.startsWith("win"),Mg=Symbol("clack:cancel");function Mc(t){return t===Mg}function Dc(t,e){let n=t;n.isTTY&&n.setRawMode(e)}function XE({input:t=YE,output:e=jg,overwrite:n=!0,hideCursor:i=!0}={}){let r=ir.createInterface({input:t,output:e,prompt:"",tabSize:1});ir.emitKeypressEvents(t,r),t instanceof KE&&t.isTTY&&t.setRawMode(!0);let o=(s,{name:a,sequence:c})=>{let u=String(s);if(Fg([u,a,c],"cancel")){i&&e.write(Ee.cursor.show),process.exit(0);return}if(!n)return;ir.moveCursor(e,a==="return"?0:-1,a==="return"?-1:0,()=>{ir.clearLine(e,1,()=>{t.once("keypress",o)})})};return i&&e.write(Ee.cursor.hide),t.once("keypress",o),()=>{t.off("keypress",o),i&&e.write(Ee.cursor.show),t instanceof KE&&t.isTTY&&!Nz&&t.setRawMode(!1),r.terminal=!1,r.close()}}var yo=t=>"columns"in t&&typeof t.columns=="number"?t.columns:80,Vg=t=>"rows"in t&&typeof t.rows=="number"?t.rows:20;function or(t,e,n,i=n,r=n,o){let s=yo(t??jg);return yt(e,s-n.length,{hard:!0,trim:!1}).split(`
268
+ `),r=Math.max(n.length,i.length),o=[];for(let s=0;s<r;s++)n[s]!==i[s]&&o.push(s);return{lines:o,numLinesBefore:n.length,numLinesAfter:i.length,numLines:r}}var qL=globalThis.process.platform.startsWith("win"),Vg=Symbol("clack:cancel");function Zc(t){return t===Vg}function zc(t,e){let n=t;n.isTTY&&n.setRawMode(e)}function iI({input:t=nI,output:e=Zg,overwrite:n=!0,hideCursor:i=!0}={}){let r=ar.createInterface({input:t,output:e,prompt:"",tabSize:1});ar.emitKeypressEvents(t,r),t instanceof rI&&t.isTTY&&t.setRawMode(!0);let o=(s,{name:a,sequence:c})=>{let u=String(s);if(Bg([u,a,c],"cancel")){i&&e.write(Ee.cursor.show),process.exit(0);return}if(!n)return;ar.moveCursor(e,a==="return"?0:-1,a==="return"?-1:0,()=>{ar.clearLine(e,1,()=>{t.once("keypress",o)})})};return i&&e.write(Ee.cursor.hide),t.once("keypress",o),()=>{t.off("keypress",o),i&&e.write(Ee.cursor.show),t instanceof rI&&t.isTTY&&!qL&&t.setRawMode(!1),r.terminal=!1,r.close()}}var xo=t=>"columns"in t&&typeof t.columns=="number"?t.columns:80,Gg=t=>"rows"in t&&typeof t.rows=="number"?t.rows:20;function cr(t,e,n,i=n,r=n,o){let s=xo(t??Zg);return yt(e,s-n.length,{hard:!0,trim:!1}).split(`
267
269
  `).map((a,c,u)=>{let l=o?o(a,c):a;return c===0?`${i}${l}`:c===u.length-1?`${r}${l}`:`${n}${l}`}).join(`
268
- `)}function QE(t,e){if("~standard"in t){let n=t["~standard"].validate(e);if(n instanceof Promise)throw new TypeError("Schema validation must be synchronous. Update `validate()` and remove any asynchronous logic.");return n.issues?.at(0)?.message}return t(e)}var Mr=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(e,n=!0){let{input:i=YE,output:r=jg,render:o,signal:s,...a}=e;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=o.bind(this),this._track=n,this._abortSignal=s,this.input=i,this.output=r}unsubscribe(){this._subscribers.clear()}setSubscriber(e,n){let i=this._subscribers.get(e)??[];i.push(n),this._subscribers.set(e,i)}on(e,n){this.setSubscriber(e,{cb:n})}once(e,n){this.setSubscriber(e,{cb:n,once:!0})}emit(e,...n){let i=this._subscribers.get(e)??[],r=[];for(let o of i)o.cb(...n),o.once&&r.push(()=>i.splice(i.indexOf(o),1));for(let o of r)o()}prompt(){return new Promise(e=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(Mg);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=Pz.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),Dc(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(Ee.cursor.show),this.output.off("resize",this.render),Dc(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(Ee.cursor.show),this.output.off("resize",this.render),Dc(this.input,!1),e(Mg)})})}_isActionKey(e,n){return e===" "}_shouldSubmit(e,n){return!0}_setValue(e){this.value=e,this.emit("value",this.value)}_setUserInput(e,n){this.userInput=e??"",this.emit("userInput",this.userInput),n&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(e,n){if(this._track&&n.name!=="return"&&(n.name&&this._isActionKey(e,n)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),n?.name&&(!this._track&&pe.aliases.has(n.name)&&this.emit("cursor",pe.aliases.get(n.name)),pe.actions.has(n.name)&&this.emit("cursor",n.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),this.emit("key",e,n),n?.name==="return"&&this._shouldSubmit(e,n)){if(this.opts.validate){let i=QE(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")}Fg([e,n?.name,n?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
269
- `),Dc(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=yt(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
270
- `).length-1;this.output.write(Ee.cursor.move(-999,e*-1))}render(){let e=yt(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(Ee.cursor.hide);else{let n=Dz(this._prevFrame,e),i=Vg(this.output);if(this.restoreCursor(),n){let r=Math.max(0,n.numLinesAfter-i),o=Math.max(0,n.numLinesBefore-i),s=n.lines.find(a=>a>=r);if(s===void 0){this._prevFrame=e;return}if(n.lines.length===1){this.output.write(Ee.cursor.move(0,s-o)),this.output.write(Ee.erase.lines(1));let a=e.split(`
270
+ `)}function oI(t,e){if("~standard"in t){let n=t["~standard"].validate(e);if(n instanceof Promise)throw new TypeError("Schema validation must be synchronous. Update `validate()` and remove any asynchronous logic.");return n.issues?.at(0)?.message}return t(e)}var Zr=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(e,n=!0){let{input:i=nI,output:r=Zg,render:o,signal:s,...a}=e;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=o.bind(this),this._track=n,this._abortSignal=s,this.input=i,this.output=r}unsubscribe(){this._subscribers.clear()}setSubscriber(e,n){let i=this._subscribers.get(e)??[];i.push(n),this._subscribers.set(e,i)}on(e,n){this.setSubscriber(e,{cb:n})}once(e,n){this.setSubscriber(e,{cb:n,once:!0})}emit(e,...n){let i=this._subscribers.get(e)??[],r=[];for(let o of i)o.cb(...n),o.once&&r.push(()=>i.splice(i.indexOf(o),1));for(let o of r)o()}prompt(){return new Promise(e=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(Vg);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=BL.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),zc(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(Ee.cursor.show),this.output.off("resize",this.render),zc(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(Ee.cursor.show),this.output.off("resize",this.render),zc(this.input,!1),e(Vg)})})}_isActionKey(e,n){return e===" "}_shouldSubmit(e,n){return!0}_setValue(e){this.value=e,this.emit("value",this.value)}_setUserInput(e,n){this.userInput=e??"",this.emit("userInput",this.userInput),n&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(e,n){if(this._track&&n.name!=="return"&&(n.name&&this._isActionKey(e,n)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),n?.name&&(!this._track&&pe.aliases.has(n.name)&&this.emit("cursor",pe.aliases.get(n.name)),pe.actions.has(n.name)&&this.emit("cursor",n.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),this.emit("key",e,n),n?.name==="return"&&this._shouldSubmit(e,n)){if(this.opts.validate){let i=oI(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")}Bg([e,n?.name,n?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
271
+ `),zc(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=yt(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
272
+ `).length-1;this.output.write(Ee.cursor.move(-999,e*-1))}render(){let e=yt(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(Ee.cursor.hide);else{let n=HL(this._prevFrame,e),i=Gg(this.output);if(this.restoreCursor(),n){let r=Math.max(0,n.numLinesAfter-i),o=Math.max(0,n.numLinesBefore-i),s=n.lines.find(a=>a>=r);if(s===void 0){this._prevFrame=e;return}if(n.lines.length===1){this.output.write(Ee.cursor.move(0,s-o)),this.output.write(Ee.erase.lines(1));let a=e.split(`
271
273
  `);this.output.write(a[s]),this._prevFrame=e,this.output.write(Ee.cursor.move(0,a.length-s-1));return}else if(n.lines.length>1){if(r<o)s=r;else{let c=s-o;c>0&&this.output.write(Ee.cursor.move(0,c))}this.output.write(Ee.erase.down());let a=e.split(`
272
274
  `).slice(s);this.output.write(a.join(`
273
- `)),this._prevFrame=e;return}}this.output.write(Ee.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}};var Nc=class extends Mr{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",n=>{this.output.write(Ee.cursor.move(0,-1)),this.value=n,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var eI=class extends Mr{options;cursor=0;get _value(){return this.options[this.cursor].value}get _enabledOptions(){return this.options.filter(e=>e.disabled!==!0)}toggleAll(){let e=this._enabledOptions,n=this.value!==void 0&&this.value.length===e.length;this.value=n?[]:e.map(i=>i.value)}toggleInvert(){let e=this.value;if(!e)return;let n=this._enabledOptions.filter(i=>!e.includes(i.value));this.value=n.map(i=>i.value)}toggleValue(){this.value===void 0&&(this.value=[]);let e=this.value.includes(this._value);this.value=e?this.value.filter(n=>n!==this._value):[...this.value,this._value]}constructor(e){super(e,!1),this.options=e.options,this.value=[...e.initialValues??[]];let n=Math.max(this.options.findIndex(({value:i})=>i===e.cursorAt),0);this.cursor=this.options[n].disabled?Ur(n,1,this.options):n,this.on("key",(i,r)=>{r.name==="a"&&this.toggleAll(),r.name==="i"&&this.toggleInvert()}),this.on("cursor",i=>{switch(i){case"left":case"up":this.cursor=Ur(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=Ur(this.cursor,1,this.options);break;case"space":this.toggleValue();break}})}},zc=class extends Mr{_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}${Ug(["inverse","hidden"],"_")}`;let n=this.masked,i=n.slice(0,this.cursor),r=n.slice(this.cursor);return`${i}${Ug("inverse",r[0])}${r.slice(1)}`}clear(){this._clearUserInput()}constructor({mask:e,...n}){super(n),this._mask=e??"\u2022",this.on("userInput",i=>{this._setValue(i)})}},Lc=class extends Mr{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(e){super(e,!1),this.options=e.options;let n=this.options.findIndex(({value:r})=>r===e.initialValue),i=n===-1?0:n;this.cursor=this.options[i].disabled?Ur(i,1,this.options):i,this.changeValue(),this.on("cursor",r=>{switch(r){case"left":case"up":this.cursor=Ur(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=Ur(this.cursor,1,this.options);break}this.changeValue()})}};var Uc=class extends Mr{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let e=this.userInput;if(this.cursor>=e.length)return`${this.userInput}\u2588`;let n=e.slice(0,this.cursor),[i,...r]=e.slice(this.cursor);return`${n}${Ug("inverse",i)}${r.join("")}`}get cursor(){return this._cursor}constructor(e){super({...e,initialUserInput:e.initialUserInput??e.initialValue}),this.on("userInput",n=>{this._setValue(n)}),this.on("finalize",()=>{this.value||(this.value=e.defaultValue),this.value===void 0&&(this.value="")})}};import{styleText as y,stripVTControlCharacters as T8}from"node:util";import it from"node:process";var bo=Je(Lg(),1);function zz(){return it.platform!=="win32"?it.env.TERM!=="linux":!!it.env.CI||!!it.env.WT_SESSION||!!it.env.TERMINUS_SUBLIME||it.env.ConEmuTask==="{cmd::Cmder}"||it.env.TERM_PROGRAM==="Terminus-Sublime"||it.env.TERM_PROGRAM==="vscode"||it.env.TERM==="xterm-256color"||it.env.TERM==="alacritty"||it.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Zg=zz(),Lz=()=>process.env.CI==="true";var Y=(t,e)=>Zg?t:e,Uz=Y("\u25C6","*"),oI=Y("\u25A0","x"),sI=Y("\u25B2","x"),Vc=Y("\u25C7","o"),Mz=Y("\u250C","T"),F=Y("\u2502","|"),_t=Y("\u2514","\u2014"),C8=Y("\u2510","T"),R8=Y("\u2518","\u2014"),Bg=Y("\u25CF",">"),Fc=Y("\u25CB"," "),jz=Y("\u25FB","[\u2022]"),tI=Y("\u25FC","[+]"),rI=Y("\u25FB","[ ]"),Fz=Y("\u25AA","\u2022"),nI=Y("\u2500","-"),Vz=Y("\u256E","+"),Zz=Y("\u251C","+"),Bz=Y("\u256F","+"),Gz=Y("\u2570","+"),D8=Y("\u256D","+"),Wz=Y("\u25CF","\u2022"),Hz=Y("\u25C6","*"),qz=Y("\u25B2","!"),Jz=Y("\u25A0","x"),$o=t=>{switch(t){case"initial":case"active":return y("cyan",Uz);case"cancel":return y("red",oI);case"error":return y("yellow",sI);case"submit":return y("green",Vc)}},aI=t=>{switch(t){case"initial":case"active":return y("cyan",F);case"cancel":return y("red",F);case"error":return y("yellow",F);case"submit":return y("green",F)}},iI=(t,e,n,i,r,o=!1)=>{let s=e,a=0;if(o)for(let c=i-1;c>=n&&(s-=t[c].length,a++,!(s<=r));c--);else for(let c=n;c<i&&(s-=t[c].length,a++,!(s<=r));c++);return{lineCount:s,removals:a}},Gg=({cursor:t,options:e,style:n,output:i=process.stdout,maxItems:r=Number.POSITIVE_INFINITY,columnPadding:o=0,rowPadding:s=4})=>{let a=yo(i)-o,c=Vg(i),u=y("dim","..."),l=Math.max(c-s,0),d=Math.max(Math.min(r,l),5),h=0;t>=d-3&&(h=Math.max(Math.min(t-d+3,e.length-d),0));let f=d<e.length&&h>0,p=d<e.length&&h+d<e.length,_=Math.min(h+d,e.length),b=[],E=0;f&&E++,p&&E++;let C=h+(f?1:0),A=_-(p?1:0);for(let T=C;T<A;T++){let B=yt(n(e[T],T===t),a,{hard:!0,trim:!1}).split(`
274
- `);b.push(B),E+=B.length}if(E>l){let T=0,B=0,V=E,H=t-C,ne=l,we=()=>iI(b,V,0,H,ne),me=()=>iI(b,V,H+1,b.length,ne,!0);f?({lineCount:V,removals:T}=we(),V>ne&&(p||(ne-=1),{lineCount:V,removals:B}=me())):(p||(ne-=1),{lineCount:V,removals:B}=me(),V>ne&&(ne-=1,{lineCount:V,removals:T}=we())),T>0&&(f=!0,b.splice(0,T)),B>0&&(p=!0,b.splice(b.length-B,B))}let I=[];f&&I.push(u);for(let T of b)for(let B of T)I.push(B);return p&&I.push(u),I};var Zc=t=>{let e=t.active??"Yes",n=t.inactive??"No";return new Nc({active:e,inactive:n,signal:t.signal,input:t.input,output:t.output,initialValue:t.initialValue??!0,render(){let i=t.withGuide??pe.withGuide,r=`${$o(this.state)} `,o=i?`${y("gray",F)} `:"",s=or(t.output,t.message,o,r),a=`${i?`${y("gray",F)}
275
+ `)),this._prevFrame=e;return}}this.output.write(Ee.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}};var Uc=class extends Zr{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",n=>{this.output.write(Ee.cursor.move(0,-1)),this.value=n,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var sI=class extends Zr{options;cursor=0;get _value(){return this.options[this.cursor].value}get _enabledOptions(){return this.options.filter(e=>e.disabled!==!0)}toggleAll(){let e=this._enabledOptions,n=this.value!==void 0&&this.value.length===e.length;this.value=n?[]:e.map(i=>i.value)}toggleInvert(){let e=this.value;if(!e)return;let n=this._enabledOptions.filter(i=>!e.includes(i.value));this.value=n.map(i=>i.value)}toggleValue(){this.value===void 0&&(this.value=[]);let e=this.value.includes(this._value);this.value=e?this.value.filter(n=>n!==this._value):[...this.value,this._value]}constructor(e){super(e,!1),this.options=e.options,this.value=[...e.initialValues??[]];let n=Math.max(this.options.findIndex(({value:i})=>i===e.cursorAt),0);this.cursor=this.options[n].disabled?Vr(n,1,this.options):n,this.on("key",(i,r)=>{r.name==="a"&&this.toggleAll(),r.name==="i"&&this.toggleInvert()}),this.on("cursor",i=>{switch(i){case"left":case"up":this.cursor=Vr(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=Vr(this.cursor,1,this.options);break;case"space":this.toggleValue();break}})}},jc=class extends Zr{_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}${Fg(["inverse","hidden"],"_")}`;let n=this.masked,i=n.slice(0,this.cursor),r=n.slice(this.cursor);return`${i}${Fg("inverse",r[0])}${r.slice(1)}`}clear(){this._clearUserInput()}constructor({mask:e,...n}){super(n),this._mask=e??"\u2022",this.on("userInput",i=>{this._setValue(i)})}},Fc=class extends Zr{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(e){super(e,!1),this.options=e.options;let n=this.options.findIndex(({value:r})=>r===e.initialValue),i=n===-1?0:n;this.cursor=this.options[i].disabled?Vr(i,1,this.options):i,this.changeValue(),this.on("cursor",r=>{switch(r){case"left":case"up":this.cursor=Vr(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=Vr(this.cursor,1,this.options);break}this.changeValue()})}};var Vc=class extends Zr{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let e=this.userInput;if(this.cursor>=e.length)return`${this.userInput}\u2588`;let n=e.slice(0,this.cursor),[i,...r]=e.slice(this.cursor);return`${n}${Fg("inverse",i)}${r.join("")}`}get cursor(){return this._cursor}constructor(e){super({...e,initialUserInput:e.initialUserInput??e.initialValue}),this.on("userInput",n=>{this._setValue(n)}),this.on("finalize",()=>{this.value||(this.value=e.defaultValue),this.value===void 0&&(this.value="")})}};import{styleText as y,stripVTControlCharacters as W8}from"node:util";import it from"node:process";var So=Je(jg(),1);function JL(){return it.platform!=="win32"?it.env.TERM!=="linux":!!it.env.CI||!!it.env.WT_SESSION||!!it.env.TERMINUS_SUBLIME||it.env.ConEmuTask==="{cmd::Cmder}"||it.env.TERM_PROGRAM==="Terminus-Sublime"||it.env.TERM_PROGRAM==="vscode"||it.env.TERM==="xterm-256color"||it.env.TERM==="alacritty"||it.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Wg=JL(),KL=()=>process.env.CI==="true";var Y=(t,e)=>Wg?t:e,YL=Y("\u25C6","*"),dI=Y("\u25A0","x"),hI=Y("\u25B2","x"),Wc=Y("\u25C7","o"),XL=Y("\u250C","T"),Z=Y("\u2502","|"),_t=Y("\u2514","\u2014"),K8=Y("\u2510","T"),Y8=Y("\u2518","\u2014"),Hg=Y("\u25CF",">"),Gc=Y("\u25CB"," "),QL=Y("\u25FB","[\u2022]"),aI=Y("\u25FC","[+]"),cI=Y("\u25FB","[ ]"),eM=Y("\u25AA","\u2022"),uI=Y("\u2500","-"),tM=Y("\u256E","+"),rM=Y("\u251C","+"),nM=Y("\u256F","+"),iM=Y("\u2570","+"),X8=Y("\u256D","+"),oM=Y("\u25CF","\u2022"),sM=Y("\u25C6","*"),aM=Y("\u25B2","!"),cM=Y("\u25A0","x"),Eo=t=>{switch(t){case"initial":case"active":return y("cyan",YL);case"cancel":return y("red",dI);case"error":return y("yellow",hI);case"submit":return y("green",Wc)}},fI=t=>{switch(t){case"initial":case"active":return y("cyan",Z);case"cancel":return y("red",Z);case"error":return y("yellow",Z);case"submit":return y("green",Z)}},lI=(t,e,n,i,r,o=!1)=>{let s=e,a=0;if(o)for(let c=i-1;c>=n&&(s-=t[c].length,a++,!(s<=r));c--);else for(let c=n;c<i&&(s-=t[c].length,a++,!(s<=r));c++);return{lineCount:s,removals:a}},qg=({cursor:t,options:e,style:n,output:i=process.stdout,maxItems:r=Number.POSITIVE_INFINITY,columnPadding:o=0,rowPadding:s=4})=>{let a=xo(i)-o,c=Gg(i),u=y("dim","..."),l=Math.max(c-s,0),d=Math.max(Math.min(r,l),5),h=0;t>=d-3&&(h=Math.max(Math.min(t-d+3,e.length-d),0));let f=d<e.length&&h>0,p=d<e.length&&h+d<e.length,_=Math.min(h+d,e.length),$=[],I=0;f&&I++,p&&I++;let A=h+(f?1:0),O=_-(p?1:0);for(let k=A;k<O;k++){let z=yt(n(e[k],k===t),a,{hard:!0,trim:!1}).split(`
276
+ `);$.push(z),I+=z.length}if(I>l){let k=0,z=0,U=I,H=t-A,ie=l,we=()=>lI($,U,0,H,ie),ge=()=>lI($,U,H+1,$.length,ie,!0);f?({lineCount:U,removals:k}=we(),U>ie&&(p||(ie-=1),{lineCount:U,removals:z}=ge())):(p||(ie-=1),{lineCount:U,removals:z}=ge(),U>ie&&(ie-=1,{lineCount:U,removals:k}=we())),k>0&&(f=!0,$.splice(0,k)),z>0&&(p=!0,$.splice($.length-z,z))}let w=[];f&&w.push(u);for(let k of $)for(let z of k)w.push(z);return p&&w.push(u),w};var Hc=t=>{let e=t.active??"Yes",n=t.inactive??"No";return new Uc({active:e,inactive:n,signal:t.signal,input:t.input,output:t.output,initialValue:t.initialValue??!0,render(){let i=t.withGuide??pe.withGuide,r=`${Eo(this.state)} `,o=i?`${y("gray",Z)} `:"",s=cr(t.output,t.message,o,r),a=`${i?`${y("gray",Z)}
275
277
  `:""}${s}
276
- `,c=this.value?e:n;switch(this.state){case"submit":{let u=i?`${y("gray",F)} `:"";return`${a}${u}${y("dim",c)}`}case"cancel":{let u=i?`${y("gray",F)} `:"";return`${a}${u}${y(["strikethrough","dim"],c)}${i?`
277
- ${y("gray",F)}`:""}`}default:{let u=i?`${y("cyan",F)} `:"",l=i?y("cyan",_t):"";return`${a}${u}${this.value?`${y("green",Bg)} ${e}`:`${y("dim",Fc)} ${y("dim",e)}`}${t.vertical?i?`
278
- ${y("cyan",F)} `:`
279
- `:` ${y("dim","/")} `}${this.value?`${y("dim",Fc)} ${y("dim",n)}`:`${y("green",Bg)} ${n}`}
278
+ `,c=this.value?e:n;switch(this.state){case"submit":{let u=i?`${y("gray",Z)} `:"";return`${a}${u}${y("dim",c)}`}case"cancel":{let u=i?`${y("gray",Z)} `:"";return`${a}${u}${y(["strikethrough","dim"],c)}${i?`
279
+ ${y("gray",Z)}`:""}`}default:{let u=i?`${y("cyan",Z)} `:"",l=i?y("cyan",_t):"";return`${a}${u}${this.value?`${y("green",Hg)} ${e}`:`${y("dim",Gc)} ${y("dim",e)}`}${t.vertical?i?`
280
+ ${y("cyan",Z)} `:`
281
+ `:` ${y("dim","/")} `}${this.value?`${y("dim",Gc)} ${y("dim",n)}`:`${y("green",Hg)} ${n}`}
280
282
  ${l}
281
- `}}}}).prompt()};var xe={message:(t=[],{symbol:e=y("gray",F),secondarySymbol:n=y("gray",F),output:i=process.stdout,spacing:r=1,withGuide:o}={})=>{let s=[],a=o??pe.withGuide,c=a?n:"",u=a?`${e} `:"",l=a?`${n} `:"";for(let h=0;h<r;h++)s.push(c);let d=Array.isArray(t)?t:t.split(`
283
+ `}}}}).prompt()};var me={message:(t=[],{symbol:e=y("gray",Z),secondarySymbol:n=y("gray",Z),output:i=process.stdout,spacing:r=1,withGuide:o}={})=>{let s=[],a=o??pe.withGuide,c=a?n:"",u=a?`${e} `:"",l=a?`${n} `:"";for(let h=0;h<r;h++)s.push(c);let d=Array.isArray(t)?t:t.split(`
282
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?n:"")}i.write(`${s.join(`
283
285
  `)}
284
- `)},info:(t,e)=>{xe.message(t,{...e,symbol:y("blue",Wz)})},success:(t,e)=>{xe.message(t,{...e,symbol:y("green",Hz)})},step:(t,e)=>{xe.message(t,{...e,symbol:y("green",Vc)})},warn:(t,e)=>{xe.message(t,{...e,symbol:y("yellow",qz)})},warning:(t,e)=>{xe.warn(t,e)},error:(t,e)=>{xe.message(t,{...e,symbol:y("red",Jz)})}},cI=(t="",e)=>{let n=e?.output??process.stdout,i=e?.withGuide??pe.withGuide?`${y("gray",_t)} `:"";n.write(`${i}${y("red",t)}
286
+ `)},info:(t,e)=>{me.message(t,{...e,symbol:y("blue",oM)})},success:(t,e)=>{me.message(t,{...e,symbol:y("green",sM)})},step:(t,e)=>{me.message(t,{...e,symbol:y("green",Wc)})},warn:(t,e)=>{me.message(t,{...e,symbol:y("yellow",aM)})},warning:(t,e)=>{me.warn(t,e)},error:(t,e)=>{me.message(t,{...e,symbol:y("red",cM)})}},pI=(t="",e)=>{let n=e?.output??process.stdout,i=e?.withGuide??pe.withGuide?`${y("gray",_t)} `:"";n.write(`${i}${y("red",t)}
285
287
 
286
- `)},uI=(t="",e)=>{let n=e?.output??process.stdout,i=e?.withGuide??pe.withGuide?`${y("gray",Mz)} `:"";n.write(`${i}${t}
287
- `)},lI=(t="",e)=>{let n=e?.output??process.stdout,i=e?.withGuide??pe.withGuide?`${y("gray",F)}
288
+ `)},mI=(t="",e)=>{let n=e?.output??process.stdout,i=e?.withGuide??pe.withGuide?`${y("gray",XL)} `:"";n.write(`${i}${t}
289
+ `)},gI=(t="",e)=>{let n=e?.output??process.stdout,i=e?.withGuide??pe.withGuide?`${y("gray",Z)}
288
290
  ${y("gray",_t)} `:"";n.write(`${i}${t}
289
291
 
290
- `)};var _o=(t,e)=>t.split(`
292
+ `)};var wo=(t,e)=>t.split(`
291
293
  `).map(n=>e(n)).join(`
292
- `),dI=t=>{let e=(i,r)=>{let o=i.label??String(i.value);return r==="disabled"?`${y("gray",rI)} ${_o(o,s=>y(["strikethrough","gray"],s))}${i.hint?` ${y("dim",`(${i.hint??"disabled"})`)}`:""}`:r==="active"?`${y("cyan",jz)} ${o}${i.hint?` ${y("dim",`(${i.hint})`)}`:""}`:r==="selected"?`${y("green",tI)} ${_o(o,s=>y("dim",s))}${i.hint?` ${y("dim",`(${i.hint})`)}`:""}`:r==="cancelled"?`${_o(o,s=>y(["strikethrough","dim"],s))}`:r==="active-selected"?`${y("green",tI)} ${o}${i.hint?` ${y("dim",`(${i.hint})`)}`:""}`:r==="submitted"?`${_o(o,s=>y("dim",s))}`:`${y("dim",rI)} ${_o(o,s=>y("dim",s))}`},n=t.required??!0;return new eI({options:t.options,signal:t.signal,input:t.input,output:t.output,initialValues:t.initialValues,required:n,cursorAt:t.cursorAt,validate(i){if(n&&(i===void 0||i.length===0))return`Please select at least one option.
293
- ${y("reset",y("dim",`Press ${y(["gray","bgWhite","inverse"]," space ")} to select, ${y("gray",y("bgWhite",y("inverse"," enter ")))} to submit`))}`},render(){let i=t.withGuide??pe.withGuide,r=or(t.output,t.message,i?`${aI(this.state)} `:"",`${$o(this.state)} `),o=`${i?`${y("gray",F)}
294
+ `),vI=t=>{let e=(i,r)=>{let o=i.label??String(i.value);return r==="disabled"?`${y("gray",cI)} ${wo(o,s=>y(["strikethrough","gray"],s))}${i.hint?` ${y("dim",`(${i.hint??"disabled"})`)}`:""}`:r==="active"?`${y("cyan",QL)} ${o}${i.hint?` ${y("dim",`(${i.hint})`)}`:""}`:r==="selected"?`${y("green",aI)} ${wo(o,s=>y("dim",s))}${i.hint?` ${y("dim",`(${i.hint})`)}`:""}`:r==="cancelled"?`${wo(o,s=>y(["strikethrough","dim"],s))}`:r==="active-selected"?`${y("green",aI)} ${o}${i.hint?` ${y("dim",`(${i.hint})`)}`:""}`:r==="submitted"?`${wo(o,s=>y("dim",s))}`:`${y("dim",cI)} ${wo(o,s=>y("dim",s))}`},n=t.required??!0;return new sI({options:t.options,signal:t.signal,input:t.input,output:t.output,initialValues:t.initialValues,required:n,cursorAt:t.cursorAt,validate(i){if(n&&(i===void 0||i.length===0))return`Please select at least one option.
295
+ ${y("reset",y("dim",`Press ${y(["gray","bgWhite","inverse"]," space ")} to select, ${y("gray",y("bgWhite",y("inverse"," enter ")))} to submit`))}`},render(){let i=t.withGuide??pe.withGuide,r=cr(t.output,t.message,i?`${fI(this.state)} `:"",`${Eo(this.state)} `),o=`${i?`${y("gray",Z)}
294
296
  `:""}${r}
295
- `,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(y("dim",", "))||y("dim","none"),u=or(t.output,c,i?`${y("gray",F)} `:"");return`${o}${u}`}case"cancel":{let c=this.options.filter(({value:l})=>s.includes(l)).map(l=>e(l,"cancelled")).join(y("dim",", "));if(c.trim()==="")return`${o}${y("gray",F)}`;let u=or(t.output,c,i?`${y("gray",F)} `:"");return`${o}${u}${i?`
296
- ${y("gray",F)}`:""}`}case"error":{let c=i?`${y("yellow",F)} `:"",u=this.error.split(`
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(y("dim",", "))||y("dim","none"),u=cr(t.output,c,i?`${y("gray",Z)} `:"");return`${o}${u}`}case"cancel":{let c=this.options.filter(({value:l})=>s.includes(l)).map(l=>e(l,"cancelled")).join(y("dim",", "));if(c.trim()==="")return`${o}${y("gray",Z)}`;let u=cr(t.output,c,i?`${y("gray",Z)} `:"");return`${o}${u}${i?`
298
+ ${y("gray",Z)}`:""}`}case"error":{let c=i?`${y("yellow",Z)} `:"",u=this.error.split(`
297
299
  `).map((h,f)=>f===0?`${i?`${y("yellow",_t)} `:""}${y("yellow",h)}`:` ${h}`).join(`
298
300
  `),l=o.split(`
299
301
  `).length,d=u.split(`
300
- `).length+1;return`${o}${c}${Gg({output:t.output,options:this.options,cursor:this.cursor,maxItems:t.maxItems,columnPadding:c.length,rowPadding:l+d,style:a}).join(`
302
+ `).length+1;return`${o}${c}${qg({output:t.output,options:this.options,cursor:this.cursor,maxItems:t.maxItems,columnPadding:c.length,rowPadding:l+d,style:a}).join(`
301
303
  ${c}`)}
302
304
  ${u}
303
- `}default:{let c=i?`${y("cyan",F)} `:"",u=o.split(`
304
- `).length,l=i?2:1;return`${o}${c}${Gg({output:t.output,options:this.options,cursor:this.cursor,maxItems:t.maxItems,columnPadding:c.length,rowPadding:u+l,style:a}).join(`
305
+ `}default:{let c=i?`${y("cyan",Z)} `:"",u=o.split(`
306
+ `).length,l=i?2:1;return`${o}${c}${qg({output:t.output,options:this.options,cursor:this.cursor,maxItems:t.maxItems,columnPadding:c.length,rowPadding:u+l,style:a}).join(`
305
307
  ${c}`)}
306
308
  ${i?y("cyan",_t):""}
307
- `}}}}).prompt()},Kz=t=>y("dim",t),Yz=(t,e,n)=>{let i={hard:!0,trim:!1},r=yt(t,e,i).split(`
308
- `),o=r.reduce((c,u)=>Math.max(De(u),c),0),s=r.map(n).reduce((c,u)=>Math.max(De(u),c),0),a=e-(s-o);return yt(t,a,i)},Wg=(t="",e="",n)=>{let i=n?.output??it.stdout,r=n?.withGuide??pe.withGuide,o=n?.format??Kz,s=["",...Yz(t,yo(i)-6,o).split(`
309
- `).map(o),""],a=De(e),c=Math.max(s.reduce((h,f)=>{let p=De(f);return p>h?p:h},0),a)+2,u=s.map(h=>`${y("gray",F)} ${h}${" ".repeat(c-De(h))}${y("gray",F)}`).join(`
310
- `),l=r?`${y("gray",F)}
311
- `:"",d=r?Zz:Gz;i.write(`${l}${y("green",Vc)} ${y("reset",e)} ${y("gray",nI.repeat(Math.max(c-a-1,1))+Vz)}
309
+ `}}}}).prompt()},uM=t=>y("dim",t),lM=(t,e,n)=>{let i={hard:!0,trim:!1},r=yt(t,e,i).split(`
310
+ `),o=r.reduce((c,u)=>Math.max(Ne(u),c),0),s=r.map(n).reduce((c,u)=>Math.max(Ne(u),c),0),a=e-(s-o);return yt(t,a,i)},Jg=(t="",e="",n)=>{let i=n?.output??it.stdout,r=n?.withGuide??pe.withGuide,o=n?.format??uM,s=["",...lM(t,xo(i)-6,o).split(`
311
+ `).map(o),""],a=Ne(e),c=Math.max(s.reduce((h,f)=>{let p=Ne(f);return p>h?p:h},0),a)+2,u=s.map(h=>`${y("gray",Z)} ${h}${" ".repeat(c-Ne(h))}${y("gray",Z)}`).join(`
312
+ `),l=r?`${y("gray",Z)}
313
+ `:"",d=r?rM:iM;i.write(`${l}${y("green",Wc)} ${y("reset",e)} ${y("gray",uI.repeat(Math.max(c-a-1,1))+tM)}
312
314
  ${u}
313
- ${y("gray",d+nI.repeat(c+2)+Bz)}
314
- `)},hI=t=>new zc({validate:t.validate,mask:t.mask??Fz,signal:t.signal,input:t.input,output:t.output,render(){let e=t.withGuide??pe.withGuide,n=`${e?`${y("gray",F)}
315
- `:""}${$o(this.state)} ${t.message}
316
- `,i=this.userInputWithCursor,r=this.masked;switch(this.state){case"error":{let o=e?`${y("yellow",F)} `:"",s=e?`${y("yellow",_t)} `:"",a=r??"";return t.clearOnError&&this.clear(),`${n.trim()}
315
+ ${y("gray",d+uI.repeat(c+2)+nM)}
316
+ `)},yI=t=>new jc({validate:t.validate,mask:t.mask??eM,signal:t.signal,input:t.input,output:t.output,render(){let e=t.withGuide??pe.withGuide,n=`${e?`${y("gray",Z)}
317
+ `:""}${Eo(this.state)} ${t.message}
318
+ `,i=this.userInputWithCursor,r=this.masked;switch(this.state){case"error":{let o=e?`${y("yellow",Z)} `:"",s=e?`${y("yellow",_t)} `:"",a=r??"";return t.clearOnError&&this.clear(),`${n.trim()}
317
319
  ${o}${a}
318
320
  ${s}${y("yellow",this.error)}
319
- `}case"submit":{let o=e?`${y("gray",F)} `:"",s=r?y("dim",r):"";return`${n}${o}${s}`}case"cancel":{let o=e?`${y("gray",F)} `:"",s=r?y(["strikethrough","dim"],r):"";return`${n}${o}${s}${r&&e?`
320
- ${y("gray",F)}`:""}`}default:{let o=e?`${y("cyan",F)} `:"",s=e?y("cyan",_t):"";return`${n}${o}${i}
321
+ `}case"submit":{let o=e?`${y("gray",Z)} `:"",s=r?y("dim",r):"";return`${n}${o}${s}`}case"cancel":{let o=e?`${y("gray",Z)} `:"",s=r?y(["strikethrough","dim"],r):"";return`${n}${o}${s}${r&&e?`
322
+ ${y("gray",Z)}`:""}`}default:{let o=e?`${y("cyan",Z)} `:"",s=e?y("cyan",_t):"";return`${n}${o}${i}
321
323
  ${s}
322
- `}}}}).prompt();var Xz=t=>y("magenta",t),fI=({indicator:t="dots",onCancel:e,output:n=process.stdout,cancelMessage:i,errorMessage:r,frames:o=Zg?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:s=Zg?80:120,signal:a,...c}={})=>{let u=Lz(),l,d,h=!1,f=!1,p="",_,b=performance.now(),E=yo(n),C=c?.styleFrame??Xz,A=Q=>{let z=Q>1?r??pe.messages.error:i??pe.messages.cancel;f=Q===1,h&&(ke(z,Q),f&&typeof e=="function"&&e())},I=()=>A(2),T=()=>A(1),B=()=>{process.on("uncaughtExceptionMonitor",I),process.on("unhandledRejection",I),process.on("SIGINT",T),process.on("SIGTERM",T),process.on("exit",A),a&&a.addEventListener("abort",T)},V=()=>{process.removeListener("uncaughtExceptionMonitor",I),process.removeListener("unhandledRejection",I),process.removeListener("SIGINT",T),process.removeListener("SIGTERM",T),process.removeListener("exit",A),a&&a.removeEventListener("abort",T)},H=()=>{if(_===void 0)return;u&&n.write(`
323
- `);let Q=yt(_,E,{hard:!0,trim:!1}).split(`
324
- `);Q.length>1&&n.write(bo.cursor.up(Q.length-1)),n.write(bo.cursor.to(0)),n.write(bo.erase.down())},ne=Q=>Q.replace(/\.+$/,""),we=Q=>{let z=(performance.now()-Q)/1e3,ue=Math.floor(z/60),ot=Math.floor(z%60);return ue>0?`[${ue}m ${ot}s]`:`[${ot}s]`},me=c.withGuide??pe.withGuide,Ie=(Q="")=>{h=!0,l=XE({output:n}),p=ne(Q),b=performance.now(),me&&n.write(`${y("gray",F)}
325
- `);let z=0,ue=0;B(),d=setInterval(()=>{if(u&&p===_)return;H(),_=p;let ot=C(o[z]),je;if(u)je=`${ot} ${p}...`;else if(t==="timer")je=`${ot} ${p} ${we(b)}`;else{let le=".".repeat(Math.floor(ue)).slice(0,3);je=`${ot} ${p}${le}`}let jr=yt(je,E,{hard:!0,trim:!1});n.write(jr),z=z+1<o.length?z+1:0,ue=ue<4?ue+.125:0},s)},ke=(Q="",z=0,ue=!1)=>{if(!h)return;h=!1,clearInterval(d),H();let ot=z===0?y("green",Vc):z===1?y("red",oI):y("red",sI);p=Q??p,ue||(t==="timer"?n.write(`${ot} ${p} ${we(b)}
324
+ `}}}}).prompt();var dM=t=>y("magenta",t),_I=({indicator:t="dots",onCancel:e,output:n=process.stdout,cancelMessage:i,errorMessage:r,frames:o=Wg?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:s=Wg?80:120,signal:a,...c}={})=>{let u=KL(),l,d,h=!1,f=!1,p="",_,$=performance.now(),I=xo(n),A=c?.styleFrame??dM,O=Q=>{let L=Q>1?r??pe.messages.error:i??pe.messages.cancel;f=Q===1,h&&(ke(L,Q),f&&typeof e=="function"&&e())},w=()=>O(2),k=()=>O(1),z=()=>{process.on("uncaughtExceptionMonitor",w),process.on("unhandledRejection",w),process.on("SIGINT",k),process.on("SIGTERM",k),process.on("exit",O),a&&a.addEventListener("abort",k)},U=()=>{process.removeListener("uncaughtExceptionMonitor",w),process.removeListener("unhandledRejection",w),process.removeListener("SIGINT",k),process.removeListener("SIGTERM",k),process.removeListener("exit",O),a&&a.removeEventListener("abort",k)},H=()=>{if(_===void 0)return;u&&n.write(`
325
+ `);let Q=yt(_,I,{hard:!0,trim:!1}).split(`
326
+ `);Q.length>1&&n.write(So.cursor.up(Q.length-1)),n.write(So.cursor.to(0)),n.write(So.erase.down())},ie=Q=>Q.replace(/\.+$/,""),we=Q=>{let L=(performance.now()-Q)/1e3,ue=Math.floor(L/60),ot=Math.floor(L%60);return ue>0?`[${ue}m ${ot}s]`:`[${ot}s]`},ge=c.withGuide??pe.withGuide,Ie=(Q="")=>{h=!0,l=iI({output:n}),p=ie(Q),$=performance.now(),ge&&n.write(`${y("gray",Z)}
327
+ `);let L=0,ue=0;z(),d=setInterval(()=>{if(u&&p===_)return;H(),_=p;let ot=A(o[L]),Ve;if(u)Ve=`${ot} ${p}...`;else if(t==="timer")Ve=`${ot} ${p} ${we($)}`;else{let le=".".repeat(Math.floor(ue)).slice(0,3);Ve=`${ot} ${p}${le}`}let Gr=yt(Ve,I,{hard:!0,trim:!1});n.write(Gr),L=L+1<o.length?L+1:0,ue=ue<4?ue+.125:0},s)},ke=(Q="",L=0,ue=!1)=>{if(!h)return;h=!1,clearInterval(d),H();let ot=L===0?y("green",Wc):L===1?y("red",dI):y("red",hI);p=Q??p,ue||(t==="timer"?n.write(`${ot} ${p} ${we($)}
326
328
  `):n.write(`${ot} ${p}
327
- `)),V(),l()};return{start:Ie,stop:(Q="")=>ke(Q,0),message:(Q="")=>{p=ne(Q??p)},cancel:(Q="")=>ke(Q,1),error:(Q="")=>ke(Q,2),clear:()=>ke("",0,!0),get isCancelled(){return f}}},N8={light:Y("\u2500","-"),heavy:Y("\u2501","="),block:Y("\u2588","#")};var jc=(t,e)=>t.includes(`
329
+ `)),U(),l()};return{start:Ie,stop:(Q="")=>ke(Q,0),message:(Q="")=>{p=ie(Q??p)},cancel:(Q="")=>ke(Q,1),error:(Q="")=>ke(Q,2),clear:()=>ke("",0,!0),get isCancelled(){return f}}},Q8={light:Y("\u2500","-"),heavy:Y("\u2501","="),block:Y("\u2588","#")};var Bc=(t,e)=>t.includes(`
328
330
  `)?t.split(`
329
331
  `).map(n=>e(n)).join(`
330
- `):e(t),Wn=t=>{let e=(n,i)=>{let r=n.label??String(n.value);switch(i){case"disabled":return`${y("gray",Fc)} ${jc(r,o=>y("gray",o))}${n.hint?` ${y("dim",`(${n.hint??"disabled"})`)}`:""}`;case"selected":return`${jc(r,o=>y("dim",o))}`;case"active":return`${y("green",Bg)} ${r}${n.hint?` ${y("dim",`(${n.hint})`)}`:""}`;case"cancelled":return`${jc(r,o=>y(["strikethrough","dim"],o))}`;default:return`${y("dim",Fc)} ${jc(r,o=>y("dim",o))}`}};return new Lc({options:t.options,signal:t.signal,input:t.input,output:t.output,initialValue:t.initialValue,render(){let n=t.withGuide??pe.withGuide,i=`${$o(this.state)} `,r=`${aI(this.state)} `,o=or(t.output,t.message,r,i),s=`${n?`${y("gray",F)}
332
+ `):e(t),Br=t=>{let e=(n,i)=>{let r=n.label??String(n.value);switch(i){case"disabled":return`${y("gray",Gc)} ${Bc(r,o=>y("gray",o))}${n.hint?` ${y("dim",`(${n.hint??"disabled"})`)}`:""}`;case"selected":return`${Bc(r,o=>y("dim",o))}`;case"active":return`${y("green",Hg)} ${r}${n.hint?` ${y("dim",`(${n.hint})`)}`:""}`;case"cancelled":return`${Bc(r,o=>y(["strikethrough","dim"],o))}`;default:return`${y("dim",Gc)} ${Bc(r,o=>y("dim",o))}`}};return new Fc({options:t.options,signal:t.signal,input:t.input,output:t.output,initialValue:t.initialValue,render(){let n=t.withGuide??pe.withGuide,i=`${Eo(this.state)} `,r=`${fI(this.state)} `,o=cr(t.output,t.message,r,i),s=`${n?`${y("gray",Z)}
331
333
  `:""}${o}
332
- `;switch(this.state){case"submit":{let a=n?`${y("gray",F)} `:"",c=or(t.output,e(this.options[this.cursor],"selected"),a);return`${s}${c}`}case"cancel":{let a=n?`${y("gray",F)} `:"",c=or(t.output,e(this.options[this.cursor],"cancelled"),a);return`${s}${c}${n?`
333
- ${y("gray",F)}`:""}`}default:{let a=n?`${y("cyan",F)} `:"",c=n?y("cyan",_t):"",u=s.split(`
334
- `).length,l=n?2:1;return`${s}${a}${Gg({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(`
334
+ `;switch(this.state){case"submit":{let a=n?`${y("gray",Z)} `:"",c=cr(t.output,e(this.options[this.cursor],"selected"),a);return`${s}${c}`}case"cancel":{let a=n?`${y("gray",Z)} `:"",c=cr(t.output,e(this.options[this.cursor],"cancelled"),a);return`${s}${c}${n?`
335
+ ${y("gray",Z)}`:""}`}default:{let a=n?`${y("cyan",Z)} `:"",c=n?y("cyan",_t):"",u=s.split(`
336
+ `).length,l=n?2:1;return`${s}${a}${qg({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(`
335
337
  ${a}`)}
336
338
  ${c}
337
- `}}}}).prompt()};var z8=`${y("gray",F)} `;var pI=t=>new Uc({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,n=`${`${e?`${y("gray",F)}
338
- `:""}${$o(this.state)} `}${t.message}
339
- `,i=t.placeholder?y("inverse",t.placeholder[0])+y("dim",t.placeholder.slice(1)):y(["inverse","hidden"],"_"),r=this.userInput?this.userInputWithCursor:i,o=this.value??"";switch(this.state){case"error":{let s=this.error?` ${y("yellow",this.error)}`:"",a=e?`${y("yellow",F)} `:"",c=e?y("yellow",_t):"";return`${n.trim()}
339
+ `}}}}).prompt()};var e9=`${y("gray",Z)} `;var bI=t=>new Vc({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,n=`${`${e?`${y("gray",Z)}
340
+ `:""}${Eo(this.state)} `}${t.message}
341
+ `,i=t.placeholder?y("inverse",t.placeholder[0])+y("dim",t.placeholder.slice(1)):y(["inverse","hidden"],"_"),r=this.userInput?this.userInputWithCursor:i,o=this.value??"";switch(this.state){case"error":{let s=this.error?` ${y("yellow",this.error)}`:"",a=e?`${y("yellow",Z)} `:"",c=e?y("yellow",_t):"";return`${n.trim()}
340
342
  ${a}${r}
341
343
  ${c}${s}
342
- `}case"submit":{let s=o?` ${y("dim",o)}`:"",a=e?y("gray",F):"";return`${n}${a}${s}`}case"cancel":{let s=o?` ${y(["strikethrough","dim"],o)}`:"",a=e?y("gray",F):"";return`${n}${a}${s}${o.trim()?`
343
- ${a}`:""}`}default:{let s=e?`${y("cyan",F)} `:"",a=e?y("cyan",_t):"";return`${n}${s}${r}
344
+ `}case"submit":{let s=o?` ${y("dim",o)}`:"",a=e?y("gray",Z):"";return`${n}${a}${s}`}case"cancel":{let s=o?` ${y(["strikethrough","dim"],o)}`:"",a=e?y("gray",Z):"";return`${n}${a}${s}${o.trim()?`
345
+ ${a}`:""}`}default:{let s=e?`${y("cyan",Z)} `:"",a=e?y("cyan",_t):"";return`${n}${s}${r}
344
346
  ${a}
345
- `}}}}).prompt();he();yr();Fn();var Qz={brain:["text"],voice:["stt","tts"],memory:["embedding"]},mI=["brain","voice","memory"],Hg="brain",eL=["text","stt","tts","embedding"];function tL(t){return t==="text"}function gI(t){let e=new Set;for(let n of t)for(let i of Qz[n])e.add(i);return eL.filter(n=>e.has(n))}function vI(t){let e=["brain"],n=t.routes;return(n?.stt||n?.tts)&&e.push("voice"),n?.embedding&&e.push("memory"),e}function yI(t,e){if(e==="valid")return[];let n=tL(t);return e==="invalid"?n?["retry","change"]:["retry","change","skip"]:n?["save","retry","change"]:["save","retry","change","skip"]}function _I(t){let e={},n={};for(let r of t.routes){let o=t.existing.routes?.[r.capability],s=o?.provider===r.provider,a=r.voiceId??(s?o.voiceId:void 0);e[r.capability]={provider:r.provider,model:r.model,...s&&o.url!==void 0&&{url:o.url},...a!==void 0&&{voiceId:a}};let c=t.keys.get(r.provider),u=t.existing.secrets?.[r.provider];c!==void 0&&c.length>0?n[r.provider]=c:c===void 0&&u!==void 0&&(n[r.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(n).length>0&&(i.secrets=n),i}function bI(t,e){return!!t.isTTY&&!!e.isTTY}var xo=class extends Error{},$I={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"}},Bc=class{config;probe;io;stdin;stdout;constructor(e){this.config=e.config,this.probe=e.probe,this.io=e.io??ce,this.stdin=e.stdin??process.stdin,this.stdout=e.stdout??process.stdout}async run(){if(!bI(this.stdin,this.stdout))return this.printHeadlessGuidance(),1;try{return await this.wizard()}catch(e){if(e instanceof xo)return cI("no changes written."),130;throw e}}loadExisting(){try{return{config:this.config.resolved(),corrupt:!1}}catch{return{config:vr.parse({}),corrupt:!0}}}async wizard(){let{config:e,corrupt:n}=this.loadExisting(),i=!n&&!!(e.routes??e.secrets);uI(N.bold("jarvis init")),n&&xe.warn("the existing config.json is invalid; init will replace it with a fresh config."),Wg(`Writes ${N.accent(Ge.resolve("config.json"))} (owner-only).`+(i?`
346
- A config already exists - values are prefilled; edit or keep them.`:""),"setup");let r=await this.pickCapabilities(e),o=new Map,s=[];for(let d of gI(r)){let h=await this.configureCapability(d,e,o);h&&s.push(h)}let a=this.ensure(await Wn({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})),c=this.ensure(await Wn({message:"Log level",options:["debug","info","warn","error"].map(d=>({value:d,label:d})),initialValue:e.defaults.logLevel}));if(this.review(s,o,a,c),!this.ensure(await Zc({message:"Write this configuration?"})))throw new xo;return this.config.write(_I({existing:e,routes:s,keys:o,modality:a,logLevel:c})),xe.success(`wrote ${Ge.resolve("config.json")}`),await Zc({message:"Start Jarvis now?",initialValue:!1})===!0&&xe.info("starting is not wired yet in v0.1 - run `jarvis` to begin a session."),lI(N.ok("done.")),0}async pickCapabilities(e){let n=this.ensure(await dI({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:vI(e),required:!1}));n.includes(Hg)||xe.warn("Brain (text) is required; keeping it selected.");let i=new Set(n);return i.add(Hg),mI.filter(r=>i.has(r))}async configureCapability(e,n,i){let r=this.probe.providersFor(e);if(r.length===0)return xe.warn(`no providers available for ${e}; skipping.`),null;for(;;){let o=await this.pickProvider(e,r,n);if(!this.probe.requiresKey(o))xe.info(`${o} needs no API key (a self-hosted server).`);else if(!i.has(o)){let c=await this.resolveKey(e,o,n,i);if(c==="change-provider")continue;if(c==="skip")return null}let s=await this.pickModel(e,o,n),a=await this.maybePickVoice(e,o,n,i);return{capability:e,provider:o,model:s,...a!==void 0&&{voiceId:a}}}}async resolveKey(e,n,i,r){let o=await this.firstKey(n,i);for(;;){let s=await this.validateKey(n,o);if(s==="valid")return r.set(n,o),"keyed";let a=await this.pickAfterFailure(e,s);if(a==="save")return r.set(n,o),"keyed";if(a==="skip")return xe.info(`skipped ${e} (optional).`),"skip";if(a==="change")return"change-provider";o=await this.promptPassword(n)}}async maybePickVoice(e,n,i,r){if(e!=="tts")return;let o=r.get(n);if(o===void 0)return;let s=await this.probe.listVoices(n,o);if(!s.ok){this.reportVoiceListFailure(n,s.reason,s.detail);return}let a=s.voices,c=i.routes?.tts,u=c?.provider===n?c.voiceId:void 0,l=f=>f!==void 0&&a.some(p=>p.voiceId===f),d=u!==void 0&&!l(u)?null:[u,ac].find(l)??a[0].voiceId;return this.ensure(await Wn({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,n,i){if(n!=="no_catalogue")if(n==="unauthorized")xe.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(n==="empty")xe.warn(`the ${e} voice catalogue came back empty; keeping the current voice.`);else{let r=i?` (${i})`:"";xe.warn(`couldn't fetch the ${e} voice list${r}; keeping the current voice.`)}}async pickProvider(e,n,i){let r=i.routes?.[e]?.provider;return this.ensure(await Wn({message:`${e} provider`,options:n.map(o=>({value:o,label:o})),initialValue:r&&n.includes(r)?r:void 0}))}async pickModel(e,n,i){let r=i.routes?.[e],o=r?.provider===n?r.model:this.probe.defaultModel(n,e)??"";return this.ensure(await pI({message:`${e} model`,initialValue:o,validate:s=>s?.trim()?void 0:"a model is required"}))}async firstKey(e,n){let i=n.secrets?.[e];return i&&this.ensure(await Zc({message:`Reuse the saved key for ${e}?`,initialValue:!0}))?i.trim():this.promptPassword(e)}async promptPassword(e){return this.ensure(await hI({message:`${e} API key`,validate:i=>i?.trim()?void 0:"a key is required"})).trim()}async validateKey(e,n){let i=fI();i.start(`validating ${e} key...`);let r=await this.probe.probe(e,n),o=r.detail?` (${r.detail})`:"";return r.ok?i.stop(N.ok(`${e} key valid`)):r.status==="invalid"?i.stop(N.fail(`${e} key rejected${o}`)):r.status==="unverifiable"?i.stop(N.warn(`could not verify ${e} here${o}`)):i.stop(N.warn(`could not validate ${e}${o}`)),r.status}async pickAfterFailure(e,n){let i=yI(e,n);return this.ensure(await Wn({message:`${e}: how do you want to proceed?`,options:i.map(r=>({value:r,label:$I[r].label,hint:$I[r].hint}))}))}review(e,n,i,r){let o=[];if(e.length===0)o.push("routes: none");else for(let s of e){let a=n.has(s.provider)?N.ok("key set"):N.warn("no key"),c=s.voiceId!==void 0?`, voice ${s.voiceId}`:"";o.push(`${s.capability}: ${s.provider}/${s.model} (${a}${c})`)}o.push(`defaults: modality=${i}, logLevel=${r}`),Wg(o.join(`
347
+ `}}}}).prompt();he();$r();Mr();var hM={brain:["text"],voice:["stt","tts"],memory:["embedding"]},$I=["brain","voice","memory"],Kg="brain",fM=["text","stt","tts","embedding"];function pM(t){return t==="text"}function xI(t){let e=new Set;for(let n of t)for(let i of hM[n])e.add(i);return fM.filter(n=>e.has(n))}function wI(t){let e=["brain"],n=t.routes;return(n?.stt||n?.tts)&&e.push("voice"),n?.embedding&&e.push("memory"),e}function SI(t,e){if(e==="valid")return[];let n=pM(t);return e==="invalid"?n?["retry","change"]:["retry","change","skip"]:n?["save","retry","change"]:["save","retry","change","skip"]}function EI(t){let e={},n={};for(let r of t.routes){let o=t.existing.routes?.[r.capability],s=o?.provider===r.provider,a=r.voiceId??(s?o.voiceId:void 0);e[r.capability]={provider:r.provider,model:r.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(r.provider),u=t.existing.secrets?.[r.provider];c!==void 0&&c.length>0?n[r.provider]=c:c===void 0&&u!==void 0&&(n[r.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(n).length>0&&(i.secrets=n),i}function II(t,e){return!!t.isTTY&&!!e.isTTY}var Io=class extends Error{},kI={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"}},qc=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??ne,this.stdin=e.stdin??process.stdin,this.stdout=e.stdout??process.stdout}async run(){if(!II(this.stdin,this.stdout))return this.printHeadlessGuidance(),1;try{return await this.wizard()}catch(e){if(e instanceof Io)return pI("no changes written."),130;throw e}}loadExisting(){try{return{config:this.config.resolved(),corrupt:!1}}catch{return{config:br.parse({}),corrupt:!0}}}async wizard(){let{config:e,corrupt:n}=this.loadExisting(),i=!n&&!!(e.routes??e.secrets);mI(R.bold("jarvis init")),n&&me.warn("the existing config.json is invalid; init will replace it with a fresh config."),Jg(`Writes ${R.accent(ze.resolve("config.json"))} (owner-only).`+(i?`
348
+ A config already exists - values are prefilled; edit or keep them.`:""),"setup");let r=await this.pickCapabilities(e),o=r.includes("voice"),s=new Map,a=[];for(let h of xI(r)){let f=await this.configureCapability(h,e,s,o);f&&a.push(f)}let c=this.ensure(await Br({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 Br({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 Hc({message:"Write this configuration?"})))throw new Io;return this.config.write(EI({existing:e,routes:a,keys:s,modality:c,logLevel:u})),me.success(`wrote ${ze.resolve("config.json")}`),await Hc({message:"Start Jarvis now?",initialValue:!1})===!0&&me.info("starting is not wired yet in v0.1 - run `jarvis` to begin a session."),gI(R.ok("done.")),0}async pickCapabilities(e){let n=this.ensure(await vI({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:wI(e),required:!1}));n.includes(Kg)||me.warn("Brain (text) is required; keeping it selected.");let i=new Set(n);return i.add(Kg),$I.filter(r=>i.has(r))}async configureCapability(e,n,i,r){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,n);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,n,i);if(u==="change-provider")continue;if(u==="skip")return null}let a=await this.pickModel(e,s,n,i,r),c=await this.maybePickVoice(e,s,n,i);return{capability:e,provider:s,model:a,...c!==void 0&&{voiceId:c}}}}async resolveKey(e,n,i,r){let o=await this.firstKey(n,i);for(;;){let s=await this.validateKey(n,o);if(s==="valid")return r.set(n,o),"keyed";let a=await this.pickAfterFailure(e,s);if(a==="save")return r.set(n,o),"keyed";if(a==="skip")return me.info(`skipped ${e} (optional).`),"skip";if(a==="change")return"change-provider";o=await this.promptPassword(n)}}async maybePickVoice(e,n,i,r){if(e!=="tts")return;let o=r.get(n);if(o===void 0)return;let s=await this.probe.listVoices(n,o);if(!s.ok){this.reportVoiceListFailure(n,s.reason,s.detail);return}let a=s.voices,c=i.routes?.tts,u=c?.provider===n?c.voiceId:void 0,l=f=>f!==void 0&&a.some(p=>p.voiceId===f),d=u!==void 0&&!l(u)?null:[u,dc].find(l)??a[0].voiceId;return this.ensure(await Br({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,n,i){if(n!=="no_catalogue")if(n==="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(n==="empty")me.warn(`the ${e} voice catalogue came back empty; keeping the current voice.`);else{let r=i?` (${i})`:"";me.warn(`couldn't fetch the ${e} voice list${r}; keeping the current voice.`)}}async pickProvider(e,n,i){let r=i.routes?.[e]?.provider;return this.ensure(await Br({message:`${e} provider`,options:n.map(o=>({value:o,label:o})),initialValue:r&&n.includes(r)?r:void 0}))}async pickModel(e,n,i,r,o){let s=i.routes?.[e],a=s?.provider===n?s.model:void 0,c=a!==void 0&&a.trim().length>0?a:void 0,u=c??this.probe.defaultModel(n,e)??"",l=r.get(n),d=this.catalogue?await this.catalogue.models(n,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(w=>w.id)),f=e==="text"&&o&&d.recommendedFast!==void 0&&h.has(d.recommendedFast),p=f?d.recommendedFast:d.recommended,_=(w,k)=>{let z=[];return k!==void 0&&z.push(k),w===p&&z.push(f?"recommended for voice":"recommended"),w===c&&z.push("current"),z.length>0?z.join(", "):void 0},$=d.models.map(w=>{let k=_(w.id,w.label);return{value:w.id,label:w.id,...k!==void 0&&{hint:k}}});c!==void 0&&!h.has(c)&&$.push({value:c,label:c,hint:"current, not in the fetched list"}),$.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 I=c??(p!==void 0&&h.has(p)?p:d.models[0].id),A=this.ensure(await Br({message:`${e} model`,options:$,initialValue:I}));if(A!==null)return A;let O=await this.editModelId(e,u);return h.has(O)||me.warn(`'${O}' is not in ${n}'s current list - saving anyway`),O}async editModelId(e,n){return this.ensure(await bI({message:`${e} model`,initialValue:n,validate:i=>i?.trim()?void 0:"a model is required"}))}async firstKey(e,n){let i=n.secrets?.[e];return i&&this.ensure(await Hc({message:`Reuse the saved key for ${e}?`,initialValue:!0}))?i.trim():this.promptPassword(e)}async promptPassword(e){return this.ensure(await yI({message:`${e} API key`,validate:i=>i?.trim()?void 0:"a key is required"})).trim()}async validateKey(e,n){let i=_I();i.start(`validating ${e} key...`);let r=await this.probe.probe(e,n),o=r.detail?` (${r.detail})`:"";return r.ok?i.stop(R.ok(`${e} key valid`)):r.status==="invalid"?i.stop(R.fail(`${e} key rejected${o}`)):r.status==="unverifiable"?i.stop(R.warn(`could not verify ${e} here${o}`)):i.stop(R.warn(`could not validate ${e}${o}`)),r.status}async pickAfterFailure(e,n){let i=SI(e,n);return this.ensure(await Br({message:`${e}: how do you want to proceed?`,options:i.map(r=>({value:r,label:kI[r].label,hint:kI[r].hint}))}))}review(e,n,i,r){let o=[];if(e.length===0)o.push("routes: none");else for(let s of e){let a=n.has(s.provider)?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=${r}`),Jg(o.join(`
347
349
  `),"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(`
348
350
  `)+`
349
- `)}ensure(e){if(Mc(e))throw new xo;return e}};zi();import{randomUUID as rL}from"node:crypto";var qg=class{constructor(e,n,i=ce){this.session=e;this.reader=n;this.io=i}session;reader;io;prompt="you ";labelShown=!1;async run(){try{for await(let e of this.session.events())if(!await this.handle(e))break}finally{this.reader.close(),await this.session.close()}}async handle(e){switch(e.type){case"session.ready":return this.greet(),this.promptAndSend();case"turn.accepted":return this.labelShown=!1,!0;case"state":return e.state==="responding"&&this.showLabel(),!0;case"response.delta":return this.showLabel(),this.io.out(e.text),!0;case"response.done":return this.labelShown&&this.io.out(`
351
+ `)}ensure(e){if(Zc(e))throw new Io;return e}};var mM=["text","stt","tts","embedding"],Jc=class{config;catalogue;probe;io;constructor(e){this.config=e.config,this.catalogue=e.catalogue,this.probe=e.probe,this.io=e.io??ne}async run(e={}){let n;try{n=this.config.resolved()}catch(s){return this.io.err(`error: ${vM(s)}
352
+ `),1}let i=n.routes??{},r=[];for(let s of mM){let a=i[s];a!==void 0&&r.push({capability:s,route:a})}if(r.length===0)return this.io.out("no routes configured - run `jarvis init` to set up providers.\n"),0;this.io.out(`
353
+ ${R.bold("jarvis models")}
354
+
355
+ `);let o=new Map;if(e.refresh===!0){let s=[...new Set(r.map(({route:c})=>c.provider))],a=!1;for(let c of s){let u=n.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 ${TI(l.cached.cacheAgeMs)} ago`:"",h=gM(l.detail,n.secrets);this.io.out(`${R.warn(`could not refresh ${c} (${h})${d}`)}
356
+ `)}}a&&this.io.out(`
357
+ `)}for(let{capability:s,route:a}of r){let c=await this.choicesFor(s,a,n,o);this.render(s,a.provider,c)}return 0}async choicesFor(e,n,i,r){let o=n.provider,s,a,c=r.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 h=i.secrets?.[o],f=await this.catalogue.models(o,e,{...h!==void 0&&{key:h}});f.source!=="prefill"&&(s=f.models,f.source==="cache"&&(a=f.cacheAgeMs))}let u=s!==void 0;if(s===void 0){let h=this.probe.defaultModel(o,e);s=h===void 0?[]:[{id:h}]}let l=this.probe.defaultModel(o,e),d=s.map(h=>({id:h.id,...h.label!==void 0&&{label:h.label},markers:[...h.id===l?["recommended"]:[],...h.id===n.model?["configured"]:[]]}));return s.some(h=>h.id===n.model)||d.push({id:n.model,markers:[u?`configured, not in ${o}'s current list`:"configured"]}),{rows:d,...a!==void 0&&{cacheAgeMs:a}}}render(e,n,i){this.io.out(`${R.bold(e)}: ${R.accent(n)}
358
+ `);let r=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(r)} ${s.join(" ")}`:o.id;this.io.out(` ${a}
359
+ `)}i.cacheAgeMs!==void 0&&i.cacheAgeMs>=6e4&&this.io.out(` ${R.dim(`(cached ${TI(i.cacheAgeMs)} ago)`)}
360
+ `),this.io.out(`
361
+ `)}};function gM(t,e){let n=t;for(let i of Object.values(e??{}))for(let r of new Set([i,i.trim()]))r.length>0&&(n=n.split(r).join("<redacted>"));return n.replace(/\s+/g," ").trim()}function TI(t){let e=Math.floor(t/6e4);if(e<1)return"moments";if(e<60)return`${e}m`;let n=Math.floor(e/60);return n<24?`${n}h`:`${Math.floor(n/24)}d`}function vM(t){return t instanceof Error?t.message:String(t)}Ui();import{randomUUID as yM}from"node:crypto";var Yg=class{constructor(e,n,i=ne){this.session=e;this.reader=n;this.io=i}session;reader;io;prompt="you ";labelShown=!1;async run(){try{for await(let e of this.session.events())if(!await this.handle(e))break}finally{this.reader.close(),await this.session.close()}}async handle(e){switch(e.type){case"session.ready":return this.greet(),this.promptAndSend();case"turn.accepted":return this.labelShown=!1,!0;case"state":return e.state==="responding"&&this.showLabel(),!0;case"response.delta":return this.showLabel(),this.io.out(e.text),!0;case"response.done":return this.labelShown&&this.io.out(`
350
362
  `),this.promptAndSend();case"error":return this.labelShown&&this.io.out(`
351
- `),this.renderError(e),this.promptAndSend();default:return!0}}async promptAndSend(){for(;;){let e=await this.reader.next(this.prompt);if(e===null)return!1;let n=e.trim();if(n.length!==0)try{return await this.session.send({type:"input.text",sessionId:this.session.sessionId,commandId:rL(),atMs:Date.now(),text:n}),!0}catch(i){if(i instanceof Ue){if(i.reason==="closed")return!1;this.renderSendError(i);continue}throw i}}}greet(){this.io.out(N.dim("jarvis is ready. type a message, or press ctrl-c to exit.")+`
352
- `)}showLabel(){this.labelShown||(this.io.out(N.dim("jarvis")+" "),this.labelShown=!0)}renderError(e){if(e.reason==="no_text_route"){this.io.out(N.warn("no brain configured yet - run `jarvis init` to add one.")+`
353
- `);return}this.io.out(N.fail(`something went wrong - ${e.message}`)+`
354
- `)}renderSendError(e){this.io.out(N.warn(`could not send that (${e.reason}) - ${e.message}`)+`
355
- `)}};async function xI(t){if(!t.stdin.isTTY)return t.io.err(N.dim("jarvis is interactive - run it in a terminal.")+`
356
- `),1;let e;try{e=await t.openSession()}catch{return t.io.err(N.fail("could not start jarvis - your config may be invalid. run `jarvis doctor`.")+`
357
- `),1}let n=t.createReader();return await new qg(e,n,t.io).run(),0}import{createInterface as nL}from"node:readline";var Gc=class{rl;closed=!1;pending=null;constructor(e,n){this.rl=nL({input:e,output:n}),this.rl.on("line",i=>this.settle(i)),this.rl.on("close",()=>{this.closed=!0,this.settle(null)}),this.rl.on("SIGINT",()=>this.close())}next(e){return this.closed?Promise.resolve(null):new Promise(n=>{this.pending=n,this.rl.setPrompt(e),this.rl.prompt()})}close(){this.closed||(this.closed=!0,this.rl.close())}settle(e){let n=this.pending;this.pending=null,n?.(e)}};Fn();var Hn=class extends Error{constructor(e){super(e),this.name="AudioUnavailableError"}};function wI(t){let e=t.routes?.stt,n=t.routes?.tts;if(!e||!n)return!1;let i=r=>!!t.secrets?.[r]||!kr(r);return i(e.provider)&&i(n.provider)}async function SI(t){if(!t.stdin.isTTY)return t.io.err(N.dim("jarvis is interactive - run it in a terminal.")+`
358
- `),1;if(t.textOnly||!t.voiceConfigured)return t.runText();if(!await t.micAvailable())return t.io.err(N.warn("no microphone detected - check it is plugged in and mic access / privacy is enabled. starting in text mode.")+`
359
- `),t.runText();let e;try{e=await t.openVoiceSession()}catch{return t.io.err(N.fail("could not start jarvis - your config may be invalid. run `jarvis doctor`.")+`
360
- `),1}try{return await t.runVoice(e),0}catch(n){if(n instanceof Hn)return t.io.err(N.warn("could not start the microphone - check mic access / privacy. starting in text mode.")+`
361
- `),t.runText();throw n}}import{randomUUID as Xg}from"node:crypto";function Jg({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 iL=Jg();function Kg(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(iL,"")}var EI=[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],II=12288,kI=65510,TI=[12288,12288,65281,65376,65504,65510];var AI=4352,OI=262141,Yg=[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 Wc=(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 PI=19968,[aL,cL]=uL(Yg);function uL(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(PI>=r&&PI<=o)return[r,o];o-r>n-e&&(e=r,n=o)}return[e,n]}var CI=t=>t<161||t>1114109?!1:Wc(EI,t),RI=t=>t<II||t>kI?!1:Wc(TI,t);var DI=t=>t>=aL&&t<=cL?!0:t<AI||t>OI?!1:Wc(Yg,t);function lL(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function wo(t,{ambiguousAsWide:e=!1}={}){return lL(t),RI(t)||DI(t)||e&&CI(t)?2:1}var dL=new Intl.Segmenter,NI=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Mark}|\p{Surrogate})+$/v,hL=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,fL=/^\p{RGI_Emoji}$/v,pL=/^[\d#*]\u20E3$/,mL=/\p{Extended_Pictographic}/gu;function gL(t){if(t.length>50)return!1;if(pL.test(t))return!0;if(t.includes("\u200D")){let e=t.match(mL);return e!==null&&e.length>=2}return!1}function vL(t){return t.replace(hL,"")}function yL(t){return NI.test(t)}function zI(t){return t>=4352&&t<=4447||t>=43360&&t<=43388}function LI(t){return t>=4448&&t<=4519||t>=55216&&t<=55238}function UI(t){return t>=4520&&t<=4607||t>=55243&&t<=55291}function _L(t){return zI(t)||LI(t)||UI(t)}function bL(t,e){let n=[];for(let r of t)NI.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(!_L(o)){if(i===0)return;for(let s=r;s<n.length;s++)i+=wo(n[s],e);return i}if(zI(o)&&LI(n[r+1])){i+=2,r+=UI(n[r+2])?2:1;continue}i+=wo(o,e)}return i}function $L(t,e){let n=0,i=!0;for(let r of t){if(i){i=!1;continue}r>="\uFF00"&&r<="\uFFEF"&&(n+=wo(r.codePointAt(0),e))}return n}function Hc(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=Kg(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 dL.segment(r)){if(yL(a))continue;if(fL.test(a)||gL(a)){o+=2;continue}let c=vL(a),u=bL(c,s);if(u!==void 0){o+=u;continue}let l=c.codePointAt(0);o+=wo(l,s),o+=$L(c,s)}return o}zi();he();var qc=class{now;refRing=new Float32Array(4096);sessionGain=2;sessionDelayMs;gain=2;delayMs;corr;frozen=!1;micHops=[];refObserved=!1;inExceed=!1;exceedRunMs=0;calmRunMs=0;closest;closestOffsetMs;replyMicStartMs;windowExceedMs=0;ratioP10;ratioP90;onsetVetoes=0;onsetVetoesInGap=0;residRatios=[];suppressedRunFrames=0;sessionProven=!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.corr=void 0,this.refObserved=!1,this.inExceed=!1,this.exceedRunMs=0,this.calmRunMs=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.residualSeen=!1,this.suppressedRunFrames=0}ingestReference(e,n){e.byteLength<2||(this.refObserved=!0,MI(e,n,(i,r)=>{let o=So(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.micHops.length<200&&MI(e,s,(b,E)=>{this.micHops.length<200&&this.micHops.push({slot:b,rms:E})}),this.micHops.length>=80&&this.tryFreeze());let c=this.alignedRefMax(s,n),u=i??null,l=u!==null&&u.length>0?wL(u):null;l!==null&&(this.residualSeen=!0);let d=l!==null&&this.residualConverged,h=EL(e),f=d&&l!==null?l:h,p=d?.01:Math.max(.01,this.gain*c*2),_=this.exceedanceArmed&&f>p;if(u!==null&&l!==null&&!_&&!this.inExceed){if(this.frozen&&this.delayMs!==void 0){let b=Math.round(this.delayMs/20);SL(u,s,(E,C)=>{let A=this.refRing[So(E-b)];A<.005||(this.residRatios.push(C/A),this.residRatios.length>120&&this.residRatios.shift())})}if(c>=.005&&h>.02){let b=l/h<=.25&&l<=.01;this.suppressedRunFrames=b?this.suppressedRunFrames+1:0,this.suppressedRunFrames>=40&&(this.sessionProven=!0)}}if(this.exceedanceArmed){let b=f/p;(this.closest===void 0||b>this.closest)&&(this.closest=b,this.closestOffsetMs=n-this.replyMicStartMs),a&&_&&(this.windowExceedMs+=o)}return this.applyVerdict(_,o,d?150:64)}get exceedanceArmed(){return this.refObserved&&this.gain>.02}shouldFireOnSpeechOnset(){if(!this.exceedanceArmed)return!0;let e=this.now(),n=this.alignedRefMax(e,e),i=this.gain*n*2<=.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",delayMs:this.delayMs,corr:this.corr,closest:this.closest,closestOffsetMs:this.closestOffsetMs,windowExceedMs:this.windowExceedMs,ratioP10:this.ratioP10,ratioP90:this.ratioP90,onsetVetoes:this.onsetVetoes,onsetVetoesInGap:this.onsetVetoesInGap,fired:e,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}residualGain(){return this.residRatios.length<50?this.gain:Math.min(4,xL(this.residRatios))}get residualConverged(){return this.sessionProven&&this.suppressedRunFrames>=10&&this.residRatios.length>=50&&this.residualGain()<=this.gain/4}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+100:n-i+100,s=0;for(let a=Math.floor(r/20);a<=Math.floor(o/20);a++){let c=this.refRing[So(a)];c>s&&(s=c)}return s}tryFreeze(){let{lag:e,corr:n}=this.bestLag(),i=[];for(let{slot:s,rms:a}of this.micHops){let c=this.refRing[So(s-e)];c>=.005&&i.push(a/c)}if(i.length<25)return;i.sort((s,a)=>s-a);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))],this.frozen=!0,this.sessionGain=this.gain,this.sessionDelayMs=this.delayMs}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:_,rms:b}of this.micHops){let E=this.refRing[So(_-r)];o++,s+=b,a+=E,c+=b*b,u+=E*E,l+=b*E}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 So(t){return(t%4096+4096)%4096}function xL(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 MI(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 wL(t){let e=0;for(let n of t)e+=n*n;return Math.sqrt(e/t.length)}function SL(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 EL(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 Qg(t){return t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}var Eo="\x1B[2K\r",IL=new Intl.Segmenter(void 0,{granularity:"grapheme"}),Jc=class{session;capture;playback;io;terminalWidth;ptt;halfDuplex;signal;phase="listening";echo=new qc;aec;labelShown=!1;partialShown=!1;statusShown=!1;listenEpoch=0;asideActive=!1;turnStats={};talking;currentTurnId;cleanedUp=!1;onAbort=()=>{this.session.close()};constructor(e){this.session=e.session,this.capture=e.capture,this.playback=e.playback,this.io=e.io??ce,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 Hn(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.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:Xg(),atMs:n,audio:e})}catch(i){if(i instanceof Ue&&i.reason==="closed"){this.capture.stop();return}U.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:Xg(),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:Xg(),atMs:Date.now()})}catch{}}handleCaptureError(e){this.cleanedUp||(this.closeOpenLine(),this.io.out(N.fail(`the microphone stopped - ${e.message}`)+`
362
- `),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.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"response.done":if(this.phase!=="responding")return;this.closeOpenLine(),this.turnStats.playbackStartAtMs!==void 0&&this.renderStatus("speaking"),this.awaitPlaybackDrain();return;case"error":{let n=this.currentTurnId;this.playback.flush(),this.aec?.dropQueuedReference(),this.closeOpenLine(),this.renderError(e),this.toListening(),this.cancelTurn(n,"user_cancel");return}default:return}}greet(){let e=this.ptt?"jarvis is ready (push-to-talk). press space to talk, again to send.":"jarvis is listening. just speak.",n=this.halfDuplex?" half-duplex: barge-in is off.":"";this.io.out(N.dim(`${e}${n} press ctrl-c to exit.`)+`
363
- `),this.renderStatus("listening")}renderPartial(e){this.io.out(`${Eo}you ${N.dim(this.clampPartialToOneRow(e))}`),this.partialShown=!0,this.statusShown=!1}clampPartialToOneRow(e){let n=this.visibleColumns()-5;if(Hc(e)<=n)return e;let i=n-3;if(i<=0)return"...";let r=[...IL.segment(e)],o=r.length,s=0;for(;o>0;){let a=s+Hc(r[o-1].segment);if(a>i)break;s=a,o-=1}return o<r.length?"..."+e.slice(r[o].index):"..."}renderFinalUser(e){this.io.out(`${Eo}you ${e.text}
364
- `),this.partialShown=!1,this.statusShown=!1}renderAside(e){this.io.out(`${Eo}${N.dim(`you (aside) ${e.text}`)}
365
- `),this.partialShown=!1,this.statusShown=!1}showLabel(){this.labelShown||(this.eraseStatusLine(),this.io.out(N.dim("jarvis")+" "),this.labelShown=!0)}renderStatus(e){this.partialShown||this.labelShown||(this.io.out(Eo+N.dim(this.statusText(e))),this.statusShown=!0)}statusText(e){if(e!=="listening"||!this.asideActive)return`${e}...`;let n=this.ptt?"listening (aside - press to talk to resume)":'listening (aside - say "Jarvis" to resume)',i=this.visibleColumns();if(n.length<=i)return n;let r="listening (aside)";return r.length<=i?r:`${e}...`}visibleColumns(){let e=this.terminalWidth();return e!==void 0&&e>0?e:80}eraseStatusLine(){this.statusShown&&(this.io.out(Eo),this.statusShown=!1)}renderError(e){if(e.reason==="no_voice_route"){this.io.out(N.warn("no voice configured yet - run `jarvis init` to add speech routes.")+`
366
- `);return}if(e.reason==="no_text_route"){this.io.out(N.warn("no brain configured yet - run `jarvis init` to add one.")+`
367
- `);return}this.io.out(N.fail(`something went wrong - ${e.message}`)+`
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 n=e.trim();if(n.length!==0)try{return await this.session.send({type:"input.text",sessionId:this.session.sessionId,commandId:yM(),atMs:Date.now(),text:n}),!0}catch(i){if(i instanceof je){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
+ `)}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
+ `);return}this.io.out(R.fail(`something went wrong - ${e.message}`)+`
366
+ `)}renderSendError(e){this.io.out(R.warn(`could not send that (${e.reason}) - ${e.message}`)+`
367
+ `)}};async function AI(t){if(!t.stdin.isTTY)return t.io.err(R.dim("jarvis is interactive - run it in a terminal.")+`
368
+ `),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 n=t.createReader();return await new Yg(e,n,t.io).run(),0}import{createInterface as _M}from"node:readline";var Kc=class{rl;closed=!1;pending=null;constructor(e,n){this.rl=_M({input:e,output:n}),this.rl.on("line",i=>this.settle(i)),this.rl.on("close",()=>{this.closed=!0,this.settle(null)}),this.rl.on("SIGINT",()=>this.close())}next(e){return this.closed?Promise.resolve(null):new Promise(n=>{this.pending=n,this.rl.setPrompt(e),this.rl.prompt()})}close(){this.closed||(this.closed=!0,this.rl.close())}settle(e){let n=this.pending;this.pending=null,n?.(e)}};Mr();var Jn=class extends Error{constructor(e){super(e),this.name="AudioUnavailableError"}};function OI(t){let e=t.routes?.stt,n=t.routes?.tts;if(!e||!n)return!1;let i=r=>!!t.secrets?.[r]||!Or(r);return i(e.provider)&&i(n.provider)}async function PI(t){if(!t.stdin.isTTY)return t.io.err(R.dim("jarvis is interactive - run it in a terminal.")+`
370
+ `),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
+ `),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(n){if(n instanceof Jn)return t.io.err(R.warn("could not start the microphone - check mic access / privacy. starting in text mode.")+`
373
+ `),t.runText();throw n}}import{randomUUID as tv}from"node:crypto";function Xg({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 bM=Xg();function Qg(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return!t.includes("\x1B")&&!t.includes("\x9B")?t:t.replace(bM,"")}var CI=[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,DI=[12288,12288,65281,65376,65504,65510];var LI=4352,MI=262141,ev=[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 Yc=(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 zI=19968,[wM,SM]=EM(ev);function EM(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(zI>=r&&zI<=o)return[r,o];o-r>n-e&&(e=r,n=o)}return[e,n]}var UI=t=>t<161||t>1114109?!1:Yc(CI,t),jI=t=>t<RI||t>NI?!1:Yc(DI,t);var FI=t=>t>=wM&&t<=SM?!0:t<LI||t>MI?!1:Yc(ev,t);function IM(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function ko(t,{ambiguousAsWide:e=!1}={}){return IM(t),jI(t)||FI(t)||e&&UI(t)?2:1}var kM=new Intl.Segmenter,VI=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Mark}|\p{Surrogate})+$/v,TM=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,AM=/^\p{RGI_Emoji}$/v,OM=/^[\d#*]\u20E3$/,PM=/\p{Extended_Pictographic}/gu;function CM(t){if(t.length>50)return!1;if(OM.test(t))return!0;if(t.includes("\u200D")){let e=t.match(PM);return e!==null&&e.length>=2}return!1}function RM(t){return t.replace(TM,"")}function NM(t){return VI.test(t)}function ZI(t){return t>=4352&&t<=4447||t>=43360&&t<=43388}function BI(t){return t>=4448&&t<=4519||t>=55216&&t<=55238}function GI(t){return t>=4520&&t<=4607||t>=55243&&t<=55291}function DM(t){return ZI(t)||BI(t)||GI(t)}function LM(t,e){let n=[];for(let r of t)VI.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(!DM(o)){if(i===0)return;for(let s=r;s<n.length;s++)i+=ko(n[s],e);return i}if(ZI(o)&&BI(n[r+1])){i+=2,r+=GI(n[r+2])?2:1;continue}i+=ko(o,e)}return i}function MM(t,e){let n=0,i=!0;for(let r of t){if(i){i=!1;continue}r>="\uFF00"&&r<="\uFFEF"&&(n+=ko(r.codePointAt(0),e))}return n}function Xc(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=Qg(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 kM.segment(r)){if(NM(a))continue;if(AM.test(a)||CM(a)){o+=2;continue}let c=RM(a),u=LM(c,s);if(u!==void 0){o+=u;continue}let l=c.codePointAt(0);o+=ko(l,s),o+=MM(c,s)}return o}Ui();he();var Qc=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,HI(e,n,(i,r)=>{let o=Kn(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&&HI(e,s,(w,k)=>{this.micHops.length<200&&this.micHops.push({slot:w,rms:k})}),this.micHops.length>=80&&this.tryFreeze());let c=this.alignedRefMax(s,n),u=i??null,l=u!==null&&u.length>0?zM(u):null;l!==null&&(this.residualSeen=!0);let d=l!==null&&this.residualConverged,h=qI(e),f=d&&l!==null?l:h,p=this.gain*c*this.margin,_=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>_&&!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 w=Math.round(this.delayMs/20);UM(u,s,(k,z)=>{let U=this.refRing[Kn(k-w)];U<.005||(this.residRatios.push(z/U),this.residRatios.length>120&&this.residRatios.shift())})}if(c>=.005&&h>.02){let w=l/h<=.25&&l<=.01;this.suppressedRunFrames=w?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 w=f/_;(this.closest===void 0||w>this.closest)&&(this.closest=w,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(qI(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?WI(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,WI(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[Kn(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[Kn(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[Kn(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:_,rms:$}of this.micHops){let I=this.refRing[Kn(_-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 Kn(t){return(t%4096+4096)%4096}function WI(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 HI(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 zM(t){let e=0;for(let n of t)e+=n*n;return Math.sqrt(e/t.length)}function UM(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 qI(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 rv(t){return t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}var To="\x1B[2K\r",jM=new Intl.Segmenter(void 0,{granularity:"grapheme"}),eu=class{session;capture;playback;io;terminalWidth;ptt;halfDuplex;signal;phase="listening";echo=new Qc;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 Jn(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:tv(),atMs:n,audio:e})}catch(i){if(i instanceof je&&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:tv(),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:tv(),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"response.done":if(this.phase!=="responding")return;this.closeOpenLine(),this.turnStats.playbackStartAtMs!==void 0&&this.renderStatus("speaking"),this.awaitPlaybackDrain();return;case"error":{let n=this.currentTurnId;this.playback.flush(),this.aec?.dropQueuedReference(),this.closeOpenLine(),this.renderError(e),this.toListening(),this.cancelTurn(n,"user_cancel");return}default:return}}greet(){let e=this.ptt?"jarvis is ready (push-to-talk). press space to talk, again to send.":"jarvis is listening. just speak.",n=this.halfDuplex?" half-duplex: barge-in is off.":"";this.io.out(R.dim(`${e}${n} press ctrl-c to exit.`)+`
375
+ `),this.renderStatus("listening")}renderPartial(e){this.io.out(`${To}you ${R.dim(this.clampPartialToOneRow(e))}`),this.partialShown=!0,this.statusShown=!1}clampPartialToOneRow(e){let n=this.visibleColumns()-5;if(Xc(e)<=n)return e;let i=n-3;if(i<=0)return"...";let r=[...jM.segment(e)],o=r.length,s=0;for(;o>0;){let a=s+Xc(r[o-1].segment);if(a>i)break;s=a,o-=1}return o<r.length?"..."+e.slice(r[o].index):"..."}renderFinalUser(e){this.io.out(`${To}you ${e.text}
376
+ `),this.partialShown=!1,this.statusShown=!1}renderAside(e){this.io.out(`${To}${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(To+R.dim(this.statusText(e))),this.statusShown=!0)}statusText(e){if(e!=="listening"||!this.asideActive)return`${e}...`;let n=this.ptt?"listening (aside - press to talk to resume)":'listening (aside - say "Jarvis" to resume)',i=this.visibleColumns();if(n.length<=i)return n;let r="listening (aside)";return r.length<=i?r:`${e}...`}visibleColumns(){let e=this.terminalWidth();return e!==void 0&&e>0?e:80}eraseStatusLine(){this.statusShown&&(this.io.out(To),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
+ `);return}if(e.reason==="no_text_route"){this.io.out(R.warn("no brain configured yet - run `jarvis init` to add one.")+`
379
+ `);return}this.io.out(R.fail(`something went wrong - ${e.message}`)+`
368
380
  `)}closeOpenLine(){if(this.labelShown||this.partialShown){this.io.out(`
369
- `),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(U.getLevel()!=="debug")return;let{finalAtMs:e,firstTokenAtMs:n,firstAudioAtMs:i,playbackStartAtMs:r}=this.turnStats,o=[];e!==void 0&&n!==void 0&&o.push(`commit->token ${Qg(n-e)}`),n!==void 0&&i!==void 0&&o.push(`token->audio ${Qg(i-n)}`),r!==void 0&&o.push(`spoke ${Qg(Date.now()-r)}`),o.length!==0&&(this.eraseStatusLine(),this.io.out(N.dim(`turn ${o.join(", ")}`)+`
370
- `))}printEchoSummary(e){if(U.getLevel()!=="debug"||!e.refObserved)return;let n=[`gain ${e.gain.toFixed(2)} ${e.gainSource}`];if(n.push(e.delayMs===void 0?"delay unlearned":`delay ${Math.round(e.delayMs)}ms`),e.corr!==void 0&&n.push(`corr ${e.corr.toFixed(2)}`),e.ratioP10!==void 0&&e.ratioP90!==void 0&&n.push(`ratio ${e.ratioP10.toFixed(2)}-${e.ratioP90.toFixed(2)}`),e.closest!==void 0&&e.closestOffsetMs!==void 0&&n.push(`closest ${e.closest.toFixed(2)}x@${(e.closestOffsetMs/1e3).toFixed(1)}s`),n.push(`window-exceed ${Math.round(e.windowExceedMs)}ms`),n.push(`onset-veto ${e.onsetVetoes} (${e.onsetVetoesInGap} gap)`),e.aec){let i=e.aec.converged?"converged":"converging";n.push(`aec on (${i}, resid ${e.aec.residualGain.toFixed(2)})`)}else this.aec&&n.push(`aec off (${this.aec.status()})`);n.push(e.fired===void 0?"no barge":`barge (${e.fired})`),this.eraseStatusLine(),this.io.out(N.dim(`echo ${n.join(", ")}`)+`
371
- `)}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 FI=16e3,Kc=16,sr=160,kL=120*FI,TL=1e3,Yc=class{load;log;state="idle";startPromise=null;aec=null;closed=!1;refQueue=[];refQueuedSamples=0;cursorSample=null;pendingMic=new Float32Array(0);constructor(e={}){this.load=e.load??AL,this.log=e.log??U}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(FI,1,1),this.state="active"}catch(e){this.fail(e)}}ingestReference(e,n){if(!(this.closed||this.state==="unavailable")&&!(e.byteLength<2))for(this.refQueue.push({startSample:Math.round(n*Kc),samples:jI(e)}),this.refQueuedSamples+=e.byteLength>>1;this.refQueuedSamples>kL&&this.refQueue.length>1;)this.refQueuedSamples-=this.refQueue[0].samples.length,this.refQueue.shift()}process(e,n){if(this.closed||this.state!=="active"||this.aec===null)return null;let i=e.byteLength>>1;if(i===0)return null;let r=Math.round((n-i/Kc)*Kc);if(this.cursorSample===null)this.cursorSample=r;else{let c=this.cursorSample+this.pendingMic.length;Math.abs(r-c)>TL*Kc&&(this.pendingMic=new Float32Array(0),this.cursorSample=r)}let o=OL(this.pendingMic,jI(e)),s=Math.floor(o.length/sr);if(s===0)return this.pendingMic=o,null;let a=[];try{for(let c=0;c<s;c++){let u=o.subarray(c*sr,(c+1)*sr),l=this.readReference(this.cursorSample+c*sr);this.aec.analyze([l]);let d=this.aec.processSize([u]),h=new Float32Array(d);this.aec.process([h],[u]),a.push(h)}}catch(c){return this.fail(c),null}return this.pendingMic=o.slice(s*sr),this.cursorSample+=s*sr,this.dropConsumedReference(),a.length===1?a[0]:PL(a)}dropQueuedReference(){this.refQueue.length=0,this.refQueuedSamples=0}status(){return this.state}close(){this.closed=!0,this.dropQueuedReference(),this.pendingMic=new Float32Array(0),this.freeInstance()}readReference(e){let n=new Float32Array(sr),i=e+sr;for(let r of this.refQueue){if(r.startSample>=i)break;let o=r.startSample+r.samples.length;if(o<=e)continue;let s=Math.max(e,r.startSample),a=Math.min(i,o);for(let c=s;c<a;c++){let u=r.samples[c-r.startSample],l=c-e;Math.abs(u)>Math.abs(n[l])&&(n[l]=u)}}return n}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 AL(){let t=await import("@ennuicastr/webrtcaec3.js");return("default"in t?t.default:t)()}function jI(t){let e=t.byteLength>>1,n=new DataView(t.buffer,t.byteOffset,t.byteLength),i=new Float32Array(e);for(let r=0;r<e;r++)i[r]=n.getInt16(r*2,!0)/32768;return i}function OL(t,e){if(t.length===0)return e;let n=new Float32Array(t.length+e.length);return n.set(t,0),n.set(e,t.length),n}function PL(t){let e=new Float32Array(t.reduce((i,r)=>i+r.length,0)),n=0;for(let i of t)e.set(i,n),n+=i.length;return e}import{emitKeypressEvents as CL}from"node:readline";var Xc=class{constructor(e,n,i=RL){this.input=e;this.onQuit=n;this.prepare=i}input;onQuit;prepare;handlers=null;talking=!1;listening=!1;onKeypress=(e,n)=>{if(n.ctrl&&n.name==="c"){this.onQuit();return}n.name==="space"&&this.toggle()};listen(e){this.listening||(this.listening=!0,this.handlers=e,this.prepare(this.input),this.input.isTTY&&this.input.setRawMode&&this.input.setRawMode(!0),this.input.resume?.(),this.input.on("keypress",this.onKeypress))}close(){this.listening&&(this.listening=!1,this.input.removeListener("keypress",this.onKeypress),this.input.isTTY&&this.input.setRawMode&&this.input.setRawMode(!1),this.input.pause?.(),this.handlers=null)}toggle(){this.talking=!this.talking,this.talking?this.handlers?.onStart():this.handlers?.onEnd()}};function RL(t){CL(t)}var HL={start:"starting...",stop:"stopping...",restart:"restarting...",devices:"listing devices..."};function qL(){try{let t=GL(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 JL(t,e){let n=new Pc(t),i=n.notice();i!==null&&ce.err(`${i}
372
- `),n.isStale(Date.now())&&n.refreshInBackground();let r=!1,o=!1;try{let u=new We().resolved();r=wI(u),o=u.defaults.modality==="text"}catch{}let s=WL(),a=u=>(U.debug("opening interactive session",{project:e.project,capabilities:u}),cg().openSession({deviceId:s,projectId:e.project,clientCapabilities:u})),c=()=>xI({stdin:process.stdin,io:ce,openSession:()=>a(["text"]),createReader:()=>new Gc(process.stdin,process.stdout)});return SI({stdin:process.stdin,io:ce,textOnly:e.textOnly||o,voiceConfigured:r,micAvailable:YL,openVoiceSession:()=>a(["text","audio-in","audio-out"]),runVoice:u=>KL(u,e),runText:c})}async function KL(t,e){let{DecibriCapture:n,DecibriPlayback:i}=await Promise.resolve().then(()=>(nv(),rv)),r=new AbortController,o=e.ptt?new Xc(process.stdin,()=>r.abort()):void 0,s=()=>r.abort();process.once("SIGINT",s);try{await new Jc({session:t,capture:new n,playback:new i,io:ce,echoCanceller:new Yc,...o&&{pushToTalk:o},options:{halfDuplex:e.halfDuplex},signal:r.signal}).run()}finally{process.removeListener("SIGINT",s)}}async function YL(){try{let{hasInputDevice:t}=await Promise.resolve().then(()=>(nv(),rv));return t()}catch(t){return U.debug("audio module unavailable; treating as no microphone",{error:t}),!1}}function XL(t){return{activate:e=>JL(t,e),status:()=>new Nr(t).status(),upgrade:()=>new Nr(t).upgrade(),init:()=>new Bc({config:new We,probe:new Pn}).run(),doctor:()=>new Cc({config:new We,probe:new Pn,version:t}).run(),configList:()=>new Lr(new We).list(),configGet:e=>new Lr(new We).get(e),configSet:(e,n)=>new Lr(new We).set(e,n),configUnset:e=>new Lr(new We).unset(e),stub:e=>(ce.err(`${HL[e]??`${e}: not implemented yet`}
373
- `),0)}}try{let t=qL();process.exitCode=await DS(process.argv.slice(2),t,XL(t))}catch(t){U.error("jarvis failed",{error:t}),process.exitCode=1}
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:n,firstAudioAtMs:i,playbackStartAtMs:r}=this.turnStats,o=[];e!==void 0&&n!==void 0&&o.push(`commit->token ${rv(n-e)}`),n!==void 0&&i!==void 0&&o.push(`token->audio ${rv(i-n)}`),r!==void 0&&o.push(`spoke ${rv(Date.now()-r)}`),o.length!==0&&(this.eraseStatusLine(),this.io.out(R.dim(`turn ${o.join(", ")}`)+`
382
+ `))}printEchoSummary(e){if(j.getLevel()!=="debug"||!e.refObserved)return;let n=[`gain ${e.gain.toFixed(2)} ${e.gainSource}`];if(e.margin>2&&n.push(`margin x${e.margin.toFixed(1)}`),n.push(e.delayMs===void 0?"delay unlearned":`delay ${Math.round(e.delayMs)}ms`),e.corr!==void 0&&n.push(`corr ${e.corr.toFixed(2)}`),e.ratioP10!==void 0&&e.ratioP90!==void 0&&n.push(`ratio ${e.ratioP10.toFixed(2)}-${e.ratioP90.toFixed(2)}`),e.closest!==void 0&&e.closestOffsetMs!==void 0&&n.push(`closest ${e.closest.toFixed(2)}x@${(e.closestOffsetMs/1e3).toFixed(1)}s`),n.push(`window-exceed ${Math.round(e.windowExceedMs)}ms`),e.quietFloor!==void 0&&n.push(`quiet-floor ${e.quietFloor.toFixed(3)}`),n.push(`onset-veto ${e.onsetVetoes} (${e.onsetVetoesInGap} gap)`),e.aec){let o=e.aec.converged?"converged":"converging";n.push(`aec on (${o}, resid ${e.aec.residualGain.toFixed(2)})`)}else this.aec&&n.push(`aec off (${this.aec.status()})`);e.residTrend&&n.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?"+":"";n.push(`${o} (${l}${c.toFixed(1)}ms this reply, ${u}ppm)`)}else n.push(o);Math.abs(i.slewMs)>=.5&&n.push(`slew ${i.slewMs.toFixed(0)}ms`),n.push(`resync ${i.resyncs}`)}let r=e.fired==="exceedance"&&e.firedRead!==void 0?`exceedance ${e.firedRead}`:e.fired;n.push(e.fired===void 0?"no barge":`barge (${r})`),this.eraseStatusLine(),this.io.out(R.dim(`echo ${n.join(", ")}`)+`
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 KI=16e3,bt=16,ur=160,FM=120*KI,VM=1e3,ZM=.1,BM=30,GM=16,WM=.1,HM=500,tu=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??qM,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(KI,1,1),this.state="active"}catch(e){this.fail(e)}}ingestReference(e,n){if(!(this.closed||this.state==="unavailable")&&!(e.byteLength<2))for(this.refQueue.push({startSample:Math.round(n*bt),samples:JI(e)}),this.refQueuedSamples+=e.byteLength>>1;this.refQueuedSamples>FM&&this.refQueue.length>1;)this.refQueuedSamples-=this.refQueue[0].samples.length,this.refQueue.shift()}process(e,n){if(this.closed||this.state!=="active"||this.aec===null)return null;let i=e.byteLength>>1;if(i===0)return null;let r=Math.round((n-i/bt)*bt);if(this.cursorSample===null)this.cursorSample=r,this.anchorSample=r,this.skewEmaMs=0;else{let c=this.cursorSample+this.pendingMic.length,u=(r-c)/bt;if(Math.abs(r-c)>VM*bt)this.pendingMic=new Float32Array(0),this.cursorSample=r,this.anchorSample=r,this.skewEmaMs=0,this.slewSamples=0,this.resyncs++;else{this.skewEmaMs+=ZM*(u-this.skewEmaMs);let l=Math.abs(this.skewEmaMs)-BM;if(l>0){let d=Math.min(GM,Math.max(1,Math.round(l*bt*WM))),h=this.skewEmaMs>0?d:-d;Math.abs(this.slewSamples+h)<=HM*bt&&(this.cursorSample+=h,this.slewSamples+=h,this.skewEmaMs-=h/bt)}}}this.lastStampSample=r+i;let o=JM(this.pendingMic,JI(e)),s=Math.floor(o.length/ur);if(s===0)return this.pendingMic=o,null;let a=[];try{for(let c=0;c<s;c++){let u=o.subarray(c*ur,(c+1)*ur),l=this.readReference(this.cursorSample+c*ur);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*ur),this.cursorSample+=s*ur,this.dropConsumedReference(),a.length===1?a[0]:KM(a)}dropQueuedReference(){this.refQueue.length=0,this.refQueuedSamples=0}diagnostics(){return this.cursorSample===null?null:{skewMs:this.skewEmaMs,sinceAnchorMs:(this.lastStampSample-this.anchorSample)/bt,resyncs:this.resyncs,slewMs:this.slewSamples/bt}}status(){return this.state}close(){this.closed=!0,this.dropQueuedReference(),this.pendingMic=new Float32Array(0),this.freeInstance()}readReference(e){let n=new Float32Array(ur),i=e+ur;for(let r of this.refQueue){if(r.startSample>=i)break;let o=r.startSample+r.samples.length;if(o<=e)continue;let s=Math.max(e,r.startSample),a=Math.min(i,o);for(let c=s;c<a;c++){let u=r.samples[c-r.startSample],l=c-e;Math.abs(u)>Math.abs(n[l])&&(n[l]=u)}}return n}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 qM(){let t=await import("@ennuicastr/webrtcaec3.js");return("default"in t?t.default:t)()}function JI(t){let e=t.byteLength>>1,n=new DataView(t.buffer,t.byteOffset,t.byteLength),i=new Float32Array(e);for(let r=0;r<e;r++)i[r]=n.getInt16(r*2,!0)/32768;return i}function JM(t,e){if(t.length===0)return e;let n=new Float32Array(t.length+e.length);return n.set(t,0),n.set(e,t.length),n}function KM(t){let e=new Float32Array(t.reduce((i,r)=>i+r.length,0)),n=0;for(let i of t)e.set(i,n),n+=i.length;return e}import{emitKeypressEvents as YM}from"node:readline";var ru=class{constructor(e,n,i=XM){this.input=e;this.onQuit=n;this.prepare=i}input;onQuit;prepare;handlers=null;talking=!1;listening=!1;onKeypress=(e,n)=>{if(n.ctrl&&n.name==="c"){this.onQuit();return}n.name==="space"&&this.toggle()};listen(e){this.listening||(this.listening=!0,this.handlers=e,this.prepare(this.input),this.input.isTTY&&this.input.setRawMode&&this.input.setRawMode(!0),this.input.resume?.(),this.input.on("keypress",this.onKeypress))}close(){this.listening&&(this.listening=!1,this.input.removeListener("keypress",this.onKeypress),this.input.isTTY&&this.input.setRawMode&&this.input.setRawMode(!1),this.input.pause?.(),this.handlers=null)}toggle(){this.talking=!this.talking,this.talking?this.handlers?.onStart():this.handlers?.onEnd()}};function XM(t){YM(t)}var hz={start:"starting...",stop:"stopping...",restart:"restarting...",devices:"listing devices..."};function fz(){try{let t=lz(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 pz(t,e){let n=new Dc(t),i=n.notice();i!==null&&ne.err(`${i}
384
+ `),n.isStale(Date.now())&&n.refreshInBackground();let r=!1,o=!1;try{let u=new Ue().resolved();r=OI(u),o=u.defaults.modality==="text"}catch{}let s=dz(),a=u=>(j.debug("opening interactive session",{project:e.project,capabilities:u}),dg().openSession({deviceId:s,projectId:e.project,clientCapabilities:u})),c=()=>AI({stdin:process.stdin,io:ne,openSession:()=>a(["text"]),createReader:()=>new Kc(process.stdin,process.stdout)});return PI({stdin:process.stdin,io:ne,textOnly:e.textOnly||o,voiceConfigured:r,micAvailable:gz,openVoiceSession:()=>a(["text","audio-in","audio-out"]),runVoice:u=>mz(u,e),runText:c})}async function mz(t,e){let{DecibriCapture:n,DecibriPlayback:i}=await Promise.resolve().then(()=>(sv(),ov)),r=new AbortController,o=e.ptt?new ru(process.stdin,()=>r.abort()):void 0,s=()=>r.abort();process.once("SIGINT",s);try{await new eu({session:t,capture:new n,playback:new i,io:ne,echoCanceller:new tu,...o&&{pushToTalk:o},options:{halfDuplex:e.halfDuplex},signal:r.signal}).run()}finally{process.removeListener("SIGINT",s)}}async function gz(){try{let{hasInputDevice:t}=await Promise.resolve().then(()=>(sv(),ov));return t()}catch(t){return j.debug("audio module unavailable; treating as no microphone",{error:t}),!1}}function vz(t){return{activate:e=>pz(t,e),status:()=>new Ur(t).status(),upgrade:()=>new Ur(t).upgrade(),init:()=>new qc({config:new Ue,probe:new Ar,catalogue:new Ct}).run(),doctor:()=>new Lc({config:new Ue,probe:new Ar,version:t}).run(),models:e=>new Jc({config:new Ue,catalogue:new Ct,probe:new Ar}).run(e),configList:()=>new Fr(new Ue).list(),configGet:e=>new Fr(new Ue).get(e),configSet:(e,n)=>new Fr(new Ue,ne,new Ct).set(e,n),configUnset:e=>new Fr(new Ue).unset(e),stub:e=>(ne.err(`${hz[e]??`${e}: not implemented yet`}
385
+ `),0)}}try{let t=fz();process.exitCode=await jS(process.argv.slice(2),t,vz(t))}catch(t){j.error("jarvis failed",{error:t}),process.exitCode=1}