@herjarsa/omo-meta-governor 0.28.0 → 0.29.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.
- package/dist/index.js +89 -89
- package/dist/index.js.map +24 -24
- package/dist/lib.d.ts +1 -0
- package/dist/lib.js +89 -89
- package/dist/lib.js.map +26 -26
- package/dist/plugin.d.ts +9 -0
- package/dist/proc-guard.d.ts +30 -0
- package/dist/protocol-enforcer.d.ts +4 -1
- package/dist/scoring-engine.d.ts +1 -1
- package/dist/types.d.ts +6 -0
- package/package.json +45 -45
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
`}catch{
|
|
3
|
-
`}try{
|
|
1
|
+
import{createRequire as pf}from"node:module";var{defineProperty:ao,getOwnPropertyNames:of,getOwnPropertyDescriptor:af}=Object,sf=Object.prototype.hasOwnProperty;function cf(e){return this[e]}var lf=(e)=>{var r=(bu??=new WeakMap).get(e),n;if(r)return r;if(r=ao({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var o of of(e))if(!sf.call(r,o))ao(r,o,{get:cf.bind(e,o),enumerable:!(n=af(e,o))||n.enumerable})}return bu.set(e,r),r},bu,uf=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var df=(e)=>e;function mf(e,r){this[e]=df.bind(null,r)}var me=(e,r)=>{for(var n in r)ao(e,n,{get:r[n],enumerable:!0,configurable:!0,set:mf.bind(r,n)})};var Ge=(e,r)=>()=>(e&&(r=e(e=0)),r);var we=pf(import.meta.url);import{spawn as ff,spawnSync as Ve}from"node:child_process";function _u(e){try{let r=Ve("pgrep",["-P",String(e)],{encoding:"utf8"});for(let n of r.stdout.trim().split(/\s+/)){let o=Number(n);if(!o)continue;_u(o);try{process.kill(o,"SIGKILL")}catch{}}}catch{}}function We(e){if(!e||e<=0)return;try{if(process.platform==="win32")Ve("taskkill",["/pid",String(e),"/T","/F"],{stdio:"ignore"});else{try{process.kill(-e,"SIGKILL")}catch{}_u(e);try{process.kill(e,"SIGKILL")}catch{}}}catch{}}function gf(e){if(!e||e<=0)return!1;try{return process.kill(e,0),!0}catch(r){if(r.code==="ESRCH")return!1;return!0}}function co(e){if(e&&e>0)xr.add(e)}function wr(e){xr.delete(e)}function Sr(){let e=0;for(let r of xr)if(gf(r))We(r),e++;return xr.clear(),e}function Ir(e,r,n){return new Promise((o)=>{let t;try{t=ff(e,r,{cwd:n.cwd,stdio:["ignore","pipe","pipe"],shell:process.platform==="win32",windowsHide:!0,env:{...process.env,OMO_MG_SPAWN:"1",...n.env}})}catch{o({stdout:"",stderr:"",code:null,timedOut:!1});return}co(t.pid);let i="",a="",s=!1,c=!1,l,d=(h)=>{if(c)return;if(c=!0,clearTimeout(v),l)clearTimeout(l);wr(t.pid),o(h)},v=setTimeout(()=>{s=!0,We(t.pid),l=setTimeout(()=>{d({stdout:i,stderr:a,code:null,timedOut:!0})},2000)},n.timeoutMs);t.stdout?.on("data",(h)=>{i+=h.toString("utf8")}),t.stderr?.on("data",(h)=>{a+=h.toString("utf8")}),t.on("error",()=>{d({stdout:i,stderr:a,code:null,timedOut:s})}),t.on("close",(h)=>{if(t.exitCode===null)We(t.pid);d({stdout:i,stderr:a,code:h,timedOut:s})})})}function H(e,r,n){let o=Date.now(),t;try{t=Ve(e,r,{cwd:n.cwd,stdio:["ignore","pipe","pipe"],shell:process.platform==="win32",windowsHide:!0,env:{...process.env,OMO_MG_SPAWN:"1",...n.env},timeout:n.timeoutMs})}catch{return{stdout:"",stderr:"",code:null,timedOut:!1}}let i=Date.now()-o,a=t.error!=null&&t.error.code==="ETIMEDOUT"||t.signal==="SIGTERM"||i>=n.timeoutMs-50;if(a&&t.pid)We(t.pid);return{stdout:(t.stdout??"").toString("utf8"),stderr:(t.stderr??"").toString("utf8"),code:t.status,timedOut:a}}function tt(){let e=0;try{if(process.platform==="win32"){for(let r of["graphify.exe","codegraph.exe"])try{Ve("taskkill",["/IM",r,"/F"],{stdio:"ignore"})}catch{}try{if(Ve("powershell",["-NoProfile","-Command","Get-CimInstance Win32_Process | Where-Object { $_.CommandLine -match 'OMO_MG_WATCH|OMO_MG_SPAWN' } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue }"],{stdio:"ignore"}).status===0)e=1}catch{}}else{for(let r of["graphify","codegraph"])try{Ve("pkill",["-x",r],{stdio:"ignore"})}catch{}try{Ve("pkill",["-f","OMO_MG_WATCH|OMO_MG_SPAWN"],{stdio:"ignore"})}catch{}}}catch{}return e}function lo(){if(so)return!1;so=!0;let e=()=>{try{Sr()}catch{}try{tt()}catch{}};wt.push({event:"exit",fn:e}),process.on("exit",e);let r=(o)=>{e();try{process.removeListener(o,r),process.kill(process.pid,o)}catch{}};wt.push({event:"SIGINT",fn:r}),wt.push({event:"SIGTERM",fn:r}),wt.push({event:"SIGHUP",fn:r}),process.on("SIGINT",r),process.on("SIGTERM",r),process.on("SIGHUP",r);let n=()=>{e()};return wt.push({event:"beforeExit",fn:n}),process.on("beforeExit",n),!0}function P_(){return so}var xr,wt,so=!1;var Tr=Ge(()=>{xr=new Set;wt=[]});var po={};me(po,{LOG_PATH:()=>pe,getLogFileSize:()=>Df,getRotatedLogCount:()=>Pf,logStructured:()=>Of,logToFile:()=>T});import{appendFileSync as hf,mkdirSync as vf,statSync as ku,renameSync as yf,existsSync as Or,unlinkSync as bf}from"node:fs";import{resolve as _f,dirname as kf}from"node:path";import{homedir as $f}from"node:os";function $u(e){let r=e;for(let n of xf)r=r.replace(n,"[REDACTED]");return r}function uo(e,r=new WeakSet){if(typeof e==="string")return $u(e);if(Array.isArray(e)){if(r.has(e))return"[Circular]";return r.add(e),e.map((n)=>uo(n,r))}if(e&&typeof e==="object"){if(r.has(e))return"[Circular]";r.add(e);let n={};for(let[o,t]of Object.entries(e))if(wf.test(o))n[o]="[REDACTED]";else try{n[o]=uo(t,r)}catch{n[o]="[unserializable]"}return n}return e}function If(){try{vf(kf(pe),{recursive:!0})}catch{}}function Tf(){if(!Or(pe))return;try{if(ku(pe).size<Sf)return}catch{return}for(let e=mo;e>=1;e--){let r=e===1?pe:`${pe}.${e-1}`,n=`${pe}.${e}`;if(Or(r))try{if(e===mo)bf(r);else yf(r,n)}catch{}}}function xu(e,r,n,o,t){If(),Tf();let i=$u(r),a=n!==void 0?uo(n):void 0,s={timestamp:new Date().toISOString(),level:e,message:i,...o?{event:o}:{},...t?{sessionID:t}:{},...a!==void 0?{data:a}:{}},c;try{c=JSON.stringify(s)+`
|
|
2
|
+
`}catch{c=JSON.stringify({timestamp:s.timestamp,level:e,message:r,data:"[unserializable]"})+`
|
|
3
|
+
`}try{hf(pe,c)}catch{}if(e==="error")console.error(`[meta-governor] ${r}`)}function T(e,r,n){xu(e,r,n)}function Of(e){xu(e.level,e.message,e.data,e.event,e.sessionID)}function Df(){try{if(Or(pe))return ku(pe).size}catch{}return 0}function Pf(){let e=0;for(let r=1;r<=mo;r++)if(Or(`${pe}.${r}`))e=r;else break;return e}var xf,wf,pe,Sf=10485760,mo=5;var Dr=Ge(()=>{xf=[/eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/g,/sk-(?:proj-|svc-|)[a-zA-Z0-9]{20,}/g,/pk-[a-zA-Z0-9]{20,}/g,/ghp_[a-zA-Z0-9]{36,}/g,/ghs_[a-zA-Z0-9]{36,}/g,/github_pat_[a-zA-Z0-9]{22,}/g,/Bearer\s+[a-zA-Z0-9_\-]{20,}/gi,/(?:key|secret|token|password|credential|private_key)\s*[:=]\s*['"]?[a-zA-Z0-9_\-]{16,}/gi],wf=/^(?:key|secret|token|password|credential|private_key|api[_-]?key|access[_-]?token|auth[_-]?token)$/i;pe=_f($f(),".config","opencode","meta-governor.log")});var Uu={};me(Uu,{checkToolAvailability:()=>vo,detectRemoteNewCommits:()=>ko,fetchCodegraphLatestVersion:()=>Mu,fetchGraphifyLatestVersion:()=>Ru,getDefaultUpgradeCachePath:()=>Eu,getInstalledCodegraphVersion:()=>bo,getInstalledGraphifyVersion:()=>Nu,getSessionCount:()=>Mf,hasActiveWatcher:()=>Rf,initCodegraph:()=>Du,initGraphify:()=>Pu,installCodegraph:()=>fo,installGraphify:()=>go,isCacheFresh:()=>_o,isGitCommitCommand:()=>Ar,isGraphifyHookInstalled:()=>zu,isNewerVersion:()=>jr,logToFile:()=>Er,readUpgradeCache:()=>ju,resetInitializedProjects:()=>Ef,runGraphSync:()=>It,shouldUpgrade:()=>yo,stopWatches:()=>St,trackSession:()=>jf,triggerCodegraphSync:()=>Cu,triggerReindex:()=>Mr,untrackSession:()=>Af,writeUpgradeCache:()=>Au});import{execSync as Be,spawn as wu}from"node:child_process";import{access as R_,stat as Ou}from"node:fs/promises";import{resolve as Cr,join as zf}from"node:path";import{homedir as Cf}from"node:os";async function fo(e,r=60000,n){let o=["i","-D","@colbymchenry/codegraph"];if(n)try{return n(`npm ${o.join(" ")}`,{cwd:e,stdio:"ignore",timeout:r}),"codegraph-installed"}catch{return"codegraph-install-failed"}return H("npm",o,{cwd:e,timeoutMs:r}).code===0?"codegraph-installed":"codegraph-install-failed"}async function go(e=60000,r){if(r)try{return r("pip install --upgrade graphifyy --break-system-packages --quiet",{stdio:"ignore",timeout:e}),"graphify-installed"}catch{try{return r("uv tool install --upgrade graphifyy --quiet",{stdio:"ignore",timeout:e}),"graphify-installed"}catch{return"graphify-install-failed"}}if(H("pip",["install","--upgrade","graphifyy","--break-system-packages","--quiet"],{timeoutMs:e}).code===0)return"graphify-installed";return H("uv",["tool","install","--upgrade","graphifyy","--quiet"],{timeoutMs:e}).code===0?"graphify-installed":"graphify-install-failed"}function Ef(){ho.clear()}function jf(e){let n=(rt.get(e)??0)+1;return rt.set(e,n),n}function Af(e){let r=rt.get(e)??0,n=Math.max(0,r-1);if(n===0)rt.delete(e),St(e);else rt.set(e,n);return n}function Mf(e){return rt.get(e)??0}async function vo(e,r=Be){let n=!1,o=!1,t=await Tu(Cr(e,".codegraph","codegraph.db")),i=await Tu(Cr(e,"graphify-out","graph.json")),a=(s,c)=>{if(r!==Be)return r(s,{stdio:"ignore",...c});let l=s.split(" "),d=l[0],v=l.slice(1),h=H(d,v,{cwd:c?.cwd??e,timeoutMs:c?.timeout??1e4});if(h.code!==0)throw Error(`exit ${h.code}`)};try{a("npx --yes codegraph --version",{timeout:1e4}),n=!0}catch{try{a("node node_modules/.bin/codegraph --version",{cwd:e,timeout:5000}),n=!0}catch{}}try{a("graphify --version",{timeout:5000}),o=!0}catch{try{a("graphifyy --version",{timeout:5000}),o=!0}catch{try{a('python -c "import graphifyy"',{timeout:5000}),o=!0}catch{try{a('python3 -c "import graphifyy"',{timeout:5000}),o=!0}catch{}}}}return{codegraph:n,graphify:o,codegraphIndexExists:t,graphifyIndexExists:i}}async function Du(e,r=60000,n=Be){try{if(n!==Be)n("npx --yes codegraph init",{cwd:e,stdio:"ignore",timeout:r});else{let o=H("npx",["--yes","codegraph","init"],{cwd:e,timeoutMs:r});if(o.code!==0)throw Error(`exit ${o.code}`)}return!0}catch{return!1}}async function Pu(e,r=120000,n=Be){let o=[{bin:"graphify",args:[".","--no-viz"]},{bin:"python",args:["-m","graphify",".","--no-viz"]},{bin:"python3",args:["-m","graphify",".","--no-viz"]}];for(let t of o)try{if(n!==Be)n(`${t.bin} ${t.args.join(" ")}`,{cwd:e,stdio:"ignore",timeout:r});else{let i=H(t.bin,t.args,{cwd:e,timeoutMs:r});if(i.code!==0)throw Error(`exit ${i.code}`)}return!0}catch{}return!1}function Iu(e,r){let n=`${e}:${r}`;if(nt.has(n))return;try{let o;if(r==="codegraph")o=wu("node",["-e",`
|
|
4
4
|
const OMO_MG_WATCH = 1;
|
|
5
5
|
const {spawn} = require("child_process");
|
|
6
6
|
const run = () => {
|
|
7
7
|
try {
|
|
8
8
|
const c = spawn("npx", ["codegraph", "update"], {
|
|
9
|
-
cwd: ${JSON.stringify(
|
|
9
|
+
cwd: ${JSON.stringify(e)},
|
|
10
10
|
stdio: "ignore",
|
|
11
11
|
windowsHide: true,
|
|
12
12
|
shell: false,
|
|
@@ -16,25 +16,25 @@ import{createRequire as sk}from"node:module";var{defineProperty:p6,getOwnPropert
|
|
|
16
16
|
};
|
|
17
17
|
run();
|
|
18
18
|
setInterval(run, 30_000);
|
|
19
|
-
`],{stdio:"ignore",detached:!0,shell:!1,env:{...process.env,OMO_MG_SPAWN:"1"}});else
|
|
20
|
-
`)[0]??"").match(/graphifyy\s*\(?([0-9]+\.[0-9]+\.[0-9]+[^\s)]*)/);if(
|
|
19
|
+
`],{stdio:"ignore",detached:!0,shell:!1,env:{...process.env,OMO_MG_SPAWN:"1"}});else o=wu("python3",["-m","graphify",".","--no-viz","--watch"],{cwd:e,stdio:"ignore",detached:!0,shell:!1,env:{...process.env,OMO_MG_SPAWN:"1"}});o.unref(),nt.set(n,{process:o,tool:r}),co(o.pid),o.on("exit",()=>{nt.delete(n),wr(o.pid)})}catch{}}function St(e){for(let[r,n]of nt)if(!e||r.startsWith(e)){let o=n.process.pid;if(o)wr(o);if(process.platform==="win32")We(o);else{try{n.process.kill("SIGTERM")}catch{}setTimeout(()=>{We(o)},2000).unref()}nt.delete(r)}}function Rf(e,r){for(let n of nt.keys())if(n.startsWith(e)){if(!r||n.endsWith(r))return!0}return!1}async function It(e={enabled:!0,watch:!1,autoInstall:!0,installTimeoutMs:60000}){let r=[],n=e.projectDir??process.cwd();if(!e.enabled)return{attempted:!1,codes:["disabled"],availability:{codegraph:!1,graphify:!1,codegraphIndexExists:!1,graphifyIndexExists:!1},alreadyInitialized:!1};if(e.killOrphanedOnInit!==!1&&!Su){Su=!0;let t=tt();Er("info","orphan sweep: killed "+t+" leftover tool processes")}if(ho.has(n)){let t=await vo(n,e.runner);return{attempted:!1,codes:t.codegraphIndexExists?["codegraph-already-exists"]:[],availability:t,alreadyInitialized:!0}}ho.add(n);let o;try{o=await vo(n,e.runner)}catch{return{attempted:!1,codes:["error"],availability:{codegraph:!1,graphify:!1,codegraphIndexExists:!1,graphifyIndexExists:!1},alreadyInitialized:!1}}if(e.autoUpgrade!==!1)try{let t=e.upgradeCachePath??Eu(),i=await ju(t),a=e.upgradeCheckTtlMs??86400000,s={codegraph:null,graphify:null},c=async(l)=>{let d=l==="codegraph"?"codegraphLatest":"graphifyLatest";if(_o(i,a)&&i?.[d])return i[d];let h=await(l==="codegraph"?Mu:Ru)();return s[l]=h,h};if(o.codegraph){let l=await bo(e.runner),d=await c("codegraph");if(yo(l,d,i,a,"codegraphLatest")){if(d&&jr(l,d)){if(await fo(n,e.installTimeoutMs??60000,e.runner)==="codegraph-installed"){if(r.push("codegraph-upgraded"),await bo(e.runner)==null)r.push("codegraph-upgrade-broken")}}}}if(o.graphify){let l=await Nu(e.runner),d=await c("graphify");if(yo(l,d,i,a,"graphifyLatest")){if(d&&jr(l,d)){if(await go(e.installTimeoutMs??60000,e.runner)==="graphify-installed")r.push("graphify-upgraded")}}if(e.checkGraphifyNeedsUpdate!==!1)try{if((e.runner?(()=>{try{return e.runner("graphify check-update "+n,{cwd:n,stdio:"ignore",timeout:1e4}),{code:0,stdout:"",stderr:""}}catch{return{code:1,stdout:"",stderr:"runner rejected"}}})():H("graphify",["check-update",n],{cwd:n,timeoutMs:1e4})).code!==0){if(e.runner)try{e.runner("graphify update "+n+" --no-cluster",{cwd:n,stdio:"ignore",timeout:e.installTimeoutMs??60000})}catch{}else H("graphify",["update",n,"--no-cluster"],{cwd:n,timeoutMs:e.installTimeoutMs??60000});r.push("graphify-reextract-triggered")}}catch{}}try{await Au(t,{checkedAtMs:Date.now(),codegraphLatest:s.codegraph??i?.codegraphLatest,graphifyLatest:s.graphify??i?.graphifyLatest}),r.push("upgrade-cache-written")}catch{}}catch{r.push("upgrade-check-skipped")}if(e.autoInstall!==!1){if(!o.codegraph){let t=await fo(n,e.installTimeoutMs??60000,e.runner);if(r.push(t),t==="codegraph-installed")o.codegraph=!0}if(!o.graphify){let t=await go(e.installTimeoutMs??60000,e.runner);if(r.push(t),t==="graphify-installed")o.graphify=!0}}else{if(!o.codegraph)r.push("codegraph-install-skipped");if(!o.graphify)r.push("graphify-install-skipped")}if(o.codegraph)if(!o.codegraphIndexExists){let t=await Du(n,e.installTimeoutMs??60000);r.push(t?"codegraph-initialized":"codegraph-init-failed")}else r.push("codegraph-already-exists");else r.push("codegraph-unavailable");if(o.graphify){if(!o.graphifyIndexExists){let t=await Pu(n,e.installTimeoutMs??120000);r.push(t?"graphify-initialized":"graphify-init-failed")}else r.push("graphify-already-exists");try{if(!await zu(n)){if(H("graphify",["hook","install"],{cwd:n,timeoutMs:1e4}).code===0)r.push("graphify-hook-installed")}}catch{}}else r.push("graphify-unavailable");if(e.watch){if(o.codegraph)Iu(n,"codegraph"),r.push("watch-started-codegraph");if(o.graphify)Iu(n,"graphify"),r.push("watch-started-graphify")}if(e.addToGlobalGraph===!0&&o.graphify)try{await Ir("graphify",["global","add",zf(n,"graphify-out")],{cwd:n,timeoutMs:1e4}),r.push("graphify-added-to-global")}catch{r.push("graphify-global-add-failed")}return{attempted:!0,codes:r,availability:o,alreadyInitialized:!1}}async function zr(e){try{return(await Ou(e)).isDirectory()}catch{return!1}}async function Tu(e){try{return(await Ou(e)).isFile()}catch{return!1}}function Ar(e){if(typeof e!=="string"||e.length===0)return!1;let r=e.replace(/\\\n/g," ").replace(/\s*\n\s*/g," ");return/(?:^|[\s;&|])git\s+commit(?:\s+-|\s|$)/.test(r)}async function Mr(e,r){if(await zr(Cr(e,".codegraph")))return await Cu(e,r);return await It({enabled:!0,watch:!1,autoInstall:!1,installTimeoutMs:5000,projectDir:e,runner:r})}async function zu(e){let{access:r,readFile:n}=await import("node:fs/promises"),{resolve:o}=await import("node:path"),t=o(e,".git","hooks","post-commit");try{await r(t)}catch{return!1}try{return(await n(t,"utf-8")).includes("graphify-hook-start")}catch{return!1}}async function Cu(e,r){let{resolve:n}=await import("node:path"),o=[],t=await zr(n(e,".codegraph"));if(t){try{if(r)r("npx --yes codegraph sync -q",{cwd:e,stdio:"ignore",timeout:30000});else H("npx",["--yes","codegraph","sync","-q"],{cwd:e,timeoutMs:30000});o.push("codegraph-already-exists"),Er("info",`codegraph sync -q completed for ${e}`)}catch(a){Er("warn",`codegraph sync failed for ${e}: ${a}`),o.push("codegraph-install-failed")}return{attempted:!0,codes:o,availability:{codegraph:!0,graphify:!1,codegraphIndexExists:t,graphifyIndexExists:await zr(n(e,"graphify-out"))},alreadyInitialized:!1}}let i=!1;try{if(r)r("npx --yes codegraph --version",{stdio:"ignore",timeout:5000});else if(H("npx",["--yes","codegraph","--version"],{timeoutMs:5000}).code!==0)throw Error("codegraph probe failed");i=!0}catch{try{if(r)r("node node_modules/.bin/codegraph --version",{cwd:e,stdio:"ignore",timeout:5000});else if(H("node",["node_modules/.bin/codegraph","--version"],{cwd:e,timeoutMs:5000}).code!==0)throw Error("local codegraph probe failed");i=!0}catch{}}if(!i)return{attempted:!0,codes:["codegraph-unavailable"],availability:{codegraph:!1,graphify:!1,codegraphIndexExists:t,graphifyIndexExists:await zr(n(e,"graphify-out"))},alreadyInitialized:!1};return await It({enabled:!0,watch:!1,autoInstall:!1,installTimeoutMs:5000,projectDir:e,runner:r})}async function Nf(){if(Pr)return Pr;let e=await Promise.resolve().then(() => (Dr(),po));return Pr=(r,n)=>e.logToFile(r,n),Pr}async function Er(e,r){(await Nf())(e,r)}function jr(e,r){if(e==null&&r)return!0;if(!r)return!1;let n=e,o=r;if(!n||n===o)return!1;let t=/^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$/;if(!t.test(n)||!t.test(o))return!1;let i=(y)=>{let[x="",j=""]=y.split("-",2),A=x.split(".").map((he)=>{let kt=Number.parseInt(he,10);return Number.isFinite(kt)?kt:0}),[G=0,N=0,X=0]=A;return[G,N,X,j]},[a,s,c,l]=i(n),[d,v,h,u]=i(o);if(d!==a)return d>a;if(v!==s)return v>s;if(h!==c)return h>c;if(l&&!u)return!0;if(!l&&u)return!1;return u>l}function Eu(){return Cr(Cf(),".config","opencode","omo-meta-governor-upgrade-check.json")}async function ju(e){try{let{readFile:r}=await import("node:fs/promises"),n=await r(e,"utf-8"),o=JSON.parse(n);if(typeof o?.checkedAtMs==="number")return o;return null}catch{return null}}async function Au(e,r){let{dirname:n}=await import("node:path"),{mkdir:o,writeFile:t}=await import("node:fs/promises"),i=n(e);try{await o(i,{recursive:!0}),await t(e,JSON.stringify(r,null,2))}catch{}}function _o(e,r){if(!e)return!1;let n=Date.now()-e.checkedAtMs;return n>=0&&n<r}function yo(e,r,n,o,t="codegraphLatest"){let i=r;if(_o(n,o))i=n?.[t]??i;if(!e&&!i)return!1;if(!i)return!1;if(!e)return!0;return jr(e,i)}async function Mu(){try{let r=H("npm",["view","@colbymchenry/codegraph","version"],{timeoutMs:1e4}).stdout.trim();return r.length>0?r:null}catch{return null}}async function Ru(e=Be){for(let r of["python","python3"])try{let t=(H(r,["-m","pip","index","versions","graphifyy"],{timeoutMs:1e4}).stdout.split(`
|
|
20
|
+
`)[0]??"").match(/graphifyy\s*\(?([0-9]+\.[0-9]+\.[0-9]+[^\s)]*)/);if(t)return t[1]}catch{}for(let r of["python","python3"])try{let o=H(r,["-c","import urllib.request, json; d=json.load(urllib.request.urlopen('https://pypi.org/pypi/graphifyy/json')); print(d['info']['version'])"],{timeoutMs:1e4}).stdout.trim();if(o.length>0)return o}catch{}return null}async function bo(e){let r=[{bin:"npx",args:["--yes","codegraph","--version"]},{bin:"node",args:["node_modules/.bin/codegraph","--version"]}];for(let{bin:n,args:o}of r)try{let t;if(e){let a=e(`${n} ${o.join(" ")}`,{stdio:"ignore",timeout:1e4});t=typeof a==="string"?a:a.toString()}else t=H(n,o,{timeoutMs:1e4}).stdout;let i=t.match(/([0-9]+\.[0-9]+\.[0-9]+[^\s]*)/);if(i)return i[1]}catch{}return null}async function Nu(e){let r=(n,o)=>{if(e){let t=e(`${n} ${o.join(" ")}`,{stdio:"ignore",timeout:1e4});return typeof t==="string"?t:t.toString()}return H(n,o,{timeoutMs:1e4}).stdout};try{let o=r("graphify",["--version"]).match(/([0-9]+\.[0-9]+\.[0-9]+[^\s]*)/);if(o)return o[1]}catch{}try{let o=r("python",["-m","pip","show","graphifyy"]).match(/Version:\s*([0-9]+\.[0-9]+\.[0-9]+[^\s]*)/);if(o)return o[1]}catch{}try{let o=r("python3",["-m","pip","show","graphifyy"]).match(/Version:\s*([0-9]+\.[0-9]+\.[0-9]+[^\s]*)/);if(o)return o[1]}catch{}return null}function ko(e,r,n){let o=n?(i)=>n(i,{cwd:e}).toString():void 0,t=r;try{if(!t)if(o)t=o("git rev-parse --abbrev-ref HEAD").trim();else t=H("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:e,timeoutMs:5000}).stdout.trim();if(o)o(`git fetch origin ${t}`);else H("git",["fetch","origin",t],{cwd:e,timeoutMs:30000});let i;if(o)i=o(`git rev-list --count HEAD..origin/${t}`);else i=H("git",["rev-list","--count",`HEAD..origin/${t}`],{cwd:e,timeoutMs:1e4}).stdout;let a=Number.parseInt(i.trim(),10);return Number.isFinite(a)&&a>0?a:0}catch{return 0}}var ho,rt,Su=!1,nt,Pr=null;var Rr=Ge(()=>{Tr();ho=new Set;rt=new Map;nt=new Map});var Ot={};me(Ot,{compareSemver:()=>xo,fetchCliHubLatestVersion:()=>$o,getInstalledCliHubVersion:()=>Tt,infoCli:()=>Ff,installCli:()=>Gf,installCliHub:()=>wo,installCliHubMetaSkill:()=>Io,isCliHubMetaSkillInstalled:()=>Oo,listClis:()=>Lf,searchClis:()=>Zf,upgradeCliHub:()=>So,upgradeCliHubMetaSkill:()=>To});import{execSync as Uf}from"node:child_process";function oe(e,r,n){try{return{ok:!0,stdout:r(e,{timeoutMs:n}),stderr:"",timedOut:!1}}catch(o){let t=o,i=typeof t.stdout==="string"?t.stdout:t.stdout instanceof Buffer?t.stdout.toString("utf8"):"",a=typeof t.stderr==="string"?t.stderr:t.stderr instanceof Buffer?t.stderr.toString("utf8"):t.message??"",s=/timed out|ETIMEDOUT|timeout/i.test(a);return{ok:!1,stdout:i,stderr:a,timedOut:s}}}function Tt(e=$e){let r=oe("pip show cli-anything-hub",e,1e4);if(!r.ok)r=oe("pip3 show cli-anything-hub",e,1e4);if(!r.ok)r=oe("python -m pip show cli-anything-hub",e,1e4);if(!r.ok)return null;let n=r.stdout.match(/^Version:\s*([\d.]+[^\s]*)/m);return n?n[1].trim():null}function $o(e=$e){let r=oe("pip index versions cli-anything-hub",e,1e4);if(!r.ok)r=oe("pip3 index versions cli-anything-hub",e,1e4);if(!r.ok)r=oe("python -m pip index versions cli-anything-hub",e,1e4);if(!r.ok)return null;let n=r.stdout.match(/^\S+\s+\(([\d.]+[^\s,)]*)/m);return n?n[1].trim():null}function xo(e,r){if(e===r)return 0;if(!e)return-1;if(!r)return 1;let n=e.split(/[.+-]/).map((t)=>Number.parseInt(t,10)||0),o=r.split(/[.+-]/).map((t)=>Number.parseInt(t,10)||0);for(let t=0;t<Math.max(n.length,o.length);t++){let i=n[t]??0,a=o[t]??0;if(i<a)return-1;if(i>a)return 1}return 0}function wo(e=$e,r=60000){let n=Date.now(),o=["uv tool install cli-anything-hub","uv pip install --system --break-system-packages cli-anything-hub","pip install --user cli-anything-hub","pip install cli-anything-hub"],t="";for(let i of o){let a=oe(i,e,r);if(a.ok)return{ok:!0,data:null,rawOutput:a.stdout,stderr:a.stderr,durationMs:Date.now()-n,code:"cli-anything-install-succeeded"};t=a.stderr}return{ok:!1,data:null,rawOutput:null,stderr:t.slice(0,500),durationMs:Date.now()-n,code:"cli-anything-install-failed"}}function So(e=$e,r=60000){let n=Date.now(),o=["uv tool upgrade cli-anything-hub","uv tool install --upgrade cli-anything-hub","uv pip install --system --upgrade --break-system-packages cli-anything-hub","pip install --user --upgrade cli-anything-hub","pip install --upgrade cli-anything-hub"],t="";for(let i of o){let a=oe(i,e,r);if(a.ok)return{ok:!0,data:null,rawOutput:a.stdout,stderr:a.stderr,durationMs:Date.now()-n,code:"cli-anything-upgrade-succeeded"};t=a.stderr}return{ok:!1,data:null,rawOutput:null,stderr:t.slice(0,500),durationMs:Date.now()-n,code:"cli-anything-upgrade-failed"}}function Lf(e={},r=$e,n=30000,o="cli-hub"){let t=Date.now(),i=["list","--json"];if(e.category)i.push("--category",e.category);if(e.source)i.push("--source",e.source);let a=oe(`${o} ${i.join(" ")}`,r,n);if(!a.ok)return{ok:!1,data:null,rawOutput:a.stdout,stderr:a.stderr.slice(0,500),durationMs:Date.now()-t,code:"cli-hub-list-failed"};try{return{ok:!0,data:JSON.parse(a.stdout),rawOutput:null,stderr:a.stderr,durationMs:Date.now()-t,code:"cli-hub-list-succeeded"}}catch{return{ok:!1,data:null,rawOutput:a.stdout,stderr:"Failed to parse cli-hub list JSON output",durationMs:Date.now()-t,code:"cli-hub-list-failed"}}}function Zf(e,r=$e,n=30000,o="cli-hub"){let t=Date.now();if(!e.trim())return{ok:!1,data:null,rawOutput:null,stderr:"empty query",durationMs:0,code:"cli-hub-search-failed"};let i=oe(`${o} search "${e}" --json`,r,n);if(!i.ok)return{ok:!1,data:null,rawOutput:i.stdout,stderr:i.stderr.slice(0,500),durationMs:Date.now()-t,code:"cli-hub-search-failed"};try{return{ok:!0,data:JSON.parse(i.stdout),rawOutput:null,stderr:i.stderr,durationMs:Date.now()-t,code:"cli-hub-search-succeeded"}}catch{return{ok:!1,data:null,rawOutput:i.stdout,stderr:"Failed to parse cli-hub search JSON output",durationMs:Date.now()-t,code:"cli-hub-search-failed"}}}function Ff(e,r=$e,n=1e4,o="cli-hub"){let t=Date.now(),i=oe(`${o} info "${e}"`,r,n);if(!i.ok)return{ok:!1,data:null,rawOutput:i.stdout,stderr:i.stderr.slice(0,500),durationMs:Date.now()-t,code:"cli-hub-info-failed"};return{ok:!0,data:i.stdout,rawOutput:null,stderr:i.stderr,durationMs:Date.now()-t,code:"cli-hub-info-succeeded"}}function Gf(e,r=$e,n=120000,o="cli-hub"){let t=Date.now(),i=oe(`${o} install "${e}"`,r,n);if(!i.ok)return{ok:!1,data:null,rawOutput:i.stdout,stderr:i.stderr.slice(0,500),durationMs:Date.now()-t,code:"cli-hub-install-failed"};return{ok:!0,data:null,rawOutput:i.stdout,stderr:i.stderr,durationMs:Date.now()-t,code:"cli-hub-install-succeeded"}}function Io(e="global",r=$e,n=60000,o="npx skills"){let t=Date.now(),a=`${o} add HKUDS/CLI-Anything --skill cli-hub-meta-skill ${e==="global"?"-g":"-p"} -y`,s=oe(a,r,n);if(!s.ok)return{ok:!1,data:null,rawOutput:s.stdout,stderr:s.stderr.slice(0,500),durationMs:Date.now()-t,code:"skill-install-failed"};return{ok:!0,data:null,rawOutput:s.stdout,stderr:s.stderr,durationMs:Date.now()-t,code:"skill-install-succeeded"}}function To(e="global",r=$e,n=60000,o="npx skills"){let t=Date.now(),a=`${o} update cli-hub-meta-skill ${e==="global"?"-g":"-p"} -y`,s=oe(a,r,n);if(!s.ok)return{ok:!1,data:null,rawOutput:s.stdout,stderr:s.stderr.slice(0,500),durationMs:Date.now()-t,code:"skill-upgrade-failed"};return{ok:!0,data:null,rawOutput:s.stdout,stderr:s.stderr,durationMs:Date.now()-t,code:"skill-upgrade-succeeded"}}function Oo(e="global",r=$e,n=1e4,o="npx skills"){let i=oe(`${o} list ${e==="global"?"-g":"-p"}`,r,n);if(!i.ok)return!1;return/cli-hub-meta-skill/i.test(i.stdout)}var $e=(e,r)=>Uf(e,{timeout:r?.timeoutMs??1e4,encoding:"utf8",stdio:["ignore","pipe","pipe"]}).toString();var ot=()=>{};var Nm={};me(Nm,{_sessionStore:()=>hr,buildEscalationPrompt:()=>Ol,existsSync:()=>Ib,hasSessionClient:()=>bt,join:()=>Sb,persistSessionMessage:()=>Yn,promptAgent:()=>_t,promptAgentText:()=>Tl,runWithClient:()=>Ob,setSessionClient:()=>Il});import{join as Sb}from"node:path";import{existsSync as Ib}from"node:fs";import{AsyncLocalStorage as Tb}from"node:async_hooks";function Il(e){if(e){let r=Date.now();if(r-Mm>1000){Mm=r;try{let{logToFile:n}=(Dr(),lf(po));n("info","SessionBridge: OpenCode client hydrated — session.prompt() available")}catch{}}}Xn=e}function Ob(e,r){return hr.run(e,r)}function bt(){return(hr.getStore()??Xn)!==null}async function _t(e,r){let n=Date.now(),o=r.timeoutMs??15000,t=hr.getStore()??Xn;if(!t)return{ok:!1,messageID:null,error:"SessionBridge: no OpenCode client captured (plugin not initialized?)",durationMs:0};if(!e)return{ok:!1,messageID:null,error:"SessionBridge: sessionID is required",durationMs:0};let i=JSON.stringify(r.mcpArgs,null,2),c={type:"text",text:`${r.preamble??"The user wants to record this."}
|
|
21
21
|
|
|
22
|
-
Please call the \`${
|
|
22
|
+
Please call the \`${r.mcpTool}\` MCP tool with EXACTLY these args:
|
|
23
23
|
|
|
24
24
|
\`\`\`json
|
|
25
|
-
`+
|
|
25
|
+
`+i+`
|
|
26
26
|
\`\`\`
|
|
27
27
|
|
|
28
28
|
Do not paraphrase, modify, or add fields. Pass the args through verbatim.
|
|
29
|
-
After the tool call, briefly confirm what you stored and for which tool.`};try{return{ok:!0,messageID:(await
|
|
29
|
+
After the tool call, briefly confirm what you stored and for which tool.`};try{return{ok:!0,messageID:(await Rm(t.session.prompt({path:{id:e},body:{parts:[c]}}),o,`session.prompt for ${r.mcpTool}`))?.data?.info?.id??null,error:null,durationMs:Date.now()-n}}catch(l){return{ok:!1,messageID:null,error:l instanceof Error?l.message:String(l),durationMs:Date.now()-n}}}async function Yn(e,r,n=1e4){let o=Date.now(),t=hr.getStore()??Xn;if(!t)return{ok:!1,messageID:null,error:"SessionBridge: no OpenCode client captured (plugin not initialized?)",durationMs:0};if(!e||!r)return{ok:!1,messageID:null,error:"SessionBridge: sessionID and text are required",durationMs:0};let i={type:"text",text:r};try{return{ok:!0,messageID:(await Rm(t.session.prompt({path:{id:e},body:{parts:[i]}}),n,`session.prompt persist for ${e}`))?.data?.info?.id??null,error:null,durationMs:Date.now()-o}}catch(a){return{ok:!1,messageID:null,error:a instanceof Error?a.message:String(a),durationMs:Date.now()-o}}}async function Tl(e,r){return Yn(e,r)}function Rm(e,r,n){return new Promise((o,t)=>{let i=setTimeout(()=>{t(Error(`${n} timed out after ${r}ms`))},r);e.then((a)=>{clearTimeout(i),o(a)},(a)=>{clearTimeout(i),t(a)})})}function Ol(e){if(e.target==="oracle")return`[MetaGovernor] Escalation triggered. Reason: ${e.reasoning}
|
|
30
30
|
|
|
31
|
-
Please invoke the \`task\` tool with \`subagent_type=oracle\` to perform a verification pass on the current session state. Decision context: ${
|
|
31
|
+
Please invoke the \`task\` tool with \`subagent_type=oracle\` to perform a verification pass on the current session state. Decision context: ${e.evidenceCount} evidence unit(s). After Oracle returns, you should continue with the recommended action.`;return`[MetaGovernor] Escalation to user required. Reason: ${e.reasoning}
|
|
32
32
|
|
|
33
|
-
Present a clear summary to the user with the deviation(s) detected and your recommended next steps. Wait for explicit user input before proceeding.`}var
|
|
34
|
-
`)
|
|
35
|
-
`).trim()}catch{return null}}function
|
|
33
|
+
Present a clear summary to the user with the deviation(s) detected and your recommended next steps. Wait for explicit user input before proceeding.`}var hr,Mm=0,Xn=null;var Qn=Ge(()=>{hr=new Tb});var Um=uf(function(nw,Db){Db.exports={name:"@herjarsa/omo-meta-governor",version:"0.29.0",type:"module",description:"Self-judging agent orchestration layer for OpenCode. Reads memory, scores sessions, dispatches decisions.",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./lib":{types:"./dist/lib.d.ts",import:"./dist/lib.js"}},types:"./dist/index.d.ts",main:"./dist/index.js",files:["dist","README.md"],scripts:{build:"bun build.ts",typecheck:"tsc --noEmit",test:"bun test"},peerDependencies:{"@opencode-ai/plugin":">=1.0.0"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},license:"MIT",repository:{type:"git",url:"https://github.com/herjarsa/omo-meta-governor.git"},devDependencies:{"@colbymchenry/codegraph":"^1.5.0","@opencode-ai/plugin":"^1.17.4","@types/node":"^25.9.3",typescript:"^7.0.2"}}});var Np={};me(Np,{deepMerge:()=>vr,getProjectConfigPath:()=>Rp,getUserConfigPath:()=>Mp,loadJsoncFile:()=>El,loadMetaGovernorConfig:()=>jl,parseJsonc:()=>Ap,stripJsoncComments:()=>jp});import{readFile as Rb,access as Nb}from"node:fs/promises";import{resolve as Ub,join as Lb}from"node:path";import{homedir as Zb}from"node:os";function jp(e){let r=[],n=0;while(n<e.length){let t=e[n];if(t==='"'||t==="'"){let i=t;r.push(i),n++;while(n<e.length){let a=e[n];if(r.push(a),a==="\\"){if(n++,n<e.length)r.push(e[n])}else if(a===i){n++;break}n++}continue}if(t==="/"&&n+1<e.length&&e[n+1]==="/"){n+=2;while(n<e.length&&e[n]!==`
|
|
34
|
+
`)n++;continue}if(t==="/"&&n+1<e.length&&e[n+1]==="*"){n+=2;while(n<e.length){if(e[n]==="*"&&n+1<e.length&&e[n+1]==="/"){n+=2;break}n++}continue}r.push(t),n++}let o=r.join("");for(let t=0;t<10;t++){let i=o;if(o=o.replace(/,(\s*[\]}])/g,"$1"),o===i)break}return o}function Ap(e){try{let r=jp(e);return JSON.parse(r)}catch{return}}function Mp(){return Ub(Zb(),".config","opencode",Ep)}function Rp(e){let r=e??process.cwd();return Lb(r,".opencode",Ep)}async function Fb(e){try{return await Nb(e),!0}catch{return!1}}async function El(e){if(!await Fb(e))return;try{let r=await Rb(e,"utf-8");return Ap(r)}catch{return}}function vr(e,r){let n={...e};for(let o of Object.keys(r)){let t=r[o],i=n[o];if(t===void 0)continue;if(Cp(t)&&Cp(i))n[o]=vr(i,t);else n[o]=t}return n}function Cp(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}async function jl(e={}){let r=[],n="defaults",o={},t=Mp(),i=await El(t);if(i)o=vr(o,i),r.push(`user:${t}`),n="user";let a=Rp(e.projectDir),s=await El(a);if(s)o=vr(o,s),r.push(`project:${a}`),n="project";if(e.cliOptions&&Object.keys(e.cliOptions).length>0)o=vr(o,e.cliOptions),r.push("cli:inline"),n="cli";return{config:o,sources:r,effectiveSource:n}}var Ep="omo-meta-governor.jsonc";var Al=()=>{};var Vp={};me(Vp,{DEFAULT_CI_MONITOR_CONFIG:()=>Jb,getFailedLogs:()=>Yb,getLatestRunForSha:()=>qb,pollRunUntilComplete:()=>Kb,triggerWorkflow:()=>Xb});import{execFileSync as Hb}from"node:child_process";function yr(e,r=1e4){try{return Hb("gh",e,{encoding:"utf-8",timeout:r,stdio:["ignore","pipe","pipe"],windowsHide:!0}).toString().replace(/\r\n/g,`
|
|
35
|
+
`).trim()}catch{return null}}function qb(e){let r=yr(["run","list","--limit","1","--commit",e,"--json","databaseId,status,conclusion,displayTitle,headSha,url"],1e4);if(!r)return null;try{return JSON.parse(r)[0]??null}catch{return null}}function Kb(e,r){let n=Date.now(),o="",t=yr(["run","view",String(e),"--json","status,conclusion,url,headSha,displayTitle"],1e4);if(!t)return null;let i;try{i=JSON.parse(t)}catch{return null}while((i.status==="queued"||i.status==="in_progress"||i.status==="waiting"||i.status==="requested")&&Date.now()-n<r.maxWaitMs){let a=Date.now()+r.pollIntervalMs;while(Date.now()<a);let s=yr(["run","view",String(e),"--json","status,conclusion,url,headSha,displayTitle"],1e4);if(!s)return null;try{i=JSON.parse(s)}catch{return null}}return i}function Xb(e,r){let n=yr(["workflow","run",e,"--ref",r],15000);return null}function Yb(e,r=4000){let n=yr(["run","view",String(e),"--log-failed"],30000);if(!n)return"";if(n.length<=r)return n;return n.slice(0,r)+`
|
|
36
36
|
|
|
37
|
-
… (${r.length-U} chars truncated) …`}var xX;var gk=u$(()=>{xX={enabled:!0,workflow:"CI",pollIntervalMs:15000,maxWaitMs:600000,failOnly:!0}});S4();import{randomUUID as B8,createHash as CX}from"node:crypto";import{fileURLToPath as cX}from"node:url";vv();import{existsSync as F2,readFileSync as M2,writeFileSync as Z2,mkdirSync as D2}from"node:fs";import{dirname as x2}from"node:path";function g2($){if(!F2($))return null;try{return JSON.parse(M2($,"utf8"))}catch{return null}}function R2($,U){try{D2(x2($),{recursive:!0}),Z2($,JSON.stringify(U,null,2),"utf8")}catch{}}async function SN($={}){let U={enabled:$.enabled??!0,autoInstall:$.autoInstall??!0,autoUpgrade:$.autoUpgrade??!0,cachePath:$.cachePath??`${process.env.HOME||process.env.USERPROFILE||"~"}/.config/opencode/omo-cli-anything-upgrade-check.json`,upgradeCheckTtlMs:$.upgradeCheckTtlMs??86400000,projectDir:$.projectDir,runner:$.runner,installScope:$.installScope??"global",cliHubBin:$.cliHubBin,skillsBin:$.skillsBin,installTimeoutMs:$.installTimeoutMs??60000};if(!U.enabled)return{attempted:!1,codes:["cli-anything-upgrade-skipped"],availability:{cliHub:!1,cliHubVersion:null,metaSkill:!1},alreadyInitialized:!0};let r=[],b=U.runner??((N,O)=>{let{execSync:I}=B$("node:child_process");return I(N,{timeout:O?.timeoutMs??1e4,encoding:"utf8",stdio:["ignore","pipe","pipe"]})}),v=qv(b),z=WU(U.installScope,b,1e4,U.skillsBin),_={cliHub:v!==null,cliHubVersion:v,metaSkill:z};if(v===null&&U.autoInstall){let N=JU(b,U.installTimeoutMs);if(r.push(N.code),N.ok){let O=qv(b);_.cliHub=!0,_.cliHubVersion=O}}else if(v!==null)r.push("cli-anything-already-installed");if(!z&&U.autoInstall){let N=KU(U.installScope,b,U.installTimeoutMs,U.skillsBin);if(r.push(N.code),N.ok)_.metaSkill=!0}else if(z)r.push("skill-already-current");if(U.autoUpgrade){let N=g2(U.cachePath),O=Date.now(),I=!0;if(N?.updatedAtISO){let W=Date.parse(N.updatedAtISO);if(Number.isFinite(W)&&O-W<U.upgradeCheckTtlMs)I=!1}let k=N?.cliHubLatestVersion??null;if(I)k=IU(b),R2(U.cachePath,{cliHubLatestVersion:k,metaSkillLastCheckedISO:new Date(O).toISOString(),updatedAtISO:new Date(O).toISOString()});if(_.cliHub&&k!==null&&_.cliHubVersion!==null&&kU(k,_.cliHubVersion)>0){let W=wU(b,U.installTimeoutMs);if(r.push(W.code),W.ok){let X=qv(b);_.cliHubVersion=X}}else if(_.cliHub&&_.cliHubVersion);if(_.metaSkill){let W=XU(U.installScope,b,U.installTimeoutMs,U.skillsBin);if(W.ok||/no update/i.test(W.stderr)){if(!r.includes("skill-already-current"))r.push(W.ok?"skill-upgrade-succeeded":"skill-already-current")}else r.push(W.code)}}return{attempted:!0,codes:r,availability:_,alreadyInitialized:!1}}var FN={limits:{maxLessons:10,maxSlots:20,maxTasks:10},timeouts:{agentmemoryMs:2000,boulderStateMs:1000}};async function xN($,U){let r=performance.now(),b={...FN.limits,...$.limits},v={...FN.timeouts,...$.timeouts},[z,_]=await Promise.allSettled([m2($,U.agentmemory,b,v.agentmemoryMs),T2($,U.boulderState,b,v.boulderStateMs)]),N=[],O={},I=z.status==="fulfilled"?z.value:(ZN(N,O,"agentmemory",MN(z.reason)),DN.agentmemory),k=_.status==="fulfilled"?_.value:(ZN(N,O,"boulderState",MN(_.reason)),DN.boulderState);return{query:$.query,timestampISO:new Date().toISOString(),agentmemory:I,boulderState:k,degradedSources:N,durationMs:performance.now()-r,errorMessages:O}}async function m2($,U,r,b){let v=await gN(U.smartSearch({query:$.query,limit:r.maxLessons}),b,"agentmemory");return{available:!0,lessons:C2(v.lessons).slice(0,r.maxLessons).map((_)=>({id:_.id,title:_.title,advice:_.advice??"info",confidence:_.confidence,concepts:_.concepts}))}}async function T2($,U,r,b){let v=await gN(U.boulderRead({directory:$.directory,sessionID:$.sessionID,query:$.query}),b,"boulderState");return{available:!0,tasks:v.sort((_,N)=>_.priority-N.priority||N.updatedAtMs-_.updatedAtMs).slice(0,r.maxTasks).map((_)=>({id:_.id,status:_.status,title:_.title})),planProgress:c2(v)}}function C2($){return[...$].sort((U,r)=>r.confidence-U.confidence)}function c2($){if($.length===0)return 0;return $.filter((r)=>r.status==="done").length/$.length}function MN($){if($ instanceof Error)return $.message;if(typeof $==="string")return $;return"unknown error"}function ZN($,U,r,b){$.push(r),U[r]=b}var DN={agentmemory:{available:!1,lessons:[]},boulderState:{available:!1,tasks:[],planProgress:0}};async function gN($,U,r){return new Promise((b,v)=>{let z=setTimeout(()=>v(Error(`${r} timeout after ${U}ms`)),U);$.then((_)=>{clearTimeout(z),b(_)},(_)=>{clearTimeout(z),v(_)})})}function Z9(){return{compactBurnRateThreshold:500,compactUsageThreshold:0.85,switchModelUsageThreshold:0.95,delegateConsecutiveHighBurn:5,windowSize:10}}function u2($){if($.length===0)return 0;return $.reduce((r,b)=>r+b,0)/$.length}function h2($,U){let r=0;for(let b=$.length-1;b>=0;b--)if($[b]>=U)r++;else break;return r}function n2($,U,r,b){let v=U-$;if(v<=0)return b;if(r<=0)return null;let z=Math.floor(v/r);if(z<=0)return b;let _=z*2;return new Date(new Date(b).getTime()+_*1000).toISOString()}function RN($){let{currentUsage:U,modelLimit:r,recentTurnTokens:b,timestampISO:v,config:z}=$,_=b.slice(-z.windowSize),N=u2(_),O=r-U,I=r>0?U/r:1,k=Math.min(0.95,0.3+_.length/z.windowSize*0.65),W="no-action",X=[],w="within normal parameters";if(I>=z.switchModelUsageThreshold)w=`context usage ${(I*100).toFixed(1)}% exceeds switch threshold ${(z.switchModelUsageThreshold*100).toFixed(1)}%`,X.push("switch-model");if(I>=z.compactUsageThreshold||N>=z.compactBurnRateThreshold){if(W==="no-action")W="compact-now",w=I>=z.compactUsageThreshold?`context usage ${(I*100).toFixed(1)}% exceeds compact threshold ${(z.compactUsageThreshold*100).toFixed(1)}%`:`burn rate ${N.toFixed(0)} tokens/turn exceeds threshold ${z.compactBurnRateThreshold}`}let j=h2(_,z.compactBurnRateThreshold);if(j>=z.delegateConsecutiveHighBurn&&W==="no-action")w=`${j} consecutive high-burn turns (threshold: ${z.delegateConsecutiveHighBurn})`,X.push("delegate-to-subagent");let B=n2(U,r,N,v);return{currentUsage:U,burnRate:N,budgetLeft:O,willOverflowAt:B,recommendation:W,recommendations:X,confidence:k,modelLimit:r,windowRemaining:Math.max(0,Math.floor(O/Math.max(N,1))),input:{...$},computedAtISO:v,turnsAnalyzed:_.length}}var L$={"oracle-verified":0.25,"no-progress-detector":0.2,"deviation-detector":0.2,"iteration-budget":0.15,"lesson-recall":0.1,"token-predictor":0.1},QU=()=>({continueThreshold:0.3,warnThreshold:0.3,escalateThreshold:0.45,stopThreshold:0.55,paralysisThreshold:3,defaultEscalationTarget:"oracle"});function y2($){let U=[];U.push({source:"oracle-verified",rawScore:$.oracleVerified?0.6:0,weight:L$["oracle-verified"],weightedScore:$.oracleVerified?0.6*L$["oracle-verified"]:0,description:$.oracleVerified?"Oracle verification passed":"No Oracle verification"}),U.push({source:"no-progress-detector",rawScore:$.noProgress?-0.8:0,weight:L$["no-progress-detector"],weightedScore:$.noProgress?-0.8*L$["no-progress-detector"]:0,description:$.noProgress?"No progress detected in last turn":"Progress detected"});let r=f2($.deviations);U.push({source:"deviation-detector",rawScore:r,weight:L$["deviation-detector"],weightedScore:r*L$["deviation-detector"],description:$.deviations.length>0?`${$.deviations.length} deviation(s) detected (worst: ${$.deviations[0].severity})`:"No deviations detected"});let b=i2($.iterationRatio);U.push({source:"iteration-budget",rawScore:b,weight:L$["iteration-budget"],weightedScore:b*L$["iteration-budget"],description:`Iteration ratio: ${$.iterationRatio.toFixed(2)} (${$.ambient.iteration}/${$.ambient.maxIterations})`});let v=l2($.lessonsRelevant);return U.push({source:"lesson-recall",rawScore:v,weight:L$["lesson-recall"],weightedScore:v*L$["lesson-recall"],description:$.lessonsRelevant.length>0?`${$.lessonsRelevant.length} relevant lesson(s) (avg confidence: ${o2($.lessonsRelevant).toFixed(2)})`:"No relevant lessons"}),U}function f2($){if($.length===0)return 0;let U={grave:-0.9,media:-0.5,leve:-0.2},r=0;for(let v of $){let z=U[v.severity]??-0.3;if(z<r)r=z}let b=Math.min($.length*0.05,0.2);return Math.max(r-b,-1)}function i2($){if($<=0.5)return-$*0.6;return-0.3-($-0.5)*1}function l2($){if($.length===0)return 0;let U=0;for(let r of $)U+=({continue:0.3,info:0,warn:-0.3,stop:-0.7}[r.advice]??0)*r.confidence;return Math.max(Math.min(U/$.length,1),-1)}function o2($){if($.length===0)return 0;return $.reduce((U,r)=>U+r.confidence,0)/$.length}function d2($,U){if($>=U.continueThreshold)return"continue";if($<=-U.stopThreshold)return"stop";if($<=-U.escalateThreshold)return"escalate";if($<=-U.warnThreshold)return"warn";return"continue"}function p2($,U){if(!$.oracleVerified)return"oracle";if($.deviations.some((r)=>r.severity==="grave"))return"user";return U.defaultEscalationTarget}function mN($,U,r,b){if(b)return`Paralysis detected: forced continue despite score ${$.toFixed(3)} (too many consecutive stops)`;let v=[...r].sort((I,k)=>I.weightedScore-k.weightedScore),z=v[0],_=v[v.length-1],N=[];if(z.weightedScore<0)N.push(`primary concern: ${z.description}`);if(_.weightedScore>0)N.push(`positive signal: ${_.description}`);return`${{continue:"Continue",warn:"Warn",escalate:"Escalate",stop:"Stop"}[U]} (score: ${$.toFixed(3)}): ${N.join("; ")||"balanced signals"}`}function TN($,U){let r={...QU(),...U};if(!Number.isFinite($.iterationRatio)||!Number.isFinite($.ambient.iteration)||!Number.isFinite($.ambient.maxIterations))return{decision:{action:"continue",score:0,reasoning:"Score neutral: NaN detected in input(s); defaulting to continue.",evidence:[],shouldEscalateTo:null},contributions:[],rawScore:0,paralysisOverride:!1,computedAtISO:new Date().toISOString()};let b=y2($),v=b.reduce((W,X)=>W+X.weightedScore,0),z=Math.max(Math.min(v,1),-1),_=$.slotMemory.consecutiveStops>=r.paralysisThreshold&&z<=-r.warnThreshold,N=_?"continue":d2(z,r),O=[];if(N!=="continue"||Math.abs(z)<r.continueThreshold){for(let W of b)if(Math.abs(W.weightedScore)>0.01)O.push({source:W.source,value:W.description,confidence:Math.abs(W.rawScore),weight:W.weight});if(O.length===0&&N!=="continue")O.push({source:"ambient",value:mN(z,N,b,_),confidence:0.5,weight:0.1})}let I=N==="escalate"?p2($,r):null;return{decision:{action:N,score:z,reasoning:mN(z,N,b,_),evidence:O,shouldEscalateTo:I},contributions:b,rawScore:z,paralysisOverride:_,computedAtISO:new Date().toISOString()}}var YU=()=>({enabled:!0,maxHistoryPerSession:50,forceContinueAfterStops:3,warnMessageTemplate:"[MetaGovernor] Score {score}: {reasoning}. Evidence: {evidenceCount} signal(s).",escalateMessageTemplate:"[MetaGovernor] Escalating to {target}: {reasoning}",stopMessageTemplate:"[MetaGovernor] STOP — {reasoning}. Evidence: {evidenceCount} signal(s)."});function F4($,U){let r=$;for(let[b,v]of Object.entries(U))r=r.replaceAll(`{${b}}`,v);return r}function t2($){return $.length}function CN($,U){let r={...YU(),...U};if(!r.enabled)return{action:"continue",message:null,historyEntry:{decision:$.scoringResult.decision,action:"continue",timestampISO:new Date().toISOString(),sessionID:$.sessionID,reasoning:"Decision handler disabled — pass-through continue"}};let b=$.scoringResult.decision,v=b.score,z=b.reasoning,_=t2(b.evidence),N=b.shouldEscalateTo??r.defaultEscalationTarget??"oracle";if($.scoringResult.paralysisOverride)return{action:"continue",message:F4(r.warnMessageTemplate,{score:v.toFixed(3),reasoning:`Paralysis detected — forced continue. ${z}`,evidenceCount:String(_)}),historyEntry:{decision:b,action:"continue",timestampISO:new Date().toISOString(),sessionID:$.sessionID,reasoning:`Paralysis override: ${z}`}};switch(b.action){case"continue":return{action:"continue",message:null,historyEntry:{decision:b,action:"continue",timestampISO:new Date().toISOString(),sessionID:$.sessionID,reasoning:z}};case"warn":return{action:"warn",message:F4(r.warnMessageTemplate,{score:v.toFixed(3),reasoning:z,evidenceCount:String(_)}),historyEntry:{decision:b,action:"warn",timestampISO:new Date().toISOString(),sessionID:$.sessionID,reasoning:z}};case"escalate":return{action:"escalate",message:F4(r.escalateMessageTemplate,{target:N,reasoning:z}),historyEntry:{decision:b,action:"escalate",timestampISO:new Date().toISOString(),sessionID:$.sessionID,reasoning:`Escalate to ${N}: ${z}`}};case"stop":return{action:"stop",message:F4(r.stopMessageTemplate,{reasoning:z,evidenceCount:String(_)}),historyEntry:{decision:b,action:"stop",timestampISO:new Date().toISOString(),sessionID:$.sessionID,reasoning:z}}}}function g9($,U){if($.length<=U)return{trimmed:[...$],dropped:0};let r=$.length-U;return{trimmed:$.slice(-U),dropped:r}}function R9($){let U=0;for(let r=$.length-1;r>=0;r--)if($[r].action==="stop")U++;else break;return U}var cN={leve:0,media:1,grave:2};function e2($,U,r){let b=`${$}-${U}-${r}`.split("").reduce((v,z)=>(v<<5)-v+z.charCodeAt(0)|0,0);return`D-${Math.abs(b).toString(36)}`}function uN($,U){let r=cN[U]??0;return $.some((b)=>(cN[b.severity]??0)>=r)}function a2($,U=[]){let r=new Set;for(let b of $)if(r.add(b.category),r.add(b.severity),b.filePath){let v=b.filePath.split("/").pop()??b.filePath;r.add(v)}for(let b of U){let v=b.split("/").pop()??b;if(v)r.add(v)}return[...r]}function s2($,U){let r=U.map((b)=>`[${b.severity}] ${b.category}: ${b.detail}`).join("; ");return`Action "${$.action}" (score ${$.score.toFixed(2)}) after deviations: ${r}. Reasoning: ${$.reasoning}`}async function hN($,U){let{decision:r,config:b,sessionID:v,directory:z,filesChanged:_}=$,N=new Date().toISOString();if(!b.enabled)return{lessonSaved:null,decisionSaved:null,reason:"closed-loop learning disabled"};if(r.evidence.length===0&&r.action==="continue")return{lessonSaved:null,decisionSaved:null,reason:"no deviations to learn from"};let O=null,I=null;if(b.saveDecisions){let j={id:e2(v,r.action,N),timestampISO:N,action:r.action,score:r.score,reasoning:r.reasoning,sessionID:v,directory:z,deviations:r.evidence.filter((B)=>B.source==="deviation-detector").map((B)=>({severity:"media",category:B.source,detail:B.value}))};try{await U.saveMemory({content:`Decision: ${r.action} (score ${r.score.toFixed(2)}). ${r.reasoning}`,concepts:["meta-governor","decision",r.action],type:"fact",files:[..._]}),I=j}catch{}}let k=r.evidence.filter((j)=>j.source==="deviation-detector").map((j)=>({severity:"media",category:j.source,detail:j.value})),W=$.currentLessonCount??0;if(W>=b.maxLessonsPerSession)return{lessonSaved:null,decisionSaved:I,reason:`maxLessonsPerSession cap reached (${W} >= ${b.maxLessonsPerSession})`};let X=b.saveLessons!==!1;if(X&&uN(k,b.minSeverityToLearn)){let j=a2(k,_),B=s2(r,k);try{O={id:(await U.saveLesson({content:B,context:`session:${v} dir:${z}`,confidence:Math.max(0.3,Math.min(0.8,Math.abs(r.score))),tags:j})).id,title:`${r.action} after ${k[0]?.category??"deviation"}`,content:B,type:"pattern",concepts:j,confidence:Math.max(0.3,Math.min(0.8,Math.abs(r.score))),files:[..._],sessionID:v}}catch{}}let w=[];if(I)w.push("decision saved");if(O)w.push("lesson saved");if(!I&&!O)if(!X)w.push("saveLessons disabled");else if(!uN(k,b.minSeverityToLearn))w.push("severity below threshold");else w.push("no saveable content");return{lessonSaved:O,decisionSaved:I,reason:w.join("; ")||"no action taken"}}function M4(){return{enabled:!0,minSeverityToLearn:"media",maxLessonsPerSession:20,saveDecisions:!0,saveLessons:!0}}var $J=()=>({enabled:!0,memory:{enabled:!0,query:"",timeoutMs:3000},tokenPredictor:{},scoring:{},decision:{},closedLoop:{},intervention:{mode:"silent",includeDecisionHistory:!0,maxHistoryMessages:5,minActionForMessage:"stop",maxInterventionsPerSession:3,respectDoneSignal:!0,phaseAwareDoneSignal:!1,persistToSession:!0},protocolEnforcement:{enabled:!1,path:void 0,injectIntoSystem:!1,auditToolCalls:!1},skillPriming:{enabled:!1,trigger:"firstImplement",router:"both"},graphSync:{killOrphanedOnInit:!0,reindexOnFetch:!0,fetchBranch:"main",autoUpgrade:!0,upgradeCachePath:void 0,checkGraphifyNeedsUpdate:!0,addToGlobalGraph:!1},graphRetrieval:{preferredTool:"auto",preferLocalCodegraph:!1,contextRouting:!1},cliAnything:{enabled:!0,autoInstall:!0,autoUpgrade:!0,cachePath:void 0,upgradeCheckTtlMs:void 0,cliHubBin:"cli-hub",skillsBin:"npx skills",installScope:"global"}}),jU={query:"",timestampISO:new Date().toISOString(),agentmemory:{available:!1,lessons:[]},boulderState:{available:!1,tasks:[],planProgress:0},degradedSources:["agentmemory","boulderState"]},vJ={consecutiveStops:0,consecutiveContinues:0,lastUpdatedISO:new Date().toISOString()},UJ={action:"continue",message:null,historyEntry:{decision:{action:"continue",score:0,reasoning:"no decision made",evidence:[],shouldEscalateTo:null},action:"continue",timestampISO:new Date().toISOString(),sessionID:"",reasoning:"no decision made"}};function rJ($,U=jU){let r=$.maxIterations>0?$.iteration/$.maxIterations:0,b={...vJ,consecutiveStops:$.consecutiveStops??0};return{oracleVerified:$.oracleVerified,noProgress:$.noProgress,deviations:$.deviations,iterationRatio:r,lessonsRelevant:U.agentmemory.lessons,slotMemory:b,ambient:{sessionID:$.sessionID,directory:".",mode:"simple",agentName:$.agentName??"unknown",iteration:$.iteration,maxIterations:$.maxIterations}}}async function yN($,U={}){let r={...$J(),...U};if(!r.enabled)return{memoryRead:jU,tokenPrediction:nN($),scoringResult:{decision:{action:"continue",score:0,reasoning:"MetaGovernor disabled",evidence:[],shouldEscalateTo:null},contributions:[],rawScore:0,paralysisOverride:!1,computedAtISO:new Date().toISOString()},decision:UJ,lessonSaved:null,decisionHistory:[],skipped:!0,skipReason:"disabled"};let b=jU;if(r.memory.enabled)try{let I={agentmemory:$.backends.agentmemory,boulderState:$.backends.boulderState};b=await xN({directory:".",sessionID:$.sessionID,query:r.memory.query||$.toolName},I)}catch{}let v;try{v=RN({currentUsage:$.recentTurnTokens.reduce((I,k)=>I+k,0),modelLimit:$.modelLimit??U.modelOverride?.modelLimit??200000,recentTurnTokens:$.recentTurnTokens,timestampISO:new Date().toISOString(),providerID:$.providerID??"",modelID:$.modelID??"",config:r.tokenPredictor})}catch{v=nN($)}let z=TN(rJ($,b),r.scoring),_={sessionID:$.sessionID,scoringResult:z},N=CN(_,r.decision),O=null;try{if(r.closedLoop.enabled!==!1)O=await hN({decision:N.historyEntry.decision,memoryRead:b,config:{...M4(),...r.closedLoop},sessionID:$.sessionID,directory:".",filesChanged:$.filePaths??[],currentLessonCount:$.currentLessonCount},$.writeBackend)}catch{}return{memoryRead:b,tokenPrediction:v,scoringResult:z,decision:N,lessonSaved:O,decisionHistory:[N.historyEntry],skipped:!1}}function nN($){let U=$.recentTurnTokens.reduce((r,b)=>r+b,0);return{burnRate:0,budgetLeft:200000,currentUsage:U,modelLimit:200000,willOverflowAt:null,recommendation:"no-action",confidence:1,windowRemaining:200000,input:{currentUsage:U,modelLimit:200000,recentTurnTokens:$.recentTurnTokens,timestampISO:new Date().toISOString(),providerID:$.providerID??"",modelID:$.modelID??"",config:{compactBurnRateThreshold:500,compactUsageThreshold:0.85,switchModelUsageThreshold:0.95,delegateConsecutiveHighBurn:5,windowSize:10}},computedAtISO:new Date().toISOString(),turnsAnalyzed:$.recentTurnTokens.length,recommendations:[]}}import{Database as bJ}from"bun:sqlite";import{existsSync as zJ,mkdirSync as _J}from"node:fs";import{join as fN}from"node:path";import{homedir as NJ}from"node:os";function OJ(){let $=fN(NJ(),".omo-meta-governor");if(!zJ($))_J($,{recursive:!0});return fN($,"meta-governor.db")}var iN="1",IJ=`
|
|
37
|
+
… (${n.length-r} chars truncated) …`}var Jb;var Wp=Ge(()=>{Jb={enabled:!0,workflow:"CI",pollIntervalMs:15000,maxWaitMs:600000,failOnly:!0}});Rr();Tr();import{randomUUID as Nw,createHash as Qb}from"node:crypto";import{fileURLToPath as e_}from"node:url";ot();import{existsSync as Vf,readFileSync as Wf,writeFileSync as Bf,mkdirSync as Hf}from"node:fs";import{dirname as Jf}from"node:path";function qf(e){if(!Vf(e))return null;try{return JSON.parse(Wf(e,"utf8"))}catch{return null}}function Kf(e,r){try{Hf(Jf(e),{recursive:!0}),Bf(e,JSON.stringify(r,null,2),"utf8")}catch{}}async function Lu(e={}){let r={enabled:e.enabled??!0,autoInstall:e.autoInstall??!0,autoUpgrade:e.autoUpgrade??!0,cachePath:e.cachePath??`${process.env.HOME||process.env.USERPROFILE||"~"}/.config/opencode/omo-cli-anything-upgrade-check.json`,upgradeCheckTtlMs:e.upgradeCheckTtlMs??86400000,projectDir:e.projectDir,runner:e.runner,installScope:e.installScope??"global",cliHubBin:e.cliHubBin,skillsBin:e.skillsBin,installTimeoutMs:e.installTimeoutMs??60000};if(!r.enabled)return{attempted:!1,codes:["cli-anything-upgrade-skipped"],availability:{cliHub:!1,cliHubVersion:null,metaSkill:!1},alreadyInitialized:!0};let n=[],o=r.runner??((s,c)=>{let{execSync:l}=we("node:child_process");return l(s,{timeout:c?.timeoutMs??1e4,encoding:"utf8",stdio:["ignore","pipe","pipe"]})}),t=Tt(o),i=Oo(r.installScope,o,1e4,r.skillsBin),a={cliHub:t!==null,cliHubVersion:t,metaSkill:i};if(t===null&&r.autoInstall){let s=wo(o,r.installTimeoutMs);if(n.push(s.code),s.ok){let c=Tt(o);a.cliHub=!0,a.cliHubVersion=c}}else if(t!==null)n.push("cli-anything-already-installed");if(!i&&r.autoInstall){let s=Io(r.installScope,o,r.installTimeoutMs,r.skillsBin);if(n.push(s.code),s.ok)a.metaSkill=!0}else if(i)n.push("skill-already-current");if(r.autoUpgrade){let s=qf(r.cachePath),c=Date.now(),l=!0;if(s?.updatedAtISO){let v=Date.parse(s.updatedAtISO);if(Number.isFinite(v)&&c-v<r.upgradeCheckTtlMs)l=!1}let d=s?.cliHubLatestVersion??null;if(l)d=$o(o),Kf(r.cachePath,{cliHubLatestVersion:d,metaSkillLastCheckedISO:new Date(c).toISOString(),updatedAtISO:new Date(c).toISOString()});if(a.cliHub&&d!==null&&a.cliHubVersion!==null&&xo(d,a.cliHubVersion)>0){let v=So(o,r.installTimeoutMs);if(n.push(v.code),v.ok){let h=Tt(o);a.cliHubVersion=h}}else if(a.cliHub&&a.cliHubVersion);if(a.metaSkill){let v=To(r.installScope,o,r.installTimeoutMs,r.skillsBin);if(v.ok||/no update/i.test(v.stderr)){if(!n.includes("skill-already-current"))n.push(v.ok?"skill-upgrade-succeeded":"skill-already-current")}else n.push(v.code)}}return{attempted:!0,codes:n,availability:a,alreadyInitialized:!1}}var Zu={limits:{maxLessons:10,maxSlots:20,maxTasks:10},timeouts:{agentmemoryMs:2000,boulderStateMs:1000}};async function Wu(e,r){let n=performance.now(),o={...Zu.limits,...e.limits},t={...Zu.timeouts,...e.timeouts},[i,a]=await Promise.allSettled([Xf(e,r.agentmemory,o,t.agentmemoryMs),Yf(e,r.boulderState,o,t.boulderStateMs)]),s=[],c={},l=i.status==="fulfilled"?i.value:(Gu(s,c,"agentmemory",Fu(i.reason)),Vu.agentmemory),d=a.status==="fulfilled"?a.value:(Gu(s,c,"boulderState",Fu(a.reason)),Vu.boulderState);return{query:e.query,timestampISO:new Date().toISOString(),agentmemory:l,boulderState:d,degradedSources:s,durationMs:performance.now()-n,errorMessages:c}}async function Xf(e,r,n,o){let t=await Bu(r.smartSearch({query:e.query,limit:n.maxLessons}),o,"agentmemory");return{available:!0,lessons:Qf(t.lessons).slice(0,n.maxLessons).map((a)=>({id:a.id,title:a.title,advice:a.advice??"info",confidence:a.confidence,concepts:a.concepts}))}}async function Yf(e,r,n,o){let t=await Bu(r.boulderRead({directory:e.directory,sessionID:e.sessionID,query:e.query}),o,"boulderState");return{available:!0,tasks:t.sort((a,s)=>a.priority-s.priority||s.updatedAtMs-a.updatedAtMs).slice(0,n.maxTasks).map((a)=>({id:a.id,status:a.status,title:a.title})),planProgress:eg(t)}}function Qf(e){return[...e].sort((r,n)=>n.confidence-r.confidence)}function eg(e){if(e.length===0)return 0;return e.filter((n)=>n.status==="done").length/e.length}function Fu(e){if(e instanceof Error)return e.message;if(typeof e==="string")return e;return"unknown error"}function Gu(e,r,n,o){e.push(n),r[n]=o}var Vu={agentmemory:{available:!1,lessons:[]},boulderState:{available:!1,tasks:[],planProgress:0}};async function Bu(e,r,n){return new Promise((o,t)=>{let i=setTimeout(()=>t(Error(`${n} timeout after ${r}ms`)),r);e.then((a)=>{clearTimeout(i),o(a)},(a)=>{clearTimeout(i),t(a)})})}function H_(){return{compactBurnRateThreshold:500,compactUsageThreshold:0.85,switchModelUsageThreshold:0.95,delegateConsecutiveHighBurn:5,windowSize:10}}function tg(e){if(e.length===0)return 0;return e.reduce((n,o)=>n+o,0)/e.length}function rg(e,r){let n=0;for(let o=e.length-1;o>=0;o--)if(e[o]>=r)n++;else break;return n}function ng(e,r,n,o){let t=r-e;if(t<=0)return o;if(n<=0)return null;let i=Math.floor(t/n);if(i<=0)return o;let a=i*2;return new Date(new Date(o).getTime()+a*1000).toISOString()}function Hu(e){let{currentUsage:r,modelLimit:n,recentTurnTokens:o,timestampISO:t,config:i}=e,a=o.slice(-i.windowSize),s=tg(a),c=n-r,l=n>0?r/n:1,d=Math.min(0.95,0.3+a.length/i.windowSize*0.65),v="no-action",h=[],u="within normal parameters";if(l>=i.switchModelUsageThreshold)u=`context usage ${(l*100).toFixed(1)}% exceeds switch threshold ${(i.switchModelUsageThreshold*100).toFixed(1)}%`,h.push("switch-model");if(l>=i.compactUsageThreshold||s>=i.compactBurnRateThreshold){if(v==="no-action")v="compact-now",u=l>=i.compactUsageThreshold?`context usage ${(l*100).toFixed(1)}% exceeds compact threshold ${(i.compactUsageThreshold*100).toFixed(1)}%`:`burn rate ${s.toFixed(0)} tokens/turn exceeds threshold ${i.compactBurnRateThreshold}`}let y=rg(a,i.compactBurnRateThreshold);if(y>=i.delegateConsecutiveHighBurn&&v==="no-action")u=`${y} consecutive high-burn turns (threshold: ${i.delegateConsecutiveHighBurn})`,h.push("delegate-to-subagent");let x=ng(r,n,s,t);return{currentUsage:r,burnRate:s,budgetLeft:c,willOverflowAt:x,recommendation:v,recommendations:h,confidence:d,modelLimit:n,windowRemaining:Math.max(0,Math.floor(c/Math.max(s,1))),input:{...e},computedAtISO:t,turnsAnalyzed:a.length}}var Se={"oracle-verified":0.25,"no-progress-detector":0.2,"deviation-detector":0.2,"iteration-budget":0.15,"lesson-recall":0.1,"token-predictor":0.1},Do=()=>({continueThreshold:0.3,warnThreshold:0.3,escalateThreshold:0.45,stopThreshold:0.55,paralysisThreshold:3,defaultEscalationTarget:"oracle"});function og(e,r){let n=[];n.push({source:"oracle-verified",rawScore:e.oracleVerified?0.6:0,weight:Se["oracle-verified"],weightedScore:e.oracleVerified?0.6*Se["oracle-verified"]:0,description:e.oracleVerified?"Oracle verification passed":"No Oracle verification"}),n.push({source:"no-progress-detector",rawScore:e.noProgress?-0.8:0,weight:Se["no-progress-detector"],weightedScore:e.noProgress?-0.8*Se["no-progress-detector"]:0,description:e.noProgress?"No progress detected in last turn":"Progress detected"});let o=ig(e.deviations,r),t=60000,i=e.deviations.filter((c)=>c.ts===void 0||r-c.ts<=t);n.push({source:"deviation-detector",rawScore:o,weight:Se["deviation-detector"],weightedScore:o*Se["deviation-detector"],description:i.length>0?`${i.length} deviation(s) detected (worst: ${i[0].severity})`:"No deviations detected"});let a=ag(e.iterationRatio);n.push({source:"iteration-budget",rawScore:a,weight:Se["iteration-budget"],weightedScore:a*Se["iteration-budget"],description:`Iteration ratio: ${e.iterationRatio.toFixed(2)} (${e.ambient.iteration}/${e.ambient.maxIterations})`});let s=sg(e.lessonsRelevant);return n.push({source:"lesson-recall",rawScore:s,weight:Se["lesson-recall"],weightedScore:s*Se["lesson-recall"],description:e.lessonsRelevant.length>0?`${e.lessonsRelevant.length} relevant lesson(s) (avg confidence: ${cg(e.lessonsRelevant).toFixed(2)})`:"No relevant lessons"}),n}function ig(e,r=Date.now()){let o=e.filter((s)=>s.ts===void 0||r-s.ts<=60000);if(o.length===0)return 0;let t={grave:-0.9,media:-0.5,leve:-0.2},i=0;for(let s of o){let c=t[s.severity]??-0.3;if(c<i)i=c}let a=Math.min(o.length*0.05,0.2);return Math.max(i-a,-1)}function ag(e){if(e<=0.5)return-e*0.6;return-0.3-(e-0.5)*1}function sg(e){if(e.length===0)return 0;let r=0;for(let n of e)r+=({continue:0.3,info:0,warn:-0.3,stop:-0.7}[n.advice]??0)*n.confidence;return Math.max(Math.min(r/e.length,1),-1)}function cg(e){if(e.length===0)return 0;return e.reduce((r,n)=>r+n.confidence,0)/e.length}function lg(e,r){if(e>=r.continueThreshold)return"continue";if(e<=-r.stopThreshold)return"stop";if(e<=-r.escalateThreshold)return"escalate";if(e<=-r.warnThreshold)return"warn";return"continue"}function ug(e,r){if(!e.oracleVerified)return"oracle";if(e.deviations.some((n)=>n.severity==="grave"))return"user";return r.defaultEscalationTarget}function Ju(e,r,n,o){if(o)return`Paralysis detected: forced continue despite score ${e.toFixed(3)} (too many consecutive stops)`;let t=[...n].sort((l,d)=>l.weightedScore-d.weightedScore),i=t[0],a=t[t.length-1],s=[];if(i.weightedScore<0)s.push(`primary concern: ${i.description}`);if(a.weightedScore>0)s.push(`positive signal: ${a.description}`);return`${{continue:"Continue",warn:"Warn",escalate:"Escalate",stop:"Stop"}[r]} (score: ${e.toFixed(3)}): ${s.join("; ")||"balanced signals"}`}function qu(e,r,n=Date.now()){let o={...Do(),...r},t=e.deviations.map((u)=>({...u}));if(!Number.isFinite(e.iterationRatio)||!Number.isFinite(e.ambient.iteration)||!Number.isFinite(e.ambient.maxIterations))return{decision:{action:"continue",score:0,reasoning:"Score neutral: NaN detected in input(s); defaulting to continue.",evidence:[],shouldEscalateTo:null},contributions:[],rawScore:0,paralysisOverride:!1,computedAtISO:new Date().toISOString()};let i=og(e,n),a=i.reduce((u,y)=>u+y.weightedScore,0),s=Math.max(Math.min(a,1),-1),c=e.slotMemory.consecutiveStops>=o.paralysisThreshold&&s<=-o.warnThreshold,l=c?"continue":lg(s,o),d=[];if(l!=="continue"||Math.abs(s)<o.continueThreshold){for(let u of i)if(Math.abs(u.weightedScore)>0.01)d.push({source:u.source,value:u.description,confidence:Math.abs(u.rawScore),weight:u.weight});if(d.length===0&&l!=="continue")d.push({source:"ambient",value:Ju(s,l,i,c),confidence:0.5,weight:0.1})}let v=l==="escalate"?ug(e,o):null;return{decision:{action:l,score:s,reasoning:Ju(s,l,i,c),evidence:d,shouldEscalateTo:v},contributions:i,rawScore:s,paralysisOverride:c,computedAtISO:new Date().toISOString()}}var Po=()=>({enabled:!0,maxHistoryPerSession:50,forceContinueAfterStops:3,warnMessageTemplate:"[MetaGovernor] Score {score}: {reasoning}. Evidence: {evidenceCount} signal(s).",escalateMessageTemplate:"[MetaGovernor] Escalating to {target}: {reasoning}",stopMessageTemplate:"[MetaGovernor] STOP — {reasoning}. Evidence: {evidenceCount} signal(s)."});function Nr(e,r){let n=e;for(let[o,t]of Object.entries(r))n=n.replaceAll(`{${o}}`,t);return n}function dg(e){return e.length}function Ku(e,r){let n={...Po(),...r};if(!n.enabled)return{action:"continue",message:null,historyEntry:{decision:e.scoringResult.decision,action:"continue",timestampISO:new Date().toISOString(),sessionID:e.sessionID,reasoning:"Decision handler disabled — pass-through continue"}};let o=e.scoringResult.decision,t=o.score,i=o.reasoning,a=dg(o.evidence),s=o.shouldEscalateTo??n.defaultEscalationTarget??"oracle";if(e.scoringResult.paralysisOverride)return{action:"continue",message:Nr(n.warnMessageTemplate,{score:t.toFixed(3),reasoning:`Paralysis detected — forced continue. ${i}`,evidenceCount:String(a)}),historyEntry:{decision:o,action:"continue",timestampISO:new Date().toISOString(),sessionID:e.sessionID,reasoning:`Paralysis override: ${i}`}};switch(o.action){case"continue":return{action:"continue",message:null,historyEntry:{decision:o,action:"continue",timestampISO:new Date().toISOString(),sessionID:e.sessionID,reasoning:i}};case"warn":return{action:"warn",message:Nr(n.warnMessageTemplate,{score:t.toFixed(3),reasoning:i,evidenceCount:String(a)}),historyEntry:{decision:o,action:"warn",timestampISO:new Date().toISOString(),sessionID:e.sessionID,reasoning:i}};case"escalate":return{action:"escalate",message:Nr(n.escalateMessageTemplate,{target:s,reasoning:i}),historyEntry:{decision:o,action:"escalate",timestampISO:new Date().toISOString(),sessionID:e.sessionID,reasoning:`Escalate to ${s}: ${i}`}};case"stop":return{action:"stop",message:Nr(n.stopMessageTemplate,{reasoning:i,evidenceCount:String(a)}),historyEntry:{decision:o,action:"stop",timestampISO:new Date().toISOString(),sessionID:e.sessionID,reasoning:i}}}}function K_(e,r){if(e.length<=r)return{trimmed:[...e],dropped:0};let n=e.length-r;return{trimmed:e.slice(-r),dropped:n}}function X_(e){let r=0;for(let n=e.length-1;n>=0;n--)if(e[n].action==="stop")r++;else break;return r}var Xu={leve:0,media:1,grave:2};function mg(e,r,n){let o=`${e}-${r}-${n}`.split("").reduce((t,i)=>(t<<5)-t+i.charCodeAt(0)|0,0);return`D-${Math.abs(o).toString(36)}`}function Yu(e,r){let n=Xu[r]??0;return e.some((o)=>(Xu[o.severity]??0)>=n)}function pg(e,r=[]){let n=new Set;for(let o of e)if(n.add(o.category),n.add(o.severity),o.filePath){let t=o.filePath.split("/").pop()??o.filePath;n.add(t)}for(let o of r){let t=o.split("/").pop()??o;if(t)n.add(t)}return[...n]}function fg(e,r){let n=r.map((o)=>`[${o.severity}] ${o.category}: ${o.detail}`).join("; ");return`Action "${e.action}" (score ${e.score.toFixed(2)}) after deviations: ${n}. Reasoning: ${e.reasoning}`}async function Qu(e,r){let{decision:n,config:o,sessionID:t,directory:i,filesChanged:a}=e,s=new Date().toISOString();if(!o.enabled)return{lessonSaved:null,decisionSaved:null,reason:"closed-loop learning disabled"};if(n.evidence.length===0&&n.action==="continue")return{lessonSaved:null,decisionSaved:null,reason:"no deviations to learn from"};let c=null,l=null;if(o.saveDecisions){let y={id:mg(t,n.action,s),timestampISO:s,action:n.action,score:n.score,reasoning:n.reasoning,sessionID:t,directory:i,deviations:n.evidence.filter((x)=>x.source==="deviation-detector").map((x)=>({severity:"media",category:x.source,detail:x.value}))};try{await r.saveMemory({content:`Decision: ${n.action} (score ${n.score.toFixed(2)}). ${n.reasoning}`,concepts:["meta-governor","decision",n.action],type:"fact",files:[...a]}),l=y}catch{}}let d=n.evidence.filter((y)=>y.source==="deviation-detector").map((y)=>({severity:"media",category:y.source,detail:y.value})),v=e.currentLessonCount??0;if(v>=o.maxLessonsPerSession)return{lessonSaved:null,decisionSaved:l,reason:`maxLessonsPerSession cap reached (${v} >= ${o.maxLessonsPerSession})`};let h=o.saveLessons!==!1;if(h&&Yu(d,o.minSeverityToLearn)){let y=pg(d,a),x=fg(n,d);try{c={id:(await r.saveLesson({content:x,context:`session:${t} dir:${i}`,confidence:Math.max(0.3,Math.min(0.8,Math.abs(n.score))),tags:y})).id,title:`${n.action} after ${d[0]?.category??"deviation"}`,content:x,type:"pattern",concepts:y,confidence:Math.max(0.3,Math.min(0.8,Math.abs(n.score))),files:[...a],sessionID:t}}catch{}}let u=[];if(l)u.push("decision saved");if(c)u.push("lesson saved");if(!l&&!c)if(!h)u.push("saveLessons disabled");else if(!Yu(d,o.minSeverityToLearn))u.push("severity below threshold");else u.push("no saveable content");return{lessonSaved:c,decisionSaved:l,reason:u.join("; ")||"no action taken"}}function Ur(){return{enabled:!0,minSeverityToLearn:"media",maxLessonsPerSession:20,saveDecisions:!0,saveLessons:!0}}var gg=()=>({enabled:!0,memory:{enabled:!0,query:"",timeoutMs:3000},tokenPredictor:{},scoring:{},decision:{},closedLoop:{},intervention:{mode:"silent",includeDecisionHistory:!0,maxHistoryMessages:5,minActionForMessage:"stop",maxInterventionsPerSession:3,respectDoneSignal:!0,phaseAwareDoneSignal:!1,persistToSession:!0},protocolEnforcement:{enabled:!1,path:void 0,injectIntoSystem:!1,auditToolCalls:!1},skillPriming:{enabled:!1,trigger:"firstImplement",router:"both"},graphSync:{killOrphanedOnInit:!0,reindexOnFetch:!0,fetchBranch:"main",autoUpgrade:!0,upgradeCachePath:void 0,checkGraphifyNeedsUpdate:!0,addToGlobalGraph:!1},graphRetrieval:{preferredTool:"auto",preferLocalCodegraph:!1,contextRouting:!1},cliAnything:{enabled:!0,autoInstall:!0,autoUpgrade:!0,cachePath:void 0,upgradeCheckTtlMs:void 0,cliHubBin:"cli-hub",skillsBin:"npx skills",installScope:"global"}}),zo={query:"",timestampISO:new Date().toISOString(),agentmemory:{available:!1,lessons:[]},boulderState:{available:!1,tasks:[],planProgress:0},degradedSources:["agentmemory","boulderState"]},hg={consecutiveStops:0,consecutiveContinues:0,lastUpdatedISO:new Date().toISOString()},vg={action:"continue",message:null,historyEntry:{decision:{action:"continue",score:0,reasoning:"no decision made",evidence:[],shouldEscalateTo:null},action:"continue",timestampISO:new Date().toISOString(),sessionID:"",reasoning:"no decision made"}};function yg(e,r=zo){let n=e.maxIterations>0?e.iteration/e.maxIterations:0,o={...hg,consecutiveStops:e.consecutiveStops??0};return{oracleVerified:e.oracleVerified,noProgress:e.noProgress,deviations:e.deviations,iterationRatio:n,lessonsRelevant:r.agentmemory.lessons,slotMemory:o,ambient:{sessionID:e.sessionID,directory:".",mode:"simple",agentName:e.agentName??"unknown",iteration:e.iteration,maxIterations:e.maxIterations}}}async function td(e,r={}){let n={...gg(),...r};if(!n.enabled)return{memoryRead:zo,tokenPrediction:ed(e),scoringResult:{decision:{action:"continue",score:0,reasoning:"MetaGovernor disabled",evidence:[],shouldEscalateTo:null},contributions:[],rawScore:0,paralysisOverride:!1,computedAtISO:new Date().toISOString()},decision:vg,lessonSaved:null,decisionHistory:[],skipped:!0,skipReason:"disabled"};let o=zo;if(n.memory.enabled)try{let l={agentmemory:e.backends.agentmemory,boulderState:e.backends.boulderState};o=await Wu({directory:".",sessionID:e.sessionID,query:n.memory.query||e.toolName},l)}catch{}let t;try{t=Hu({currentUsage:e.recentTurnTokens.reduce((l,d)=>l+d,0),modelLimit:e.modelLimit??r.modelOverride?.modelLimit??200000,recentTurnTokens:e.recentTurnTokens,timestampISO:new Date().toISOString(),providerID:e.providerID??"",modelID:e.modelID??"",config:n.tokenPredictor})}catch{t=ed(e)}let i=qu(yg(e,o),n.scoring),a={sessionID:e.sessionID,scoringResult:i},s=Ku(a,n.decision),c=null;try{if(n.closedLoop.enabled!==!1)c=await Qu({decision:s.historyEntry.decision,memoryRead:o,config:{...Ur(),...n.closedLoop},sessionID:e.sessionID,directory:".",filesChanged:e.filePaths??[],currentLessonCount:e.currentLessonCount},e.writeBackend)}catch{}return{memoryRead:o,tokenPrediction:t,scoringResult:i,decision:s,lessonSaved:c,decisionHistory:[s.historyEntry],skipped:!1}}function ed(e){let r=e.recentTurnTokens.reduce((n,o)=>n+o,0);return{burnRate:0,budgetLeft:200000,currentUsage:r,modelLimit:200000,willOverflowAt:null,recommendation:"no-action",confidence:1,windowRemaining:200000,input:{currentUsage:r,modelLimit:200000,recentTurnTokens:e.recentTurnTokens,timestampISO:new Date().toISOString(),providerID:e.providerID??"",modelID:e.modelID??"",config:{compactBurnRateThreshold:500,compactUsageThreshold:0.85,switchModelUsageThreshold:0.95,delegateConsecutiveHighBurn:5,windowSize:10}},computedAtISO:new Date().toISOString(),turnsAnalyzed:e.recentTurnTokens.length,recommendations:[]}}import{Database as bg}from"bun:sqlite";import{existsSync as _g,mkdirSync as kg}from"node:fs";import{join as rd}from"node:path";import{homedir as $g}from"node:os";function xg(){let e=rd($g(),".omo-meta-governor");if(!_g(e))kg(e,{recursive:!0});return rd(e,"meta-governor.db")}var nd="1",wg=`
|
|
38
38
|
CREATE TABLE IF NOT EXISTS _meta (
|
|
39
39
|
key TEXT PRIMARY KEY,
|
|
40
40
|
value TEXT NOT NULL
|
|
@@ -94,7 +94,7 @@ CREATE TABLE IF NOT EXISTS boulder_tasks (
|
|
|
94
94
|
CREATE INDEX IF NOT EXISTS idx_entries_kind ON entries(kind);
|
|
95
95
|
CREATE INDEX IF NOT EXISTS idx_entries_session ON entries(session_id, directory);
|
|
96
96
|
CREATE INDEX IF NOT EXISTS idx_boulder_dir_session ON boulder_tasks(directory, session_id);
|
|
97
|
-
`;function
|
|
97
|
+
`;function od(e){let r=Date.now().toString(36),n=Math.floor(Math.random()*65535).toString(36);return`${e}-${r}-${n}`}class ad{db;stmts;constructor(e){let r=e??xg();this.db=new bg(r,{create:!0}),this.db.exec("PRAGMA journal_mode = WAL;"),this.db.exec("PRAGMA synchronous = NORMAL;"),this.db.exec("PRAGMA foreign_keys = ON;"),this.db.exec("PRAGMA busy_timeout = 5000;"),this.db.exec(wg);let n=this.db.query("SELECT value FROM _meta WHERE key = 'schema_version'").get();if(!n)this.db.query("INSERT INTO _meta (key, value) VALUES ('schema_version', ?)").run(nd);else if(n.value!==nd);this.stmts={insertEntry:this.db.prepare(`
|
|
98
98
|
INSERT INTO entries (id, kind, title, content, context, advice, confidence, tags, files, session_id, directory, created_at)
|
|
99
99
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
100
100
|
`),ftsSearch:this.db.prepare(`
|
|
@@ -109,116 +109,116 @@ CREATE INDEX IF NOT EXISTS idx_boulder_dir_session ON boulder_tasks(directory, s
|
|
|
109
109
|
FROM boulder_tasks
|
|
110
110
|
WHERE directory = ? AND session_id = ?
|
|
111
111
|
ORDER BY priority ASC, updated_at_ms DESC
|
|
112
|
-
`)}}saveMemory(
|
|
113
|
-
`)[0]??"lesson").slice(0,80);return this.stmts.insertEntry.run(U,"lesson",b,$.content,$.context,null,r,JSON.stringify($.tags??[]),JSON.stringify([]),"","",Date.now()),Promise.resolve({id:U})}smartSearch($){let U=$.limit??10,r=this.toFtsQuery($.query),v=this.stmts.ftsSearch.all(r,U).map((z)=>({id:z.id,title:z.title,content:z.content,type:z.kind,concepts:oN(z.tags),confidence:z.confidence,files:oN(z.files),advice:z.advice??"info"}));return Promise.resolve({lessons:v,crystals:[]})}boulderRead($){let r=this.stmts.boulderSelect.all($.directory,$.sessionID).map((b)=>({id:b.id,title:b.title,priority:b.priority,status:b.status,description:b.description,createdAtMs:b.created_at_ms,updatedAtMs:b.updated_at_ms}));if($.query){let b=$.query.toLowerCase();r=r.filter((v)=>v.title.toLowerCase().includes(b)||v.description.toLowerCase().includes(b))}return Promise.resolve(r)}close(){this.db.close()}toFtsQuery($){let U=$.trim().split(/\s+/).filter(Boolean).map((r)=>r.replace(/["()*]/g,"")).filter(Boolean);if(U.length===0)return'""';return U.map((r)=>`"${r}"*`).join(" ")}}function oN($){try{let U=JSON.parse($);return Array.isArray(U)?U:[]}catch{return[]}}var PU=null;function Z4(){if(!PU)PU=new dN;return PU}var c6={};k$(c6,{xid:()=>tw,void:()=>VK,uuidv7:()=>nw,uuidv6:()=>hw,uuidv4:()=>uw,uuid:()=>cw,util:()=>P,url:()=>yw,uppercase:()=>pv,unknown:()=>Xv,union:()=>sz,undefined:()=>jK,ulid:()=>pw,uint64:()=>QK,uint32:()=>KK,tuple:()=>fO,trim:()=>v4,treeifyError:()=>MU,transform:()=>U_,toUpperCase:()=>r4,toLowerCase:()=>U4,toJSONSchema:()=>Xz,templateLiteral:()=>TK,symbol:()=>YK,superRefine:()=>WI,success:()=>gK,stringbool:()=>yK,stringFormat:()=>_K,string:()=>Zz,strictObject:()=>HK,startsWith:()=>ev,size:()=>lv,setErrorMap:()=>oK,set:()=>FK,safeParseAsync:()=>Bz,safeParse:()=>qz,safeEncodeAsync:()=>Fz,safeEncode:()=>Gz,safeDecodeAsync:()=>Mz,safeDecode:()=>Sz,registry:()=>r6,regexes:()=>W$,regex:()=>ov,refine:()=>XI,record:()=>iO,readonly:()=>OI,property:()=>Nz,promise:()=>CK,prettifyError:()=>ZU,preprocess:()=>iK,prefault:()=>vI,positive:()=>rz,pipe:()=>x6,partialRecord:()=>GK,parseAsync:()=>Vz,parse:()=>Pz,overwrite:()=>M$,optional:()=>Z6,object:()=>LK,number:()=>FO,nullish:()=>xK,nullable:()=>D6,null:()=>gO,normalize:()=>$4,nonpositive:()=>zz,nonoptional:()=>UI,nonnegative:()=>_z,never:()=>ez,negative:()=>bz,nativeEnum:()=>MK,nanoid:()=>lw,nan:()=>RK,multipleOf:()=>o$,minSize:()=>d$,minLength:()=>C$,mime:()=>sv,maxSize:()=>kv,maxLength:()=>Jv,map:()=>SK,lte:()=>Q$,lt:()=>S$,lowercase:()=>dv,looseObject:()=>EK,locales:()=>nv,literal:()=>ZK,length:()=>wv,lazy:()=>JI,ksuid:()=>ew,keyof:()=>BK,jwt:()=>zK,json:()=>fK,iso:()=>F6,ipv6:()=>sw,ipv4:()=>aw,intersection:()=>nO,int64:()=>WK,int32:()=>wK,int:()=>Dz,instanceof:()=>nK,includes:()=>tv,httpUrl:()=>fw,hostname:()=>NK,hex:()=>OK,hash:()=>IK,guid:()=>Cw,gte:()=>_$,gt:()=>F$,globalRegistry:()=>A$,getErrorMap:()=>dK,function:()=>cK,formatError:()=>Dv,float64:()=>JK,float32:()=>kK,flattenError:()=>Zv,file:()=>DK,enum:()=>v_,endsWith:()=>av,encodeAsync:()=>Ez,encode:()=>Lz,emoji:()=>iw,email:()=>Tw,e164:()=>bK,discriminatedUnion:()=>AK,decodeAsync:()=>Az,decode:()=>Hz,date:()=>qK,custom:()=>hK,cuid2:()=>dw,cuid:()=>ow,core:()=>Z$,config:()=>l,coerce:()=>O_,codec:()=>mK,clone:()=>U$,cidrv6:()=>vK,cidrv4:()=>$K,check:()=>uK,catch:()=>zI,boolean:()=>MO,bigint:()=>XK,base64url:()=>rK,base64:()=>UK,array:()=>m6,any:()=>PK,_function:()=>cK,_default:()=>sO,_ZodString:()=>xz,ZodXID:()=>uz,ZodVoid:()=>CO,ZodUnknown:()=>mO,ZodUnion:()=>az,ZodUndefined:()=>DO,ZodUUID:()=>D$,ZodURL:()=>g6,ZodULID:()=>cz,ZodType:()=>F,ZodTuple:()=>yO,ZodTransform:()=>tO,ZodTemplateLiteral:()=>II,ZodSymbol:()=>ZO,ZodSuccess:()=>rI,ZodStringFormat:()=>h,ZodString:()=>z4,ZodSet:()=>oO,ZodRecord:()=>$_,ZodRealError:()=>N$,ZodReadonly:()=>NI,ZodPromise:()=>wI,ZodPrefault:()=>$I,ZodPipe:()=>z_,ZodOptional:()=>r_,ZodObject:()=>T6,ZodNumberFormat:()=>Wv,ZodNumber:()=>N4,ZodNullable:()=>eO,ZodNull:()=>xO,ZodNonOptional:()=>b_,ZodNever:()=>TO,ZodNanoID:()=>mz,ZodNaN:()=>_I,ZodMap:()=>lO,ZodLiteral:()=>dO,ZodLazy:()=>kI,ZodKSUID:()=>hz,ZodJWT:()=>pz,ZodIssueCode:()=>lK,ZodIntersection:()=>hO,ZodISOTime:()=>G6,ZodISODuration:()=>S6,ZodISODateTime:()=>E6,ZodISODate:()=>A6,ZodIPv6:()=>yz,ZodIPv4:()=>nz,ZodGUID:()=>M6,ZodFunction:()=>KI,ZodFirstPartyTypeKind:()=>N_,ZodFile:()=>pO,ZodError:()=>Rw,ZodEnum:()=>b4,ZodEmoji:()=>Rz,ZodEmail:()=>gz,ZodE164:()=>dz,ZodDiscriminatedUnion:()=>uO,ZodDefault:()=>aO,ZodDate:()=>R6,ZodCustomStringFormat:()=>_4,ZodCustom:()=>C6,ZodCodec:()=>__,ZodCatch:()=>bI,ZodCUID2:()=>Cz,ZodCUID:()=>Tz,ZodCIDRv6:()=>iz,ZodCIDRv4:()=>fz,ZodBoolean:()=>O4,ZodBigIntFormat:()=>tz,ZodBigInt:()=>I4,ZodBase64URL:()=>oz,ZodBase64:()=>lz,ZodArray:()=>cO,ZodAny:()=>RO,TimePrecision:()=>F1,NEVER:()=>VU,$output:()=>E1,$input:()=>A1,$brand:()=>qU});var Z$={};k$(Z$,{version:()=>Gr,util:()=>P,treeifyError:()=>MU,toJSONSchema:()=>Xz,toDotPath:()=>$O,safeParseAsync:()=>xU,safeParse:()=>DU,safeEncodeAsync:()=>nJ,safeEncode:()=>uJ,safeDecodeAsync:()=>yJ,safeDecode:()=>hJ,registry:()=>r6,regexes:()=>W$,prettifyError:()=>ZU,parseAsync:()=>R4,parse:()=>g4,locales:()=>nv,isValidJWT:()=>jO,isValidBase64URL:()=>YO,isValidBase64:()=>dr,globalRegistry:()=>A$,globalConfig:()=>Lv,formatError:()=>Dv,flattenError:()=>Zv,encodeAsync:()=>CJ,encode:()=>mJ,decodeAsync:()=>cJ,decode:()=>TJ,config:()=>l,clone:()=>U$,_xid:()=>X6,_void:()=>s1,_uuidv7:()=>O6,_uuidv6:()=>N6,_uuidv4:()=>_6,_uuid:()=>z6,_url:()=>iv,_uppercase:()=>pv,_unknown:()=>e1,_union:()=>ww,_undefined:()=>d1,_ulid:()=>K6,_uint64:()=>l1,_uint32:()=>u1,_tuple:()=>Ww,_trim:()=>v4,_transform:()=>Bw,_toUpperCase:()=>r4,_toLowerCase:()=>U4,_templateLiteral:()=>Zw,_symbol:()=>o1,_superRefine:()=>wz,_success:()=>Gw,_stringbool:()=>Kz,_stringFormat:()=>Kv,_string:()=>G1,_startsWith:()=>ev,_size:()=>lv,_set:()=>jw,_safeParseAsync:()=>Ov,_safeParse:()=>Nv,_safeEncodeAsync:()=>n4,_safeEncode:()=>u4,_safeDecodeAsync:()=>y4,_safeDecode:()=>h4,_regex:()=>ov,_refine:()=>Jz,_record:()=>Qw,_readonly:()=>Mw,_property:()=>Nz,_promise:()=>xw,_positive:()=>rz,_pipe:()=>Fw,_parseAsync:()=>_v,_parse:()=>zv,_overwrite:()=>M$,_optional:()=>Lw,_number:()=>g1,_nullable:()=>Hw,_null:()=>p1,_normalize:()=>$4,_nonpositive:()=>zz,_nonoptional:()=>Aw,_nonnegative:()=>_z,_never:()=>a1,_negative:()=>bz,_nativeEnum:()=>Vw,_nanoid:()=>k6,_nan:()=>Uz,_multipleOf:()=>o$,_minSize:()=>d$,_minLength:()=>C$,_min:()=>_$,_mime:()=>sv,_maxSize:()=>kv,_maxLength:()=>Jv,_max:()=>Q$,_map:()=>Yw,_lte:()=>Q$,_lt:()=>S$,_lowercase:()=>dv,_literal:()=>qw,_length:()=>wv,_lazy:()=>Dw,_ksuid:()=>W6,_jwt:()=>L6,_isoTime:()=>D1,_isoDuration:()=>x1,_isoDateTime:()=>M1,_isoDate:()=>Z1,_ipv6:()=>Y6,_ipv4:()=>Q6,_intersection:()=>Xw,_int64:()=>i1,_int32:()=>c1,_int:()=>m1,_includes:()=>tv,_guid:()=>fv,_gte:()=>_$,_gt:()=>F$,_float64:()=>C1,_float32:()=>T1,_file:()=>Iz,_enum:()=>Pw,_endsWith:()=>av,_encodeAsync:()=>C4,_encode:()=>m4,_emoji:()=>I6,_email:()=>b6,_e164:()=>B6,_discriminatedUnion:()=>Kw,_default:()=>Ew,_decodeAsync:()=>c4,_decode:()=>T4,_date:()=>$z,_custom:()=>kz,_cuid2:()=>w6,_cuid:()=>J6,_coercedString:()=>S1,_coercedNumber:()=>R1,_coercedDate:()=>vz,_coercedBoolean:()=>n1,_coercedBigint:()=>f1,_cidrv6:()=>P6,_cidrv4:()=>j6,_check:()=>EO,_catch:()=>Sw,_boolean:()=>h1,_bigint:()=>y1,_base64url:()=>q6,_base64:()=>V6,_array:()=>Oz,_any:()=>t1,TimePrecision:()=>F1,NEVER:()=>VU,JSONSchemaGenerator:()=>H6,JSONSchema:()=>AO,Doc:()=>o4,$output:()=>E1,$input:()=>A1,$constructor:()=>J,$brand:()=>qU,$ZodXID:()=>Cr,$ZodVoid:()=>Ob,$ZodUnknown:()=>_b,$ZodUnion:()=>v6,$ZodUndefined:()=>rb,$ZodUUID:()=>Mr,$ZodURL:()=>Dr,$ZodULID:()=>Tr,$ZodType:()=>A,$ZodTuple:()=>U6,$ZodTransform:()=>Vb,$ZodTemplateLiteral:()=>Zb,$ZodSymbol:()=>Ub,$ZodSuccess:()=>Ab,$ZodStringFormat:()=>c,$ZodString:()=>l$,$ZodSet:()=>Qb,$ZodRegistry:()=>yv,$ZodRecord:()=>Xb,$ZodRealError:()=>z$,$ZodReadonly:()=>Mb,$ZodPromise:()=>xb,$ZodPrefault:()=>Hb,$ZodPipe:()=>Fb,$ZodOptional:()=>qb,$ZodObjectJIT:()=>Jb,$ZodObject:()=>qO,$ZodNumberFormat:()=>$b,$ZodNumber:()=>s4,$ZodNullable:()=>Bb,$ZodNull:()=>bb,$ZodNonOptional:()=>Eb,$ZodNever:()=>Nb,$ZodNanoID:()=>gr,$ZodNaN:()=>Sb,$ZodMap:()=>Wb,$ZodLiteral:()=>jb,$ZodLazy:()=>gb,$ZodKSUID:()=>cr,$ZodJWT:()=>ar,$ZodIntersection:()=>Kb,$ZodISOTime:()=>nr,$ZodISODuration:()=>yr,$ZodISODateTime:()=>ur,$ZodISODate:()=>hr,$ZodIPv6:()=>ir,$ZodIPv4:()=>fr,$ZodGUID:()=>Fr,$ZodFunction:()=>Db,$ZodFile:()=>Pb,$ZodError:()=>Mv,$ZodEnum:()=>Yb,$ZodEncodeError:()=>y$,$ZodEmoji:()=>xr,$ZodEmail:()=>Zr,$ZodE164:()=>er,$ZodDiscriminatedUnion:()=>wb,$ZodDefault:()=>Lb,$ZodDate:()=>Ib,$ZodCustomStringFormat:()=>sr,$ZodCustom:()=>Rb,$ZodCodec:()=>mv,$ZodCheckUpperCase:()=>Vr,$ZodCheckStringFormat:()=>Iv,$ZodCheckStartsWith:()=>Br,$ZodCheckSizeEquals:()=>Xr,$ZodCheckRegex:()=>jr,$ZodCheckProperty:()=>Hr,$ZodCheckOverwrite:()=>Ar,$ZodCheckNumberFormat:()=>kr,$ZodCheckMultipleOf:()=>Ir,$ZodCheckMinSize:()=>Kr,$ZodCheckMinLength:()=>Qr,$ZodCheckMimeType:()=>Er,$ZodCheckMaxSize:()=>wr,$ZodCheckMaxLength:()=>Wr,$ZodCheckLowerCase:()=>Pr,$ZodCheckLessThan:()=>i4,$ZodCheckLengthEquals:()=>Yr,$ZodCheckIncludes:()=>qr,$ZodCheckGreaterThan:()=>l4,$ZodCheckEndsWith:()=>Lr,$ZodCheckBigIntFormat:()=>Jr,$ZodCheck:()=>y,$ZodCatch:()=>Gb,$ZodCUID2:()=>mr,$ZodCUID:()=>Rr,$ZodCIDRv6:()=>or,$ZodCIDRv4:()=>lr,$ZodBoolean:()=>Rv,$ZodBigIntFormat:()=>vb,$ZodBigInt:()=>$6,$ZodBase64URL:()=>tr,$ZodBase64:()=>pr,$ZodAsyncError:()=>H$,$ZodArray:()=>kb,$ZodAny:()=>zb});var VU=Object.freeze({status:"aborted"});function J($,U,r){function b(N,O){var I;Object.defineProperty(N,"_zod",{value:N._zod??{},enumerable:!1}),(I=N._zod).traits??(I.traits=new Set),N._zod.traits.add($),U(N,O);for(let k in _.prototype)if(!(k in N))Object.defineProperty(N,k,{value:_.prototype[k].bind(N)});N._zod.constr=_,N._zod.def=O}let v=r?.Parent??Object;class z extends v{}Object.defineProperty(z,"name",{value:$});function _(N){var O;let I=r?.Parent?new z:this;b(I,N),(O=I._zod).deferred??(O.deferred=[]);for(let k of I._zod.deferred)k();return I}return Object.defineProperty(_,"init",{value:b}),Object.defineProperty(_,Symbol.hasInstance,{value:(N)=>{if(r?.Parent&&N instanceof r.Parent)return!0;return N?._zod?.traits?.has($)}}),Object.defineProperty(_,"name",{value:$}),_}var qU=Symbol("zod_brand");class H$ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class y$ extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var Lv={};function l($){if($)Object.assign(Lv,$);return Lv}var P={};k$(P,{unwrapMessage:()=>Hv,uint8ArrayToHex:()=>gJ,uint8ArrayToBase64url:()=>DJ,uint8ArrayToBase64:()=>eN,stringifyPrimitive:()=>V,shallowClone:()=>EU,safeExtend:()=>AJ,required:()=>FJ,randomString:()=>PJ,propertyKeyTypes:()=>Gv,promiseAllObject:()=>jJ,primitiveTypes:()=>AU,prefixIssues:()=>w$,pick:()=>LJ,partial:()=>SJ,optionalKeys:()=>GU,omit:()=>HJ,objectClone:()=>WJ,numKeys:()=>VJ,nullish:()=>x$,normalizeParams:()=>q,mergeDefs:()=>R$,merge:()=>GJ,jsonStringifyReplacer:()=>Uv,joinValues:()=>K,issue:()=>bv,isPlainObject:()=>m$,isObject:()=>f$,hexToUint8Array:()=>xJ,getSizableOrigin:()=>Sv,getParsedType:()=>qJ,getLengthableOrigin:()=>Fv,getEnumValues:()=>Ev,getElementAtPath:()=>YJ,floatSafeRemainder:()=>LU,finalizeIssue:()=>K$,extend:()=>EJ,escapeRegex:()=>E$,esc:()=>D4,defineLazy:()=>Z,createTransparentProxy:()=>BJ,cloneDef:()=>QJ,clone:()=>U$,cleanRegex:()=>Av,cleanEnum:()=>MJ,captureStackTrace:()=>x4,cached:()=>rv,base64urlToUint8Array:()=>ZJ,base64ToUint8Array:()=>tN,assignProp:()=>g$,assertNotEqual:()=>JJ,assertNever:()=>KJ,assertIs:()=>wJ,assertEqual:()=>kJ,assert:()=>XJ,allowsEval:()=>HU,aborted:()=>T$,NUMBER_FORMAT_RANGES:()=>SU,Class:()=>aN,BIGINT_FORMAT_RANGES:()=>FU});function kJ($){return $}function JJ($){return $}function wJ($){}function KJ($){throw Error()}function XJ($){}function Ev($){let U=Object.values($).filter((b)=>typeof b==="number");return Object.entries($).filter(([b,v])=>U.indexOf(+b)===-1).map(([b,v])=>v)}function K($,U="|"){return $.map((r)=>V(r)).join(U)}function Uv($,U){if(typeof U==="bigint")return U.toString();return U}function rv($){return{get value(){{let r=$();return Object.defineProperty(this,"value",{value:r}),r}throw Error("cached value already set")}}}function x$($){return $===null||$===void 0}function Av($){let U=$.startsWith("^")?1:0,r=$.endsWith("$")?$.length-1:$.length;return $.slice(U,r)}function LU($,U){let r=($.toString().split(".")[1]||"").length,b=U.toString(),v=(b.split(".")[1]||"").length;if(v===0&&/\d?e-\d?/.test(b)){let O=b.match(/\d?e-(\d?)/);if(O?.[1])v=Number.parseInt(O[1])}let z=r>v?r:v,_=Number.parseInt($.toFixed(z).replace(".","")),N=Number.parseInt(U.toFixed(z).replace(".",""));return _%N/10**z}var pN=Symbol("evaluating");function Z($,U,r){let b=void 0;Object.defineProperty($,U,{get(){if(b===pN)return;if(b===void 0)b=pN,b=r();return b},set(v){Object.defineProperty($,U,{value:v})},configurable:!0})}function WJ($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function g$($,U,r){Object.defineProperty($,U,{value:r,writable:!0,enumerable:!0,configurable:!0})}function R$(...$){let U={};for(let r of $){let b=Object.getOwnPropertyDescriptors(r);Object.assign(U,b)}return Object.defineProperties({},U)}function QJ($){return R$($._zod.def)}function YJ($,U){if(!U)return $;return U.reduce((r,b)=>r?.[b],$)}function jJ($){let U=Object.keys($),r=U.map((b)=>$[b]);return Promise.all(r).then((b)=>{let v={};for(let z=0;z<U.length;z++)v[U[z]]=b[z];return v})}function PJ($=10){let r="";for(let b=0;b<$;b++)r+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return r}function D4($){return JSON.stringify($)}var x4="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function f$($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var HU=rv(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function m$($){if(f$($)===!1)return!1;let U=$.constructor;if(U===void 0)return!0;let r=U.prototype;if(f$(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function EU($){if(m$($))return{...$};if(Array.isArray($))return[...$];return $}function VJ($){let U=0;for(let r in $)if(Object.prototype.hasOwnProperty.call($,r))U++;return U}var qJ=($)=>{let U=typeof $;switch(U){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${U}`)}},Gv=new Set(["string","number","symbol"]),AU=new Set(["string","number","bigint","boolean","symbol","undefined"]);function E$($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function U$($,U,r){let b=new $._zod.constr(U??$._zod.def);if(!U||r?.parent)b._zod.parent=$;return b}function q($){let U=$;if(!U)return{};if(typeof U==="string")return{error:()=>U};if(U?.message!==void 0){if(U?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");U.error=U.message}if(delete U.message,typeof U.error==="string")return{...U,error:()=>U.error};return U}function BJ($){let U;return new Proxy({},{get(r,b,v){return U??(U=$()),Reflect.get(U,b,v)},set(r,b,v,z){return U??(U=$()),Reflect.set(U,b,v,z)},has(r,b){return U??(U=$()),Reflect.has(U,b)},deleteProperty(r,b){return U??(U=$()),Reflect.deleteProperty(U,b)},ownKeys(r){return U??(U=$()),Reflect.ownKeys(U)},getOwnPropertyDescriptor(r,b){return U??(U=$()),Reflect.getOwnPropertyDescriptor(U,b)},defineProperty(r,b,v){return U??(U=$()),Reflect.defineProperty(U,b,v)}})}function V($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function GU($){return Object.keys($).filter((U)=>{return $[U]._zod.optin==="optional"&&$[U]._zod.optout==="optional"})}var SU={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},FU={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function LJ($,U){let r=$._zod.def,b=R$($._zod.def,{get shape(){let v={};for(let z in U){if(!(z in r.shape))throw Error(`Unrecognized key: "${z}"`);if(!U[z])continue;v[z]=r.shape[z]}return g$(this,"shape",v),v},checks:[]});return U$($,b)}function HJ($,U){let r=$._zod.def,b=R$($._zod.def,{get shape(){let v={...$._zod.def.shape};for(let z in U){if(!(z in r.shape))throw Error(`Unrecognized key: "${z}"`);if(!U[z])continue;delete v[z]}return g$(this,"shape",v),v},checks:[]});return U$($,b)}function EJ($,U){if(!m$(U))throw Error("Invalid input to extend: expected a plain object");let r=$._zod.def.checks;if(r&&r.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let v=R$($._zod.def,{get shape(){let z={...$._zod.def.shape,...U};return g$(this,"shape",z),z},checks:[]});return U$($,v)}function AJ($,U){if(!m$(U))throw Error("Invalid input to safeExtend: expected a plain object");let r={...$._zod.def,get shape(){let b={...$._zod.def.shape,...U};return g$(this,"shape",b),b},checks:$._zod.def.checks};return U$($,r)}function GJ($,U){let r=R$($._zod.def,{get shape(){let b={...$._zod.def.shape,...U._zod.def.shape};return g$(this,"shape",b),b},get catchall(){return U._zod.def.catchall},checks:[]});return U$($,r)}function SJ($,U,r){let b=R$(U._zod.def,{get shape(){let v=U._zod.def.shape,z={...v};if(r)for(let _ in r){if(!(_ in v))throw Error(`Unrecognized key: "${_}"`);if(!r[_])continue;z[_]=$?new $({type:"optional",innerType:v[_]}):v[_]}else for(let _ in v)z[_]=$?new $({type:"optional",innerType:v[_]}):v[_];return g$(this,"shape",z),z},checks:[]});return U$(U,b)}function FJ($,U,r){let b=R$(U._zod.def,{get shape(){let v=U._zod.def.shape,z={...v};if(r)for(let _ in r){if(!(_ in z))throw Error(`Unrecognized key: "${_}"`);if(!r[_])continue;z[_]=new $({type:"nonoptional",innerType:v[_]})}else for(let _ in v)z[_]=new $({type:"nonoptional",innerType:v[_]});return g$(this,"shape",z),z},checks:[]});return U$(U,b)}function T$($,U=0){if($.aborted===!0)return!0;for(let r=U;r<$.issues.length;r++)if($.issues[r]?.continue!==!0)return!0;return!1}function w$($,U){return U.map((r)=>{var b;return(b=r).path??(b.path=[]),r.path.unshift($),r})}function Hv($){return typeof $==="string"?$:$?.message}function K$($,U,r){let b={...$,path:$.path??[]};if(!$.message){let v=Hv($.inst?._zod.def?.error?.($))??Hv(U?.error?.($))??Hv(r.customError?.($))??Hv(r.localeError?.($))??"Invalid input";b.message=v}if(delete b.inst,delete b.continue,!U?.reportInput)delete b.input;return b}function Sv($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function Fv($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function bv(...$){let[U,r,b]=$;if(typeof U==="string")return{message:U,code:"custom",input:r,inst:b};return{...U}}function MJ($){return Object.entries($).filter(([U,r])=>{return Number.isNaN(Number.parseInt(U,10))}).map((U)=>U[1])}function tN($){let U=atob($),r=new Uint8Array(U.length);for(let b=0;b<U.length;b++)r[b]=U.charCodeAt(b);return r}function eN($){let U="";for(let r=0;r<$.length;r++)U+=String.fromCharCode($[r]);return btoa(U)}function ZJ($){let U=$.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-U.length%4)%4);return tN(U+r)}function DJ($){return eN($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function xJ($){let U=$.replace(/^0x/,"");if(U.length%2!==0)throw Error("Invalid hex string length");let r=new Uint8Array(U.length/2);for(let b=0;b<U.length;b+=2)r[b/2]=Number.parseInt(U.slice(b,b+2),16);return r}function gJ($){return Array.from($).map((U)=>U.toString(16).padStart(2,"0")).join("")}class aN{constructor(...$){}}var sN=($,U)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:U,enumerable:!1}),$.message=JSON.stringify(U,Uv,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},Mv=J("$ZodError",sN),z$=J("$ZodError",sN,{Parent:Error});function Zv($,U=(r)=>r.message){let r={},b=[];for(let v of $.issues)if(v.path.length>0)r[v.path[0]]=r[v.path[0]]||[],r[v.path[0]].push(U(v));else b.push(U(v));return{formErrors:b,fieldErrors:r}}function Dv($,U){let r=U||function(z){return z.message},b={_errors:[]},v=(z)=>{for(let _ of z.issues)if(_.code==="invalid_union"&&_.errors.length)_.errors.map((N)=>v({issues:N}));else if(_.code==="invalid_key")v({issues:_.issues});else if(_.code==="invalid_element")v({issues:_.issues});else if(_.path.length===0)b._errors.push(r(_));else{let N=b,O=0;while(O<_.path.length){let I=_.path[O];if(O!==_.path.length-1)N[I]=N[I]||{_errors:[]};else N[I]=N[I]||{_errors:[]},N[I]._errors.push(r(_));N=N[I],O++}}};return v($),b}function MU($,U){let r=U||function(z){return z.message},b={errors:[]},v=(z,_=[])=>{var N,O;for(let I of z.issues)if(I.code==="invalid_union"&&I.errors.length)I.errors.map((k)=>v({issues:k},I.path));else if(I.code==="invalid_key")v({issues:I.issues},I.path);else if(I.code==="invalid_element")v({issues:I.issues},I.path);else{let k=[..._,...I.path];if(k.length===0){b.errors.push(r(I));continue}let W=b,X=0;while(X<k.length){let w=k[X],j=X===k.length-1;if(typeof w==="string")W.properties??(W.properties={}),(N=W.properties)[w]??(N[w]={errors:[]}),W=W.properties[w];else W.items??(W.items=[]),(O=W.items)[w]??(O[w]={errors:[]}),W=W.items[w];if(j)W.errors.push(r(I));X++}}};return v($),b}function $O($){let U=[],r=$.map((b)=>typeof b==="object"?b.key:b);for(let b of r)if(typeof b==="number")U.push(`[${b}]`);else if(typeof b==="symbol")U.push(`[${JSON.stringify(String(b))}]`);else if(/[^\w$]/.test(b))U.push(`[${JSON.stringify(b)}]`);else{if(U.length)U.push(".");U.push(b)}return U.join("")}function ZU($){let U=[],r=[...$.issues].sort((b,v)=>(b.path??[]).length-(v.path??[]).length);for(let b of r)if(U.push(`✖ ${b.message}`),b.path?.length)U.push(` → at ${$O(b.path)}`);return U.join(`
|
|
114
|
-
`)}var zv=($)=>(U,r,b,v)=>{let z=b?Object.assign(b,{async:!1}):{async:!1},_=U._zod.run({value:r,issues:[]},z);if(_ instanceof Promise)throw new H$;if(_.issues.length){let N=new(v?.Err??$)(_.issues.map((O)=>K$(O,z,l())));throw x4(N,v?.callee),N}return _.value},g4=zv(z$),_v=($)=>async(U,r,b,v)=>{let z=b?Object.assign(b,{async:!0}):{async:!0},_=U._zod.run({value:r,issues:[]},z);if(_ instanceof Promise)_=await _;if(_.issues.length){let N=new(v?.Err??$)(_.issues.map((O)=>K$(O,z,l())));throw x4(N,v?.callee),N}return _.value},R4=_v(z$),Nv=($)=>(U,r,b)=>{let v=b?{...b,async:!1}:{async:!1},z=U._zod.run({value:r,issues:[]},v);if(z instanceof Promise)throw new H$;return z.issues.length?{success:!1,error:new($??Mv)(z.issues.map((_)=>K$(_,v,l())))}:{success:!0,data:z.value}},DU=Nv(z$),Ov=($)=>async(U,r,b)=>{let v=b?Object.assign(b,{async:!0}):{async:!0},z=U._zod.run({value:r,issues:[]},v);if(z instanceof Promise)z=await z;return z.issues.length?{success:!1,error:new $(z.issues.map((_)=>K$(_,v,l())))}:{success:!0,data:z.value}},xU=Ov(z$),m4=($)=>(U,r,b)=>{let v=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return zv($)(U,r,v)},mJ=m4(z$),T4=($)=>(U,r,b)=>{return zv($)(U,r,b)},TJ=T4(z$),C4=($)=>async(U,r,b)=>{let v=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return _v($)(U,r,v)},CJ=C4(z$),c4=($)=>async(U,r,b)=>{return _v($)(U,r,b)},cJ=c4(z$),u4=($)=>(U,r,b)=>{let v=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return Nv($)(U,r,v)},uJ=u4(z$),h4=($)=>(U,r,b)=>{return Nv($)(U,r,b)},hJ=h4(z$),n4=($)=>async(U,r,b)=>{let v=b?Object.assign(b,{direction:"backward"}):{direction:"backward"};return Ov($)(U,r,v)},nJ=n4(z$),y4=($)=>async(U,r,b)=>{return Ov($)(U,r,b)},yJ=y4(z$);var W$={};k$(W$,{xid:()=>TU,uuid7:()=>oJ,uuid6:()=>lJ,uuid4:()=>iJ,uuid:()=>i$,uppercase:()=>Or,unicodeEmail:()=>vO,undefined:()=>_r,ulid:()=>mU,time:()=>aU,string:()=>$r,sha512_hex:()=>w0,sha512_base64url:()=>X0,sha512_base64:()=>K0,sha384_hex:()=>I0,sha384_base64url:()=>J0,sha384_base64:()=>k0,sha256_hex:()=>_0,sha256_base64url:()=>O0,sha256_base64:()=>N0,sha1_hex:()=>r0,sha1_base64url:()=>z0,sha1_base64:()=>b0,rfc5322Email:()=>pJ,number:()=>rr,null:()=>zr,nanoid:()=>cU,md5_hex:()=>$0,md5_base64url:()=>U0,md5_base64:()=>v0,lowercase:()=>Nr,ksuid:()=>CU,ipv6:()=>iU,ipv4:()=>fU,integer:()=>Ur,idnEmail:()=>tJ,html5Email:()=>dJ,hostname:()=>pU,hex:()=>sJ,guid:()=>hU,extendedDuration:()=>fJ,emoji:()=>yU,email:()=>nU,e164:()=>tU,duration:()=>uU,domain:()=>aJ,datetime:()=>sU,date:()=>eU,cuid2:()=>RU,cuid:()=>gU,cidrv6:()=>oU,cidrv4:()=>lU,browserEmail:()=>eJ,boolean:()=>br,bigint:()=>vr,base64url:()=>f4,base64:()=>dU});var gU=/^[cC][^\s-]{8,}$/,RU=/^[0-9a-z]+$/,mU=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,TU=/^[0-9a-vA-V]{20}$/,CU=/^[A-Za-z0-9]{27}$/,cU=/^[a-zA-Z0-9_-]{21}$/,uU=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,fJ=/^[-+]?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)?)??$/,hU=/^([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})$/,i$=($)=>{if(!$)return/^([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)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},iJ=i$(4),lJ=i$(6),oJ=i$(7),nU=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,dJ=/^[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])?)*$/,pJ=/^(([^<>()\[\]\\.,;:\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,}))$/,vO=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,tJ=vO,eJ=/^[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])?)*$/;function yU(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var fU=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,iU=/^(([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=/^((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])$/,oU=/^(([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])$/,dU=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,f4=/^[A-Za-z0-9_-]*$/,pU=/^(?=.{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])?)*\.?$/,aJ=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,tU=/^\+(?:[0-9]){6,14}[0-9]$/,UO="(?:(?:\\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])))",eU=new RegExp(`^${UO}$`);function rO($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function aU($){return new RegExp(`^${rO($)}$`)}function sU($){let U=rO({precision:$.precision}),r=["Z"];if($.local)r.push("");if($.offset)r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let b=`${U}(?:${r.join("|")})`;return new RegExp(`^${UO}T(?:${b})$`)}var $r=($)=>{let U=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${U}$`)},vr=/^-?\d+n?$/,Ur=/^-?\d+$/,rr=/^-?\d+(?:\.\d+)?/,br=/^(?:true|false)$/i,zr=/^null$/i;var _r=/^undefined$/i;var Nr=/^[^A-Z]*$/,Or=/^[^a-z]*$/,sJ=/^[0-9a-fA-F]*$/;function xv($,U){return new RegExp(`^[A-Za-z0-9+/]{${$}}${U}$`)}function gv($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var $0=/^[0-9a-fA-F]{32}$/,v0=xv(22,"=="),U0=gv(22),r0=/^[0-9a-fA-F]{40}$/,b0=xv(27,"="),z0=gv(27),_0=/^[0-9a-fA-F]{64}$/,N0=xv(43,"="),O0=gv(43),I0=/^[0-9a-fA-F]{96}$/,k0=xv(64,""),J0=gv(64),w0=/^[0-9a-fA-F]{128}$/,K0=xv(86,"=="),X0=gv(86);var y=J("$ZodCheck",($,U)=>{var r;$._zod??($._zod={}),$._zod.def=U,(r=$._zod).onattach??(r.onattach=[])}),zO={number:"number",bigint:"bigint",object:"date"},i4=J("$ZodCheckLessThan",($,U)=>{y.init($,U);let r=zO[typeof U.value];$._zod.onattach.push((b)=>{let v=b._zod.bag,z=(U.inclusive?v.maximum:v.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(U.value<z)if(U.inclusive)v.maximum=U.value;else v.exclusiveMaximum=U.value}),$._zod.check=(b)=>{if(U.inclusive?b.value<=U.value:b.value<U.value)return;b.issues.push({origin:r,code:"too_big",maximum:U.value,input:b.value,inclusive:U.inclusive,inst:$,continue:!U.abort})}}),l4=J("$ZodCheckGreaterThan",($,U)=>{y.init($,U);let r=zO[typeof U.value];$._zod.onattach.push((b)=>{let v=b._zod.bag,z=(U.inclusive?v.minimum:v.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(U.value>z)if(U.inclusive)v.minimum=U.value;else v.exclusiveMinimum=U.value}),$._zod.check=(b)=>{if(U.inclusive?b.value>=U.value:b.value>U.value)return;b.issues.push({origin:r,code:"too_small",minimum:U.value,input:b.value,inclusive:U.inclusive,inst:$,continue:!U.abort})}}),Ir=J("$ZodCheckMultipleOf",($,U)=>{y.init($,U),$._zod.onattach.push((r)=>{var b;(b=r._zod.bag).multipleOf??(b.multipleOf=U.value)}),$._zod.check=(r)=>{if(typeof r.value!==typeof U.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?r.value%U.value===BigInt(0):LU(r.value,U.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:U.value,input:r.value,inst:$,continue:!U.abort})}}),kr=J("$ZodCheckNumberFormat",($,U)=>{y.init($,U),U.format=U.format||"float64";let r=U.format?.includes("int"),b=r?"int":"number",[v,z]=SU[U.format];$._zod.onattach.push((_)=>{let N=_._zod.bag;if(N.format=U.format,N.minimum=v,N.maximum=z,r)N.pattern=Ur}),$._zod.check=(_)=>{let N=_.value;if(r){if(!Number.isInteger(N)){_.issues.push({expected:b,format:U.format,code:"invalid_type",continue:!1,input:N,inst:$});return}if(!Number.isSafeInteger(N)){if(N>0)_.issues.push({input:N,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:b,continue:!U.abort});else _.issues.push({input:N,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:b,continue:!U.abort});return}}if(N<v)_.issues.push({origin:"number",input:N,code:"too_small",minimum:v,inclusive:!0,inst:$,continue:!U.abort});if(N>z)_.issues.push({origin:"number",input:N,code:"too_big",maximum:z,inst:$})}}),Jr=J("$ZodCheckBigIntFormat",($,U)=>{y.init($,U);let[r,b]=FU[U.format];$._zod.onattach.push((v)=>{let z=v._zod.bag;z.format=U.format,z.minimum=r,z.maximum=b}),$._zod.check=(v)=>{let z=v.value;if(z<r)v.issues.push({origin:"bigint",input:z,code:"too_small",minimum:r,inclusive:!0,inst:$,continue:!U.abort});if(z>b)v.issues.push({origin:"bigint",input:z,code:"too_big",maximum:b,inst:$})}}),wr=J("$ZodCheckMaxSize",($,U)=>{var r;y.init($,U),(r=$._zod.def).when??(r.when=(b)=>{let v=b.value;return!x$(v)&&v.size!==void 0}),$._zod.onattach.push((b)=>{let v=b._zod.bag.maximum??Number.POSITIVE_INFINITY;if(U.maximum<v)b._zod.bag.maximum=U.maximum}),$._zod.check=(b)=>{let v=b.value;if(v.size<=U.maximum)return;b.issues.push({origin:Sv(v),code:"too_big",maximum:U.maximum,inclusive:!0,input:v,inst:$,continue:!U.abort})}}),Kr=J("$ZodCheckMinSize",($,U)=>{var r;y.init($,U),(r=$._zod.def).when??(r.when=(b)=>{let v=b.value;return!x$(v)&&v.size!==void 0}),$._zod.onattach.push((b)=>{let v=b._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(U.minimum>v)b._zod.bag.minimum=U.minimum}),$._zod.check=(b)=>{let v=b.value;if(v.size>=U.minimum)return;b.issues.push({origin:Sv(v),code:"too_small",minimum:U.minimum,inclusive:!0,input:v,inst:$,continue:!U.abort})}}),Xr=J("$ZodCheckSizeEquals",($,U)=>{var r;y.init($,U),(r=$._zod.def).when??(r.when=(b)=>{let v=b.value;return!x$(v)&&v.size!==void 0}),$._zod.onattach.push((b)=>{let v=b._zod.bag;v.minimum=U.size,v.maximum=U.size,v.size=U.size}),$._zod.check=(b)=>{let v=b.value,z=v.size;if(z===U.size)return;let _=z>U.size;b.issues.push({origin:Sv(v),..._?{code:"too_big",maximum:U.size}:{code:"too_small",minimum:U.size},inclusive:!0,exact:!0,input:b.value,inst:$,continue:!U.abort})}}),Wr=J("$ZodCheckMaxLength",($,U)=>{var r;y.init($,U),(r=$._zod.def).when??(r.when=(b)=>{let v=b.value;return!x$(v)&&v.length!==void 0}),$._zod.onattach.push((b)=>{let v=b._zod.bag.maximum??Number.POSITIVE_INFINITY;if(U.maximum<v)b._zod.bag.maximum=U.maximum}),$._zod.check=(b)=>{let v=b.value;if(v.length<=U.maximum)return;let _=Fv(v);b.issues.push({origin:_,code:"too_big",maximum:U.maximum,inclusive:!0,input:v,inst:$,continue:!U.abort})}}),Qr=J("$ZodCheckMinLength",($,U)=>{var r;y.init($,U),(r=$._zod.def).when??(r.when=(b)=>{let v=b.value;return!x$(v)&&v.length!==void 0}),$._zod.onattach.push((b)=>{let v=b._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(U.minimum>v)b._zod.bag.minimum=U.minimum}),$._zod.check=(b)=>{let v=b.value;if(v.length>=U.minimum)return;let _=Fv(v);b.issues.push({origin:_,code:"too_small",minimum:U.minimum,inclusive:!0,input:v,inst:$,continue:!U.abort})}}),Yr=J("$ZodCheckLengthEquals",($,U)=>{var r;y.init($,U),(r=$._zod.def).when??(r.when=(b)=>{let v=b.value;return!x$(v)&&v.length!==void 0}),$._zod.onattach.push((b)=>{let v=b._zod.bag;v.minimum=U.length,v.maximum=U.length,v.length=U.length}),$._zod.check=(b)=>{let v=b.value,z=v.length;if(z===U.length)return;let _=Fv(v),N=z>U.length;b.issues.push({origin:_,...N?{code:"too_big",maximum:U.length}:{code:"too_small",minimum:U.length},inclusive:!0,exact:!0,input:b.value,inst:$,continue:!U.abort})}}),Iv=J("$ZodCheckStringFormat",($,U)=>{var r,b;if(y.init($,U),$._zod.onattach.push((v)=>{let z=v._zod.bag;if(z.format=U.format,U.pattern)z.patterns??(z.patterns=new Set),z.patterns.add(U.pattern)}),U.pattern)(r=$._zod).check??(r.check=(v)=>{if(U.pattern.lastIndex=0,U.pattern.test(v.value))return;v.issues.push({origin:"string",code:"invalid_format",format:U.format,input:v.value,...U.pattern?{pattern:U.pattern.toString()}:{},inst:$,continue:!U.abort})});else(b=$._zod).check??(b.check=()=>{})}),jr=J("$ZodCheckRegex",($,U)=>{Iv.init($,U),$._zod.check=(r)=>{if(U.pattern.lastIndex=0,U.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:U.pattern.toString(),inst:$,continue:!U.abort})}}),Pr=J("$ZodCheckLowerCase",($,U)=>{U.pattern??(U.pattern=Nr),Iv.init($,U)}),Vr=J("$ZodCheckUpperCase",($,U)=>{U.pattern??(U.pattern=Or),Iv.init($,U)}),qr=J("$ZodCheckIncludes",($,U)=>{y.init($,U);let r=E$(U.includes),b=new RegExp(typeof U.position==="number"?`^.{${U.position}}${r}`:r);U.pattern=b,$._zod.onattach.push((v)=>{let z=v._zod.bag;z.patterns??(z.patterns=new Set),z.patterns.add(b)}),$._zod.check=(v)=>{if(v.value.includes(U.includes,U.position))return;v.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:U.includes,input:v.value,inst:$,continue:!U.abort})}}),Br=J("$ZodCheckStartsWith",($,U)=>{y.init($,U);let r=new RegExp(`^${E$(U.prefix)}.*`);U.pattern??(U.pattern=r),$._zod.onattach.push((b)=>{let v=b._zod.bag;v.patterns??(v.patterns=new Set),v.patterns.add(r)}),$._zod.check=(b)=>{if(b.value.startsWith(U.prefix))return;b.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:U.prefix,input:b.value,inst:$,continue:!U.abort})}}),Lr=J("$ZodCheckEndsWith",($,U)=>{y.init($,U);let r=new RegExp(`.*${E$(U.suffix)}$`);U.pattern??(U.pattern=r),$._zod.onattach.push((b)=>{let v=b._zod.bag;v.patterns??(v.patterns=new Set),v.patterns.add(r)}),$._zod.check=(b)=>{if(b.value.endsWith(U.suffix))return;b.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:U.suffix,input:b.value,inst:$,continue:!U.abort})}});function bO($,U,r){if($.issues.length)U.issues.push(...w$(r,$.issues))}var Hr=J("$ZodCheckProperty",($,U)=>{y.init($,U),$._zod.check=(r)=>{let b=U.schema._zod.run({value:r.value[U.property],issues:[]},{});if(b instanceof Promise)return b.then((v)=>bO(v,r,U.property));bO(b,r,U.property);return}}),Er=J("$ZodCheckMimeType",($,U)=>{y.init($,U);let r=new Set(U.mime);$._zod.onattach.push((b)=>{b._zod.bag.mime=U.mime}),$._zod.check=(b)=>{if(r.has(b.value.type))return;b.issues.push({code:"invalid_value",values:U.mime,input:b.value.type,inst:$,continue:!U.abort})}}),Ar=J("$ZodCheckOverwrite",($,U)=>{y.init($,U),$._zod.check=(r)=>{r.value=U.tx(r.value)}});class o4{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let r=$.split(`
|
|
115
|
-
`).filter((
|
|
116
|
-
`))}}var Gr={major:4,minor:1,patch:8};var A=J("$ZodType",($,U)=>{var r;$??($={}),$._zod.def=U,$._zod.bag=$._zod.bag||{},$._zod.version=Gr;let b=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))b.unshift($);for(let v of b)for(let z of v._zod.onattach)z($);if(b.length===0)(r=$._zod).deferred??(r.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let v=(_,N,O)=>{let I=T$(_),k;for(let W of N){if(W._zod.def.when){if(!W._zod.def.when(_))continue}else if(I)continue;let X=_.issues.length,w=W._zod.check(_);if(w instanceof Promise&&O?.async===!1)throw new H$;if(k||w instanceof Promise)k=(k??Promise.resolve()).then(async()=>{if(await w,_.issues.length===X)return;if(!I)I=T$(_,X)});else{if(_.issues.length===X)continue;if(!I)I=T$(_,X)}}if(k)return k.then(()=>{return _});return _},z=(_,N,O)=>{if(T$(_))return _.aborted=!0,_;let I=v(N,b,O);if(I instanceof Promise){if(O.async===!1)throw new H$;return I.then((k)=>$._zod.parse(k,O))}return $._zod.parse(I,O)};$._zod.run=(_,N)=>{if(N.skipChecks)return $._zod.parse(_,N);if(N.direction==="backward"){let I=$._zod.parse({value:_.value,issues:[]},{...N,skipChecks:!0});if(I instanceof Promise)return I.then((k)=>{return z(k,_,N)});return z(I,_,N)}let O=$._zod.parse(_,N);if(O instanceof Promise){if(N.async===!1)throw new H$;return O.then((I)=>v(I,b,N))}return v(O,b,N)}}$["~standard"]={validate:(v)=>{try{let z=DU($,v);return z.success?{value:z.data}:{issues:z.error?.issues}}catch(z){return xU($,v).then((_)=>_.success?{value:_.data}:{issues:_.error?.issues})}},vendor:"zod",version:1}}),l$=J("$ZodString",($,U)=>{A.init($,U),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??$r($._zod.bag),$._zod.parse=(r,b)=>{if(U.coerce)try{r.value=String(r.value)}catch(v){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:$}),r}}),c=J("$ZodStringFormat",($,U)=>{Iv.init($,U),l$.init($,U)}),Fr=J("$ZodGUID",($,U)=>{U.pattern??(U.pattern=hU),c.init($,U)}),Mr=J("$ZodUUID",($,U)=>{if(U.version){let b={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[U.version];if(b===void 0)throw Error(`Invalid UUID version: "${U.version}"`);U.pattern??(U.pattern=i$(b))}else U.pattern??(U.pattern=i$());c.init($,U)}),Zr=J("$ZodEmail",($,U)=>{U.pattern??(U.pattern=nU),c.init($,U)}),Dr=J("$ZodURL",($,U)=>{c.init($,U),$._zod.check=(r)=>{try{let b=r.value.trim(),v=new URL(b);if(U.hostname){if(U.hostname.lastIndex=0,!U.hostname.test(v.hostname))r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:pU.source,input:r.value,inst:$,continue:!U.abort})}if(U.protocol){if(U.protocol.lastIndex=0,!U.protocol.test(v.protocol.endsWith(":")?v.protocol.slice(0,-1):v.protocol))r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:U.protocol.source,input:r.value,inst:$,continue:!U.abort})}if(U.normalize)r.value=v.href;else r.value=b;return}catch(b){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:$,continue:!U.abort})}}}),xr=J("$ZodEmoji",($,U)=>{U.pattern??(U.pattern=yU()),c.init($,U)}),gr=J("$ZodNanoID",($,U)=>{U.pattern??(U.pattern=cU),c.init($,U)}),Rr=J("$ZodCUID",($,U)=>{U.pattern??(U.pattern=gU),c.init($,U)}),mr=J("$ZodCUID2",($,U)=>{U.pattern??(U.pattern=RU),c.init($,U)}),Tr=J("$ZodULID",($,U)=>{U.pattern??(U.pattern=mU),c.init($,U)}),Cr=J("$ZodXID",($,U)=>{U.pattern??(U.pattern=TU),c.init($,U)}),cr=J("$ZodKSUID",($,U)=>{U.pattern??(U.pattern=CU),c.init($,U)}),ur=J("$ZodISODateTime",($,U)=>{U.pattern??(U.pattern=sU(U)),c.init($,U)}),hr=J("$ZodISODate",($,U)=>{U.pattern??(U.pattern=eU),c.init($,U)}),nr=J("$ZodISOTime",($,U)=>{U.pattern??(U.pattern=aU(U)),c.init($,U)}),yr=J("$ZodISODuration",($,U)=>{U.pattern??(U.pattern=uU),c.init($,U)}),fr=J("$ZodIPv4",($,U)=>{U.pattern??(U.pattern=fU),c.init($,U),$._zod.onattach.push((r)=>{let b=r._zod.bag;b.format="ipv4"})}),ir=J("$ZodIPv6",($,U)=>{U.pattern??(U.pattern=iU),c.init($,U),$._zod.onattach.push((r)=>{let b=r._zod.bag;b.format="ipv6"}),$._zod.check=(r)=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:$,continue:!U.abort})}}}),lr=J("$ZodCIDRv4",($,U)=>{U.pattern??(U.pattern=lU),c.init($,U)}),or=J("$ZodCIDRv6",($,U)=>{U.pattern??(U.pattern=oU),c.init($,U),$._zod.check=(r)=>{let b=r.value.split("/");try{if(b.length!==2)throw Error();let[v,z]=b;if(!z)throw Error();let _=Number(z);if(`${_}`!==z)throw Error();if(_<0||_>128)throw Error();new URL(`http://[${v}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:$,continue:!U.abort})}}});function dr($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var pr=J("$ZodBase64",($,U)=>{U.pattern??(U.pattern=dU),c.init($,U),$._zod.onattach.push((r)=>{r._zod.bag.contentEncoding="base64"}),$._zod.check=(r)=>{if(dr(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:$,continue:!U.abort})}});function YO($){if(!f4.test($))return!1;let U=$.replace(/[-_]/g,(b)=>b==="-"?"+":"/"),r=U.padEnd(Math.ceil(U.length/4)*4,"=");return dr(r)}var tr=J("$ZodBase64URL",($,U)=>{U.pattern??(U.pattern=f4),c.init($,U),$._zod.onattach.push((r)=>{r._zod.bag.contentEncoding="base64url"}),$._zod.check=(r)=>{if(YO(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:$,continue:!U.abort})}}),er=J("$ZodE164",($,U)=>{U.pattern??(U.pattern=tU),c.init($,U)});function jO($,U=null){try{let r=$.split(".");if(r.length!==3)return!1;let[b]=r;if(!b)return!1;let v=JSON.parse(atob(b));if("typ"in v&&v?.typ!=="JWT")return!1;if(!v.alg)return!1;if(U&&(!("alg"in v)||v.alg!==U))return!1;return!0}catch{return!1}}var ar=J("$ZodJWT",($,U)=>{c.init($,U),$._zod.check=(r)=>{if(jO(r.value,U.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:$,continue:!U.abort})}}),sr=J("$ZodCustomStringFormat",($,U)=>{c.init($,U),$._zod.check=(r)=>{if(U.fn(r.value))return;r.issues.push({code:"invalid_format",format:U.format,input:r.value,inst:$,continue:!U.abort})}}),s4=J("$ZodNumber",($,U)=>{A.init($,U),$._zod.pattern=$._zod.bag.pattern??rr,$._zod.parse=(r,b)=>{if(U.coerce)try{r.value=Number(r.value)}catch(_){}let v=r.value;if(typeof v==="number"&&!Number.isNaN(v)&&Number.isFinite(v))return r;let z=typeof v==="number"?Number.isNaN(v)?"NaN":!Number.isFinite(v)?"Infinity":void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:v,inst:$,...z?{received:z}:{}}),r}}),$b=J("$ZodNumber",($,U)=>{kr.init($,U),s4.init($,U)}),Rv=J("$ZodBoolean",($,U)=>{A.init($,U),$._zod.pattern=br,$._zod.parse=(r,b)=>{if(U.coerce)try{r.value=Boolean(r.value)}catch(z){}let v=r.value;if(typeof v==="boolean")return r;return r.issues.push({expected:"boolean",code:"invalid_type",input:v,inst:$}),r}}),$6=J("$ZodBigInt",($,U)=>{A.init($,U),$._zod.pattern=vr,$._zod.parse=(r,b)=>{if(U.coerce)try{r.value=BigInt(r.value)}catch(v){}if(typeof r.value==="bigint")return r;return r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:$}),r}}),vb=J("$ZodBigInt",($,U)=>{Jr.init($,U),$6.init($,U)}),Ub=J("$ZodSymbol",($,U)=>{A.init($,U),$._zod.parse=(r,b)=>{let v=r.value;if(typeof v==="symbol")return r;return r.issues.push({expected:"symbol",code:"invalid_type",input:v,inst:$}),r}}),rb=J("$ZodUndefined",($,U)=>{A.init($,U),$._zod.pattern=_r,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(r,b)=>{let v=r.value;if(typeof v>"u")return r;return r.issues.push({expected:"undefined",code:"invalid_type",input:v,inst:$}),r}}),bb=J("$ZodNull",($,U)=>{A.init($,U),$._zod.pattern=zr,$._zod.values=new Set([null]),$._zod.parse=(r,b)=>{let v=r.value;if(v===null)return r;return r.issues.push({expected:"null",code:"invalid_type",input:v,inst:$}),r}}),zb=J("$ZodAny",($,U)=>{A.init($,U),$._zod.parse=(r)=>r}),_b=J("$ZodUnknown",($,U)=>{A.init($,U),$._zod.parse=(r)=>r}),Nb=J("$ZodNever",($,U)=>{A.init($,U),$._zod.parse=(r,b)=>{return r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:$}),r}}),Ob=J("$ZodVoid",($,U)=>{A.init($,U),$._zod.parse=(r,b)=>{let v=r.value;if(typeof v>"u")return r;return r.issues.push({expected:"void",code:"invalid_type",input:v,inst:$}),r}}),Ib=J("$ZodDate",($,U)=>{A.init($,U),$._zod.parse=(r,b)=>{if(U.coerce)try{r.value=new Date(r.value)}catch(N){}let v=r.value,z=v instanceof Date;if(z&&!Number.isNaN(v.getTime()))return r;return r.issues.push({expected:"date",code:"invalid_type",input:v,...z?{received:"Invalid Date"}:{},inst:$}),r}});function NO($,U,r){if($.issues.length)U.issues.push(...w$(r,$.issues));U.value[r]=$.value}var kb=J("$ZodArray",($,U)=>{A.init($,U),$._zod.parse=(r,b)=>{let v=r.value;if(!Array.isArray(v))return r.issues.push({expected:"array",code:"invalid_type",input:v,inst:$}),r;r.value=Array(v.length);let z=[];for(let _=0;_<v.length;_++){let N=v[_],O=U.element._zod.run({value:N,issues:[]},b);if(O instanceof Promise)z.push(O.then((I)=>NO(I,r,_)));else NO(O,r,_)}if(z.length)return Promise.all(z).then(()=>r);return r}});function a4($,U,r,b){if($.issues.length)U.issues.push(...w$(r,$.issues));if($.value===void 0){if(r in b)U.value[r]=void 0}else U.value[r]=$.value}function PO($){let U=Object.keys($.shape);for(let b of U)if(!$.shape?.[b]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${b}": expected a Zod schema`);let r=GU($.shape);return{...$,keys:U,keySet:new Set(U),numKeys:U.length,optionalKeys:new Set(r)}}function VO($,U,r,b,v,z){let _=[],N=v.keySet,O=v.catchall._zod,I=O.def.type;for(let k of Object.keys(U)){if(N.has(k))continue;if(I==="never"){_.push(k);continue}let W=O.run({value:U[k],issues:[]},b);if(W instanceof Promise)$.push(W.then((X)=>a4(X,r,k,U)));else a4(W,r,k,U)}if(_.length)r.issues.push({code:"unrecognized_keys",keys:_,input:U,inst:z});if(!$.length)return r;return Promise.all($).then(()=>{return r})}var qO=J("$ZodObject",($,U)=>{A.init($,U);let r=rv(()=>PO(U));Z($._zod,"propValues",()=>{let _=U.shape,N={};for(let O in _){let I=_[O]._zod;if(I.values){N[O]??(N[O]=new Set);for(let k of I.values)N[O].add(k)}}return N});let b=f$,v=U.catchall,z;$._zod.parse=(_,N)=>{z??(z=r.value);let O=_.value;if(!b(O))return _.issues.push({expected:"object",code:"invalid_type",input:O,inst:$}),_;_.value={};let I=[],k=z.shape;for(let W of z.keys){let w=k[W]._zod.run({value:O[W],issues:[]},N);if(w instanceof Promise)I.push(w.then((j)=>a4(j,_,W,O)));else a4(w,_,W,O)}if(!v)return I.length?Promise.all(I).then(()=>_):_;return VO(I,O,_,N,r.value,$)}}),Jb=J("$ZodObjectJIT",($,U)=>{qO.init($,U);let r=$._zod.parse,b=rv(()=>PO(U)),v=(X)=>{let w=new o4(["shape","payload","ctx"]),j=b.value,B=(m)=>{let d=D4(m);return`shape[${d}]._zod.run({ value: input[${d}], issues: [] }, ctx)`};w.write("const input = payload.value;");let D=Object.create(null),x=0;for(let m of j.keys)D[m]=`key_${x++}`;w.write("const newResult = {};");for(let m of j.keys){let d=D[m],X$=D4(m);w.write(`const ${d} = ${B(m)};`),w.write(`
|
|
117
|
-
if (${
|
|
118
|
-
payload.issues = payload.issues.concat(${
|
|
112
|
+
`)}}saveMemory(e){let r=od("M"),n=(e.concepts[0]??"memory").slice(0,80);return this.stmts.insertEntry.run(r,"memory",n,e.content,"",null,0.5,JSON.stringify(e.concepts),JSON.stringify(e.files??[]),"","",Date.now()),Promise.resolve({id:r})}saveLesson(e){let r=od("L"),n=e.confidence??0.5,o=(e.content.split(`
|
|
113
|
+
`)[0]??"lesson").slice(0,80);return this.stmts.insertEntry.run(r,"lesson",o,e.content,e.context,null,n,JSON.stringify(e.tags??[]),JSON.stringify([]),"","",Date.now()),Promise.resolve({id:r})}smartSearch(e){let r=e.limit??10,n=this.toFtsQuery(e.query),t=this.stmts.ftsSearch.all(n,r).map((i)=>({id:i.id,title:i.title,content:i.content,type:i.kind,concepts:id(i.tags),confidence:i.confidence,files:id(i.files),advice:i.advice??"info"}));return Promise.resolve({lessons:t,crystals:[]})}boulderRead(e){let n=this.stmts.boulderSelect.all(e.directory,e.sessionID).map((o)=>({id:o.id,title:o.title,priority:o.priority,status:o.status,description:o.description,createdAtMs:o.created_at_ms,updatedAtMs:o.updated_at_ms}));if(e.query){let o=e.query.toLowerCase();n=n.filter((t)=>t.title.toLowerCase().includes(o)||t.description.toLowerCase().includes(o))}return Promise.resolve(n)}close(){this.db.close()}toFtsQuery(e){let r=e.trim().split(/\s+/).filter(Boolean).map((n)=>n.replace(/["()*]/g,"")).filter(Boolean);if(r.length===0)return'""';return r.map((n)=>`"${n}"*`).join(" ")}}function id(e){try{let r=JSON.parse(e);return Array.isArray(r)?r:[]}catch{return[]}}var Co=null;function Lr(){if(!Co)Co=new ad;return Co}var qn={};me(qn,{$brand:()=>jo,$input:()=>Us,$output:()=>Ns,NEVER:()=>Eo,TimePrecision:()=>Fs,ZodAny:()=>Hd,ZodArray:()=>Xd,ZodBase64:()=>il,ZodBase64URL:()=>al,ZodBigInt:()=>gr,ZodBigIntFormat:()=>ll,ZodBoolean:()=>fr,ZodCIDRv4:()=>nl,ZodCIDRv6:()=>ol,ZodCUID:()=>Kc,ZodCUID2:()=>Xc,ZodCatch:()=>hm,ZodCodec:()=>bl,ZodCustom:()=>Jn,ZodCustomStringFormat:()=>mr,ZodDate:()=>Wn,ZodDefault:()=>um,ZodDiscriminatedUnion:()=>Yd,ZodE164:()=>sl,ZodEmail:()=>Hc,ZodEmoji:()=>Jc,ZodEnum:()=>ur,ZodError:()=>Kv,ZodFile:()=>sm,ZodFirstPartyTypeKind:()=>_l,ZodFunction:()=>Sm,ZodGUID:()=>Ln,ZodIPv4:()=>tl,ZodIPv6:()=>rl,ZodISODate:()=>Mn,ZodISODateTime:()=>An,ZodISODuration:()=>Nn,ZodISOTime:()=>Rn,ZodIntersection:()=>Qd,ZodIssueCode:()=>sb,ZodJWT:()=>cl,ZodKSUID:()=>el,ZodLazy:()=>$m,ZodLiteral:()=>am,ZodMap:()=>om,ZodNaN:()=>ym,ZodNanoID:()=>qc,ZodNever:()=>qd,ZodNonOptional:()=>vl,ZodNull:()=>Wd,ZodNullable:()=>lm,ZodNumber:()=>pr,ZodNumberFormat:()=>yt,ZodObject:()=>Hn,ZodOptional:()=>hl,ZodPipe:()=>yl,ZodPrefault:()=>mm,ZodPromise:()=>wm,ZodReadonly:()=>bm,ZodRealError:()=>ue,ZodRecord:()=>pl,ZodSet:()=>im,ZodString:()=>dr,ZodStringFormat:()=>V,ZodSuccess:()=>gm,ZodSymbol:()=>Gd,ZodTemplateLiteral:()=>km,ZodTransform:()=>cm,ZodTuple:()=>tm,ZodType:()=>z,ZodULID:()=>Yc,ZodURL:()=>Vn,ZodUUID:()=>Ee,ZodUndefined:()=>Vd,ZodUnion:()=>dl,ZodUnknown:()=>Jd,ZodVoid:()=>Kd,ZodXID:()=>Qc,_ZodString:()=>Bc,_default:()=>dm,_function:()=>eb,any:()=>jy,array:()=>Bn,base64:()=>vy,base64url:()=>yy,bigint:()=>Dy,boolean:()=>Fd,catch:()=>vm,check:()=>tb,cidrv4:()=>gy,cidrv6:()=>hy,clone:()=>ie,codec:()=>Xy,coerce:()=>kl,config:()=>q,core:()=>Ce,cuid:()=>cy,cuid2:()=>ly,custom:()=>rb,date:()=>My,decode:()=>Rc,decodeAsync:()=>Uc,discriminatedUnion:()=>Zy,e164:()=>by,email:()=>Yv,emoji:()=>ay,encode:()=>Mc,encodeAsync:()=>Nc,endsWith:()=>or,enum:()=>fl,file:()=>Hy,flattenError:()=>Rt,float32:()=>Sy,float64:()=>Iy,formatError:()=>Nt,function:()=>eb,getErrorMap:()=>lb,globalRegistry:()=>Oe,gt:()=>Pe,gte:()=>le,guid:()=>Qv,hash:()=>wy,hex:()=>xy,hostname:()=>$y,httpUrl:()=>iy,includes:()=>rr,instanceof:()=>nb,int:()=>Wc,int32:()=>Ty,int64:()=>Py,intersection:()=>em,ipv4:()=>py,ipv6:()=>fy,iso:()=>Un,json:()=>ib,jwt:()=>_y,keyof:()=>Ry,ksuid:()=>my,lazy:()=>xm,length:()=>gt,literal:()=>By,locales:()=>Jt,looseObject:()=>Ly,lowercase:()=>er,lt:()=>De,lte:()=>ye,map:()=>Gy,maxLength:()=>ft,maxSize:()=>pt,mime:()=>ir,minLength:()=>Ue,minSize:()=>Ye,multipleOf:()=>Xe,nan:()=>Ky,nanoid:()=>sy,nativeEnum:()=>Wy,negative:()=>vc,never:()=>ul,nonnegative:()=>bc,nonoptional:()=>fm,nonpositive:()=>yc,normalize:()=>ar,null:()=>Bd,nullable:()=>Fn,nullish:()=>Jy,number:()=>Zd,object:()=>Ny,optional:()=>Zn,overwrite:()=>ze,parse:()=>Cc,parseAsync:()=>Ec,partialRecord:()=>Fy,pipe:()=>Gn,positive:()=>hc,prefault:()=>pm,preprocess:()=>ab,prettifyError:()=>Vo,promise:()=>Qy,property:()=>_c,readonly:()=>_m,record:()=>nm,refine:()=>Im,regex:()=>Qt,regexes:()=>ve,registry:()=>pn,safeDecode:()=>Zc,safeDecodeAsync:()=>Gc,safeEncode:()=>Lc,safeEncodeAsync:()=>Fc,safeParse:()=>jc,safeParseAsync:()=>Ac,set:()=>Vy,setErrorMap:()=>cb,size:()=>Yt,startsWith:()=>nr,strictObject:()=>Uy,string:()=>Vc,stringFormat:()=>ky,stringbool:()=>ob,success:()=>qy,superRefine:()=>Tm,symbol:()=>Cy,templateLiteral:()=>Yy,toJSONSchema:()=>Tc,toLowerCase:()=>cr,toUpperCase:()=>lr,transform:()=>gl,treeifyError:()=>Go,trim:()=>sr,tuple:()=>rm,uint32:()=>Oy,uint64:()=>zy,ulid:()=>uy,undefined:()=>Ey,union:()=>ml,unknown:()=>vt,uppercase:()=>tr,url:()=>oy,util:()=>b,uuid:()=>ey,uuidv4:()=>ty,uuidv6:()=>ry,uuidv7:()=>ny,void:()=>Ay,xid:()=>dy});var Ce={};me(Ce,{$ZodAny:()=>ya,$ZodArray:()=>xa,$ZodAsyncError:()=>Ie,$ZodBase64:()=>ca,$ZodBase64URL:()=>la,$ZodBigInt:()=>un,$ZodBigIntFormat:()=>fa,$ZodBoolean:()=>Zt,$ZodCIDRv4:()=>ia,$ZodCIDRv6:()=>aa,$ZodCUID:()=>Ji,$ZodCUID2:()=>qi,$ZodCatch:()=>La,$ZodCheck:()=>W,$ZodCheckBigIntFormat:()=>wi,$ZodCheckEndsWith:()=>Mi,$ZodCheckGreaterThan:()=>tn,$ZodCheckIncludes:()=>ji,$ZodCheckLengthEquals:()=>Pi,$ZodCheckLessThan:()=>en,$ZodCheckLowerCase:()=>Ci,$ZodCheckMaxLength:()=>Oi,$ZodCheckMaxSize:()=>Si,$ZodCheckMimeType:()=>Ni,$ZodCheckMinLength:()=>Di,$ZodCheckMinSize:()=>Ii,$ZodCheckMultipleOf:()=>$i,$ZodCheckNumberFormat:()=>xi,$ZodCheckOverwrite:()=>Ui,$ZodCheckProperty:()=>Ri,$ZodCheckRegex:()=>zi,$ZodCheckSizeEquals:()=>Ti,$ZodCheckStartsWith:()=>Ai,$ZodCheckStringFormat:()=>mt,$ZodCheckUpperCase:()=>Ei,$ZodCodec:()=>Ft,$ZodCustom:()=>Ja,$ZodCustomStringFormat:()=>ma,$ZodDate:()=>$a,$ZodDefault:()=>Ma,$ZodDiscriminatedUnion:()=>Sa,$ZodE164:()=>ua,$ZodEmail:()=>Vi,$ZodEmoji:()=>Bi,$ZodEncodeError:()=>He,$ZodEnum:()=>Pa,$ZodError:()=>Mt,$ZodFile:()=>Ca,$ZodFunction:()=>Wa,$ZodGUID:()=>Fi,$ZodIPv4:()=>na,$ZodIPv6:()=>oa,$ZodISODate:()=>ea,$ZodISODateTime:()=>Qi,$ZodISODuration:()=>ra,$ZodISOTime:()=>ta,$ZodIntersection:()=>Ia,$ZodJWT:()=>da,$ZodKSUID:()=>Yi,$ZodLazy:()=>Ha,$ZodLiteral:()=>za,$ZodMap:()=>Oa,$ZodNaN:()=>Za,$ZodNanoID:()=>Hi,$ZodNever:()=>_a,$ZodNonOptional:()=>Na,$ZodNull:()=>va,$ZodNullable:()=>Aa,$ZodNumber:()=>ln,$ZodNumberFormat:()=>pa,$ZodObject:()=>Ed,$ZodObjectJIT:()=>wa,$ZodOptional:()=>ja,$ZodPipe:()=>Fa,$ZodPrefault:()=>Ra,$ZodPromise:()=>Ba,$ZodReadonly:()=>Ga,$ZodRealError:()=>ce,$ZodRecord:()=>Ta,$ZodRegistry:()=>qt,$ZodSet:()=>Da,$ZodString:()=>Ke,$ZodStringFormat:()=>F,$ZodSuccess:()=>Ua,$ZodSymbol:()=>ga,$ZodTemplateLiteral:()=>Va,$ZodTransform:()=>Ea,$ZodTuple:()=>mn,$ZodType:()=>D,$ZodULID:()=>Ki,$ZodURL:()=>Wi,$ZodUUID:()=>Gi,$ZodUndefined:()=>ha,$ZodUnion:()=>dn,$ZodUnknown:()=>ba,$ZodVoid:()=>ka,$ZodXID:()=>Xi,$brand:()=>jo,$constructor:()=>m,$input:()=>Us,$output:()=>Ns,Doc:()=>rn,JSONSchema:()=>Nd,JSONSchemaGenerator:()=>jn,NEVER:()=>Eo,TimePrecision:()=>Fs,_any:()=>lc,_array:()=>kc,_base64:()=>Pn,_base64url:()=>zn,_bigint:()=>rc,_boolean:()=>ec,_catch:()=>Gv,_check:()=>Rd,_cidrv4:()=>On,_cidrv6:()=>Dn,_coercedBigint:()=>nc,_coercedBoolean:()=>tc,_coercedDate:()=>fc,_coercedNumber:()=>Js,_coercedString:()=>Zs,_cuid:()=>kn,_cuid2:()=>$n,_custom:()=>xc,_date:()=>pc,_decode:()=>Br,_decodeAsync:()=>Jr,_default:()=>Lv,_discriminatedUnion:()=>Ov,_e164:()=>Cn,_email:()=>fn,_emoji:()=>bn,_encode:()=>Wr,_encodeAsync:()=>Hr,_endsWith:()=>or,_enum:()=>jv,_file:()=>$c,_float32:()=>Ks,_float64:()=>Xs,_gt:()=>Pe,_gte:()=>le,_guid:()=>Kt,_includes:()=>rr,_int:()=>qs,_int32:()=>Ys,_int64:()=>oc,_intersection:()=>Dv,_ipv4:()=>In,_ipv6:()=>Tn,_isoDate:()=>Vs,_isoDateTime:()=>Gs,_isoDuration:()=>Bs,_isoTime:()=>Ws,_jwt:()=>En,_ksuid:()=>Sn,_lazy:()=>Hv,_length:()=>gt,_literal:()=>Mv,_lowercase:()=>er,_lt:()=>De,_lte:()=>ye,_map:()=>Cv,_max:()=>ye,_maxLength:()=>ft,_maxSize:()=>pt,_mime:()=>ir,_min:()=>le,_minLength:()=>Ue,_minSize:()=>Ye,_multipleOf:()=>Xe,_nan:()=>gc,_nanoid:()=>_n,_nativeEnum:()=>Av,_negative:()=>vc,_never:()=>dc,_nonnegative:()=>bc,_nonoptional:()=>Zv,_nonpositive:()=>yc,_normalize:()=>ar,_null:()=>cc,_nullable:()=>Uv,_number:()=>Hs,_optional:()=>Nv,_overwrite:()=>ze,_parse:()=>ct,_parseAsync:()=>lt,_pipe:()=>Vv,_positive:()=>hc,_promise:()=>Jv,_property:()=>_c,_readonly:()=>Wv,_record:()=>zv,_refine:()=>wc,_regex:()=>Qt,_safeDecode:()=>Kr,_safeDecodeAsync:()=>Yr,_safeEncode:()=>qr,_safeEncodeAsync:()=>Xr,_safeParse:()=>ut,_safeParseAsync:()=>dt,_set:()=>Ev,_size:()=>Yt,_startsWith:()=>nr,_string:()=>Ls,_stringFormat:()=>ht,_stringbool:()=>Ic,_success:()=>Fv,_superRefine:()=>Sc,_symbol:()=>ac,_templateLiteral:()=>Bv,_toLowerCase:()=>cr,_toUpperCase:()=>lr,_transform:()=>Rv,_trim:()=>sr,_tuple:()=>Pv,_uint32:()=>Qs,_uint64:()=>ic,_ulid:()=>xn,_undefined:()=>sc,_union:()=>Tv,_unknown:()=>uc,_uppercase:()=>tr,_url:()=>Xt,_uuid:()=>gn,_uuidv4:()=>hn,_uuidv6:()=>vn,_uuidv7:()=>yn,_void:()=>mc,_xid:()=>wn,clone:()=>ie,config:()=>q,decode:()=>Yg,decodeAsync:()=>eh,encode:()=>Xg,encodeAsync:()=>Qg,flattenError:()=>Rt,formatError:()=>Nt,globalConfig:()=>Dt,globalRegistry:()=>Oe,isValidBase64:()=>sa,isValidBase64URL:()=>Dd,isValidJWT:()=>Pd,locales:()=>Jt,parse:()=>Gr,parseAsync:()=>Vr,prettifyError:()=>Vo,regexes:()=>ve,registry:()=>pn,safeDecode:()=>rh,safeDecodeAsync:()=>oh,safeEncode:()=>th,safeEncodeAsync:()=>nh,safeParse:()=>Wo,safeParseAsync:()=>Bo,toDotPath:()=>md,toJSONSchema:()=>Tc,treeifyError:()=>Go,util:()=>b,version:()=>Li});var Eo=Object.freeze({status:"aborted"});function m(e,r,n){function o(s,c){var l;Object.defineProperty(s,"_zod",{value:s._zod??{},enumerable:!1}),(l=s._zod).traits??(l.traits=new Set),s._zod.traits.add(e),r(s,c);for(let d in a.prototype)if(!(d in s))Object.defineProperty(s,d,{value:a.prototype[d].bind(s)});s._zod.constr=a,s._zod.def=c}let t=n?.Parent??Object;class i extends t{}Object.defineProperty(i,"name",{value:e});function a(s){var c;let l=n?.Parent?new i:this;o(l,s),(c=l._zod).deferred??(c.deferred=[]);for(let d of l._zod.deferred)d();return l}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:(s)=>{if(n?.Parent&&s instanceof n.Parent)return!0;return s?._zod?.traits?.has(e)}}),Object.defineProperty(a,"name",{value:e}),a}var jo=Symbol("zod_brand");class Ie extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class He extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}var Dt={};function q(e){if(e)Object.assign(Dt,e);return Dt}var b={};me(b,{BIGINT_FORMAT_RANGES:()=>Fo,Class:()=>ud,NUMBER_FORMAT_RANGES:()=>Zo,aborted:()=>Ne,allowsEval:()=>Ro,assert:()=>Dg,assertEqual:()=>Sg,assertIs:()=>Tg,assertNever:()=>Og,assertNotEqual:()=>Ig,assignProp:()=>Ae,base64ToUint8Array:()=>cd,base64urlToUint8Array:()=>Bg,cached:()=>at,captureStackTrace:()=>Fr,cleanEnum:()=>Wg,cleanRegex:()=>Ct,clone:()=>ie,cloneDef:()=>zg,createTransparentProxy:()=>Rg,defineLazy:()=>E,esc:()=>Zr,escapeRegex:()=>Te,extend:()=>Lg,finalizeIssue:()=>ge,floatSafeRemainder:()=>Mo,getElementAtPath:()=>Cg,getEnumValues:()=>zt,getLengthableOrigin:()=>At,getParsedType:()=>Mg,getSizableOrigin:()=>jt,hexToUint8Array:()=>Jg,isObject:()=>Je,isPlainObject:()=>Re,issue:()=>st,joinValues:()=>p,jsonStringifyReplacer:()=>it,merge:()=>Fg,mergeDefs:()=>Me,normalizeParams:()=>k,nullish:()=>je,numKeys:()=>Ag,objectClone:()=>Pg,omit:()=>Ug,optionalKeys:()=>Lo,partial:()=>Gg,pick:()=>Ng,prefixIssues:()=>fe,primitiveTypes:()=>Uo,promiseAllObject:()=>Eg,propertyKeyTypes:()=>Et,randomString:()=>jg,required:()=>Vg,safeExtend:()=>Zg,shallowClone:()=>No,stringifyPrimitive:()=>_,uint8ArrayToBase64:()=>ld,uint8ArrayToBase64url:()=>Hg,uint8ArrayToHex:()=>qg,unwrapMessage:()=>Pt});function Sg(e){return e}function Ig(e){return e}function Tg(e){}function Og(e){throw Error()}function Dg(e){}function zt(e){let r=Object.values(e).filter((o)=>typeof o==="number");return Object.entries(e).filter(([o,t])=>r.indexOf(+o)===-1).map(([o,t])=>t)}function p(e,r="|"){return e.map((n)=>_(n)).join(r)}function it(e,r){if(typeof r==="bigint")return r.toString();return r}function at(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw Error("cached value already set")}}}function je(e){return e===null||e===void 0}function Ct(e){let r=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(r,n)}function Mo(e,r){let n=(e.toString().split(".")[1]||"").length,o=r.toString(),t=(o.split(".")[1]||"").length;if(t===0&&/\d?e-\d?/.test(o)){let c=o.match(/\d?e-(\d?)/);if(c?.[1])t=Number.parseInt(c[1])}let i=n>t?n:t,a=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(r.toFixed(i).replace(".",""));return a%s/10**i}var sd=Symbol("evaluating");function E(e,r,n){let o=void 0;Object.defineProperty(e,r,{get(){if(o===sd)return;if(o===void 0)o=sd,o=n();return o},set(t){Object.defineProperty(e,r,{value:t})},configurable:!0})}function Pg(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ae(e,r,n){Object.defineProperty(e,r,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Me(...e){let r={};for(let n of e){let o=Object.getOwnPropertyDescriptors(n);Object.assign(r,o)}return Object.defineProperties({},r)}function zg(e){return Me(e._zod.def)}function Cg(e,r){if(!r)return e;return r.reduce((n,o)=>n?.[o],e)}function Eg(e){let r=Object.keys(e),n=r.map((o)=>e[o]);return Promise.all(n).then((o)=>{let t={};for(let i=0;i<r.length;i++)t[r[i]]=o[i];return t})}function jg(e=10){let n="";for(let o=0;o<e;o++)n+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return n}function Zr(e){return JSON.stringify(e)}var Fr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Je(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var Ro=at(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Re(e){if(Je(e)===!1)return!1;let r=e.constructor;if(r===void 0)return!0;let n=r.prototype;if(Je(n)===!1)return!1;if(Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)return!1;return!0}function No(e){if(Re(e))return{...e};if(Array.isArray(e))return[...e];return e}function Ag(e){let r=0;for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n))r++;return r}var Mg=(e)=>{let r=typeof e;switch(r){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(e===null)return"null";if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return"promise";if(typeof Map<"u"&&e instanceof Map)return"map";if(typeof Set<"u"&&e instanceof Set)return"set";if(typeof Date<"u"&&e instanceof Date)return"date";if(typeof File<"u"&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${r}`)}},Et=new Set(["string","number","symbol"]),Uo=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Te(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ie(e,r,n){let o=new e._zod.constr(r??e._zod.def);if(!r||n?.parent)o._zod.parent=e;return o}function k(e){let r=e;if(!r)return{};if(typeof r==="string")return{error:()=>r};if(r?.message!==void 0){if(r?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");r.error=r.message}if(delete r.message,typeof r.error==="string")return{...r,error:()=>r.error};return r}function Rg(e){let r;return new Proxy({},{get(n,o,t){return r??(r=e()),Reflect.get(r,o,t)},set(n,o,t,i){return r??(r=e()),Reflect.set(r,o,t,i)},has(n,o){return r??(r=e()),Reflect.has(r,o)},deleteProperty(n,o){return r??(r=e()),Reflect.deleteProperty(r,o)},ownKeys(n){return r??(r=e()),Reflect.ownKeys(r)},getOwnPropertyDescriptor(n,o){return r??(r=e()),Reflect.getOwnPropertyDescriptor(r,o)},defineProperty(n,o,t){return r??(r=e()),Reflect.defineProperty(r,o,t)}})}function _(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function Lo(e){return Object.keys(e).filter((r)=>e[r]._zod.optin==="optional"&&e[r]._zod.optout==="optional")}var Zo={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Fo={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Ng(e,r){let n=e._zod.def,o=Me(e._zod.def,{get shape(){let t={};for(let i in r){if(!(i in n.shape))throw Error(`Unrecognized key: "${i}"`);if(!r[i])continue;t[i]=n.shape[i]}return Ae(this,"shape",t),t},checks:[]});return ie(e,o)}function Ug(e,r){let n=e._zod.def,o=Me(e._zod.def,{get shape(){let t={...e._zod.def.shape};for(let i in r){if(!(i in n.shape))throw Error(`Unrecognized key: "${i}"`);if(!r[i])continue;delete t[i]}return Ae(this,"shape",t),t},checks:[]});return ie(e,o)}function Lg(e,r){if(!Re(r))throw Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let t=Me(e._zod.def,{get shape(){let i={...e._zod.def.shape,...r};return Ae(this,"shape",i),i},checks:[]});return ie(e,t)}function Zg(e,r){if(!Re(r))throw Error("Invalid input to safeExtend: expected a plain object");let n={...e._zod.def,get shape(){let o={...e._zod.def.shape,...r};return Ae(this,"shape",o),o},checks:e._zod.def.checks};return ie(e,n)}function Fg(e,r){let n=Me(e._zod.def,{get shape(){let o={...e._zod.def.shape,...r._zod.def.shape};return Ae(this,"shape",o),o},get catchall(){return r._zod.def.catchall},checks:[]});return ie(e,n)}function Gg(e,r,n){let o=Me(r._zod.def,{get shape(){let t=r._zod.def.shape,i={...t};if(n)for(let a in n){if(!(a in t))throw Error(`Unrecognized key: "${a}"`);if(!n[a])continue;i[a]=e?new e({type:"optional",innerType:t[a]}):t[a]}else for(let a in t)i[a]=e?new e({type:"optional",innerType:t[a]}):t[a];return Ae(this,"shape",i),i},checks:[]});return ie(r,o)}function Vg(e,r,n){let o=Me(r._zod.def,{get shape(){let t=r._zod.def.shape,i={...t};if(n)for(let a in n){if(!(a in i))throw Error(`Unrecognized key: "${a}"`);if(!n[a])continue;i[a]=new e({type:"nonoptional",innerType:t[a]})}else for(let a in t)i[a]=new e({type:"nonoptional",innerType:t[a]});return Ae(this,"shape",i),i},checks:[]});return ie(r,o)}function Ne(e,r=0){if(e.aborted===!0)return!0;for(let n=r;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function fe(e,r){return r.map((n)=>{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function Pt(e){return typeof e==="string"?e:e?.message}function ge(e,r,n){let o={...e,path:e.path??[]};if(!e.message){let t=Pt(e.inst?._zod.def?.error?.(e))??Pt(r?.error?.(e))??Pt(n.customError?.(e))??Pt(n.localeError?.(e))??"Invalid input";o.message=t}if(delete o.inst,delete o.continue,!r?.reportInput)delete o.input;return o}function jt(e){if(e instanceof Set)return"set";if(e instanceof Map)return"map";if(e instanceof File)return"file";return"unknown"}function At(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function st(...e){let[r,n,o]=e;if(typeof r==="string")return{message:r,code:"custom",input:n,inst:o};return{...r}}function Wg(e){return Object.entries(e).filter(([r,n])=>Number.isNaN(Number.parseInt(r,10))).map((r)=>r[1])}function cd(e){let r=atob(e),n=new Uint8Array(r.length);for(let o=0;o<r.length;o++)n[o]=r.charCodeAt(o);return n}function ld(e){let r="";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return btoa(r)}function Bg(e){let r=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-r.length%4)%4);return cd(r+n)}function Hg(e){return ld(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Jg(e){let r=e.replace(/^0x/,"");if(r.length%2!==0)throw Error("Invalid hex string length");let n=new Uint8Array(r.length/2);for(let o=0;o<r.length;o+=2)n[o/2]=Number.parseInt(r.slice(o,o+2),16);return n}function qg(e){return Array.from(e).map((r)=>r.toString(16).padStart(2,"0")).join("")}class ud{constructor(...e){}}var dd=(e,r)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:r,enumerable:!1}),e.message=JSON.stringify(r,it,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Mt=m("$ZodError",dd),ce=m("$ZodError",dd,{Parent:Error});function Rt(e,r=(n)=>n.message){let n={},o=[];for(let t of e.issues)if(t.path.length>0)n[t.path[0]]=n[t.path[0]]||[],n[t.path[0]].push(r(t));else o.push(r(t));return{formErrors:o,fieldErrors:n}}function Nt(e,r){let n=r||function(i){return i.message},o={_errors:[]},t=(i)=>{for(let a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map((s)=>t({issues:s}));else if(a.code==="invalid_key")t({issues:a.issues});else if(a.code==="invalid_element")t({issues:a.issues});else if(a.path.length===0)o._errors.push(n(a));else{let s=o,c=0;while(c<a.path.length){let l=a.path[c];if(c!==a.path.length-1)s[l]=s[l]||{_errors:[]};else s[l]=s[l]||{_errors:[]},s[l]._errors.push(n(a));s=s[l],c++}}};return t(e),o}function Go(e,r){let n=r||function(i){return i.message},o={errors:[]},t=(i,a=[])=>{var s,c;for(let l of i.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map((d)=>t({issues:d},l.path));else if(l.code==="invalid_key")t({issues:l.issues},l.path);else if(l.code==="invalid_element")t({issues:l.issues},l.path);else{let d=[...a,...l.path];if(d.length===0){o.errors.push(n(l));continue}let v=o,h=0;while(h<d.length){let u=d[h],y=h===d.length-1;if(typeof u==="string")v.properties??(v.properties={}),(s=v.properties)[u]??(s[u]={errors:[]}),v=v.properties[u];else v.items??(v.items=[]),(c=v.items)[u]??(c[u]={errors:[]}),v=v.items[u];if(y)v.errors.push(n(l));h++}}};return t(e),o}function md(e){let r=[],n=e.map((o)=>typeof o==="object"?o.key:o);for(let o of n)if(typeof o==="number")r.push(`[${o}]`);else if(typeof o==="symbol")r.push(`[${JSON.stringify(String(o))}]`);else if(/[^\w$]/.test(o))r.push(`[${JSON.stringify(o)}]`);else{if(r.length)r.push(".");r.push(o)}return r.join("")}function Vo(e){let r=[],n=[...e.issues].sort((o,t)=>(o.path??[]).length-(t.path??[]).length);for(let o of n)if(r.push(`✖ ${o.message}`),o.path?.length)r.push(` → at ${md(o.path)}`);return r.join(`
|
|
114
|
+
`)}var ct=(e)=>(r,n,o,t)=>{let i=o?Object.assign(o,{async:!1}):{async:!1},a=r._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Ie;if(a.issues.length){let s=new(t?.Err??e)(a.issues.map((c)=>ge(c,i,q())));throw Fr(s,t?.callee),s}return a.value},Gr=ct(ce),lt=(e)=>async(r,n,o,t)=>{let i=o?Object.assign(o,{async:!0}):{async:!0},a=r._zod.run({value:n,issues:[]},i);if(a instanceof Promise)a=await a;if(a.issues.length){let s=new(t?.Err??e)(a.issues.map((c)=>ge(c,i,q())));throw Fr(s,t?.callee),s}return a.value},Vr=lt(ce),ut=(e)=>(r,n,o)=>{let t=o?{...o,async:!1}:{async:!1},i=r._zod.run({value:n,issues:[]},t);if(i instanceof Promise)throw new Ie;return i.issues.length?{success:!1,error:new(e??Mt)(i.issues.map((a)=>ge(a,t,q())))}:{success:!0,data:i.value}},Wo=ut(ce),dt=(e)=>async(r,n,o)=>{let t=o?Object.assign(o,{async:!0}):{async:!0},i=r._zod.run({value:n,issues:[]},t);if(i instanceof Promise)i=await i;return i.issues.length?{success:!1,error:new e(i.issues.map((a)=>ge(a,t,q())))}:{success:!0,data:i.value}},Bo=dt(ce),Wr=(e)=>(r,n,o)=>{let t=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return ct(e)(r,n,t)},Xg=Wr(ce),Br=(e)=>(r,n,o)=>ct(e)(r,n,o),Yg=Br(ce),Hr=(e)=>async(r,n,o)=>{let t=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return lt(e)(r,n,t)},Qg=Hr(ce),Jr=(e)=>async(r,n,o)=>lt(e)(r,n,o),eh=Jr(ce),qr=(e)=>(r,n,o)=>{let t=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return ut(e)(r,n,t)},th=qr(ce),Kr=(e)=>(r,n,o)=>ut(e)(r,n,o),rh=Kr(ce),Xr=(e)=>async(r,n,o)=>{let t=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return dt(e)(r,n,t)},nh=Xr(ce),Yr=(e)=>async(r,n,o)=>dt(e)(r,n,o),oh=Yr(ce);var ve={};me(ve,{base64:()=>si,base64url:()=>Qr,bigint:()=>fi,boolean:()=>vi,browserEmail:()=>mh,cidrv4:()=>ii,cidrv6:()=>ai,cuid:()=>Ho,cuid2:()=>Jo,date:()=>ui,datetime:()=>mi,domain:()=>ph,duration:()=>Qo,e164:()=>li,email:()=>ti,emoji:()=>ri,extendedDuration:()=>ih,guid:()=>ei,hex:()=>fh,hostname:()=>ci,html5Email:()=>lh,idnEmail:()=>dh,integer:()=>gi,ipv4:()=>ni,ipv6:()=>oi,ksuid:()=>Xo,lowercase:()=>_i,md5_base64:()=>hh,md5_base64url:()=>vh,md5_hex:()=>gh,nanoid:()=>Yo,null:()=>yi,number:()=>hi,rfc5322Email:()=>uh,sha1_base64:()=>bh,sha1_base64url:()=>_h,sha1_hex:()=>yh,sha256_base64:()=>$h,sha256_base64url:()=>xh,sha256_hex:()=>kh,sha384_base64:()=>Sh,sha384_base64url:()=>Ih,sha384_hex:()=>wh,sha512_base64:()=>Oh,sha512_base64url:()=>Dh,sha512_hex:()=>Th,string:()=>pi,time:()=>di,ulid:()=>qo,undefined:()=>bi,unicodeEmail:()=>pd,uppercase:()=>ki,uuid:()=>qe,uuid4:()=>ah,uuid6:()=>sh,uuid7:()=>ch,xid:()=>Ko});var Ho=/^[cC][^\s-]{8,}$/,Jo=/^[0-9a-z]+$/,qo=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ko=/^[0-9a-vA-V]{20}$/,Xo=/^[A-Za-z0-9]{27}$/,Yo=/^[a-zA-Z0-9_-]{21}$/,Qo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ih=/^[-+]?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)?)??$/,ei=/^([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})$/,qe=(e)=>{if(!e)return/^([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)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},ah=qe(4),sh=qe(6),ch=qe(7),ti=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,lh=/^[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])?)*$/,uh=/^(([^<>()\[\]\\.,;:\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,}))$/,pd=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,dh=pd,mh=/^[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])?)*$/;function ri(){return new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}var ni=/^(?:(?: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])$/,oi=/^(([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}|:))$/,ii=/^((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])$/,ai=/^(([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])$/,si=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Qr=/^[A-Za-z0-9_-]*$/,ci=/^(?=.{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])?)*\.?$/,ph=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,li=/^\+(?:[0-9]){6,14}[0-9]$/,fd="(?:(?:\\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])))",ui=new RegExp(`^${fd}$`);function gd(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function di(e){return new RegExp(`^${gd(e)}$`)}function mi(e){let r=gd({precision:e.precision}),n=["Z"];if(e.local)n.push("");if(e.offset)n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${r}(?:${n.join("|")})`;return new RegExp(`^${fd}T(?:${o})$`)}var pi=(e)=>{let r=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${r}$`)},fi=/^-?\d+n?$/,gi=/^-?\d+$/,hi=/^-?\d+(?:\.\d+)?/,vi=/^(?:true|false)$/i,yi=/^null$/i;var bi=/^undefined$/i;var _i=/^[^A-Z]*$/,ki=/^[^a-z]*$/,fh=/^[0-9a-fA-F]*$/;function Ut(e,r){return new RegExp(`^[A-Za-z0-9+/]{${e}}${r}$`)}function Lt(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var gh=/^[0-9a-fA-F]{32}$/,hh=Ut(22,"=="),vh=Lt(22),yh=/^[0-9a-fA-F]{40}$/,bh=Ut(27,"="),_h=Lt(27),kh=/^[0-9a-fA-F]{64}$/,$h=Ut(43,"="),xh=Lt(43),wh=/^[0-9a-fA-F]{96}$/,Sh=Ut(64,""),Ih=Lt(64),Th=/^[0-9a-fA-F]{128}$/,Oh=Ut(86,"=="),Dh=Lt(86);var W=m("$ZodCheck",(e,r)=>{var n;e._zod??(e._zod={}),e._zod.def=r,(n=e._zod).onattach??(n.onattach=[])}),vd={number:"number",bigint:"bigint",object:"date"},en=m("$ZodCheckLessThan",(e,r)=>{W.init(e,r);let n=vd[typeof r.value];e._zod.onattach.push((o)=>{let t=o._zod.bag,i=(r.inclusive?t.maximum:t.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(r.value<i)if(r.inclusive)t.maximum=r.value;else t.exclusiveMaximum=r.value}),e._zod.check=(o)=>{if(r.inclusive?o.value<=r.value:o.value<r.value)return;o.issues.push({origin:n,code:"too_big",maximum:r.value,input:o.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),tn=m("$ZodCheckGreaterThan",(e,r)=>{W.init(e,r);let n=vd[typeof r.value];e._zod.onattach.push((o)=>{let t=o._zod.bag,i=(r.inclusive?t.minimum:t.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(r.value>i)if(r.inclusive)t.minimum=r.value;else t.exclusiveMinimum=r.value}),e._zod.check=(o)=>{if(r.inclusive?o.value>=r.value:o.value>r.value)return;o.issues.push({origin:n,code:"too_small",minimum:r.value,input:o.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),$i=m("$ZodCheckMultipleOf",(e,r)=>{W.init(e,r),e._zod.onattach.push((n)=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=r.value)}),e._zod.check=(n)=>{if(typeof n.value!==typeof r.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof n.value==="bigint"?n.value%r.value===BigInt(0):Mo(n.value,r.value)===0)return;n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:r.value,input:n.value,inst:e,continue:!r.abort})}}),xi=m("$ZodCheckNumberFormat",(e,r)=>{W.init(e,r),r.format=r.format||"float64";let n=r.format?.includes("int"),o=n?"int":"number",[t,i]=Zo[r.format];e._zod.onattach.push((a)=>{let s=a._zod.bag;if(s.format=r.format,s.minimum=t,s.maximum=i,n)s.pattern=gi}),e._zod.check=(a)=>{let s=a.value;if(n){if(!Number.isInteger(s)){a.issues.push({expected:o,format:r.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){if(s>0)a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!r.abort});else a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!r.abort});return}}if(s<t)a.issues.push({origin:"number",input:s,code:"too_small",minimum:t,inclusive:!0,inst:e,continue:!r.abort});if(s>i)a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inst:e})}}),wi=m("$ZodCheckBigIntFormat",(e,r)=>{W.init(e,r);let[n,o]=Fo[r.format];e._zod.onattach.push((t)=>{let i=t._zod.bag;i.format=r.format,i.minimum=n,i.maximum=o}),e._zod.check=(t)=>{let i=t.value;if(i<n)t.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!r.abort});if(i>o)t.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inst:e})}}),Si=m("$ZodCheckMaxSize",(e,r)=>{var n;W.init(e,r),(n=e._zod.def).when??(n.when=(o)=>{let t=o.value;return!je(t)&&t.size!==void 0}),e._zod.onattach.push((o)=>{let t=o._zod.bag.maximum??Number.POSITIVE_INFINITY;if(r.maximum<t)o._zod.bag.maximum=r.maximum}),e._zod.check=(o)=>{let t=o.value;if(t.size<=r.maximum)return;o.issues.push({origin:jt(t),code:"too_big",maximum:r.maximum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),Ii=m("$ZodCheckMinSize",(e,r)=>{var n;W.init(e,r),(n=e._zod.def).when??(n.when=(o)=>{let t=o.value;return!je(t)&&t.size!==void 0}),e._zod.onattach.push((o)=>{let t=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(r.minimum>t)o._zod.bag.minimum=r.minimum}),e._zod.check=(o)=>{let t=o.value;if(t.size>=r.minimum)return;o.issues.push({origin:jt(t),code:"too_small",minimum:r.minimum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),Ti=m("$ZodCheckSizeEquals",(e,r)=>{var n;W.init(e,r),(n=e._zod.def).when??(n.when=(o)=>{let t=o.value;return!je(t)&&t.size!==void 0}),e._zod.onattach.push((o)=>{let t=o._zod.bag;t.minimum=r.size,t.maximum=r.size,t.size=r.size}),e._zod.check=(o)=>{let t=o.value,i=t.size;if(i===r.size)return;let a=i>r.size;o.issues.push({origin:jt(t),...a?{code:"too_big",maximum:r.size}:{code:"too_small",minimum:r.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!r.abort})}}),Oi=m("$ZodCheckMaxLength",(e,r)=>{var n;W.init(e,r),(n=e._zod.def).when??(n.when=(o)=>{let t=o.value;return!je(t)&&t.length!==void 0}),e._zod.onattach.push((o)=>{let t=o._zod.bag.maximum??Number.POSITIVE_INFINITY;if(r.maximum<t)o._zod.bag.maximum=r.maximum}),e._zod.check=(o)=>{let t=o.value;if(t.length<=r.maximum)return;let a=At(t);o.issues.push({origin:a,code:"too_big",maximum:r.maximum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),Di=m("$ZodCheckMinLength",(e,r)=>{var n;W.init(e,r),(n=e._zod.def).when??(n.when=(o)=>{let t=o.value;return!je(t)&&t.length!==void 0}),e._zod.onattach.push((o)=>{let t=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(r.minimum>t)o._zod.bag.minimum=r.minimum}),e._zod.check=(o)=>{let t=o.value;if(t.length>=r.minimum)return;let a=At(t);o.issues.push({origin:a,code:"too_small",minimum:r.minimum,inclusive:!0,input:t,inst:e,continue:!r.abort})}}),Pi=m("$ZodCheckLengthEquals",(e,r)=>{var n;W.init(e,r),(n=e._zod.def).when??(n.when=(o)=>{let t=o.value;return!je(t)&&t.length!==void 0}),e._zod.onattach.push((o)=>{let t=o._zod.bag;t.minimum=r.length,t.maximum=r.length,t.length=r.length}),e._zod.check=(o)=>{let t=o.value,i=t.length;if(i===r.length)return;let a=At(t),s=i>r.length;o.issues.push({origin:a,...s?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!r.abort})}}),mt=m("$ZodCheckStringFormat",(e,r)=>{var n,o;if(W.init(e,r),e._zod.onattach.push((t)=>{let i=t._zod.bag;if(i.format=r.format,r.pattern)i.patterns??(i.patterns=new Set),i.patterns.add(r.pattern)}),r.pattern)(n=e._zod).check??(n.check=(t)=>{if(r.pattern.lastIndex=0,r.pattern.test(t.value))return;t.issues.push({origin:"string",code:"invalid_format",format:r.format,input:t.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:e,continue:!r.abort})});else(o=e._zod).check??(o.check=()=>{})}),zi=m("$ZodCheckRegex",(e,r)=>{mt.init(e,r),e._zod.check=(n)=>{if(r.pattern.lastIndex=0,r.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:r.pattern.toString(),inst:e,continue:!r.abort})}}),Ci=m("$ZodCheckLowerCase",(e,r)=>{r.pattern??(r.pattern=_i),mt.init(e,r)}),Ei=m("$ZodCheckUpperCase",(e,r)=>{r.pattern??(r.pattern=ki),mt.init(e,r)}),ji=m("$ZodCheckIncludes",(e,r)=>{W.init(e,r);let n=Te(r.includes),o=new RegExp(typeof r.position==="number"?`^.{${r.position}}${n}`:n);r.pattern=o,e._zod.onattach.push((t)=>{let i=t._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=(t)=>{if(t.value.includes(r.includes,r.position))return;t.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:t.value,inst:e,continue:!r.abort})}}),Ai=m("$ZodCheckStartsWith",(e,r)=>{W.init(e,r);let n=new RegExp(`^${Te(r.prefix)}.*`);r.pattern??(r.pattern=n),e._zod.onattach.push((o)=>{let t=o._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=(o)=>{if(o.value.startsWith(r.prefix))return;o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:o.value,inst:e,continue:!r.abort})}}),Mi=m("$ZodCheckEndsWith",(e,r)=>{W.init(e,r);let n=new RegExp(`.*${Te(r.suffix)}$`);r.pattern??(r.pattern=n),e._zod.onattach.push((o)=>{let t=o._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=(o)=>{if(o.value.endsWith(r.suffix))return;o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:o.value,inst:e,continue:!r.abort})}});function hd(e,r,n){if(e.issues.length)r.issues.push(...fe(n,e.issues))}var Ri=m("$ZodCheckProperty",(e,r)=>{W.init(e,r),e._zod.check=(n)=>{let o=r.schema._zod.run({value:n.value[r.property],issues:[]},{});if(o instanceof Promise)return o.then((t)=>hd(t,n,r.property));hd(o,n,r.property);return}}),Ni=m("$ZodCheckMimeType",(e,r)=>{W.init(e,r);let n=new Set(r.mime);e._zod.onattach.push((o)=>{o._zod.bag.mime=r.mime}),e._zod.check=(o)=>{if(n.has(o.value.type))return;o.issues.push({code:"invalid_value",values:r.mime,input:o.value.type,inst:e,continue:!r.abort})}}),Ui=m("$ZodCheckOverwrite",(e,r)=>{W.init(e,r),e._zod.check=(n)=>{n.value=r.tx(n.value)}});class rn{constructor(e=[]){if(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 n=e.split(`
|
|
115
|
+
`).filter((i)=>i),o=Math.min(...n.map((i)=>i.length-i.trimStart().length)),t=n.map((i)=>i.slice(o)).map((i)=>" ".repeat(this.indent*2)+i);for(let i of t)this.content.push(i)}compile(){let e=Function,r=this?.args,o=[...(this?.content??[""]).map((t)=>` ${t}`)];return new e(...r,o.join(`
|
|
116
|
+
`))}}var Li={major:4,minor:1,patch:8};var D=m("$ZodType",(e,r)=>{var n;e??(e={}),e._zod.def=r,e._zod.bag=e._zod.bag||{},e._zod.version=Li;let o=[...e._zod.def.checks??[]];if(e._zod.traits.has("$ZodCheck"))o.unshift(e);for(let t of o)for(let i of t._zod.onattach)i(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(a,s,c)=>{let l=Ne(a),d;for(let v of s){if(v._zod.def.when){if(!v._zod.def.when(a))continue}else if(l)continue;let h=a.issues.length,u=v._zod.check(a);if(u instanceof Promise&&c?.async===!1)throw new Ie;if(d||u instanceof Promise)d=(d??Promise.resolve()).then(async()=>{if(await u,a.issues.length===h)return;if(!l)l=Ne(a,h)});else{if(a.issues.length===h)continue;if(!l)l=Ne(a,h)}}if(d)return d.then(()=>a);return a},i=(a,s,c)=>{if(Ne(a))return a.aborted=!0,a;let l=t(s,o,c);if(l instanceof Promise){if(c.async===!1)throw new Ie;return l.then((d)=>e._zod.parse(d,c))}return e._zod.parse(l,c)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});if(l instanceof Promise)return l.then((d)=>i(d,a,s));return i(l,a,s)}let c=e._zod.parse(a,s);if(c instanceof Promise){if(s.async===!1)throw new Ie;return c.then((l)=>t(l,o,s))}return t(c,o,s)}}e["~standard"]={validate:(t)=>{try{let i=Wo(e,t);return i.success?{value:i.data}:{issues:i.error?.issues}}catch(i){return Bo(e,t).then((a)=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),Ke=m("$ZodString",(e,r)=>{D.init(e,r),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??pi(e._zod.bag),e._zod.parse=(n,o)=>{if(r.coerce)try{n.value=String(n.value)}catch(t){}if(typeof n.value==="string")return n;return n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),F=m("$ZodStringFormat",(e,r)=>{mt.init(e,r),Ke.init(e,r)}),Fi=m("$ZodGUID",(e,r)=>{r.pattern??(r.pattern=ei),F.init(e,r)}),Gi=m("$ZodUUID",(e,r)=>{if(r.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[r.version];if(o===void 0)throw Error(`Invalid UUID version: "${r.version}"`);r.pattern??(r.pattern=qe(o))}else r.pattern??(r.pattern=qe());F.init(e,r)}),Vi=m("$ZodEmail",(e,r)=>{r.pattern??(r.pattern=ti),F.init(e,r)}),Wi=m("$ZodURL",(e,r)=>{F.init(e,r),e._zod.check=(n)=>{try{let o=n.value.trim(),t=new URL(o);if(r.hostname){if(r.hostname.lastIndex=0,!r.hostname.test(t.hostname))n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:ci.source,input:n.value,inst:e,continue:!r.abort})}if(r.protocol){if(r.protocol.lastIndex=0,!r.protocol.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol))n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:r.protocol.source,input:n.value,inst:e,continue:!r.abort})}if(r.normalize)n.value=t.href;else n.value=o;return}catch(o){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!r.abort})}}}),Bi=m("$ZodEmoji",(e,r)=>{r.pattern??(r.pattern=ri()),F.init(e,r)}),Hi=m("$ZodNanoID",(e,r)=>{r.pattern??(r.pattern=Yo),F.init(e,r)}),Ji=m("$ZodCUID",(e,r)=>{r.pattern??(r.pattern=Ho),F.init(e,r)}),qi=m("$ZodCUID2",(e,r)=>{r.pattern??(r.pattern=Jo),F.init(e,r)}),Ki=m("$ZodULID",(e,r)=>{r.pattern??(r.pattern=qo),F.init(e,r)}),Xi=m("$ZodXID",(e,r)=>{r.pattern??(r.pattern=Ko),F.init(e,r)}),Yi=m("$ZodKSUID",(e,r)=>{r.pattern??(r.pattern=Xo),F.init(e,r)}),Qi=m("$ZodISODateTime",(e,r)=>{r.pattern??(r.pattern=mi(r)),F.init(e,r)}),ea=m("$ZodISODate",(e,r)=>{r.pattern??(r.pattern=ui),F.init(e,r)}),ta=m("$ZodISOTime",(e,r)=>{r.pattern??(r.pattern=di(r)),F.init(e,r)}),ra=m("$ZodISODuration",(e,r)=>{r.pattern??(r.pattern=Qo),F.init(e,r)}),na=m("$ZodIPv4",(e,r)=>{r.pattern??(r.pattern=ni),F.init(e,r),e._zod.onattach.push((n)=>{let o=n._zod.bag;o.format="ipv4"})}),oa=m("$ZodIPv6",(e,r)=>{r.pattern??(r.pattern=oi),F.init(e,r),e._zod.onattach.push((n)=>{let o=n._zod.bag;o.format="ipv6"}),e._zod.check=(n)=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!r.abort})}}}),ia=m("$ZodCIDRv4",(e,r)=>{r.pattern??(r.pattern=ii),F.init(e,r)}),aa=m("$ZodCIDRv6",(e,r)=>{r.pattern??(r.pattern=ai),F.init(e,r),e._zod.check=(n)=>{let o=n.value.split("/");try{if(o.length!==2)throw Error();let[t,i]=o;if(!i)throw Error();let a=Number(i);if(`${a}`!==i)throw Error();if(a<0||a>128)throw Error();new URL(`http://[${t}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!r.abort})}}});function sa(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var ca=m("$ZodBase64",(e,r)=>{r.pattern??(r.pattern=si),F.init(e,r),e._zod.onattach.push((n)=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=(n)=>{if(sa(n.value))return;n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!r.abort})}});function Dd(e){if(!Qr.test(e))return!1;let r=e.replace(/[-_]/g,(o)=>o==="-"?"+":"/"),n=r.padEnd(Math.ceil(r.length/4)*4,"=");return sa(n)}var la=m("$ZodBase64URL",(e,r)=>{r.pattern??(r.pattern=Qr),F.init(e,r),e._zod.onattach.push((n)=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=(n)=>{if(Dd(n.value))return;n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!r.abort})}}),ua=m("$ZodE164",(e,r)=>{r.pattern??(r.pattern=li),F.init(e,r)});function Pd(e,r=null){try{let n=e.split(".");if(n.length!==3)return!1;let[o]=n;if(!o)return!1;let t=JSON.parse(atob(o));if("typ"in t&&t?.typ!=="JWT")return!1;if(!t.alg)return!1;if(r&&(!("alg"in t)||t.alg!==r))return!1;return!0}catch{return!1}}var da=m("$ZodJWT",(e,r)=>{F.init(e,r),e._zod.check=(n)=>{if(Pd(n.value,r.alg))return;n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!r.abort})}}),ma=m("$ZodCustomStringFormat",(e,r)=>{F.init(e,r),e._zod.check=(n)=>{if(r.fn(n.value))return;n.issues.push({code:"invalid_format",format:r.format,input:n.value,inst:e,continue:!r.abort})}}),ln=m("$ZodNumber",(e,r)=>{D.init(e,r),e._zod.pattern=e._zod.bag.pattern??hi,e._zod.parse=(n,o)=>{if(r.coerce)try{n.value=Number(n.value)}catch(a){}let t=n.value;if(typeof t==="number"&&!Number.isNaN(t)&&Number.isFinite(t))return n;let i=typeof t==="number"?Number.isNaN(t)?"NaN":!Number.isFinite(t)?"Infinity":void 0:void 0;return n.issues.push({expected:"number",code:"invalid_type",input:t,inst:e,...i?{received:i}:{}}),n}}),pa=m("$ZodNumber",(e,r)=>{xi.init(e,r),ln.init(e,r)}),Zt=m("$ZodBoolean",(e,r)=>{D.init(e,r),e._zod.pattern=vi,e._zod.parse=(n,o)=>{if(r.coerce)try{n.value=Boolean(n.value)}catch(i){}let t=n.value;if(typeof t==="boolean")return n;return n.issues.push({expected:"boolean",code:"invalid_type",input:t,inst:e}),n}}),un=m("$ZodBigInt",(e,r)=>{D.init(e,r),e._zod.pattern=fi,e._zod.parse=(n,o)=>{if(r.coerce)try{n.value=BigInt(n.value)}catch(t){}if(typeof n.value==="bigint")return n;return n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),fa=m("$ZodBigInt",(e,r)=>{wi.init(e,r),un.init(e,r)}),ga=m("$ZodSymbol",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>{let t=n.value;if(typeof t==="symbol")return n;return n.issues.push({expected:"symbol",code:"invalid_type",input:t,inst:e}),n}}),ha=m("$ZodUndefined",(e,r)=>{D.init(e,r),e._zod.pattern=bi,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,o)=>{let t=n.value;if(typeof t>"u")return n;return n.issues.push({expected:"undefined",code:"invalid_type",input:t,inst:e}),n}}),va=m("$ZodNull",(e,r)=>{D.init(e,r),e._zod.pattern=yi,e._zod.values=new Set([null]),e._zod.parse=(n,o)=>{let t=n.value;if(t===null)return n;return n.issues.push({expected:"null",code:"invalid_type",input:t,inst:e}),n}}),ya=m("$ZodAny",(e,r)=>{D.init(e,r),e._zod.parse=(n)=>n}),ba=m("$ZodUnknown",(e,r)=>{D.init(e,r),e._zod.parse=(n)=>n}),_a=m("$ZodNever",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),ka=m("$ZodVoid",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>{let t=n.value;if(typeof t>"u")return n;return n.issues.push({expected:"void",code:"invalid_type",input:t,inst:e}),n}}),$a=m("$ZodDate",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>{if(r.coerce)try{n.value=new Date(n.value)}catch(s){}let t=n.value,i=t instanceof Date;if(i&&!Number.isNaN(t.getTime()))return n;return n.issues.push({expected:"date",code:"invalid_type",input:t,...i?{received:"Invalid Date"}:{},inst:e}),n}});function bd(e,r,n){if(e.issues.length)r.issues.push(...fe(n,e.issues));r.value[n]=e.value}var xa=m("$ZodArray",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>{let t=n.value;if(!Array.isArray(t))return n.issues.push({expected:"array",code:"invalid_type",input:t,inst:e}),n;n.value=Array(t.length);let i=[];for(let a=0;a<t.length;a++){let s=t[a],c=r.element._zod.run({value:s,issues:[]},o);if(c instanceof Promise)i.push(c.then((l)=>bd(l,n,a)));else bd(c,n,a)}if(i.length)return Promise.all(i).then(()=>n);return n}});function cn(e,r,n,o){if(e.issues.length)r.issues.push(...fe(n,e.issues));if(e.value===void 0){if(n in o)r.value[n]=void 0}else r.value[n]=e.value}function zd(e){let r=Object.keys(e.shape);for(let o of r)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${o}": expected a Zod schema`);let n=Lo(e.shape);return{...e,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(n)}}function Cd(e,r,n,o,t,i){let a=[],s=t.keySet,c=t.catchall._zod,l=c.def.type;for(let d of Object.keys(r)){if(s.has(d))continue;if(l==="never"){a.push(d);continue}let v=c.run({value:r[d],issues:[]},o);if(v instanceof Promise)e.push(v.then((h)=>cn(h,n,d,r)));else cn(v,n,d,r)}if(a.length)n.issues.push({code:"unrecognized_keys",keys:a,input:r,inst:i});if(!e.length)return n;return Promise.all(e).then(()=>n)}var Ed=m("$ZodObject",(e,r)=>{D.init(e,r);let n=at(()=>zd(r));E(e._zod,"propValues",()=>{let a=r.shape,s={};for(let c in a){let l=a[c]._zod;if(l.values){s[c]??(s[c]=new Set);for(let d of l.values)s[c].add(d)}}return s});let o=Je,t=r.catchall,i;e._zod.parse=(a,s)=>{i??(i=n.value);let c=a.value;if(!o(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),a;a.value={};let l=[],d=i.shape;for(let v of i.keys){let u=d[v]._zod.run({value:c[v],issues:[]},s);if(u instanceof Promise)l.push(u.then((y)=>cn(y,a,v,c)));else cn(u,a,v,c)}if(!t)return l.length?Promise.all(l).then(()=>a):a;return Cd(l,c,a,s,n.value,e)}}),wa=m("$ZodObjectJIT",(e,r)=>{Ed.init(e,r);let n=e._zod.parse,o=at(()=>zd(r)),t=(h)=>{let u=new rn(["shape","payload","ctx"]),y=o.value,x=(N)=>{let X=Zr(N);return`shape[${X}]._zod.run({ value: input[${X}], issues: [] }, ctx)`};u.write("const input = payload.value;");let j=Object.create(null),A=0;for(let N of y.keys)j[N]=`key_${A++}`;u.write("const newResult = {};");for(let N of y.keys){let X=j[N],he=Zr(N);u.write(`const ${X} = ${x(N)};`),u.write(`
|
|
117
|
+
if (${X}.issues.length) {
|
|
118
|
+
payload.issues = payload.issues.concat(${X}.issues.map(iss => ({
|
|
119
119
|
...iss,
|
|
120
|
-
path: iss.path ? [${
|
|
120
|
+
path: iss.path ? [${he}, ...iss.path] : [${he}]
|
|
121
121
|
})));
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
|
|
125
|
-
if (${
|
|
126
|
-
if (${
|
|
127
|
-
newResult[${
|
|
125
|
+
if (${X}.value === undefined) {
|
|
126
|
+
if (${he} in input) {
|
|
127
|
+
newResult[${he}] = undefined;
|
|
128
128
|
}
|
|
129
129
|
} else {
|
|
130
|
-
newResult[${
|
|
130
|
+
newResult[${he}] = ${X}.value;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
`)}w.write("payload.value = newResult;"),w.write("return payload;");let u=w.compile();return(m,d)=>u(X,m,d)},z,_=f$,N=!Lv.jitless,I=N&&HU.value,k=U.catchall,W;$._zod.parse=(X,w)=>{W??(W=b.value);let j=X.value;if(!_(j))return X.issues.push({expected:"object",code:"invalid_type",input:j,inst:$}),X;if(N&&I&&w?.async===!1&&w.jitless!==!0){if(!z)z=v(U.shape);if(X=z(X,w),!k)return X;return VO([],j,X,w,W,$)}return r(X,w)}});function OO($,U,r,b){for(let z of $)if(z.issues.length===0)return U.value=z.value,U;let v=$.filter((z)=>!T$(z));if(v.length===1)return U.value=v[0].value,v[0];return U.issues.push({code:"invalid_union",input:U.value,inst:r,errors:$.map((z)=>z.issues.map((_)=>K$(_,b,l())))}),U}var v6=J("$ZodUnion",($,U)=>{A.init($,U),Z($._zod,"optin",()=>U.options.some((v)=>v._zod.optin==="optional")?"optional":void 0),Z($._zod,"optout",()=>U.options.some((v)=>v._zod.optout==="optional")?"optional":void 0),Z($._zod,"values",()=>{if(U.options.every((v)=>v._zod.values))return new Set(U.options.flatMap((v)=>Array.from(v._zod.values)));return}),Z($._zod,"pattern",()=>{if(U.options.every((v)=>v._zod.pattern)){let v=U.options.map((z)=>z._zod.pattern);return new RegExp(`^(${v.map((z)=>Av(z.source)).join("|")})$`)}return});let r=U.options.length===1,b=U.options[0]._zod.run;$._zod.parse=(v,z)=>{if(r)return b(v,z);let _=!1,N=[];for(let O of U.options){let I=O._zod.run({value:v.value,issues:[]},z);if(I instanceof Promise)N.push(I),_=!0;else{if(I.issues.length===0)return I;N.push(I)}}if(!_)return OO(N,v,$,z);return Promise.all(N).then((O)=>{return OO(O,v,$,z)})}}),wb=J("$ZodDiscriminatedUnion",($,U)=>{v6.init($,U);let r=$._zod.parse;Z($._zod,"propValues",()=>{let v={};for(let z of U.options){let _=z._zod.propValues;if(!_||Object.keys(_).length===0)throw Error(`Invalid discriminated union option at index "${U.options.indexOf(z)}"`);for(let[N,O]of Object.entries(_)){if(!v[N])v[N]=new Set;for(let I of O)v[N].add(I)}}return v});let b=rv(()=>{let v=U.options,z=new Map;for(let _ of v){let N=_._zod.propValues?.[U.discriminator];if(!N||N.size===0)throw Error(`Invalid discriminated union option at index "${U.options.indexOf(_)}"`);for(let O of N){if(z.has(O))throw Error(`Duplicate discriminator value "${String(O)}"`);z.set(O,_)}}return z});$._zod.parse=(v,z)=>{let _=v.value;if(!f$(_))return v.issues.push({code:"invalid_type",expected:"object",input:_,inst:$}),v;let N=b.value.get(_?.[U.discriminator]);if(N)return N._zod.run(v,z);if(U.unionFallback)return r(v,z);return v.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:U.discriminator,input:_,path:[U.discriminator],inst:$}),v}}),Kb=J("$ZodIntersection",($,U)=>{A.init($,U),$._zod.parse=(r,b)=>{let v=r.value,z=U.left._zod.run({value:v,issues:[]},b),_=U.right._zod.run({value:v,issues:[]},b);if(z instanceof Promise||_ instanceof Promise)return Promise.all([z,_]).then(([O,I])=>{return IO(r,O,I)});return IO(r,z,_)}});function Sr($,U){if($===U)return{valid:!0,data:$};if($ instanceof Date&&U instanceof Date&&+$===+U)return{valid:!0,data:$};if(m$($)&&m$(U)){let r=Object.keys(U),b=Object.keys($).filter((z)=>r.indexOf(z)!==-1),v={...$,...U};for(let z of b){let _=Sr($[z],U[z]);if(!_.valid)return{valid:!1,mergeErrorPath:[z,..._.mergeErrorPath]};v[z]=_.data}return{valid:!0,data:v}}if(Array.isArray($)&&Array.isArray(U)){if($.length!==U.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let b=0;b<$.length;b++){let v=$[b],z=U[b],_=Sr(v,z);if(!_.valid)return{valid:!1,mergeErrorPath:[b,..._.mergeErrorPath]};r.push(_.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function IO($,U,r){if(U.issues.length)$.issues.push(...U.issues);if(r.issues.length)$.issues.push(...r.issues);if(T$($))return $;let b=Sr(U.value,r.value);if(!b.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(b.mergeErrorPath)}`);return $.value=b.data,$}var U6=J("$ZodTuple",($,U)=>{A.init($,U);let r=U.items,b=r.length-[...r].reverse().findIndex((v)=>v._zod.optin!=="optional");$._zod.parse=(v,z)=>{let _=v.value;if(!Array.isArray(_))return v.issues.push({input:_,inst:$,expected:"tuple",code:"invalid_type"}),v;v.value=[];let N=[];if(!U.rest){let I=_.length>r.length,k=_.length<b-1;if(I||k)return v.issues.push({...I?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},input:_,inst:$,origin:"array"}),v}let O=-1;for(let I of r){if(O++,O>=_.length){if(O>=b)continue}let k=I._zod.run({value:_[O],issues:[]},z);if(k instanceof Promise)N.push(k.then((W)=>d4(W,v,O)));else d4(k,v,O)}if(U.rest){let I=_.slice(r.length);for(let k of I){O++;let W=U.rest._zod.run({value:k,issues:[]},z);if(W instanceof Promise)N.push(W.then((X)=>d4(X,v,O)));else d4(W,v,O)}}if(N.length)return Promise.all(N).then(()=>v);return v}});function d4($,U,r){if($.issues.length)U.issues.push(...w$(r,$.issues));U.value[r]=$.value}var Xb=J("$ZodRecord",($,U)=>{A.init($,U),$._zod.parse=(r,b)=>{let v=r.value;if(!m$(v))return r.issues.push({expected:"record",code:"invalid_type",input:v,inst:$}),r;let z=[];if(U.keyType._zod.values){let _=U.keyType._zod.values;r.value={};for(let O of _)if(typeof O==="string"||typeof O==="number"||typeof O==="symbol"){let I=U.valueType._zod.run({value:v[O],issues:[]},b);if(I instanceof Promise)z.push(I.then((k)=>{if(k.issues.length)r.issues.push(...w$(O,k.issues));r.value[O]=k.value}));else{if(I.issues.length)r.issues.push(...w$(O,I.issues));r.value[O]=I.value}}let N;for(let O in v)if(!_.has(O))N=N??[],N.push(O);if(N&&N.length>0)r.issues.push({code:"unrecognized_keys",input:v,inst:$,keys:N})}else{r.value={};for(let _ of Reflect.ownKeys(v)){if(_==="__proto__")continue;let N=U.keyType._zod.run({value:_,issues:[]},b);if(N instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(N.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:N.issues.map((I)=>K$(I,b,l())),input:_,path:[_],inst:$}),r.value[N.value]=N.value;continue}let O=U.valueType._zod.run({value:v[_],issues:[]},b);if(O instanceof Promise)z.push(O.then((I)=>{if(I.issues.length)r.issues.push(...w$(_,I.issues));r.value[N.value]=I.value}));else{if(O.issues.length)r.issues.push(...w$(_,O.issues));r.value[N.value]=O.value}}}if(z.length)return Promise.all(z).then(()=>r);return r}}),Wb=J("$ZodMap",($,U)=>{A.init($,U),$._zod.parse=(r,b)=>{let v=r.value;if(!(v instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:v,inst:$}),r;let z=[];r.value=new Map;for(let[_,N]of v){let O=U.keyType._zod.run({value:_,issues:[]},b),I=U.valueType._zod.run({value:N,issues:[]},b);if(O instanceof Promise||I instanceof Promise)z.push(Promise.all([O,I]).then(([k,W])=>{kO(k,W,r,_,v,$,b)}));else kO(O,I,r,_,v,$,b)}if(z.length)return Promise.all(z).then(()=>r);return r}});function kO($,U,r,b,v,z,_){if($.issues.length)if(Gv.has(typeof b))r.issues.push(...w$(b,$.issues));else r.issues.push({code:"invalid_key",origin:"map",input:v,inst:z,issues:$.issues.map((N)=>K$(N,_,l()))});if(U.issues.length)if(Gv.has(typeof b))r.issues.push(...w$(b,U.issues));else r.issues.push({origin:"map",code:"invalid_element",input:v,inst:z,key:b,issues:U.issues.map((N)=>K$(N,_,l()))});r.value.set($.value,U.value)}var Qb=J("$ZodSet",($,U)=>{A.init($,U),$._zod.parse=(r,b)=>{let v=r.value;if(!(v instanceof Set))return r.issues.push({input:v,inst:$,expected:"set",code:"invalid_type"}),r;let z=[];r.value=new Set;for(let _ of v){let N=U.valueType._zod.run({value:_,issues:[]},b);if(N instanceof Promise)z.push(N.then((O)=>JO(O,r)));else JO(N,r)}if(z.length)return Promise.all(z).then(()=>r);return r}});function JO($,U){if($.issues.length)U.issues.push(...$.issues);U.value.add($.value)}var Yb=J("$ZodEnum",($,U)=>{A.init($,U);let r=Ev(U.entries),b=new Set(r);$._zod.values=b,$._zod.pattern=new RegExp(`^(${r.filter((v)=>Gv.has(typeof v)).map((v)=>typeof v==="string"?E$(v):v.toString()).join("|")})$`),$._zod.parse=(v,z)=>{let _=v.value;if(b.has(_))return v;return v.issues.push({code:"invalid_value",values:r,input:_,inst:$}),v}}),jb=J("$ZodLiteral",($,U)=>{if(A.init($,U),U.values.length===0)throw Error("Cannot create literal schema with no valid values");$._zod.values=new Set(U.values),$._zod.pattern=new RegExp(`^(${U.values.map((r)=>typeof r==="string"?E$(r):r?E$(r.toString()):String(r)).join("|")})$`),$._zod.parse=(r,b)=>{let v=r.value;if($._zod.values.has(v))return r;return r.issues.push({code:"invalid_value",values:U.values,input:v,inst:$}),r}}),Pb=J("$ZodFile",($,U)=>{A.init($,U),$._zod.parse=(r,b)=>{let v=r.value;if(v instanceof File)return r;return r.issues.push({expected:"file",code:"invalid_type",input:v,inst:$}),r}}),Vb=J("$ZodTransform",($,U)=>{A.init($,U),$._zod.parse=(r,b)=>{if(b.direction==="backward")throw new y$($.constructor.name);let v=U.transform(r.value,r);if(b.async)return(v instanceof Promise?v:Promise.resolve(v)).then((_)=>{return r.value=_,r});if(v instanceof Promise)throw new H$;return r.value=v,r}});function wO($,U){if($.issues.length&&U===void 0)return{issues:[],value:void 0};return $}var qb=J("$ZodOptional",($,U)=>{A.init($,U),$._zod.optin="optional",$._zod.optout="optional",Z($._zod,"values",()=>{return U.innerType._zod.values?new Set([...U.innerType._zod.values,void 0]):void 0}),Z($._zod,"pattern",()=>{let r=U.innerType._zod.pattern;return r?new RegExp(`^(${Av(r.source)})?$`):void 0}),$._zod.parse=(r,b)=>{if(U.innerType._zod.optin==="optional"){let v=U.innerType._zod.run(r,b);if(v instanceof Promise)return v.then((z)=>wO(z,r.value));return wO(v,r.value)}if(r.value===void 0)return r;return U.innerType._zod.run(r,b)}}),Bb=J("$ZodNullable",($,U)=>{A.init($,U),Z($._zod,"optin",()=>U.innerType._zod.optin),Z($._zod,"optout",()=>U.innerType._zod.optout),Z($._zod,"pattern",()=>{let r=U.innerType._zod.pattern;return r?new RegExp(`^(${Av(r.source)}|null)$`):void 0}),Z($._zod,"values",()=>{return U.innerType._zod.values?new Set([...U.innerType._zod.values,null]):void 0}),$._zod.parse=(r,b)=>{if(r.value===null)return r;return U.innerType._zod.run(r,b)}}),Lb=J("$ZodDefault",($,U)=>{A.init($,U),$._zod.optin="optional",Z($._zod,"values",()=>U.innerType._zod.values),$._zod.parse=(r,b)=>{if(b.direction==="backward")return U.innerType._zod.run(r,b);if(r.value===void 0)return r.value=U.defaultValue,r;let v=U.innerType._zod.run(r,b);if(v instanceof Promise)return v.then((z)=>KO(z,U));return KO(v,U)}});function KO($,U){if($.value===void 0)$.value=U.defaultValue;return $}var Hb=J("$ZodPrefault",($,U)=>{A.init($,U),$._zod.optin="optional",Z($._zod,"values",()=>U.innerType._zod.values),$._zod.parse=(r,b)=>{if(b.direction==="backward")return U.innerType._zod.run(r,b);if(r.value===void 0)r.value=U.defaultValue;return U.innerType._zod.run(r,b)}}),Eb=J("$ZodNonOptional",($,U)=>{A.init($,U),Z($._zod,"values",()=>{let r=U.innerType._zod.values;return r?new Set([...r].filter((b)=>b!==void 0)):void 0}),$._zod.parse=(r,b)=>{let v=U.innerType._zod.run(r,b);if(v instanceof Promise)return v.then((z)=>XO(z,$));return XO(v,$)}});function XO($,U){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:U});return $}var Ab=J("$ZodSuccess",($,U)=>{A.init($,U),$._zod.parse=(r,b)=>{if(b.direction==="backward")throw new y$("ZodSuccess");let v=U.innerType._zod.run(r,b);if(v instanceof Promise)return v.then((z)=>{return r.value=z.issues.length===0,r});return r.value=v.issues.length===0,r}}),Gb=J("$ZodCatch",($,U)=>{A.init($,U),Z($._zod,"optin",()=>U.innerType._zod.optin),Z($._zod,"optout",()=>U.innerType._zod.optout),Z($._zod,"values",()=>U.innerType._zod.values),$._zod.parse=(r,b)=>{if(b.direction==="backward")return U.innerType._zod.run(r,b);let v=U.innerType._zod.run(r,b);if(v instanceof Promise)return v.then((z)=>{if(r.value=z.value,z.issues.length)r.value=U.catchValue({...r,error:{issues:z.issues.map((_)=>K$(_,b,l()))},input:r.value}),r.issues=[];return r});if(r.value=v.value,v.issues.length)r.value=U.catchValue({...r,error:{issues:v.issues.map((z)=>K$(z,b,l()))},input:r.value}),r.issues=[];return r}}),Sb=J("$ZodNaN",($,U)=>{A.init($,U),$._zod.parse=(r,b)=>{if(typeof r.value!=="number"||!Number.isNaN(r.value))return r.issues.push({input:r.value,inst:$,expected:"nan",code:"invalid_type"}),r;return r}}),Fb=J("$ZodPipe",($,U)=>{A.init($,U),Z($._zod,"values",()=>U.in._zod.values),Z($._zod,"optin",()=>U.in._zod.optin),Z($._zod,"optout",()=>U.out._zod.optout),Z($._zod,"propValues",()=>U.in._zod.propValues),$._zod.parse=(r,b)=>{if(b.direction==="backward"){let z=U.out._zod.run(r,b);if(z instanceof Promise)return z.then((_)=>p4(_,U.in,b));return p4(z,U.in,b)}let v=U.in._zod.run(r,b);if(v instanceof Promise)return v.then((z)=>p4(z,U.out,b));return p4(v,U.out,b)}});function p4($,U,r){if($.issues.length)return $.aborted=!0,$;return U._zod.run({value:$.value,issues:$.issues},r)}var mv=J("$ZodCodec",($,U)=>{A.init($,U),Z($._zod,"values",()=>U.in._zod.values),Z($._zod,"optin",()=>U.in._zod.optin),Z($._zod,"optout",()=>U.out._zod.optout),Z($._zod,"propValues",()=>U.in._zod.propValues),$._zod.parse=(r,b)=>{if((b.direction||"forward")==="forward"){let z=U.in._zod.run(r,b);if(z instanceof Promise)return z.then((_)=>t4(_,U,b));return t4(z,U,b)}else{let z=U.out._zod.run(r,b);if(z instanceof Promise)return z.then((_)=>t4(_,U,b));return t4(z,U,b)}}});function t4($,U,r){if($.issues.length)return $.aborted=!0,$;if((r.direction||"forward")==="forward"){let v=U.transform($.value,$);if(v instanceof Promise)return v.then((z)=>e4($,z,U.out,r));return e4($,v,U.out,r)}else{let v=U.reverseTransform($.value,$);if(v instanceof Promise)return v.then((z)=>e4($,z,U.in,r));return e4($,v,U.in,r)}}function e4($,U,r,b){if($.issues.length)return $.aborted=!0,$;return r._zod.run({value:U,issues:$.issues},b)}var Mb=J("$ZodReadonly",($,U)=>{A.init($,U),Z($._zod,"propValues",()=>U.innerType._zod.propValues),Z($._zod,"values",()=>U.innerType._zod.values),Z($._zod,"optin",()=>U.innerType._zod.optin),Z($._zod,"optout",()=>U.innerType._zod.optout),$._zod.parse=(r,b)=>{if(b.direction==="backward")return U.innerType._zod.run(r,b);let v=U.innerType._zod.run(r,b);if(v instanceof Promise)return v.then(WO);return WO(v)}});function WO($){return $.value=Object.freeze($.value),$}var Zb=J("$ZodTemplateLiteral",($,U)=>{A.init($,U);let r=[];for(let b of U.parts)if(typeof b==="object"&&b!==null){if(!b._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...b._zod.traits].shift()}`);let v=b._zod.pattern instanceof RegExp?b._zod.pattern.source:b._zod.pattern;if(!v)throw Error(`Invalid template literal part: ${b._zod.traits}`);let z=v.startsWith("^")?1:0,_=v.endsWith("$")?v.length-1:v.length;r.push(v.slice(z,_))}else if(b===null||AU.has(typeof b))r.push(E$(`${b}`));else throw Error(`Invalid template literal part: ${b}`);$._zod.pattern=new RegExp(`^${r.join("")}$`),$._zod.parse=(b,v)=>{if(typeof b.value!=="string")return b.issues.push({input:b.value,inst:$,expected:"template_literal",code:"invalid_type"}),b;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(b.value))return b.issues.push({input:b.value,inst:$,code:"invalid_format",format:U.format??"template_literal",pattern:$._zod.pattern.source}),b;return b}}),Db=J("$ZodFunction",($,U)=>{return A.init($,U),$._def=U,$._zod.def=U,$.implement=(r)=>{if(typeof r!=="function")throw Error("implement() must be called with a function");return function(...b){let v=$._def.input?g4($._def.input,b):b,z=Reflect.apply(r,this,v);if($._def.output)return g4($._def.output,z);return z}},$.implementAsync=(r)=>{if(typeof r!=="function")throw Error("implementAsync() must be called with a function");return async function(...b){let v=$._def.input?await R4($._def.input,b):b,z=await Reflect.apply(r,this,v);if($._def.output)return await R4($._def.output,z);return z}},$._zod.parse=(r,b)=>{if(typeof r.value!=="function")return r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:$}),r;if($._def.output&&$._def.output._zod.def.type==="promise")r.value=$.implementAsync(r.value);else r.value=$.implement(r.value);return r},$.input=(...r)=>{let b=$.constructor;if(Array.isArray(r[0]))return new b({type:"function",input:new U6({type:"tuple",items:r[0],rest:r[1]}),output:$._def.output});return new b({type:"function",input:r[0],output:$._def.output})},$.output=(r)=>{return new $.constructor({type:"function",input:$._def.input,output:r})},$}),xb=J("$ZodPromise",($,U)=>{A.init($,U),$._zod.parse=(r,b)=>{return Promise.resolve(r.value).then((v)=>U.innerType._zod.run({value:v,issues:[]},b))}}),gb=J("$ZodLazy",($,U)=>{A.init($,U),Z($._zod,"innerType",()=>U.getter()),Z($._zod,"pattern",()=>$._zod.innerType._zod.pattern),Z($._zod,"propValues",()=>$._zod.innerType._zod.propValues),Z($._zod,"optin",()=>$._zod.innerType._zod.optin??void 0),Z($._zod,"optout",()=>$._zod.innerType._zod.optout??void 0),$._zod.parse=(r,b)=>{return $._zod.innerType._zod.run(r,b)}}),Rb=J("$ZodCustom",($,U)=>{y.init($,U),A.init($,U),$._zod.parse=(r,b)=>{return r},$._zod.check=(r)=>{let b=r.value,v=U.fn(b);if(v instanceof Promise)return v.then((z)=>QO(z,r,b,$));QO(v,r,b,$);return}});function QO($,U,r,b){if(!$){let v={code:"custom",input:r,inst:b,path:[...b._zod.def.path??[]],continue:!b._zod.def.abort};if(b._zod.def.params)v.params=b._zod.def.params;U.issues.push(bv(v))}}var nv={};k$(nv,{zhTW:()=>L1,zhCN:()=>B1,yo:()=>H1,vi:()=>q1,ur:()=>V1,uk:()=>hv,ua:()=>P1,tr:()=>j1,th:()=>Y1,ta:()=>Q1,sv:()=>W1,sl:()=>X1,ru:()=>K1,pt:()=>w1,ps:()=>k1,pl:()=>J1,ota:()=>I1,no:()=>O1,nl:()=>N1,ms:()=>_1,mk:()=>z1,lt:()=>b1,ko:()=>r1,km:()=>Cv,kh:()=>U1,ka:()=>v1,ja:()=>$1,it:()=>sb,is:()=>ab,id:()=>eb,hu:()=>tb,he:()=>pb,frCA:()=>db,fr:()=>ob,fi:()=>lb,fa:()=>ib,es:()=>fb,eo:()=>yb,en:()=>Tv,de:()=>nb,da:()=>hb,cs:()=>ub,ca:()=>cb,be:()=>Cb,az:()=>Tb,ar:()=>mb});var Q0=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"number";case"object":{if(Array.isArray(v))return"array";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return(v)=>{switch(v.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${v.expected}، ولكن تم إدخال ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${V(v.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return` أكبر من اللازم: يفترض أن تكون ${v.origin??"القيمة"} ${z} ${v.maximum.toString()} ${_.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${v.origin??"القيمة"} ${z} ${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`أصغر من اللازم: يفترض لـ ${v.origin} أن يكون ${z} ${v.minimum.toString()} ${_.unit}`;return`أصغر من اللازم: يفترض لـ ${v.origin} أن يكون ${z} ${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${v.prefix}"`;if(z.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${z.suffix}"`;if(z.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${z.includes}"`;if(z.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${z.pattern}`;return`${b[z.format]??v.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${v.divisor}`;case"unrecognized_keys":return`معرف${v.keys.length>1?"ات":""} غريب${v.keys.length>1?"ة":""}: ${K(v.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${v.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${v.origin}`;default:return"مدخل غير مقبول"}}};function mb(){return{localeError:Q0()}}var Y0=()=>{let $={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"number";case"object":{if(Array.isArray(v))return"array";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={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"};return(v)=>{switch(v.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${v.expected}, daxil olan ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`Yanlış dəyər: gözlənilən ${V(v.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Çox böyük: gözlənilən ${v.origin??"dəyər"} ${z}${v.maximum.toString()} ${_.unit??"element"}`;return`Çox böyük: gözlənilən ${v.origin??"dəyər"} ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Çox kiçik: gözlənilən ${v.origin} ${z}${v.minimum.toString()} ${_.unit}`;return`Çox kiçik: gözlənilən ${v.origin} ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Yanlış mətn: "${z.prefix}" ilə başlamalıdır`;if(z.format==="ends_with")return`Yanlış mətn: "${z.suffix}" ilə bitməlidir`;if(z.format==="includes")return`Yanlış mətn: "${z.includes}" daxil olmalıdır`;if(z.format==="regex")return`Yanlış mətn: ${z.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${b[z.format]??v.format}`}case"not_multiple_of":return`Yanlış ədəd: ${v.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${v.keys.length>1?"lar":""}: ${K(v.keys,", ")}`;case"invalid_key":return`${v.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${v.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function Tb(){return{localeError:Y0()}}function BO($,U,r,b){let v=Math.abs($),z=v%10,_=v%100;if(_>=11&&_<=19)return b;if(z===1)return U;if(z>=2&&z<=4)return r;return b}var j0=()=>{let $={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"лік";case"object":{if(Array.isArray(v))return"масіў";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return(v)=>{switch(v.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${v.expected}, атрымана ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`Няправільны ўвод: чакалася ${V(v.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_){let N=Number(v.maximum),O=BO(N,_.unit.one,_.unit.few,_.unit.many);return`Занадта вялікі: чакалася, што ${v.origin??"значэнне"} павінна ${_.verb} ${z}${v.maximum.toString()} ${O}`}return`Занадта вялікі: чакалася, што ${v.origin??"значэнне"} павінна быць ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_){let N=Number(v.minimum),O=BO(N,_.unit.one,_.unit.few,_.unit.many);return`Занадта малы: чакалася, што ${v.origin} павінна ${_.verb} ${z}${v.minimum.toString()} ${O}`}return`Занадта малы: чакалася, што ${v.origin} павінна быць ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${z.prefix}"`;if(z.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${z.suffix}"`;if(z.format==="includes")return`Няправільны радок: павінен змяшчаць "${z.includes}"`;if(z.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${z.pattern}`;return`Няправільны ${b[z.format]??v.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${v.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${v.keys.length>1?"ключы":"ключ"}: ${K(v.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${v.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${v.origin}`;default:return"Няправільны ўвод"}}};function Cb(){return{localeError:j0()}}var P0=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"number";case"object":{if(Array.isArray(v))return"array";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"entrada",email:"adreça electrònica",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ça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(v)=>{switch(v.code){case"invalid_type":return`Tipus invàlid: s'esperava ${v.expected}, s'ha rebut ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`Valor invàlid: s'esperava ${V(v.values[0])}`;return`Opció invàlida: s'esperava una de ${K(v.values," o ")}`;case"too_big":{let z=v.inclusive?"com a màxim":"menys de",_=U(v.origin);if(_)return`Massa gran: s'esperava que ${v.origin??"el valor"} contingués ${z} ${v.maximum.toString()} ${_.unit??"elements"}`;return`Massa gran: s'esperava que ${v.origin??"el valor"} fos ${z} ${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?"com a mínim":"més de",_=U(v.origin);if(_)return`Massa petit: s'esperava que ${v.origin} contingués ${z} ${v.minimum.toString()} ${_.unit}`;return`Massa petit: s'esperava que ${v.origin} fos ${z} ${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Format invàlid: ha de començar amb "${z.prefix}"`;if(z.format==="ends_with")return`Format invàlid: ha d'acabar amb "${z.suffix}"`;if(z.format==="includes")return`Format invàlid: ha d'incloure "${z.includes}"`;if(z.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${z.pattern}`;return`Format invàlid per a ${b[z.format]??v.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${v.divisor}`;case"unrecognized_keys":return`Clau${v.keys.length>1?"s":""} no reconeguda${v.keys.length>1?"s":""}: ${K(v.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${v.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${v.origin}`;default:return"Entrada invàlida"}}};function cb(){return{localeError:P0()}}var V0=()=>{let $={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(v))return"pole";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"regulární výraz",email:"e-mailová 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 čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return(v)=>{switch(v.code){case"invalid_type":return`Neplatný vstup: očekáváno ${v.expected}, obdrženo ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`Neplatný vstup: očekáváno ${V(v.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Hodnota je příliš velká: ${v.origin??"hodnota"} musí mít ${z}${v.maximum.toString()} ${_.unit??"prvků"}`;return`Hodnota je příliš velká: ${v.origin??"hodnota"} musí být ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Hodnota je příliš malá: ${v.origin??"hodnota"} musí mít ${z}${v.minimum.toString()} ${_.unit??"prvků"}`;return`Hodnota je příliš malá: ${v.origin??"hodnota"} musí být ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Neplatný řetězec: musí začínat na "${z.prefix}"`;if(z.format==="ends_with")return`Neplatný řetězec: musí končit na "${z.suffix}"`;if(z.format==="includes")return`Neplatný řetězec: musí obsahovat "${z.includes}"`;if(z.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${z.pattern}`;return`Neplatný formát ${b[z.format]??v.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${v.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${K(v.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${v.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${v.origin}`;default:return"Neplatný vstup"}}};function ub(){return{localeError:V0()}}var q0=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},U={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};function r(_){return $[_]??null}function b(_){return U[_]??_}let v=(_)=>{let N=typeof _;switch(N){case"number":return Number.isNaN(_)?"NaN":"tal";case"object":{if(Array.isArray(_))return"liste";if(_===null)return"null";if(Object.getPrototypeOf(_)!==Object.prototype&&_.constructor)return _.constructor.name;return"objekt"}}return N},z={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æt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",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"};return(_)=>{switch(_.code){case"invalid_type":return`Ugyldigt input: forventede ${b(_.expected)}, fik ${b(v(_.input))}`;case"invalid_value":if(_.values.length===1)return`Ugyldig værdi: forventede ${V(_.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${K(_.values,"|")}`;case"too_big":{let N=_.inclusive?"<=":"<",O=r(_.origin),I=b(_.origin);if(O)return`For stor: forventede ${I??"value"} ${O.verb} ${N} ${_.maximum.toString()} ${O.unit??"elementer"}`;return`For stor: forventede ${I??"value"} havde ${N} ${_.maximum.toString()}`}case"too_small":{let N=_.inclusive?">=":">",O=r(_.origin),I=b(_.origin);if(O)return`For lille: forventede ${I} ${O.verb} ${N} ${_.minimum.toString()} ${O.unit}`;return`For lille: forventede ${I} havde ${N} ${_.minimum.toString()}`}case"invalid_format":{let N=_;if(N.format==="starts_with")return`Ugyldig streng: skal starte med "${N.prefix}"`;if(N.format==="ends_with")return`Ugyldig streng: skal ende med "${N.suffix}"`;if(N.format==="includes")return`Ugyldig streng: skal indeholde "${N.includes}"`;if(N.format==="regex")return`Ugyldig streng: skal matche mønsteret ${N.pattern}`;return`Ugyldig ${z[N.format]??_.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${_.divisor}`;case"unrecognized_keys":return`${_.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${K(_.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${_.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${_.origin}`;default:return"Ugyldigt input"}}};function hb(){return{localeError:q0()}}var B0=()=>{let $={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 U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"Zahl";case"object":{if(Array.isArray(v))return"Array";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={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"};return(v)=>{switch(v.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${v.expected}, erhalten ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`Ungültige Eingabe: erwartet ${V(v.values[0])}`;return`Ungültige Option: erwartet eine von ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Zu groß: erwartet, dass ${v.origin??"Wert"} ${z}${v.maximum.toString()} ${_.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${v.origin??"Wert"} ${z}${v.maximum.toString()} ist`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Zu klein: erwartet, dass ${v.origin} ${z}${v.minimum.toString()} ${_.unit} hat`;return`Zu klein: erwartet, dass ${v.origin} ${z}${v.minimum.toString()} ist`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Ungültiger String: muss mit "${z.prefix}" beginnen`;if(z.format==="ends_with")return`Ungültiger String: muss mit "${z.suffix}" enden`;if(z.format==="includes")return`Ungültiger String: muss "${z.includes}" enthalten`;if(z.format==="regex")return`Ungültiger String: muss dem Muster ${z.pattern} entsprechen`;return`Ungültig: ${b[z.format]??v.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${v.divisor} sein`;case"unrecognized_keys":return`${v.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${K(v.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${v.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${v.origin}`;default:return"Ungültige Eingabe"}}};function nb(){return{localeError:B0()}}var L0=($)=>{let U=typeof $;switch(U){case"number":return Number.isNaN($)?"NaN":"number";case"object":{if(Array.isArray($))return"array";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return U},H0=()=>{let $={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function U(b){return $[b]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(b)=>{switch(b.code){case"invalid_type":return`Invalid input: expected ${b.expected}, received ${L0(b.input)}`;case"invalid_value":if(b.values.length===1)return`Invalid input: expected ${V(b.values[0])}`;return`Invalid option: expected one of ${K(b.values,"|")}`;case"too_big":{let v=b.inclusive?"<=":"<",z=U(b.origin);if(z)return`Too big: expected ${b.origin??"value"} to have ${v}${b.maximum.toString()} ${z.unit??"elements"}`;return`Too big: expected ${b.origin??"value"} to be ${v}${b.maximum.toString()}`}case"too_small":{let v=b.inclusive?">=":">",z=U(b.origin);if(z)return`Too small: expected ${b.origin} to have ${v}${b.minimum.toString()} ${z.unit}`;return`Too small: expected ${b.origin} to be ${v}${b.minimum.toString()}`}case"invalid_format":{let v=b;if(v.format==="starts_with")return`Invalid string: must start with "${v.prefix}"`;if(v.format==="ends_with")return`Invalid string: must end with "${v.suffix}"`;if(v.format==="includes")return`Invalid string: must include "${v.includes}"`;if(v.format==="regex")return`Invalid string: must match pattern ${v.pattern}`;return`Invalid ${r[v.format]??b.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${b.divisor}`;case"unrecognized_keys":return`Unrecognized key${b.keys.length>1?"s":""}: ${K(b.keys,", ")}`;case"invalid_key":return`Invalid key in ${b.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${b.origin}`;default:return"Invalid input"}}};function Tv(){return{localeError:H0()}}var E0=($)=>{let U=typeof $;switch(U){case"number":return Number.isNaN($)?"NaN":"nombro";case"object":{if(Array.isArray($))return"tabelo";if($===null)return"senvalora";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return U},A0=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function U(b){return $[b]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",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ŭro",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"};return(b)=>{switch(b.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${b.expected}, riceviĝis ${E0(b.input)}`;case"invalid_value":if(b.values.length===1)return`Nevalida enigo: atendiĝis ${V(b.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${K(b.values,"|")}`;case"too_big":{let v=b.inclusive?"<=":"<",z=U(b.origin);if(z)return`Tro granda: atendiĝis ke ${b.origin??"valoro"} havu ${v}${b.maximum.toString()} ${z.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${b.origin??"valoro"} havu ${v}${b.maximum.toString()}`}case"too_small":{let v=b.inclusive?">=":">",z=U(b.origin);if(z)return`Tro malgranda: atendiĝis ke ${b.origin} havu ${v}${b.minimum.toString()} ${z.unit}`;return`Tro malgranda: atendiĝis ke ${b.origin} estu ${v}${b.minimum.toString()}`}case"invalid_format":{let v=b;if(v.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${v.prefix}"`;if(v.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${v.suffix}"`;if(v.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${v.includes}"`;if(v.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${v.pattern}`;return`Nevalida ${r[v.format]??b.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${b.divisor}`;case"unrecognized_keys":return`Nekonata${b.keys.length>1?"j":""} ŝlosilo${b.keys.length>1?"j":""}: ${K(b.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${b.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${b.origin}`;default:return"Nevalida enigo"}}};function yb(){return{localeError:A0()}}var G0=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},U={string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};function r(_){return $[_]??null}function b(_){return U[_]??_}let v=(_)=>{let N=typeof _;switch(N){case"number":return Number.isNaN(_)?"NaN":"number";case"object":{if(Array.isArray(_))return"array";if(_===null)return"null";if(Object.getPrototypeOf(_)!==Object.prototype)return _.constructor.name;return"object"}}return N},z={regex:"entrada",email:"dirección de correo electrónico",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ón ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(_)=>{switch(_.code){case"invalid_type":return`Entrada inválida: se esperaba ${b(_.expected)}, recibido ${b(v(_.input))}`;case"invalid_value":if(_.values.length===1)return`Entrada inválida: se esperaba ${V(_.values[0])}`;return`Opción inválida: se esperaba una de ${K(_.values,"|")}`;case"too_big":{let N=_.inclusive?"<=":"<",O=r(_.origin),I=b(_.origin);if(O)return`Demasiado grande: se esperaba que ${I??"valor"} tuviera ${N}${_.maximum.toString()} ${O.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${I??"valor"} fuera ${N}${_.maximum.toString()}`}case"too_small":{let N=_.inclusive?">=":">",O=r(_.origin),I=b(_.origin);if(O)return`Demasiado pequeño: se esperaba que ${I} tuviera ${N}${_.minimum.toString()} ${O.unit}`;return`Demasiado pequeño: se esperaba que ${I} fuera ${N}${_.minimum.toString()}`}case"invalid_format":{let N=_;if(N.format==="starts_with")return`Cadena inválida: debe comenzar con "${N.prefix}"`;if(N.format==="ends_with")return`Cadena inválida: debe terminar en "${N.suffix}"`;if(N.format==="includes")return`Cadena inválida: debe incluir "${N.includes}"`;if(N.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${N.pattern}`;return`Inválido ${z[N.format]??_.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${_.divisor}`;case"unrecognized_keys":return`Llave${_.keys.length>1?"s":""} desconocida${_.keys.length>1?"s":""}: ${K(_.keys,", ")}`;case"invalid_key":return`Llave inválida en ${b(_.origin)}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${b(_.origin)}`;default:return"Entrada inválida"}}};function fb(){return{localeError:G0()}}var S0=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"عدد";case"object":{if(Array.isArray(v))return"آرایه";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return(v)=>{switch(v.code){case"invalid_type":return`ورودی نامعتبر: میبایست ${v.expected} میبود، ${r(v.input)} دریافت شد`;case"invalid_value":if(v.values.length===1)return`ورودی نامعتبر: میبایست ${V(v.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${K(v.values,"|")} میبود`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`خیلی بزرگ: ${v.origin??"مقدار"} باید ${z}${v.maximum.toString()} ${_.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${v.origin??"مقدار"} باید ${z}${v.maximum.toString()} باشد`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`خیلی کوچک: ${v.origin} باید ${z}${v.minimum.toString()} ${_.unit} باشد`;return`خیلی کوچک: ${v.origin} باید ${z}${v.minimum.toString()} باشد`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`رشته نامعتبر: باید با "${z.prefix}" شروع شود`;if(z.format==="ends_with")return`رشته نامعتبر: باید با "${z.suffix}" تمام شود`;if(z.format==="includes")return`رشته نامعتبر: باید شامل "${z.includes}" باشد`;if(z.format==="regex")return`رشته نامعتبر: باید با الگوی ${z.pattern} مطابقت داشته باشد`;return`${b[z.format]??v.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${v.divisor} باشد`;case"unrecognized_keys":return`کلید${v.keys.length>1?"های":""} ناشناس: ${K(v.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${v.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${v.origin}`;default:return"ورودی نامعتبر"}}};function ib(){return{localeError:S0()}}var F0=()=>{let $={string:{unit:"merkkiä",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äivämäärän"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"number";case"object":{if(Array.isArray(v))return"array";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"säännöllinen lauseke",email:"sähköpostiosoite",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äivämäärä",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"};return(v)=>{switch(v.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${v.expected}, oli ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`Virheellinen syöte: täytyy olla ${V(v.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Liian suuri: ${_.subject} täytyy olla ${z}${v.maximum.toString()} ${_.unit}`.trim();return`Liian suuri: arvon täytyy olla ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Liian pieni: ${_.subject} täytyy olla ${z}${v.minimum.toString()} ${_.unit}`.trim();return`Liian pieni: arvon täytyy olla ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${z.prefix}"`;if(z.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${z.suffix}"`;if(z.format==="includes")return`Virheellinen syöte: täytyy sisältää "${z.includes}"`;if(z.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${z.pattern}`;return`Virheellinen ${b[z.format]??v.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${v.divisor} monikerta`;case"unrecognized_keys":return`${v.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${K(v.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öte"}}};function lb(){return{localeError:F0()}}var M0=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"nombre";case"object":{if(Array.isArray(v))return"tableau";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"entrée",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ée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(v)=>{switch(v.code){case"invalid_type":return`Entrée invalide : ${v.expected} attendu, ${r(v.input)} reçu`;case"invalid_value":if(v.values.length===1)return`Entrée invalide : ${V(v.values[0])} attendu`;return`Option invalide : une valeur parmi ${K(v.values,"|")} attendue`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Trop grand : ${v.origin??"valeur"} doit ${_.verb} ${z}${v.maximum.toString()} ${_.unit??"élément(s)"}`;return`Trop grand : ${v.origin??"valeur"} doit être ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Trop petit : ${v.origin} doit ${_.verb} ${z}${v.minimum.toString()} ${_.unit}`;return`Trop petit : ${v.origin} doit être ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Chaîne invalide : doit commencer par "${z.prefix}"`;if(z.format==="ends_with")return`Chaîne invalide : doit se terminer par "${z.suffix}"`;if(z.format==="includes")return`Chaîne invalide : doit inclure "${z.includes}"`;if(z.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${z.pattern}`;return`${b[z.format]??v.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${v.divisor}`;case"unrecognized_keys":return`Clé${v.keys.length>1?"s":""} non reconnue${v.keys.length>1?"s":""} : ${K(v.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${v.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${v.origin}`;default:return"Entrée invalide"}}};function ob(){return{localeError:M0()}}var Z0=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"number";case"object":{if(Array.isArray(v))return"array";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"entrée",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ée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(v)=>{switch(v.code){case"invalid_type":return`Entrée invalide : attendu ${v.expected}, reçu ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`Entrée invalide : attendu ${V(v.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"≤":"<",_=U(v.origin);if(_)return`Trop grand : attendu que ${v.origin??"la valeur"} ait ${z}${v.maximum.toString()} ${_.unit}`;return`Trop grand : attendu que ${v.origin??"la valeur"} soit ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?"≥":">",_=U(v.origin);if(_)return`Trop petit : attendu que ${v.origin} ait ${z}${v.minimum.toString()} ${_.unit}`;return`Trop petit : attendu que ${v.origin} soit ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Chaîne invalide : doit commencer par "${z.prefix}"`;if(z.format==="ends_with")return`Chaîne invalide : doit se terminer par "${z.suffix}"`;if(z.format==="includes")return`Chaîne invalide : doit inclure "${z.includes}"`;if(z.format==="regex")return`Chaîne invalide : doit correspondre au motif ${z.pattern}`;return`${b[z.format]??v.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${v.divisor}`;case"unrecognized_keys":return`Clé${v.keys.length>1?"s":""} non reconnue${v.keys.length>1?"s":""} : ${K(v.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${v.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${v.origin}`;default:return"Entrée invalide"}}};function db(){return{localeError:Z0()}}var D0=()=>{let $={string:{unit:"אותיות",verb:"לכלול"},file:{unit:"בייטים",verb:"לכלול"},array:{unit:"פריטים",verb:"לכלול"},set:{unit:"פריטים",verb:"לכלול"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"number";case"object":{if(Array.isArray(v))return"array";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"קלט",email:"כתובת אימייל",url:"כתובת רשת",emoji:"אימוג'י",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"תאריך וזמן ISO",date:"תאריך ISO",time:"זמן ISO",duration:"משך זמן ISO",ipv4:"כתובת IPv4",ipv6:"כתובת IPv6",cidrv4:"טווח IPv4",cidrv6:"טווח IPv6",base64:"מחרוזת בבסיס 64",base64url:"מחרוזת בבסיס 64 לכתובות רשת",json_string:"מחרוזת JSON",e164:"מספר E.164",jwt:"JWT",template_literal:"קלט"};return(v)=>{switch(v.code){case"invalid_type":return`קלט לא תקין: צריך ${v.expected}, התקבל ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`קלט לא תקין: צריך ${V(v.values[0])}`;return`קלט לא תקין: צריך אחת מהאפשרויות ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`גדול מדי: ${v.origin??"value"} צריך להיות ${z}${v.maximum.toString()} ${_.unit??"elements"}`;return`גדול מדי: ${v.origin??"value"} צריך להיות ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`קטן מדי: ${v.origin} צריך להיות ${z}${v.minimum.toString()} ${_.unit}`;return`קטן מדי: ${v.origin} צריך להיות ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`מחרוזת לא תקינה: חייבת להתחיל ב"${z.prefix}"`;if(z.format==="ends_with")return`מחרוזת לא תקינה: חייבת להסתיים ב "${z.suffix}"`;if(z.format==="includes")return`מחרוזת לא תקינה: חייבת לכלול "${z.includes}"`;if(z.format==="regex")return`מחרוזת לא תקינה: חייבת להתאים לתבנית ${z.pattern}`;return`${b[z.format]??v.format} לא תקין`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${v.divisor}`;case"unrecognized_keys":return`מפתח${v.keys.length>1?"ות":""} לא מזוה${v.keys.length>1?"ים":"ה"}: ${K(v.keys,", ")}`;case"invalid_key":return`מפתח לא תקין ב${v.origin}`;case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${v.origin}`;default:return"קלט לא תקין"}}};function pb(){return{localeError:D0()}}var x0=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"szám";case"object":{if(Array.isArray(v))return"tömb";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"bemenet",email:"email cím",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őbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return(v)=>{switch(v.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${v.expected}, a kapott érték ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`Érvénytelen bemenet: a várt érték ${V(v.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Túl nagy: ${v.origin??"érték"} mérete túl nagy ${z}${v.maximum.toString()} ${_.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${v.origin??"érték"} túl nagy: ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Túl kicsi: a bemeneti érték ${v.origin} mérete túl kicsi ${z}${v.minimum.toString()} ${_.unit}`;return`Túl kicsi: a bemeneti érték ${v.origin} túl kicsi ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Érvénytelen string: "${z.prefix}" értékkel kell kezdődnie`;if(z.format==="ends_with")return`Érvénytelen string: "${z.suffix}" értékkel kell végződnie`;if(z.format==="includes")return`Érvénytelen string: "${z.includes}" értéket kell tartalmaznia`;if(z.format==="regex")return`Érvénytelen string: ${z.pattern} mintának kell megfelelnie`;return`Érvénytelen ${b[z.format]??v.format}`}case"not_multiple_of":return`Érvénytelen szám: ${v.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${v.keys.length>1?"s":""}: ${K(v.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${v.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${v.origin}`;default:return"Érvénytelen bemenet"}}};function tb(){return{localeError:x0()}}var g0=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"number";case"object":{if(Array.isArray(v))return"array";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={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"};return(v)=>{switch(v.code){case"invalid_type":return`Input tidak valid: diharapkan ${v.expected}, diterima ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`Input tidak valid: diharapkan ${V(v.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Terlalu besar: diharapkan ${v.origin??"value"} memiliki ${z}${v.maximum.toString()} ${_.unit??"elemen"}`;return`Terlalu besar: diharapkan ${v.origin??"value"} menjadi ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Terlalu kecil: diharapkan ${v.origin} memiliki ${z}${v.minimum.toString()} ${_.unit}`;return`Terlalu kecil: diharapkan ${v.origin} menjadi ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`String tidak valid: harus dimulai dengan "${z.prefix}"`;if(z.format==="ends_with")return`String tidak valid: harus berakhir dengan "${z.suffix}"`;if(z.format==="includes")return`String tidak valid: harus menyertakan "${z.includes}"`;if(z.format==="regex")return`String tidak valid: harus sesuai pola ${z.pattern}`;return`${b[z.format]??v.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${v.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${v.keys.length>1?"s":""}: ${K(v.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${v.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${v.origin}`;default:return"Input tidak valid"}}};function eb(){return{localeError:g0()}}var R0=($)=>{let U=typeof $;switch(U){case"number":return Number.isNaN($)?"NaN":"númer";case"object":{if(Array.isArray($))return"fylki";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return U},m0=()=>{let $={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function U(b){return $[b]??null}let r={regex:"gildi",email:"netfang",url:"vefslóð",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ími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",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ölugildi",jwt:"JWT",template_literal:"gildi"};return(b)=>{switch(b.code){case"invalid_type":return`Rangt gildi: Þú slóst inn ${R0(b.input)} þar sem á að vera ${b.expected}`;case"invalid_value":if(b.values.length===1)return`Rangt gildi: gert ráð fyrir ${V(b.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${K(b.values,"|")}`;case"too_big":{let v=b.inclusive?"<=":"<",z=U(b.origin);if(z)return`Of stórt: gert er ráð fyrir að ${b.origin??"gildi"} hafi ${v}${b.maximum.toString()} ${z.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${b.origin??"gildi"} sé ${v}${b.maximum.toString()}`}case"too_small":{let v=b.inclusive?">=":">",z=U(b.origin);if(z)return`Of lítið: gert er ráð fyrir að ${b.origin} hafi ${v}${b.minimum.toString()} ${z.unit}`;return`Of lítið: gert er ráð fyrir að ${b.origin} sé ${v}${b.minimum.toString()}`}case"invalid_format":{let v=b;if(v.format==="starts_with")return`Ógildur strengur: verður að byrja á "${v.prefix}"`;if(v.format==="ends_with")return`Ógildur strengur: verður að enda á "${v.suffix}"`;if(v.format==="includes")return`Ógildur strengur: verður að innihalda "${v.includes}"`;if(v.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${v.pattern}`;return`Rangt ${r[v.format]??b.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${b.divisor}`;case"unrecognized_keys":return`Óþekkt ${b.keys.length>1?"ir lyklar":"ur lykill"}: ${K(b.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${b.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${b.origin}`;default:return"Rangt gildi"}}};function ab(){return{localeError:m0()}}var T0=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"numero";case"object":{if(Array.isArray(v))return"vettore";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={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"};return(v)=>{switch(v.code){case"invalid_type":return`Input non valido: atteso ${v.expected}, ricevuto ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`Input non valido: atteso ${V(v.values[0])}`;return`Opzione non valida: atteso uno tra ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Troppo grande: ${v.origin??"valore"} deve avere ${z}${v.maximum.toString()} ${_.unit??"elementi"}`;return`Troppo grande: ${v.origin??"valore"} deve essere ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Troppo piccolo: ${v.origin} deve avere ${z}${v.minimum.toString()} ${_.unit}`;return`Troppo piccolo: ${v.origin} deve essere ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Stringa non valida: deve iniziare con "${z.prefix}"`;if(z.format==="ends_with")return`Stringa non valida: deve terminare con "${z.suffix}"`;if(z.format==="includes")return`Stringa non valida: deve includere "${z.includes}"`;if(z.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${z.pattern}`;return`Invalid ${b[z.format]??v.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${v.divisor}`;case"unrecognized_keys":return`Chiav${v.keys.length>1?"i":"e"} non riconosciut${v.keys.length>1?"e":"a"}: ${K(v.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${v.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${v.origin}`;default:return"Input non valido"}}};function sb(){return{localeError:T0()}}var C0=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"数値";case"object":{if(Array.isArray(v))return"配列";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return(v)=>{switch(v.code){case"invalid_type":return`無効な入力: ${v.expected}が期待されましたが、${r(v.input)}が入力されました`;case"invalid_value":if(v.values.length===1)return`無効な入力: ${V(v.values[0])}が期待されました`;return`無効な選択: ${K(v.values,"、")}のいずれかである必要があります`;case"too_big":{let z=v.inclusive?"以下である":"より小さい",_=U(v.origin);if(_)return`大きすぎる値: ${v.origin??"値"}は${v.maximum.toString()}${_.unit??"要素"}${z}必要があります`;return`大きすぎる値: ${v.origin??"値"}は${v.maximum.toString()}${z}必要があります`}case"too_small":{let z=v.inclusive?"以上である":"より大きい",_=U(v.origin);if(_)return`小さすぎる値: ${v.origin}は${v.minimum.toString()}${_.unit}${z}必要があります`;return`小さすぎる値: ${v.origin}は${v.minimum.toString()}${z}必要があります`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`無効な文字列: "${z.prefix}"で始まる必要があります`;if(z.format==="ends_with")return`無効な文字列: "${z.suffix}"で終わる必要があります`;if(z.format==="includes")return`無効な文字列: "${z.includes}"を含む必要があります`;if(z.format==="regex")return`無効な文字列: パターン${z.pattern}に一致する必要があります`;return`無効な${b[z.format]??v.format}`}case"not_multiple_of":return`無効な数値: ${v.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${v.keys.length>1?"群":""}: ${K(v.keys,"、")}`;case"invalid_key":return`${v.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${v.origin}内の無効な値`;default:return"無効な入力"}}};function $1(){return{localeError:C0()}}var c0=($)=>{let U=typeof $;switch(U){case"number":return Number.isNaN($)?"NaN":"რიცხვი";case"object":{if(Array.isArray($))return"მასივი";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return{string:"სტრინგი",boolean:"ბულეანი",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"ფუნქცია"}[U]??U},u0=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function U(b){return $[b]??null}let r={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"};return(b)=>{switch(b.code){case"invalid_type":return`არასწორი შეყვანა: მოსალოდნელი ${b.expected}, მიღებული ${c0(b.input)}`;case"invalid_value":if(b.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${V(b.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${K(b.values,"|")}-დან`;case"too_big":{let v=b.inclusive?"<=":"<",z=U(b.origin);if(z)return`ზედმეტად დიდი: მოსალოდნელი ${b.origin??"მნიშვნელობა"} ${z.verb} ${v}${b.maximum.toString()} ${z.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${b.origin??"მნიშვნელობა"} იყოს ${v}${b.maximum.toString()}`}case"too_small":{let v=b.inclusive?">=":">",z=U(b.origin);if(z)return`ზედმეტად პატარა: მოსალოდნელი ${b.origin} ${z.verb} ${v}${b.minimum.toString()} ${z.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${b.origin} იყოს ${v}${b.minimum.toString()}`}case"invalid_format":{let v=b;if(v.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${v.prefix}"-ით`;if(v.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${v.suffix}"-ით`;if(v.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${v.includes}"-ს`;if(v.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${v.pattern}`;return`არასწორი ${r[v.format]??b.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${b.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${b.keys.length>1?"ები":"ი"}: ${K(b.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${b.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${b.origin}-ში`;default:return"არასწორი შეყვანა"}}};function v1(){return{localeError:u0()}}var h0=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(v))return"អារេ (Array)";if(v===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return(v)=>{switch(v.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${v.expected} ប៉ុន្តែទទួលបាន ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${V(v.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`ធំពេក៖ ត្រូវការ ${v.origin??"តម្លៃ"} ${z} ${v.maximum.toString()} ${_.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${v.origin??"តម្លៃ"} ${z} ${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`តូចពេក៖ ត្រូវការ ${v.origin} ${z} ${v.minimum.toString()} ${_.unit}`;return`តូចពេក៖ ត្រូវការ ${v.origin} ${z} ${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${z.prefix}"`;if(z.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${z.suffix}"`;if(z.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${z.includes}"`;if(z.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${z.pattern}`;return`មិនត្រឹមត្រូវ៖ ${b[z.format]??v.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${v.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${K(v.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${v.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${v.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function Cv(){return{localeError:h0()}}function U1(){return Cv()}var n0=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"number";case"object":{if(Array.isArray(v))return"array";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return(v)=>{switch(v.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${v.expected}, 받은 타입은 ${r(v.input)}입니다`;case"invalid_value":if(v.values.length===1)return`잘못된 입력: 값은 ${V(v.values[0])} 이어야 합니다`;return`잘못된 옵션: ${K(v.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let z=v.inclusive?"이하":"미만",_=z==="미만"?"이어야 합니다":"여야 합니다",N=U(v.origin),O=N?.unit??"요소";if(N)return`${v.origin??"값"}이 너무 큽니다: ${v.maximum.toString()}${O} ${z}${_}`;return`${v.origin??"값"}이 너무 큽니다: ${v.maximum.toString()} ${z}${_}`}case"too_small":{let z=v.inclusive?"이상":"초과",_=z==="이상"?"이어야 합니다":"여야 합니다",N=U(v.origin),O=N?.unit??"요소";if(N)return`${v.origin??"값"}이 너무 작습니다: ${v.minimum.toString()}${O} ${z}${_}`;return`${v.origin??"값"}이 너무 작습니다: ${v.minimum.toString()} ${z}${_}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`잘못된 문자열: "${z.prefix}"(으)로 시작해야 합니다`;if(z.format==="ends_with")return`잘못된 문자열: "${z.suffix}"(으)로 끝나야 합니다`;if(z.format==="includes")return`잘못된 문자열: "${z.includes}"을(를) 포함해야 합니다`;if(z.format==="regex")return`잘못된 문자열: 정규식 ${z.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${b[z.format]??v.format}`}case"not_multiple_of":return`잘못된 숫자: ${v.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${K(v.keys,", ")}`;case"invalid_key":return`잘못된 키: ${v.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${v.origin}`;default:return"잘못된 입력"}}};function r1(){return{localeError:n0()}}var y0=($)=>{return uv(typeof $,$)},uv=($,U=void 0)=>{switch($){case"number":return Number.isNaN(U)?"NaN":"skaičius";case"bigint":return"sveikasis skaičius";case"string":return"eilutė";case"boolean":return"loginė reikšmė";case"undefined":case"void":return"neapibrėžta reikšmė";case"function":return"funkcija";case"symbol":return"simbolis";case"object":{if(U===void 0)return"nežinomas objektas";if(U===null)return"nulinė reikšmė";if(Array.isArray(U))return"masyvas";if(Object.getPrototypeOf(U)!==Object.prototype&&U.constructor)return U.constructor.name;return"objektas"}case"null":return"nulinė reikšmė"}return $},cv=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function LO($){let U=Math.abs($),r=U%10,b=U%100;if(b>=11&&b<=19||r===0)return"many";if(r===1)return"one";return"few"}var f0=()=>{let $={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function U(b,v,z,_){let N=$[b]??null;if(N===null)return N;return{unit:N.unit[v],verb:N.verb[_][z?"inclusive":"notInclusive"]}}let r={regex:"įvestis",email:"el. pašto 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ė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"};return(b)=>{switch(b.code){case"invalid_type":return`Gautas tipas ${y0(b.input)}, o tikėtasi - ${uv(b.expected)}`;case"invalid_value":if(b.values.length===1)return`Privalo būti ${V(b.values[0])}`;return`Privalo būti vienas iš ${K(b.values,"|")} pasirinkimų`;case"too_big":{let v=uv(b.origin),z=U(b.origin,LO(Number(b.maximum)),b.inclusive??!1,"smaller");if(z?.verb)return`${cv(v??b.origin??"reikšmė")} ${z.verb} ${b.maximum.toString()} ${z.unit??"elementų"}`;let _=b.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${cv(v??b.origin??"reikšmė")} turi būti ${_} ${b.maximum.toString()} ${z?.unit}`}case"too_small":{let v=uv(b.origin),z=U(b.origin,LO(Number(b.minimum)),b.inclusive??!1,"bigger");if(z?.verb)return`${cv(v??b.origin??"reikšmė")} ${z.verb} ${b.minimum.toString()} ${z.unit??"elementų"}`;let _=b.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${cv(v??b.origin??"reikšmė")} turi būti ${_} ${b.minimum.toString()} ${z?.unit}`}case"invalid_format":{let v=b;if(v.format==="starts_with")return`Eilutė privalo prasidėti "${v.prefix}"`;if(v.format==="ends_with")return`Eilutė privalo pasibaigti "${v.suffix}"`;if(v.format==="includes")return`Eilutė privalo įtraukti "${v.includes}"`;if(v.format==="regex")return`Eilutė privalo atitikti ${v.pattern}`;return`Neteisingas ${r[v.format]??b.format}`}case"not_multiple_of":return`Skaičius privalo būti ${b.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${b.keys.length>1?"i":"as"} rakt${b.keys.length>1?"ai":"as"}: ${K(b.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let v=uv(b.origin);return`${cv(v??b.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function b1(){return{localeError:f0()}}var i0=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"број";case"object":{if(Array.isArray(v))return"низа";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return(v)=>{switch(v.code){case"invalid_type":return`Грешен внес: се очекува ${v.expected}, примено ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`Invalid input: expected ${V(v.values[0])}`;return`Грешана опција: се очекува една ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Премногу голем: се очекува ${v.origin??"вредноста"} да има ${z}${v.maximum.toString()} ${_.unit??"елементи"}`;return`Премногу голем: се очекува ${v.origin??"вредноста"} да биде ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Премногу мал: се очекува ${v.origin} да има ${z}${v.minimum.toString()} ${_.unit}`;return`Премногу мал: се очекува ${v.origin} да биде ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Неважечка низа: мора да започнува со "${z.prefix}"`;if(z.format==="ends_with")return`Неважечка низа: мора да завршува со "${z.suffix}"`;if(z.format==="includes")return`Неважечка низа: мора да вклучува "${z.includes}"`;if(z.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${z.pattern}`;return`Invalid ${b[z.format]??v.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${v.divisor}`;case"unrecognized_keys":return`${v.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${K(v.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${v.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${v.origin}`;default:return"Грешен внес"}}};function z1(){return{localeError:i0()}}var l0=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"nombor";case"object":{if(Array.isArray(v))return"array";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={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"};return(v)=>{switch(v.code){case"invalid_type":return`Input tidak sah: dijangka ${v.expected}, diterima ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`Input tidak sah: dijangka ${V(v.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Terlalu besar: dijangka ${v.origin??"nilai"} ${_.verb} ${z}${v.maximum.toString()} ${_.unit??"elemen"}`;return`Terlalu besar: dijangka ${v.origin??"nilai"} adalah ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Terlalu kecil: dijangka ${v.origin} ${_.verb} ${z}${v.minimum.toString()} ${_.unit}`;return`Terlalu kecil: dijangka ${v.origin} adalah ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`String tidak sah: mesti bermula dengan "${z.prefix}"`;if(z.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${z.suffix}"`;if(z.format==="includes")return`String tidak sah: mesti mengandungi "${z.includes}"`;if(z.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${z.pattern}`;return`${b[z.format]??v.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${v.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${K(v.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${v.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${v.origin}`;default:return"Input tidak sah"}}};function _1(){return{localeError:l0()}}var o0=()=>{let $={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"getal";case"object":{if(Array.isArray(v))return"array";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={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"};return(v)=>{switch(v.code){case"invalid_type":return`Ongeldige invoer: verwacht ${v.expected}, ontving ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`Ongeldige invoer: verwacht ${V(v.values[0])}`;return`Ongeldige optie: verwacht één van ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Te lang: verwacht dat ${v.origin??"waarde"} ${z}${v.maximum.toString()} ${_.unit??"elementen"} bevat`;return`Te lang: verwacht dat ${v.origin??"waarde"} ${z}${v.maximum.toString()} is`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Te kort: verwacht dat ${v.origin} ${z}${v.minimum.toString()} ${_.unit} bevat`;return`Te kort: verwacht dat ${v.origin} ${z}${v.minimum.toString()} is`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Ongeldige tekst: moet met "${z.prefix}" beginnen`;if(z.format==="ends_with")return`Ongeldige tekst: moet op "${z.suffix}" eindigen`;if(z.format==="includes")return`Ongeldige tekst: moet "${z.includes}" bevatten`;if(z.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${z.pattern}`;return`Ongeldig: ${b[z.format]??v.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${v.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${v.keys.length>1?"s":""}: ${K(v.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${v.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${v.origin}`;default:return"Ongeldige invoer"}}};function N1(){return{localeError:o0()}}var d0=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"tall";case"object":{if(Array.isArray(v))return"liste";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={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åde",ipv6:"IPv6-område",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"};return(v)=>{switch(v.code){case"invalid_type":return`Ugyldig input: forventet ${v.expected}, fikk ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`Ugyldig verdi: forventet ${V(v.values[0])}`;return`Ugyldig valg: forventet en av ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`For stor(t): forventet ${v.origin??"value"} til å ha ${z}${v.maximum.toString()} ${_.unit??"elementer"}`;return`For stor(t): forventet ${v.origin??"value"} til å ha ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`For lite(n): forventet ${v.origin} til å ha ${z}${v.minimum.toString()} ${_.unit}`;return`For lite(n): forventet ${v.origin} til å ha ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Ugyldig streng: må starte med "${z.prefix}"`;if(z.format==="ends_with")return`Ugyldig streng: må ende med "${z.suffix}"`;if(z.format==="includes")return`Ugyldig streng: må inneholde "${z.includes}"`;if(z.format==="regex")return`Ugyldig streng: må matche mønsteret ${z.pattern}`;return`Ugyldig ${b[z.format]??v.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${v.divisor}`;case"unrecognized_keys":return`${v.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${K(v.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${v.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${v.origin}`;default:return"Ugyldig input"}}};function O1(){return{localeError:d0()}}var p0=()=>{let $={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"numara";case"object":{if(Array.isArray(v))return"saf";if(v===null)return"gayb";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"giren",email:"epostagâh",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âmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return(v)=>{switch(v.code){case"invalid_type":return`Fâsit giren: umulan ${v.expected}, alınan ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`Fâsit giren: umulan ${V(v.values[0])}`;return`Fâsit tercih: mûteberler ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Fazla büyük: ${v.origin??"value"}, ${z}${v.maximum.toString()} ${_.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${v.origin??"value"}, ${z}${v.maximum.toString()} olmalıydı.`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Fazla küçük: ${v.origin}, ${z}${v.minimum.toString()} ${_.unit} sahip olmalıydı.`;return`Fazla küçük: ${v.origin}, ${z}${v.minimum.toString()} olmalıydı.`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Fâsit metin: "${z.prefix}" ile başlamalı.`;if(z.format==="ends_with")return`Fâsit metin: "${z.suffix}" ile bitmeli.`;if(z.format==="includes")return`Fâsit metin: "${z.includes}" ihtivâ etmeli.`;if(z.format==="regex")return`Fâsit metin: ${z.pattern} nakşına uymalı.`;return`Fâsit ${b[z.format]??v.format}`}case"not_multiple_of":return`Fâsit sayı: ${v.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${v.keys.length>1?"s":""}: ${K(v.keys,", ")}`;case"invalid_key":return`${v.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${v.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function I1(){return{localeError:p0()}}var t0=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"عدد";case"object":{if(Array.isArray(v))return"ارې";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return(v)=>{switch(v.code){case"invalid_type":return`ناسم ورودي: باید ${v.expected} وای, مګر ${r(v.input)} ترلاسه شو`;case"invalid_value":if(v.values.length===1)return`ناسم ورودي: باید ${V(v.values[0])} وای`;return`ناسم انتخاب: باید یو له ${K(v.values,"|")} څخه وای`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`ډیر لوی: ${v.origin??"ارزښت"} باید ${z}${v.maximum.toString()} ${_.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${v.origin??"ارزښت"} باید ${z}${v.maximum.toString()} وي`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`ډیر کوچنی: ${v.origin} باید ${z}${v.minimum.toString()} ${_.unit} ولري`;return`ډیر کوچنی: ${v.origin} باید ${z}${v.minimum.toString()} وي`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`ناسم متن: باید د "${z.prefix}" سره پیل شي`;if(z.format==="ends_with")return`ناسم متن: باید د "${z.suffix}" سره پای ته ورسيږي`;if(z.format==="includes")return`ناسم متن: باید "${z.includes}" ولري`;if(z.format==="regex")return`ناسم متن: باید د ${z.pattern} سره مطابقت ولري`;return`${b[z.format]??v.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${v.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${v.keys.length>1?"کلیډونه":"کلیډ"}: ${K(v.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${v.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${v.origin} کې`;default:return"ناسمه ورودي"}}};function k1(){return{localeError:t0()}}var e0=()=>{let $={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"liczba";case"object":{if(Array.isArray(v))return"tablica";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"wyrażenie",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ąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return(v)=>{switch(v.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${v.expected}, otrzymano ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${V(v.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Za duża wartość: oczekiwano, że ${v.origin??"wartość"} będzie mieć ${z}${v.maximum.toString()} ${_.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${v.origin??"wartość"} będzie wynosić ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Za mała wartość: oczekiwano, że ${v.origin??"wartość"} będzie mieć ${z}${v.minimum.toString()} ${_.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${v.origin??"wartość"} będzie wynosić ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${z.prefix}"`;if(z.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${z.suffix}"`;if(z.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${z.includes}"`;if(z.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${z.pattern}`;return`Nieprawidłow(y/a/e) ${b[z.format]??v.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${v.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${v.keys.length>1?"s":""}: ${K(v.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${v.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${v.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function J1(){return{localeError:e0()}}var a0=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"número";case"object":{if(Array.isArray(v))return"array";if(v===null)return"nulo";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"padrão",email:"endereço 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ção ISO",ipv4:"endereço IPv4",ipv6:"endereço 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úmero E.164",jwt:"JWT",template_literal:"entrada"};return(v)=>{switch(v.code){case"invalid_type":return`Tipo inválido: esperado ${v.expected}, recebido ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`Entrada inválida: esperado ${V(v.values[0])}`;return`Opção inválida: esperada uma das ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Muito grande: esperado que ${v.origin??"valor"} tivesse ${z}${v.maximum.toString()} ${_.unit??"elementos"}`;return`Muito grande: esperado que ${v.origin??"valor"} fosse ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Muito pequeno: esperado que ${v.origin} tivesse ${z}${v.minimum.toString()} ${_.unit}`;return`Muito pequeno: esperado que ${v.origin} fosse ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Texto inválido: deve começar com "${z.prefix}"`;if(z.format==="ends_with")return`Texto inválido: deve terminar com "${z.suffix}"`;if(z.format==="includes")return`Texto inválido: deve incluir "${z.includes}"`;if(z.format==="regex")return`Texto inválido: deve corresponder ao padrão ${z.pattern}`;return`${b[z.format]??v.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${v.divisor}`;case"unrecognized_keys":return`Chave${v.keys.length>1?"s":""} desconhecida${v.keys.length>1?"s":""}: ${K(v.keys,", ")}`;case"invalid_key":return`Chave inválida em ${v.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${v.origin}`;default:return"Campo inválido"}}};function w1(){return{localeError:a0()}}function HO($,U,r,b){let v=Math.abs($),z=v%10,_=v%100;if(_>=11&&_<=19)return b;if(z===1)return U;if(z>=2&&z<=4)return r;return b}var s0=()=>{let $={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"число";case"object":{if(Array.isArray(v))return"массив";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return(v)=>{switch(v.code){case"invalid_type":return`Неверный ввод: ожидалось ${v.expected}, получено ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`Неверный ввод: ожидалось ${V(v.values[0])}`;return`Неверный вариант: ожидалось одно из ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_){let N=Number(v.maximum),O=HO(N,_.unit.one,_.unit.few,_.unit.many);return`Слишком большое значение: ожидалось, что ${v.origin??"значение"} будет иметь ${z}${v.maximum.toString()} ${O}`}return`Слишком большое значение: ожидалось, что ${v.origin??"значение"} будет ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_){let N=Number(v.minimum),O=HO(N,_.unit.one,_.unit.few,_.unit.many);return`Слишком маленькое значение: ожидалось, что ${v.origin} будет иметь ${z}${v.minimum.toString()} ${O}`}return`Слишком маленькое значение: ожидалось, что ${v.origin} будет ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Неверная строка: должна начинаться с "${z.prefix}"`;if(z.format==="ends_with")return`Неверная строка: должна заканчиваться на "${z.suffix}"`;if(z.format==="includes")return`Неверная строка: должна содержать "${z.includes}"`;if(z.format==="regex")return`Неверная строка: должна соответствовать шаблону ${z.pattern}`;return`Неверный ${b[z.format]??v.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${v.divisor}`;case"unrecognized_keys":return`Нераспознанн${v.keys.length>1?"ые":"ый"} ключ${v.keys.length>1?"и":""}: ${K(v.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${v.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${v.origin}`;default:return"Неверные входные данные"}}};function K1(){return{localeError:s0()}}var $w=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"število";case"object":{if(Array.isArray(v))return"tabela";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"vnos",email:"e-poštni 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 čas",date:"ISO datum",time:"ISO čas",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 številka",jwt:"JWT",template_literal:"vnos"};return(v)=>{switch(v.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${v.expected}, prejeto ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`Neveljaven vnos: pričakovano ${V(v.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Preveliko: pričakovano, da bo ${v.origin??"vrednost"} imelo ${z}${v.maximum.toString()} ${_.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${v.origin??"vrednost"} ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Premajhno: pričakovano, da bo ${v.origin} imelo ${z}${v.minimum.toString()} ${_.unit}`;return`Premajhno: pričakovano, da bo ${v.origin} ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Neveljaven niz: mora se začeti z "${z.prefix}"`;if(z.format==="ends_with")return`Neveljaven niz: mora se končati z "${z.suffix}"`;if(z.format==="includes")return`Neveljaven niz: mora vsebovati "${z.includes}"`;if(z.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${z.pattern}`;return`Neveljaven ${b[z.format]??v.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${v.divisor}`;case"unrecognized_keys":return`Neprepoznan${v.keys.length>1?"i ključi":" ključ"}: ${K(v.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${v.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${v.origin}`;default:return"Neveljaven vnos"}}};function X1(){return{localeError:$w()}}var vw=()=>{let $={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"antal";case"object":{if(Array.isArray(v))return"lista";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"reguljärt 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äng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return(v)=>{switch(v.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${v.expected}, fick ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`Ogiltig inmatning: förväntat ${V(v.values[0])}`;return`Ogiltigt val: förväntade en av ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`För stor(t): förväntade ${v.origin??"värdet"} att ha ${z}${v.maximum.toString()} ${_.unit??"element"}`;return`För stor(t): förväntat ${v.origin??"värdet"} att ha ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`För lite(t): förväntade ${v.origin??"värdet"} att ha ${z}${v.minimum.toString()} ${_.unit}`;return`För lite(t): förväntade ${v.origin??"värdet"} att ha ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Ogiltig sträng: måste börja med "${z.prefix}"`;if(z.format==="ends_with")return`Ogiltig sträng: måste sluta med "${z.suffix}"`;if(z.format==="includes")return`Ogiltig sträng: måste innehålla "${z.includes}"`;if(z.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${z.pattern}"`;return`Ogiltig(t) ${b[z.format]??v.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${v.divisor}`;case"unrecognized_keys":return`${v.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${K(v.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${v.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${v.origin??"värdet"}`;default:return"Ogiltig input"}}};function W1(){return{localeError:vw()}}var Uw=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(v))return"அணி";if(v===null)return"வெறுமை";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"உள்ளீடு",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 தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return(v)=>{switch(v.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${v.expected}, பெறப்பட்டது ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${V(v.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${K(v.values,"|")} இல் ஒன்று`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${v.origin??"மதிப்பு"} ${z}${v.maximum.toString()} ${_.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${v.origin??"மதிப்பு"} ${z}${v.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${v.origin} ${z}${v.minimum.toString()} ${_.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${v.origin} ${z}${v.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`தவறான சரம்: "${z.prefix}" இல் தொடங்க வேண்டும்`;if(z.format==="ends_with")return`தவறான சரம்: "${z.suffix}" இல் முடிவடைய வேண்டும்`;if(z.format==="includes")return`தவறான சரம்: "${z.includes}" ஐ உள்ளடக்க வேண்டும்`;if(z.format==="regex")return`தவறான சரம்: ${z.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${b[z.format]??v.format}`}case"not_multiple_of":return`தவறான எண்: ${v.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${v.keys.length>1?"கள்":""}: ${K(v.keys,", ")}`;case"invalid_key":return`${v.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${v.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function Q1(){return{localeError:Uw()}}var rw=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(v))return"อาร์เรย์ (Array)";if(v===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return(v)=>{switch(v.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${v.expected} แต่ได้รับ ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${V(v.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"ไม่เกิน":"น้อยกว่า",_=U(v.origin);if(_)return`เกินกำหนด: ${v.origin??"ค่า"} ควรมี${z} ${v.maximum.toString()} ${_.unit??"รายการ"}`;return`เกินกำหนด: ${v.origin??"ค่า"} ควรมี${z} ${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?"อย่างน้อย":"มากกว่า",_=U(v.origin);if(_)return`น้อยกว่ากำหนด: ${v.origin} ควรมี${z} ${v.minimum.toString()} ${_.unit}`;return`น้อยกว่ากำหนด: ${v.origin} ควรมี${z} ${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${z.prefix}"`;if(z.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${z.suffix}"`;if(z.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${z.includes}" อยู่ในข้อความ`;if(z.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${z.pattern}`;return`รูปแบบไม่ถูกต้อง: ${b[z.format]??v.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${v.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${K(v.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${v.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${v.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function Y1(){return{localeError:rw()}}var bw=($)=>{let U=typeof $;switch(U){case"number":return Number.isNaN($)?"NaN":"number";case"object":{if(Array.isArray($))return"array";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return U},zw=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function U(b){return $[b]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"};return(b)=>{switch(b.code){case"invalid_type":return`Geçersiz değer: beklenen ${b.expected}, alınan ${bw(b.input)}`;case"invalid_value":if(b.values.length===1)return`Geçersiz değer: beklenen ${V(b.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${K(b.values,"|")}`;case"too_big":{let v=b.inclusive?"<=":"<",z=U(b.origin);if(z)return`Çok büyük: beklenen ${b.origin??"değer"} ${v}${b.maximum.toString()} ${z.unit??"öğe"}`;return`Çok büyük: beklenen ${b.origin??"değer"} ${v}${b.maximum.toString()}`}case"too_small":{let v=b.inclusive?">=":">",z=U(b.origin);if(z)return`Çok küçük: beklenen ${b.origin} ${v}${b.minimum.toString()} ${z.unit}`;return`Çok küçük: beklenen ${b.origin} ${v}${b.minimum.toString()}`}case"invalid_format":{let v=b;if(v.format==="starts_with")return`Geçersiz metin: "${v.prefix}" ile başlamalı`;if(v.format==="ends_with")return`Geçersiz metin: "${v.suffix}" ile bitmeli`;if(v.format==="includes")return`Geçersiz metin: "${v.includes}" içermeli`;if(v.format==="regex")return`Geçersiz metin: ${v.pattern} desenine uymalı`;return`Geçersiz ${r[v.format]??b.format}`}case"not_multiple_of":return`Geçersiz sayı: ${b.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${b.keys.length>1?"lar":""}: ${K(b.keys,", ")}`;case"invalid_key":return`${b.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${b.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function j1(){return{localeError:zw()}}var _w=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"число";case"object":{if(Array.isArray(v))return"масив";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return(v)=>{switch(v.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${v.expected}, отримано ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`Неправильні вхідні дані: очікується ${V(v.values[0])}`;return`Неправильна опція: очікується одне з ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Занадто велике: очікується, що ${v.origin??"значення"} ${_.verb} ${z}${v.maximum.toString()} ${_.unit??"елементів"}`;return`Занадто велике: очікується, що ${v.origin??"значення"} буде ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Занадто мале: очікується, що ${v.origin} ${_.verb} ${z}${v.minimum.toString()} ${_.unit}`;return`Занадто мале: очікується, що ${v.origin} буде ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Неправильний рядок: повинен починатися з "${z.prefix}"`;if(z.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${z.suffix}"`;if(z.format==="includes")return`Неправильний рядок: повинен містити "${z.includes}"`;if(z.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${z.pattern}`;return`Неправильний ${b[z.format]??v.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${v.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${v.keys.length>1?"і":""}: ${K(v.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${v.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${v.origin}`;default:return"Неправильні вхідні дані"}}};function hv(){return{localeError:_w()}}function P1(){return hv()}var Nw=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"نمبر";case"object":{if(Array.isArray(v))return"آرے";if(v===null)return"نل";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return(v)=>{switch(v.code){case"invalid_type":return`غلط ان پٹ: ${v.expected} متوقع تھا، ${r(v.input)} موصول ہوا`;case"invalid_value":if(v.values.length===1)return`غلط ان پٹ: ${V(v.values[0])} متوقع تھا`;return`غلط آپشن: ${K(v.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`بہت بڑا: ${v.origin??"ویلیو"} کے ${z}${v.maximum.toString()} ${_.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${v.origin??"ویلیو"} کا ${z}${v.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`بہت چھوٹا: ${v.origin} کے ${z}${v.minimum.toString()} ${_.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${v.origin} کا ${z}${v.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`غلط سٹرنگ: "${z.prefix}" سے شروع ہونا چاہیے`;if(z.format==="ends_with")return`غلط سٹرنگ: "${z.suffix}" پر ختم ہونا چاہیے`;if(z.format==="includes")return`غلط سٹرنگ: "${z.includes}" شامل ہونا چاہیے`;if(z.format==="regex")return`غلط سٹرنگ: پیٹرن ${z.pattern} سے میچ ہونا چاہیے`;return`غلط ${b[z.format]??v.format}`}case"not_multiple_of":return`غلط نمبر: ${v.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${v.keys.length>1?"ز":""}: ${K(v.keys,"، ")}`;case"invalid_key":return`${v.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${v.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function V1(){return{localeError:Nw()}}var Ow=()=>{let $={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"số";case"object":{if(Array.isArray(v))return"mảng";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"đầu vào",email:"địa chỉ 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ày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return(v)=>{switch(v.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${v.expected}, nhận được ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${V(v.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Quá lớn: mong đợi ${v.origin??"giá trị"} ${_.verb} ${z}${v.maximum.toString()} ${_.unit??"phần tử"}`;return`Quá lớn: mong đợi ${v.origin??"giá trị"} ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Quá nhỏ: mong đợi ${v.origin} ${_.verb} ${z}${v.minimum.toString()} ${_.unit}`;return`Quá nhỏ: mong đợi ${v.origin} ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${z.prefix}"`;if(z.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${z.suffix}"`;if(z.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${z.includes}"`;if(z.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${z.pattern}`;return`${b[z.format]??v.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${v.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${K(v.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${v.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${v.origin}`;default:return"Đầu vào không hợp lệ"}}};function q1(){return{localeError:Ow()}}var Iw=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(v))return"数组";if(v===null)return"空值(null)";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return(v)=>{switch(v.code){case"invalid_type":return`无效输入:期望 ${v.expected},实际接收 ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`无效输入:期望 ${V(v.values[0])}`;return`无效选项:期望以下之一 ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`数值过大:期望 ${v.origin??"值"} ${z}${v.maximum.toString()} ${_.unit??"个元素"}`;return`数值过大:期望 ${v.origin??"值"} ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`数值过小:期望 ${v.origin} ${z}${v.minimum.toString()} ${_.unit}`;return`数值过小:期望 ${v.origin} ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`无效字符串:必须以 "${z.prefix}" 开头`;if(z.format==="ends_with")return`无效字符串:必须以 "${z.suffix}" 结尾`;if(z.format==="includes")return`无效字符串:必须包含 "${z.includes}"`;if(z.format==="regex")return`无效字符串:必须满足正则表达式 ${z.pattern}`;return`无效${b[z.format]??v.format}`}case"not_multiple_of":return`无效数字:必须是 ${v.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${K(v.keys,", ")}`;case"invalid_key":return`${v.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${v.origin} 中包含无效值(value)`;default:return"无效输入"}}};function B1(){return{localeError:Iw()}}var kw=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"number";case"object":{if(Array.isArray(v))return"array";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"輸入",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 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return(v)=>{switch(v.code){case"invalid_type":return`無效的輸入值:預期為 ${v.expected},但收到 ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`無效的輸入值:預期為 ${V(v.values[0])}`;return`無效的選項:預期為以下其中之一 ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`數值過大:預期 ${v.origin??"值"} 應為 ${z}${v.maximum.toString()} ${_.unit??"個元素"}`;return`數值過大:預期 ${v.origin??"值"} 應為 ${z}${v.maximum.toString()}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`數值過小:預期 ${v.origin} 應為 ${z}${v.minimum.toString()} ${_.unit}`;return`數值過小:預期 ${v.origin} 應為 ${z}${v.minimum.toString()}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`無效的字串:必須以 "${z.prefix}" 開頭`;if(z.format==="ends_with")return`無效的字串:必須以 "${z.suffix}" 結尾`;if(z.format==="includes")return`無效的字串:必須包含 "${z.includes}"`;if(z.format==="regex")return`無效的字串:必須符合格式 ${z.pattern}`;return`無效的 ${b[z.format]??v.format}`}case"not_multiple_of":return`無效的數字:必須為 ${v.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${v.keys.length>1?"們":""}:${K(v.keys,"、")}`;case"invalid_key":return`${v.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${v.origin} 中有無效的值`;default:return"無效的輸入值"}}};function L1(){return{localeError:kw()}}var Jw=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function U(v){return $[v]??null}let r=(v)=>{let z=typeof v;switch(z){case"number":return Number.isNaN(v)?"NaN":"nọ́mbà";case"object":{if(Array.isArray(v))return"akopọ";if(v===null)return"null";if(Object.getPrototypeOf(v)!==Object.prototype&&v.constructor)return v.constructor.name}}return z},b={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",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:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"};return(v)=>{switch(v.code){case"invalid_type":return`Ìbáwọlé aṣìṣe: a ní láti fi ${v.expected}, àmọ̀ a rí ${r(v.input)}`;case"invalid_value":if(v.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${V(v.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${K(v.values,"|")}`;case"too_big":{let z=v.inclusive?"<=":"<",_=U(v.origin);if(_)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${v.origin??"iye"} ${_.verb} ${z}${v.maximum} ${_.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${z}${v.maximum}`}case"too_small":{let z=v.inclusive?">=":">",_=U(v.origin);if(_)return`Kéré ju: a ní láti jẹ́ pé ${v.origin} ${_.verb} ${z}${v.minimum} ${_.unit}`;return`Kéré ju: a ní láti jẹ́ ${z}${v.minimum}`}case"invalid_format":{let z=v;if(z.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${z.prefix}"`;if(z.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${z.suffix}"`;if(z.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${z.includes}"`;if(z.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${z.pattern}`;return`Aṣìṣe: ${b[z.format]??v.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${v.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${K(v.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${v.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${v.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function H1(){return{localeError:Jw()}}var E1=Symbol("ZodOutput"),A1=Symbol("ZodInput");class yv{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...U){let r=U[0];if(this._map.set($,r),r&&typeof r==="object"&&"id"in r){if(this._idmap.has(r.id))throw Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,$)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let U=this._map.get($);if(U&&typeof U==="object"&&"id"in U)this._idmap.delete(U.id);return this._map.delete($),this}get($){let U=$._zod.parent;if(U){let r={...this.get(U)??{}};delete r.id;let b={...r,...this._map.get($)};return Object.keys(b).length?b:void 0}return this._map.get($)}has($){return this._map.has($)}}function r6(){return new yv}var A$=r6();function G1($,U){return new $({type:"string",...q(U)})}function S1($,U){return new $({type:"string",coerce:!0,...q(U)})}function b6($,U){return new $({type:"string",format:"email",check:"string_format",abort:!1,...q(U)})}function fv($,U){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...q(U)})}function z6($,U){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...q(U)})}function _6($,U){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...q(U)})}function N6($,U){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...q(U)})}function O6($,U){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...q(U)})}function iv($,U){return new $({type:"string",format:"url",check:"string_format",abort:!1,...q(U)})}function I6($,U){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...q(U)})}function k6($,U){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...q(U)})}function J6($,U){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...q(U)})}function w6($,U){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...q(U)})}function K6($,U){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...q(U)})}function X6($,U){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...q(U)})}function W6($,U){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...q(U)})}function Q6($,U){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...q(U)})}function Y6($,U){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...q(U)})}function j6($,U){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...q(U)})}function P6($,U){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...q(U)})}function V6($,U){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...q(U)})}function q6($,U){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...q(U)})}function B6($,U){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...q(U)})}function L6($,U){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...q(U)})}var F1={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function M1($,U){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...q(U)})}function Z1($,U){return new $({type:"string",format:"date",check:"string_format",...q(U)})}function D1($,U){return new $({type:"string",format:"time",check:"string_format",precision:null,...q(U)})}function x1($,U){return new $({type:"string",format:"duration",check:"string_format",...q(U)})}function g1($,U){return new $({type:"number",checks:[],...q(U)})}function R1($,U){return new $({type:"number",coerce:!0,checks:[],...q(U)})}function m1($,U){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...q(U)})}function T1($,U){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...q(U)})}function C1($,U){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...q(U)})}function c1($,U){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...q(U)})}function u1($,U){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...q(U)})}function h1($,U){return new $({type:"boolean",...q(U)})}function n1($,U){return new $({type:"boolean",coerce:!0,...q(U)})}function y1($,U){return new $({type:"bigint",...q(U)})}function f1($,U){return new $({type:"bigint",coerce:!0,...q(U)})}function i1($,U){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...q(U)})}function l1($,U){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...q(U)})}function o1($,U){return new $({type:"symbol",...q(U)})}function d1($,U){return new $({type:"undefined",...q(U)})}function p1($,U){return new $({type:"null",...q(U)})}function t1($){return new $({type:"any"})}function e1($){return new $({type:"unknown"})}function a1($,U){return new $({type:"never",...q(U)})}function s1($,U){return new $({type:"void",...q(U)})}function $z($,U){return new $({type:"date",...q(U)})}function vz($,U){return new $({type:"date",coerce:!0,...q(U)})}function Uz($,U){return new $({type:"nan",...q(U)})}function S$($,U){return new i4({check:"less_than",...q(U),value:$,inclusive:!1})}function Q$($,U){return new i4({check:"less_than",...q(U),value:$,inclusive:!0})}function F$($,U){return new l4({check:"greater_than",...q(U),value:$,inclusive:!1})}function _$($,U){return new l4({check:"greater_than",...q(U),value:$,inclusive:!0})}function rz($){return F$(0,$)}function bz($){return S$(0,$)}function zz($){return Q$(0,$)}function _z($){return _$(0,$)}function o$($,U){return new Ir({check:"multiple_of",...q(U),value:$})}function kv($,U){return new wr({check:"max_size",...q(U),maximum:$})}function d$($,U){return new Kr({check:"min_size",...q(U),minimum:$})}function lv($,U){return new Xr({check:"size_equals",...q(U),size:$})}function Jv($,U){return new Wr({check:"max_length",...q(U),maximum:$})}function C$($,U){return new Qr({check:"min_length",...q(U),minimum:$})}function wv($,U){return new Yr({check:"length_equals",...q(U),length:$})}function ov($,U){return new jr({check:"string_format",format:"regex",...q(U),pattern:$})}function dv($){return new Pr({check:"string_format",format:"lowercase",...q($)})}function pv($){return new Vr({check:"string_format",format:"uppercase",...q($)})}function tv($,U){return new qr({check:"string_format",format:"includes",...q(U),includes:$})}function ev($,U){return new Br({check:"string_format",format:"starts_with",...q(U),prefix:$})}function av($,U){return new Lr({check:"string_format",format:"ends_with",...q(U),suffix:$})}function Nz($,U,r){return new Hr({check:"property",property:$,schema:U,...q(r)})}function sv($,U){return new Er({check:"mime_type",mime:$,...q(U)})}function M$($){return new Ar({check:"overwrite",tx:$})}function $4($){return M$((U)=>U.normalize($))}function v4(){return M$(($)=>$.trim())}function U4(){return M$(($)=>$.toLowerCase())}function r4(){return M$(($)=>$.toUpperCase())}function Oz($,U,r){return new $({type:"array",element:U,...q(r)})}function ww($,U,r){return new $({type:"union",options:U,...q(r)})}function Kw($,U,r,b){return new $({type:"union",options:r,discriminator:U,...q(b)})}function Xw($,U,r){return new $({type:"intersection",left:U,right:r})}function Ww($,U,r,b){let v=r instanceof A;return new $({type:"tuple",items:U,rest:v?r:null,...q(v?b:r)})}function Qw($,U,r,b){return new $({type:"record",keyType:U,valueType:r,...q(b)})}function Yw($,U,r,b){return new $({type:"map",keyType:U,valueType:r,...q(b)})}function jw($,U,r){return new $({type:"set",valueType:U,...q(r)})}function Pw($,U,r){let b=Array.isArray(U)?Object.fromEntries(U.map((v)=>[v,v])):U;return new $({type:"enum",entries:b,...q(r)})}function Vw($,U,r){return new $({type:"enum",entries:U,...q(r)})}function qw($,U,r){return new $({type:"literal",values:Array.isArray(U)?U:[U],...q(r)})}function Iz($,U){return new $({type:"file",...q(U)})}function Bw($,U){return new $({type:"transform",transform:U})}function Lw($,U){return new $({type:"optional",innerType:U})}function Hw($,U){return new $({type:"nullable",innerType:U})}function Ew($,U,r){return new $({type:"default",innerType:U,get defaultValue(){return typeof r==="function"?r():EU(r)}})}function Aw($,U,r){return new $({type:"nonoptional",innerType:U,...q(r)})}function Gw($,U){return new $({type:"success",innerType:U})}function Sw($,U,r){return new $({type:"catch",innerType:U,catchValue:typeof r==="function"?r:()=>r})}function Fw($,U,r){return new $({type:"pipe",in:U,out:r})}function Mw($,U){return new $({type:"readonly",innerType:U})}function Zw($,U,r){return new $({type:"template_literal",parts:U,...q(r)})}function Dw($,U){return new $({type:"lazy",getter:U})}function xw($,U){return new $({type:"promise",innerType:U})}function kz($,U,r){let b=q(r);return b.abort??(b.abort=!0),new $({type:"custom",check:"custom",fn:U,...b})}function Jz($,U,r){return new $({type:"custom",check:"custom",fn:U,...q(r)})}function wz($){let U=EO((r)=>{return r.addIssue=(b)=>{if(typeof b==="string")r.issues.push(bv(b,r.value,U._zod.def));else{let v=b;if(v.fatal)v.continue=!1;v.code??(v.code="custom"),v.input??(v.input=r.value),v.inst??(v.inst=U),v.continue??(v.continue=!U._zod.def.abort),r.issues.push(bv(v))}},$(r.value,r)});return U}function EO($,U){let r=new y({check:"custom",...q(U)});return r._zod.check=$,r}function Kz($,U){let r=q(U),b=r.truthy??["true","1","yes","on","y","enabled"],v=r.falsy??["false","0","no","off","n","disabled"];if(r.case!=="sensitive")b=b.map((w)=>typeof w==="string"?w.toLowerCase():w),v=v.map((w)=>typeof w==="string"?w.toLowerCase():w);let z=new Set(b),_=new Set(v),N=$.Codec??mv,O=$.Boolean??Rv,k=new($.String??l$)({type:"string",error:r.error}),W=new O({type:"boolean",error:r.error}),X=new N({type:"pipe",in:k,out:W,transform:(w,j)=>{let B=w;if(r.case!=="sensitive")B=B.toLowerCase();if(z.has(B))return!0;else if(_.has(B))return!1;else return j.issues.push({code:"invalid_value",expected:"stringbool",values:[...z,..._],input:j.value,inst:X,continue:!1}),{}},reverseTransform:(w,j)=>{if(w===!0)return b[0]||"true";else return v[0]||"false"},error:r.error});return X}function Kv($,U,r,b={}){let v=q(b),z={...q(b),check:"string_format",type:"string",format:U,fn:typeof r==="function"?r:(N)=>r.test(N),...v};if(r instanceof RegExp)z.pattern=r;return new $(z)}class H6{constructor($){this.counter=0,this.metadataRegistry=$?.metadata??A$,this.target=$?.target??"draft-2020-12",this.unrepresentable=$?.unrepresentable??"throw",this.override=$?.override??(()=>{}),this.io=$?.io??"output",this.seen=new Map}process($,U={path:[],schemaPath:[]}){var r;let b=$._zod.def,v={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},z=this.seen.get($);if(z){if(z.count++,U.schemaPath.includes($))z.cycle=U.path;return z.schema}let _={schema:{},count:1,cycle:void 0,path:U.path};this.seen.set($,_);let N=$._zod.toJSONSchema?.();if(N)_.schema=N;else{let k={...U,schemaPath:[...U.schemaPath,$],path:U.path},W=$._zod.parent;if(W)_.ref=W,this.process(W,k),this.seen.get(W).isParent=!0;else{let X=_.schema;switch(b.type){case"string":{let w=X;w.type="string";let{minimum:j,maximum:B,format:D,patterns:x,contentEncoding:u}=$._zod.bag;if(typeof j==="number")w.minLength=j;if(typeof B==="number")w.maxLength=B;if(D){if(w.format=v[D]??D,w.format==="")delete w.format}if(u)w.contentEncoding=u;if(x&&x.size>0){let m=[...x];if(m.length===1)w.pattern=m[0].source;else if(m.length>1)_.schema.allOf=[...m.map((d)=>({...this.target==="draft-7"||this.target==="draft-4"||this.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))]}break}case"number":{let w=X,{minimum:j,maximum:B,format:D,multipleOf:x,exclusiveMaximum:u,exclusiveMinimum:m}=$._zod.bag;if(typeof D==="string"&&D.includes("int"))w.type="integer";else w.type="number";if(typeof m==="number")if(this.target==="draft-4"||this.target==="openapi-3.0")w.minimum=m,w.exclusiveMinimum=!0;else w.exclusiveMinimum=m;if(typeof j==="number"){if(w.minimum=j,typeof m==="number"&&this.target!=="draft-4")if(m>=j)delete w.minimum;else delete w.exclusiveMinimum}if(typeof u==="number")if(this.target==="draft-4"||this.target==="openapi-3.0")w.maximum=u,w.exclusiveMaximum=!0;else w.exclusiveMaximum=u;if(typeof B==="number"){if(w.maximum=B,typeof u==="number"&&this.target!=="draft-4")if(u<=B)delete w.maximum;else delete w.exclusiveMaximum}if(typeof x==="number")w.multipleOf=x;break}case"boolean":{let w=X;w.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{if(this.target==="openapi-3.0")X.type="string",X.nullable=!0,X.enum=[null];else X.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"never":{X.not={};break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let w=X,{minimum:j,maximum:B}=$._zod.bag;if(typeof j==="number")w.minItems=j;if(typeof B==="number")w.maxItems=B;w.type="array",w.items=this.process(b.element,{...k,path:[...k.path,"items"]});break}case"object":{let w=X;w.type="object",w.properties={};let j=b.shape;for(let x in j)w.properties[x]=this.process(j[x],{...k,path:[...k.path,"properties",x]});let B=new Set(Object.keys(j)),D=new Set([...B].filter((x)=>{let u=b.shape[x]._zod;if(this.io==="input")return u.optin===void 0;else return u.optout===void 0}));if(D.size>0)w.required=Array.from(D);if(b.catchall?._zod.def.type==="never")w.additionalProperties=!1;else if(!b.catchall){if(this.io==="output")w.additionalProperties=!1}else if(b.catchall)w.additionalProperties=this.process(b.catchall,{...k,path:[...k.path,"additionalProperties"]});break}case"union":{let w=X,j=b.options.map((B,D)=>this.process(B,{...k,path:[...k.path,"anyOf",D]}));w.anyOf=j;break}case"intersection":{let w=X,j=this.process(b.left,{...k,path:[...k.path,"allOf",0]}),B=this.process(b.right,{...k,path:[...k.path,"allOf",1]}),D=(u)=>("allOf"in u)&&Object.keys(u).length===1,x=[...D(j)?j.allOf:[j],...D(B)?B.allOf:[B]];w.allOf=x;break}case"tuple":{let w=X;w.type="array";let j=this.target==="draft-2020-12"?"prefixItems":"items",B=this.target==="draft-2020-12"?"items":this.target==="openapi-3.0"?"items":"additionalItems",D=b.items.map((d,X$)=>this.process(d,{...k,path:[...k.path,j,X$]})),x=b.rest?this.process(b.rest,{...k,path:[...k.path,B,...this.target==="openapi-3.0"?[b.items.length]:[]]}):null;if(this.target==="draft-2020-12"){if(w.prefixItems=D,x)w.items=x}else if(this.target==="openapi-3.0"){if(w.items={anyOf:D},x)w.items.anyOf.push(x);if(w.minItems=D.length,!x)w.maxItems=D.length}else if(w.items=D,x)w.additionalItems=x;let{minimum:u,maximum:m}=$._zod.bag;if(typeof u==="number")w.minItems=u;if(typeof m==="number")w.maxItems=m;break}case"record":{let w=X;if(w.type="object",this.target==="draft-7"||this.target==="draft-2020-12")w.propertyNames=this.process(b.keyType,{...k,path:[...k.path,"propertyNames"]});w.additionalProperties=this.process(b.valueType,{...k,path:[...k.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let w=X,j=Ev(b.entries);if(j.every((B)=>typeof B==="number"))w.type="number";if(j.every((B)=>typeof B==="string"))w.type="string";w.enum=j;break}case"literal":{let w=X,j=[];for(let B of b.values)if(B===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof B==="bigint")if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else j.push(Number(B));else j.push(B);if(j.length===0);else if(j.length===1){let B=j[0];if(w.type=B===null?"null":typeof B,this.target==="draft-4"||this.target==="openapi-3.0")w.enum=[B];else w.const=B}else{if(j.every((B)=>typeof B==="number"))w.type="number";if(j.every((B)=>typeof B==="string"))w.type="string";if(j.every((B)=>typeof B==="boolean"))w.type="string";if(j.every((B)=>B===null))w.type="null";w.enum=j}break}case"file":{let w=X,j={type:"string",format:"binary",contentEncoding:"binary"},{minimum:B,maximum:D,mime:x}=$._zod.bag;if(B!==void 0)j.minLength=B;if(D!==void 0)j.maxLength=D;if(x)if(x.length===1)j.contentMediaType=x[0],Object.assign(w,j);else w.anyOf=x.map((u)=>{return{...j,contentMediaType:u}});else Object.assign(w,j);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let w=this.process(b.innerType,k);if(this.target==="openapi-3.0")_.ref=b.innerType,X.nullable=!0;else X.anyOf=[w,{type:"null"}];break}case"nonoptional":{this.process(b.innerType,k),_.ref=b.innerType;break}case"success":{let w=X;w.type="boolean";break}case"default":{this.process(b.innerType,k),_.ref=b.innerType,X.default=JSON.parse(JSON.stringify(b.defaultValue));break}case"prefault":{if(this.process(b.innerType,k),_.ref=b.innerType,this.io==="input")X._prefault=JSON.parse(JSON.stringify(b.defaultValue));break}case"catch":{this.process(b.innerType,k),_.ref=b.innerType;let w;try{w=b.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}X.default=w;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let w=X,j=$._zod.pattern;if(!j)throw Error("Pattern not found in template literal");w.type="string",w.pattern=j.source;break}case"pipe":{let w=this.io==="input"?b.in._zod.def.type==="transform"?b.out:b.in:b.out;this.process(w,k),_.ref=w;break}case"readonly":{this.process(b.innerType,k),_.ref=b.innerType,X.readOnly=!0;break}case"promise":{this.process(b.innerType,k),_.ref=b.innerType;break}case"optional":{this.process(b.innerType,k),_.ref=b.innerType;break}case"lazy":{let w=$._zod.innerType;this.process(w,k),_.ref=w;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}case"function":{if(this.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema");break}default:}}}let O=this.metadataRegistry.get($);if(O)Object.assign(_.schema,O);if(this.io==="input"&&e($))delete _.schema.examples,delete _.schema.default;if(this.io==="input"&&_.schema._prefault)(r=_.schema).default??(r.default=_.schema._prefault);return delete _.schema._prefault,this.seen.get($).schema}emit($,U){let r={cycles:U?.cycles??"ref",reused:U?.reused??"inline",external:U?.external??void 0},b=this.seen.get($);if(!b)throw Error("Unprocessed schema. This is a bug in Zod.");let v=(I)=>{let k=this.target==="draft-2020-12"?"$defs":"definitions";if(r.external){let j=r.external.registry.get(I[0])?.id,B=r.external.uri??((x)=>x);if(j)return{ref:B(j)};let D=I[1].defId??I[1].schema.id??`schema${this.counter++}`;return I[1].defId=D,{defId:D,ref:`${B("__shared")}#/${k}/${D}`}}if(I[1]===b)return{ref:"#"};let X=`${"#"}/${k}/`,w=I[1].schema.id??`__schema${this.counter++}`;return{defId:w,ref:X+w}},z=(I)=>{if(I[1].schema.$ref)return;let k=I[1],{ref:W,defId:X}=v(I);if(k.def={...k.schema},X)k.defId=X;let w=k.schema;for(let j in w)delete w[j];w.$ref=W};if(r.cycles==="throw")for(let I of this.seen.entries()){let k=I[1];if(k.cycle)throw Error(`Cycle detected: #/${k.cycle?.join("/")}/<root>
|
|
133
|
+
`)}u.write("payload.value = newResult;"),u.write("return payload;");let G=u.compile();return(N,X)=>G(h,N,X)},i,a=Je,s=!Dt.jitless,l=s&&Ro.value,d=r.catchall,v;e._zod.parse=(h,u)=>{v??(v=o.value);let y=h.value;if(!a(y))return h.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),h;if(s&&l&&u?.async===!1&&u.jitless!==!0){if(!i)i=t(r.shape);if(h=i(h,u),!d)return h;return Cd([],y,h,u,v,e)}return n(h,u)}});function _d(e,r,n,o){for(let i of e)if(i.issues.length===0)return r.value=i.value,r;let t=e.filter((i)=>!Ne(i));if(t.length===1)return r.value=t[0].value,t[0];return r.issues.push({code:"invalid_union",input:r.value,inst:n,errors:e.map((i)=>i.issues.map((a)=>ge(a,o,q())))}),r}var dn=m("$ZodUnion",(e,r)=>{D.init(e,r),E(e._zod,"optin",()=>r.options.some((t)=>t._zod.optin==="optional")?"optional":void 0),E(e._zod,"optout",()=>r.options.some((t)=>t._zod.optout==="optional")?"optional":void 0),E(e._zod,"values",()=>{if(r.options.every((t)=>t._zod.values))return new Set(r.options.flatMap((t)=>Array.from(t._zod.values)));return}),E(e._zod,"pattern",()=>{if(r.options.every((t)=>t._zod.pattern)){let t=r.options.map((i)=>i._zod.pattern);return new RegExp(`^(${t.map((i)=>Ct(i.source)).join("|")})$`)}return});let n=r.options.length===1,o=r.options[0]._zod.run;e._zod.parse=(t,i)=>{if(n)return o(t,i);let a=!1,s=[];for(let c of r.options){let l=c._zod.run({value:t.value,issues:[]},i);if(l instanceof Promise)s.push(l),a=!0;else{if(l.issues.length===0)return l;s.push(l)}}if(!a)return _d(s,t,e,i);return Promise.all(s).then((c)=>_d(c,t,e,i))}}),Sa=m("$ZodDiscriminatedUnion",(e,r)=>{dn.init(e,r);let n=e._zod.parse;E(e._zod,"propValues",()=>{let t={};for(let i of r.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw Error(`Invalid discriminated union option at index "${r.options.indexOf(i)}"`);for(let[s,c]of Object.entries(a)){if(!t[s])t[s]=new Set;for(let l of c)t[s].add(l)}}return t});let o=at(()=>{let t=r.options,i=new Map;for(let a of t){let s=a._zod.propValues?.[r.discriminator];if(!s||s.size===0)throw Error(`Invalid discriminated union option at index "${r.options.indexOf(a)}"`);for(let c of s){if(i.has(c))throw Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,a)}}return i});e._zod.parse=(t,i)=>{let a=t.value;if(!Je(a))return t.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),t;let s=o.value.get(a?.[r.discriminator]);if(s)return s._zod.run(t,i);if(r.unionFallback)return n(t,i);return t.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:r.discriminator,input:a,path:[r.discriminator],inst:e}),t}}),Ia=m("$ZodIntersection",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>{let t=n.value,i=r.left._zod.run({value:t,issues:[]},o),a=r.right._zod.run({value:t,issues:[]},o);if(i instanceof Promise||a instanceof Promise)return Promise.all([i,a]).then(([c,l])=>kd(n,c,l));return kd(n,i,a)}});function Zi(e,r){if(e===r)return{valid:!0,data:e};if(e instanceof Date&&r instanceof Date&&+e===+r)return{valid:!0,data:e};if(Re(e)&&Re(r)){let n=Object.keys(r),o=Object.keys(e).filter((i)=>n.indexOf(i)!==-1),t={...e,...r};for(let i of o){let a=Zi(e[i],r[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};t[i]=a.data}return{valid:!0,data:t}}if(Array.isArray(e)&&Array.isArray(r)){if(e.length!==r.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let o=0;o<e.length;o++){let t=e[o],i=r[o],a=Zi(t,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function kd(e,r,n){if(r.issues.length)e.issues.push(...r.issues);if(n.issues.length)e.issues.push(...n.issues);if(Ne(e))return e;let o=Zi(r.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var mn=m("$ZodTuple",(e,r)=>{D.init(e,r);let n=r.items,o=n.length-[...n].reverse().findIndex((t)=>t._zod.optin!=="optional");e._zod.parse=(t,i)=>{let a=t.value;if(!Array.isArray(a))return t.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),t;t.value=[];let s=[];if(!r.rest){let l=a.length>n.length,d=a.length<o-1;if(l||d)return t.issues.push({...l?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},input:a,inst:e,origin:"array"}),t}let c=-1;for(let l of n){if(c++,c>=a.length){if(c>=o)continue}let d=l._zod.run({value:a[c],issues:[]},i);if(d instanceof Promise)s.push(d.then((v)=>nn(v,t,c)));else nn(d,t,c)}if(r.rest){let l=a.slice(n.length);for(let d of l){c++;let v=r.rest._zod.run({value:d,issues:[]},i);if(v instanceof Promise)s.push(v.then((h)=>nn(h,t,c)));else nn(v,t,c)}}if(s.length)return Promise.all(s).then(()=>t);return t}});function nn(e,r,n){if(e.issues.length)r.issues.push(...fe(n,e.issues));r.value[n]=e.value}var Ta=m("$ZodRecord",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>{let t=n.value;if(!Re(t))return n.issues.push({expected:"record",code:"invalid_type",input:t,inst:e}),n;let i=[];if(r.keyType._zod.values){let a=r.keyType._zod.values;n.value={};for(let c of a)if(typeof c==="string"||typeof c==="number"||typeof c==="symbol"){let l=r.valueType._zod.run({value:t[c],issues:[]},o);if(l instanceof Promise)i.push(l.then((d)=>{if(d.issues.length)n.issues.push(...fe(c,d.issues));n.value[c]=d.value}));else{if(l.issues.length)n.issues.push(...fe(c,l.issues));n.value[c]=l.value}}let s;for(let c in t)if(!a.has(c))s=s??[],s.push(c);if(s&&s.length>0)n.issues.push({code:"unrecognized_keys",input:t,inst:e,keys:s})}else{n.value={};for(let a of Reflect.ownKeys(t)){if(a==="__proto__")continue;let s=r.keyType._zod.run({value:a,issues:[]},o);if(s instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(s.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:s.issues.map((l)=>ge(l,o,q())),input:a,path:[a],inst:e}),n.value[s.value]=s.value;continue}let c=r.valueType._zod.run({value:t[a],issues:[]},o);if(c instanceof Promise)i.push(c.then((l)=>{if(l.issues.length)n.issues.push(...fe(a,l.issues));n.value[s.value]=l.value}));else{if(c.issues.length)n.issues.push(...fe(a,c.issues));n.value[s.value]=c.value}}}if(i.length)return Promise.all(i).then(()=>n);return n}}),Oa=m("$ZodMap",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>{let t=n.value;if(!(t instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:t,inst:e}),n;let i=[];n.value=new Map;for(let[a,s]of t){let c=r.keyType._zod.run({value:a,issues:[]},o),l=r.valueType._zod.run({value:s,issues:[]},o);if(c instanceof Promise||l instanceof Promise)i.push(Promise.all([c,l]).then(([d,v])=>{$d(d,v,n,a,t,e,o)}));else $d(c,l,n,a,t,e,o)}if(i.length)return Promise.all(i).then(()=>n);return n}});function $d(e,r,n,o,t,i,a){if(e.issues.length)if(Et.has(typeof o))n.issues.push(...fe(o,e.issues));else n.issues.push({code:"invalid_key",origin:"map",input:t,inst:i,issues:e.issues.map((s)=>ge(s,a,q()))});if(r.issues.length)if(Et.has(typeof o))n.issues.push(...fe(o,r.issues));else n.issues.push({origin:"map",code:"invalid_element",input:t,inst:i,key:o,issues:r.issues.map((s)=>ge(s,a,q()))});n.value.set(e.value,r.value)}var Da=m("$ZodSet",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>{let t=n.value;if(!(t instanceof Set))return n.issues.push({input:t,inst:e,expected:"set",code:"invalid_type"}),n;let i=[];n.value=new Set;for(let a of t){let s=r.valueType._zod.run({value:a,issues:[]},o);if(s instanceof Promise)i.push(s.then((c)=>xd(c,n)));else xd(s,n)}if(i.length)return Promise.all(i).then(()=>n);return n}});function xd(e,r){if(e.issues.length)r.issues.push(...e.issues);r.value.add(e.value)}var Pa=m("$ZodEnum",(e,r)=>{D.init(e,r);let n=zt(r.entries),o=new Set(n);e._zod.values=o,e._zod.pattern=new RegExp(`^(${n.filter((t)=>Et.has(typeof t)).map((t)=>typeof t==="string"?Te(t):t.toString()).join("|")})$`),e._zod.parse=(t,i)=>{let a=t.value;if(o.has(a))return t;return t.issues.push({code:"invalid_value",values:n,input:a,inst:e}),t}}),za=m("$ZodLiteral",(e,r)=>{if(D.init(e,r),r.values.length===0)throw Error("Cannot create literal schema with no valid values");e._zod.values=new Set(r.values),e._zod.pattern=new RegExp(`^(${r.values.map((n)=>typeof n==="string"?Te(n):n?Te(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let t=n.value;if(e._zod.values.has(t))return n;return n.issues.push({code:"invalid_value",values:r.values,input:t,inst:e}),n}}),Ca=m("$ZodFile",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>{let t=n.value;if(t instanceof File)return n;return n.issues.push({expected:"file",code:"invalid_type",input:t,inst:e}),n}}),Ea=m("$ZodTransform",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new He(e.constructor.name);let t=r.transform(n.value,n);if(o.async)return(t instanceof Promise?t:Promise.resolve(t)).then((a)=>(n.value=a,n));if(t instanceof Promise)throw new Ie;return n.value=t,n}});function wd(e,r){if(e.issues.length&&r===void 0)return{issues:[],value:void 0};return e}var ja=m("$ZodOptional",(e,r)=>{D.init(e,r),e._zod.optin="optional",e._zod.optout="optional",E(e._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,void 0]):void 0),E(e._zod,"pattern",()=>{let n=r.innerType._zod.pattern;return n?new RegExp(`^(${Ct(n.source)})?$`):void 0}),e._zod.parse=(n,o)=>{if(r.innerType._zod.optin==="optional"){let t=r.innerType._zod.run(n,o);if(t instanceof Promise)return t.then((i)=>wd(i,n.value));return wd(t,n.value)}if(n.value===void 0)return n;return r.innerType._zod.run(n,o)}}),Aa=m("$ZodNullable",(e,r)=>{D.init(e,r),E(e._zod,"optin",()=>r.innerType._zod.optin),E(e._zod,"optout",()=>r.innerType._zod.optout),E(e._zod,"pattern",()=>{let n=r.innerType._zod.pattern;return n?new RegExp(`^(${Ct(n.source)}|null)$`):void 0}),E(e._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,null]):void 0),e._zod.parse=(n,o)=>{if(n.value===null)return n;return r.innerType._zod.run(n,o)}}),Ma=m("$ZodDefault",(e,r)=>{D.init(e,r),e._zod.optin="optional",E(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return r.innerType._zod.run(n,o);if(n.value===void 0)return n.value=r.defaultValue,n;let t=r.innerType._zod.run(n,o);if(t instanceof Promise)return t.then((i)=>Sd(i,r));return Sd(t,r)}});function Sd(e,r){if(e.value===void 0)e.value=r.defaultValue;return e}var Ra=m("$ZodPrefault",(e,r)=>{D.init(e,r),e._zod.optin="optional",E(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return r.innerType._zod.run(n,o);if(n.value===void 0)n.value=r.defaultValue;return r.innerType._zod.run(n,o)}}),Na=m("$ZodNonOptional",(e,r)=>{D.init(e,r),E(e._zod,"values",()=>{let n=r.innerType._zod.values;return n?new Set([...n].filter((o)=>o!==void 0)):void 0}),e._zod.parse=(n,o)=>{let t=r.innerType._zod.run(n,o);if(t instanceof Promise)return t.then((i)=>Id(i,e));return Id(t,e)}});function Id(e,r){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:r});return e}var Ua=m("$ZodSuccess",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new He("ZodSuccess");let t=r.innerType._zod.run(n,o);if(t instanceof Promise)return t.then((i)=>(n.value=i.issues.length===0,n));return n.value=t.issues.length===0,n}}),La=m("$ZodCatch",(e,r)=>{D.init(e,r),E(e._zod,"optin",()=>r.innerType._zod.optin),E(e._zod,"optout",()=>r.innerType._zod.optout),E(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return r.innerType._zod.run(n,o);let t=r.innerType._zod.run(n,o);if(t instanceof Promise)return t.then((i)=>{if(n.value=i.value,i.issues.length)n.value=r.catchValue({...n,error:{issues:i.issues.map((a)=>ge(a,o,q()))},input:n.value}),n.issues=[];return n});if(n.value=t.value,t.issues.length)n.value=r.catchValue({...n,error:{issues:t.issues.map((i)=>ge(i,o,q()))},input:n.value}),n.issues=[];return n}}),Za=m("$ZodNaN",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>{if(typeof n.value!=="number"||!Number.isNaN(n.value))return n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n;return n}}),Fa=m("$ZodPipe",(e,r)=>{D.init(e,r),E(e._zod,"values",()=>r.in._zod.values),E(e._zod,"optin",()=>r.in._zod.optin),E(e._zod,"optout",()=>r.out._zod.optout),E(e._zod,"propValues",()=>r.in._zod.propValues),e._zod.parse=(n,o)=>{if(o.direction==="backward"){let i=r.out._zod.run(n,o);if(i instanceof Promise)return i.then((a)=>on(a,r.in,o));return on(i,r.in,o)}let t=r.in._zod.run(n,o);if(t instanceof Promise)return t.then((i)=>on(i,r.out,o));return on(t,r.out,o)}});function on(e,r,n){if(e.issues.length)return e.aborted=!0,e;return r._zod.run({value:e.value,issues:e.issues},n)}var Ft=m("$ZodCodec",(e,r)=>{D.init(e,r),E(e._zod,"values",()=>r.in._zod.values),E(e._zod,"optin",()=>r.in._zod.optin),E(e._zod,"optout",()=>r.out._zod.optout),E(e._zod,"propValues",()=>r.in._zod.propValues),e._zod.parse=(n,o)=>{if((o.direction||"forward")==="forward"){let i=r.in._zod.run(n,o);if(i instanceof Promise)return i.then((a)=>an(a,r,o));return an(i,r,o)}else{let i=r.out._zod.run(n,o);if(i instanceof Promise)return i.then((a)=>an(a,r,o));return an(i,r,o)}}});function an(e,r,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){let t=r.transform(e.value,e);if(t instanceof Promise)return t.then((i)=>sn(e,i,r.out,n));return sn(e,t,r.out,n)}else{let t=r.reverseTransform(e.value,e);if(t instanceof Promise)return t.then((i)=>sn(e,i,r.in,n));return sn(e,t,r.in,n)}}function sn(e,r,n,o){if(e.issues.length)return e.aborted=!0,e;return n._zod.run({value:r,issues:e.issues},o)}var Ga=m("$ZodReadonly",(e,r)=>{D.init(e,r),E(e._zod,"propValues",()=>r.innerType._zod.propValues),E(e._zod,"values",()=>r.innerType._zod.values),E(e._zod,"optin",()=>r.innerType._zod.optin),E(e._zod,"optout",()=>r.innerType._zod.optout),e._zod.parse=(n,o)=>{if(o.direction==="backward")return r.innerType._zod.run(n,o);let t=r.innerType._zod.run(n,o);if(t instanceof Promise)return t.then(Td);return Td(t)}});function Td(e){return e.value=Object.freeze(e.value),e}var Va=m("$ZodTemplateLiteral",(e,r)=>{D.init(e,r);let n=[];for(let o of r.parts)if(typeof o==="object"&&o!==null){if(!o._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let t=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${o._zod.traits}`);let i=t.startsWith("^")?1:0,a=t.endsWith("$")?t.length-1:t.length;n.push(t.slice(i,a))}else if(o===null||Uo.has(typeof o))n.push(Te(`${o}`));else throw Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(o,t)=>{if(typeof o.value!=="string")return o.issues.push({input:o.value,inst:e,expected:"template_literal",code:"invalid_type"}),o;if(e._zod.pattern.lastIndex=0,!e._zod.pattern.test(o.value))return o.issues.push({input:o.value,inst:e,code:"invalid_format",format:r.format??"template_literal",pattern:e._zod.pattern.source}),o;return o}}),Wa=m("$ZodFunction",(e,r)=>(D.init(e,r),e._def=r,e._zod.def=r,e.implement=(n)=>{if(typeof n!=="function")throw Error("implement() must be called with a function");return function(...o){let t=e._def.input?Gr(e._def.input,o):o,i=Reflect.apply(n,this,t);if(e._def.output)return Gr(e._def.output,i);return i}},e.implementAsync=(n)=>{if(typeof n!=="function")throw Error("implementAsync() must be called with a function");return async function(...o){let t=e._def.input?await Vr(e._def.input,o):o,i=await Reflect.apply(n,this,t);if(e._def.output)return await Vr(e._def.output,i);return i}},e._zod.parse=(n,o)=>{if(typeof n.value!=="function")return n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n;if(e._def.output&&e._def.output._zod.def.type==="promise")n.value=e.implementAsync(n.value);else n.value=e.implement(n.value);return n},e.input=(...n)=>{let o=e.constructor;if(Array.isArray(n[0]))return new o({type:"function",input:new mn({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output});return new o({type:"function",input:n[0],output:e._def.output})},e.output=(n)=>new e.constructor({type:"function",input:e._def.input,output:n}),e)),Ba=m("$ZodPromise",(e,r)=>{D.init(e,r),e._zod.parse=(n,o)=>Promise.resolve(n.value).then((t)=>r.innerType._zod.run({value:t,issues:[]},o))}),Ha=m("$ZodLazy",(e,r)=>{D.init(e,r),E(e._zod,"innerType",()=>r.getter()),E(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),E(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),E(e._zod,"optin",()=>e._zod.innerType._zod.optin??void 0),E(e._zod,"optout",()=>e._zod.innerType._zod.optout??void 0),e._zod.parse=(n,o)=>e._zod.innerType._zod.run(n,o)}),Ja=m("$ZodCustom",(e,r)=>{W.init(e,r),D.init(e,r),e._zod.parse=(n,o)=>n,e._zod.check=(n)=>{let o=n.value,t=r.fn(o);if(t instanceof Promise)return t.then((i)=>Od(i,n,o,e));Od(t,n,o,e);return}});function Od(e,r,n,o){if(!e){let t={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};if(o._zod.def.params)t.params=o._zod.def.params;r.issues.push(st(t))}}var Jt={};me(Jt,{ar:()=>qa,az:()=>Ka,be:()=>Xa,ca:()=>Ya,cs:()=>Qa,da:()=>es,de:()=>ts,en:()=>Gt,eo:()=>rs,es:()=>ns,fa:()=>os,fi:()=>is,fr:()=>as,frCA:()=>ss,he:()=>cs,hu:()=>ls,id:()=>us,is:()=>ds,it:()=>ms,ja:()=>ps,ka:()=>fs,kh:()=>gs,km:()=>Vt,ko:()=>hs,lt:()=>vs,mk:()=>ys,ms:()=>bs,nl:()=>_s,no:()=>ks,ota:()=>$s,pl:()=>ws,ps:()=>xs,pt:()=>Ss,ru:()=>Is,sl:()=>Ts,sv:()=>Os,ta:()=>Ds,th:()=>Ps,tr:()=>zs,ua:()=>Cs,uk:()=>Ht,ur:()=>Es,vi:()=>js,yo:()=>Rs,zhCN:()=>As,zhTW:()=>Ms});var zh=()=>{let e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return(t)=>{switch(t.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${t.expected}، ولكن تم إدخال ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${_(t.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return` أكبر من اللازم: يفترض أن تكون ${t.origin??"القيمة"} ${i} ${t.maximum.toString()} ${a.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${t.origin??"القيمة"} ${i} ${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`أصغر من اللازم: يفترض لـ ${t.origin} أن يكون ${i} ${t.minimum.toString()} ${a.unit}`;return`أصغر من اللازم: يفترض لـ ${t.origin} أن يكون ${i} ${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${t.prefix}"`;if(i.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${i.suffix}"`;if(i.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${i.includes}"`;if(i.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${i.pattern}`;return`${o[i.format]??t.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${t.divisor}`;case"unrecognized_keys":return`معرف${t.keys.length>1?"ات":""} غريب${t.keys.length>1?"ة":""}: ${p(t.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${t.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${t.origin}`;default:return"مدخل غير مقبول"}}};function qa(){return{localeError:zh()}}var Ch=()=>{let e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={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"};return(t)=>{switch(t.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${t.expected}, daxil olan ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Yanlış dəyər: gözlənilən ${_(t.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Çox böyük: gözlənilən ${t.origin??"dəyər"} ${i}${t.maximum.toString()} ${a.unit??"element"}`;return`Çox böyük: gözlənilən ${t.origin??"dəyər"} ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Çox kiçik: gözlənilən ${t.origin} ${i}${t.minimum.toString()} ${a.unit}`;return`Çox kiçik: gözlənilən ${t.origin} ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Yanlış mətn: "${i.prefix}" ilə başlamalıdır`;if(i.format==="ends_with")return`Yanlış mətn: "${i.suffix}" ilə bitməlidir`;if(i.format==="includes")return`Yanlış mətn: "${i.includes}" daxil olmalıdır`;if(i.format==="regex")return`Yanlış mətn: ${i.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${o[i.format]??t.format}`}case"not_multiple_of":return`Yanlış ədəd: ${t.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${t.keys.length>1?"lar":""}: ${p(t.keys,", ")}`;case"invalid_key":return`${t.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${t.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function Ka(){return{localeError:Ch()}}function jd(e,r,n,o){let t=Math.abs(e),i=t%10,a=t%100;if(a>=11&&a<=19)return o;if(i===1)return r;if(i>=2&&i<=4)return n;return o}var Eh=()=>{let e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"лік";case"object":{if(Array.isArray(t))return"масіў";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return(t)=>{switch(t.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${t.expected}, атрымана ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Няправільны ўвод: чакалася ${_(t.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a){let s=Number(t.maximum),c=jd(s,a.unit.one,a.unit.few,a.unit.many);return`Занадта вялікі: чакалася, што ${t.origin??"значэнне"} павінна ${a.verb} ${i}${t.maximum.toString()} ${c}`}return`Занадта вялікі: чакалася, што ${t.origin??"значэнне"} павінна быць ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a){let s=Number(t.minimum),c=jd(s,a.unit.one,a.unit.few,a.unit.many);return`Занадта малы: чакалася, што ${t.origin} павінна ${a.verb} ${i}${t.minimum.toString()} ${c}`}return`Занадта малы: чакалася, што ${t.origin} павінна быць ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${i.prefix}"`;if(i.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${i.suffix}"`;if(i.format==="includes")return`Няправільны радок: павінен змяшчаць "${i.includes}"`;if(i.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${i.pattern}`;return`Няправільны ${o[i.format]??t.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${t.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${t.keys.length>1?"ключы":"ключ"}: ${p(t.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${t.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${t.origin}`;default:return"Няправільны ўвод"}}};function Xa(){return{localeError:Eh()}}var jh=()=>{let e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"entrada",email:"adreça electrònica",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ça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(t)=>{switch(t.code){case"invalid_type":return`Tipus invàlid: s'esperava ${t.expected}, s'ha rebut ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Valor invàlid: s'esperava ${_(t.values[0])}`;return`Opció invàlida: s'esperava una de ${p(t.values," o ")}`;case"too_big":{let i=t.inclusive?"com a màxim":"menys de",a=r(t.origin);if(a)return`Massa gran: s'esperava que ${t.origin??"el valor"} contingués ${i} ${t.maximum.toString()} ${a.unit??"elements"}`;return`Massa gran: s'esperava que ${t.origin??"el valor"} fos ${i} ${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?"com a mínim":"més de",a=r(t.origin);if(a)return`Massa petit: s'esperava que ${t.origin} contingués ${i} ${t.minimum.toString()} ${a.unit}`;return`Massa petit: s'esperava que ${t.origin} fos ${i} ${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Format invàlid: ha de començar amb "${i.prefix}"`;if(i.format==="ends_with")return`Format invàlid: ha d'acabar amb "${i.suffix}"`;if(i.format==="includes")return`Format invàlid: ha d'incloure "${i.includes}"`;if(i.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${i.pattern}`;return`Format invàlid per a ${o[i.format]??t.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${t.divisor}`;case"unrecognized_keys":return`Clau${t.keys.length>1?"s":""} no reconeguda${t.keys.length>1?"s":""}: ${p(t.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${t.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${t.origin}`;default:return"Entrada invàlida"}}};function Ya(){return{localeError:jh()}}var Ah=()=>{let e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(t))return"pole";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"regulární výraz",email:"e-mailová 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 čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return(t)=>{switch(t.code){case"invalid_type":return`Neplatný vstup: očekáváno ${t.expected}, obdrženo ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Neplatný vstup: očekáváno ${_(t.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Hodnota je příliš velká: ${t.origin??"hodnota"} musí mít ${i}${t.maximum.toString()} ${a.unit??"prvků"}`;return`Hodnota je příliš velká: ${t.origin??"hodnota"} musí být ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Hodnota je příliš malá: ${t.origin??"hodnota"} musí mít ${i}${t.minimum.toString()} ${a.unit??"prvků"}`;return`Hodnota je příliš malá: ${t.origin??"hodnota"} musí být ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Neplatný řetězec: musí začínat na "${i.prefix}"`;if(i.format==="ends_with")return`Neplatný řetězec: musí končit na "${i.suffix}"`;if(i.format==="includes")return`Neplatný řetězec: musí obsahovat "${i.includes}"`;if(i.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${i.pattern}`;return`Neplatný formát ${o[i.format]??t.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${t.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${p(t.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${t.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${t.origin}`;default:return"Neplatný vstup"}}};function Qa(){return{localeError:Ah()}}var Mh=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},r={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};function n(a){return e[a]??null}function o(a){return r[a]??a}let t=(a)=>{let s=typeof a;switch(s){case"number":return Number.isNaN(a)?"NaN":"tal";case"object":{if(Array.isArray(a))return"liste";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype&&a.constructor)return a.constructor.name;return"objekt"}}return s},i={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æt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",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"};return(a)=>{switch(a.code){case"invalid_type":return`Ugyldigt input: forventede ${o(a.expected)}, fik ${o(t(a.input))}`;case"invalid_value":if(a.values.length===1)return`Ugyldig værdi: forventede ${_(a.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${p(a.values,"|")}`;case"too_big":{let s=a.inclusive?"<=":"<",c=n(a.origin),l=o(a.origin);if(c)return`For stor: forventede ${l??"value"} ${c.verb} ${s} ${a.maximum.toString()} ${c.unit??"elementer"}`;return`For stor: forventede ${l??"value"} havde ${s} ${a.maximum.toString()}`}case"too_small":{let s=a.inclusive?">=":">",c=n(a.origin),l=o(a.origin);if(c)return`For lille: forventede ${l} ${c.verb} ${s} ${a.minimum.toString()} ${c.unit}`;return`For lille: forventede ${l} havde ${s} ${a.minimum.toString()}`}case"invalid_format":{let s=a;if(s.format==="starts_with")return`Ugyldig streng: skal starte med "${s.prefix}"`;if(s.format==="ends_with")return`Ugyldig streng: skal ende med "${s.suffix}"`;if(s.format==="includes")return`Ugyldig streng: skal indeholde "${s.includes}"`;if(s.format==="regex")return`Ugyldig streng: skal matche mønsteret ${s.pattern}`;return`Ugyldig ${i[s.format]??a.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${a.divisor}`;case"unrecognized_keys":return`${a.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${p(a.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${a.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${a.origin}`;default:return"Ugyldigt input"}}};function es(){return{localeError:Mh()}}var Rh=()=>{let e={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 r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"Zahl";case"object":{if(Array.isArray(t))return"Array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={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"};return(t)=>{switch(t.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${t.expected}, erhalten ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Ungültige Eingabe: erwartet ${_(t.values[0])}`;return`Ungültige Option: erwartet eine von ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Zu groß: erwartet, dass ${t.origin??"Wert"} ${i}${t.maximum.toString()} ${a.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${t.origin??"Wert"} ${i}${t.maximum.toString()} ist`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Zu klein: erwartet, dass ${t.origin} ${i}${t.minimum.toString()} ${a.unit} hat`;return`Zu klein: erwartet, dass ${t.origin} ${i}${t.minimum.toString()} ist`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Ungültiger String: muss mit "${i.prefix}" beginnen`;if(i.format==="ends_with")return`Ungültiger String: muss mit "${i.suffix}" enden`;if(i.format==="includes")return`Ungültiger String: muss "${i.includes}" enthalten`;if(i.format==="regex")return`Ungültiger String: muss dem Muster ${i.pattern} entsprechen`;return`Ungültig: ${o[i.format]??t.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${t.divisor} sein`;case"unrecognized_keys":return`${t.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${p(t.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${t.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${t.origin}`;default:return"Ungültige Eingabe"}}};function ts(){return{localeError:Rh()}}var Nh=(e)=>{let r=typeof e;switch(r){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return r},Uh=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function r(o){return e[o]??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"};return(o)=>{switch(o.code){case"invalid_type":return`Invalid input: expected ${o.expected}, received ${Nh(o.input)}`;case"invalid_value":if(o.values.length===1)return`Invalid input: expected ${_(o.values[0])}`;return`Invalid option: expected one of ${p(o.values,"|")}`;case"too_big":{let t=o.inclusive?"<=":"<",i=r(o.origin);if(i)return`Too big: expected ${o.origin??"value"} to have ${t}${o.maximum.toString()} ${i.unit??"elements"}`;return`Too big: expected ${o.origin??"value"} to be ${t}${o.maximum.toString()}`}case"too_small":{let t=o.inclusive?">=":">",i=r(o.origin);if(i)return`Too small: expected ${o.origin} to have ${t}${o.minimum.toString()} ${i.unit}`;return`Too small: expected ${o.origin} to be ${t}${o.minimum.toString()}`}case"invalid_format":{let t=o;if(t.format==="starts_with")return`Invalid string: must start with "${t.prefix}"`;if(t.format==="ends_with")return`Invalid string: must end with "${t.suffix}"`;if(t.format==="includes")return`Invalid string: must include "${t.includes}"`;if(t.format==="regex")return`Invalid string: must match pattern ${t.pattern}`;return`Invalid ${n[t.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${p(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function Gt(){return{localeError:Uh()}}var Lh=(e)=>{let r=typeof e;switch(r){case"number":return Number.isNaN(e)?"NaN":"nombro";case"object":{if(Array.isArray(e))return"tabelo";if(e===null)return"senvalora";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return r},Zh=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function r(o){return e[o]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",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ŭro",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"};return(o)=>{switch(o.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${o.expected}, riceviĝis ${Lh(o.input)}`;case"invalid_value":if(o.values.length===1)return`Nevalida enigo: atendiĝis ${_(o.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${p(o.values,"|")}`;case"too_big":{let t=o.inclusive?"<=":"<",i=r(o.origin);if(i)return`Tro granda: atendiĝis ke ${o.origin??"valoro"} havu ${t}${o.maximum.toString()} ${i.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${o.origin??"valoro"} havu ${t}${o.maximum.toString()}`}case"too_small":{let t=o.inclusive?">=":">",i=r(o.origin);if(i)return`Tro malgranda: atendiĝis ke ${o.origin} havu ${t}${o.minimum.toString()} ${i.unit}`;return`Tro malgranda: atendiĝis ke ${o.origin} estu ${t}${o.minimum.toString()}`}case"invalid_format":{let t=o;if(t.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${t.prefix}"`;if(t.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${t.suffix}"`;if(t.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${t.includes}"`;if(t.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${t.pattern}`;return`Nevalida ${n[t.format]??o.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${o.divisor}`;case"unrecognized_keys":return`Nekonata${o.keys.length>1?"j":""} ŝlosilo${o.keys.length>1?"j":""}: ${p(o.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${o.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${o.origin}`;default:return"Nevalida enigo"}}};function rs(){return{localeError:Zh()}}var Fh=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},r={string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};function n(a){return e[a]??null}function o(a){return r[a]??a}let t=(a)=>{let s=typeof a;switch(s){case"number":return Number.isNaN(a)?"NaN":"number";case"object":{if(Array.isArray(a))return"array";if(a===null)return"null";if(Object.getPrototypeOf(a)!==Object.prototype)return a.constructor.name;return"object"}}return s},i={regex:"entrada",email:"dirección de correo electrónico",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ón ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(a)=>{switch(a.code){case"invalid_type":return`Entrada inválida: se esperaba ${o(a.expected)}, recibido ${o(t(a.input))}`;case"invalid_value":if(a.values.length===1)return`Entrada inválida: se esperaba ${_(a.values[0])}`;return`Opción inválida: se esperaba una de ${p(a.values,"|")}`;case"too_big":{let s=a.inclusive?"<=":"<",c=n(a.origin),l=o(a.origin);if(c)return`Demasiado grande: se esperaba que ${l??"valor"} tuviera ${s}${a.maximum.toString()} ${c.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${l??"valor"} fuera ${s}${a.maximum.toString()}`}case"too_small":{let s=a.inclusive?">=":">",c=n(a.origin),l=o(a.origin);if(c)return`Demasiado pequeño: se esperaba que ${l} tuviera ${s}${a.minimum.toString()} ${c.unit}`;return`Demasiado pequeño: se esperaba que ${l} fuera ${s}${a.minimum.toString()}`}case"invalid_format":{let s=a;if(s.format==="starts_with")return`Cadena inválida: debe comenzar con "${s.prefix}"`;if(s.format==="ends_with")return`Cadena inválida: debe terminar en "${s.suffix}"`;if(s.format==="includes")return`Cadena inválida: debe incluir "${s.includes}"`;if(s.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${s.pattern}`;return`Inválido ${i[s.format]??a.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${a.divisor}`;case"unrecognized_keys":return`Llave${a.keys.length>1?"s":""} desconocida${a.keys.length>1?"s":""}: ${p(a.keys,", ")}`;case"invalid_key":return`Llave inválida en ${o(a.origin)}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${o(a.origin)}`;default:return"Entrada inválida"}}};function ns(){return{localeError:Fh()}}var Gh=()=>{let e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"عدد";case"object":{if(Array.isArray(t))return"آرایه";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return(t)=>{switch(t.code){case"invalid_type":return`ورودی نامعتبر: میبایست ${t.expected} میبود، ${n(t.input)} دریافت شد`;case"invalid_value":if(t.values.length===1)return`ورودی نامعتبر: میبایست ${_(t.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${p(t.values,"|")} میبود`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`خیلی بزرگ: ${t.origin??"مقدار"} باید ${i}${t.maximum.toString()} ${a.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${t.origin??"مقدار"} باید ${i}${t.maximum.toString()} باشد`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`خیلی کوچک: ${t.origin} باید ${i}${t.minimum.toString()} ${a.unit} باشد`;return`خیلی کوچک: ${t.origin} باید ${i}${t.minimum.toString()} باشد`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`رشته نامعتبر: باید با "${i.prefix}" شروع شود`;if(i.format==="ends_with")return`رشته نامعتبر: باید با "${i.suffix}" تمام شود`;if(i.format==="includes")return`رشته نامعتبر: باید شامل "${i.includes}" باشد`;if(i.format==="regex")return`رشته نامعتبر: باید با الگوی ${i.pattern} مطابقت داشته باشد`;return`${o[i.format]??t.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${t.divisor} باشد`;case"unrecognized_keys":return`کلید${t.keys.length>1?"های":""} ناشناس: ${p(t.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${t.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${t.origin}`;default:return"ورودی نامعتبر"}}};function os(){return{localeError:Gh()}}var Vh=()=>{let e={string:{unit:"merkkiä",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äivämäärän"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"säännöllinen lauseke",email:"sähköpostiosoite",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äivämäärä",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"};return(t)=>{switch(t.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${t.expected}, oli ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Virheellinen syöte: täytyy olla ${_(t.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Liian suuri: ${a.subject} täytyy olla ${i}${t.maximum.toString()} ${a.unit}`.trim();return`Liian suuri: arvon täytyy olla ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Liian pieni: ${a.subject} täytyy olla ${i}${t.minimum.toString()} ${a.unit}`.trim();return`Liian pieni: arvon täytyy olla ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${i.prefix}"`;if(i.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${i.suffix}"`;if(i.format==="includes")return`Virheellinen syöte: täytyy sisältää "${i.includes}"`;if(i.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${i.pattern}`;return`Virheellinen ${o[i.format]??t.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${t.divisor} monikerta`;case"unrecognized_keys":return`${t.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${p(t.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öte"}}};function is(){return{localeError:Vh()}}var Wh=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"nombre";case"object":{if(Array.isArray(t))return"tableau";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"entrée",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ée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(t)=>{switch(t.code){case"invalid_type":return`Entrée invalide : ${t.expected} attendu, ${n(t.input)} reçu`;case"invalid_value":if(t.values.length===1)return`Entrée invalide : ${_(t.values[0])} attendu`;return`Option invalide : une valeur parmi ${p(t.values,"|")} attendue`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Trop grand : ${t.origin??"valeur"} doit ${a.verb} ${i}${t.maximum.toString()} ${a.unit??"élément(s)"}`;return`Trop grand : ${t.origin??"valeur"} doit être ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Trop petit : ${t.origin} doit ${a.verb} ${i}${t.minimum.toString()} ${a.unit}`;return`Trop petit : ${t.origin} doit être ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Chaîne invalide : doit commencer par "${i.prefix}"`;if(i.format==="ends_with")return`Chaîne invalide : doit se terminer par "${i.suffix}"`;if(i.format==="includes")return`Chaîne invalide : doit inclure "${i.includes}"`;if(i.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${i.pattern}`;return`${o[i.format]??t.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${t.divisor}`;case"unrecognized_keys":return`Clé${t.keys.length>1?"s":""} non reconnue${t.keys.length>1?"s":""} : ${p(t.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${t.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${t.origin}`;default:return"Entrée invalide"}}};function as(){return{localeError:Wh()}}var Bh=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"entrée",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ée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(t)=>{switch(t.code){case"invalid_type":return`Entrée invalide : attendu ${t.expected}, reçu ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Entrée invalide : attendu ${_(t.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"≤":"<",a=r(t.origin);if(a)return`Trop grand : attendu que ${t.origin??"la valeur"} ait ${i}${t.maximum.toString()} ${a.unit}`;return`Trop grand : attendu que ${t.origin??"la valeur"} soit ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?"≥":">",a=r(t.origin);if(a)return`Trop petit : attendu que ${t.origin} ait ${i}${t.minimum.toString()} ${a.unit}`;return`Trop petit : attendu que ${t.origin} soit ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Chaîne invalide : doit commencer par "${i.prefix}"`;if(i.format==="ends_with")return`Chaîne invalide : doit se terminer par "${i.suffix}"`;if(i.format==="includes")return`Chaîne invalide : doit inclure "${i.includes}"`;if(i.format==="regex")return`Chaîne invalide : doit correspondre au motif ${i.pattern}`;return`${o[i.format]??t.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${t.divisor}`;case"unrecognized_keys":return`Clé${t.keys.length>1?"s":""} non reconnue${t.keys.length>1?"s":""} : ${p(t.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${t.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${t.origin}`;default:return"Entrée invalide"}}};function ss(){return{localeError:Bh()}}var Hh=()=>{let e={string:{unit:"אותיות",verb:"לכלול"},file:{unit:"בייטים",verb:"לכלול"},array:{unit:"פריטים",verb:"לכלול"},set:{unit:"פריטים",verb:"לכלול"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"קלט",email:"כתובת אימייל",url:"כתובת רשת",emoji:"אימוג'י",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"תאריך וזמן ISO",date:"תאריך ISO",time:"זמן ISO",duration:"משך זמן ISO",ipv4:"כתובת IPv4",ipv6:"כתובת IPv6",cidrv4:"טווח IPv4",cidrv6:"טווח IPv6",base64:"מחרוזת בבסיס 64",base64url:"מחרוזת בבסיס 64 לכתובות רשת",json_string:"מחרוזת JSON",e164:"מספר E.164",jwt:"JWT",template_literal:"קלט"};return(t)=>{switch(t.code){case"invalid_type":return`קלט לא תקין: צריך ${t.expected}, התקבל ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`קלט לא תקין: צריך ${_(t.values[0])}`;return`קלט לא תקין: צריך אחת מהאפשרויות ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`גדול מדי: ${t.origin??"value"} צריך להיות ${i}${t.maximum.toString()} ${a.unit??"elements"}`;return`גדול מדי: ${t.origin??"value"} צריך להיות ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`קטן מדי: ${t.origin} צריך להיות ${i}${t.minimum.toString()} ${a.unit}`;return`קטן מדי: ${t.origin} צריך להיות ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`מחרוזת לא תקינה: חייבת להתחיל ב"${i.prefix}"`;if(i.format==="ends_with")return`מחרוזת לא תקינה: חייבת להסתיים ב "${i.suffix}"`;if(i.format==="includes")return`מחרוזת לא תקינה: חייבת לכלול "${i.includes}"`;if(i.format==="regex")return`מחרוזת לא תקינה: חייבת להתאים לתבנית ${i.pattern}`;return`${o[i.format]??t.format} לא תקין`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${t.divisor}`;case"unrecognized_keys":return`מפתח${t.keys.length>1?"ות":""} לא מזוה${t.keys.length>1?"ים":"ה"}: ${p(t.keys,", ")}`;case"invalid_key":return`מפתח לא תקין ב${t.origin}`;case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${t.origin}`;default:return"קלט לא תקין"}}};function cs(){return{localeError:Hh()}}var Jh=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"szám";case"object":{if(Array.isArray(t))return"tömb";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"bemenet",email:"email cím",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őbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return(t)=>{switch(t.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${t.expected}, a kapott érték ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Érvénytelen bemenet: a várt érték ${_(t.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Túl nagy: ${t.origin??"érték"} mérete túl nagy ${i}${t.maximum.toString()} ${a.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${t.origin??"érték"} túl nagy: ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Túl kicsi: a bemeneti érték ${t.origin} mérete túl kicsi ${i}${t.minimum.toString()} ${a.unit}`;return`Túl kicsi: a bemeneti érték ${t.origin} túl kicsi ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Érvénytelen string: "${i.prefix}" értékkel kell kezdődnie`;if(i.format==="ends_with")return`Érvénytelen string: "${i.suffix}" értékkel kell végződnie`;if(i.format==="includes")return`Érvénytelen string: "${i.includes}" értéket kell tartalmaznia`;if(i.format==="regex")return`Érvénytelen string: ${i.pattern} mintának kell megfelelnie`;return`Érvénytelen ${o[i.format]??t.format}`}case"not_multiple_of":return`Érvénytelen szám: ${t.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${t.keys.length>1?"s":""}: ${p(t.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${t.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${t.origin}`;default:return"Érvénytelen bemenet"}}};function ls(){return{localeError:Jh()}}var qh=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={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"};return(t)=>{switch(t.code){case"invalid_type":return`Input tidak valid: diharapkan ${t.expected}, diterima ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Input tidak valid: diharapkan ${_(t.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Terlalu besar: diharapkan ${t.origin??"value"} memiliki ${i}${t.maximum.toString()} ${a.unit??"elemen"}`;return`Terlalu besar: diharapkan ${t.origin??"value"} menjadi ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Terlalu kecil: diharapkan ${t.origin} memiliki ${i}${t.minimum.toString()} ${a.unit}`;return`Terlalu kecil: diharapkan ${t.origin} menjadi ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`String tidak valid: harus dimulai dengan "${i.prefix}"`;if(i.format==="ends_with")return`String tidak valid: harus berakhir dengan "${i.suffix}"`;if(i.format==="includes")return`String tidak valid: harus menyertakan "${i.includes}"`;if(i.format==="regex")return`String tidak valid: harus sesuai pola ${i.pattern}`;return`${o[i.format]??t.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${t.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${t.keys.length>1?"s":""}: ${p(t.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${t.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${t.origin}`;default:return"Input tidak valid"}}};function us(){return{localeError:qh()}}var Kh=(e)=>{let r=typeof e;switch(r){case"number":return Number.isNaN(e)?"NaN":"númer";case"object":{if(Array.isArray(e))return"fylki";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return r},Xh=()=>{let e={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function r(o){return e[o]??null}let n={regex:"gildi",email:"netfang",url:"vefslóð",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ími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",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ölugildi",jwt:"JWT",template_literal:"gildi"};return(o)=>{switch(o.code){case"invalid_type":return`Rangt gildi: Þú slóst inn ${Kh(o.input)} þar sem á að vera ${o.expected}`;case"invalid_value":if(o.values.length===1)return`Rangt gildi: gert ráð fyrir ${_(o.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${p(o.values,"|")}`;case"too_big":{let t=o.inclusive?"<=":"<",i=r(o.origin);if(i)return`Of stórt: gert er ráð fyrir að ${o.origin??"gildi"} hafi ${t}${o.maximum.toString()} ${i.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${o.origin??"gildi"} sé ${t}${o.maximum.toString()}`}case"too_small":{let t=o.inclusive?">=":">",i=r(o.origin);if(i)return`Of lítið: gert er ráð fyrir að ${o.origin} hafi ${t}${o.minimum.toString()} ${i.unit}`;return`Of lítið: gert er ráð fyrir að ${o.origin} sé ${t}${o.minimum.toString()}`}case"invalid_format":{let t=o;if(t.format==="starts_with")return`Ógildur strengur: verður að byrja á "${t.prefix}"`;if(t.format==="ends_with")return`Ógildur strengur: verður að enda á "${t.suffix}"`;if(t.format==="includes")return`Ógildur strengur: verður að innihalda "${t.includes}"`;if(t.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${t.pattern}`;return`Rangt ${n[t.format]??o.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${o.divisor}`;case"unrecognized_keys":return`Óþekkt ${o.keys.length>1?"ir lyklar":"ur lykill"}: ${p(o.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${o.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${o.origin}`;default:return"Rangt gildi"}}};function ds(){return{localeError:Xh()}}var Yh=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"numero";case"object":{if(Array.isArray(t))return"vettore";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={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"};return(t)=>{switch(t.code){case"invalid_type":return`Input non valido: atteso ${t.expected}, ricevuto ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Input non valido: atteso ${_(t.values[0])}`;return`Opzione non valida: atteso uno tra ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Troppo grande: ${t.origin??"valore"} deve avere ${i}${t.maximum.toString()} ${a.unit??"elementi"}`;return`Troppo grande: ${t.origin??"valore"} deve essere ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Troppo piccolo: ${t.origin} deve avere ${i}${t.minimum.toString()} ${a.unit}`;return`Troppo piccolo: ${t.origin} deve essere ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Stringa non valida: deve iniziare con "${i.prefix}"`;if(i.format==="ends_with")return`Stringa non valida: deve terminare con "${i.suffix}"`;if(i.format==="includes")return`Stringa non valida: deve includere "${i.includes}"`;if(i.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${i.pattern}`;return`Invalid ${o[i.format]??t.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${t.divisor}`;case"unrecognized_keys":return`Chiav${t.keys.length>1?"i":"e"} non riconosciut${t.keys.length>1?"e":"a"}: ${p(t.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${t.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${t.origin}`;default:return"Input non valido"}}};function ms(){return{localeError:Yh()}}var Qh=()=>{let e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"数値";case"object":{if(Array.isArray(t))return"配列";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return(t)=>{switch(t.code){case"invalid_type":return`無効な入力: ${t.expected}が期待されましたが、${n(t.input)}が入力されました`;case"invalid_value":if(t.values.length===1)return`無効な入力: ${_(t.values[0])}が期待されました`;return`無効な選択: ${p(t.values,"、")}のいずれかである必要があります`;case"too_big":{let i=t.inclusive?"以下である":"より小さい",a=r(t.origin);if(a)return`大きすぎる値: ${t.origin??"値"}は${t.maximum.toString()}${a.unit??"要素"}${i}必要があります`;return`大きすぎる値: ${t.origin??"値"}は${t.maximum.toString()}${i}必要があります`}case"too_small":{let i=t.inclusive?"以上である":"より大きい",a=r(t.origin);if(a)return`小さすぎる値: ${t.origin}は${t.minimum.toString()}${a.unit}${i}必要があります`;return`小さすぎる値: ${t.origin}は${t.minimum.toString()}${i}必要があります`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`無効な文字列: "${i.prefix}"で始まる必要があります`;if(i.format==="ends_with")return`無効な文字列: "${i.suffix}"で終わる必要があります`;if(i.format==="includes")return`無効な文字列: "${i.includes}"を含む必要があります`;if(i.format==="regex")return`無効な文字列: パターン${i.pattern}に一致する必要があります`;return`無効な${o[i.format]??t.format}`}case"not_multiple_of":return`無効な数値: ${t.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${t.keys.length>1?"群":""}: ${p(t.keys,"、")}`;case"invalid_key":return`${t.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${t.origin}内の無効な値`;default:return"無効な入力"}}};function ps(){return{localeError:Qh()}}var ev=(e)=>{let r=typeof e;switch(r){case"number":return Number.isNaN(e)?"NaN":"რიცხვი";case"object":{if(Array.isArray(e))return"მასივი";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return{string:"სტრინგი",boolean:"ბულეანი",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"ფუნქცია"}[r]??r},tv=()=>{let e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function r(o){return e[o]??null}let n={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"};return(o)=>{switch(o.code){case"invalid_type":return`არასწორი შეყვანა: მოსალოდნელი ${o.expected}, მიღებული ${ev(o.input)}`;case"invalid_value":if(o.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${_(o.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${p(o.values,"|")}-დან`;case"too_big":{let t=o.inclusive?"<=":"<",i=r(o.origin);if(i)return`ზედმეტად დიდი: მოსალოდნელი ${o.origin??"მნიშვნელობა"} ${i.verb} ${t}${o.maximum.toString()} ${i.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${o.origin??"მნიშვნელობა"} იყოს ${t}${o.maximum.toString()}`}case"too_small":{let t=o.inclusive?">=":">",i=r(o.origin);if(i)return`ზედმეტად პატარა: მოსალოდნელი ${o.origin} ${i.verb} ${t}${o.minimum.toString()} ${i.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${o.origin} იყოს ${t}${o.minimum.toString()}`}case"invalid_format":{let t=o;if(t.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${t.prefix}"-ით`;if(t.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${t.suffix}"-ით`;if(t.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${t.includes}"-ს`;if(t.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${t.pattern}`;return`არასწორი ${n[t.format]??o.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${o.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${o.keys.length>1?"ები":"ი"}: ${p(o.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${o.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${o.origin}-ში`;default:return"არასწორი შეყვანა"}}};function fs(){return{localeError:tv()}}var rv=()=>{let e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(t))return"អារេ (Array)";if(t===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return(t)=>{switch(t.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${t.expected} ប៉ុន្តែទទួលបាន ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${_(t.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`ធំពេក៖ ត្រូវការ ${t.origin??"តម្លៃ"} ${i} ${t.maximum.toString()} ${a.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${t.origin??"តម្លៃ"} ${i} ${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`តូចពេក៖ ត្រូវការ ${t.origin} ${i} ${t.minimum.toString()} ${a.unit}`;return`តូចពេក៖ ត្រូវការ ${t.origin} ${i} ${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${i.prefix}"`;if(i.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${i.suffix}"`;if(i.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${i.includes}"`;if(i.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${i.pattern}`;return`មិនត្រឹមត្រូវ៖ ${o[i.format]??t.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${t.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${p(t.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${t.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${t.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function Vt(){return{localeError:rv()}}function gs(){return Vt()}var nv=()=>{let e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return(t)=>{switch(t.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${t.expected}, 받은 타입은 ${n(t.input)}입니다`;case"invalid_value":if(t.values.length===1)return`잘못된 입력: 값은 ${_(t.values[0])} 이어야 합니다`;return`잘못된 옵션: ${p(t.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let i=t.inclusive?"이하":"미만",a=i==="미만"?"이어야 합니다":"여야 합니다",s=r(t.origin),c=s?.unit??"요소";if(s)return`${t.origin??"값"}이 너무 큽니다: ${t.maximum.toString()}${c} ${i}${a}`;return`${t.origin??"값"}이 너무 큽니다: ${t.maximum.toString()} ${i}${a}`}case"too_small":{let i=t.inclusive?"이상":"초과",a=i==="이상"?"이어야 합니다":"여야 합니다",s=r(t.origin),c=s?.unit??"요소";if(s)return`${t.origin??"값"}이 너무 작습니다: ${t.minimum.toString()}${c} ${i}${a}`;return`${t.origin??"값"}이 너무 작습니다: ${t.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`잘못된 문자열: "${i.prefix}"(으)로 시작해야 합니다`;if(i.format==="ends_with")return`잘못된 문자열: "${i.suffix}"(으)로 끝나야 합니다`;if(i.format==="includes")return`잘못된 문자열: "${i.includes}"을(를) 포함해야 합니다`;if(i.format==="regex")return`잘못된 문자열: 정규식 ${i.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${o[i.format]??t.format}`}case"not_multiple_of":return`잘못된 숫자: ${t.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${p(t.keys,", ")}`;case"invalid_key":return`잘못된 키: ${t.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${t.origin}`;default:return"잘못된 입력"}}};function hs(){return{localeError:nv()}}var ov=(e)=>Bt(typeof e,e),Bt=(e,r=void 0)=>{switch(e){case"number":return Number.isNaN(r)?"NaN":"skaičius";case"bigint":return"sveikasis skaičius";case"string":return"eilutė";case"boolean":return"loginė reikšmė";case"undefined":case"void":return"neapibrėžta reikšmė";case"function":return"funkcija";case"symbol":return"simbolis";case"object":{if(r===void 0)return"nežinomas objektas";if(r===null)return"nulinė reikšmė";if(Array.isArray(r))return"masyvas";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name;return"objektas"}case"null":return"nulinė reikšmė"}return e},Wt=(e)=>e.charAt(0).toUpperCase()+e.slice(1);function Ad(e){let r=Math.abs(e),n=r%10,o=r%100;if(o>=11&&o<=19||n===0)return"many";if(n===1)return"one";return"few"}var iv=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function r(o,t,i,a){let s=e[o]??null;if(s===null)return s;return{unit:s.unit[t],verb:s.verb[a][i?"inclusive":"notInclusive"]}}let n={regex:"įvestis",email:"el. pašto 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ė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"};return(o)=>{switch(o.code){case"invalid_type":return`Gautas tipas ${ov(o.input)}, o tikėtasi - ${Bt(o.expected)}`;case"invalid_value":if(o.values.length===1)return`Privalo būti ${_(o.values[0])}`;return`Privalo būti vienas iš ${p(o.values,"|")} pasirinkimų`;case"too_big":{let t=Bt(o.origin),i=r(o.origin,Ad(Number(o.maximum)),o.inclusive??!1,"smaller");if(i?.verb)return`${Wt(t??o.origin??"reikšmė")} ${i.verb} ${o.maximum.toString()} ${i.unit??"elementų"}`;let a=o.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${Wt(t??o.origin??"reikšmė")} turi būti ${a} ${o.maximum.toString()} ${i?.unit}`}case"too_small":{let t=Bt(o.origin),i=r(o.origin,Ad(Number(o.minimum)),o.inclusive??!1,"bigger");if(i?.verb)return`${Wt(t??o.origin??"reikšmė")} ${i.verb} ${o.minimum.toString()} ${i.unit??"elementų"}`;let a=o.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${Wt(t??o.origin??"reikšmė")} turi būti ${a} ${o.minimum.toString()} ${i?.unit}`}case"invalid_format":{let t=o;if(t.format==="starts_with")return`Eilutė privalo prasidėti "${t.prefix}"`;if(t.format==="ends_with")return`Eilutė privalo pasibaigti "${t.suffix}"`;if(t.format==="includes")return`Eilutė privalo įtraukti "${t.includes}"`;if(t.format==="regex")return`Eilutė privalo atitikti ${t.pattern}`;return`Neteisingas ${n[t.format]??o.format}`}case"not_multiple_of":return`Skaičius privalo būti ${o.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${o.keys.length>1?"i":"as"} rakt${o.keys.length>1?"ai":"as"}: ${p(o.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let t=Bt(o.origin);return`${Wt(t??o.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function vs(){return{localeError:iv()}}var av=()=>{let e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"број";case"object":{if(Array.isArray(t))return"низа";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return(t)=>{switch(t.code){case"invalid_type":return`Грешен внес: се очекува ${t.expected}, примено ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Invalid input: expected ${_(t.values[0])}`;return`Грешана опција: се очекува една ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Премногу голем: се очекува ${t.origin??"вредноста"} да има ${i}${t.maximum.toString()} ${a.unit??"елементи"}`;return`Премногу голем: се очекува ${t.origin??"вредноста"} да биде ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Премногу мал: се очекува ${t.origin} да има ${i}${t.minimum.toString()} ${a.unit}`;return`Премногу мал: се очекува ${t.origin} да биде ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Неважечка низа: мора да започнува со "${i.prefix}"`;if(i.format==="ends_with")return`Неважечка низа: мора да завршува со "${i.suffix}"`;if(i.format==="includes")return`Неважечка низа: мора да вклучува "${i.includes}"`;if(i.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${i.pattern}`;return`Invalid ${o[i.format]??t.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${p(t.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${t.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${t.origin}`;default:return"Грешен внес"}}};function ys(){return{localeError:av()}}var sv=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"nombor";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={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"};return(t)=>{switch(t.code){case"invalid_type":return`Input tidak sah: dijangka ${t.expected}, diterima ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Input tidak sah: dijangka ${_(t.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Terlalu besar: dijangka ${t.origin??"nilai"} ${a.verb} ${i}${t.maximum.toString()} ${a.unit??"elemen"}`;return`Terlalu besar: dijangka ${t.origin??"nilai"} adalah ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Terlalu kecil: dijangka ${t.origin} ${a.verb} ${i}${t.minimum.toString()} ${a.unit}`;return`Terlalu kecil: dijangka ${t.origin} adalah ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`String tidak sah: mesti bermula dengan "${i.prefix}"`;if(i.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${i.suffix}"`;if(i.format==="includes")return`String tidak sah: mesti mengandungi "${i.includes}"`;if(i.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${i.pattern}`;return`${o[i.format]??t.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${t.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${p(t.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${t.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${t.origin}`;default:return"Input tidak sah"}}};function bs(){return{localeError:sv()}}var cv=()=>{let e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"getal";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={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"};return(t)=>{switch(t.code){case"invalid_type":return`Ongeldige invoer: verwacht ${t.expected}, ontving ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Ongeldige invoer: verwacht ${_(t.values[0])}`;return`Ongeldige optie: verwacht één van ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Te lang: verwacht dat ${t.origin??"waarde"} ${i}${t.maximum.toString()} ${a.unit??"elementen"} bevat`;return`Te lang: verwacht dat ${t.origin??"waarde"} ${i}${t.maximum.toString()} is`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Te kort: verwacht dat ${t.origin} ${i}${t.minimum.toString()} ${a.unit} bevat`;return`Te kort: verwacht dat ${t.origin} ${i}${t.minimum.toString()} is`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Ongeldige tekst: moet met "${i.prefix}" beginnen`;if(i.format==="ends_with")return`Ongeldige tekst: moet op "${i.suffix}" eindigen`;if(i.format==="includes")return`Ongeldige tekst: moet "${i.includes}" bevatten`;if(i.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`;return`Ongeldig: ${o[i.format]??t.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${t.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${t.keys.length>1?"s":""}: ${p(t.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${t.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${t.origin}`;default:return"Ongeldige invoer"}}};function _s(){return{localeError:cv()}}var lv=()=>{let e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"tall";case"object":{if(Array.isArray(t))return"liste";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={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åde",ipv6:"IPv6-område",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"};return(t)=>{switch(t.code){case"invalid_type":return`Ugyldig input: forventet ${t.expected}, fikk ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Ugyldig verdi: forventet ${_(t.values[0])}`;return`Ugyldig valg: forventet en av ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`For stor(t): forventet ${t.origin??"value"} til å ha ${i}${t.maximum.toString()} ${a.unit??"elementer"}`;return`For stor(t): forventet ${t.origin??"value"} til å ha ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`For lite(n): forventet ${t.origin} til å ha ${i}${t.minimum.toString()} ${a.unit}`;return`For lite(n): forventet ${t.origin} til å ha ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Ugyldig streng: må starte med "${i.prefix}"`;if(i.format==="ends_with")return`Ugyldig streng: må ende med "${i.suffix}"`;if(i.format==="includes")return`Ugyldig streng: må inneholde "${i.includes}"`;if(i.format==="regex")return`Ugyldig streng: må matche mønsteret ${i.pattern}`;return`Ugyldig ${o[i.format]??t.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${p(t.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${t.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${t.origin}`;default:return"Ugyldig input"}}};function ks(){return{localeError:lv()}}var uv=()=>{let e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"numara";case"object":{if(Array.isArray(t))return"saf";if(t===null)return"gayb";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"giren",email:"epostagâh",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âmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return(t)=>{switch(t.code){case"invalid_type":return`Fâsit giren: umulan ${t.expected}, alınan ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Fâsit giren: umulan ${_(t.values[0])}`;return`Fâsit tercih: mûteberler ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Fazla büyük: ${t.origin??"value"}, ${i}${t.maximum.toString()} ${a.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${t.origin??"value"}, ${i}${t.maximum.toString()} olmalıydı.`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Fazla küçük: ${t.origin}, ${i}${t.minimum.toString()} ${a.unit} sahip olmalıydı.`;return`Fazla küçük: ${t.origin}, ${i}${t.minimum.toString()} olmalıydı.`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Fâsit metin: "${i.prefix}" ile başlamalı.`;if(i.format==="ends_with")return`Fâsit metin: "${i.suffix}" ile bitmeli.`;if(i.format==="includes")return`Fâsit metin: "${i.includes}" ihtivâ etmeli.`;if(i.format==="regex")return`Fâsit metin: ${i.pattern} nakşına uymalı.`;return`Fâsit ${o[i.format]??t.format}`}case"not_multiple_of":return`Fâsit sayı: ${t.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${t.keys.length>1?"s":""}: ${p(t.keys,", ")}`;case"invalid_key":return`${t.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${t.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function $s(){return{localeError:uv()}}var dv=()=>{let e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"عدد";case"object":{if(Array.isArray(t))return"ارې";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return(t)=>{switch(t.code){case"invalid_type":return`ناسم ورودي: باید ${t.expected} وای, مګر ${n(t.input)} ترلاسه شو`;case"invalid_value":if(t.values.length===1)return`ناسم ورودي: باید ${_(t.values[0])} وای`;return`ناسم انتخاب: باید یو له ${p(t.values,"|")} څخه وای`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`ډیر لوی: ${t.origin??"ارزښت"} باید ${i}${t.maximum.toString()} ${a.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${t.origin??"ارزښت"} باید ${i}${t.maximum.toString()} وي`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`ډیر کوچنی: ${t.origin} باید ${i}${t.minimum.toString()} ${a.unit} ولري`;return`ډیر کوچنی: ${t.origin} باید ${i}${t.minimum.toString()} وي`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`ناسم متن: باید د "${i.prefix}" سره پیل شي`;if(i.format==="ends_with")return`ناسم متن: باید د "${i.suffix}" سره پای ته ورسيږي`;if(i.format==="includes")return`ناسم متن: باید "${i.includes}" ولري`;if(i.format==="regex")return`ناسم متن: باید د ${i.pattern} سره مطابقت ولري`;return`${o[i.format]??t.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${t.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${t.keys.length>1?"کلیډونه":"کلیډ"}: ${p(t.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${t.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${t.origin} کې`;default:return"ناسمه ورودي"}}};function xs(){return{localeError:dv()}}var mv=()=>{let e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"liczba";case"object":{if(Array.isArray(t))return"tablica";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"wyrażenie",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ąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return(t)=>{switch(t.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${t.expected}, otrzymano ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${_(t.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Za duża wartość: oczekiwano, że ${t.origin??"wartość"} będzie mieć ${i}${t.maximum.toString()} ${a.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${t.origin??"wartość"} będzie wynosić ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Za mała wartość: oczekiwano, że ${t.origin??"wartość"} będzie mieć ${i}${t.minimum.toString()} ${a.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${t.origin??"wartość"} będzie wynosić ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${i.prefix}"`;if(i.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${i.suffix}"`;if(i.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${i.includes}"`;if(i.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${i.pattern}`;return`Nieprawidłow(y/a/e) ${o[i.format]??t.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${t.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${t.keys.length>1?"s":""}: ${p(t.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${t.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${t.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function ws(){return{localeError:mv()}}var pv=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"número";case"object":{if(Array.isArray(t))return"array";if(t===null)return"nulo";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"padrão",email:"endereço 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ção ISO",ipv4:"endereço IPv4",ipv6:"endereço 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úmero E.164",jwt:"JWT",template_literal:"entrada"};return(t)=>{switch(t.code){case"invalid_type":return`Tipo inválido: esperado ${t.expected}, recebido ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Entrada inválida: esperado ${_(t.values[0])}`;return`Opção inválida: esperada uma das ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Muito grande: esperado que ${t.origin??"valor"} tivesse ${i}${t.maximum.toString()} ${a.unit??"elementos"}`;return`Muito grande: esperado que ${t.origin??"valor"} fosse ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Muito pequeno: esperado que ${t.origin} tivesse ${i}${t.minimum.toString()} ${a.unit}`;return`Muito pequeno: esperado que ${t.origin} fosse ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Texto inválido: deve começar com "${i.prefix}"`;if(i.format==="ends_with")return`Texto inválido: deve terminar com "${i.suffix}"`;if(i.format==="includes")return`Texto inválido: deve incluir "${i.includes}"`;if(i.format==="regex")return`Texto inválido: deve corresponder ao padrão ${i.pattern}`;return`${o[i.format]??t.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${t.divisor}`;case"unrecognized_keys":return`Chave${t.keys.length>1?"s":""} desconhecida${t.keys.length>1?"s":""}: ${p(t.keys,", ")}`;case"invalid_key":return`Chave inválida em ${t.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${t.origin}`;default:return"Campo inválido"}}};function Ss(){return{localeError:pv()}}function Md(e,r,n,o){let t=Math.abs(e),i=t%10,a=t%100;if(a>=11&&a<=19)return o;if(i===1)return r;if(i>=2&&i<=4)return n;return o}var fv=()=>{let e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"число";case"object":{if(Array.isArray(t))return"массив";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return(t)=>{switch(t.code){case"invalid_type":return`Неверный ввод: ожидалось ${t.expected}, получено ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Неверный ввод: ожидалось ${_(t.values[0])}`;return`Неверный вариант: ожидалось одно из ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a){let s=Number(t.maximum),c=Md(s,a.unit.one,a.unit.few,a.unit.many);return`Слишком большое значение: ожидалось, что ${t.origin??"значение"} будет иметь ${i}${t.maximum.toString()} ${c}`}return`Слишком большое значение: ожидалось, что ${t.origin??"значение"} будет ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a){let s=Number(t.minimum),c=Md(s,a.unit.one,a.unit.few,a.unit.many);return`Слишком маленькое значение: ожидалось, что ${t.origin} будет иметь ${i}${t.minimum.toString()} ${c}`}return`Слишком маленькое значение: ожидалось, что ${t.origin} будет ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Неверная строка: должна начинаться с "${i.prefix}"`;if(i.format==="ends_with")return`Неверная строка: должна заканчиваться на "${i.suffix}"`;if(i.format==="includes")return`Неверная строка: должна содержать "${i.includes}"`;if(i.format==="regex")return`Неверная строка: должна соответствовать шаблону ${i.pattern}`;return`Неверный ${o[i.format]??t.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${t.divisor}`;case"unrecognized_keys":return`Нераспознанн${t.keys.length>1?"ые":"ый"} ключ${t.keys.length>1?"и":""}: ${p(t.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${t.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${t.origin}`;default:return"Неверные входные данные"}}};function Is(){return{localeError:fv()}}var gv=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"število";case"object":{if(Array.isArray(t))return"tabela";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"vnos",email:"e-poštni 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 čas",date:"ISO datum",time:"ISO čas",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 številka",jwt:"JWT",template_literal:"vnos"};return(t)=>{switch(t.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${t.expected}, prejeto ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Neveljaven vnos: pričakovano ${_(t.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Preveliko: pričakovano, da bo ${t.origin??"vrednost"} imelo ${i}${t.maximum.toString()} ${a.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${t.origin??"vrednost"} ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Premajhno: pričakovano, da bo ${t.origin} imelo ${i}${t.minimum.toString()} ${a.unit}`;return`Premajhno: pričakovano, da bo ${t.origin} ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Neveljaven niz: mora se začeti z "${i.prefix}"`;if(i.format==="ends_with")return`Neveljaven niz: mora se končati z "${i.suffix}"`;if(i.format==="includes")return`Neveljaven niz: mora vsebovati "${i.includes}"`;if(i.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`;return`Neveljaven ${o[i.format]??t.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${t.divisor}`;case"unrecognized_keys":return`Neprepoznan${t.keys.length>1?"i ključi":" ključ"}: ${p(t.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${t.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${t.origin}`;default:return"Neveljaven vnos"}}};function Ts(){return{localeError:gv()}}var hv=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"antal";case"object":{if(Array.isArray(t))return"lista";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"reguljärt 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äng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return(t)=>{switch(t.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${t.expected}, fick ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Ogiltig inmatning: förväntat ${_(t.values[0])}`;return`Ogiltigt val: förväntade en av ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`För stor(t): förväntade ${t.origin??"värdet"} att ha ${i}${t.maximum.toString()} ${a.unit??"element"}`;return`För stor(t): förväntat ${t.origin??"värdet"} att ha ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`För lite(t): förväntade ${t.origin??"värdet"} att ha ${i}${t.minimum.toString()} ${a.unit}`;return`För lite(t): förväntade ${t.origin??"värdet"} att ha ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Ogiltig sträng: måste börja med "${i.prefix}"`;if(i.format==="ends_with")return`Ogiltig sträng: måste sluta med "${i.suffix}"`;if(i.format==="includes")return`Ogiltig sträng: måste innehålla "${i.includes}"`;if(i.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${i.pattern}"`;return`Ogiltig(t) ${o[i.format]??t.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${p(t.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${t.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${t.origin??"värdet"}`;default:return"Ogiltig input"}}};function Os(){return{localeError:hv()}}var vv=()=>{let e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(t))return"அணி";if(t===null)return"வெறுமை";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"உள்ளீடு",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 தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return(t)=>{switch(t.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${t.expected}, பெறப்பட்டது ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${_(t.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${p(t.values,"|")} இல் ஒன்று`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${t.origin??"மதிப்பு"} ${i}${t.maximum.toString()} ${a.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${t.origin??"மதிப்பு"} ${i}${t.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${t.origin} ${i}${t.minimum.toString()} ${a.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${t.origin} ${i}${t.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`தவறான சரம்: "${i.prefix}" இல் தொடங்க வேண்டும்`;if(i.format==="ends_with")return`தவறான சரம்: "${i.suffix}" இல் முடிவடைய வேண்டும்`;if(i.format==="includes")return`தவறான சரம்: "${i.includes}" ஐ உள்ளடக்க வேண்டும்`;if(i.format==="regex")return`தவறான சரம்: ${i.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${o[i.format]??t.format}`}case"not_multiple_of":return`தவறான எண்: ${t.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${t.keys.length>1?"கள்":""}: ${p(t.keys,", ")}`;case"invalid_key":return`${t.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${t.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function Ds(){return{localeError:vv()}}var yv=()=>{let e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(t))return"อาร์เรย์ (Array)";if(t===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return(t)=>{switch(t.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${t.expected} แต่ได้รับ ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${_(t.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"ไม่เกิน":"น้อยกว่า",a=r(t.origin);if(a)return`เกินกำหนด: ${t.origin??"ค่า"} ควรมี${i} ${t.maximum.toString()} ${a.unit??"รายการ"}`;return`เกินกำหนด: ${t.origin??"ค่า"} ควรมี${i} ${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?"อย่างน้อย":"มากกว่า",a=r(t.origin);if(a)return`น้อยกว่ากำหนด: ${t.origin} ควรมี${i} ${t.minimum.toString()} ${a.unit}`;return`น้อยกว่ากำหนด: ${t.origin} ควรมี${i} ${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${i.prefix}"`;if(i.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${i.suffix}"`;if(i.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${i.includes}" อยู่ในข้อความ`;if(i.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${i.pattern}`;return`รูปแบบไม่ถูกต้อง: ${o[i.format]??t.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${t.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${p(t.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${t.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${t.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function Ps(){return{localeError:yv()}}var bv=(e)=>{let r=typeof e;switch(r){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return r},_v=()=>{let e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function r(o){return e[o]??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üre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"};return(o)=>{switch(o.code){case"invalid_type":return`Geçersiz değer: beklenen ${o.expected}, alınan ${bv(o.input)}`;case"invalid_value":if(o.values.length===1)return`Geçersiz değer: beklenen ${_(o.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${p(o.values,"|")}`;case"too_big":{let t=o.inclusive?"<=":"<",i=r(o.origin);if(i)return`Çok büyük: beklenen ${o.origin??"değer"} ${t}${o.maximum.toString()} ${i.unit??"öğe"}`;return`Çok büyük: beklenen ${o.origin??"değer"} ${t}${o.maximum.toString()}`}case"too_small":{let t=o.inclusive?">=":">",i=r(o.origin);if(i)return`Çok küçük: beklenen ${o.origin} ${t}${o.minimum.toString()} ${i.unit}`;return`Çok küçük: beklenen ${o.origin} ${t}${o.minimum.toString()}`}case"invalid_format":{let t=o;if(t.format==="starts_with")return`Geçersiz metin: "${t.prefix}" ile başlamalı`;if(t.format==="ends_with")return`Geçersiz metin: "${t.suffix}" ile bitmeli`;if(t.format==="includes")return`Geçersiz metin: "${t.includes}" içermeli`;if(t.format==="regex")return`Geçersiz metin: ${t.pattern} desenine uymalı`;return`Geçersiz ${n[t.format]??o.format}`}case"not_multiple_of":return`Geçersiz sayı: ${o.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${o.keys.length>1?"lar":""}: ${p(o.keys,", ")}`;case"invalid_key":return`${o.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${o.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function zs(){return{localeError:_v()}}var kv=()=>{let e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"число";case"object":{if(Array.isArray(t))return"масив";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return(t)=>{switch(t.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${t.expected}, отримано ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Неправильні вхідні дані: очікується ${_(t.values[0])}`;return`Неправильна опція: очікується одне з ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Занадто велике: очікується, що ${t.origin??"значення"} ${a.verb} ${i}${t.maximum.toString()} ${a.unit??"елементів"}`;return`Занадто велике: очікується, що ${t.origin??"значення"} буде ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Занадто мале: очікується, що ${t.origin} ${a.verb} ${i}${t.minimum.toString()} ${a.unit}`;return`Занадто мале: очікується, що ${t.origin} буде ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Неправильний рядок: повинен починатися з "${i.prefix}"`;if(i.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${i.suffix}"`;if(i.format==="includes")return`Неправильний рядок: повинен містити "${i.includes}"`;if(i.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${i.pattern}`;return`Неправильний ${o[i.format]??t.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${t.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${t.keys.length>1?"і":""}: ${p(t.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${t.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${t.origin}`;default:return"Неправильні вхідні дані"}}};function Ht(){return{localeError:kv()}}function Cs(){return Ht()}var $v=()=>{let e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"نمبر";case"object":{if(Array.isArray(t))return"آرے";if(t===null)return"نل";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return(t)=>{switch(t.code){case"invalid_type":return`غلط ان پٹ: ${t.expected} متوقع تھا، ${n(t.input)} موصول ہوا`;case"invalid_value":if(t.values.length===1)return`غلط ان پٹ: ${_(t.values[0])} متوقع تھا`;return`غلط آپشن: ${p(t.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`بہت بڑا: ${t.origin??"ویلیو"} کے ${i}${t.maximum.toString()} ${a.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${t.origin??"ویلیو"} کا ${i}${t.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`بہت چھوٹا: ${t.origin} کے ${i}${t.minimum.toString()} ${a.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${t.origin} کا ${i}${t.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`غلط سٹرنگ: "${i.prefix}" سے شروع ہونا چاہیے`;if(i.format==="ends_with")return`غلط سٹرنگ: "${i.suffix}" پر ختم ہونا چاہیے`;if(i.format==="includes")return`غلط سٹرنگ: "${i.includes}" شامل ہونا چاہیے`;if(i.format==="regex")return`غلط سٹرنگ: پیٹرن ${i.pattern} سے میچ ہونا چاہیے`;return`غلط ${o[i.format]??t.format}`}case"not_multiple_of":return`غلط نمبر: ${t.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${t.keys.length>1?"ز":""}: ${p(t.keys,"، ")}`;case"invalid_key":return`${t.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${t.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function Es(){return{localeError:$v()}}var xv=()=>{let e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"số";case"object":{if(Array.isArray(t))return"mảng";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"đầu vào",email:"địa chỉ 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ày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return(t)=>{switch(t.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${t.expected}, nhận được ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${_(t.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Quá lớn: mong đợi ${t.origin??"giá trị"} ${a.verb} ${i}${t.maximum.toString()} ${a.unit??"phần tử"}`;return`Quá lớn: mong đợi ${t.origin??"giá trị"} ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Quá nhỏ: mong đợi ${t.origin} ${a.verb} ${i}${t.minimum.toString()} ${a.unit}`;return`Quá nhỏ: mong đợi ${t.origin} ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${i.prefix}"`;if(i.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${i.suffix}"`;if(i.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${i.includes}"`;if(i.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${i.pattern}`;return`${o[i.format]??t.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${t.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${p(t.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${t.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${t.origin}`;default:return"Đầu vào không hợp lệ"}}};function js(){return{localeError:xv()}}var wv=()=>{let e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(t))return"数组";if(t===null)return"空值(null)";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return(t)=>{switch(t.code){case"invalid_type":return`无效输入:期望 ${t.expected},实际接收 ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`无效输入:期望 ${_(t.values[0])}`;return`无效选项:期望以下之一 ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`数值过大:期望 ${t.origin??"值"} ${i}${t.maximum.toString()} ${a.unit??"个元素"}`;return`数值过大:期望 ${t.origin??"值"} ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`数值过小:期望 ${t.origin} ${i}${t.minimum.toString()} ${a.unit}`;return`数值过小:期望 ${t.origin} ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`无效字符串:必须以 "${i.prefix}" 开头`;if(i.format==="ends_with")return`无效字符串:必须以 "${i.suffix}" 结尾`;if(i.format==="includes")return`无效字符串:必须包含 "${i.includes}"`;if(i.format==="regex")return`无效字符串:必须满足正则表达式 ${i.pattern}`;return`无效${o[i.format]??t.format}`}case"not_multiple_of":return`无效数字:必须是 ${t.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${p(t.keys,", ")}`;case"invalid_key":return`${t.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${t.origin} 中包含无效值(value)`;default:return"无效输入"}}};function As(){return{localeError:wv()}}var Sv=()=>{let e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"輸入",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 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return(t)=>{switch(t.code){case"invalid_type":return`無效的輸入值:預期為 ${t.expected},但收到 ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`無效的輸入值:預期為 ${_(t.values[0])}`;return`無效的選項:預期為以下其中之一 ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`數值過大:預期 ${t.origin??"值"} 應為 ${i}${t.maximum.toString()} ${a.unit??"個元素"}`;return`數值過大:預期 ${t.origin??"值"} 應為 ${i}${t.maximum.toString()}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`數值過小:預期 ${t.origin} 應為 ${i}${t.minimum.toString()} ${a.unit}`;return`數值過小:預期 ${t.origin} 應為 ${i}${t.minimum.toString()}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`無效的字串:必須以 "${i.prefix}" 開頭`;if(i.format==="ends_with")return`無效的字串:必須以 "${i.suffix}" 結尾`;if(i.format==="includes")return`無效的字串:必須包含 "${i.includes}"`;if(i.format==="regex")return`無效的字串:必須符合格式 ${i.pattern}`;return`無效的 ${o[i.format]??t.format}`}case"not_multiple_of":return`無效的數字:必須為 ${t.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${t.keys.length>1?"們":""}:${p(t.keys,"、")}`;case"invalid_key":return`${t.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${t.origin} 中有無效的值`;default:return"無效的輸入值"}}};function Ms(){return{localeError:Sv()}}var Iv=()=>{let e={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function r(t){return e[t]??null}let n=(t)=>{let i=typeof t;switch(i){case"number":return Number.isNaN(t)?"NaN":"nọ́mbà";case"object":{if(Array.isArray(t))return"akopọ";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return i},o={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",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:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"};return(t)=>{switch(t.code){case"invalid_type":return`Ìbáwọlé aṣìṣe: a ní láti fi ${t.expected}, àmọ̀ a rí ${n(t.input)}`;case"invalid_value":if(t.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${_(t.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${p(t.values,"|")}`;case"too_big":{let i=t.inclusive?"<=":"<",a=r(t.origin);if(a)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${t.origin??"iye"} ${a.verb} ${i}${t.maximum} ${a.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${i}${t.maximum}`}case"too_small":{let i=t.inclusive?">=":">",a=r(t.origin);if(a)return`Kéré ju: a ní láti jẹ́ pé ${t.origin} ${a.verb} ${i}${t.minimum} ${a.unit}`;return`Kéré ju: a ní láti jẹ́ ${i}${t.minimum}`}case"invalid_format":{let i=t;if(i.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${i.prefix}"`;if(i.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${i.suffix}"`;if(i.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${i.includes}"`;if(i.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${i.pattern}`;return`Aṣìṣe: ${o[i.format]??t.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${t.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${p(t.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${t.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${t.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function Rs(){return{localeError:Iv()}}var Ns=Symbol("ZodOutput"),Us=Symbol("ZodInput");class qt{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];if(this._map.set(e,n),n&&typeof n==="object"&&"id"in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);if(r&&typeof r==="object"&&"id"in r)this._idmap.delete(r.id);return this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function pn(){return new qt}var Oe=pn();function Ls(e,r){return new e({type:"string",...k(r)})}function Zs(e,r){return new e({type:"string",coerce:!0,...k(r)})}function fn(e,r){return new e({type:"string",format:"email",check:"string_format",abort:!1,...k(r)})}function Kt(e,r){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...k(r)})}function gn(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...k(r)})}function hn(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...k(r)})}function vn(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...k(r)})}function yn(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...k(r)})}function Xt(e,r){return new e({type:"string",format:"url",check:"string_format",abort:!1,...k(r)})}function bn(e,r){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...k(r)})}function _n(e,r){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...k(r)})}function kn(e,r){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...k(r)})}function $n(e,r){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...k(r)})}function xn(e,r){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...k(r)})}function wn(e,r){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...k(r)})}function Sn(e,r){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...k(r)})}function In(e,r){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...k(r)})}function Tn(e,r){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...k(r)})}function On(e,r){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...k(r)})}function Dn(e,r){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...k(r)})}function Pn(e,r){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...k(r)})}function zn(e,r){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...k(r)})}function Cn(e,r){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...k(r)})}function En(e,r){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...k(r)})}var Fs={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Gs(e,r){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...k(r)})}function Vs(e,r){return new e({type:"string",format:"date",check:"string_format",...k(r)})}function Ws(e,r){return new e({type:"string",format:"time",check:"string_format",precision:null,...k(r)})}function Bs(e,r){return new e({type:"string",format:"duration",check:"string_format",...k(r)})}function Hs(e,r){return new e({type:"number",checks:[],...k(r)})}function Js(e,r){return new e({type:"number",coerce:!0,checks:[],...k(r)})}function qs(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...k(r)})}function Ks(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...k(r)})}function Xs(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...k(r)})}function Ys(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...k(r)})}function Qs(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...k(r)})}function ec(e,r){return new e({type:"boolean",...k(r)})}function tc(e,r){return new e({type:"boolean",coerce:!0,...k(r)})}function rc(e,r){return new e({type:"bigint",...k(r)})}function nc(e,r){return new e({type:"bigint",coerce:!0,...k(r)})}function oc(e,r){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...k(r)})}function ic(e,r){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...k(r)})}function ac(e,r){return new e({type:"symbol",...k(r)})}function sc(e,r){return new e({type:"undefined",...k(r)})}function cc(e,r){return new e({type:"null",...k(r)})}function lc(e){return new e({type:"any"})}function uc(e){return new e({type:"unknown"})}function dc(e,r){return new e({type:"never",...k(r)})}function mc(e,r){return new e({type:"void",...k(r)})}function pc(e,r){return new e({type:"date",...k(r)})}function fc(e,r){return new e({type:"date",coerce:!0,...k(r)})}function gc(e,r){return new e({type:"nan",...k(r)})}function De(e,r){return new en({check:"less_than",...k(r),value:e,inclusive:!1})}function ye(e,r){return new en({check:"less_than",...k(r),value:e,inclusive:!0})}function Pe(e,r){return new tn({check:"greater_than",...k(r),value:e,inclusive:!1})}function le(e,r){return new tn({check:"greater_than",...k(r),value:e,inclusive:!0})}function hc(e){return Pe(0,e)}function vc(e){return De(0,e)}function yc(e){return ye(0,e)}function bc(e){return le(0,e)}function Xe(e,r){return new $i({check:"multiple_of",...k(r),value:e})}function pt(e,r){return new Si({check:"max_size",...k(r),maximum:e})}function Ye(e,r){return new Ii({check:"min_size",...k(r),minimum:e})}function Yt(e,r){return new Ti({check:"size_equals",...k(r),size:e})}function ft(e,r){return new Oi({check:"max_length",...k(r),maximum:e})}function Ue(e,r){return new Di({check:"min_length",...k(r),minimum:e})}function gt(e,r){return new Pi({check:"length_equals",...k(r),length:e})}function Qt(e,r){return new zi({check:"string_format",format:"regex",...k(r),pattern:e})}function er(e){return new Ci({check:"string_format",format:"lowercase",...k(e)})}function tr(e){return new Ei({check:"string_format",format:"uppercase",...k(e)})}function rr(e,r){return new ji({check:"string_format",format:"includes",...k(r),includes:e})}function nr(e,r){return new Ai({check:"string_format",format:"starts_with",...k(r),prefix:e})}function or(e,r){return new Mi({check:"string_format",format:"ends_with",...k(r),suffix:e})}function _c(e,r,n){return new Ri({check:"property",property:e,schema:r,...k(n)})}function ir(e,r){return new Ni({check:"mime_type",mime:e,...k(r)})}function ze(e){return new Ui({check:"overwrite",tx:e})}function ar(e){return ze((r)=>r.normalize(e))}function sr(){return ze((e)=>e.trim())}function cr(){return ze((e)=>e.toLowerCase())}function lr(){return ze((e)=>e.toUpperCase())}function kc(e,r,n){return new e({type:"array",element:r,...k(n)})}function Tv(e,r,n){return new e({type:"union",options:r,...k(n)})}function Ov(e,r,n,o){return new e({type:"union",options:n,discriminator:r,...k(o)})}function Dv(e,r,n){return new e({type:"intersection",left:r,right:n})}function Pv(e,r,n,o){let t=n instanceof D;return new e({type:"tuple",items:r,rest:t?n:null,...k(t?o:n)})}function zv(e,r,n,o){return new e({type:"record",keyType:r,valueType:n,...k(o)})}function Cv(e,r,n,o){return new e({type:"map",keyType:r,valueType:n,...k(o)})}function Ev(e,r,n){return new e({type:"set",valueType:r,...k(n)})}function jv(e,r,n){let o=Array.isArray(r)?Object.fromEntries(r.map((t)=>[t,t])):r;return new e({type:"enum",entries:o,...k(n)})}function Av(e,r,n){return new e({type:"enum",entries:r,...k(n)})}function Mv(e,r,n){return new e({type:"literal",values:Array.isArray(r)?r:[r],...k(n)})}function $c(e,r){return new e({type:"file",...k(r)})}function Rv(e,r){return new e({type:"transform",transform:r})}function Nv(e,r){return new e({type:"optional",innerType:r})}function Uv(e,r){return new e({type:"nullable",innerType:r})}function Lv(e,r,n){return new e({type:"default",innerType:r,get defaultValue(){return typeof n==="function"?n():No(n)}})}function Zv(e,r,n){return new e({type:"nonoptional",innerType:r,...k(n)})}function Fv(e,r){return new e({type:"success",innerType:r})}function Gv(e,r,n){return new e({type:"catch",innerType:r,catchValue:typeof n==="function"?n:()=>n})}function Vv(e,r,n){return new e({type:"pipe",in:r,out:n})}function Wv(e,r){return new e({type:"readonly",innerType:r})}function Bv(e,r,n){return new e({type:"template_literal",parts:r,...k(n)})}function Hv(e,r){return new e({type:"lazy",getter:r})}function Jv(e,r){return new e({type:"promise",innerType:r})}function xc(e,r,n){let o=k(n);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:r,...o})}function wc(e,r,n){return new e({type:"custom",check:"custom",fn:r,...k(n)})}function Sc(e){let r=Rd((n)=>(n.addIssue=(o)=>{if(typeof o==="string")n.issues.push(st(o,n.value,r._zod.def));else{let t=o;if(t.fatal)t.continue=!1;t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=r),t.continue??(t.continue=!r._zod.def.abort),n.issues.push(st(t))}},e(n.value,n)));return r}function Rd(e,r){let n=new W({check:"custom",...k(r)});return n._zod.check=e,n}function Ic(e,r){let n=k(r),o=n.truthy??["true","1","yes","on","y","enabled"],t=n.falsy??["false","0","no","off","n","disabled"];if(n.case!=="sensitive")o=o.map((u)=>typeof u==="string"?u.toLowerCase():u),t=t.map((u)=>typeof u==="string"?u.toLowerCase():u);let i=new Set(o),a=new Set(t),s=e.Codec??Ft,c=e.Boolean??Zt,d=new(e.String??Ke)({type:"string",error:n.error}),v=new c({type:"boolean",error:n.error}),h=new s({type:"pipe",in:d,out:v,transform:(u,y)=>{let x=u;if(n.case!=="sensitive")x=x.toLowerCase();if(i.has(x))return!0;else if(a.has(x))return!1;else return y.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:y.value,inst:h,continue:!1}),{}},reverseTransform:(u,y)=>{if(u===!0)return o[0]||"true";else return t[0]||"false"},error:n.error});return h}function ht(e,r,n,o={}){let t=k(o),i={...k(o),check:"string_format",type:"string",format:r,fn:typeof n==="function"?n:(s)=>n.test(s),...t};if(n instanceof RegExp)i.pattern=n;return new e(i)}class jn{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??Oe,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,t={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},i=this.seen.get(e);if(i){if(i.count++,r.schemaPath.includes(e))i.cycle=r.path;return i.schema}let a={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(e,a);let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let d={...r,schemaPath:[...r.schemaPath,e],path:r.path},v=e._zod.parent;if(v)a.ref=v,this.process(v,d),this.seen.get(v).isParent=!0;else{let h=a.schema;switch(o.type){case"string":{let u=h;u.type="string";let{minimum:y,maximum:x,format:j,patterns:A,contentEncoding:G}=e._zod.bag;if(typeof y==="number")u.minLength=y;if(typeof x==="number")u.maxLength=x;if(j){if(u.format=t[j]??j,u.format==="")delete u.format}if(G)u.contentEncoding=G;if(A&&A.size>0){let N=[...A];if(N.length===1)u.pattern=N[0].source;else if(N.length>1)a.schema.allOf=[...N.map((X)=>({...this.target==="draft-7"||this.target==="draft-4"||this.target==="openapi-3.0"?{type:"string"}:{},pattern:X.source}))]}break}case"number":{let u=h,{minimum:y,maximum:x,format:j,multipleOf:A,exclusiveMaximum:G,exclusiveMinimum:N}=e._zod.bag;if(typeof j==="string"&&j.includes("int"))u.type="integer";else u.type="number";if(typeof N==="number")if(this.target==="draft-4"||this.target==="openapi-3.0")u.minimum=N,u.exclusiveMinimum=!0;else u.exclusiveMinimum=N;if(typeof y==="number"){if(u.minimum=y,typeof N==="number"&&this.target!=="draft-4")if(N>=y)delete u.minimum;else delete u.exclusiveMinimum}if(typeof G==="number")if(this.target==="draft-4"||this.target==="openapi-3.0")u.maximum=G,u.exclusiveMaximum=!0;else u.exclusiveMaximum=G;if(typeof x==="number"){if(u.maximum=x,typeof G==="number"&&this.target!=="draft-4")if(G<=x)delete u.maximum;else delete u.exclusiveMaximum}if(typeof A==="number")u.multipleOf=A;break}case"boolean":{let u=h;u.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{if(this.target==="openapi-3.0")h.type="string",h.nullable=!0,h.enum=[null];else h.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"never":{h.not={};break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let u=h,{minimum:y,maximum:x}=e._zod.bag;if(typeof y==="number")u.minItems=y;if(typeof x==="number")u.maxItems=x;u.type="array",u.items=this.process(o.element,{...d,path:[...d.path,"items"]});break}case"object":{let u=h;u.type="object",u.properties={};let y=o.shape;for(let A in y)u.properties[A]=this.process(y[A],{...d,path:[...d.path,"properties",A]});let x=new Set(Object.keys(y)),j=new Set([...x].filter((A)=>{let G=o.shape[A]._zod;if(this.io==="input")return G.optin===void 0;else return G.optout===void 0}));if(j.size>0)u.required=Array.from(j);if(o.catchall?._zod.def.type==="never")u.additionalProperties=!1;else if(!o.catchall){if(this.io==="output")u.additionalProperties=!1}else if(o.catchall)u.additionalProperties=this.process(o.catchall,{...d,path:[...d.path,"additionalProperties"]});break}case"union":{let u=h,y=o.options.map((x,j)=>this.process(x,{...d,path:[...d.path,"anyOf",j]}));u.anyOf=y;break}case"intersection":{let u=h,y=this.process(o.left,{...d,path:[...d.path,"allOf",0]}),x=this.process(o.right,{...d,path:[...d.path,"allOf",1]}),j=(G)=>("allOf"in G)&&Object.keys(G).length===1,A=[...j(y)?y.allOf:[y],...j(x)?x.allOf:[x]];u.allOf=A;break}case"tuple":{let u=h;u.type="array";let y=this.target==="draft-2020-12"?"prefixItems":"items",x=this.target==="draft-2020-12"?"items":this.target==="openapi-3.0"?"items":"additionalItems",j=o.items.map((X,he)=>this.process(X,{...d,path:[...d.path,y,he]})),A=o.rest?this.process(o.rest,{...d,path:[...d.path,x,...this.target==="openapi-3.0"?[o.items.length]:[]]}):null;if(this.target==="draft-2020-12"){if(u.prefixItems=j,A)u.items=A}else if(this.target==="openapi-3.0"){if(u.items={anyOf:j},A)u.items.anyOf.push(A);if(u.minItems=j.length,!A)u.maxItems=j.length}else if(u.items=j,A)u.additionalItems=A;let{minimum:G,maximum:N}=e._zod.bag;if(typeof G==="number")u.minItems=G;if(typeof N==="number")u.maxItems=N;break}case"record":{let u=h;if(u.type="object",this.target==="draft-7"||this.target==="draft-2020-12")u.propertyNames=this.process(o.keyType,{...d,path:[...d.path,"propertyNames"]});u.additionalProperties=this.process(o.valueType,{...d,path:[...d.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let u=h,y=zt(o.entries);if(y.every((x)=>typeof x==="number"))u.type="number";if(y.every((x)=>typeof x==="string"))u.type="string";u.enum=y;break}case"literal":{let u=h,y=[];for(let x of o.values)if(x===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof x==="bigint")if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else y.push(Number(x));else y.push(x);if(y.length===0);else if(y.length===1){let x=y[0];if(u.type=x===null?"null":typeof x,this.target==="draft-4"||this.target==="openapi-3.0")u.enum=[x];else u.const=x}else{if(y.every((x)=>typeof x==="number"))u.type="number";if(y.every((x)=>typeof x==="string"))u.type="string";if(y.every((x)=>typeof x==="boolean"))u.type="string";if(y.every((x)=>x===null))u.type="null";u.enum=y}break}case"file":{let u=h,y={type:"string",format:"binary",contentEncoding:"binary"},{minimum:x,maximum:j,mime:A}=e._zod.bag;if(x!==void 0)y.minLength=x;if(j!==void 0)y.maxLength=j;if(A)if(A.length===1)y.contentMediaType=A[0],Object.assign(u,y);else u.anyOf=A.map((G)=>({...y,contentMediaType:G}));else Object.assign(u,y);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let u=this.process(o.innerType,d);if(this.target==="openapi-3.0")a.ref=o.innerType,h.nullable=!0;else h.anyOf=[u,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,d),a.ref=o.innerType;break}case"success":{let u=h;u.type="boolean";break}case"default":{this.process(o.innerType,d),a.ref=o.innerType,h.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{if(this.process(o.innerType,d),a.ref=o.innerType,this.io==="input")h._prefault=JSON.parse(JSON.stringify(o.defaultValue));break}case"catch":{this.process(o.innerType,d),a.ref=o.innerType;let u;try{u=o.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}h.default=u;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let u=h,y=e._zod.pattern;if(!y)throw Error("Pattern not found in template literal");u.type="string",u.pattern=y.source;break}case"pipe":{let u=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(u,d),a.ref=u;break}case"readonly":{this.process(o.innerType,d),a.ref=o.innerType,h.readOnly=!0;break}case"promise":{this.process(o.innerType,d),a.ref=o.innerType;break}case"optional":{this.process(o.innerType,d),a.ref=o.innerType;break}case"lazy":{let u=e._zod.innerType;this.process(u,d),a.ref=u;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}case"function":{if(this.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema");break}default:}}}let c=this.metadataRegistry.get(e);if(c)Object.assign(a.schema,c);if(this.io==="input"&&Q(e))delete a.schema.examples,delete a.schema.default;if(this.io==="input"&&a.schema._prefault)(n=a.schema).default??(n.default=a.schema._prefault);return delete a.schema._prefault,this.seen.get(e).schema}emit(e,r){let n={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},o=this.seen.get(e);if(!o)throw Error("Unprocessed schema. This is a bug in Zod.");let t=(l)=>{let d=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let y=n.external.registry.get(l[0])?.id,x=n.external.uri??((A)=>A);if(y)return{ref:x(y)};let j=l[1].defId??l[1].schema.id??`schema${this.counter++}`;return l[1].defId=j,{defId:j,ref:`${x("__shared")}#/${d}/${j}`}}if(l[1]===o)return{ref:"#"};let h=`${"#"}/${d}/`,u=l[1].schema.id??`__schema${this.counter++}`;return{defId:u,ref:h+u}},i=(l)=>{if(l[1].schema.$ref)return;let d=l[1],{ref:v,defId:h}=t(l);if(d.def={...d.schema},h)d.defId=h;let u=d.schema;for(let y in u)delete u[y];u.$ref=v};if(n.cycles==="throw")for(let l of this.seen.entries()){let d=l[1];if(d.cycle)throw Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
|
|
134
134
|
|
|
135
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let I of this.seen.entries()){let k=I[1];if($===I[0]){z(I);continue}if(r.external){let X=r.external.registry.get(I[0])?.id;if($!==I[0]&&X){z(I);continue}}if(this.metadataRegistry.get(I[0])?.id){z(I);continue}if(k.cycle){z(I);continue}if(k.count>1){if(r.reused==="ref"){z(I);continue}}}let _=(I,k)=>{let W=this.seen.get(I),X=W.def??W.schema,w={...X};if(W.ref===null)return;let j=W.ref;if(W.ref=null,j){_(j,k);let B=this.seen.get(j).schema;if(B.$ref&&(k.target==="draft-7"||k.target==="draft-4"||k.target==="openapi-3.0"))X.allOf=X.allOf??[],X.allOf.push(B);else Object.assign(X,B),Object.assign(X,w)}if(!W.isParent)this.override({zodSchema:I,jsonSchema:X,path:W.path??[]})};for(let I of[...this.seen.entries()].reverse())_(I[0],{target:this.target});let N={};if(this.target==="draft-2020-12")N.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")N.$schema="http://json-schema.org/draft-07/schema#";else if(this.target==="draft-4")N.$schema="http://json-schema.org/draft-04/schema#";else if(this.target==="openapi-3.0");else console.warn(`Invalid target: ${this.target}`);if(r.external?.uri){let I=r.external.registry.get($)?.id;if(!I)throw Error("Schema is missing an `id` property");N.$id=r.external.uri(I)}Object.assign(N,b.def);let O=r.external?.defs??{};for(let I of this.seen.entries()){let k=I[1];if(k.def&&k.defId)O[k.defId]=k.def}if(r.external);else if(Object.keys(O).length>0)if(this.target==="draft-2020-12")N.$defs=O;else N.definitions=O;try{return JSON.parse(JSON.stringify(N))}catch(I){throw Error("Error converting schema to JSON.")}}}function Xz($,U){if($ instanceof yv){let b=new H6(U),v={};for(let N of $._idmap.entries()){let[O,I]=N;b.process(I)}let z={},_={registry:$,uri:U?.uri,defs:v};for(let N of $._idmap.entries()){let[O,I]=N;z[O]=b.emit(I,{...U,external:_})}if(Object.keys(v).length>0){let N=b.target==="draft-2020-12"?"$defs":"definitions";z.__shared={[N]:v}}return{schemas:z}}let r=new H6(U);return r.process($),r.emit($,U)}function e($,U){let r=U??{seen:new Set};if(r.seen.has($))return!1;r.seen.add($);let v=$._zod.def;switch(v.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return e(v.element,r);case"object":{for(let z in v.shape)if(e(v.shape[z],r))return!0;return!1}case"union":{for(let z of v.options)if(e(z,r))return!0;return!1}case"intersection":return e(v.left,r)||e(v.right,r);case"tuple":{for(let z of v.items)if(e(z,r))return!0;if(v.rest&&e(v.rest,r))return!0;return!1}case"record":return e(v.keyType,r)||e(v.valueType,r);case"map":return e(v.keyType,r)||e(v.valueType,r);case"set":return e(v.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return e(v.innerType,r);case"lazy":return e(v.getter(),r);case"default":return e(v.innerType,r);case"prefault":return e(v.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return e(v.in,r)||e(v.out,r);case"success":return!1;case"catch":return!1;case"function":return!1;default:}throw Error(`Unknown schema type: ${v.type}`)}var AO={};var F6={};k$(F6,{time:()=>Yz,duration:()=>jz,datetime:()=>Wz,date:()=>Qz,ZodISOTime:()=>G6,ZodISODuration:()=>S6,ZodISODateTime:()=>E6,ZodISODate:()=>A6});var E6=J("ZodISODateTime",($,U)=>{ur.init($,U),h.init($,U)});function Wz($){return M1(E6,$)}var A6=J("ZodISODate",($,U)=>{hr.init($,U),h.init($,U)});function Qz($){return Z1(A6,$)}var G6=J("ZodISOTime",($,U)=>{nr.init($,U),h.init($,U)});function Yz($){return D1(G6,$)}var S6=J("ZodISODuration",($,U)=>{yr.init($,U),h.init($,U)});function jz($){return x1(S6,$)}var SO=($,U)=>{Mv.init($,U),$.name="ZodError",Object.defineProperties($,{format:{value:(r)=>Dv($,r)},flatten:{value:(r)=>Zv($,r)},addIssue:{value:(r)=>{$.issues.push(r),$.message=JSON.stringify($.issues,Uv,2)}},addIssues:{value:(r)=>{$.issues.push(...r),$.message=JSON.stringify($.issues,Uv,2)}},isEmpty:{get(){return $.issues.length===0}}})},Rw=J("ZodError",SO),N$=J("ZodError",SO,{Parent:Error});var Pz=zv(N$),Vz=_v(N$),qz=Nv(N$),Bz=Ov(N$),Lz=m4(N$),Hz=T4(N$),Ez=C4(N$),Az=c4(N$),Gz=u4(N$),Sz=h4(N$),Fz=n4(N$),Mz=y4(N$);var F=J("ZodType",($,U)=>{return A.init($,U),$.def=U,$.type=U.type,Object.defineProperty($,"_def",{value:U}),$.check=(...r)=>{return $.clone({...U,checks:[...U.checks??[],...r.map((b)=>typeof b==="function"?{_zod:{check:b,def:{check:"custom"},onattach:[]}}:b)]})},$.clone=(r,b)=>U$($,r,b),$.brand=()=>$,$.register=(r,b)=>{return r.add($,b),$},$.parse=(r,b)=>Pz($,r,b,{callee:$.parse}),$.safeParse=(r,b)=>qz($,r,b),$.parseAsync=async(r,b)=>Vz($,r,b,{callee:$.parseAsync}),$.safeParseAsync=async(r,b)=>Bz($,r,b),$.spa=$.safeParseAsync,$.encode=(r,b)=>Lz($,r,b),$.decode=(r,b)=>Hz($,r,b),$.encodeAsync=async(r,b)=>Ez($,r,b),$.decodeAsync=async(r,b)=>Az($,r,b),$.safeEncode=(r,b)=>Gz($,r,b),$.safeDecode=(r,b)=>Sz($,r,b),$.safeEncodeAsync=async(r,b)=>Fz($,r,b),$.safeDecodeAsync=async(r,b)=>Mz($,r,b),$.refine=(r,b)=>$.check(XI(r,b)),$.superRefine=(r)=>$.check(WI(r)),$.overwrite=(r)=>$.check(M$(r)),$.optional=()=>Z6($),$.nullable=()=>D6($),$.nullish=()=>Z6(D6($)),$.nonoptional=(r)=>UI($,r),$.array=()=>m6($),$.or=(r)=>sz([$,r]),$.and=(r)=>nO($,r),$.transform=(r)=>x6($,U_(r)),$.default=(r)=>sO($,r),$.prefault=(r)=>vI($,r),$.catch=(r)=>zI($,r),$.pipe=(r)=>x6($,r),$.readonly=()=>OI($),$.describe=(r)=>{let b=$.clone();return A$.add(b,{description:r}),b},Object.defineProperty($,"description",{get(){return A$.get($)?.description},configurable:!0}),$.meta=(...r)=>{if(r.length===0)return A$.get($);let b=$.clone();return A$.add(b,r[0]),b},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$}),xz=J("_ZodString",($,U)=>{l$.init($,U),F.init($,U);let r=$._zod.bag;$.format=r.format??null,$.minLength=r.minimum??null,$.maxLength=r.maximum??null,$.regex=(...b)=>$.check(ov(...b)),$.includes=(...b)=>$.check(tv(...b)),$.startsWith=(...b)=>$.check(ev(...b)),$.endsWith=(...b)=>$.check(av(...b)),$.min=(...b)=>$.check(C$(...b)),$.max=(...b)=>$.check(Jv(...b)),$.length=(...b)=>$.check(wv(...b)),$.nonempty=(...b)=>$.check(C$(1,...b)),$.lowercase=(b)=>$.check(dv(b)),$.uppercase=(b)=>$.check(pv(b)),$.trim=()=>$.check(v4()),$.normalize=(...b)=>$.check($4(...b)),$.toLowerCase=()=>$.check(U4()),$.toUpperCase=()=>$.check(r4())}),z4=J("ZodString",($,U)=>{l$.init($,U),xz.init($,U),$.email=(r)=>$.check(b6(gz,r)),$.url=(r)=>$.check(iv(g6,r)),$.jwt=(r)=>$.check(L6(pz,r)),$.emoji=(r)=>$.check(I6(Rz,r)),$.guid=(r)=>$.check(fv(M6,r)),$.uuid=(r)=>$.check(z6(D$,r)),$.uuidv4=(r)=>$.check(_6(D$,r)),$.uuidv6=(r)=>$.check(N6(D$,r)),$.uuidv7=(r)=>$.check(O6(D$,r)),$.nanoid=(r)=>$.check(k6(mz,r)),$.guid=(r)=>$.check(fv(M6,r)),$.cuid=(r)=>$.check(J6(Tz,r)),$.cuid2=(r)=>$.check(w6(Cz,r)),$.ulid=(r)=>$.check(K6(cz,r)),$.base64=(r)=>$.check(V6(lz,r)),$.base64url=(r)=>$.check(q6(oz,r)),$.xid=(r)=>$.check(X6(uz,r)),$.ksuid=(r)=>$.check(W6(hz,r)),$.ipv4=(r)=>$.check(Q6(nz,r)),$.ipv6=(r)=>$.check(Y6(yz,r)),$.cidrv4=(r)=>$.check(j6(fz,r)),$.cidrv6=(r)=>$.check(P6(iz,r)),$.e164=(r)=>$.check(B6(dz,r)),$.datetime=(r)=>$.check(Wz(r)),$.date=(r)=>$.check(Qz(r)),$.time=(r)=>$.check(Yz(r)),$.duration=(r)=>$.check(jz(r))});function Zz($){return G1(z4,$)}var h=J("ZodStringFormat",($,U)=>{c.init($,U),xz.init($,U)}),gz=J("ZodEmail",($,U)=>{Zr.init($,U),h.init($,U)});function Tw($){return b6(gz,$)}var M6=J("ZodGUID",($,U)=>{Fr.init($,U),h.init($,U)});function Cw($){return fv(M6,$)}var D$=J("ZodUUID",($,U)=>{Mr.init($,U),h.init($,U)});function cw($){return z6(D$,$)}function uw($){return _6(D$,$)}function hw($){return N6(D$,$)}function nw($){return O6(D$,$)}var g6=J("ZodURL",($,U)=>{Dr.init($,U),h.init($,U)});function yw($){return iv(g6,$)}function fw($){return iv(g6,{protocol:/^https?$/,hostname:W$.domain,...P.normalizeParams($)})}var Rz=J("ZodEmoji",($,U)=>{xr.init($,U),h.init($,U)});function iw($){return I6(Rz,$)}var mz=J("ZodNanoID",($,U)=>{gr.init($,U),h.init($,U)});function lw($){return k6(mz,$)}var Tz=J("ZodCUID",($,U)=>{Rr.init($,U),h.init($,U)});function ow($){return J6(Tz,$)}var Cz=J("ZodCUID2",($,U)=>{mr.init($,U),h.init($,U)});function dw($){return w6(Cz,$)}var cz=J("ZodULID",($,U)=>{Tr.init($,U),h.init($,U)});function pw($){return K6(cz,$)}var uz=J("ZodXID",($,U)=>{Cr.init($,U),h.init($,U)});function tw($){return X6(uz,$)}var hz=J("ZodKSUID",($,U)=>{cr.init($,U),h.init($,U)});function ew($){return W6(hz,$)}var nz=J("ZodIPv4",($,U)=>{fr.init($,U),h.init($,U)});function aw($){return Q6(nz,$)}var yz=J("ZodIPv6",($,U)=>{ir.init($,U),h.init($,U)});function sw($){return Y6(yz,$)}var fz=J("ZodCIDRv4",($,U)=>{lr.init($,U),h.init($,U)});function $K($){return j6(fz,$)}var iz=J("ZodCIDRv6",($,U)=>{or.init($,U),h.init($,U)});function vK($){return P6(iz,$)}var lz=J("ZodBase64",($,U)=>{pr.init($,U),h.init($,U)});function UK($){return V6(lz,$)}var oz=J("ZodBase64URL",($,U)=>{tr.init($,U),h.init($,U)});function rK($){return q6(oz,$)}var dz=J("ZodE164",($,U)=>{er.init($,U),h.init($,U)});function bK($){return B6(dz,$)}var pz=J("ZodJWT",($,U)=>{ar.init($,U),h.init($,U)});function zK($){return L6(pz,$)}var _4=J("ZodCustomStringFormat",($,U)=>{sr.init($,U),h.init($,U)});function _K($,U,r={}){return Kv(_4,$,U,r)}function NK($){return Kv(_4,"hostname",W$.hostname,$)}function OK($){return Kv(_4,"hex",W$.hex,$)}function IK($,U){let r=U?.enc??"hex",b=`${$}_${r}`,v=W$[b];if(!v)throw Error(`Unrecognized hash format: ${b}`);return Kv(_4,b,v,U)}var N4=J("ZodNumber",($,U)=>{s4.init($,U),F.init($,U),$.gt=(b,v)=>$.check(F$(b,v)),$.gte=(b,v)=>$.check(_$(b,v)),$.min=(b,v)=>$.check(_$(b,v)),$.lt=(b,v)=>$.check(S$(b,v)),$.lte=(b,v)=>$.check(Q$(b,v)),$.max=(b,v)=>$.check(Q$(b,v)),$.int=(b)=>$.check(Dz(b)),$.safe=(b)=>$.check(Dz(b)),$.positive=(b)=>$.check(F$(0,b)),$.nonnegative=(b)=>$.check(_$(0,b)),$.negative=(b)=>$.check(S$(0,b)),$.nonpositive=(b)=>$.check(Q$(0,b)),$.multipleOf=(b,v)=>$.check(o$(b,v)),$.step=(b,v)=>$.check(o$(b,v)),$.finite=()=>$;let r=$._zod.bag;$.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??0.5),$.isFinite=!0,$.format=r.format??null});function FO($){return g1(N4,$)}var Wv=J("ZodNumberFormat",($,U)=>{$b.init($,U),N4.init($,U)});function Dz($){return m1(Wv,$)}function kK($){return T1(Wv,$)}function JK($){return C1(Wv,$)}function wK($){return c1(Wv,$)}function KK($){return u1(Wv,$)}var O4=J("ZodBoolean",($,U)=>{Rv.init($,U),F.init($,U)});function MO($){return h1(O4,$)}var I4=J("ZodBigInt",($,U)=>{$6.init($,U),F.init($,U),$.gte=(b,v)=>$.check(_$(b,v)),$.min=(b,v)=>$.check(_$(b,v)),$.gt=(b,v)=>$.check(F$(b,v)),$.gte=(b,v)=>$.check(_$(b,v)),$.min=(b,v)=>$.check(_$(b,v)),$.lt=(b,v)=>$.check(S$(b,v)),$.lte=(b,v)=>$.check(Q$(b,v)),$.max=(b,v)=>$.check(Q$(b,v)),$.positive=(b)=>$.check(F$(BigInt(0),b)),$.negative=(b)=>$.check(S$(BigInt(0),b)),$.nonpositive=(b)=>$.check(Q$(BigInt(0),b)),$.nonnegative=(b)=>$.check(_$(BigInt(0),b)),$.multipleOf=(b,v)=>$.check(o$(b,v));let r=$._zod.bag;$.minValue=r.minimum??null,$.maxValue=r.maximum??null,$.format=r.format??null});function XK($){return y1(I4,$)}var tz=J("ZodBigIntFormat",($,U)=>{vb.init($,U),I4.init($,U)});function WK($){return i1(tz,$)}function QK($){return l1(tz,$)}var ZO=J("ZodSymbol",($,U)=>{Ub.init($,U),F.init($,U)});function YK($){return o1(ZO,$)}var DO=J("ZodUndefined",($,U)=>{rb.init($,U),F.init($,U)});function jK($){return d1(DO,$)}var xO=J("ZodNull",($,U)=>{bb.init($,U),F.init($,U)});function gO($){return p1(xO,$)}var RO=J("ZodAny",($,U)=>{zb.init($,U),F.init($,U)});function PK(){return t1(RO)}var mO=J("ZodUnknown",($,U)=>{_b.init($,U),F.init($,U)});function Xv(){return e1(mO)}var TO=J("ZodNever",($,U)=>{Nb.init($,U),F.init($,U)});function ez($){return a1(TO,$)}var CO=J("ZodVoid",($,U)=>{Ob.init($,U),F.init($,U)});function VK($){return s1(CO,$)}var R6=J("ZodDate",($,U)=>{Ib.init($,U),F.init($,U),$.min=(b,v)=>$.check(_$(b,v)),$.max=(b,v)=>$.check(Q$(b,v));let r=$._zod.bag;$.minDate=r.minimum?new Date(r.minimum):null,$.maxDate=r.maximum?new Date(r.maximum):null});function qK($){return $z(R6,$)}var cO=J("ZodArray",($,U)=>{kb.init($,U),F.init($,U),$.element=U.element,$.min=(r,b)=>$.check(C$(r,b)),$.nonempty=(r)=>$.check(C$(1,r)),$.max=(r,b)=>$.check(Jv(r,b)),$.length=(r,b)=>$.check(wv(r,b)),$.unwrap=()=>$.element});function m6($,U){return Oz(cO,$,U)}function BK($){let U=$._zod.def.shape;return v_(Object.keys(U))}var T6=J("ZodObject",($,U)=>{Jb.init($,U),F.init($,U),P.defineLazy($,"shape",()=>U.shape),$.keyof=()=>v_(Object.keys($._zod.def.shape)),$.catchall=(r)=>$.clone({...$._zod.def,catchall:r}),$.passthrough=()=>$.clone({...$._zod.def,catchall:Xv()}),$.loose=()=>$.clone({...$._zod.def,catchall:Xv()}),$.strict=()=>$.clone({...$._zod.def,catchall:ez()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(r)=>{return P.extend($,r)},$.safeExtend=(r)=>{return P.safeExtend($,r)},$.merge=(r)=>P.merge($,r),$.pick=(r)=>P.pick($,r),$.omit=(r)=>P.omit($,r),$.partial=(...r)=>P.partial(r_,$,r[0]),$.required=(...r)=>P.required(b_,$,r[0])});function LK($,U){let r={type:"object",get shape(){return P.assignProp(this,"shape",$?P.objectClone($):{}),this.shape},...P.normalizeParams(U)};return new T6(r)}function HK($,U){return new T6({type:"object",get shape(){return P.assignProp(this,"shape",P.objectClone($)),this.shape},catchall:ez(),...P.normalizeParams(U)})}function EK($,U){return new T6({type:"object",get shape(){return P.assignProp(this,"shape",P.objectClone($)),this.shape},catchall:Xv(),...P.normalizeParams(U)})}var az=J("ZodUnion",($,U)=>{v6.init($,U),F.init($,U),$.options=U.options});function sz($,U){return new az({type:"union",options:$,...P.normalizeParams(U)})}var uO=J("ZodDiscriminatedUnion",($,U)=>{az.init($,U),wb.init($,U)});function AK($,U,r){return new uO({type:"union",options:U,discriminator:$,...P.normalizeParams(r)})}var hO=J("ZodIntersection",($,U)=>{Kb.init($,U),F.init($,U)});function nO($,U){return new hO({type:"intersection",left:$,right:U})}var yO=J("ZodTuple",($,U)=>{U6.init($,U),F.init($,U),$.rest=(r)=>$.clone({...$._zod.def,rest:r})});function fO($,U,r){let b=U instanceof A,v=b?r:U;return new yO({type:"tuple",items:$,rest:b?U:null,...P.normalizeParams(v)})}var $_=J("ZodRecord",($,U)=>{Xb.init($,U),F.init($,U),$.keyType=U.keyType,$.valueType=U.valueType});function iO($,U,r){return new $_({type:"record",keyType:$,valueType:U,...P.normalizeParams(r)})}function GK($,U,r){let b=U$($);return b._zod.values=void 0,new $_({type:"record",keyType:b,valueType:U,...P.normalizeParams(r)})}var lO=J("ZodMap",($,U)=>{Wb.init($,U),F.init($,U),$.keyType=U.keyType,$.valueType=U.valueType});function SK($,U,r){return new lO({type:"map",keyType:$,valueType:U,...P.normalizeParams(r)})}var oO=J("ZodSet",($,U)=>{Qb.init($,U),F.init($,U),$.min=(...r)=>$.check(d$(...r)),$.nonempty=(r)=>$.check(d$(1,r)),$.max=(...r)=>$.check(kv(...r)),$.size=(...r)=>$.check(lv(...r))});function FK($,U){return new oO({type:"set",valueType:$,...P.normalizeParams(U)})}var b4=J("ZodEnum",($,U)=>{Yb.init($,U),F.init($,U),$.enum=U.entries,$.options=Object.values(U.entries);let r=new Set(Object.keys(U.entries));$.extract=(b,v)=>{let z={};for(let _ of b)if(r.has(_))z[_]=U.entries[_];else throw Error(`Key ${_} not found in enum`);return new b4({...U,checks:[],...P.normalizeParams(v),entries:z})},$.exclude=(b,v)=>{let z={...U.entries};for(let _ of b)if(r.has(_))delete z[_];else throw Error(`Key ${_} not found in enum`);return new b4({...U,checks:[],...P.normalizeParams(v),entries:z})}});function v_($,U){let r=Array.isArray($)?Object.fromEntries($.map((b)=>[b,b])):$;return new b4({type:"enum",entries:r,...P.normalizeParams(U)})}function MK($,U){return new b4({type:"enum",entries:$,...P.normalizeParams(U)})}var dO=J("ZodLiteral",($,U)=>{jb.init($,U),F.init($,U),$.values=new Set(U.values),Object.defineProperty($,"value",{get(){if(U.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return U.values[0]}})});function ZK($,U){return new dO({type:"literal",values:Array.isArray($)?$:[$],...P.normalizeParams(U)})}var pO=J("ZodFile",($,U)=>{Pb.init($,U),F.init($,U),$.min=(r,b)=>$.check(d$(r,b)),$.max=(r,b)=>$.check(kv(r,b)),$.mime=(r,b)=>$.check(sv(Array.isArray(r)?r:[r],b))});function DK($){return Iz(pO,$)}var tO=J("ZodTransform",($,U)=>{Vb.init($,U),F.init($,U),$._zod.parse=(r,b)=>{if(b.direction==="backward")throw new y$($.constructor.name);r.addIssue=(z)=>{if(typeof z==="string")r.issues.push(P.issue(z,r.value,U));else{let _=z;if(_.fatal)_.continue=!1;_.code??(_.code="custom"),_.input??(_.input=r.value),_.inst??(_.inst=$),r.issues.push(P.issue(_))}};let v=U.transform(r.value,r);if(v instanceof Promise)return v.then((z)=>{return r.value=z,r});return r.value=v,r}});function U_($){return new tO({type:"transform",transform:$})}var r_=J("ZodOptional",($,U)=>{qb.init($,U),F.init($,U),$.unwrap=()=>$._zod.def.innerType});function Z6($){return new r_({type:"optional",innerType:$})}var eO=J("ZodNullable",($,U)=>{Bb.init($,U),F.init($,U),$.unwrap=()=>$._zod.def.innerType});function D6($){return new eO({type:"nullable",innerType:$})}function xK($){return Z6(D6($))}var aO=J("ZodDefault",($,U)=>{Lb.init($,U),F.init($,U),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function sO($,U){return new aO({type:"default",innerType:$,get defaultValue(){return typeof U==="function"?U():P.shallowClone(U)}})}var $I=J("ZodPrefault",($,U)=>{Hb.init($,U),F.init($,U),$.unwrap=()=>$._zod.def.innerType});function vI($,U){return new $I({type:"prefault",innerType:$,get defaultValue(){return typeof U==="function"?U():P.shallowClone(U)}})}var b_=J("ZodNonOptional",($,U)=>{Eb.init($,U),F.init($,U),$.unwrap=()=>$._zod.def.innerType});function UI($,U){return new b_({type:"nonoptional",innerType:$,...P.normalizeParams(U)})}var rI=J("ZodSuccess",($,U)=>{Ab.init($,U),F.init($,U),$.unwrap=()=>$._zod.def.innerType});function gK($){return new rI({type:"success",innerType:$})}var bI=J("ZodCatch",($,U)=>{Gb.init($,U),F.init($,U),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function zI($,U){return new bI({type:"catch",innerType:$,catchValue:typeof U==="function"?U:()=>U})}var _I=J("ZodNaN",($,U)=>{Sb.init($,U),F.init($,U)});function RK($){return Uz(_I,$)}var z_=J("ZodPipe",($,U)=>{Fb.init($,U),F.init($,U),$.in=U.in,$.out=U.out});function x6($,U){return new z_({type:"pipe",in:$,out:U})}var __=J("ZodCodec",($,U)=>{z_.init($,U),mv.init($,U)});function mK($,U,r){return new __({type:"pipe",in:$,out:U,transform:r.decode,reverseTransform:r.encode})}var NI=J("ZodReadonly",($,U)=>{Mb.init($,U),F.init($,U),$.unwrap=()=>$._zod.def.innerType});function OI($){return new NI({type:"readonly",innerType:$})}var II=J("ZodTemplateLiteral",($,U)=>{Zb.init($,U),F.init($,U)});function TK($,U){return new II({type:"template_literal",parts:$,...P.normalizeParams(U)})}var kI=J("ZodLazy",($,U)=>{gb.init($,U),F.init($,U),$.unwrap=()=>$._zod.def.getter()});function JI($){return new kI({type:"lazy",getter:$})}var wI=J("ZodPromise",($,U)=>{xb.init($,U),F.init($,U),$.unwrap=()=>$._zod.def.innerType});function CK($){return new wI({type:"promise",innerType:$})}var KI=J("ZodFunction",($,U)=>{Db.init($,U),F.init($,U)});function cK($){return new KI({type:"function",input:Array.isArray($?.input)?fO($?.input):$?.input??m6(Xv()),output:$?.output??Xv()})}var C6=J("ZodCustom",($,U)=>{Rb.init($,U),F.init($,U)});function uK($){let U=new y({check:"custom"});return U._zod.check=$,U}function hK($,U){return kz(C6,$??(()=>!0),U)}function XI($,U={}){return Jz(C6,$,U)}function WI($){return wz($)}function nK($,U={error:`Input not instance of ${$.name}`}){let r=new C6({type:"custom",check:"custom",fn:(b)=>b instanceof $,abort:!0,...P.normalizeParams(U)});return r._zod.bag.Class=$,r}var yK=(...$)=>Kz({Codec:__,Boolean:O4,String:z4},...$);function fK($){let U=JI(()=>{return sz([Zz($),FO(),MO(),gO(),m6(U),iO(Zz(),U)])});return U}function iK($,U){return x6(U_($),U)}var lK={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function oK($){l({customError:$})}function dK(){return l().customError}var N_;(function($){})(N_||(N_={}));var O_={};k$(O_,{string:()=>pK,number:()=>tK,date:()=>sK,boolean:()=>eK,bigint:()=>aK});function pK($){return S1(z4,$)}function tK($){return R1(N4,$)}function eK($){return n1(O4,$)}function aK($){return f1(I4,$)}function sK($){return vz(R6,$)}l(Tv());function M($){return $}M.schema=c6;import{renameSync as $X,writeFileSync as vX,readFileSync as AY,existsSync as UX,statSync as GY}from"node:fs";import{dirname as rX}from"node:path";import{mkdirSync as bX}from"node:fs";function QI($,U){let r=rX(U);if(!UX(r))bX(r,{recursive:!0});let b=`${U}.tmp`;vX(b,JSON.stringify($,null,2),"utf8"),$X(b,U)}e6();import{statSync as YI,existsSync as xY}from"node:fs";import{join as I_}from"node:path";function zX($,U,r,b){let v=U&&r;if($==="codegraph")return U?{kind:"codegraph",cmd:"codegraph",args:[]}:null;if($==="graphify")return r?{kind:"graphify",cmd:"graphify",args:[]}:null;if($==="alternate"&&v)return(b??"").trim().toLowerCase().split("").reduce((N,O)=>N+O.charCodeAt(0),0)%2===0?{kind:"codegraph",cmd:"codegraph",args:[]}:{kind:"graphify",cmd:"graphify",args:[]};if(U)return{kind:"codegraph",cmd:"codegraph",args:[]};if(r)return{kind:"graphify",cmd:"graphify",args:[]};return null}function jI($){let U=$.trim().toLowerCase(),r=2166136261;for(let b=0;b<U.length;b++)r^=U.charCodeAt(b),r=r*16777619>>>0;return r.toString(16)}class PI{timeoutMs;cacheTtlMs;maxEntriesPerSession;cache=new Map;preferredTool;constructor($={}){this.timeoutMs=$.timeoutMs??5000,this.cacheTtlMs=$.cacheTtlMs??300000,this.maxEntriesPerSession=$.maxEntriesPerSession??10,this.preferredTool=$.preferredTool??"auto"}setPreferredTool($){this.preferredTool=$}hasCodegraphDir($){try{return YI(I_($,".codegraph")).isDirectory()}catch{return!1}}hasGraphifyDir($){try{return YI(I_($,"graphify-out")).isDirectory()}catch{return!1}}cacheContext($,U,r){let b=this.cache.get($);if(!b)b={entries:new Map},this.cache.set($,b);let v=jI(U);b.entries.set(v,{query:U,content:r,insertedAtMs:Date.now()});while(b.entries.size>this.maxEntriesPerSession){let z=b.entries.keys().next().value;if(!z)break;b.entries.delete(z)}}getCachedContext($,U){let r=this.cache.get($);if(!r)return null;if(U){let v=jI(U),z=r.entries.get(v);if(!z)return null;if(Date.now()-z.insertedAtMs>this.cacheTtlMs)return r.entries.delete(v),null;return z.content}let b=null;for(let v of r.entries.values())if(Date.now()-v.insertedAtMs<=this.cacheTtlMs)b=v.content;return b}clear(){this.cache.clear()}clearSession($){this.cache.delete($)}async invoke($,U,r={}){let b=Date.now(),v=r.timeoutMs??this.timeoutMs,z=this.hasCodegraphDir($),_=this.hasGraphifyDir($),N=r.preferredTool??this.preferredTool,O=zX(N,z,_,U),I=null,k=null,W=[];if(O)if(I=O.kind,I==="codegraph")k=r.codegraphBin??"codegraph",W=["explore",U,"--project-path",$];else k=r.graphifyBin??"graphify",W=["query",U,"--graph",I_($,"graphify-out")];if(!k||!I)return{kind:null,query:U,result:null,timedOut:!1,durationMs:Date.now()-b};try{let X=await this.spawnWithTimeout(k,W,v,$);return{kind:I,query:U,result:X.trim()||null,timedOut:!1,durationMs:Date.now()-b}}catch(X){let w=X instanceof Error&&X.message.includes("timed out");return{kind:I,query:U,result:null,timedOut:w,durationMs:Date.now()-b}}}spawnWithTimeout($,U,r,b){return j4($,U,{cwd:b,timeoutMs:r}).then((v)=>{if(v.timedOut)throw Error(`graph retrieval subprocess timed out after ${r}ms`);if(v.code===null)throw Error(`graph retrieval subprocess failed to spawn: ${$}`);if(v.code!==0)throw Error(`graph retrieval subprocess exited ${v.code}: ${v.stderr.slice(0,200)}`);return v.stdout})}async invokeNode($,U,r={}){return this.invokeCodegraphSubcommand("node",$,U,r)}async invokeCallers($,U,r={}){return this.invokeCodegraphSubcommand("callers",$,U,r)}async invokeImpact($,U,r={}){return this.invokeCodegraphSubcommand("impact",$,U,r)}async invokeFiles($,U={}){return this.invokeCodegraphSubcommand("files",void 0,$,U)}async invokeContext($,U,r={}){return this.invokeCodegraphSubcommand("context",$,U,r)}async invokeAffected($,U,r={}){return this.invokeCodegraphSubcommand("affected",$,U,r)}async invokeStatus($,U={}){return this.invokeCodegraphSubcommand("status",void 0,$,U)}async invokeUnlock($,U={}){return this.invokeCodegraphSubcommand("unlock",void 0,$,U)}async invokeMarkDirty($,U={}){return this.invokeCodegraphSubcommand("mark-dirty",void 0,$,U)}async invokeSyncIfDirty($,U={}){return this.invokeCodegraphSubcommand("sync-if-dirty",void 0,$,U)}async invokeIndex($,U={}){return this.invokeCodegraphSubcommand("index",void 0,$,U)}async invokeVisualize($,U={}){return this.invokeCodegraphSubcommand("visualize",void 0,$,U)}async invokeServe($,U,r={}){return this.invokeCodegraphSubcommand("serve",String($),U,r)}async invokeUninit($,U={}){return this.invokeCodegraphSubcommand("uninit",void 0,$,U)}async invokeCodegraphSubcommand($,U,r,b){let v=Date.now(),z=b.timeoutMs??this.timeoutMs;if(!this.hasCodegraphDir(r))return{kind:null,query:U===void 0?$:Array.isArray(U)?U.join(","):U,result:null,timedOut:!1,durationMs:Date.now()-v};let _=b.codegraphBin??"codegraph",N=U===void 0?[]:Array.isArray(U)?U:[U],O=[$,...N,"--project-path",r],I=U===void 0?$:Array.isArray(U)?U.join(","):U;try{let k=await this.spawnWithTimeout(_,O,z,r);return{kind:"codegraph",query:I,result:k.trim()||null,timedOut:!1,durationMs:Date.now()-v}}catch(k){let W=k instanceof Error&&/timed out/i.test(k.message);return{kind:"codegraph",query:I,result:null,timedOut:W,durationMs:Date.now()-v}}}async invokePath($,U,r,b={}){let v=Date.now(),z=b.timeoutMs??this.timeoutMs;if(!this.hasGraphifyDir(r))return{kind:null,query:`${$} ${U}`,result:null,timedOut:!1,durationMs:Date.now()-v};let _=b.graphifyBin??"graphify",N=["path",$,U];try{let O=await this.spawnWithTimeout(_,N,z,r);return{kind:"graphify",query:`${$} ${U}`,result:O.trim()||null,timedOut:!1,durationMs:Date.now()-v}}catch(O){return{kind:"graphify",query:`${$} ${U}`,result:null,timedOut:O instanceof Error&&/timed out/i.test(O.message),durationMs:Date.now()-v}}}async invokeExplain($,U,r={}){return this.invokeGraphifySubcommand("explain",$,U,r)}async invokeGraphifySubcommand($,U,r,b){let v=Date.now(),z=b.timeoutMs??this.timeoutMs;if(!this.hasGraphifyDir(r))return{kind:null,query:U??$,result:null,timedOut:!1,durationMs:Date.now()-v};let _=b.graphifyBin??"graphify",N=U===void 0?[$]:[$,U];try{let O=await this.spawnWithTimeout(_,N,z,r);return{kind:"graphify",query:U??$,result:O.trim()||null,timedOut:!1,durationMs:Date.now()-v}}catch(O){return{kind:"graphify",query:U??$,result:null,timedOut:O instanceof Error&&/timed out/i.test(O.message),durationMs:Date.now()-v}}}async invokeDiagnose($,U={}){return this.invokeGraphifySubcommand("diagnose",void 0,$,U)}async invokeMergeDriver($,U={}){return this.invokeGraphifySubcommand("merge-driver",void 0,$,U)}async invokeSaveResult($,U={}){return this.invokeGraphifySubcommand("save-result",void 0,$,U)}async invokeExtract($,U={}){return this.invokeGraphifySubcommand("extract",void 0,$,U)}async invokeClusterOnly($,U={}){return this.invokeGraphifySubcommand("cluster-only",void 0,$,U)}async invokeLabel($,U,r={}){return this.invokeGraphifySubcommand("label",$,U,r)}async invokeTree($,U={}){return this.invokeGraphifySubcommand("tree",void 0,$,U)}async invokeClone($,U={}){return this.invokeGraphifySubcommand("clone",void 0,$,U)}async invokeAdd($,U,r={}){return this.invokeGraphifySubcommand("add",$,U,r)}async invokeCheckUpdate($,U={}){return this.invokeGraphifySubcommand("check-update",void 0,$,U)}}var k_=null;function R(){if(!k_)k_=new PI;return k_}function VI($){let U=R();if($.preferredTool)U.setPreferredTool($.preferredTool)}var _X=R();class LI{retrieval;constructor($=_X){this.retrieval=$}async find($,U,r=5000){let b=Date.now(),v=await this.retrieval.invokeNode($,U,{timeoutMs:r});if(v.kind==="codegraph"&&v.result)return NX($,v.result,b,"codegraph");let z=await this.retrieval.invoke(U,$,{timeoutMs:r});if(z.kind==="graphify"&&z.result)return OX($,z.result,b,"graphify");return{symbol:$,source:null,callers:[],found:!1,kind:v.kind??z.kind,durationMs:Date.now()-b}}async impact($,U,r=5000){let b=Date.now(),v=await this.retrieval.invokeImpact($,U,{timeoutMs:r});if(v.kind==="codegraph"&&v.result)return IX($,v.result,b,"codegraph",v.timedOut);let z=await this.retrieval.invokeCallers($,U,{timeoutMs:r});if(z.kind==="codegraph"&&z.result)return{symbol:$,directCallers:u6(z.result),transitiveCallers:[],testFiles:[],docFiles:[],totalAffectedFiles:new Set(u6(z.result).map((_)=>_.file)).size,kind:"codegraph",durationMs:Date.now()-b,timedOut:z.timedOut};return{symbol:$,directCallers:[],transitiveCallers:[],testFiles:[],docFiles:[],totalAffectedFiles:0,kind:v.kind??z.kind,durationMs:Date.now()-b,timedOut:v.timedOut||z.timedOut}}async listFiles($,U=5000){let r=Date.now(),b=await this.retrieval.invokeFiles($,{timeoutMs:U});if(b.kind==="codegraph"&&b.result){let v=b.result.split(`
|
|
136
|
-
`).map((
|
|
137
|
-
`);for(let
|
|
138
|
-
`),
|
|
139
|
-
`))}function
|
|
140
|
-
`),
|
|
141
|
-
${
|
|
142
|
-
${
|
|
135
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let l of this.seen.entries()){let d=l[1];if(e===l[0]){i(l);continue}if(n.external){let h=n.external.registry.get(l[0])?.id;if(e!==l[0]&&h){i(l);continue}}if(this.metadataRegistry.get(l[0])?.id){i(l);continue}if(d.cycle){i(l);continue}if(d.count>1){if(n.reused==="ref"){i(l);continue}}}let a=(l,d)=>{let v=this.seen.get(l),h=v.def??v.schema,u={...h};if(v.ref===null)return;let y=v.ref;if(v.ref=null,y){a(y,d);let x=this.seen.get(y).schema;if(x.$ref&&(d.target==="draft-7"||d.target==="draft-4"||d.target==="openapi-3.0"))h.allOf=h.allOf??[],h.allOf.push(x);else Object.assign(h,x),Object.assign(h,u)}if(!v.isParent)this.override({zodSchema:l,jsonSchema:h,path:v.path??[]})};for(let l of[...this.seen.entries()].reverse())a(l[0],{target:this.target});let s={};if(this.target==="draft-2020-12")s.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")s.$schema="http://json-schema.org/draft-07/schema#";else if(this.target==="draft-4")s.$schema="http://json-schema.org/draft-04/schema#";else if(this.target==="openapi-3.0");else console.warn(`Invalid target: ${this.target}`);if(n.external?.uri){let l=n.external.registry.get(e)?.id;if(!l)throw Error("Schema is missing an `id` property");s.$id=n.external.uri(l)}Object.assign(s,o.def);let c=n.external?.defs??{};for(let l of this.seen.entries()){let d=l[1];if(d.def&&d.defId)c[d.defId]=d.def}if(n.external);else if(Object.keys(c).length>0)if(this.target==="draft-2020-12")s.$defs=c;else s.definitions=c;try{return JSON.parse(JSON.stringify(s))}catch(l){throw Error("Error converting schema to JSON.")}}}function Tc(e,r){if(e instanceof qt){let o=new jn(r),t={};for(let s of e._idmap.entries()){let[c,l]=s;o.process(l)}let i={},a={registry:e,uri:r?.uri,defs:t};for(let s of e._idmap.entries()){let[c,l]=s;i[c]=o.emit(l,{...r,external:a})}if(Object.keys(t).length>0){let s=o.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[s]:t}}return{schemas:i}}let n=new jn(r);return n.process(e),n.emit(e,r)}function Q(e,r){let n=r??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let t=e._zod.def;switch(t.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Q(t.element,n);case"object":{for(let i in t.shape)if(Q(t.shape[i],n))return!0;return!1}case"union":{for(let i of t.options)if(Q(i,n))return!0;return!1}case"intersection":return Q(t.left,n)||Q(t.right,n);case"tuple":{for(let i of t.items)if(Q(i,n))return!0;if(t.rest&&Q(t.rest,n))return!0;return!1}case"record":return Q(t.keyType,n)||Q(t.valueType,n);case"map":return Q(t.keyType,n)||Q(t.valueType,n);case"set":return Q(t.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Q(t.innerType,n);case"lazy":return Q(t.getter(),n);case"default":return Q(t.innerType,n);case"prefault":return Q(t.innerType,n);case"custom":return!1;case"transform":return!0;case"pipe":return Q(t.in,n)||Q(t.out,n);case"success":return!1;case"catch":return!1;case"function":return!1;default:}throw Error(`Unknown schema type: ${t.type}`)}var Nd={};var Un={};me(Un,{ZodISODate:()=>Mn,ZodISODateTime:()=>An,ZodISODuration:()=>Nn,ZodISOTime:()=>Rn,date:()=>Dc,datetime:()=>Oc,duration:()=>zc,time:()=>Pc});var An=m("ZodISODateTime",(e,r)=>{Qi.init(e,r),V.init(e,r)});function Oc(e){return Gs(An,e)}var Mn=m("ZodISODate",(e,r)=>{ea.init(e,r),V.init(e,r)});function Dc(e){return Vs(Mn,e)}var Rn=m("ZodISOTime",(e,r)=>{ta.init(e,r),V.init(e,r)});function Pc(e){return Ws(Rn,e)}var Nn=m("ZodISODuration",(e,r)=>{ra.init(e,r),V.init(e,r)});function zc(e){return Bs(Nn,e)}var Ld=(e,r)=>{Mt.init(e,r),e.name="ZodError",Object.defineProperties(e,{format:{value:(n)=>Nt(e,n)},flatten:{value:(n)=>Rt(e,n)},addIssue:{value:(n)=>{e.issues.push(n),e.message=JSON.stringify(e.issues,it,2)}},addIssues:{value:(n)=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,it,2)}},isEmpty:{get(){return e.issues.length===0}}})},Kv=m("ZodError",Ld),ue=m("ZodError",Ld,{Parent:Error});var Cc=ct(ue),Ec=lt(ue),jc=ut(ue),Ac=dt(ue),Mc=Wr(ue),Rc=Br(ue),Nc=Hr(ue),Uc=Jr(ue),Lc=qr(ue),Zc=Kr(ue),Fc=Xr(ue),Gc=Yr(ue);var z=m("ZodType",(e,r)=>(D.init(e,r),e.def=r,e.type=r.type,Object.defineProperty(e,"_def",{value:r}),e.check=(...n)=>e.clone({...r,checks:[...r.checks??[],...n.map((o)=>typeof o==="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),e.clone=(n,o)=>ie(e,n,o),e.brand=()=>e,e.register=(n,o)=>(n.add(e,o),e),e.parse=(n,o)=>Cc(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>jc(e,n,o),e.parseAsync=async(n,o)=>Ec(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>Ac(e,n,o),e.spa=e.safeParseAsync,e.encode=(n,o)=>Mc(e,n,o),e.decode=(n,o)=>Rc(e,n,o),e.encodeAsync=async(n,o)=>Nc(e,n,o),e.decodeAsync=async(n,o)=>Uc(e,n,o),e.safeEncode=(n,o)=>Lc(e,n,o),e.safeDecode=(n,o)=>Zc(e,n,o),e.safeEncodeAsync=async(n,o)=>Fc(e,n,o),e.safeDecodeAsync=async(n,o)=>Gc(e,n,o),e.refine=(n,o)=>e.check(Im(n,o)),e.superRefine=(n)=>e.check(Tm(n)),e.overwrite=(n)=>e.check(ze(n)),e.optional=()=>Zn(e),e.nullable=()=>Fn(e),e.nullish=()=>Zn(Fn(e)),e.nonoptional=(n)=>fm(e,n),e.array=()=>Bn(e),e.or=(n)=>ml([e,n]),e.and=(n)=>em(e,n),e.transform=(n)=>Gn(e,gl(n)),e.default=(n)=>dm(e,n),e.prefault=(n)=>pm(e,n),e.catch=(n)=>vm(e,n),e.pipe=(n)=>Gn(e,n),e.readonly=()=>_m(e),e.describe=(n)=>{let o=e.clone();return Oe.add(o,{description:n}),o},Object.defineProperty(e,"description",{get(){return Oe.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Oe.get(e);let o=e.clone();return Oe.add(o,n[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Bc=m("_ZodString",(e,r)=>{Ke.init(e,r),z.init(e,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...o)=>e.check(Qt(...o)),e.includes=(...o)=>e.check(rr(...o)),e.startsWith=(...o)=>e.check(nr(...o)),e.endsWith=(...o)=>e.check(or(...o)),e.min=(...o)=>e.check(Ue(...o)),e.max=(...o)=>e.check(ft(...o)),e.length=(...o)=>e.check(gt(...o)),e.nonempty=(...o)=>e.check(Ue(1,...o)),e.lowercase=(o)=>e.check(er(o)),e.uppercase=(o)=>e.check(tr(o)),e.trim=()=>e.check(sr()),e.normalize=(...o)=>e.check(ar(...o)),e.toLowerCase=()=>e.check(cr()),e.toUpperCase=()=>e.check(lr())}),dr=m("ZodString",(e,r)=>{Ke.init(e,r),Bc.init(e,r),e.email=(n)=>e.check(fn(Hc,n)),e.url=(n)=>e.check(Xt(Vn,n)),e.jwt=(n)=>e.check(En(cl,n)),e.emoji=(n)=>e.check(bn(Jc,n)),e.guid=(n)=>e.check(Kt(Ln,n)),e.uuid=(n)=>e.check(gn(Ee,n)),e.uuidv4=(n)=>e.check(hn(Ee,n)),e.uuidv6=(n)=>e.check(vn(Ee,n)),e.uuidv7=(n)=>e.check(yn(Ee,n)),e.nanoid=(n)=>e.check(_n(qc,n)),e.guid=(n)=>e.check(Kt(Ln,n)),e.cuid=(n)=>e.check(kn(Kc,n)),e.cuid2=(n)=>e.check($n(Xc,n)),e.ulid=(n)=>e.check(xn(Yc,n)),e.base64=(n)=>e.check(Pn(il,n)),e.base64url=(n)=>e.check(zn(al,n)),e.xid=(n)=>e.check(wn(Qc,n)),e.ksuid=(n)=>e.check(Sn(el,n)),e.ipv4=(n)=>e.check(In(tl,n)),e.ipv6=(n)=>e.check(Tn(rl,n)),e.cidrv4=(n)=>e.check(On(nl,n)),e.cidrv6=(n)=>e.check(Dn(ol,n)),e.e164=(n)=>e.check(Cn(sl,n)),e.datetime=(n)=>e.check(Oc(n)),e.date=(n)=>e.check(Dc(n)),e.time=(n)=>e.check(Pc(n)),e.duration=(n)=>e.check(zc(n))});function Vc(e){return Ls(dr,e)}var V=m("ZodStringFormat",(e,r)=>{F.init(e,r),Bc.init(e,r)}),Hc=m("ZodEmail",(e,r)=>{Vi.init(e,r),V.init(e,r)});function Yv(e){return fn(Hc,e)}var Ln=m("ZodGUID",(e,r)=>{Fi.init(e,r),V.init(e,r)});function Qv(e){return Kt(Ln,e)}var Ee=m("ZodUUID",(e,r)=>{Gi.init(e,r),V.init(e,r)});function ey(e){return gn(Ee,e)}function ty(e){return hn(Ee,e)}function ry(e){return vn(Ee,e)}function ny(e){return yn(Ee,e)}var Vn=m("ZodURL",(e,r)=>{Wi.init(e,r),V.init(e,r)});function oy(e){return Xt(Vn,e)}function iy(e){return Xt(Vn,{protocol:/^https?$/,hostname:ve.domain,...b.normalizeParams(e)})}var Jc=m("ZodEmoji",(e,r)=>{Bi.init(e,r),V.init(e,r)});function ay(e){return bn(Jc,e)}var qc=m("ZodNanoID",(e,r)=>{Hi.init(e,r),V.init(e,r)});function sy(e){return _n(qc,e)}var Kc=m("ZodCUID",(e,r)=>{Ji.init(e,r),V.init(e,r)});function cy(e){return kn(Kc,e)}var Xc=m("ZodCUID2",(e,r)=>{qi.init(e,r),V.init(e,r)});function ly(e){return $n(Xc,e)}var Yc=m("ZodULID",(e,r)=>{Ki.init(e,r),V.init(e,r)});function uy(e){return xn(Yc,e)}var Qc=m("ZodXID",(e,r)=>{Xi.init(e,r),V.init(e,r)});function dy(e){return wn(Qc,e)}var el=m("ZodKSUID",(e,r)=>{Yi.init(e,r),V.init(e,r)});function my(e){return Sn(el,e)}var tl=m("ZodIPv4",(e,r)=>{na.init(e,r),V.init(e,r)});function py(e){return In(tl,e)}var rl=m("ZodIPv6",(e,r)=>{oa.init(e,r),V.init(e,r)});function fy(e){return Tn(rl,e)}var nl=m("ZodCIDRv4",(e,r)=>{ia.init(e,r),V.init(e,r)});function gy(e){return On(nl,e)}var ol=m("ZodCIDRv6",(e,r)=>{aa.init(e,r),V.init(e,r)});function hy(e){return Dn(ol,e)}var il=m("ZodBase64",(e,r)=>{ca.init(e,r),V.init(e,r)});function vy(e){return Pn(il,e)}var al=m("ZodBase64URL",(e,r)=>{la.init(e,r),V.init(e,r)});function yy(e){return zn(al,e)}var sl=m("ZodE164",(e,r)=>{ua.init(e,r),V.init(e,r)});function by(e){return Cn(sl,e)}var cl=m("ZodJWT",(e,r)=>{da.init(e,r),V.init(e,r)});function _y(e){return En(cl,e)}var mr=m("ZodCustomStringFormat",(e,r)=>{ma.init(e,r),V.init(e,r)});function ky(e,r,n={}){return ht(mr,e,r,n)}function $y(e){return ht(mr,"hostname",ve.hostname,e)}function xy(e){return ht(mr,"hex",ve.hex,e)}function wy(e,r){let n=r?.enc??"hex",o=`${e}_${n}`,t=ve[o];if(!t)throw Error(`Unrecognized hash format: ${o}`);return ht(mr,o,t,r)}var pr=m("ZodNumber",(e,r)=>{ln.init(e,r),z.init(e,r),e.gt=(o,t)=>e.check(Pe(o,t)),e.gte=(o,t)=>e.check(le(o,t)),e.min=(o,t)=>e.check(le(o,t)),e.lt=(o,t)=>e.check(De(o,t)),e.lte=(o,t)=>e.check(ye(o,t)),e.max=(o,t)=>e.check(ye(o,t)),e.int=(o)=>e.check(Wc(o)),e.safe=(o)=>e.check(Wc(o)),e.positive=(o)=>e.check(Pe(0,o)),e.nonnegative=(o)=>e.check(le(0,o)),e.negative=(o)=>e.check(De(0,o)),e.nonpositive=(o)=>e.check(ye(0,o)),e.multipleOf=(o,t)=>e.check(Xe(o,t)),e.step=(o,t)=>e.check(Xe(o,t)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??0.5),e.isFinite=!0,e.format=n.format??null});function Zd(e){return Hs(pr,e)}var yt=m("ZodNumberFormat",(e,r)=>{pa.init(e,r),pr.init(e,r)});function Wc(e){return qs(yt,e)}function Sy(e){return Ks(yt,e)}function Iy(e){return Xs(yt,e)}function Ty(e){return Ys(yt,e)}function Oy(e){return Qs(yt,e)}var fr=m("ZodBoolean",(e,r)=>{Zt.init(e,r),z.init(e,r)});function Fd(e){return ec(fr,e)}var gr=m("ZodBigInt",(e,r)=>{un.init(e,r),z.init(e,r),e.gte=(o,t)=>e.check(le(o,t)),e.min=(o,t)=>e.check(le(o,t)),e.gt=(o,t)=>e.check(Pe(o,t)),e.gte=(o,t)=>e.check(le(o,t)),e.min=(o,t)=>e.check(le(o,t)),e.lt=(o,t)=>e.check(De(o,t)),e.lte=(o,t)=>e.check(ye(o,t)),e.max=(o,t)=>e.check(ye(o,t)),e.positive=(o)=>e.check(Pe(BigInt(0),o)),e.negative=(o)=>e.check(De(BigInt(0),o)),e.nonpositive=(o)=>e.check(ye(BigInt(0),o)),e.nonnegative=(o)=>e.check(le(BigInt(0),o)),e.multipleOf=(o,t)=>e.check(Xe(o,t));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function Dy(e){return rc(gr,e)}var ll=m("ZodBigIntFormat",(e,r)=>{fa.init(e,r),gr.init(e,r)});function Py(e){return oc(ll,e)}function zy(e){return ic(ll,e)}var Gd=m("ZodSymbol",(e,r)=>{ga.init(e,r),z.init(e,r)});function Cy(e){return ac(Gd,e)}var Vd=m("ZodUndefined",(e,r)=>{ha.init(e,r),z.init(e,r)});function Ey(e){return sc(Vd,e)}var Wd=m("ZodNull",(e,r)=>{va.init(e,r),z.init(e,r)});function Bd(e){return cc(Wd,e)}var Hd=m("ZodAny",(e,r)=>{ya.init(e,r),z.init(e,r)});function jy(){return lc(Hd)}var Jd=m("ZodUnknown",(e,r)=>{ba.init(e,r),z.init(e,r)});function vt(){return uc(Jd)}var qd=m("ZodNever",(e,r)=>{_a.init(e,r),z.init(e,r)});function ul(e){return dc(qd,e)}var Kd=m("ZodVoid",(e,r)=>{ka.init(e,r),z.init(e,r)});function Ay(e){return mc(Kd,e)}var Wn=m("ZodDate",(e,r)=>{$a.init(e,r),z.init(e,r),e.min=(o,t)=>e.check(le(o,t)),e.max=(o,t)=>e.check(ye(o,t));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function My(e){return pc(Wn,e)}var Xd=m("ZodArray",(e,r)=>{xa.init(e,r),z.init(e,r),e.element=r.element,e.min=(n,o)=>e.check(Ue(n,o)),e.nonempty=(n)=>e.check(Ue(1,n)),e.max=(n,o)=>e.check(ft(n,o)),e.length=(n,o)=>e.check(gt(n,o)),e.unwrap=()=>e.element});function Bn(e,r){return kc(Xd,e,r)}function Ry(e){let r=e._zod.def.shape;return fl(Object.keys(r))}var Hn=m("ZodObject",(e,r)=>{wa.init(e,r),z.init(e,r),b.defineLazy(e,"shape",()=>r.shape),e.keyof=()=>fl(Object.keys(e._zod.def.shape)),e.catchall=(n)=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:vt()}),e.loose=()=>e.clone({...e._zod.def,catchall:vt()}),e.strict=()=>e.clone({...e._zod.def,catchall:ul()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=(n)=>b.extend(e,n),e.safeExtend=(n)=>b.safeExtend(e,n),e.merge=(n)=>b.merge(e,n),e.pick=(n)=>b.pick(e,n),e.omit=(n)=>b.omit(e,n),e.partial=(...n)=>b.partial(hl,e,n[0]),e.required=(...n)=>b.required(vl,e,n[0])});function Ny(e,r){let n={type:"object",get shape(){return b.assignProp(this,"shape",e?b.objectClone(e):{}),this.shape},...b.normalizeParams(r)};return new Hn(n)}function Uy(e,r){return new Hn({type:"object",get shape(){return b.assignProp(this,"shape",b.objectClone(e)),this.shape},catchall:ul(),...b.normalizeParams(r)})}function Ly(e,r){return new Hn({type:"object",get shape(){return b.assignProp(this,"shape",b.objectClone(e)),this.shape},catchall:vt(),...b.normalizeParams(r)})}var dl=m("ZodUnion",(e,r)=>{dn.init(e,r),z.init(e,r),e.options=r.options});function ml(e,r){return new dl({type:"union",options:e,...b.normalizeParams(r)})}var Yd=m("ZodDiscriminatedUnion",(e,r)=>{dl.init(e,r),Sa.init(e,r)});function Zy(e,r,n){return new Yd({type:"union",options:r,discriminator:e,...b.normalizeParams(n)})}var Qd=m("ZodIntersection",(e,r)=>{Ia.init(e,r),z.init(e,r)});function em(e,r){return new Qd({type:"intersection",left:e,right:r})}var tm=m("ZodTuple",(e,r)=>{mn.init(e,r),z.init(e,r),e.rest=(n)=>e.clone({...e._zod.def,rest:n})});function rm(e,r,n){let o=r instanceof D,t=o?n:r;return new tm({type:"tuple",items:e,rest:o?r:null,...b.normalizeParams(t)})}var pl=m("ZodRecord",(e,r)=>{Ta.init(e,r),z.init(e,r),e.keyType=r.keyType,e.valueType=r.valueType});function nm(e,r,n){return new pl({type:"record",keyType:e,valueType:r,...b.normalizeParams(n)})}function Fy(e,r,n){let o=ie(e);return o._zod.values=void 0,new pl({type:"record",keyType:o,valueType:r,...b.normalizeParams(n)})}var om=m("ZodMap",(e,r)=>{Oa.init(e,r),z.init(e,r),e.keyType=r.keyType,e.valueType=r.valueType});function Gy(e,r,n){return new om({type:"map",keyType:e,valueType:r,...b.normalizeParams(n)})}var im=m("ZodSet",(e,r)=>{Da.init(e,r),z.init(e,r),e.min=(...n)=>e.check(Ye(...n)),e.nonempty=(n)=>e.check(Ye(1,n)),e.max=(...n)=>e.check(pt(...n)),e.size=(...n)=>e.check(Yt(...n))});function Vy(e,r){return new im({type:"set",valueType:e,...b.normalizeParams(r)})}var ur=m("ZodEnum",(e,r)=>{Pa.init(e,r),z.init(e,r),e.enum=r.entries,e.options=Object.values(r.entries);let n=new Set(Object.keys(r.entries));e.extract=(o,t)=>{let i={};for(let a of o)if(n.has(a))i[a]=r.entries[a];else throw Error(`Key ${a} not found in enum`);return new ur({...r,checks:[],...b.normalizeParams(t),entries:i})},e.exclude=(o,t)=>{let i={...r.entries};for(let a of o)if(n.has(a))delete i[a];else throw Error(`Key ${a} not found in enum`);return new ur({...r,checks:[],...b.normalizeParams(t),entries:i})}});function fl(e,r){let n=Array.isArray(e)?Object.fromEntries(e.map((o)=>[o,o])):e;return new ur({type:"enum",entries:n,...b.normalizeParams(r)})}function Wy(e,r){return new ur({type:"enum",entries:e,...b.normalizeParams(r)})}var am=m("ZodLiteral",(e,r)=>{za.init(e,r),z.init(e,r),e.values=new Set(r.values),Object.defineProperty(e,"value",{get(){if(r.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return r.values[0]}})});function By(e,r){return new am({type:"literal",values:Array.isArray(e)?e:[e],...b.normalizeParams(r)})}var sm=m("ZodFile",(e,r)=>{Ca.init(e,r),z.init(e,r),e.min=(n,o)=>e.check(Ye(n,o)),e.max=(n,o)=>e.check(pt(n,o)),e.mime=(n,o)=>e.check(ir(Array.isArray(n)?n:[n],o))});function Hy(e){return $c(sm,e)}var cm=m("ZodTransform",(e,r)=>{Ea.init(e,r),z.init(e,r),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new He(e.constructor.name);n.addIssue=(i)=>{if(typeof i==="string")n.issues.push(b.issue(i,n.value,r));else{let a=i;if(a.fatal)a.continue=!1;a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=e),n.issues.push(b.issue(a))}};let t=r.transform(n.value,n);if(t instanceof Promise)return t.then((i)=>(n.value=i,n));return n.value=t,n}});function gl(e){return new cm({type:"transform",transform:e})}var hl=m("ZodOptional",(e,r)=>{ja.init(e,r),z.init(e,r),e.unwrap=()=>e._zod.def.innerType});function Zn(e){return new hl({type:"optional",innerType:e})}var lm=m("ZodNullable",(e,r)=>{Aa.init(e,r),z.init(e,r),e.unwrap=()=>e._zod.def.innerType});function Fn(e){return new lm({type:"nullable",innerType:e})}function Jy(e){return Zn(Fn(e))}var um=m("ZodDefault",(e,r)=>{Ma.init(e,r),z.init(e,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function dm(e,r){return new um({type:"default",innerType:e,get defaultValue(){return typeof r==="function"?r():b.shallowClone(r)}})}var mm=m("ZodPrefault",(e,r)=>{Ra.init(e,r),z.init(e,r),e.unwrap=()=>e._zod.def.innerType});function pm(e,r){return new mm({type:"prefault",innerType:e,get defaultValue(){return typeof r==="function"?r():b.shallowClone(r)}})}var vl=m("ZodNonOptional",(e,r)=>{Na.init(e,r),z.init(e,r),e.unwrap=()=>e._zod.def.innerType});function fm(e,r){return new vl({type:"nonoptional",innerType:e,...b.normalizeParams(r)})}var gm=m("ZodSuccess",(e,r)=>{Ua.init(e,r),z.init(e,r),e.unwrap=()=>e._zod.def.innerType});function qy(e){return new gm({type:"success",innerType:e})}var hm=m("ZodCatch",(e,r)=>{La.init(e,r),z.init(e,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function vm(e,r){return new hm({type:"catch",innerType:e,catchValue:typeof r==="function"?r:()=>r})}var ym=m("ZodNaN",(e,r)=>{Za.init(e,r),z.init(e,r)});function Ky(e){return gc(ym,e)}var yl=m("ZodPipe",(e,r)=>{Fa.init(e,r),z.init(e,r),e.in=r.in,e.out=r.out});function Gn(e,r){return new yl({type:"pipe",in:e,out:r})}var bl=m("ZodCodec",(e,r)=>{yl.init(e,r),Ft.init(e,r)});function Xy(e,r,n){return new bl({type:"pipe",in:e,out:r,transform:n.decode,reverseTransform:n.encode})}var bm=m("ZodReadonly",(e,r)=>{Ga.init(e,r),z.init(e,r),e.unwrap=()=>e._zod.def.innerType});function _m(e){return new bm({type:"readonly",innerType:e})}var km=m("ZodTemplateLiteral",(e,r)=>{Va.init(e,r),z.init(e,r)});function Yy(e,r){return new km({type:"template_literal",parts:e,...b.normalizeParams(r)})}var $m=m("ZodLazy",(e,r)=>{Ha.init(e,r),z.init(e,r),e.unwrap=()=>e._zod.def.getter()});function xm(e){return new $m({type:"lazy",getter:e})}var wm=m("ZodPromise",(e,r)=>{Ba.init(e,r),z.init(e,r),e.unwrap=()=>e._zod.def.innerType});function Qy(e){return new wm({type:"promise",innerType:e})}var Sm=m("ZodFunction",(e,r)=>{Wa.init(e,r),z.init(e,r)});function eb(e){return new Sm({type:"function",input:Array.isArray(e?.input)?rm(e?.input):e?.input??Bn(vt()),output:e?.output??vt()})}var Jn=m("ZodCustom",(e,r)=>{Ja.init(e,r),z.init(e,r)});function tb(e){let r=new W({check:"custom"});return r._zod.check=e,r}function rb(e,r){return xc(Jn,e??(()=>!0),r)}function Im(e,r={}){return wc(Jn,e,r)}function Tm(e){return Sc(e)}function nb(e,r={error:`Input not instance of ${e.name}`}){let n=new Jn({type:"custom",check:"custom",fn:(o)=>o instanceof e,abort:!0,...b.normalizeParams(r)});return n._zod.bag.Class=e,n}var ob=(...e)=>Ic({Codec:bl,Boolean:fr,String:dr},...e);function ib(e){let r=xm(()=>ml([Vc(e),Zd(),Fd(),Bd(),Bn(r),nm(Vc(),r)]));return r}function ab(e,r){return Gn(gl(e),r)}var sb={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function cb(e){q({customError:e})}function lb(){return q().customError}var _l;(function(e){})(_l||(_l={}));var kl={};me(kl,{bigint:()=>pb,boolean:()=>mb,date:()=>fb,number:()=>db,string:()=>ub});function ub(e){return Zs(dr,e)}function db(e){return Js(pr,e)}function mb(e){return tc(fr,e)}function pb(e){return nc(gr,e)}function fb(e){return fc(Wn,e)}q(Gt());function C(e){return e}C.schema=qn;import{renameSync as gb,writeFileSync as hb,readFileSync as Fx,existsSync as vb,statSync as Gx}from"node:fs";import{dirname as yb}from"node:path";import{mkdirSync as bb}from"node:fs";function Om(e,r){let n=yb(r);if(!vb(n))bb(n,{recursive:!0});let o=`${r}.tmp`;hb(o,JSON.stringify(e,null,2),"utf8"),gb(o,r)}Tr();import{statSync as Dm,existsSync as qx}from"node:fs";import{join as $l}from"node:path";function _b(e,r,n,o){let t=r&&n;if(e==="codegraph")return r?{kind:"codegraph",cmd:"codegraph",args:[]}:null;if(e==="graphify")return n?{kind:"graphify",cmd:"graphify",args:[]}:null;if(e==="alternate"&&t)return(o??"").trim().toLowerCase().split("").reduce((s,c)=>s+c.charCodeAt(0),0)%2===0?{kind:"codegraph",cmd:"codegraph",args:[]}:{kind:"graphify",cmd:"graphify",args:[]};if(r)return{kind:"codegraph",cmd:"codegraph",args:[]};if(n)return{kind:"graphify",cmd:"graphify",args:[]};return null}function Pm(e){let r=e.trim().toLowerCase(),n=2166136261;for(let o=0;o<r.length;o++)n^=r.charCodeAt(o),n=n*16777619>>>0;return n.toString(16)}class zm{timeoutMs;cacheTtlMs;maxEntriesPerSession;cache=new Map;preferredTool;constructor(e={}){this.timeoutMs=e.timeoutMs??5000,this.cacheTtlMs=e.cacheTtlMs??300000,this.maxEntriesPerSession=e.maxEntriesPerSession??10,this.preferredTool=e.preferredTool??"auto"}setPreferredTool(e){this.preferredTool=e}hasCodegraphDir(e){try{return Dm($l(e,".codegraph")).isDirectory()}catch{return!1}}hasGraphifyDir(e){try{return Dm($l(e,"graphify-out")).isDirectory()}catch{return!1}}cacheContext(e,r,n){let o=this.cache.get(e);if(!o)o={entries:new Map},this.cache.set(e,o);let t=Pm(r);o.entries.set(t,{query:r,content:n,insertedAtMs:Date.now()});while(o.entries.size>this.maxEntriesPerSession){let i=o.entries.keys().next().value;if(!i)break;o.entries.delete(i)}}getCachedContext(e,r){let n=this.cache.get(e);if(!n)return null;if(r){let t=Pm(r),i=n.entries.get(t);if(!i)return null;if(Date.now()-i.insertedAtMs>this.cacheTtlMs)return n.entries.delete(t),null;return i.content}let o=null;for(let t of n.entries.values())if(Date.now()-t.insertedAtMs<=this.cacheTtlMs)o=t.content;return o}clear(){this.cache.clear()}clearSession(e){this.cache.delete(e)}async invoke(e,r,n={}){let o=Date.now(),t=n.timeoutMs??this.timeoutMs,i=this.hasCodegraphDir(e),a=this.hasGraphifyDir(e),s=n.preferredTool??this.preferredTool,c=_b(s,i,a,r),l=null,d=null,v=[];if(c)if(l=c.kind,l==="codegraph")d=n.codegraphBin??"codegraph",v=["explore",r,"--project-path",e];else d=n.graphifyBin??"graphify",v=["query",r,"--graph",$l(e,"graphify-out")];if(!d||!l)return{kind:null,query:r,result:null,timedOut:!1,durationMs:Date.now()-o};try{let h=await this.spawnWithTimeout(d,v,t,e);return{kind:l,query:r,result:h.trim()||null,timedOut:!1,durationMs:Date.now()-o}}catch(h){let u=h instanceof Error&&h.message.includes("timed out");return{kind:l,query:r,result:null,timedOut:u,durationMs:Date.now()-o}}}spawnWithTimeout(e,r,n,o){return Ir(e,r,{cwd:o,timeoutMs:n}).then((t)=>{if(t.timedOut)throw Error(`graph retrieval subprocess timed out after ${n}ms`);if(t.code===null)throw Error(`graph retrieval subprocess failed to spawn: ${e}`);if(t.code!==0)throw Error(`graph retrieval subprocess exited ${t.code}: ${t.stderr.slice(0,200)}`);return t.stdout})}async invokeNode(e,r,n={}){return this.invokeCodegraphSubcommand("node",e,r,n)}async invokeCallers(e,r,n={}){return this.invokeCodegraphSubcommand("callers",e,r,n)}async invokeImpact(e,r,n={}){return this.invokeCodegraphSubcommand("impact",e,r,n)}async invokeFiles(e,r={}){return this.invokeCodegraphSubcommand("files",void 0,e,r)}async invokeContext(e,r,n={}){return this.invokeCodegraphSubcommand("context",e,r,n)}async invokeAffected(e,r,n={}){return this.invokeCodegraphSubcommand("affected",e,r,n)}async invokeStatus(e,r={}){return this.invokeCodegraphSubcommand("status",void 0,e,r)}async invokeUnlock(e,r={}){return this.invokeCodegraphSubcommand("unlock",void 0,e,r)}async invokeMarkDirty(e,r={}){return this.invokeCodegraphSubcommand("mark-dirty",void 0,e,r)}async invokeSyncIfDirty(e,r={}){return this.invokeCodegraphSubcommand("sync-if-dirty",void 0,e,r)}async invokeIndex(e,r={}){return this.invokeCodegraphSubcommand("index",void 0,e,r)}async invokeVisualize(e,r={}){return this.invokeCodegraphSubcommand("visualize",void 0,e,r)}async invokeServe(e,r,n={}){return this.invokeCodegraphSubcommand("serve",String(e),r,n)}async invokeUninit(e,r={}){return this.invokeCodegraphSubcommand("uninit",void 0,e,r)}async invokeCodegraphSubcommand(e,r,n,o){let t=Date.now(),i=o.timeoutMs??this.timeoutMs;if(!this.hasCodegraphDir(n))return{kind:null,query:r===void 0?e:Array.isArray(r)?r.join(","):r,result:null,timedOut:!1,durationMs:Date.now()-t};let a=o.codegraphBin??"codegraph",s=r===void 0?[]:Array.isArray(r)?r:[r],c=[e,...s,"--project-path",n],l=r===void 0?e:Array.isArray(r)?r.join(","):r;try{let d=await this.spawnWithTimeout(a,c,i,n);return{kind:"codegraph",query:l,result:d.trim()||null,timedOut:!1,durationMs:Date.now()-t}}catch(d){let v=d instanceof Error&&/timed out/i.test(d.message);return{kind:"codegraph",query:l,result:null,timedOut:v,durationMs:Date.now()-t}}}async invokePath(e,r,n,o={}){let t=Date.now(),i=o.timeoutMs??this.timeoutMs;if(!this.hasGraphifyDir(n))return{kind:null,query:`${e} ${r}`,result:null,timedOut:!1,durationMs:Date.now()-t};let a=o.graphifyBin??"graphify",s=["path",e,r];try{let c=await this.spawnWithTimeout(a,s,i,n);return{kind:"graphify",query:`${e} ${r}`,result:c.trim()||null,timedOut:!1,durationMs:Date.now()-t}}catch(c){return{kind:"graphify",query:`${e} ${r}`,result:null,timedOut:c instanceof Error&&/timed out/i.test(c.message),durationMs:Date.now()-t}}}async invokeExplain(e,r,n={}){return this.invokeGraphifySubcommand("explain",e,r,n)}async invokeGraphifySubcommand(e,r,n,o){let t=Date.now(),i=o.timeoutMs??this.timeoutMs;if(!this.hasGraphifyDir(n))return{kind:null,query:r??e,result:null,timedOut:!1,durationMs:Date.now()-t};let a=o.graphifyBin??"graphify",s=r===void 0?[e]:[e,r];try{let c=await this.spawnWithTimeout(a,s,i,n);return{kind:"graphify",query:r??e,result:c.trim()||null,timedOut:!1,durationMs:Date.now()-t}}catch(c){return{kind:"graphify",query:r??e,result:null,timedOut:c instanceof Error&&/timed out/i.test(c.message),durationMs:Date.now()-t}}}async invokeDiagnose(e,r={}){return this.invokeGraphifySubcommand("diagnose",void 0,e,r)}async invokeMergeDriver(e,r={}){return this.invokeGraphifySubcommand("merge-driver",void 0,e,r)}async invokeSaveResult(e,r={}){return this.invokeGraphifySubcommand("save-result",void 0,e,r)}async invokeExtract(e,r={}){return this.invokeGraphifySubcommand("extract",void 0,e,r)}async invokeClusterOnly(e,r={}){return this.invokeGraphifySubcommand("cluster-only",void 0,e,r)}async invokeLabel(e,r,n={}){return this.invokeGraphifySubcommand("label",e,r,n)}async invokeTree(e,r={}){return this.invokeGraphifySubcommand("tree",void 0,e,r)}async invokeClone(e,r={}){return this.invokeGraphifySubcommand("clone",void 0,e,r)}async invokeAdd(e,r,n={}){return this.invokeGraphifySubcommand("add",e,r,n)}async invokeCheckUpdate(e,r={}){return this.invokeGraphifySubcommand("check-update",void 0,e,r)}}var xl=null;function R(){if(!xl)xl=new zm;return xl}function Cm(e){let r=R();if(e.preferredTool)r.setPreferredTool(e.preferredTool)}var kb=R();class Am{retrieval;constructor(e=kb){this.retrieval=e}async find(e,r,n=5000){let o=Date.now(),t=await this.retrieval.invokeNode(e,r,{timeoutMs:n});if(t.kind==="codegraph"&&t.result)return $b(e,t.result,o,"codegraph");let i=await this.retrieval.invoke(r,e,{timeoutMs:n});if(i.kind==="graphify"&&i.result)return xb(e,i.result,o,"graphify");return{symbol:e,source:null,callers:[],found:!1,kind:t.kind??i.kind,durationMs:Date.now()-o}}async impact(e,r,n=5000){let o=Date.now(),t=await this.retrieval.invokeImpact(e,r,{timeoutMs:n});if(t.kind==="codegraph"&&t.result)return wb(e,t.result,o,"codegraph",t.timedOut);let i=await this.retrieval.invokeCallers(e,r,{timeoutMs:n});if(i.kind==="codegraph"&&i.result)return{symbol:e,directCallers:Kn(i.result),transitiveCallers:[],testFiles:[],docFiles:[],totalAffectedFiles:new Set(Kn(i.result).map((a)=>a.file)).size,kind:"codegraph",durationMs:Date.now()-o,timedOut:i.timedOut};return{symbol:e,directCallers:[],transitiveCallers:[],testFiles:[],docFiles:[],totalAffectedFiles:0,kind:t.kind??i.kind,durationMs:Date.now()-o,timedOut:t.timedOut||i.timedOut}}async listFiles(e,r=5000){let n=Date.now(),o=await this.retrieval.invokeFiles(e,{timeoutMs:r});if(o.kind==="codegraph"&&o.result){let t=o.result.split(`
|
|
136
|
+
`).map((i)=>i.trim()).filter(Boolean);return{files:t,count:t.length,kind:"codegraph",durationMs:Date.now()-n}}return{files:[],count:0,kind:o.kind,durationMs:Date.now()-n}}}function $b(e,r,n,o){let t=Kn(r),i=r.search(/callers?:|## callers?/i),a=i>0?r.slice(0,i).trim():r.trim();return{symbol:e,source:a||null,callers:t,found:t.length>0||a.length>0,kind:o,durationMs:Date.now()-n}}function xb(e,r,n,o){return{symbol:e,source:r.trim()||null,callers:[],found:r.trim().length>0,kind:o,durationMs:Date.now()-n}}function wb(e,r,n,o,t){let i=Em(r,/direct\s*callers?:|## direct/i),a=Em(r,/transitive\s*callers?:|## transitive/i),s=jm(r,/tests?:|## tests?/i),c=jm(r,/docs?:|## docs?/i),l=new Set;for(let d of i)l.add(d.file);for(let d of a)l.add(d.file);for(let d of s)l.add(d);for(let d of c)l.add(d);return{symbol:e,directCallers:i,transitiveCallers:a,testFiles:s,docFiles:c,totalAffectedFiles:l.size,kind:o,durationMs:Date.now()-n,timedOut:t}}function Kn(e){let r=[],n=e.split(`
|
|
137
|
+
`);for(let o of n){let t=o.match(/^\s*[-*]?\s*([^\s:]+\.[a-z]+):(\d+)(?:[:\s—–-]+(.+))?/i);if(t){let i=t[1]??"",a=t[2]?parseInt(t[2],10):0,s=(t[3]??"").trim();if(i&&a>0)r.push({file:i,line:a,context:s})}}return r}function Em(e,r){let n=e.split(`
|
|
138
|
+
`),o=!1,t=[];for(let i of n){if(r.test(i)){o=!0;continue}if(o){if(/^#\s/.test(i)&&!r.test(i))break;if(i.trim()===""&&t.length>0)break;t.push(i)}}return Kn(t.join(`
|
|
139
|
+
`))}function jm(e,r){let n=e.split(`
|
|
140
|
+
`),o=!1,t=[];for(let i of n){if(r.test(i)){o=!0;continue}if(o){if(/^#\s/.test(i)&&!r.test(i))break;if(i.trim()===""&&t.length>0)break;let a=i.trim().replace(/^[-*]\s*/,"");if(a.match(/[^\s:]+\.[a-z]+/i))t.push(a)}}return t}var wl=null;function Sl(){if(!wl)wl=new Am;return wl}Qn();var Z=C.schema,Dl="0.0.0";try{Dl=Um().version}catch{}async function Pb(e,r,n=1500){if(!Pl)return"pending";return await Pl.awaitDelivery({sessionID:e,mcpTool:r,timeoutMs:n})}var Pl=null;function Lm(e){Pl=e}async function Zm(e,r){return await Pb(e,r)}function Fm(e){return C({description:"Semantic code search over the project graph. ROUTING (v0.25.0): with both indexes present, codegraph handles code-structure queries (symbols, call sites, module layout) and graphify "+"handles concept/architecture queries — the plugin alternates deterministically per query, "+"or you can force one via config graphRetrieval.preferredTool. USE THIS for architecture questions, finding call sites, understanding module structure. "+"Prefer over grep/glob for high-level understanding — grep is still better for literal text matches.",args:{query:Z.string().min(3).describe("Natural language query describing what you're looking for"),maxResults:Z.number().int().min(1).max(20).optional().describe("Max results to return (default 10)")},async execute(r,n){let o=Date.now(),t=await e.graphRetrieval.invoke(e.cwd,r.query,{timeoutMs:8000}),i={tool:"omo_search",query:r.query,kind:t.kind,timedOut:t.timedOut,durationMs:t.durationMs,resultSize:t.result?.length??0,sessionID:n.sessionID};if(t.timedOut)return{title:"omo_search: timeout",output:`Graph search timed out after ${t.durationMs}ms. No graph tools available at ${e.cwd}, or the query is too expensive. Fall back to grep/glob for direct text matching.`,metadata:i};if(!t.result)return{title:"omo_search: no graph backend",output:`No codegraph or graphify directory found at ${e.cwd}. Run \`npx codegraph init\` or \`graphify . --no-viz\` to build the index, then call omo_search again. Until then, use grep/glob for direct text matching.`,metadata:i};return{title:`omo_search: ${t.kind}`,output:t.result,metadata:i}}})}function Gm(e){return C({description:"Search lessons learned in past sessions of this project. Returns ranked lessons (highest confidence first) matching the query. "+"Use before making non-trivial decisions — the answer may already be in memory.",args:{query:Z.string().min(2).describe("What kind of lesson you're looking for"),limit:Z.number().int().min(1).max(20).optional().describe("Max lessons to return (default 5)")},async execute(r,n){let o=Date.now(),i=(await e.sqlite.smartSearch({query:r.query,limit:r.limit??5})).lessons;if(i.length===0)return{title:"omo_recall: no matches",output:`No past lessons found matching "${r.query}". This is the first time the agent is encountering this question.`,metadata:{tool:"omo_recall",query:r.query,durationMs:Date.now()-o,lessonsFound:0}};let a=i.map((s,c)=>`${c+1}. [${s.id}] confidence=${s.confidence.toFixed(2)}
|
|
141
|
+
${s.title}
|
|
142
|
+
${s.content.slice(0,500)}${s.content.length>500?"...":""}`).join(`
|
|
143
143
|
|
|
144
|
-
`);return{title:`omo_recall: ${
|
|
144
|
+
`);return{title:`omo_recall: ${i.length} lesson${i.length===1?"":"s"}`,output:`Found ${i.length} past lesson${i.length===1?"":"s"} matching "${r.query}":
|
|
145
145
|
|
|
146
|
-
${
|
|
146
|
+
${a}`,metadata:{tool:"omo_recall",query:r.query,durationMs:Date.now()-o,lessonsFound:i.length}}}})}function Vm(e){return C({description:"Show omo-meta-governor plugin status: enabled, metrics, recent decisions, and current config. Use when the user asks 'is the plugin working?' or to verify that lessons are being persisted.",args:{},async execute(r,n){let o=e.metrics.getMetrics(),t=o.counters.interventions_delivered?.count??0,i=(o.counters.decisions_skipped_continue?.count??0)+(o.counters.decisions_skipped_no_decision?.count??0)+(o.counters.decisions_skipped_no_message?.count??0)+(o.counters.decisions_skipped_below_threshold?.count??0),a=o.counters.decisions_taken?.lastOccurrenceISO,s=o.counters.interventions_delivered?.lastOccurrenceISO,c={version:Dl,status:o.counters.orchestrator_errors?.count?"degraded":"healthy",enabled:!0,startedAtISO:o.startedAtISO,uptimeMs:o.uptimeMs,metrics:{decisionsTaken:o.counters.decisions_taken?.count??0,decisionsStored:o.counters.decisions_stored?.count??0,interventionsDelivered:t,orchestratorRuns:o.counters.orchestrator_runs?.count??0,orchestratorErrors:o.counters.orchestrator_errors?.count??0,lastDecisionISO:a,lastInterventionISO:s},logFile:{path:e.logFilePath,sizeBytes:0,rotatedFiles:0},session:{id:n.sessionID,toolCallsObserved:o.counters.orchestrator_runs?.count??0,violationsDetected:o.counters.protocol_violations_detected?.count??0,interventionsSkipped:i,firstSeenISO:o.startedAtISO,lastSeenISO:new Date().toISOString()},graphSync:{lastUpgradeAtISO:null,lastUpgradeResult:"unknown",lastUpgradeTarget:null,lastUpgradeMs:null},graphToolsUsed:{omo_search:0,omo_recall:0,omo_health:0,omo_find:0,omo_impact:0,omo_remember:0,omo_recall_mcp:0,omo_path:0,omo_explain:0,omo_files:0,omo_callers:0,omo_node:0,omo_context:0,omo_affected_cg:0,omo_status:0,omo_unlock:0,omo_mark_dirty:0,omo_sync_if_dirty:0,omo_index:0,omo_visualize:0,omo_serve:0,omo_uninit:0,omo_diagnose:0,omo_merge_graphs:0,omo_save_result:0,omo_extract:0,omo_cluster_only:0,omo_label:0,omo_tree:0,omo_clone:0,omo_add:0,omo_check_update:0,omo_hook_status:0}};try{Om(c,e.healthFilePath)}catch{}return{title:"omo_health",output:`# omo-meta-governor v${Dl} — Health Report
|
|
147
147
|
|
|
148
|
-
`+`**Status**: ${
|
|
149
|
-
**Enabled**: ${
|
|
150
|
-
**Uptime**: ${(
|
|
151
|
-
**Session**: ${
|
|
148
|
+
`+`**Status**: ${c.status}
|
|
149
|
+
**Enabled**: ${c.enabled}
|
|
150
|
+
**Uptime**: ${(c.uptimeMs/1000).toFixed(1)}s
|
|
151
|
+
**Session**: ${c.session.id}
|
|
152
152
|
|
|
153
153
|
## Metrics (this session)
|
|
154
154
|
| Metric | Count | Last seen |
|
|
155
155
|
|--------|-------|-----------|
|
|
156
|
-
| Decisions taken | ${
|
|
157
|
-
| Decisions stored | ${
|
|
158
|
-
`+`| Interventions delivered | ${
|
|
159
|
-
| Interventions skipped | ${
|
|
160
|
-
`+`| Orchestrator runs | ${
|
|
161
|
-
`+`| Orchestrator errors | ${
|
|
162
|
-
`+`| Protocol violations | ${
|
|
156
|
+
| Decisions taken | ${c.metrics.decisionsTaken} | ${a??"—"} |
|
|
157
|
+
| Decisions stored | ${c.metrics.decisionsStored} | — |
|
|
158
|
+
`+`| Interventions delivered | ${t} | ${s??"—"} |
|
|
159
|
+
| Interventions skipped | ${i} | — |
|
|
160
|
+
`+`| Orchestrator runs | ${c.metrics.orchestratorRuns} | — |
|
|
161
|
+
`+`| Orchestrator errors | ${c.metrics.orchestratorErrors} | — |
|
|
162
|
+
`+`| Protocol violations | ${c.session.violationsDetected} | — |
|
|
163
163
|
|
|
164
164
|
`+`## Files
|
|
165
|
-
- Health JSON: \`${
|
|
166
|
-
- Log file: \`${
|
|
165
|
+
- Health JSON: \`${e.healthFilePath}\`
|
|
166
|
+
- Log file: \`${e.logFilePath}\`
|
|
167
167
|
|
|
168
|
-
The health JSON file is updated on every invocation. Run \`cat ${
|
|
168
|
+
The health JSON file is updated on every invocation. Run \`cat ${e.healthFilePath}\` to see the full snapshot.`,metadata:{tool:"omo_health",sessionID:n.sessionID,uptimeMs:c.uptimeMs}}}})}function Wm(e){return C({description:"Find the exact source location and direct callers of a symbol (function, class, method, variable). "+"CODEGRAPH TOOL (v0.25.0): symbol precision lives in codegraph — use this for exact definitions "+"and call sites. USE THIS when you know the exact symbol name and need its source code. Example: omo_find with symbol='UserService.create' returns the file:line of the definition and every call site.",args:{symbol:Z.string().min(1).describe("The exact symbol name to find (e.g. 'UserService.create', 'validateToken')")},async execute(r,n){let o=Date.now(),i=await(e.codeGraph??Sl()).find(r.symbol,e.cwd,5000),a={tool:"omo_find",symbol:r.symbol,kind:i.kind,found:i.found,callerCount:i.callers.length,durationMs:i.durationMs,sessionID:n.sessionID};if(!i.found)return{title:`omo_find: ${r.symbol} not found`,output:`Symbol "${r.symbol}" was not found in the codebase graph. If .codegraph/ doesn't exist, run \`npx codegraph init\` first. Otherwise, try omo_search with a natural-language description.`,metadata:a};let s=i.source?`
|
|
169
169
|
## Definition
|
|
170
170
|
|
|
171
171
|
\`\`\`
|
|
172
|
-
${
|
|
172
|
+
${i.source.slice(0,2000)}
|
|
173
173
|
\`\`\`
|
|
174
|
-
`:"",
|
|
175
|
-
## Direct Callers (${
|
|
174
|
+
`:"",c=i.callers.length>0?`
|
|
175
|
+
## Direct Callers (${i.callers.length})
|
|
176
176
|
|
|
177
|
-
`+
|
|
178
|
-
`)+(
|
|
179
|
-
... and ${
|
|
177
|
+
`+i.callers.slice(0,30).map((l)=>`- ${l.file}:${l.line}${l.context?` — ${l.context}`:""}`).join(`
|
|
178
|
+
`)+(i.callers.length>30?`
|
|
179
|
+
... and ${i.callers.length-30} more`:""):`
|
|
180
180
|
## Direct Callers
|
|
181
181
|
|
|
182
|
-
None found in the indexed graph.`;return{title:`omo_find: ${
|
|
183
|
-
`+
|
|
184
|
-
`),
|
|
185
|
-
`),
|
|
186
|
-
`),metadata:_}}})}function RI($){return M({description:"Save a fact, observation, or insight to AgentMemory so it persists across sessions. USE THIS when you learn something worth remembering: a bug pattern, a config quirk, a user preference, a project rule. The system will route the save to AgentMemory's MCP server. Example: omo_remember with content='Always use bun:sqlite, not better-sqlite3' "+"concepts=['storage', 'bun'] — the system will save this to AgentMemory.",args:{content:C.string().min(1).describe("The fact/observation/lesson to remember"),concepts:C.array(C.string()).optional().describe("Tags to categorize this memory (e.g. ['security', 'auth'])"),type:C.enum(["fact","pattern","observation"]).optional().describe("Type of memory: fact, pattern, or observation")},async execute(U,r){let b=r.sessionID;if(!Qv())return{title:"omo_remember: session not initialized",output:"Could not save to AgentMemory: the plugin has not captured the OpenCode session client. Try restarting the plugin or check that the OpenCode session is running.",metadata:{tool:"omo_remember",ok:!1}};let v={content:U.content,concepts:U.concepts??[],type:U.type??"observation"},z=await Yv(b,{toolName:"omo_remember",mcpTool:"agentmemory_memory_save",mcpArgs:v,preamble:"Save this to AgentMemory (cross-session persistent memory)."});if(!z.ok)return{title:"omo_remember: failed",output:`Failed to dispatch save to AgentMemory: ${z.error??"unknown error"}`,metadata:{tool:"omo_remember",ok:!1,durationMs:z.durationMs}};$.onDispatch?.({sessionID:b,mcpTool:"agentmemory_memory_save",mcpArgs:v});let _=await FI(b,"agentmemory_memory_save");return{title:`omo_remember: ${_}`,output:`Save to AgentMemory ${_==="delivered"?"verified":_==="expired"?"not delivered within TTL":"dispatched"} (messageID: ${z.messageID??"pending"}). LLM call to agentmemory_memory_save ${_==="delivered"?"was observed":"not yet observed (will happen on next turn)"} with args: ${JSON.stringify(v)}. It will be available in future sessions via agentmemory_memory_recall.`,metadata:{tool:"omo_remember",ok:!0,messageID:z.messageID,durationMs:z.durationMs,contentLength:U.content.length,deliveryStatus:_}}}})}function mI($){return M({description:"Search AgentMemory's cross-session memory (via agentmemory_memory_smart_search). USE THIS for questions that need context from PREVIOUS sessions: 'how did we set up X', 'what was the last approach to Y', 'recall the config for Z'. For current-session recall, prefer omo_recall (local SQLite) instead.",args:{query:C.string().min(2).describe("The search query"),limit:C.number().int().min(1).max(20).optional().describe("Max results (default 5)")},async execute(U,r){let b=r.sessionID;if(!Qv())return{title:"omo_recall_mcp: session not initialized",output:"Could not search AgentMemory: session client not captured. Use omo_recall for local session memory instead.",metadata:{tool:"omo_recall_mcp",ok:!1}};let v={query:U.query,limit:U.limit??5},z=await Yv(b,{toolName:"omo_recall_mcp",mcpTool:"agentmemory_memory_smart_search",mcpArgs:v,preamble:"Search AgentMemory for this query and report the results."});if(!z.ok)return{title:"omo_recall_mcp: failed",output:`Failed to dispatch search to AgentMemory: ${z.error??"unknown error"}`,metadata:{tool:"omo_recall_mcp",ok:!1,durationMs:z.durationMs}};$.onDispatch?.({sessionID:b,mcpTool:"agentmemory_memory_smart_search",mcpArgs:v});let _=await FI(b,"agentmemory_memory_smart_search");return{title:`omo_recall_mcp: ${_}`,output:`Search to AgentMemory ${_==="delivered"?"verified":"dispatched"} (messageID: ${z.messageID??"pending"}). LLM call to agentmemory_memory_smart_search ${_==="delivered"?"was observed":"not yet observed (will happen on next turn)"} with args: ${JSON.stringify(v)}. Results will appear in the next assistant message.`,metadata:{tool:"omo_recall_mcp",ok:!0,messageID:z.messageID,durationMs:z.durationMs,query:U.query,deliveryStatus:_}}}})}function TI($){return M({description:"Find the shortest conceptual path between two concepts in the codebase "+"using the graphify knowledge graph. GRAPHIFY TOOL (v0.25.0): concept-level relations live in graphify — "+"codegraph cannot answer these. USE THIS to understand how two apparently unrelated parts of the codebase connect. Example: omo_path with from='auth' to='database' traces the chain from authentication handlers to DB queries.",args:{from:C.string().min(1).describe("Start concept"),to:C.string().min(1).describe("End concept")},async execute(U,r){let b=Date.now(),z=await R().invokePath(U.from,U.to,$.cwd,{timeoutMs:8000});return{title:z.kind==="graphify"?"omo_path: path found":"omo_path: unavailable",output:z.result??`No path found between "${U.from}" and "${U.to}". Check if graphify-out/ exists and is up to date.`,metadata:{tool:"omo_path",from:U.from,to:U.to,kind:z.kind,durationMs:Date.now()-b,sessionID:r?r.sessionID:"unknown"}}}})}function CI($){return M({description:"Get a plain-language explanation of a concept from the graphify knowledge graph. "+"GRAPHIFY TOOL (v0.25.0): conceptual overviews live in graphify — codegraph cannot produce them. "+"USE THIS when you encounter an unfamiliar term or module and need a quick overview of what it is and how it fits into the codebase. Example: 'omo_explain SwinTransformer'.",args:{concept:C.string().min(1).describe("The concept to explain")},async execute(U,r){let b=Date.now(),z=await R().invokeExplain(U.concept,$.cwd,{timeoutMs:8000});return{title:z.kind==="graphify"?"omo_explain: done":"omo_explain: unavailable",output:z.result??`Concept "${U.concept}" not found in the knowledge graph. Run \`graphify . --no-viz\` first.`,metadata:{tool:"omo_explain",concept:U.concept,kind:z.kind,durationMs:Date.now()-b,sessionID:r?r.sessionID:"unknown"}}}})}function cI($){return M({description:"List files indexed by the codebase graph (codegraph or graphify). USAGE: returns a list of indexed file paths. Use this when you need to discover which files are in the graph before drilling into a specific one.",args:{},async execute(U,r){let b=Date.now(),z=await($.graphRetrieval??R()).invokeFiles($.cwd,{timeoutMs:5000});if(!z.result)return{title:"omo_files: no index",output:"No indexed files found. If `.codegraph/` doesn't exist, run `npx codegraph init` first. If `graphify-out/` doesn't exist, run `graphify . --no-viz` first.",metadata:{tool:"omo_files",kind:z.kind,durationMs:Date.now()-b,sessionID:r.sessionID}};return{title:`omo_files: ${z.kind??"unknown"} backend`,output:z.result,metadata:{tool:"omo_files",kind:z.kind,durationMs:Date.now()-b,sessionID:r.sessionID}}}})}function uI($){return M({description:"List all call sites of a symbol in the codebase graph. USAGE: omo_callers with symbol='UserService.create' returns every file:line "+"where that symbol is called. Codegraph-only — returns null if .codegraph/ is missing.",args:{symbol:C.string().min(1).describe("The symbol to find callers for (function, class, method, variable)")},async execute(U,r){let b=Date.now(),z=await($.graphRetrieval??R()).invokeCallers(U.symbol,$.cwd,{timeoutMs:5000});if(!z.result)return{title:`omo_callers: ${U.symbol} (no callers or no codegraph)`,output:`No call sites found for "${U.symbol}". Either the symbol is unused, or codegraph is not installed / has no index. Run \`npx codegraph init\` to create the index.`,metadata:{tool:"omo_callers",symbol:U.symbol,kind:z.kind,durationMs:Date.now()-b,sessionID:r.sessionID}};return{title:`omo_callers: ${U.symbol}`,output:z.result,metadata:{tool:"omo_callers",symbol:U.symbol,kind:z.kind,durationMs:Date.now()-b,sessionID:r.sessionID}}}})}function hI($){return M({description:"Get the source code of a symbol (function/class/method/variable) and its direct callers. USAGE: omo_node with symbol='UserService.create' returns the symbol's definition and "+"every direct call site. Distinct from omo_find (which only returns a definition summary) — "+"this tool returns the full source body. Codegraph-only.",args:{symbol:C.string().min(1).describe("The symbol to resolve (function, class, method, variable)")},async execute(U,r){let b=Date.now(),z=await($.graphRetrieval??R()).invokeNode(U.symbol,$.cwd,{timeoutMs:5000});if(!z.result)return{title:`omo_node: ${U.symbol} not found`,output:`Symbol "${U.symbol}" was not found in the codegraph index. Run \`npx codegraph init\` if the index doesn't exist, or \`npx codegraph sync\` to refresh.`,metadata:{tool:"omo_node",symbol:U.symbol,kind:z.kind,durationMs:Date.now()-b,sessionID:r.sessionID}};return{title:`omo_node: ${U.symbol}`,output:z.result,metadata:{tool:"omo_node",symbol:U.symbol,kind:z.kind,durationMs:Date.now()-b,sessionID:r.sessionID}}}})}function o($,U,r,b,v,z){let _=Date.now()-b;if(!r.result)return{title:`${$}: no result`,output:z,metadata:{tool:$,kind:r.kind,durationMs:_,sessionID:v.sessionID,...U}};return{title:$,output:r.result,metadata:{tool:$,kind:r.kind,durationMs:_,sessionID:v.sessionID,...U}}}function nI($){return M({description:"Get a focused code context window for a given task. USAGE: omo_context with task='validate JWT tokens' returns relevant code blocks (file paths + line ranges). "+"Codegraph-only — returns null if .codegraph/ is missing.",args:{task:C.string().min(1).describe("The task to extract context for")},async execute(U,r){let b=Date.now(),z=await($.graphRetrieval??R()).invokeContext(U.task,$.cwd,{timeoutMs:5000});return o("omo_context",{task:U.task},{...z,durationMs:Date.now()-b},b,r,`No context for task "${U.task}". Run \`npx codegraph init\` if the index doesn't exist.`)}})}function yI($){return M({description:"List files affected by changes in the given source files. USAGE: omo_affected_cg with files=['src/auth.ts'] returns the set of test files, callers, and dependent modules. Codegraph-only.",args:{files:C.array(C.string().min(1)).min(1).describe("Source file paths to analyze (relative to cwd)")},async execute(U,r){let b=Date.now(),z=await($.graphRetrieval??R()).invokeAffected(U.files,$.cwd,{timeoutMs:5000});return o("omo_affected_cg",{files:U.files.join(",")},{...z,durationMs:Date.now()-b},b,r,`Could not compute affected files for [${U.files.join(", ")}]. Run \`npx codegraph init\` if needed.`)}})}function fI($){return M({description:"Show codegraph health: node count, version, last update timestamp. USAGE: omo_status returns a multi-line report. Codegraph-only.",args:{},async execute(U,r){let b=Date.now(),z=await($.graphRetrieval??R()).invokeStatus($.cwd,{timeoutMs:5000});return o("omo_status",{},{...z,durationMs:Date.now()-b},b,r,"codegraph is not installed or has no index. Run `npx codegraph init` to create one.")}})}function iI($){return M({description:"Remove a stale codegraph lock file (left behind after a crash). USAGE: omo_unlock clears the lock so the next sync can run. Codegraph-only.",args:{},async execute(U,r){let b=Date.now(),z=await($.graphRetrieval??R()).invokeUnlock($.cwd,{timeoutMs:5000});return o("omo_unlock",{},{...z,durationMs:Date.now()-b},b,r,"codegraph is not installed.")}})}function lI($){return M({description:"Mark the codegraph index as dirty so the next sync re-extracts. USAGE: omo_mark_dirty when you know source files changed without git hooks firing.",args:{},async execute(U,r){let b=Date.now(),z=await($.graphRetrieval??R()).invokeMarkDirty($.cwd,{timeoutMs:5000});return o("omo_mark_dirty",{},{...z,durationMs:Date.now()-b},b,r,"codegraph is not installed.")}})}function oI($){return M({description:"Trigger a codegraph sync ONLY if the graph was previously marked dirty. USAGE: omo_sync_if_dirty is a cheap daily check; omo_status shows the dirty flag.",args:{},async execute(U,r){let b=Date.now(),z=await($.graphRetrieval??R()).invokeSyncIfDirty($.cwd,{timeoutMs:30000});return o("omo_sync_if_dirty",{},{...z,durationMs:Date.now()-b},b,r,"codegraph is not installed or no index exists.")}})}function dI($){return M({description:"Manually trigger a full codegraph reindex. USAGE: omo_index when you want a guaranteed-fresh graph (bypasses the dirty-flag check).",args:{},async execute(U,r){let b=Date.now(),z=await($.graphRetrieval??R()).invokeIndex($.cwd,{timeoutMs:60000});return o("omo_index",{},{...z,durationMs:Date.now()-b},b,r,"codegraph is not installed. Run `npm i -D @colbymchenry/codegraph` first.")}})}function pI($){return M({description:"Generate an HTML visualization of the codegraph. USAGE: omo_visualize returns the path to the generated HTML file.",args:{},async execute(U,r){let b=Date.now(),z=await($.graphRetrieval??R()).invokeVisualize($.cwd,{timeoutMs:30000});return o("omo_visualize",{},{...z,durationMs:Date.now()-b},b,r,"codegraph is not installed.")}})}function tI($){return M({description:"Start the codegraph HTTP server on the given port. USAGE: omo_serve with port=3030 starts the server in the background. Returns the port + status.",args:{port:C.number().int().min(1).max(65535).describe("TCP port to bind the codegraph server to")},async execute(U,r){let b=Date.now(),z=await($.graphRetrieval??R()).invokeServe(U.port,$.cwd,{timeoutMs:5000});return o("omo_serve",{port:U.port},{...z,durationMs:Date.now()-b},b,r,"codegraph is not installed. Run `npm i -D @colbymchenry/codegraph` first.")}})}function eI($){return M({description:"Remove the codegraph index (.codegraph/) from disk. "+"USAGE: omo_uninit when you want a clean slate — next sync will rebuild from scratch.",args:{},async execute(U,r){let b=Date.now(),z=await($.graphRetrieval??R()).invokeUninit($.cwd,{timeoutMs:5000});return o("omo_uninit",{},{...z,durationMs:Date.now()-b},b,r,"codegraph is not installed.")}})}function aI($){return M({description:"Diagnose the graphify graph for inconsistencies, multigraph warnings, and stale nodes. USAGE: omo_diagnose returns a JSON-like report. Graphify-only.",args:{},async execute(U,r){let b=Date.now(),z=await($.graphRetrieval??R()).invokeDiagnose($.cwd,{timeoutMs:1e4});return o("omo_diagnose",{},{...z,durationMs:Date.now()-b},b,r,"graphify is not installed. Run `pip install graphifyy` first.")}})}function sI($){return M({description:"Run graphify's 3-way merge driver to resolve conflicting graph segments. USAGE: omo_merge_graphs when git reports a conflict in graphify-out/. Graphify-only.",args:{},async execute(U,r){let b=Date.now(),z=await($.graphRetrieval??R()).invokeMergeDriver($.cwd,{timeoutMs:30000});return o("omo_merge_graphs",{},{...z,durationMs:Date.now()-b},b,r,"graphify is not installed.")}})}function $k($){return M({description:"Persist the result of the last graphify query to disk for later inspection. USAGE: omo_save_result after omo_explain or omo_path returns a useful output.",args:{},async execute(U,r){let b=Date.now(),z=await($.graphRetrieval??R()).invokeSaveResult($.cwd,{timeoutMs:5000});return o("omo_save_result",{},{...z,durationMs:Date.now()-b},b,r,"graphify is not installed.")}})}function vk($){return M({description:"Re-run graphify's semantic extraction over the entire source tree. USAGE: omo_extract when the graph schema changed and you want a fresh semantic layer.",args:{},async execute(U,r){let b=Date.now(),z=await($.graphRetrieval??R()).invokeExtract($.cwd,{timeoutMs:60000});return o("omo_extract",{},{...z,durationMs:Date.now()-b},b,r,"graphify is not installed.")}})}function Uk($){return M({description:"Re-run graphify's clustering step (skip semantic extraction). USAGE: omo_cluster_only after minor node additions to refresh the topic map.",args:{},async execute(U,r){let b=Date.now(),z=await($.graphRetrieval??R()).invokeClusterOnly($.cwd,{timeoutMs:30000});return o("omo_cluster_only",{},{...z,durationMs:Date.now()-b},b,r,"graphify is not installed.")}})}function rk($){return M({description:"Apply a label to a graphify node (e.g. for categorization or human notes). USAGE: omo_label with node='validateToken' applies a label.",args:{node:C.string().min(1).describe("The graph node to label")},async execute(U,r){let b=Date.now(),z=await($.graphRetrieval??R()).invokeLabel(U.node,$.cwd,{timeoutMs:5000});return o("omo_label",{node:U.node},{...z,durationMs:Date.now()-b},b,r,"graphify is not installed.")}})}function bk($){return M({description:"Emit a tree visualization of the graphify graph (hierarchical topic layout). USAGE: omo_tree for a structural overview of the topic map. Graphify-only.",args:{},async execute(U,r){let b=Date.now(),z=await($.graphRetrieval??R()).invokeTree($.cwd,{timeoutMs:1e4});return o("omo_tree",{},{...z,durationMs:Date.now()-b},b,r,"graphify is not installed.")}})}function zk($){return M({description:"Clone the graphify graph to a new location. USAGE: omo_clone when forking a project or creating a backup.",args:{},async execute(U,r){let b=Date.now(),z=await($.graphRetrieval??R()).invokeClone($.cwd,{timeoutMs:30000});return o("omo_clone",{},{...z,durationMs:Date.now()-b},b,r,"graphify is not installed.")}})}function _k($){return M({description:"Add specific files to the graphify graph (instead of re-extracting the whole tree). USAGE: omo_add with files='src/auth.ts src/login.ts' after writing new files.",args:{files:C.string().min(1).describe("Space-separated list of file paths to add (relative to cwd)")},async execute(U,r){let b=Date.now(),z=await($.graphRetrieval??R()).invokeAdd(U.files,$.cwd,{timeoutMs:30000});return o("omo_add",{files:U.files},{...z,durationMs:Date.now()-b},b,r,"graphify is not installed.")}})}function Nk($){return M({description:"Check if the graphify schema or extractors changed since the last extraction. USAGE: omo_check_update to decide if re-extraction is needed. Graphify-only.",args:{},async execute(U,r){let b=Date.now(),z=await($.graphRetrieval??R()).invokeCheckUpdate($.cwd,{timeoutMs:1e4});return o("omo_check_update",{},{...z,durationMs:Date.now()-b},b,r,"graphify is not installed.")}})}function Ok($){return M({description:"Check whether the graphify post-commit git hook is installed in this project. USAGE: omo_hook_status returns 'installed' or 'missing' along with the hook path. Run after `git init` to confirm the hook is wired.",args:{},async execute(U,r){let b=Date.now(),{isGraphifyHookInstalled:v}=await Promise.resolve().then(() => (S4(),GN)),z=await v($.cwd),_=`${$.cwd}/.git/hooks/post-commit`,N=z?`graphify post-commit hook is INSTALLED at ${_}.`:"graphify post-commit hook is NOT installed. Run `graphify hook install` or enable graphSync in plugin config to install automatically.";return{title:`omo_hook_status: ${z?"installed":"missing"}`,output:N,metadata:{tool:"omo_hook_status",installed:z,hookPath:_,durationMs:Date.now()-b,sessionID:r.sessionID}}}})}function f6($,U,r,b,v,z){let _=Date.now()-b;if(!r.ok)return{title:`${$}: ${r.code}`,output:`${z}
|
|
182
|
+
None found in the indexed graph.`;return{title:`omo_find: ${r.symbol}${i.callers.length>0?` (${i.callers.length} callers)`:""}`,output:`Found definition for "${r.symbol}" (via ${i.kind??"fallback"}).
|
|
183
|
+
`+s+c,metadata:a}}})}function Bm(e){return C({description:"Analyze the impact of changing a symbol. Lists direct callers, transitive callers, and affected test/doc files. CODEGRAPH TOOL (v0.25.0): call-graph analysis is codegraph-only. "+"ALWAYS run this BEFORE modifying a function or class — "+"knows what will break. Example: omo_impact with symbol='validateToken' lists every file that calls validateToken and every test that exercises it.",args:{symbol:Z.string().min(1).describe("The symbol to analyze (function, class, method)")},async execute(r,n){let o=Date.now(),i=await(e.codeGraph??Sl()).impact(r.symbol,e.cwd,5000),a={tool:"omo_impact",symbol:r.symbol,kind:i.kind,directCallers:i.directCallers.length,transitiveCallers:i.transitiveCallers.length,testFiles:i.testFiles.length,docFiles:i.docFiles.length,totalAffectedFiles:i.totalAffectedFiles,timedOut:i.timedOut,durationMs:i.durationMs,sessionID:n.sessionID};if(i.totalAffectedFiles===0&&i.directCallers.length===0)return{title:`omo_impact: no callers found for ${r.symbol}`,output:`No call sites found for "${r.symbol}". Either the symbol is unused, or the codegraph index is stale. Run \`npx codegraph sync\` to refresh the index and try again.`,metadata:a};let s=[];if(s.push(`Impact analysis for "${r.symbol}" (via ${i.kind??"fallback"}).
|
|
184
|
+
`),s.push("## Summary"),s.push(`- Direct callers: **${i.directCallers.length}**`),s.push(`- Transitive callers: **${i.transitiveCallers.length}**`),s.push(`- Test files affected: **${i.testFiles.length}**`),s.push(`- Doc files affected: **${i.docFiles.length}**`),s.push(`- Total affected files: **${i.totalAffectedFiles}**
|
|
185
|
+
`),i.directCallers.length>0){s.push("## Direct Callers");for(let c of i.directCallers.slice(0,30))s.push(`- ${c.file}:${c.line}${c.context?` — ${c.context}`:""}`);if(i.directCallers.length>30)s.push(`- ... and ${i.directCallers.length-30} more`);s.push("")}if(i.testFiles.length>0){s.push("## Test Files Affected");for(let c of i.testFiles.slice(0,20))s.push(`- ${c}`);s.push("")}if(i.docFiles.length>0){s.push("## Doc Files Affected");for(let c of i.docFiles.slice(0,20))s.push(`- ${c}`);s.push("")}if(i.timedOut)s.push("⚠️ Analysis timed out — results may be incomplete. Try with a more specific symbol.");return{title:`omo_impact: ${r.symbol} (${i.totalAffectedFiles} files)`,output:s.join(`
|
|
186
|
+
`),metadata:a}}})}function Hm(e){return C({description:"Save a fact, observation, or insight to AgentMemory so it persists across sessions. USE THIS when you learn something worth remembering: a bug pattern, a config quirk, a user preference, a project rule. The system will route the save to AgentMemory's MCP server. Example: omo_remember with content='Always use bun:sqlite, not better-sqlite3' "+"concepts=['storage', 'bun'] — the system will save this to AgentMemory.",args:{content:Z.string().min(1).describe("The fact/observation/lesson to remember"),concepts:Z.array(Z.string()).optional().describe("Tags to categorize this memory (e.g. ['security', 'auth'])"),type:Z.enum(["fact","pattern","observation"]).optional().describe("Type of memory: fact, pattern, or observation")},async execute(r,n){let o=n.sessionID;if(!bt())return{title:"omo_remember: session not initialized",output:"Could not save to AgentMemory: the plugin has not captured the OpenCode session client. Try restarting the plugin or check that the OpenCode session is running.",metadata:{tool:"omo_remember",ok:!1}};let t={content:r.content,concepts:r.concepts??[],type:r.type??"observation"},i=await _t(o,{toolName:"omo_remember",mcpTool:"agentmemory_memory_save",mcpArgs:t,preamble:"Save this to AgentMemory (cross-session persistent memory)."});if(!i.ok)return{title:"omo_remember: failed",output:`Failed to dispatch save to AgentMemory: ${i.error??"unknown error"}`,metadata:{tool:"omo_remember",ok:!1,durationMs:i.durationMs}};e.onDispatch?.({sessionID:o,mcpTool:"agentmemory_memory_save",mcpArgs:t});let a=await Zm(o,"agentmemory_memory_save");return{title:`omo_remember: ${a}`,output:`Save to AgentMemory ${a==="delivered"?"verified":a==="expired"?"not delivered within TTL":"dispatched"} (messageID: ${i.messageID??"pending"}). LLM call to agentmemory_memory_save ${a==="delivered"?"was observed":"not yet observed (will happen on next turn)"} with args: ${JSON.stringify(t)}. It will be available in future sessions via agentmemory_memory_recall.`,metadata:{tool:"omo_remember",ok:!0,messageID:i.messageID,durationMs:i.durationMs,contentLength:r.content.length,deliveryStatus:a}}}})}function Jm(e){return C({description:"Search AgentMemory's cross-session memory (via agentmemory_memory_smart_search). USE THIS for questions that need context from PREVIOUS sessions: 'how did we set up X', 'what was the last approach to Y', 'recall the config for Z'. For current-session recall, prefer omo_recall (local SQLite) instead.",args:{query:Z.string().min(2).describe("The search query"),limit:Z.number().int().min(1).max(20).optional().describe("Max results (default 5)")},async execute(r,n){let o=n.sessionID;if(!bt())return{title:"omo_recall_mcp: session not initialized",output:"Could not search AgentMemory: session client not captured. Use omo_recall for local session memory instead.",metadata:{tool:"omo_recall_mcp",ok:!1}};let t={query:r.query,limit:r.limit??5},i=await _t(o,{toolName:"omo_recall_mcp",mcpTool:"agentmemory_memory_smart_search",mcpArgs:t,preamble:"Search AgentMemory for this query and report the results."});if(!i.ok)return{title:"omo_recall_mcp: failed",output:`Failed to dispatch search to AgentMemory: ${i.error??"unknown error"}`,metadata:{tool:"omo_recall_mcp",ok:!1,durationMs:i.durationMs}};e.onDispatch?.({sessionID:o,mcpTool:"agentmemory_memory_smart_search",mcpArgs:t});let a=await Zm(o,"agentmemory_memory_smart_search");return{title:`omo_recall_mcp: ${a}`,output:`Search to AgentMemory ${a==="delivered"?"verified":"dispatched"} (messageID: ${i.messageID??"pending"}). LLM call to agentmemory_memory_smart_search ${a==="delivered"?"was observed":"not yet observed (will happen on next turn)"} with args: ${JSON.stringify(t)}. Results will appear in the next assistant message.`,metadata:{tool:"omo_recall_mcp",ok:!0,messageID:i.messageID,durationMs:i.durationMs,query:r.query,deliveryStatus:a}}}})}function qm(e){return C({description:"Find the shortest conceptual path between two concepts in the codebase "+"using the graphify knowledge graph. GRAPHIFY TOOL (v0.25.0): concept-level relations live in graphify — "+"codegraph cannot answer these. USE THIS to understand how two apparently unrelated parts of the codebase connect. Example: omo_path with from='auth' to='database' traces the chain from authentication handlers to DB queries.",args:{from:Z.string().min(1).describe("Start concept"),to:Z.string().min(1).describe("End concept")},async execute(r,n){let o=Date.now(),i=await R().invokePath(r.from,r.to,e.cwd,{timeoutMs:8000});return{title:i.kind==="graphify"?"omo_path: path found":"omo_path: unavailable",output:i.result??`No path found between "${r.from}" and "${r.to}". Check if graphify-out/ exists and is up to date.`,metadata:{tool:"omo_path",from:r.from,to:r.to,kind:i.kind,durationMs:Date.now()-o,sessionID:n?n.sessionID:"unknown"}}}})}function Km(e){return C({description:"Get a plain-language explanation of a concept from the graphify knowledge graph. "+"GRAPHIFY TOOL (v0.25.0): conceptual overviews live in graphify — codegraph cannot produce them. "+"USE THIS when you encounter an unfamiliar term or module and need a quick overview of what it is and how it fits into the codebase. Example: 'omo_explain SwinTransformer'.",args:{concept:Z.string().min(1).describe("The concept to explain")},async execute(r,n){let o=Date.now(),i=await R().invokeExplain(r.concept,e.cwd,{timeoutMs:8000});return{title:i.kind==="graphify"?"omo_explain: done":"omo_explain: unavailable",output:i.result??`Concept "${r.concept}" not found in the knowledge graph. Run \`graphify . --no-viz\` first.`,metadata:{tool:"omo_explain",concept:r.concept,kind:i.kind,durationMs:Date.now()-o,sessionID:n?n.sessionID:"unknown"}}}})}function Xm(e){return C({description:"List files indexed by the codebase graph (codegraph or graphify). USAGE: returns a list of indexed file paths. Use this when you need to discover which files are in the graph before drilling into a specific one.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeFiles(e.cwd,{timeoutMs:5000});if(!i.result)return{title:"omo_files: no index",output:"No indexed files found. If `.codegraph/` doesn't exist, run `npx codegraph init` first. If `graphify-out/` doesn't exist, run `graphify . --no-viz` first.",metadata:{tool:"omo_files",kind:i.kind,durationMs:Date.now()-o,sessionID:n.sessionID}};return{title:`omo_files: ${i.kind??"unknown"} backend`,output:i.result,metadata:{tool:"omo_files",kind:i.kind,durationMs:Date.now()-o,sessionID:n.sessionID}}}})}function Ym(e){return C({description:"List all call sites of a symbol in the codebase graph. USAGE: omo_callers with symbol='UserService.create' returns every file:line "+"where that symbol is called. Codegraph-only — returns null if .codegraph/ is missing.",args:{symbol:Z.string().min(1).describe("The symbol to find callers for (function, class, method, variable)")},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeCallers(r.symbol,e.cwd,{timeoutMs:5000});if(!i.result)return{title:`omo_callers: ${r.symbol} (no callers or no codegraph)`,output:`No call sites found for "${r.symbol}". Either the symbol is unused, or codegraph is not installed / has no index. Run \`npx codegraph init\` to create the index.`,metadata:{tool:"omo_callers",symbol:r.symbol,kind:i.kind,durationMs:Date.now()-o,sessionID:n.sessionID}};return{title:`omo_callers: ${r.symbol}`,output:i.result,metadata:{tool:"omo_callers",symbol:r.symbol,kind:i.kind,durationMs:Date.now()-o,sessionID:n.sessionID}}}})}function Qm(e){return C({description:"Get the source code of a symbol (function/class/method/variable) and its direct callers. USAGE: omo_node with symbol='UserService.create' returns the symbol's definition and "+"every direct call site. Distinct from omo_find (which only returns a definition summary) — "+"this tool returns the full source body. Codegraph-only.",args:{symbol:Z.string().min(1).describe("The symbol to resolve (function, class, method, variable)")},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeNode(r.symbol,e.cwd,{timeoutMs:5000});if(!i.result)return{title:`omo_node: ${r.symbol} not found`,output:`Symbol "${r.symbol}" was not found in the codegraph index. Run \`npx codegraph init\` if the index doesn't exist, or \`npx codegraph sync\` to refresh.`,metadata:{tool:"omo_node",symbol:r.symbol,kind:i.kind,durationMs:Date.now()-o,sessionID:n.sessionID}};return{title:`omo_node: ${r.symbol}`,output:i.result,metadata:{tool:"omo_node",symbol:r.symbol,kind:i.kind,durationMs:Date.now()-o,sessionID:n.sessionID}}}})}function K(e,r,n,o,t,i){let a=Date.now()-o;if(!n.result)return{title:`${e}: no result`,output:i,metadata:{tool:e,kind:n.kind,durationMs:a,sessionID:t.sessionID,...r}};return{title:e,output:n.result,metadata:{tool:e,kind:n.kind,durationMs:a,sessionID:t.sessionID,...r}}}function ep(e){return C({description:"Get a focused code context window for a given task. USAGE: omo_context with task='validate JWT tokens' returns relevant code blocks (file paths + line ranges). "+"Codegraph-only — returns null if .codegraph/ is missing.",args:{task:Z.string().min(1).describe("The task to extract context for")},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeContext(r.task,e.cwd,{timeoutMs:5000});return K("omo_context",{task:r.task},{...i,durationMs:Date.now()-o},o,n,`No context for task "${r.task}". Run \`npx codegraph init\` if the index doesn't exist.`)}})}function tp(e){return C({description:"List files affected by changes in the given source files. USAGE: omo_affected_cg with files=['src/auth.ts'] returns the set of test files, callers, and dependent modules. Codegraph-only.",args:{files:Z.array(Z.string().min(1)).min(1).describe("Source file paths to analyze (relative to cwd)")},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeAffected(r.files,e.cwd,{timeoutMs:5000});return K("omo_affected_cg",{files:r.files.join(",")},{...i,durationMs:Date.now()-o},o,n,`Could not compute affected files for [${r.files.join(", ")}]. Run \`npx codegraph init\` if needed.`)}})}function rp(e){return C({description:"Show codegraph health: node count, version, last update timestamp. USAGE: omo_status returns a multi-line report. Codegraph-only.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeStatus(e.cwd,{timeoutMs:5000});return K("omo_status",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed or has no index. Run `npx codegraph init` to create one.")}})}function np(e){return C({description:"Remove a stale codegraph lock file (left behind after a crash). USAGE: omo_unlock clears the lock so the next sync can run. Codegraph-only.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeUnlock(e.cwd,{timeoutMs:5000});return K("omo_unlock",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed.")}})}function op(e){return C({description:"Mark the codegraph index as dirty so the next sync re-extracts. USAGE: omo_mark_dirty when you know source files changed without git hooks firing.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeMarkDirty(e.cwd,{timeoutMs:5000});return K("omo_mark_dirty",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed.")}})}function ip(e){return C({description:"Trigger a codegraph sync ONLY if the graph was previously marked dirty. USAGE: omo_sync_if_dirty is a cheap daily check; omo_status shows the dirty flag.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeSyncIfDirty(e.cwd,{timeoutMs:30000});return K("omo_sync_if_dirty",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed or no index exists.")}})}function ap(e){return C({description:"Manually trigger a full codegraph reindex. USAGE: omo_index when you want a guaranteed-fresh graph (bypasses the dirty-flag check).",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeIndex(e.cwd,{timeoutMs:60000});return K("omo_index",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed. Run `npm i -D @colbymchenry/codegraph` first.")}})}function sp(e){return C({description:"Generate an HTML visualization of the codegraph. USAGE: omo_visualize returns the path to the generated HTML file.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeVisualize(e.cwd,{timeoutMs:30000});return K("omo_visualize",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed.")}})}function cp(e){return C({description:"Start the codegraph HTTP server on the given port. USAGE: omo_serve with port=3030 starts the server in the background. Returns the port + status.",args:{port:Z.number().int().min(1).max(65535).describe("TCP port to bind the codegraph server to")},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeServe(r.port,e.cwd,{timeoutMs:5000});return K("omo_serve",{port:r.port},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed. Run `npm i -D @colbymchenry/codegraph` first.")}})}function lp(e){return C({description:"Remove the codegraph index (.codegraph/) from disk. "+"USAGE: omo_uninit when you want a clean slate — next sync will rebuild from scratch.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeUninit(e.cwd,{timeoutMs:5000});return K("omo_uninit",{},{...i,durationMs:Date.now()-o},o,n,"codegraph is not installed.")}})}function up(e){return C({description:"Diagnose the graphify graph for inconsistencies, multigraph warnings, and stale nodes. USAGE: omo_diagnose returns a JSON-like report. Graphify-only.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeDiagnose(e.cwd,{timeoutMs:1e4});return K("omo_diagnose",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed. Run `pip install graphifyy` first.")}})}function dp(e){return C({description:"Run graphify's 3-way merge driver to resolve conflicting graph segments. USAGE: omo_merge_graphs when git reports a conflict in graphify-out/. Graphify-only.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeMergeDriver(e.cwd,{timeoutMs:30000});return K("omo_merge_graphs",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function mp(e){return C({description:"Persist the result of the last graphify query to disk for later inspection. USAGE: omo_save_result after omo_explain or omo_path returns a useful output.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeSaveResult(e.cwd,{timeoutMs:5000});return K("omo_save_result",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function pp(e){return C({description:"Re-run graphify's semantic extraction over the entire source tree. USAGE: omo_extract when the graph schema changed and you want a fresh semantic layer.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeExtract(e.cwd,{timeoutMs:60000});return K("omo_extract",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function fp(e){return C({description:"Re-run graphify's clustering step (skip semantic extraction). USAGE: omo_cluster_only after minor node additions to refresh the topic map.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeClusterOnly(e.cwd,{timeoutMs:30000});return K("omo_cluster_only",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function gp(e){return C({description:"Apply a label to a graphify node (e.g. for categorization or human notes). USAGE: omo_label with node='validateToken' applies a label.",args:{node:Z.string().min(1).describe("The graph node to label")},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeLabel(r.node,e.cwd,{timeoutMs:5000});return K("omo_label",{node:r.node},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function hp(e){return C({description:"Emit a tree visualization of the graphify graph (hierarchical topic layout). USAGE: omo_tree for a structural overview of the topic map. Graphify-only.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeTree(e.cwd,{timeoutMs:1e4});return K("omo_tree",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function vp(e){return C({description:"Clone the graphify graph to a new location. USAGE: omo_clone when forking a project or creating a backup.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeClone(e.cwd,{timeoutMs:30000});return K("omo_clone",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function yp(e){return C({description:"Add specific files to the graphify graph (instead of re-extracting the whole tree). USAGE: omo_add with files='src/auth.ts src/login.ts' after writing new files.",args:{files:Z.string().min(1).describe("Space-separated list of file paths to add (relative to cwd)")},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeAdd(r.files,e.cwd,{timeoutMs:30000});return K("omo_add",{files:r.files},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function bp(e){return C({description:"Check if the graphify schema or extractors changed since the last extraction. USAGE: omo_check_update to decide if re-extraction is needed. Graphify-only.",args:{},async execute(r,n){let o=Date.now(),i=await(e.graphRetrieval??R()).invokeCheckUpdate(e.cwd,{timeoutMs:1e4});return K("omo_check_update",{},{...i,durationMs:Date.now()-o},o,n,"graphify is not installed.")}})}function _p(e){return C({description:"Check whether the graphify post-commit git hook is installed in this project. USAGE: omo_hook_status returns 'installed' or 'missing' along with the hook path. Run after `git init` to confirm the hook is wired.",args:{},async execute(r,n){let o=Date.now(),{isGraphifyHookInstalled:t}=await Promise.resolve().then(() => (Rr(),Uu)),i=await t(e.cwd),a=`${e.cwd}/.git/hooks/post-commit`,s=i?`graphify post-commit hook is INSTALLED at ${a}.`:"graphify post-commit hook is NOT installed. Run `graphify hook install` or enable graphSync in plugin config to install automatically.";return{title:`omo_hook_status: ${i?"installed":"missing"}`,output:s,metadata:{tool:"omo_hook_status",installed:i,hookPath:a,durationMs:Date.now()-o,sessionID:n.sessionID}}}})}function eo(e,r,n,o,t,i){let a=Date.now()-o;if(!n.ok)return{title:`${e}: ${n.code}`,output:`${i}
|
|
187
187
|
|
|
188
|
-
Diagnostic: ${
|
|
189
|
-
stderr: ${r.stderr||"(empty)"}`,metadata:{tool:$,code:r.code,durationMs:_,sessionID:v.sessionID,...U}};let N=r.data!==null&&r.data!==void 0?typeof r.data==="string"?r.data:JSON.stringify(r.data,null,2):r.rawOutput??"";return{title:$,output:N,metadata:{tool:$,code:r.code,durationMs:_,sessionID:v.sessionID,...U}}}function Ik($){return M({description:"Install a CLI from the CLI-Anything hub so the agent can drive that software. USAGE: omo_cli_anything_install with name='gimp' installs `cli-anything-gimp`, which exposes a `cli-anything-gimp` command. Browse the catalog with omo_cli_anything_list. See https://github.com/HKUDS/CLI-Anything for the full registry.",args:{name:C.string().min(1).describe("The CLI name to install (e.g. 'gimp', 'blender', 'drawio')")},async execute(U,r){let b=Date.now(),{installCli:v}=await Promise.resolve().then(() => (vv(),Bv)),z=v(U.name,$.runner,120000,"cli-hub");return f6("omo_cli_anything_install",{name:U.name},{...z,durationMs:Date.now()-b},b,r,`Could not install '${U.name}'. Check that cli-anything-hub is installed (omo_health) and the name is correct.`)}})}function kk($){return M({description:"List all CLIs available in the CLI-Anything hub (40+ GUI software harnesses). USAGE: omo_cli_anything_list with category='image' returns only image-related CLIs. Returns JSON with name, version, description, category, install_cmd, entry_point. See https://github.com/HKUDS/CLI-Anything.",args:{category:C.string().optional().describe("Optional category filter (e.g. 'image', 'devops', '3d', 'audio')"),source:C.enum(["harness","public","npm","all"]).optional().describe("Optional source filter. 'all' includes harness + public + npm.")},async execute(U,r){let b=Date.now(),{listClis:v}=await Promise.resolve().then(() => (vv(),Bv)),z=v({category:U.category,source:U.source},$.runner,30000,"cli-hub");return f6("omo_cli_anything_list",{category:U.category,source:U.source},{...z,durationMs:Date.now()-b},b,r,"Could not list CLIs from the hub. Make sure cli-anything-hub is installed: `pip install cli-anything-hub`.")}})}function Jk($){return M({description:"Search the CLI-Anything hub for CLIs matching a query (name, description, or category). USAGE: omo_cli_anything_search with query='cad' returns CAD-related CLIs. Returns JSON array. See https://github.com/HKUDS/CLI-Anything.",args:{query:C.string().min(1).describe("Search query (matches name, description, or category)")},async execute(U,r){let b=Date.now(),{searchClis:v}=await Promise.resolve().then(() => (vv(),Bv)),z=v(U.query,$.runner,30000,"cli-hub");return f6("omo_cli_anything_search",{query:U.query},{...z,durationMs:Date.now()-b},b,r,"Search failed. Make sure cli-anything-hub is installed: `pip install cli-anything-hub`.")}})}function wk($){return M({description:"Show details for a specific CLI in the CLI-Anything hub. USAGE: omo_cli_anything_info with name='blender' returns display name, version, description, requirements (e.g. 'blender (apt install blender)'), entry point, install command. See https://github.com/HKUDS/CLI-Anything.",args:{name:C.string().min(1).describe("The CLI name to look up")},async execute(U,r){let b=Date.now(),{infoCli:v}=await Promise.resolve().then(() => (vv(),Bv)),z=v(U.name,$.runner,1e4,"cli-hub");return f6("omo_cli_anything_info",{name:U.name},{...z,durationMs:Date.now()-b},b,r,`Could not find '${U.name}' in the hub. Try omo_cli_anything_search to find similar names.`)}})}class Kk{client=null;defaultTimeoutMs;toolCache=null;constructor($={}){this.defaultTimeoutMs=$.defaultTimeoutMs??5000}setClient($){this.client=$,this.toolCache=null}isReady(){return this.client!==null}async callTool($,U={},r){let b=Date.now(),v=r??this.defaultTimeoutMs;if(!this.client)return{data:null,timedOut:!1,durationMs:Date.now()-b,error:"MCP client not initialized"};try{let _=(await this.raceWithTimeout(this.client.tool.invoke({toolID:$,input:U}),v,$)).data;return{data:_&&typeof _==="object"&&!Array.isArray(_)?_:null,timedOut:!1,durationMs:Date.now()-b,error:null}}catch(z){return{data:null,timedOut:z instanceof Error&&/timed out/i.test(z.message),durationMs:Date.now()-b,error:z instanceof Error?z.message:String(z)}}}async isAvailable($){if(!this.client)return!1;if(this.toolCache===null)try{let U=await this.client.tool.list();this.toolCache=new Set((U.data??[]).map((r)=>r.id))}catch{this.toolCache=new Set}return this.toolCache.has($)}async availableTools(){if(!this.client)return[];if(this.toolCache===null)await this.isAvailable("__bootstrap__");return Array.from(this.toolCache??new Set)}invalidateCache(){this.toolCache=null}raceWithTimeout($,U,r){return new Promise((b,v)=>{let z=setTimeout(()=>{v(Error(`${r} timed out after ${U}ms`))},U);$.then((_)=>{clearTimeout(z),b(_)},(_)=>{clearTimeout(z),v(_)})})}}var j_=null;function Xk(){if(!j_)j_=new Kk;return j_}y6();class P_{entries=new Map;deliveredCount=0;expiredCount=0;register($){this.cleanup();let U=`deliv-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,r=Wk($.mcpArgs);return this.entries.set(U,{id:U,sessionID:$.sessionID,mcpTool:$.mcpTool,mcpArgsHash:r,registeredAt:Date.now(),ttlMs:$.ttlMs??1e4}),U}markDelivered($){this.cleanup();let U=$.mcpArgs?Wk($.mcpArgs):null;for(let[r,b]of this.entries){if(b.sessionID!==$.sessionID)continue;if(b.mcpTool!==$.mcpTool)continue;if(U!==null&&b.mcpArgsHash!==U)continue;return this.entries.delete(r),this.deliveredCount++,r}return null}async awaitDelivery($){let U=$.timeoutMs??2000,r=Date.now();while(Date.now()-r<U){if(this.cleanup(),![...this.entries.values()].find((v)=>v.sessionID===$.sessionID&&v.mcpTool===$.mcpTool))return"delivered";await QX(50)}return"expired"}getStats(){return{pending:this.entries.size,delivered:this.deliveredCount,expired:this.expiredCount}}clearSession($){for(let[U,r]of this.entries)if(r.sessionID===$)this.entries.delete(U)}cleanup(){let $=Date.now();for(let[U,r]of this.entries)if($-r.registeredAt>r.ttlMs)this.entries.delete(U),this.expiredCount++}}function Wk($){return JSON.stringify($,Object.keys($).sort())}function QX($){return new Promise((U)=>setTimeout(U,$))}V4();import{resolve as Tk}from"node:path";import{homedir as uX}from"node:os";import{readFileSync as YX}from"node:fs";import{dirname as jX,resolve as PX}from"node:path";import{fileURLToPath as VX}from"node:url";var Qk="0.0.0";try{let $=jX(VX(import.meta.url)),U=PX($,"..","package.json"),r=JSON.parse(YX(U,"utf8"));if(typeof r.version==="string"&&r.version.length>0)Qk=r.version}catch{}var Y$=Qk,Yk=["decisions_taken","decisions_skipped_continue","decisions_skipped_no_decision","decisions_skipped_no_message","decisions_skipped_below_threshold","interventions_delivered","interventions_disabled_done","interventions_disabled_cap","decisions_stored","plan_reminders_injected","bot_feedback_injected","violations_injected","protocol_audits_passed","protocol_violations_detected","git_commit_reindex","orchestrator_runs","orchestrator_errors"];function jk(){let $={};for(let U of Yk)$[U]={count:0,lastOccurrenceISO:null};return $}var qX=jk(),sY=new Date().toISOString();function Pk($){let U=$??{},r=jk(),b=new Date().toISOString(),v=U.version??Y$,z=U.global===!0;return{inc(_){let N=r[_];if(!N)return;if(N.count++,N.lastOccurrenceISO=new Date().toISOString(),z){let O=qX[_];if(O)O.count++,O.lastOccurrenceISO=N.lastOccurrenceISO}},getMetrics(){return{version:v,sessionID:U.sessionID??"",startedAtISO:b,uptimeMs:Date.now()-new Date(b).getTime(),counters:{...r}}},reset(){for(let _ of Yk)r[_]={count:0,lastOccurrenceISO:null}}}}function L_($){let U={enabled:!1,...$},r=QU(),b=YU(),v=M4();return{enabled:U.enabled===!0,memory:{enabled:!0,query:U.memory?.query??"meta_governor_context",timeoutMs:U.memory?.timeoutMs??U.memory?.agentmemoryTimeoutMs??2000},tokenPredictor:{compactBurnRateThreshold:U.tokenPredictor?.compactBurnRateThreshold??500,compactUsageThreshold:U.tokenPredictor?.compactUsageThreshold??0.85,switchModelUsageThreshold:U.tokenPredictor?.switchModelUsageThreshold??0.95,delegateConsecutiveHighBurn:U.tokenPredictor?.delegateConsecutiveHighBurn??5},scoring:{...r,...U.scoring?.continueThreshold!==void 0?{continueThreshold:U.scoring.continueThreshold}:{},...U.scoring?.warnThreshold!==void 0?{warnThreshold:U.scoring.warnThreshold}:{},...U.scoring?.escalateThreshold!==void 0?{escalateThreshold:U.scoring.escalateThreshold}:{},...U.scoring?.stopThreshold!==void 0?{stopThreshold:U.scoring.stopThreshold}:{},...U.scoring?.paralysisThreshold!==void 0?{paralysisThreshold:U.scoring.paralysisThreshold}:{},...U.scoring?.defaultEscalationTarget!==void 0?{defaultEscalationTarget:U.scoring.defaultEscalationTarget}:{}},closedLoop:{...v,...U.closedLoop?.enabled!==void 0?{enabled:U.closedLoop.enabled}:{},...U.closedLoop?.minSeverityToLearn!==void 0?{minSeverityToLearn:U.closedLoop.minSeverityToLearn}:{},...U.closedLoop?.maxLessonsPerSession!==void 0?{maxLessonsPerSession:U.closedLoop.maxLessonsPerSession}:{},...U.closedLoop?.saveDecisions!==void 0?{saveDecisions:U.closedLoop.saveDecisions}:{},...U.closedLoop?.saveLessons!==void 0?{saveLessons:U.closedLoop.saveLessons}:{}},decision:{...b,...U.decision?.maxHistoryPerSession!==void 0?{maxHistoryPerSession:U.decision.maxHistoryPerSession}:{},...U.decision?.forceContinueAfterStops!==void 0?{forceContinueAfterStops:U.decision.forceContinueAfterStops}:{},...U.decision?.warnMessageTemplate!==void 0?{warnMessageTemplate:U.decision.warnMessageTemplate}:{},...U.decision?.escalateMessageTemplate!==void 0?{escalateMessageTemplate:U.decision.escalateMessageTemplate}:{},...U.decision?.stopMessageTemplate!==void 0?{stopMessageTemplate:U.decision.stopMessageTemplate}:{}},modelOverride:U.modelOverride?{providerID:U.modelOverride.providerID,modelID:U.modelOverride.modelID,modelLimit:U.modelOverride.modelLimit,temperature:U.modelOverride.temperature??0.2,topP:U.modelOverride.topP??1,maxTokens:U.modelOverride.maxTokens??2048,reasoning:U.modelOverride.reasoning??!1,verbosity:U.modelOverride.verbosity??"minimal"}:void 0,intervention:{mode:U.intervention?.mode??"silent",includeDecisionHistory:U.intervention?.includeDecisionHistory??!0,maxHistoryMessages:U.intervention?.maxHistoryMessages??5,minActionForMessage:U.intervention?.minActionForMessage??"stop",maxInterventionsPerSession:U.intervention?.maxInterventionsPerSession??3,respectDoneSignal:U.intervention?.respectDoneSignal??!0,phaseAwareDoneSignal:U.intervention?.phaseAwareDoneSignal??!1,persistToSession:U.intervention?.persistToSession??!0},postWave:{enabled:U.postWave?.enabled??U.intervention?.phaseAwareDoneSignal===!0,repoMode:U.postWave?.repoMode??"auto",aasToolPrefix:U.postWave?.aasToolPrefix??"aas",ciTimeoutMs:U.postWave?.ciTimeoutMs??600000,maxRetriesPerWave:U.postWave?.maxRetriesPerWave??1,reinjectCooldownMs:U.postWave?.reinjectCooldownMs??60000,respectSilentMode:U.postWave?.respectSilentMode??!1,...U.postWave?.ownRepoDirective!==void 0?{ownRepoDirective:U.postWave.ownRepoDirective}:{},...U.postWave?.thirdPartyDirective!==void 0?{thirdPartyDirective:U.postWave.thirdPartyDirective}:{}},protocolEnforcement:{enabled:U.protocolEnforcement?.enabled??!1,path:U.protocolEnforcement?.path,injectIntoSystem:U.protocolEnforcement?.injectIntoSystem??!1,auditToolCalls:U.protocolEnforcement?.auditToolCalls??!1},skillPriming:{enabled:U.skillPriming?.enabled??!1,trigger:U.skillPriming?.trigger??"firstImplement",router:U.skillPriming?.router??"both"},graphSync:{killOrphanedOnInit:U.graphSync?.killOrphanedOnInit??!0,reindexOnFetch:U.graphSync?.reindexOnFetch!==!1,fetchBranch:U.graphSync?.fetchBranch??"main",autoUpgrade:U.graphSync?.autoUpgrade!==!1,upgradeCachePath:U.graphSync?.upgradeCachePath,checkGraphifyNeedsUpdate:U.graphSync?.checkGraphifyNeedsUpdate!==!1,addToGlobalGraph:U.graphSync?.addToGlobalGraph===!0},graphRetrieval:{preferredTool:U.graphRetrieval?.preferredTool??"auto",preferLocalCodegraph:U.graphRetrieval?.preferLocalCodegraph===!0,contextRouting:U.graphRetrieval?.contextRouting===!0},cliAnything:{enabled:U.cliAnything?.enabled!==!1,autoInstall:U.cliAnything?.autoInstall!==!1,autoUpgrade:U.cliAnything?.autoUpgrade!==!1,cachePath:U.cliAnything?.cachePath,upgradeCheckTtlMs:U.cliAnything?.upgradeCheckTtlMs,cliHubBin:U.cliAnything?.cliHubBin??"cli-hub",skillsBin:U.cliAnything?.skillsBin??"npx skills",installScope:U.cliAnything?.installScope??"global"}}}function N8($){if(!$)return!1;if($.enabled===!0)return!0;return $.meta_governor?.enabled===!0}async function O8($={}){let{loadMetaGovernorConfig:U}=await Promise.resolve().then(() => (B_(),Ak)),r=await U($);return L_(r.config)}B_();var p$=new Map;function Gk($,U){p$.set($,U)}function t$($){let U=p$.get($);if(U!==void 0)p$.delete($);return U}function k8($){return p$.has($)}function J8(){for(let[$,U]of p$)return p$.delete($),U;return}function w8(){p$.clear()}class H_{store=new Map;maxEntries;ttlMs;now;constructor($={}){this.maxEntries=$.maxEntries??100,this.ttlMs=$.ttlMs??3600000,this.now=$.now??Date.now}get($){let U=this.store.get($);if(!U)return;let r=this.now();if(U.expiresAtMs<=r){this.store.delete($);return}return U.lastAccessAtMs=r,U.value}has($){return this.get($)!==void 0}set($,U){let r=this.now();if(!this.store.has($)&&this.store.size>=this.maxEntries)this.evictOldest();this.store.set($,{value:U,expiresAtMs:r+this.ttlMs,lastAccessAtMs:r})}delete($){return this.store.delete($)}size(){return this.store.size}clear(){this.store.clear()}evictOldest(){let $,U=1/0;for(let[r,b]of this.store)if(b.lastAccessAtMs<U)U=b.lastAccessAtMs,$=r;if($!==void 0)this.store.delete($)}}import{statSync as hX,readFileSync as Ck}from"node:fs";import{execSync as nX}from"node:child_process";import{join as Rk}from"node:path";import{readFile as SX}from"node:fs/promises";import{resolve as FX}from"node:path";import{homedir as MX}from"node:os";var E_=FX(MX(),".config","opencode","sisyphus-mandatory","sisyphus-mandatory.md");async function Sk($){return await SX($??E_,"utf-8")}function Fk($){let U=["","## Sisyphus Protocol Enforcement","","You MUST follow these Sisyphus protocol rules:","","1. **Pre-response Memory Check**: Before any action, read `<project-memory>` and `<session-history-since>` blocks in context. Cite `<memory id>` for any fact used from memory. Do not ask questions whose answers are in those blocks.","","2. **Codebase Graph First**: Before using grep/glob/read for architecture or symbol queries, check whether `.codegraph/` or `graphify-out/` exists. If so, use codegraph/graphify tools first, then grep/read only as last resort.","","3. **Tool Routing Table**: Match common intents to the correct tool:",' - "we did this before" / "you should know" → `agentmemory_memory_recall`'," - Starting a task that resembles a previous one → `agentmemory_memory_smart_search`"," - Before asking the user a clarifying question → `agentmemory_memory_recall` first"," - Save durable insight/decision/rule → `agentmemory_memory_save`",""];if(/\boracle\b/i.test($))U.push("4. **Post-task Oracle Verification**: If files touched >= 3 OR any INVOKE trigger matches, invoke Oracle with the exact format:",' `task(subagent_type="oracle", run_in_background=false, prompt="Verify: ...")`'," - INVOKE triggers: created 1+ new file, modified abstraction, touched security/auth paths, modified DB/persistence, modified CI/CD, added/removed dependency, modified perf-critical path, todo had 2+ completed items."," - SKIP only when: files touched <= 2, no new file, no dependency change, single-step task, change is typo/comment/rename only."," - Verdict: PASS → done. FAIL/CONDITIONAL → fix and re-invoke. Max 3 invocations."," - Cost: Max 3 oracle invocations per task. Skip rate: Must NOT skip Oracle on 2+ file change.","");return U.push("5. **Parallel Query Rule**: Fire independent tool queries in the same turn. Do NOT serialize independent memory/context queries.","","6. **Empty-Result Escalation**: On empty `agentmemory_memory_recall`, fire `agentmemory_memory_smart_search` + `agentmemory_memory_export` before asking the user.","","7. **Hard Rules (No Exceptions)**:"," - Do NOT ask 'where is X?' if memory or session record already contains it."," - Do NOT claim 'I don't know' before firing at least 2 different recall tools."," - Do NOT re-issue clarifying questions whose answer is in `<project-memory>` or `<session-history-since>`."," - Do NOT suppress type errors with `as any`, `@ts-ignore`, or `@ts-expect-error`."," - Do NOT leave empty catch blocks `catch(e) {}`.",' - Do NOT start a fresh agent via `task()` when `task(task_id="ses_...")` (continuation) exists — use continuation IDs.'," - Do NOT batch-complete todos — mark each one `completed` immediately after finishing."," - Do NOT skip creating todos for multi-step tasks.","","8. **Self-Check Before Responding**:"," - Verify you read `<project-memory>` and `<session-history-since>` blocks."," - Verify you cited `<memory id>` for any fact used from memory."," - Verify you did not ask a question whose answer is in those blocks."," - For multi-file changes, verify Oracle was invoked."," - For codebase exploration, verify codegraph/graphify was tried before grep/read."," - After discovering something non-obvious, save it with `agentmemory_memory_save` so future sessions benefit."," - Do NOT save routine operations (file reads, greps, list commands), trivial decisions, or facts already covered by existing memory. Save only novel insights, non-obvious patterns, or corrections to previous assumptions.",""),U.join(`
|
|
190
|
-
`)}function
|
|
191
|
-
`)}function Dk($){if($.trigger==="sessionStart")return!0;if($.implementationToolSeen)return!0;return $.recentToolCalls.some((U)=>A_.includes(U))}S4();var mk={continue:0,warn:1,escalate:2,stop:3};function G_($,U){return mk[$]>=mk[U]}function yX($){let U=$.args;if(!U||typeof U!=="object")return null;let r=["pattern","query","path","glob","regex","include_pattern"];for(let b of r){let v=U[b];if(typeof v==="string"&&v.trim().length>0)return v.trim()}return null}var fX=Pk({sessionID:"__global__",global:!0,version:Y$}),iX=Tk(uX(),".config","opencode","meta-governor-health.json");function ck($={},U={}){let r=R(),b=new P_;SI(b);let v=process.cwd(),z=Z4(),_=MI({graphRetrieval:r,cwd:v}),N=ZI({sqlite:z}),O=DI({metrics:fX,logFilePath:J$,healthFilePath:iX}),I=xI({cwd:v}),k=gI({cwd:v}),W=RI({onDispatch:({sessionID:$$,mcpTool:O$,mcpArgs:V$})=>{b.register({sessionID:$$,mcpTool:O$,mcpArgs:V$})}}),X=mI({onDispatch:({sessionID:$$,mcpTool:O$,mcpArgs:V$})=>{b.register({sessionID:$$,mcpTool:O$,mcpArgs:V$})}}),w=TI({cwd:v}),j=CI({cwd:v}),B=cI({graphRetrieval:r,cwd:v}),D=uI({graphRetrieval:r,cwd:v}),x=hI({graphRetrieval:r,cwd:v}),u=nI({graphRetrieval:r,cwd:v}),m=yI({graphRetrieval:r,cwd:v}),d=fI({graphRetrieval:r,cwd:v}),X$=iI({graphRetrieval:r,cwd:v}),jv=lI({graphRetrieval:r,cwd:v}),F_=oI({graphRetrieval:r,cwd:v}),M_=dI({graphRetrieval:r,cwd:v}),Z_=pI({graphRetrieval:r,cwd:v}),D_=tI({graphRetrieval:r,cwd:v}),x_=eI({graphRetrieval:r,cwd:v}),g_=aI({graphRetrieval:r,cwd:v}),R_=sI({graphRetrieval:r,cwd:v}),m_=$k({graphRetrieval:r,cwd:v}),T_=vk({graphRetrieval:r,cwd:v}),C_=Uk({graphRetrieval:r,cwd:v}),c_=rk({graphRetrieval:r,cwd:v}),u_=bk({graphRetrieval:r,cwd:v}),h_=zk({graphRetrieval:r,cwd:v}),n_=_k({graphRetrieval:r,cwd:v}),y_=Nk({graphRetrieval:r,cwd:v}),f_=Ok({cwd:v}),i_=Ik({cwd:v}),l_=kk({cwd:v}),o_=Jk({cwd:v}),d_=wk({cwd:v});G("info",`v${Y$} MetaGovernor plugin loaded`,{version:Y$,build:"0.19.5-instr",cwd:v,projectHasCodegraph:r.hasCodegraphDir(v),projectHasGraphify:r.hasGraphifyDir(v)});let p_="?";try{let O$=cX(import.meta.url),V$=Ck(O$);p_=CX("sha256").update(V$).digest("hex").slice(0,8)}catch{}return console.log(`[meta-governor] v${Y$} loaded (bundle: ${p_})`),(async()=>{try{let{execSync:$$}=await import("node:child_process"),O$=$$("npm view @herjarsa/omo-meta-governor version",{timeout:5000,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();if(O$&&O$!==Y$)G("warn",`STALE_CACHE: loaded v${Y$} but npm has v${O$}. Run: npm cache clean --force && rm -rf ~/.cache/opencode/packages/@herjarsa/omo-meta-governor*`)}catch{}})(),async($$,O$)=>{G("info",`v${Y$} factory_invoked`,{version:Y$,hasInput:$$!=null,inputDir:$$?.directory??null,inputKeys:$$?Object.keys($$):[]});let V$=$$.client,t_=V$!=null&&typeof V$==="object"&&"tool"in V$?V$:null;Xk().setClient(t_),K_(t_);let c$;try{c$=await q_({projectDir:$$.directory??v})}catch(Q){throw G("error","factory_config_load_failed",{message:Q instanceof Error?Q.message:String(Q),stack:Q instanceof Error?Q.stack?.slice(0,800):void 0}),Q}let uk={...$,...c$.config,...O$?.meta_governor??{}},E;try{E=L_(uk)}catch(Q){throw G("error","factory_orchestrator_config_failed",{message:Q instanceof Error?Q.message:String(Q)}),Q}if(VI({preferredTool:E.graphRetrieval.preferredTool}),c$.sources.length>0)G("info",`v${Y$} config_loaded`,{version:Y$,sources:c$.sources,effectiveSource:c$.effectiveSource,enabled:E.enabled});if(E.postWave?.enabled===!0&&E.intervention.respectDoneSignal===!1)G("info","post_wave_warning",{message:"postWave.enabled=true but intervention.respectDoneSignal=false: post-wave directives still fire on Oracle-verified PHASE-N-COMPLETE, but the done-signal latch is off (intervention is not auto-disabled at plan end)."});let e_=new Set,a_=new Set,hk=new Set,j$=$$.directory?Tk($$.directory):v,Pv=$.graphSync??c$.config?.graphSync??O$?.meta_governor?.graphSync;if(Pv?.enabled!==!1){if(U.__test_onGraphSyncInit?.({projectDir:j$}),(U.__test_runGraphSync??Vv)({enabled:!0,watch:Pv?.watch??!1,autoInstall:Pv?.autoInstall??!0,installTimeoutMs:Pv?.installTimeoutMs??60000,killOrphanedOnInit:Pv?.killOrphanedOnInit??!0,projectDir:j$}).then((L)=>{if(L?.attempted&&L.availability.codegraph&&L.availability.graphify)e_.add(j$)}).catch(()=>{}),E.cliAnything?.enabled!==!1){let L=c$.config?.cliAnything??O$?.meta_governor?.cliAnything;(U.__test_runCliAnythingSync??SN)({enabled:!0,autoInstall:L?.autoInstall??!0,autoUpgrade:L?.autoUpgrade??!0,cachePath:L?.cachePath??`${process.env.HOME||process.env.USERPROFILE||"~"}/.config/opencode/omo-cli-anything-upgrade-check.json`,upgradeCheckTtlMs:L?.upgradeCheckTtlMs??86400000,projectDir:j$,installScope:L?.installScope??"global",cliHubBin:L?.cliHubBin??"cli-hub",skillsBin:L?.skillsBin??"npx skills"}).then((H)=>{if(H?.attempted&&H.availability.cliHub)hk.add(j$)}).catch((H)=>{G("warn",`cli-anything sync failed: ${String(H)}`)})}queueMicrotask(()=>{try{let L=E.graphSync.fetchBranch,Y=OU(j$,L);if(Y>0)G("info",`reindexOnFetch: ${Y} new commits on origin/${L}, reindexing`),G4(j$).catch((H)=>{G("warn",`reindexOnFetch failed: ${String(H)}`)})}catch{}})}if(!E.enabled)return{tool:{omo_search:_,omo_recall:N,omo_health:O,omo_find:I,omo_impact:k,omo_remember:W,omo_recall_mcp:X,omo_path:w,omo_explain:j,omo_files:B,omo_callers:D,omo_node:x,omo_context:u,omo_affected_cg:m,omo_status:d,omo_unlock:X$,omo_mark_dirty:jv,omo_sync_if_dirty:F_,omo_index:M_,omo_visualize:Z_,omo_serve:D_,omo_uninit:x_,omo_diagnose:g_,omo_merge_graphs:R_,omo_save_result:m_,omo_extract:T_,omo_cluster_only:C_,omo_label:c_,omo_tree:u_,omo_clone:h_,omo_add:n_,omo_check_update:y_,omo_hook_status:f_,omo_cli_anything_install:i_,omo_cli_anything_list:l_,omo_cli_anything_search:o_,omo_cli_anything_info:d_}};let l6=()=>E.modelOverride?.providerID??U.providerID?.(),o6=()=>E.modelOverride?.modelID??U.modelID?.(),nk=()=>E.modelOverride?.modelLimit??200000,k9=l6()??"unknown",J9=o6()??"unknown",K4;if(E.protocolEnforcement.enabled||E.protocolEnforcement.injectIntoSystem){let Q=E.protocolEnforcement.path??E_;try{let L=await Sk(Q);K4=Fk(L)}catch(L){if(E.modelOverride?.verbosity!=="silent")G("warn",`could not load protocol: ${L instanceof Error?L.message:String(L)}`)}}let G$=new H_({maxEntries:100,ttlMs:3600000}),X4=new Map,s_=300000,W4=new Map,$N=new Set,vN=new Set,UN=new Set,yk=()=>({currentWaveN:null,lastInjectedWaveN:null,lastInjectedAtMs:null,postWaveInjectionsThisWave:0,rulesReadForWave:{},oracleAfterPhaseAtMs:{},repoModeResolved:null}),rN=new Map,Q4=(Q,L)=>{if(!Q||!L)return;if(!E.intervention.persistToSession)return;n6(Q,L).then((Y)=>{if(!Y.ok)G("warn",`persist intervention failed for ${Q}`,{error:Y.error});else G("info",`persisted intervention for ${Q}`)})};return{"tool.execute.before":async(Q,L)=>{if(!E.enabled)return;if(!E.protocolEnforcement.auditToolCalls)return;if(!Q.sessionID)return;let Y=G$.get(Q.sessionID);if(!Y)Y={memoryToolsUsed:[],hasCodegraphDir:r.hasCodegraphDir(v),hasGraphifyDir:r.hasGraphifyDir(v),oracleInvoked:!1,filesChanged:0,emptyRecall:!1,escalationAttempted:!1,recentToolCalls:[],recentWriteContents:[],recentWriteFilePaths:[],memorySaved:!1,accumulatedDeviations:[],recentInterventionTexts:[],batchCompletions:0,taskDoneSignal:!1,phaseCompleteSignal:!1,planCompleteSignal:!1,interventionCount:0,interventionDisabled:!1,lessonCount:0,lastViolationInjectionAtMs:0,iteration:0,oracleInFlight:!1,oracleInFlightSinceMs:null,signalAtMs:0,postWave:{currentWaveN:null,lastInjectedWaveN:null,lastInjectedAtMs:null,postWaveInjectionsThisWave:0,rulesReadForWave:{},oracleAfterPhaseAtMs:{},repoModeResolved:null}},G$.set(Q.sessionID,Y);if(Y?.oracleInFlight)return;if(K4)G("info","protocol loaded, system injection ready");let H=Mk(Q.tool,L.args,{memoryToolsUsed:Y.memoryToolsUsed,hasCodegraphDir:Y.hasCodegraphDir,hasGraphifyDir:Y.hasGraphifyDir,oracleInvoked:Y.oracleInvoked,filesChanged:Y.filesChanged,emptyRecall:Y.emptyRecall,escalationAttempted:Y.escalationAttempted,recentToolCalls:Y.recentToolCalls,recentWriteContents:Y.recentWriteContents,memorySaved:Y.memorySaved,batchCompletions:Y.batchCompletions});if(H.length>0){let r$=Y.lastViolationInjectionAtMs??0;if(r$>0&&Date.now()-r$<30000){G("info",`violation during cooldown (${Math.round((30000-(Date.now()-r$))/1000)}s remaining), skipping queue`);let b$=H.map((s)=>({severity:s.severity,category:s.rule,detail:s.detail}));Y.accumulatedDeviations=[...Y.accumulatedDeviations,...b$].slice(-5)}else{G("warn",`protocol violations on tool ${Q.tool}`,H);let b$=X4.get(Q.sessionID)?.items??[];for(let S of H)b$.push(`[${S.severity.toUpperCase()}] ${S.rule}: ${S.detail}`);X4.set(Q.sessionID,{items:b$,expiresAtMs:Date.now()+s_});let s=H.map((S)=>({severity:S.severity,category:S.rule,detail:S.detail}));Y.accumulatedDeviations=[...Y.accumulatedDeviations,...s].slice(-5),Y.lastViolationInjectionAtMs=Date.now()}}else G("info",`audit OK on tool ${Q.tool}`);if((Q.tool==="grep"||Q.tool==="glob")&&(r.hasCodegraphDir(v)||r.hasGraphifyDir(v))){let a=yX(Q);if(a)r.invoke(v,a,{timeoutMs:5000}).then((r$)=>{if(r$.result)r.cacheContext(Q.sessionID,a,r$.result)}).catch(()=>{})}},"tool.execute.after":async(Q,L)=>{if(!E.enabled)return;try{b.markDelivered({sessionID:Q.sessionID,mcpTool:Q.tool,mcpArgs:Q.args})}catch{}if(A_.includes(Q.tool))UN.add(Q.sessionID);let Y=G$.get(Q.sessionID);if(Y){if(Y.iteration++,Y.recentToolCalls=[Q.tool].concat(Y.recentToolCalls).slice(0,20),["write","edit","edit_block","desktop-commander_write_file","desktop-commander_edit_block"].includes(Q.tool)){Y.filesChanged++;let p=(L.output??"").slice(0,500);Y.recentWriteContents=[p].concat(Y.recentWriteContents).slice(0,3);let I$=Q.args,t=I$?.filePath??I$?.path;if(typeof t==="string"&&t.length>0)Y.recentWriteFilePaths=[t].concat(Y.recentWriteFilePaths).slice(0,10)}if(["agentmemory_memory_recall","agentmemory_memory_smart_search","agentmemory_memory_save"].some((p)=>Q.tool.startsWith(p))&&!Y.memoryToolsUsed.includes(Q.tool))Y.memoryToolsUsed.push(Q.tool);if(Q.tool.startsWith("agentmemory_memory_save")){let p=L.output??"";if(p.includes("saved")||p.includes("written"))Y.memorySaved=!0}if(Q.tool==="task"){let p=L.output??"",I$=Q.args;if(I$?.subagent_type==="oracle"||p.includes("subagent_type=oracle")){if(Y.oracleInvoked=!0,I$?.run_in_background===!0)Y.oracleInFlight=!0,Y.oracleInFlightSinceMs=Date.now()}}let f=(L.output??"").toLowerCase();if(Q.tool.includes("recall")&&(f.includes("returned empty")||f.includes("no results")))Y.emptyRecall=!0;if(Q.tool==="todowrite"&&(L.output??"").includes("completed")){if(((L.output??"").match(/"status":"completed"/g)??[]).length>=3)Y.batchCompletions++}let g=[typeof L.output==="string"?L.output:"",typeof Q.args==="string"?Q.args:""].join(`
|
|
192
|
-
`);if(!
|
|
193
|
-
`),
|
|
188
|
+
Diagnostic: ${n.code}
|
|
189
|
+
stderr: ${n.stderr||"(empty)"}`,metadata:{tool:e,code:n.code,durationMs:a,sessionID:t.sessionID,...r}};let s=n.data!==null&&n.data!==void 0?typeof n.data==="string"?n.data:JSON.stringify(n.data,null,2):n.rawOutput??"";return{title:e,output:s,metadata:{tool:e,code:n.code,durationMs:a,sessionID:t.sessionID,...r}}}function kp(e){return C({description:"Install a CLI from the CLI-Anything hub so the agent can drive that software. USAGE: omo_cli_anything_install with name='gimp' installs `cli-anything-gimp`, which exposes a `cli-anything-gimp` command. Browse the catalog with omo_cli_anything_list. See https://github.com/HKUDS/CLI-Anything for the full registry.",args:{name:Z.string().min(1).describe("The CLI name to install (e.g. 'gimp', 'blender', 'drawio')")},async execute(r,n){let o=Date.now(),{installCli:t}=await Promise.resolve().then(() => (ot(),Ot)),i=t(r.name,e.runner,120000,"cli-hub");return eo("omo_cli_anything_install",{name:r.name},{...i,durationMs:Date.now()-o},o,n,`Could not install '${r.name}'. Check that cli-anything-hub is installed (omo_health) and the name is correct.`)}})}function $p(e){return C({description:"List all CLIs available in the CLI-Anything hub (40+ GUI software harnesses). USAGE: omo_cli_anything_list with category='image' returns only image-related CLIs. Returns JSON with name, version, description, category, install_cmd, entry_point. See https://github.com/HKUDS/CLI-Anything.",args:{category:Z.string().optional().describe("Optional category filter (e.g. 'image', 'devops', '3d', 'audio')"),source:Z.enum(["harness","public","npm","all"]).optional().describe("Optional source filter. 'all' includes harness + public + npm.")},async execute(r,n){let o=Date.now(),{listClis:t}=await Promise.resolve().then(() => (ot(),Ot)),i=t({category:r.category,source:r.source},e.runner,30000,"cli-hub");return eo("omo_cli_anything_list",{category:r.category,source:r.source},{...i,durationMs:Date.now()-o},o,n,"Could not list CLIs from the hub. Make sure cli-anything-hub is installed: `pip install cli-anything-hub`.")}})}function xp(e){return C({description:"Search the CLI-Anything hub for CLIs matching a query (name, description, or category). USAGE: omo_cli_anything_search with query='cad' returns CAD-related CLIs. Returns JSON array. See https://github.com/HKUDS/CLI-Anything.",args:{query:Z.string().min(1).describe("Search query (matches name, description, or category)")},async execute(r,n){let o=Date.now(),{searchClis:t}=await Promise.resolve().then(() => (ot(),Ot)),i=t(r.query,e.runner,30000,"cli-hub");return eo("omo_cli_anything_search",{query:r.query},{...i,durationMs:Date.now()-o},o,n,"Search failed. Make sure cli-anything-hub is installed: `pip install cli-anything-hub`.")}})}function wp(e){return C({description:"Show details for a specific CLI in the CLI-Anything hub. USAGE: omo_cli_anything_info with name='blender' returns display name, version, description, requirements (e.g. 'blender (apt install blender)'), entry point, install command. See https://github.com/HKUDS/CLI-Anything.",args:{name:Z.string().min(1).describe("The CLI name to look up")},async execute(r,n){let o=Date.now(),{infoCli:t}=await Promise.resolve().then(() => (ot(),Ot)),i=t(r.name,e.runner,1e4,"cli-hub");return eo("omo_cli_anything_info",{name:r.name},{...i,durationMs:Date.now()-o},o,n,`Could not find '${r.name}' in the hub. Try omo_cli_anything_search to find similar names.`)}})}class Sp{client=null;defaultTimeoutMs;toolCache=null;constructor(e={}){this.defaultTimeoutMs=e.defaultTimeoutMs??5000}setClient(e){this.client=e,this.toolCache=null}isReady(){return this.client!==null}async callTool(e,r={},n){let o=Date.now(),t=n??this.defaultTimeoutMs;if(!this.client)return{data:null,timedOut:!1,durationMs:Date.now()-o,error:"MCP client not initialized"};try{let a=(await this.raceWithTimeout(this.client.tool.invoke({toolID:e,input:r}),t,e)).data;return{data:a&&typeof a==="object"&&!Array.isArray(a)?a:null,timedOut:!1,durationMs:Date.now()-o,error:null}}catch(i){return{data:null,timedOut:i instanceof Error&&/timed out/i.test(i.message),durationMs:Date.now()-o,error:i instanceof Error?i.message:String(i)}}}async isAvailable(e){if(!this.client)return!1;if(this.toolCache===null)try{let r=await this.client.tool.list();this.toolCache=new Set((r.data??[]).map((n)=>n.id))}catch{this.toolCache=new Set}return this.toolCache.has(e)}async availableTools(){if(!this.client)return[];if(this.toolCache===null)await this.isAvailable("__bootstrap__");return Array.from(this.toolCache??new Set)}invalidateCache(){this.toolCache=null}raceWithTimeout(e,r,n){return new Promise((o,t)=>{let i=setTimeout(()=>{t(Error(`${n} timed out after ${r}ms`))},r);e.then((a)=>{clearTimeout(i),o(a)},(a)=>{clearTimeout(i),t(a)})})}}var zl=null;function Ip(){if(!zl)zl=new Sp;return zl}Qn();class Cl{entries=new Map;deliveredCount=0;expiredCount=0;register(e){this.cleanup();let r=`deliv-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,n=Tp(e.mcpArgs);return this.entries.set(r,{id:r,sessionID:e.sessionID,mcpTool:e.mcpTool,mcpArgsHash:n,registeredAt:Date.now(),ttlMs:e.ttlMs??1e4}),r}markDelivered(e){this.cleanup();let r=e.mcpArgs?Tp(e.mcpArgs):null;for(let[n,o]of this.entries){if(o.sessionID!==e.sessionID)continue;if(o.mcpTool!==e.mcpTool)continue;if(r!==null&&o.mcpArgsHash!==r)continue;return this.entries.delete(n),this.deliveredCount++,n}return null}async awaitDelivery(e){let r=e.timeoutMs??2000,n=Date.now();while(Date.now()-n<r){if(this.cleanup(),![...this.entries.values()].find((t)=>t.sessionID===e.sessionID&&t.mcpTool===e.mcpTool))return"delivered";await zb(50)}return"expired"}getStats(){return{pending:this.entries.size,delivered:this.deliveredCount,expired:this.expiredCount}}clearSession(e){for(let[r,n]of this.entries)if(n.sessionID===e)this.entries.delete(r)}cleanup(){let e=Date.now();for(let[r,n]of this.entries)if(e-n.registeredAt>n.ttlMs)this.entries.delete(r),this.expiredCount++}}function Tp(e){return JSON.stringify(e,Object.keys(e).sort())}function zb(e){return new Promise((r)=>setTimeout(r,e))}Dr();import{resolve as qp}from"node:path";import{homedir as t_}from"node:os";import{readFileSync as Cb}from"node:fs";import{dirname as Eb,resolve as jb}from"node:path";import{fileURLToPath as Ab}from"node:url";var Op="0.0.0";try{let e=Eb(Ab(import.meta.url)),r=jb(e,"..","package.json"),n=JSON.parse(Cb(r,"utf8"));if(typeof n.version==="string"&&n.version.length>0)Op=n.version}catch{}var be=Op,Dp=["decisions_taken","decisions_skipped_continue","decisions_skipped_no_decision","decisions_skipped_no_message","decisions_skipped_below_threshold","interventions_delivered","interventions_disabled_done","interventions_disabled_cap","decisions_stored","plan_reminders_injected","bot_feedback_injected","violations_injected","protocol_audits_passed","protocol_violations_detected","git_commit_reindex","orchestrator_runs","orchestrator_errors"];function Pp(){let e={};for(let r of Dp)e[r]={count:0,lastOccurrenceISO:null};return e}var Mb=Pp(),gw=new Date().toISOString();function zp(e){let r=e??{},n=Pp(),o=new Date().toISOString(),t=r.version??be,i=r.global===!0;return{inc(a){let s=n[a];if(!s)return;if(s.count++,s.lastOccurrenceISO=new Date().toISOString(),i){let c=Mb[a];if(c)c.count++,c.lastOccurrenceISO=s.lastOccurrenceISO}},getMetrics(){return{version:t,sessionID:r.sessionID??"",startedAtISO:o,uptimeMs:Date.now()-new Date(o).getTime(),counters:{...n}}},reset(){for(let a of Dp)n[a]={count:0,lastOccurrenceISO:null}}}}function Ml(e){let r={enabled:!1,...e},n=Do(),o=Po(),t=Ur();return{enabled:r.enabled===!0,memory:{enabled:!0,query:r.memory?.query??"meta_governor_context",timeoutMs:r.memory?.timeoutMs??r.memory?.agentmemoryTimeoutMs??2000},tokenPredictor:{compactBurnRateThreshold:r.tokenPredictor?.compactBurnRateThreshold??500,compactUsageThreshold:r.tokenPredictor?.compactUsageThreshold??0.85,switchModelUsageThreshold:r.tokenPredictor?.switchModelUsageThreshold??0.95,delegateConsecutiveHighBurn:r.tokenPredictor?.delegateConsecutiveHighBurn??5},scoring:{...n,...r.scoring?.continueThreshold!==void 0?{continueThreshold:r.scoring.continueThreshold}:{},...r.scoring?.warnThreshold!==void 0?{warnThreshold:r.scoring.warnThreshold}:{},...r.scoring?.escalateThreshold!==void 0?{escalateThreshold:r.scoring.escalateThreshold}:{},...r.scoring?.stopThreshold!==void 0?{stopThreshold:r.scoring.stopThreshold}:{},...r.scoring?.paralysisThreshold!==void 0?{paralysisThreshold:r.scoring.paralysisThreshold}:{},...r.scoring?.defaultEscalationTarget!==void 0?{defaultEscalationTarget:r.scoring.defaultEscalationTarget}:{}},closedLoop:{...t,...r.closedLoop?.enabled!==void 0?{enabled:r.closedLoop.enabled}:{},...r.closedLoop?.minSeverityToLearn!==void 0?{minSeverityToLearn:r.closedLoop.minSeverityToLearn}:{},...r.closedLoop?.maxLessonsPerSession!==void 0?{maxLessonsPerSession:r.closedLoop.maxLessonsPerSession}:{},...r.closedLoop?.saveDecisions!==void 0?{saveDecisions:r.closedLoop.saveDecisions}:{},...r.closedLoop?.saveLessons!==void 0?{saveLessons:r.closedLoop.saveLessons}:{}},decision:{...o,...r.decision?.maxHistoryPerSession!==void 0?{maxHistoryPerSession:r.decision.maxHistoryPerSession}:{},...r.decision?.forceContinueAfterStops!==void 0?{forceContinueAfterStops:r.decision.forceContinueAfterStops}:{},...r.decision?.warnMessageTemplate!==void 0?{warnMessageTemplate:r.decision.warnMessageTemplate}:{},...r.decision?.escalateMessageTemplate!==void 0?{escalateMessageTemplate:r.decision.escalateMessageTemplate}:{},...r.decision?.stopMessageTemplate!==void 0?{stopMessageTemplate:r.decision.stopMessageTemplate}:{}},modelOverride:r.modelOverride?{providerID:r.modelOverride.providerID,modelID:r.modelOverride.modelID,modelLimit:r.modelOverride.modelLimit,temperature:r.modelOverride.temperature??0.2,topP:r.modelOverride.topP??1,maxTokens:r.modelOverride.maxTokens??2048,reasoning:r.modelOverride.reasoning??!1,verbosity:r.modelOverride.verbosity??"minimal"}:void 0,intervention:{mode:r.intervention?.mode??"silent",includeDecisionHistory:r.intervention?.includeDecisionHistory??!0,maxHistoryMessages:r.intervention?.maxHistoryMessages??5,minActionForMessage:r.intervention?.minActionForMessage??"stop",maxInterventionsPerSession:r.intervention?.maxInterventionsPerSession??3,respectDoneSignal:r.intervention?.respectDoneSignal??!0,phaseAwareDoneSignal:r.intervention?.phaseAwareDoneSignal??!1,persistToSession:r.intervention?.persistToSession??!0},postWave:{enabled:r.postWave?.enabled??r.intervention?.phaseAwareDoneSignal===!0,repoMode:r.postWave?.repoMode??"auto",aasToolPrefix:r.postWave?.aasToolPrefix??"aas",ciTimeoutMs:r.postWave?.ciTimeoutMs??600000,maxRetriesPerWave:r.postWave?.maxRetriesPerWave??1,reinjectCooldownMs:r.postWave?.reinjectCooldownMs??60000,respectSilentMode:r.postWave?.respectSilentMode??!1,...r.postWave?.ownRepoDirective!==void 0?{ownRepoDirective:r.postWave.ownRepoDirective}:{},...r.postWave?.thirdPartyDirective!==void 0?{thirdPartyDirective:r.postWave.thirdPartyDirective}:{}},protocolEnforcement:{enabled:r.protocolEnforcement?.enabled??!1,path:r.protocolEnforcement?.path,injectIntoSystem:r.protocolEnforcement?.injectIntoSystem??!1,auditToolCalls:r.protocolEnforcement?.auditToolCalls??!1},skillPriming:{enabled:r.skillPriming?.enabled??!1,trigger:r.skillPriming?.trigger??"firstImplement",router:r.skillPriming?.router??"both"},graphSync:{killOrphanedOnInit:r.graphSync?.killOrphanedOnInit??!0,reindexOnFetch:r.graphSync?.reindexOnFetch!==!1,fetchBranch:r.graphSync?.fetchBranch??"main",autoUpgrade:r.graphSync?.autoUpgrade!==!1,upgradeCachePath:r.graphSync?.upgradeCachePath,checkGraphifyNeedsUpdate:r.graphSync?.checkGraphifyNeedsUpdate!==!1,addToGlobalGraph:r.graphSync?.addToGlobalGraph===!0},graphRetrieval:{preferredTool:r.graphRetrieval?.preferredTool??"auto",preferLocalCodegraph:r.graphRetrieval?.preferLocalCodegraph===!0,contextRouting:r.graphRetrieval?.contextRouting===!0},cliAnything:{enabled:r.cliAnything?.enabled!==!1,autoInstall:r.cliAnything?.autoInstall!==!1,autoUpgrade:r.cliAnything?.autoUpgrade!==!1,cachePath:r.cliAnything?.cachePath,upgradeCheckTtlMs:r.cliAnything?.upgradeCheckTtlMs,cliHubBin:r.cliAnything?.cliHubBin??"cli-hub",skillsBin:r.cliAnything?.skillsBin??"npx skills",installScope:r.cliAnything?.installScope??"global"}}}function xw(e){if(!e)return!1;if(e.enabled===!0)return!0;return e.meta_governor?.enabled===!0}async function ww(e={}){let{loadMetaGovernorConfig:r}=await Promise.resolve().then(() => (Al(),Np)),n=await r(e);return Ml(n.config)}Al();var Qe=new Map;function Up(e,r){Qe.set(e,r)}function Le(e){let r=Qe.get(e);if(r!==void 0)Qe.delete(e);return r}function Iw(e){return Qe.has(e)}function Tw(){for(let[e,r]of Qe)return Qe.delete(e),r;return}function Ow(){Qe.clear()}class Rl{store=new Map;maxEntries;ttlMs;now;constructor(e={}){this.maxEntries=e.maxEntries??100,this.ttlMs=e.ttlMs??3600000,this.now=e.now??Date.now}get(e){let r=this.store.get(e);if(!r)return;let n=this.now();if(r.expiresAtMs<=n){this.store.delete(e);return}return r.lastAccessAtMs=n,r.value}has(e){return this.get(e)!==void 0}set(e,r){let n=this.now();if(!this.store.has(e)&&this.store.size>=this.maxEntries)this.evictOldest();this.store.set(e,{value:r,expiresAtMs:n+this.ttlMs,lastAccessAtMs:n})}delete(e){return this.store.delete(e)}size(){return this.store.size}clear(){this.store.clear()}evictOldest(){let e,r=1/0;for(let[n,o]of this.store)if(o.lastAccessAtMs<r)r=o.lastAccessAtMs,e=n;if(e!==void 0)this.store.delete(e)}}import{statSync as r_,readFileSync as Kp}from"node:fs";import{execSync as n_}from"node:child_process";import{join as Bp}from"node:path";import{readFile as Gb}from"node:fs/promises";import{resolve as Vb}from"node:path";import{homedir as Wb}from"node:os";var Nl=Vb(Wb(),".config","opencode","sisyphus-mandatory","sisyphus-mandatory.md");async function Lp(e){return await Gb(e??Nl,"utf-8")}function Ul(e,r){let n=r?.oracleVerified===!0,o=r?.filesChanged??0,t=["","## Sisyphus Protocol Enforcement","","You MUST follow these Sisyphus protocol rules:","","1. **Pre-response Memory Check**: Before any action, read `<project-memory>` and `<session-history-since>` blocks in context. Cite `<memory id>` for any fact used from memory. Do not ask questions whose answers are in those blocks.","","2. **Codebase Graph First**: Before using grep/glob/read for architecture or symbol queries, check whether `.codegraph/` or `graphify-out/` exists. If so, use codegraph/graphify tools first, then grep/read only as last resort.","","3. **Tool Routing Table**: Match common intents to the correct tool:",' - "we did this before" / "you should know" → `agentmemory_memory_recall`'," - Starting a task that resembles a previous one → `agentmemory_memory_smart_search`"," - Before asking the user a clarifying question → `agentmemory_memory_recall` first"," - Save durable insight/decision/rule → `agentmemory_memory_save`",""];if(/\boracle\b/i.test(e)&&!(n&&o>0))t.push("4. **Post-task Oracle Verification**: If files touched >= 3 OR any INVOKE trigger matches, invoke Oracle with the exact format:",' `task(subagent_type="oracle", run_in_background=false, prompt="Verify: ...")`'," - INVOKE triggers: created 1+ new file, modified abstraction, touched security/auth paths, modified DB/persistence, modified CI/CD, added/removed dependency, modified perf-critical path, todo had 2+ completed items."," - SKIP only when: files touched <= 2, no new file, no dependency change, single-step task, change is typo/comment/rename only."," - Verdict: PASS → done. FAIL/CONDITIONAL → fix and re-invoke. Max 3 invocations."," - Cost: Max 3 oracle invocations per task. Skip rate: Must NOT skip Oracle on 2+ file change.","");return t.push("5. **Parallel Query Rule**: Fire independent tool queries in the same turn. Do NOT serialize independent memory/context queries.","","6. **Empty-Result Escalation**: On empty `agentmemory_memory_recall`, fire `agentmemory_memory_smart_search` + `agentmemory_memory_export` before asking the user.","","7. **Hard Rules (No Exceptions)**:"," - Do NOT ask 'where is X?' if memory or session record already contains it."," - Do NOT claim 'I don't know' before firing at least 2 different recall tools."," - Do NOT re-issue clarifying questions whose answer is in `<project-memory>` or `<session-history-since>`."," - Do NOT suppress type errors with `as any`, `@ts-ignore`, or `@ts-expect-error`."," - Do NOT leave empty catch blocks `catch(e) {}`.",' - Do NOT start a fresh agent via `task()` when `task(task_id="ses_...")` (continuation) exists — use continuation IDs.'," - Do NOT batch-complete todos — mark each one `completed` immediately after finishing."," - Do NOT skip creating todos for multi-step tasks.","","8. **Self-Check Before Responding**:"," - Verify you read `<project-memory>` and `<session-history-since>` blocks."," - Verify you cited `<memory id>` for any fact used from memory."," - Verify you did not ask a question whose answer is in those blocks."," - For multi-file changes, verify Oracle was invoked."," - For codebase exploration, verify codegraph/graphify was tried before grep/read."," - After discovering something non-obvious, save it with `agentmemory_memory_save` so future sessions benefit."," - Do NOT save routine operations (file reads, greps, list commands), trivial decisions, or facts already covered by existing memory. Save only novel insights, non-obvious patterns, or corrections to previous assumptions.","","9. **CI Verification Loop (NON-NEGOTIABLE)**: After EVERY step of an implementation plan that produces a code change you intend to keep, you MUST execute the full CI loop BEFORE moving to the next step:"," a. Commit the changes atomically (one commit per verified increment, never omnibus)."," b. Push to the remote that has CI configured (own repo: `git push origin <branch>`. Fork upstream: `git push fork <branch>` + open/update PR)."," c. Wait for the CI run triggered by the push to reach a terminal state (`gh run watch <run-id> --exit-status`).",' d. Assert `conclusion == "success"` on EVERY job. If any job fails, fix the regression, re-push, and re-verify until all jobs are green.'," e. Capture the green run-id so the final plan-completion message can cite it as evidence."," - Anti-pattern this rule kills: running local tests, seeing 0 failures, declaring done, then shipping the next step on top of an unverified CI. Local green is NOT CI green. Pushed-not-watched is NOT CI green."," - At the END of the plan (when the last step is done), run a final guarantee: `gh run list --branch <branch> --limit 5` and assert EVERY recent run on this branch has `conclusion=success`. If any run shows `failure`, surface it explicitly to the user with the run-id, the failing job, and the log excerpt - do NOT claim plan success."," - For fork -> upstream PR workflow: verify the workflow_run on the upstream repo (the PR's head ref), not just the fork. Both must be green."," - This rule applies whenever the repo has a `.github/workflows/*.yml` file (or equivalent CI config). For repos without CI, document the absence explicitly."," - If the user explicitly says 'skip CI' or 'local only', this rule is suppressed for that turn ONLY - re-engage on next step.",""),t.join(`
|
|
190
|
+
`)}function Zp(e,r,n){let o=[],t=n.recentToolCalls??[],i=n.recentWriteContents??[],a=n.memorySaved??!1,s=n.batchCompletions??0;if((e==="grep"||e==="glob")&&(n.hasCodegraphDir||n.hasGraphifyDir)){let u=n.hasCodegraphDir?".codegraph":"graphify-out";o.push({rule:"codebase-graph-first",tool:e,severity:"media",detail:`Used ${e} when ${u} exists — should use codegraph/graphify first for architecture and symbol queries.`})}if(e==="task"&&r&&typeof r==="object"){let u=r;if(!u.task_id&&typeof u.prompt==="string"&&t.length>3)o.push({rule:"continuation-discipline",tool:e,severity:"leve",detail:`Started a new task() without task(task_id="ses_...") continuation ID. Use task_id to preserve the subagent's full context and save tokens.`})}let c=["write","edit","edit_block","desktop-commander_edit_block","desktop-commander_write_file"];if(c.includes(e)){let u=typeof r==="object"&&r!==null?JSON.stringify(r):String(r??""),y=/@ts-ignore|@ts-expect-error/.test(u),x=/\bas any\b/.test(u);if(y&&x)o.push({rule:"no-type-suppression",tool:e,severity:"grave",detail:"File write contains both @ts-ignore/@ts-expect-error AND 'as any' — double type suppression. "+"Both are forbidden by the Sisyphus protocol."});else if(y)o.push({rule:"no-type-suppression",tool:e,severity:"media",detail:"File write contains @ts-ignore or @ts-expect-error — both are forbidden. "+"Fix the underlying type error instead."});else if(x)o.push({rule:"no-type-suppression",tool:e,severity:"media",detail:"File write contains 'as any' — type suppression forbidden. "+"Use proper type narrowing instead."})}if(c.includes(e)){let u=typeof r==="object"&&r!==null?JSON.stringify(r):String(r??"");if(/catch\s*\(\s*\w+\s*\)\s*\{\s*\}/.test(u))o.push({rule:"no-empty-catch",tool:e,severity:"media",detail:"Empty catch block detected — `catch(e) {}` is forbidden. "+"Log the error or handle it gracefully."})}if(["codegraph_explore","graphify query"].includes(e)&&t.length>=2){if(!a)o.push({rule:"save-discovery-to-memory",tool:e,severity:"leve",detail:`Used ${e} to discover code but no memory save was made afterwards. Save non-obvious findings with agentmemory_memory_save so future sessions benefit.`})}if(s>0&&e!=="todowrite")o.push({rule:"no-batch-todo-completion",tool:e,severity:"leve",detail:"Batch todo completion detected. Each todo must be marked `completed` immediately "+"after finishing — do not batch-complete multiple items."});if(n.emptyRecall&&!n.escalationAttempted){if(e.startsWith("question")||e==="ask")o.push({rule:"empty-result-escalation",tool:e,severity:"grave",detail:"Memory recall returned empty but agent did not fire smart_search + export before asking the user. Steps 1-3 of empty-result escalation protocol are mandatory."})}let d=["agentmemory_memory_recall","agentmemory_memory_smart_search","agentmemory_memory_save"];if(!n.memoryToolsUsed.some((u)=>d.some((y)=>u.startsWith(y)))&&(e.startsWith("question")||e==="ask"))o.push({rule:"memory-first",tool:e,severity:"grave",detail:"Asked a question without first querying memory. Must fire agentmemory_memory_recall or agentmemory_memory_smart_search before asking the user."});let h=["write","edit","edit_block","desktop-commander_write_file","desktop-commander_edit_block","apply_patch"];if(n.filesChanged>=3&&!n.oracleInvoked&&h.includes(e))o.push({rule:"oracle-verification",tool:e,severity:"media",detail:`Files changed (${n.filesChanged}) >= 3 but Oracle was not invoked. The POST-TASK ORACLE VERIFICATION protocol requires Oracle invocation on multi-file changes.`});return o}var Ll=["write","edit","edit_block","multi_edit","apply_patch","ast_grep_replace","refactor","desktop-commander_write_file","desktop-commander_edit_block"],Bb=["brainstorming","writing-plans","test-driven-development","systematic-debugging","subagent-driven-development"];function Fp(e){let r=["[SKILL PRIMING] This session involves implementation work. Select precise skills for this task before writing code:"],n=1;if(e==="aas"||e==="both")r.push(`${n}. Query the AAS skill catalog (aas search_skills) for the 2-3 capabilities most relevant to this task (e.g. testing, architecture, language-specific), and compare candidates with aas get_skill.`),n++,r.push(`${n}. If 2+ viable candidates exist, compose a minimal stack (<= 3 skills) with aas compose_stack.`),n++;if(e==="superpowers"||e==="both")r.push(`${n}. If a matching superpowers skill is available and not yet active (${Bb.join(" / ")}), load it via the skill tool.`),n++;if(e==="both")r.push("If a superpowers skill is already active, skip the catalog step.");return r.push("Do NOT enumerate the full catalog — keep the stack minimal and task-specific."),r.join(`
|
|
191
|
+
`)}function Gp(e){if(e.trigger==="sessionStart")return!0;if(e.implementationToolSeen)return!0;return e.recentToolCalls.some((r)=>Ll.includes(r))}Rr();var Hp={continue:0,warn:1,escalate:2,stop:3};function Zl(e,r){return Hp[e]>=Hp[r]}function o_(e){let r=e.args;if(!r||typeof r!=="object")return null;let n=["pattern","query","path","glob","regex","include_pattern"];for(let o of n){let t=r[o];if(typeof t==="string"&&t.trim().length>0)return t.trim()}return null}var i_=zp({sessionID:"__global__",global:!0,version:be}),a_=qp(t_(),".config","opencode","meta-governor-health.json");function Xp(e={},r={}){let n=R(),o=new Cl;Lm(o);let t=process.cwd(),i=Lr(),a=Fm({graphRetrieval:n,cwd:t}),s=Gm({sqlite:i}),c=Vm({metrics:i_,logFilePath:pe,healthFilePath:a_}),l=Wm({cwd:t}),d=Bm({cwd:t}),v=Hm({onDispatch:({sessionID:re,mcpTool:de,mcpArgs:xe})=>{o.register({sessionID:re,mcpTool:de,mcpArgs:xe})}}),h=Jm({onDispatch:({sessionID:re,mcpTool:de,mcpArgs:xe})=>{o.register({sessionID:re,mcpTool:de,mcpArgs:xe})}}),u=qm({cwd:t}),y=Km({cwd:t}),x=Xm({graphRetrieval:n,cwd:t}),j=Ym({graphRetrieval:n,cwd:t}),A=Qm({graphRetrieval:n,cwd:t}),G=ep({graphRetrieval:n,cwd:t}),N=tp({graphRetrieval:n,cwd:t}),X=rp({graphRetrieval:n,cwd:t}),he=np({graphRetrieval:n,cwd:t}),kt=op({graphRetrieval:n,cwd:t}),Gl=ip({graphRetrieval:n,cwd:t}),Vl=ap({graphRetrieval:n,cwd:t}),Wl=sp({graphRetrieval:n,cwd:t}),Bl=cp({graphRetrieval:n,cwd:t}),Hl=lp({graphRetrieval:n,cwd:t}),Jl=up({graphRetrieval:n,cwd:t}),ql=dp({graphRetrieval:n,cwd:t}),Kl=mp({graphRetrieval:n,cwd:t}),Xl=pp({graphRetrieval:n,cwd:t}),Yl=fp({graphRetrieval:n,cwd:t}),Ql=gp({graphRetrieval:n,cwd:t}),eu=hp({graphRetrieval:n,cwd:t}),tu=vp({graphRetrieval:n,cwd:t}),ru=yp({graphRetrieval:n,cwd:t}),nu=bp({graphRetrieval:n,cwd:t}),ou=_p({cwd:t}),iu=kp({cwd:t}),au=$p({cwd:t}),su=xp({cwd:t}),cu=wp({cwd:t});T("info",`v${be} MetaGovernor plugin loaded`,{version:be,build:"0.19.5-instr",cwd:t,projectHasCodegraph:n.hasCodegraphDir(t),projectHasGraphify:n.hasGraphifyDir(t)});let lu="?";try{let de=e_(import.meta.url),xe=Kp(de);lu=Qb("sha256").update(xe).digest("hex").slice(0,8)}catch{}return console.log(`[meta-governor] v${be} loaded (bundle: ${lu})`),(async()=>{try{let{execSync:re}=await import("node:child_process"),de=re("npm view @herjarsa/omo-meta-governor version",{timeout:5000,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).trim();if(de&&de!==be)T("warn",`STALE_CACHE: loaded v${be} but npm has v${de}. Run: npm cache clean --force && rm -rf ~/.cache/opencode/packages/@herjarsa/omo-meta-governor*`)}catch{}})(),async(re,de)=>{T("info",`v${be} factory_invoked`,{version:be,hasInput:re!=null,inputDir:re?.directory??null,inputKeys:re?Object.keys(re):[]});let xe=re.client,uu=xe!=null&&typeof xe==="object"&&"tool"in xe?xe:null;Ip().setClient(uu),Il(uu);let Ze;try{Ze=await jl({projectDir:re.directory??t})}catch(g){throw T("error","factory_config_load_failed",{message:g instanceof Error?g.message:String(g),stack:g instanceof Error?g.stack?.slice(0,800):void 0}),g}let Yp={...e,...Ze.config,...de?.meta_governor??{}},O;try{O=Ml(Yp)}catch(g){throw T("error","factory_orchestrator_config_failed",{message:g instanceof Error?g.message:String(g)}),g}if(Cm({preferredTool:O.graphRetrieval.preferredTool}),Ze.sources.length>0)T("info",`v${be} config_loaded`,{version:be,sources:Ze.sources,effectiveSource:Ze.effectiveSource,enabled:O.enabled});if(O.postWave?.enabled===!0&&O.intervention.respectDoneSignal===!1)T("info","post_wave_warning",{message:"postWave.enabled=true but intervention.respectDoneSignal=false: post-wave directives still fire on Oracle-verified PHASE-N-COMPLETE, but the done-signal latch is off (intervention is not auto-disabled at plan end)."});let du=new Set,mu=new Set,Qp=new Set,_e=re.directory?qp(re.directory):t,$t=e.graphSync??Ze.config?.graphSync??de?.meta_governor?.graphSync;if($t?.enabled!==!1){if(r.__test_onGraphSyncInit?.({projectDir:_e}),(r.__test_runGraphSync??It)({enabled:!0,watch:$t?.watch??!1,autoInstall:$t?.autoInstall??!0,installTimeoutMs:$t?.installTimeoutMs??60000,killOrphanedOnInit:$t?.killOrphanedOnInit??!0,projectDir:_e}).then((w)=>{if(w?.attempted&&w.availability.codegraph&&w.availability.graphify)du.add(_e)}).catch(()=>{}),O.cliAnything?.enabled!==!1){let w=Ze.config?.cliAnything??de?.meta_governor?.cliAnything;(r.__test_runCliAnythingSync??Lu)({enabled:!0,autoInstall:w?.autoInstall??!0,autoUpgrade:w?.autoUpgrade??!0,cachePath:w?.cachePath??`${process.env.HOME||process.env.USERPROFILE||"~"}/.config/opencode/omo-cli-anything-upgrade-check.json`,upgradeCheckTtlMs:w?.upgradeCheckTtlMs??86400000,projectDir:_e,installScope:w?.installScope??"global",cliHubBin:w?.cliHubBin??"cli-hub",skillsBin:w?.skillsBin??"npx skills"}).then((I)=>{if(I?.attempted&&I.availability.cliHub)Qp.add(_e)}).catch((I)=>{T("warn",`cli-anything sync failed: ${String(I)}`)})}queueMicrotask(()=>{try{let w=O.graphSync.fetchBranch,f=ko(_e,w);if(f>0)T("info",`reindexOnFetch: ${f} new commits on origin/${w}, reindexing`),Mr(_e).catch((I)=>{T("warn",`reindexOnFetch failed: ${String(I)}`)})}catch{}})}if(!O.enabled)return{tool:{omo_search:a,omo_recall:s,omo_health:c,omo_find:l,omo_impact:d,omo_remember:v,omo_recall_mcp:h,omo_path:u,omo_explain:y,omo_files:x,omo_callers:j,omo_node:A,omo_context:G,omo_affected_cg:N,omo_status:X,omo_unlock:he,omo_mark_dirty:kt,omo_sync_if_dirty:Gl,omo_index:Vl,omo_visualize:Wl,omo_serve:Bl,omo_uninit:Hl,omo_diagnose:Jl,omo_merge_graphs:ql,omo_save_result:Kl,omo_extract:Xl,omo_cluster_only:Yl,omo_label:Ql,omo_tree:eu,omo_clone:tu,omo_add:ru,omo_check_update:nu,omo_hook_status:ou,omo_cli_anything_install:iu,omo_cli_anything_list:au,omo_cli_anything_search:su,omo_cli_anything_info:cu},dispose:()=>{try{lo()}catch{}try{St()}catch{}try{Sr()}catch{}try{tt()}catch{}return Promise.resolve()}};let ro=()=>O.modelOverride?.providerID??r.providerID?.(),no=()=>O.modelOverride?.modelID??r.modelID?.(),ef=()=>O.modelOverride?.modelLimit??200000,S_=ro()??"unknown",I_=no()??"unknown",br,pu;if(O.protocolEnforcement.enabled||O.protocolEnforcement.injectIntoSystem){let g=O.protocolEnforcement.path??Nl;try{br=await Lp(g),pu=Ul(br)}catch(w){if(O.modelOverride?.verbosity!=="silent")T("warn",`could not load protocol: ${w instanceof Error?w.message:String(w)}`)}}let ke=new Rl({maxEntries:100,ttlMs:3600000}),_r=new Map,fu=300000,kr=new Map,gu=new Set,hu=new Set,vu=new Set,tf=()=>({currentWaveN:null,lastInjectedWaveN:null,lastInjectedAtMs:null,postWaveInjectionsThisWave:0,rulesReadForWave:{},oracleAfterPhaseAtMs:{},repoModeResolved:null}),yu=new Map,$r=(g,w)=>{if(!g||!w)return;if(!O.intervention.persistToSession)return;Yn(g,w).then((f)=>{if(!f.ok)T("warn",`persist intervention failed for ${g}`,{error:f.error});else T("info",`persisted intervention for ${g}`)})};return{dispose:()=>{try{lo()}catch{}try{St()}catch{}try{Sr()}catch{}try{tt()}catch{}return Promise.resolve()},"tool.execute.before":async(g,w)=>{if(!O.enabled)return;if(!O.protocolEnforcement.auditToolCalls)return;if(!g.sessionID)return;let f=ke.get(g.sessionID);if(!f)f={memoryToolsUsed:[],hasCodegraphDir:n.hasCodegraphDir(t),hasGraphifyDir:n.hasGraphifyDir(t),oracleInvoked:!1,filesChanged:0,emptyRecall:!1,escalationAttempted:!1,recentToolCalls:[],recentWriteContents:[],recentWriteFilePaths:[],memorySaved:!1,accumulatedDeviations:[],recentInterventionTexts:[],batchCompletions:0,taskDoneSignal:!1,phaseCompleteSignal:!1,planCompleteSignal:!1,interventionCount:0,interventionDisabled:!1,lessonCount:0,lastViolationInjectionAtMs:0,iteration:0,oracleInFlight:!1,oracleInFlightSinceMs:null,signalAtMs:0,backgroundTaskInFlight:!1,backgroundTaskInFlightSinceMs:null,backgroundTaskType:null,lastWarnAtMs:0,lastWarnHash:"",recentPwArgsHashes:[]},ke.set(g.sessionID,f);if(f?.oracleInFlight)return;if(pu)T("info","protocol loaded, system injection ready");let I=Zp(g.tool,w.args,{memoryToolsUsed:f.memoryToolsUsed,hasCodegraphDir:f.hasCodegraphDir,hasGraphifyDir:f.hasGraphifyDir,oracleInvoked:f.oracleInvoked,filesChanged:f.filesChanged,emptyRecall:f.emptyRecall,escalationAttempted:f.escalationAttempted,recentToolCalls:f.recentToolCalls,recentWriteContents:f.recentWriteContents,memorySaved:f.memorySaved,batchCompletions:f.batchCompletions});if(I.length>0){let ae=f.lastViolationInjectionAtMs??0;if(ae>0&&Date.now()-ae<30000){T("info",`violation during cooldown (${Math.round((30000-(Date.now()-ae))/1000)}s remaining), skipping queue`);let ne=I.map((Y)=>({severity:Y.severity,category:Y.rule,detail:Y.detail,ts:Date.now()}));f.accumulatedDeviations=[...f.accumulatedDeviations,...ne].slice(-5)}else{T("warn",`protocol violations on tool ${g.tool}`,I);let ne=_r.get(g.sessionID)?.items??[],Y=new Set;for(let S of I){let U=`${S.severity}::${S.rule}::${S.detail}`;if(Y.has(U))continue;Y.add(U);let L=`[${S.severity.toUpperCase()}] ${S.rule}: ${S.detail}`;if(!ne.includes(L))ne.push(L)}_r.set(g.sessionID,{items:ne,expiresAtMs:Date.now()+fu});let M=I.map((S)=>({severity:S.severity,category:S.rule,detail:S.detail,ts:Date.now()}));f.accumulatedDeviations=[...f.accumulatedDeviations,...M].slice(-5)}}else T("info",`audit OK on tool ${g.tool}`);if((g.tool==="grep"||g.tool==="glob")&&(n.hasCodegraphDir(t)||n.hasGraphifyDir(t))){let ee=o_(g);if(ee)n.invoke(t,ee,{timeoutMs:5000}).then((ae)=>{if(ae.result)n.cacheContext(g.sessionID,ee,ae.result)}).catch(()=>{})}},"tool.execute.after":async(g,w)=>{if(!O.enabled)return;try{o.markDelivered({sessionID:g.sessionID,mcpTool:g.tool,mcpArgs:g.args})}catch{}if(Ll.includes(g.tool))vu.add(g.sessionID);let f=ke.get(g.sessionID);if(f){if(f.iteration++,f.recentToolCalls=[g.tool].concat(f.recentToolCalls).slice(0,20),["write","edit","edit_block","desktop-commander_write_file","desktop-commander_edit_block"].includes(g.tool)){f.filesChanged++;let P=(w.output??"").slice(0,500);f.recentWriteContents=[P].concat(f.recentWriteContents).slice(0,3);let te=g.args,B=te?.filePath??te?.path;if(typeof B==="string"&&B.length>0)f.recentWriteFilePaths=[B].concat(f.recentWriteFilePaths).slice(0,10)}if(["agentmemory_memory_recall","agentmemory_memory_smart_search","agentmemory_memory_save"].some((P)=>g.tool.startsWith(P))&&!f.memoryToolsUsed.includes(g.tool))f.memoryToolsUsed.push(g.tool);if(g.tool.startsWith("agentmemory_memory_save")){let P=w.output??"";if(P.includes("saved")||P.includes("written"))f.memorySaved=!0}if(g.tool==="task"){let P=w.output??"",te=g.args,B=te?.subagent_type;if(B==="oracle"||P.includes("subagent_type=oracle")){if(f.oracleInvoked=!0,te?.run_in_background===!0)f.oracleInFlight=!0,f.oracleInFlightSinceMs=Date.now()}if(te?.run_in_background===!0&&typeof B==="string")f.backgroundTaskInFlight=!0,f.backgroundTaskInFlightSinceMs=Date.now(),f.backgroundTaskType=B,T("info",`background_task_in_flight: subagent_type=${B} for session ${g.sessionID}`)}let L=(w.output??"").toLowerCase();if(g.tool.includes("recall")&&(L.includes("returned empty")||L.includes("no results")))f.emptyRecall=!0;if(g.tool==="todowrite"&&(w.output??"").includes("completed")){if(((w.output??"").match(/"status":"completed"/g)??[]).length>=3)f.batchCompletions++}let J=[typeof w.output==="string"?w.output:"",typeof g.args==="string"?g.args:""].join(`
|
|
192
|
+
`);if(!f.taskDoneSignal&&f_(J))f.taskDoneSignal=!0,f.signalAtMs=Date.now(),T("info",`task_done_signal detected (legacy) for session ${g.sessionID}`);if(!f.phaseCompleteSignal&&g_(J))f.phaseCompleteSignal=!0,f.signalAtMs=Date.now(),T("info",`phase_complete_signal detected for session ${g.sessionID}`);if(!f.planCompleteSignal&&h_(J))f.planCompleteSignal=!0,f.signalAtMs=Date.now(),T("info",`plan_complete_signal detected for session ${g.sessionID}`);if(f.oracleInFlight){let te=f.oracleInFlightSinceMs!==null&&Date.now()-f.oracleInFlightSinceMs>300000;if(f.oracleInFlightSinceMs!==null&&f.signalAtMs>f.oracleInFlightSinceMs||te)f.oracleInFlight=!1,f.oracleInFlightSinceMs=null,T("info",`oracle_completed: re-enabling intervention for session ${g.sessionID}${te?" (timeout)":""}`);if(g.tool==="task"&&g.args?.subagent_type==="oracle"&&g.args?.run_in_background===!1)f.oracleInFlight=!1,f.oracleInFlightSinceMs=null,T("info",`oracle_completed (foreground call): re-enabling intervention for session ${g.sessionID}`)}if(f.backgroundTaskInFlight){if(f.backgroundTaskInFlightSinceMs!==null&&Date.now()-f.backgroundTaskInFlightSinceMs>300000)f.backgroundTaskInFlight=!1,f.backgroundTaskInFlightSinceMs=null,f.backgroundTaskType=null,T("info",`background_task_timed_out: re-enabling intervention for session ${g.sessionID}`)}}if(O.postWave?.enabled){let M=O.postWave,S=[typeof w.output==="string"?w.output:"",typeof g.args==="string"?g.args:""].join(`
|
|
193
|
+
`),U=v_(S),L=g.tool==="task"&&S.includes("subagent_type=oracle");if(U!==null||L){let J=ke.get(g.sessionID);if(J){let B=Jp(S);if(J.recentPwArgsHashes.includes(B)){if(U===null&&L)T("info",`post_wave_dedupe: skipping re-detection of identical Oracle-call text for session ${g.sessionID}`)}else J.recentPwArgsHashes=[B,...J.recentPwArgsHashes].slice(0,8)}let P=yu.get(g.sessionID);if(!P)P=tf(),yu.set(g.sessionID,P);if(U!==null&&U!==P.currentWaveN)P.currentWaveN=U,P.postWaveInjectionsThisWave=0;if(L&&P.currentWaveN!==null){if(!(J!==void 0&&J.recentPwArgsHashes.slice(1).includes(Jp(S))))P.oracleAfterPhaseAtMs[P.currentWaveN]=Date.now()}let te=Date.now();if(y_({postWave:P},M,te)){let B=P.repoModeResolved??k_(M.repoMode??"auto",_e);P.repoModeResolved=B;let xt=B==="third-party"?__(M.thirdPartyDirective,P.currentWaveN,M.aasToolPrefix):b_(M.ownRepoDirective,P.currentWaveN);P.lastInjectedWaveN=P.currentWaveN,P.lastInjectedAtMs=te,P.postWaveInjectionsThisWave++,Tl(g.sessionID,xt).then((oo)=>{if(!oo.ok)T("info",`post-wave directive delivery failed for ${g.sessionID}: ${oo.error??"unknown"}`)})}}}if(f?.interventionDisabled)return;let ee=(f?.recentToolCalls??[]).slice(0,5).filter((M)=>["write","edit","edit_block","desktop-commander_write_file","desktop-commander_edit_block","task"].includes(M)),ae=f?!(f.oracleInFlight||f.backgroundTaskInFlight)&&ee.length===0:!1,ne=f?.accumulatedDeviations??[],Y={sessionID:g.sessionID,toolName:g.tool,toolOutput:w.output,iteration:f?.iteration??0,maxIterations:O.closedLoop.maxLessonsPerSession??10,oracleVerified:f?.oracleInvoked??!1,noProgress:ae,filesChanged:f?.filesChanged??0,recentTurnTokens:[],deviations:ne,filePaths:f?.recentWriteFilePaths??[],...(()=>{let{backends:M,writeBackend:S}=r;if(M&&S)return{backends:M,writeBackend:S};try{let U=Lr();return{backends:M??{agentmemory:U,boulderState:U},writeBackend:S??U}}catch{return{backends:M??{agentmemory:{smartSearch:async()=>({lessons:[],crystals:[]})},boulderState:{boulderRead:async()=>[]}},writeBackend:S??{saveMemory:async()=>({id:""}),saveLesson:async()=>({id:""})}}}})(),config:O,...ro()?{providerID:ro()}:{},...no()?{modelID:no()}:{},modelLimit:ef(),currentLessonCount:f?.lessonCount??0};try{let M=await td(Y);if(M.lessonSaved?.lessonSaved&&f)f.lessonCount++;if(M.decision.action==="escalate"&&g.sessionID&&bt()){let S=M.decision.historyEntry.decision,U=S.evidence.length,L=S.shouldEscalateTo??"oracle",J=Ol({reasoning:S.reasoning,target:L,evidenceCount:U,sessionID:g.sessionID});_t(g.sessionID,{toolName:"meta_governor_escalate",mcpTool:"task",mcpArgs:{subagent_type:L},preamble:J}).catch((P)=>{T("warn",`escalation prompt failed: ${String(P)}`)})}if(O.intervention.mode!=="silent"&&f){let S=M.decision;if(f.oracleInFlight||f.backgroundTaskInFlight){let L=f.oracleInFlight?"oracle_in_flight":"background_task_in_flight";T("info",`${L}: skipping intervention for session ${g.sessionID} (score ${M.scoringResult.rawScore.toFixed(2)})`);return}let U=O.intervention.phaseAwareDoneSignal===!0;if(O.intervention.respectDoneSignal&&f.oracleInvoked&&(f.planCompleteSignal||!U&&(f.taskDoneSignal||f.phaseCompleteSignal))){f.interventionDisabled=!0;let L=f.planCompleteSignal?"PLAN-COMPLETE":f.taskDoneSignal?"DONE":"PHASE-N-COMPLETE";T("info",`task verified (${L} + Oracle): disabling intervention for session ${g.sessionID}`),Le(g.sessionID);return}if(S.action!=="continue"&&Zl(S.action,O.intervention.minActionForMessage)){let L=Math.max(0,O.intervention.maxInterventionsPerSession??0);if(L>0&&f.interventionCount>=L){f.interventionDisabled=!0,T("warn",`intervention cap (${L}) reached for session ${g.sessionID}; disabling further intervention`),Le(g.sessionID);return}let J=60000,P=Date.now(),te=S.historyEntry?.reasoning??S.message??"",B=`${S.action}::${te.slice(0,80)}`;if((S.action==="warn"||S.action==="escalate")&&f.lastWarnHash===B&&f.lastWarnAtMs>0&&P-f.lastWarnAtMs<J){T("info",`warn_cooldown: suppressing duplicate ${S.action} (${Math.round((J-(P-f.lastWarnAtMs))/1000)}s remaining) for session ${g.sessionID}`),Le(g.sessionID);return}if(f.interventionCount++,S.action==="warn"||S.action==="escalate")f.lastWarnAtMs=P,f.lastWarnHash=B;Up(g.sessionID,S)}}}catch{}try{if(g.tool==="bash"){let S=g.args?.command;if(Ar(S))T("info","git_commit_reindex_triggered",{sessionID:g.sessionID,command:S}),r.__test_onCommitTrigger?.({projectDir:_e,command:S??"",sessionID:g.sessionID}),Mr(_e).catch((U)=>{T("warn",`codegraph sync failed: ${String(U)}`)})}}catch{}try{if(g.tool==="bash"){let S=g.args?.command;if(c_(S)){let U=s_(w.output,g.sessionID);if(U.length>0){let L=kr.get(g.sessionID)?.items??[];kr.set(g.sessionID,{items:L.concat(U),expiresAtMs:Date.now()+fu}),T("info",`captured ${U.length} bot feedback line(s) for session ${g.sessionID}`)}}}}catch{}try{let M=g.args?.command;if(g.tool==="bash"&&l_(M)){let S=O.ciMonitor;if(S?.enabled){let U=u_(t),L=d_(t);if(U&&L)T("info",`ci_monitor: git push detected on ${L}@${U.slice(0,7)} — starting background poll`),m_(U,L,S,g.sessionID).catch((J)=>{T("warn",`ci_monitor: background poll failed: ${J instanceof Error?J.message:String(J)}`)})}}}catch{}},"experimental.chat.messages.transform":async(g,w)=>{if(!O.enabled)return;let I=w.messages[w.messages.length-1]?.info?.sessionID;if(!I)return;let ee=ke.get(I);if(O.skillPriming.enabled&&!hu.has(I)&&Gp({trigger:O.skillPriming.trigger,recentToolCalls:ee?.recentToolCalls??[],implementationToolSeen:vu.has(I)}))hu.add(I),w.messages.push({info:{role:"user",agent:"meta-governor",synthetic:!0},parts:[{type:"text",text:Fp(O.skillPriming.router),synthetic:!0}]}),T("info",`skill_priming_injected for session ${I}`);if(du.has(_e)&&!mu.has(I))mu.add(I),w.messages.push({info:{role:"user",agent:"meta-governor",synthetic:!0},parts:[{type:"text",text:["[META-GOVERNOR] codegraph y graphify ya están inicializados en este repo. ","ROUTING EXPLÍCITO (v0.25.0): ","• Símbolos/definiciones/callers/impacto (código) → CODEGRAPH: omo_find, omo_impact, omo_search. ","• Conceptos/arquitectura/conexiones/explicaciones → GRAPHIFY: omo_path, omo_explain (y omo_search en modo alternate). ","• Vista general del repo → lee graphify-out/GRAPH_REPORT.md. ","Actualizan tras cada commit."].join(" "),synthetic:!0}]}),T("info",`graph_tools_ready_injected for session ${I}`);if(O.intervention.mode!=="message")return;if(ee?.interventionDisabled){Le(I);return}if(ee&&!gu.has(I)&&p_(t,ee.interventionCount)){gu.add(I);let se="[MetaGovernor] Before any code change, create PLAN.md or a `## Plan` section in AGENTS.md that enumerates the phases. After each phase, commit (local + fork + upstream). Each commit triggers automatic reindex via the graphify post-commit hook + `codegraph sync`.";w.messages.push({info:{role:"user",agent:"meta-governor",synthetic:!0},parts:[{type:"text",text:se,synthetic:!0}]}),T("info",`plan_reminder_injected for session ${I}`),$r(I,se)}let ae=kr.get(I);if(ae&&ae.expiresAtMs>Date.now()){let se=ae.items;if(se.length>0){let Fe=`[MetaGovernor PR Reviewer Feedback]
|
|
194
194
|
|
|
195
|
-
${
|
|
195
|
+
${se.map((et,io)=>`${io+1}. ${et}`).join(`
|
|
196
196
|
`)}
|
|
197
197
|
|
|
198
|
-
Apply these fixes to keep the PR mergeable.`;
|
|
198
|
+
Apply these fixes to keep the PR mergeable.`;w.messages.push({info:{role:"user",agent:"meta-governor",synthetic:!0},parts:[{type:"text",text:Fe,synthetic:!0}]}),kr.delete(I),T("info",`injected ${se.length} bot feedback line(s) to model for session ${I}`),$r(I,Fe)}}let ne=_r.get(I);if(ne&&ne.expiresAtMs>Date.now()){let se=ne.items;if(se.length>0){let Fe=`[META-GOVERNOR PROTOCOL VIOLATIONS - YOU MUST COMPLY]
|
|
199
199
|
|
|
200
|
-
${
|
|
200
|
+
${se.map((io,nf)=>`${nf+1}. ${io}`).join(`
|
|
201
201
|
`)}
|
|
202
202
|
|
|
203
|
-
Remember: use codegraph/graphify for architecture queries, do not grep without trying codegraph/graphify first, no @ts-ignore/as-any, no empty catch, check memory before asking.`;
|
|
204
|
-
${
|
|
203
|
+
Remember: use codegraph/graphify for architecture queries, do not grep without trying codegraph/graphify first, no @ts-ignore/as-any, no empty catch, check memory before asking.`;w.messages.push({info:{role:"user",agent:"meta-governor",synthetic:!0},parts:[{type:"text",text:Fe,synthetic:!0}]}),_r.delete(I),T("info",`injected ${se.length} violation(s) to model`),$r(I,Fe);let et=ke.get(I);if(et)et.lastViolationInjectionAtMs=Date.now()}}let Y=Le(I);if(!Y)return;if(Y.action==="continue")return;if(!Y.message)return;if(!Zl(Y.action,O.intervention.minActionForMessage))return;let M=ee??ke.get(I);if(!M)M={memoryToolsUsed:[],hasCodegraphDir:n.hasCodegraphDir(t),hasGraphifyDir:n.hasGraphifyDir(t),oracleInvoked:!1,filesChanged:0,emptyRecall:!1,escalationAttempted:!1,recentToolCalls:[],recentWriteContents:[],recentWriteFilePaths:[],memorySaved:!1,accumulatedDeviations:[],recentInterventionTexts:[],batchCompletions:0,taskDoneSignal:!1,phaseCompleteSignal:!1,planCompleteSignal:!1,interventionCount:0,interventionDisabled:!1,lessonCount:0,iteration:0,oracleInFlight:!1,oracleInFlightSinceMs:null,signalAtMs:0,lastViolationInjectionAtMs:0,backgroundTaskInFlight:!1,backgroundTaskInFlightSinceMs:null,backgroundTaskType:null,lastWarnAtMs:0,lastWarnHash:"",recentPwArgsHashes:[]},ke.set(I,M);let S=Math.max(0,O.intervention.maxInterventionsPerSession??0);if(S>0&&M.interventionCount>=S){M.interventionDisabled=!0;return}M.interventionCount++;let U=O.intervention.includeDecisionHistory!==!1,L=O.intervention.maxHistoryMessages??5,J=(M.recentInterventionTexts??[]).slice(-L),P=[];for(let se of J)if(P.length===0||P[P.length-1]!==se)P.push(se);let te=Math.max(L,P.length),B=`[MetaGovernor] ${Y.message}`;if(U&&P.length>0)B=`[MetaGovernor] Recent decisions in this session:
|
|
204
|
+
${P.map((Fe,et)=>`${et+1}. ${Fe}`).join(`
|
|
205
205
|
`)}
|
|
206
206
|
|
|
207
207
|
---
|
|
208
208
|
|
|
209
|
-
Current decision: ${
|
|
210
|
-
### Sisyphus Protocol Enforcement`,
|
|
211
|
-
### Graph Context (auto-retrieved)`,
|
|
212
|
-
[MetaGovernor Intervention]`,
|
|
213
|
-
${
|
|
214
|
-
|
|
215
|
-
`);
|
|
216
|
-
### Past Lessons (auto-retrieved)`,
|
|
217
|
-
`),
|
|
218
|
-
`);
|
|
219
|
-
`)}function
|
|
220
|
-
`)}function
|
|
221
|
-
`).some((
|
|
222
|
-
|
|
223
|
-
//# debugId=
|
|
209
|
+
Current decision: ${Y.message}`;let xt=`[${Y.action}] ${Y.message}`;if(M.recentInterventionTexts?.slice(-1)[0]!==xt)M.recentInterventionTexts=[...M.recentInterventionTexts??[],xt].slice(-te);let rf={type:"text",text:B,synthetic:!0};w.messages.push({info:{role:"user",agent:"meta-governor"},parts:[rf]}),$r(I,B)},"experimental.chat.system.transform":async(g,w)=>{if(!O.enabled)return;if(O.protocolEnforcement.injectIntoSystem&&br){let f=g.sessionID?ke.get(g.sessionID):void 0;w.system.push(`
|
|
210
|
+
### Sisyphus Protocol Enforcement`,Ul(br,{oracleVerified:f?.oracleInvoked===!0,filesChanged:f?.filesChanged??0}),"---")}if(g.sessionID){let f=n.getCachedContext(g.sessionID);if(f)w.system.push(`
|
|
211
|
+
### Graph Context (auto-retrieved)`,f,"---")}if(O.intervention.mode==="system"&&g.sessionID){let f=ke.get(g.sessionID);if(f?.interventionDisabled){Le(g.sessionID);return}let I=Le(g.sessionID);if(I&&I.action!=="continue"&&I.message){if(Zl(I.action,O.intervention.minActionForMessage)){if(f){let ee=Math.max(0,O.intervention.maxInterventionsPerSession??0);if(ee>0&&f.interventionCount>=ee){f.interventionDisabled=!0;return}f.interventionCount++}w.system.push(`
|
|
212
|
+
[MetaGovernor Intervention]`,I.message,"---")}}}},tool:{omo_search:a,omo_recall:s,omo_health:c,omo_find:l,omo_impact:d,omo_remember:v,omo_recall_mcp:h,omo_path:u,omo_explain:y,omo_files:x,omo_callers:j,omo_node:A,omo_context:G,omo_affected_cg:N,omo_status:X,omo_unlock:he,omo_mark_dirty:kt,omo_sync_if_dirty:Gl,omo_index:Vl,omo_visualize:Wl,omo_serve:Bl,omo_uninit:Hl,omo_diagnose:Jl,omo_merge_graphs:ql,omo_save_result:Kl,omo_extract:Xl,omo_cluster_only:Yl,omo_label:Ql,omo_tree:eu,omo_clone:tu,omo_add:ru,omo_check_update:nu,omo_hook_status:ou,omo_cli_anything_install:iu,omo_cli_anything_list:au,omo_cli_anything_search:su,omo_cli_anything_info:cu},"experimental.session.compacting":async(g,w)=>{if(!O.enabled||!O.closedLoop.enabled)return;let f=Lr(),I=`session:${g.sessionID}`,ee=await f.smartSearch({query:I,limit:3});if(ee.lessons.length>0){let ae=ee.lessons.map((ne,Y)=>`${Y+1}. [${ne.id}] confidence=${ne.confidence.toFixed(2)}
|
|
213
|
+
${ne.content.slice(0,300)}`).join(`
|
|
214
|
+
|
|
215
|
+
`);w.context.push(`
|
|
216
|
+
### Past Lessons (auto-retrieved)`,ae,"---")}},"experimental.compaction.autocontinue":async(g,w)=>{if(!O.enabled)return;if(ke.get(g.sessionID)?.interventionDisabled)w.enabled=!1}}}}function s_(e,r){if(typeof e!=="string"||e.length===0)return[];let n=e.split(`
|
|
217
|
+
`),o=[];for(let t of n){let i=t.match(/^\s*(\S+)\s+(fail)\s+(.*)$/);if(i){let a=i[1].trim(),s=i[3].trim();o.push(`${r} · ${a}: ${s}`)}}return o}function c_(e){if(typeof e!=="string"||e.length===0)return!1;let r=e.replace(/\\\n/g," ").replace(/\s*\n\s*/g," ");return/(?:^|[\s;&|])gh\s+pr(?:\s|$)/.test(r)}function l_(e){if(typeof e!=="string"||e.length===0)return!1;let r=e.replace(/\\\n/g," ").replace(/\s*\n\s*/g," ");return/(?:^|[\s;&|])git\s+push(?:\s|$)/.test(r)}function u_(e){try{let{execFileSync:r}=we("node:child_process");return r("git",["rev-parse","HEAD"],{cwd:e,encoding:"utf-8",timeout:5000,stdio:["ignore","pipe","pipe"],windowsHide:!0}).toString().trim()||null}catch{return null}}function d_(e){try{let{execFileSync:r}=we("node:child_process"),o=r("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:e,encoding:"utf-8",timeout:5000,stdio:["ignore","pipe","pipe"],windowsHide:!0}).toString().trim();return o&&o!=="HEAD"?o:null}catch{return null}}var Fl=new Map;async function m_(e,r,n,o){let t=await Promise.resolve().then(() => (Wp(),Vp)),i=Fl.get(o)??{lastPolledSha:null,lastFailureInjectionAtMs:0,pending:new Set};i.pending.add(e),Fl.set(o,i);try{t.triggerWorkflow(n.workflow,r);let a=Date.now(),s=null;while(Date.now()-a<n.maxWaitMs){if(s=t.getLatestRunForSha(e),!s){await new Promise((c)=>setTimeout(c,n.pollIntervalMs));continue}if(s.status==="completed")break;await new Promise((c)=>setTimeout(c,n.pollIntervalMs))}if(!s||s.status!=="completed"){T("warn",`ci_monitor: timeout waiting for run on ${e.slice(0,7)} (${n.maxWaitMs}ms)`);return}if(i.lastPolledSha=e,s.conclusion==="failure"){let c=Date.now();if(c-i.lastFailureInjectionAtMs<60000)return;i.lastFailureInjectionAtMs=c;let l=t.getFailedLogs(s.databaseId,4000),d=[`[CI Monitor] GitHub Actions run #${s.databaseId} FAILED on ${r}@${e.slice(0,7)}.`,"",`Title: ${s.displayTitle}`,`URL: ${s.url}`,`Conclusion: ${s.conclusion}`,"","── FAILED-STEP LOGS (truncated) ──",l||"(no failed-log output available — run `gh run view "+s.databaseId+" --log-failed` for full output)","","── ACTION ──",n.failOnly?"Read the failed logs above, identify which tests broke, run them locally to reproduce, fix, and re-push. Use `bun run typecheck` first (fastest signal), then run only the failing test files.":"Review the run and take action."].join(`
|
|
218
|
+
`);T("warn",`ci_monitor: CI failed for ${e.slice(0,7)} — ${s.url}`);let h=await(await Promise.resolve().then(() => (Qn(),Nm))).persistSessionMessage(o,d,1e4);if(!h.ok)T("warn",`ci_monitor: failed to inject failure message: ${h.error??"unknown"}`)}else if(s.conclusion==="success")T("info",`ci_monitor: run #${s.databaseId} passed for ${e.slice(0,7)}`);else T("info",`ci_monitor: run #${s.databaseId} conclusion=${s.conclusion} for ${e.slice(0,7)}`)}finally{i.pending.delete(e),Fl.set(o,i)}}function p_(e,r){if(r>=1)return!1;try{return r_(Bp(e,"PLAN.md")),!1}catch{}try{let n=Kp(Bp(e,"AGENTS.md"),"utf-8");if(/^##\s+Plan\b/im.test(n))return!1}catch{}return!0}function f_(e){if(typeof e!=="string"||e.length===0)return!1;return/<promise>\s*DONE!?\s*<\/promise>/i.test(e)}function g_(e){if(typeof e!=="string"||e.length===0)return!1;return/<promise>\s*DONE!?\s*<\/promise>/i.test(e)||/<promise>\s*PHASE-\d+-COMPLETE\s*<\/promise>/i.test(e)}function h_(e){if(typeof e!=="string"||e.length===0)return!1;return/<promise>\s*PLAN-COMPLETE\s*<\/promise>/i.test(e)}function v_(e){let r=/(?:<promise>\s*)?PHASE-(\d+)-COMPLETE\s*(?:<\/promise>)?/i.exec(e);return r?Number.parseInt(r[1],10):null}function Jp(e){let r=2166136261;for(let n=0;n<e.length;n++)r^=e.charCodeAt(n),r=Math.imul(r,16777619);return(r>>>0).toString(36)}function y_(e,r,n){if(r.enabled===!1)return!1;let o=e.postWave.currentWaveN;if(o===null)return!1;if(!(o in e.postWave.oracleAfterPhaseAtMs))return!1;let t=r.maxRetriesPerWave??1,i=r.reinjectCooldownMs??60000,a=e.postWave.lastInjectedWaveN===o;if(a&&e.postWave.postWaveInjectionsThisWave>=t)return!1;if(a&&e.postWave.lastInjectedAtMs!==null&&n-e.postWave.lastInjectedAtMs<i)return!1;return!0}function b_(e,r){if(e)return e;return[`Wave ${r===null||r===void 0?"?":String(r)} is Oracle-verified. Land it now:`,"1. Use a CLEAN dedicated branch for this PR: `git checkout -b <branch>` (each PR gets its own independent branch; never mix PRs on one branch unless they fix the same problem).","2. `git push -u origin HEAD` (sets upstream on first push).","3. If no PR exists yet: `gh pr create --fill`.","4. Monitor CI: `timeout 600 gh pr checks --watch` (auto-stops after 10 min).","5. Only start the next wave after checks are green."].join(`
|
|
219
|
+
`)}function __(e,r,n="aas"){if(e)return e;return[`Wave ${r===null||r===void 0?"?":String(r)} is Oracle-verified. This is a THIRD-PARTY repo — land it as a contribution:`,"1. READ FIRST the repo's contribution rules (read CONTRIBUTING.md, PR/issue templates and guides) and follow them exactly.","2. Create a CLEAN dedicated branch for THIS PR: `git checkout -b <branch>` — each PR gets its own independent branch; never mix PRs on one branch unless they fix the same problem (then commit onto that same branch).",`3. Invoke the \`${n}\` MCP GitHub skills (search_skills → get_skill → compose_stack) to create the PR/issue.`,"4. Push the branch to your FORK (`git push -u origin HEAD`) and open the PR against the UPSTREAM repo following the repo's template.","5. Request review on the PR (add reviewers) and wait for CI to pass before starting the next wave."].join(`
|
|
220
|
+
`)}function k_(e,r,n=n_){if(e==="own"||e==="third-party")return e;try{let o=n("gh repo view --json isFork,parent",{cwd:r,stdio:"pipe",timeout:1e4}),t=JSON.parse(String(o));if(t.isFork===!0&&t.parent!==null&&t.parent!==void 0)return"third-party";return"own"}catch{try{let o=n("git remote -v",{cwd:r,stdio:"pipe",timeout:1e4});if(String(o).split(`
|
|
221
|
+
`).some((i)=>/^\s*upstream\s+/.test(i)))return"third-party"}catch{}return"own"}}var $_=Xp();function to(e,r){return $_(e,r)}to.id="omo-meta-governor";to.server=to;var yS=to;export{yS as default};
|
|
222
|
+
|
|
223
|
+
//# debugId=4D56165EDF6D78A364756E2164756E21
|
|
224
224
|
//# sourceMappingURL=index.js.map
|