@acampkin/mcc 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +227 -0
- package/dist/index.mjs +705 -0
- package/dist-v1/index.mjs +580 -0
- package/package.json +108 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,705 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {createRequire}from'module';import ll from'process';import QI,{homedir,tmpdir,platform}from'os';import kv from'tty';import {mkdirSync,createWriteStream,createReadStream,existsSync,readFileSync,writeFileSync,chmodSync,rmSync,readdirSync,statSync,renameSync,unlinkSync,watchFile,unwatchFile,appendFileSync}from'fs';import {join,dirname,basename,resolve}from'path';import {randomUUID,randomBytes,createDecipheriv,createCipheriv,scryptSync}from'crypto';import {createServer}from'http';import {execFile,spawn}from'child_process';import {promisify}from'util';import de from'inquirer';import II from'ora';import {createInterface}from'readline';import {EventEmitter}from'events';import Az from'better-sqlite3';import'ioredis';import Te from'@inquirer/select';import me from'@inquirer/confirm';import uv from'@inquirer/input';import xI from'@inquirer/password';import {Command}from'commander';import {Readable}from'stream';import {pipeline}from'stream/promises';import {Separator,ExitPromptError,CancelPromptError}from'@inquirer/core';const require$1 = createRequire(import.meta.url);
|
|
3
|
+
var qI=Object.create;var cl=Object.defineProperty;var BI=Object.getOwnPropertyDescriptor;var HI=Object.getOwnPropertyNames;var KI=Object.getPrototypeOf,VI=Object.prototype.hasOwnProperty;var _t=(t=>typeof require$1<"u"?require$1:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require$1<"u"?require$1:e)[r]}):t)(function(t){if(typeof require$1<"u")return require$1.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var _=(t,e)=>()=>(t&&(e=t(t=0)),e);var N=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ne=(t,e)=>{for(var r in e)cl(t,r,{get:e[r],enumerable:true});},JI=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of HI(e))!VI.call(t,n)&&n!==r&&cl(t,n,{get:()=>e[n],enumerable:!(i=BI(e,n))||i.enumerable});return t};var bv=(t,e,r)=>(r=t!=null?qI(KI(t)):{},JI(cl(r,"default",{value:t,enumerable:true}),t));function YI(){let t=new Map;for(let[e,r]of Object.entries(oe)){for(let[i,n]of Object.entries(r))oe[i]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},r[i]=oe[i],t.set(n[0],n[1]);Object.defineProperty(oe,e,{value:r,enumerable:false});}return Object.defineProperty(oe,"codes",{value:t,enumerable:false}),oe.color.close="\x1B[39m",oe.bgColor.close="\x1B[49m",oe.color.ansi=$v(),oe.color.ansi256=_v(),oe.color.ansi16m=Sv(),oe.bgColor.ansi=$v(10),oe.bgColor.ansi256=_v(10),oe.bgColor.ansi16m=Sv(10),Object.defineProperties(oe,{rgbToAnsi256:{value(e,r,i){return e===r&&r===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5)},enumerable:false},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return [0,0,0];let[i]=r;i.length===3&&(i=[...i].map(o=>o+o).join(""));let n=Number.parseInt(i,16);return [n>>16&255,n>>8&255,n&255]},enumerable:false},hexToAnsi256:{value:e=>oe.rgbToAnsi256(...oe.hexToRgb(e)),enumerable:false},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,i,n;if(e>=232)r=((e-232)*10+8)/255,i=r,n=r;else {e-=16;let a=e%36;r=Math.floor(e/36)/5,i=Math.floor(a/6)/5,n=a%6/5;}let o=Math.max(r,i,n)*2;if(o===0)return 30;let s=30+(Math.round(n)<<2|Math.round(i)<<1|Math.round(r));return o===2&&(s+=60),s},enumerable:false},rgbToAnsi:{value:(e,r,i)=>oe.ansi256ToAnsi(oe.rgbToAnsi256(e,r,i)),enumerable:false},hexToAnsi:{value:e=>oe.ansi256ToAnsi(oe.hexToAnsi256(e)),enumerable:false}}),oe}var $v,_v,Sv,oe,GI,WI,XI,et,wv=_(()=>{$v=(t=0)=>e=>`\x1B[${e+t}m`,_v=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Sv=(t=0)=>(e,r,i)=>`\x1B[${38+t};2;${e};${r};${i}m`,oe={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Object.keys(oe.modifier),GI=Object.keys(oe.color),WI=Object.keys(oe.bgColor),[...GI,...WI];XI=YI(),et=XI;});function Ve(t,e=globalThis.Deno?globalThis.Deno.args:ll.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",i=e.indexOf(r+t),n=e.indexOf("--");return i!==-1&&(n===-1||i<n)}function eE(){if("FORCE_COLOR"in se)return se.FORCE_COLOR==="true"?1:se.FORCE_COLOR==="false"?0:se.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(se.FORCE_COLOR,10),3)}function tE(t){return t===0?false:{level:t,hasBasic:true,has256:t>=2,has16m:t>=3}}function nE(t,{streamIsTTY:e,sniffFlags:r=true}={}){let i=eE();i!==void 0&&(Oo=i);let n=r?Oo:i;if(n===0)return 0;if(r){if(Ve("color=16m")||Ve("color=full")||Ve("color=truecolor"))return 3;if(Ve("color=256"))return 2}if("TF_BUILD"in se&&"AGENT_NAME"in se)return 1;if(t&&!e&&n===void 0)return 0;let o=n||0;if(se.TERM==="dumb")return o;if(ll.platform==="win32"){let s=QI.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in se)return ["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in se)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in se)||se.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in se)return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(se.TEAMCITY_VERSION)?1:0;if(se.COLORTERM==="truecolor"||se.TERM==="xterm-kitty"||se.TERM==="xterm-ghostty"||se.TERM==="wezterm")return 3;if("TERM_PROGRAM"in se){let s=Number.parseInt((se.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(se.TERM_PROGRAM){case "iTerm.app":return s>=3?3:2;case "Apple_Terminal":return 2}}return /-256(color)?$/i.test(se.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(se.TERM)||"COLORTERM"in se?1:o}function xv(t,e={}){let r=nE(t,{streamIsTTY:t&&t.isTTY,...e});return tE(r)}var se,Oo,rE,Iv,Ev=_(()=>{({env:se}=ll);Ve("no-color")||Ve("no-colors")||Ve("color=false")||Ve("color=never")?Oo=0:(Ve("color")||Ve("colors")||Ve("color=true")||Ve("color=always"))&&(Oo=1);rE={stdout:xv({isTTY:kv.isatty(1)}),stderr:xv({isTTY:kv.isatty(2)})},Iv=rE;});function Tv(t,e,r){let i=t.indexOf(e);if(i===-1)return t;let n=e.length,o=0,s="";do s+=t.slice(o,i)+e+r,o=i+n,i=t.indexOf(e,o);while(i!==-1);return s+=t.slice(o),s}function Pv(t,e,r,i){let n=0,o="";do{let s=t[i-1]==="\r";o+=t.slice(n,s?i-1:i)+e+(s?`\r
|
|
4
|
+
`:`
|
|
5
|
+
`)+r,n=i+1,i=t.indexOf(`
|
|
6
|
+
`,n);}while(i!==-1);return o+=t.slice(n),o}var Ov=_(()=>{});function Zr(t){return oE(t)}var Cv,Av,ul,Rn,Fr,Nv,Dn,iE,oE,dl,sE,aE,ml,Co,cE,lE,M,St=_(()=>{wv();Ev();Ov();(({stdout:Cv,stderr:Av}=Iv)),ul=Symbol("GENERATOR"),Rn=Symbol("STYLER"),Fr=Symbol("IS_EMPTY"),Nv=["ansi","ansi","ansi256","ansi16m"],Dn=Object.create(null),iE=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=Cv?Cv.level:0;t.level=e.level===void 0?r:e.level;},oE=t=>{let e=(...r)=>r.join(" ");return iE(e,t),Object.setPrototypeOf(e,Zr.prototype),e};Object.setPrototypeOf(Zr.prototype,Function.prototype);for(let[t,e]of Object.entries(et))Dn[t]={get(){let r=Co(this,ml(e.open,e.close,this[Rn]),this[Fr]);return Object.defineProperty(this,t,{value:r}),r}};Dn.visible={get(){let t=Co(this,this[Rn],true);return Object.defineProperty(this,"visible",{value:t}),t}};dl=(t,e,r,...i)=>t==="rgb"?e==="ansi16m"?et[r].ansi16m(...i):e==="ansi256"?et[r].ansi256(et.rgbToAnsi256(...i)):et[r].ansi(et.rgbToAnsi(...i)):t==="hex"?dl("rgb",e,r,...et.hexToRgb(...i)):et[r][t](...i),sE=["rgb","hex","ansi256"];for(let t of sE){Dn[t]={get(){let{level:r}=this;return function(...i){let n=ml(dl(t,Nv[r],"color",...i),et.color.close,this[Rn]);return Co(this,n,this[Fr])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);Dn[e]={get(){let{level:r}=this;return function(...i){let n=ml(dl(t,Nv[r],"bgColor",...i),et.bgColor.close,this[Rn]);return Co(this,n,this[Fr])}}};}aE=Object.defineProperties(()=>{},{...Dn,level:{enumerable:true,get(){return this[ul].level},set(t){this[ul].level=t;}}}),ml=(t,e,r)=>{let i,n;return r===void 0?(i=t,n=e):(i=r.openAll+t,n=e+r.closeAll),{open:t,close:e,openAll:i,closeAll:n,parent:r}},Co=(t,e,r)=>{let i=(...n)=>cE(i,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(i,aE),i[ul]=t,i[Rn]=e,i[Fr]=r,i},cE=(t,e)=>{if(t.level<=0||!e)return t[Fr]?"":e;let r=t[Rn];if(r===void 0)return e;let{openAll:i,closeAll:n}=r;if(e.includes("\x1B"))for(;r!==void 0;)e=Tv(e,r.close,r.open),r=r.parent;let o=e.indexOf(`
|
|
7
|
+
`);return o!==-1&&(e=Pv(e,n,i,o)),i+e+n};Object.defineProperties(Zr.prototype,Dn);lE=Zr(),Zr({level:Av?Av.level:0}),M=lE;});function ae(t){let e=["#00D4FF","#7B61FF"],r=t.split("");return r.map((i,n)=>{let s=n/Math.max(r.length-1,1)<.5?0:1;return M.hex(e[s])(i)}).join("")}function H(t=50,e="single"){switch(e){case "double":return c.dim("\u2550".repeat(t));case "dotted":return c.dim("\u2504".repeat(t));case "gradient":return ae("\u2501".repeat(t));default:return c.dim("\u2500".repeat(t))}}function ve(t,e){let i=c.primary,n=c.dim,o=t.padEnd(52),s=e?e.padEnd(52):"",a=`
|
|
8
|
+
${i(lt.topLeft+lt.horizontal.repeat(58)+lt.topRight)}
|
|
9
|
+
${i(lt.vertical)} ${M.bold.white(o)} ${i(lt.vertical)}`;return e&&(a+=`
|
|
10
|
+
${i(lt.vertical)} ${n(s)} ${i(lt.vertical)}`),a+=`
|
|
11
|
+
${i(lt.bottomLeft+lt.horizontal.repeat(58)+lt.bottomRight)}`,a}function zv(t){let e=c.primary,r=c.accent,i=c.dim,n=c.subtle,o=t.defaultProvider??"Not set";return `
|
|
12
|
+
${e(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")}
|
|
13
|
+
${e(" \u2551")} ${e("\u2551")}
|
|
14
|
+
${e(" \u2551")} ${e.bold("\u2588\u2588\u2588\u2557 \u2588\u2588\u2557")}${r.bold("\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557")} ${e("\u2551")}
|
|
15
|
+
${e(" \u2551")} ${e.bold("\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551")}${r.bold("\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D")} ${i("Multi-Client")} ${e("\u2551")}
|
|
16
|
+
${e(" \u2551")} ${e.bold("\u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551")}${r.bold("\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2588\u2557")} ${i("Coder")} ${e("\u2551")}
|
|
17
|
+
${e(" \u2551")} ${e.bold("\u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551")}${r.bold("\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551")} ${e("\u2551")}
|
|
18
|
+
${e(" \u2551")} ${e.bold("\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551")}${r.bold("\u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D")} ${i("v"+Se)} ${e("\u2551")}
|
|
19
|
+
${e(" \u2551")} ${e.bold("\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D")}${r.bold("\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D")} ${e("\u2551")}
|
|
20
|
+
${e(" \u2551")} ${e("\u2551")}
|
|
21
|
+
${e(" \u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563")}
|
|
22
|
+
${e(" \u2551")} ${e("\u2551")}
|
|
23
|
+
${e(" \u2551")} ${i("Providers:")} ${n(String(t.enabled))} ${i("enabled /")} ${n(String(t.total))} ${i("total")} ${e("\u2551")}
|
|
24
|
+
${e(" \u2551")} ${i("Default:")} ${r(o.substring(0,35).padEnd(35))} ${e("\u2551")}
|
|
25
|
+
${e(" \u2551")} ${e("\u2551")}
|
|
26
|
+
${e(" \u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563")}
|
|
27
|
+
${e(" \u2551")} ${i("Built by")} ${ae("Velocity Digital")} ${i("\u2022")} ${i("velocitydigi.com")} ${e("\u2551")}
|
|
28
|
+
${e(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")}
|
|
29
|
+
`}function ce(){return `
|
|
30
|
+
${c.dim("\u2500".repeat(60))}
|
|
31
|
+
${c.dim("Built by")} ${ae("Velocity Digital")} ${c.dim("\u2022")} ${c.primary("v"+Se)} ${c.dim("\u2022")} ${c.dim(uE)}
|
|
32
|
+
`}function Lv(t){let e=t?Rv.slice(0,t):Rv,r=`
|
|
33
|
+
${ve("Changelog","Version History")}
|
|
34
|
+
`;for(let i of e){r+=`
|
|
35
|
+
${c.primary.bold("v"+i.version)} ${c.dim("\u2500")} ${c.subtle(i.date)}
|
|
36
|
+
${M.white.bold(i.title)}
|
|
37
|
+
`;for(let n of i.changes)r+=` ${c.dim("\u2022")} ${c.subtle(n)}
|
|
38
|
+
`;}return r+=ce(),r}var Se,uE,Dv,Mv,Rv,c,lt,$,fl,qe=_(()=>{St();Se="2.1.0",uE="2026-02-20",Dv="Multi-Client Coder",Mv="Session-aware Claude launcher with autopilot",Rv=[{version:"2.1.0",date:"2026-02-20",title:"Claude Agent SDK Integration & Release Preparation",changes:["Added Claude Agent SDK native provider type (agent-sdk)","Updated model catalog with Claude 4.6 (Opus 4.6, Sonnet 4.6)","Bundle size optimization: V1 minification enabled","Lazy-loaded update dependencies for smaller core bundle","Externalized orchestration deps in V1 build","Excluded sourcemaps from npm package","Updated package to scoped name: @velocity-digital/mcc","Removed unused dependencies (diff package)","Updated model pricing for all Claude 4.x models"]},{version:"2.0.0",date:"2025-01-29",title:"Multi-Client Coder - Major Refactor",changes:['Rebranded from "Model Context Configurator" to "Multi-Client Coder"',"Session recovery and context transfer between sessions","Built-in autopilot mode for autonomous execution","Simplified UI (66% reduction in menu verbosity)","New command structure: launch, resume, sessions, autopilot","Workspace-aware session management","2-color gradient (cyan to violet) for cleaner branding"]},{version:"1.0.0",date:"2026-01-26",title:"Stable V1 Release",changes:["Dual-build system (v1 stable + development)","V1 excludes AI orchestration features (spawn, fan-out, pipe, batch)","V1 provides stable core: provider management, health checks, credential storage","Development build continues with full orchestration for testing","Both builds operate side-by-side without conflicts","New package scripts: build:v1, link:v1, release:v1","Export paths: ./dist (dev) and ./dist-v1 (v1)","Binaries: mcc (dev) and mcc-v1 (v1 stable)"]},{version:"0.7a",date:"2026-01-24",title:"Cache Layer, Headless Mode & Polish",changes:["Memory + Redis cache layer with TTL, prefix isolation, and response caching","Headless multi-agent orchestration (process pool, bus, router, state machine)","Inter-agent communication protocol with typed message channels","Deployment bundle via tsup (single .mjs, ~1MB)","Vitest test framework with 54 unit tests","Technical debt remediation (errorMessage utility, regex injection fix)","Lint warnings reduced from 33 to 5 (nullish coalescing batch-fix)","Launcher UI polish with branding gradient and icons"]},{version:"0.6a",date:"2026-01-22",title:"Visual Refresh & Branding",changes:["Complete CLI visual overhaul with Velocity Digital branding","New gradient headers and animated spinners","Added changelog command and version history","Enhanced provider status indicators with pulse effect","Improved credential management UI"]},{version:"0.5a",date:"2026-01-22",title:"SDK Integration Research",changes:["Investigated @anthropic-ai/claude-code SDK integration","Confirmed CLI-based spawning as correct approach","Removed unnecessary credential validation (sk-ant- prefix)","Verified environment variable passthrough"]},{version:"0.4a",date:"2026-01-21",title:"Interactive Menu System",changes:["Full interactive menu with provider selection","Model selection before launch","Provider setup wizard for disabled providers","Help screen with quick start guide","Settings menu for credential management"]},{version:"0.3a",date:"2026-01-21",title:"Health Check System",changes:["Per-provider health checking with retry logic","Error categorization (network, auth, server, config, timeout)","Configurable timeouts per provider","Verbose mode with actionable suggestions","Loading spinners during health checks"]},{version:"0.2a",date:"2026-01-21",title:"Encrypted Credentials",changes:["AES-256-GCM encrypted credential store","Environment variable fallback support","Credential manager in settings menu","Secure storage at ~/.config/mcc/.credentials"]},{version:"0.1a",date:"2026-01-20",title:"Initial Release",changes:["Multi-provider support (Anthropic, Z.AI, MiniMax, Local)","YAML-based configuration","Basic CLI with list, health, test, config commands","Claude Code launcher with environment setup"]}],c={primary:M.hex("#00D4FF"),primaryDark:M.hex("#0099CC"),accent:M.hex("#FF00FF"),accentDark:M.hex("#CC00CC"),success:M.hex("#00FF88"),warning:M.hex("#FFD700"),error:M.hex("#FF4444"),info:M.hex("#00BFFF"),dim:M.hex("#666666"),muted:M.hex("#888888"),subtle:M.hex("#AAAAAA"),velocity:M.hex("#00D4FF"),digital:M.hex("#FF00FF")},lt={topLeft:"\u2554",topRight:"\u2557",bottomLeft:"\u255A",bottomRight:"\u255D",horizontal:"\u2550",vertical:"\u2551"},$={success:c.success("\u2714"),error:c.error("\u2716"),warning:c.warning("\u26A0"),info:c.info("\u2139"),enabled:c.success("\u25CF"),disabled:c.dim("\u25CB"),pending:c.warning("\u25D0"),launch:c.primary("\u25B6"),settings:c.muted("\u2699"),help:c.info("?"),back:c.dim("\u2190"),radar:c.info("\u{1F4E1}"),coins:c.warning("$"),star:c.warning("\u2605"),bolt:c.primary("\u26A1"),key:c.warning("\u{1F511}"),lock:c.success("\u{1F512}"),globe:c.info("\u{1F310}"),rocket:c.accent("\u{1F680}"),sparkle:c.accent("\u2728"),terminal:c.dim("\u2328")};fl={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},pulse:{interval:100,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},velocity:{interval:120,frames:["\u26A1","\u2728","\u{1F4AB}","\u2B50","\u{1F4AB}","\u2728"]}};});var K=N(we=>{var gl=Symbol.for("yaml.alias"),Jv=Symbol.for("yaml.document"),Ao=Symbol.for("yaml.map"),Gv=Symbol.for("yaml.pair"),hl=Symbol.for("yaml.scalar"),No=Symbol.for("yaml.seq"),wt=Symbol.for("yaml.node.type"),NE=t=>!!t&&typeof t=="object"&&t[wt]===gl,RE=t=>!!t&&typeof t=="object"&&t[wt]===Jv,DE=t=>!!t&&typeof t=="object"&&t[wt]===Ao,ME=t=>!!t&&typeof t=="object"&&t[wt]===Gv,Wv=t=>!!t&&typeof t=="object"&&t[wt]===hl,zE=t=>!!t&&typeof t=="object"&&t[wt]===No;function Yv(t){if(t&&typeof t=="object")switch(t[wt]){case Ao:case No:return true}return false}function LE(t){if(t&&typeof t=="object")switch(t[wt]){case gl:case Ao:case hl:case No:return true}return false}var jE=t=>(Wv(t)||Yv(t))&&!!t.anchor;we.ALIAS=gl;we.DOC=Jv;we.MAP=Ao;we.NODE_TYPE=wt;we.PAIR=Gv;we.SCALAR=hl;we.SEQ=No;we.hasAnchor=jE;we.isAlias=NE;we.isCollection=Yv;we.isDocument=RE;we.isMap=DE;we.isNode=LE;we.isPair=ME;we.isScalar=Wv;we.isSeq=zE;});var qr=N(vl=>{var ye=K(),De=Symbol("break visit"),Xv=Symbol("skip children"),dt=Symbol("remove node");function Ro(t,e){let r=Qv(e);ye.isDocument(t)?Mn(null,t.contents,r,Object.freeze([t]))===dt&&(t.contents=null):Mn(null,t,r,Object.freeze([]));}Ro.BREAK=De;Ro.SKIP=Xv;Ro.REMOVE=dt;function Mn(t,e,r,i){let n=ey(t,e,r,i);if(ye.isNode(n)||ye.isPair(n))return ty(t,i,n),Mn(t,n,r,i);if(typeof n!="symbol"){if(ye.isCollection(e)){i=Object.freeze(i.concat(e));for(let o=0;o<e.items.length;++o){let s=Mn(o,e.items[o],r,i);if(typeof s=="number")o=s-1;else {if(s===De)return De;s===dt&&(e.items.splice(o,1),o-=1);}}}else if(ye.isPair(e)){i=Object.freeze(i.concat(e));let o=Mn("key",e.key,r,i);if(o===De)return De;o===dt&&(e.key=null);let s=Mn("value",e.value,r,i);if(s===De)return De;s===dt&&(e.value=null);}}return n}async function Do(t,e){let r=Qv(e);ye.isDocument(t)?await zn(null,t.contents,r,Object.freeze([t]))===dt&&(t.contents=null):await zn(null,t,r,Object.freeze([]));}Do.BREAK=De;Do.SKIP=Xv;Do.REMOVE=dt;async function zn(t,e,r,i){let n=await ey(t,e,r,i);if(ye.isNode(n)||ye.isPair(n))return ty(t,i,n),zn(t,n,r,i);if(typeof n!="symbol"){if(ye.isCollection(e)){i=Object.freeze(i.concat(e));for(let o=0;o<e.items.length;++o){let s=await zn(o,e.items[o],r,i);if(typeof s=="number")o=s-1;else {if(s===De)return De;s===dt&&(e.items.splice(o,1),o-=1);}}}else if(ye.isPair(e)){i=Object.freeze(i.concat(e));let o=await zn("key",e.key,r,i);if(o===De)return De;o===dt&&(e.key=null);let s=await zn("value",e.value,r,i);if(s===De)return De;s===dt&&(e.value=null);}}return n}function Qv(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function ey(t,e,r,i){if(typeof r=="function")return r(t,e,i);if(ye.isMap(e))return r.Map?.(t,e,i);if(ye.isSeq(e))return r.Seq?.(t,e,i);if(ye.isPair(e))return r.Pair?.(t,e,i);if(ye.isScalar(e))return r.Scalar?.(t,e,i);if(ye.isAlias(e))return r.Alias?.(t,e,i)}function ty(t,e,r){let i=e[e.length-1];if(ye.isCollection(i))i.items[t]=r;else if(ye.isPair(i))t==="key"?i.key=r:i.value=r;else if(ye.isDocument(i))i.contents=r;else {let n=ye.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${n} parent`)}}vl.visit=Ro;vl.visitAsync=Do;});var yl=N(ry=>{var ny=K(),UE=qr(),FE={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},ZE=t=>t.replace(/[!,[\]{}]/g,e=>FE[e]),Br=class t{constructor(e,r){this.docStart=null,this.docEnd=false,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r);}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case "1.1":this.atNextDocument=true;break;case "1.2":this.atNextDocument=false,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=false);let i=e.trim().split(/[ \t]+/),n=i.shift();switch(n){case "%TAG":{if(i.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),i.length<2))return false;let[o,s]=i;return this.tags[o]=s,true}case "%YAML":{if(this.yaml.explicit=true,i.length!==1)return r(0,"%YAML directive should contain exactly one part"),false;let[o]=i;if(o==="1.1"||o==="1.2")return this.yaml.version=o,true;{let s=/^\d+\.\d+$/.test(o);return r(6,`Unsupported YAML version ${o}`,s),false}}default:return r(0,`Unknown directive ${n}`,true),false}}tagName(e,r){if(e==="!")return "!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);return s==="!"||s==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),s)}let[,i,n]=e.match(/^(.*!)([^!]*)$/s);n||r(`The ${e} tag has no suffix`);let o=this.tags[i];if(o)try{return o+decodeURIComponent(n)}catch(s){return r(String(s)),null}return i==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,i]of Object.entries(this.tags))if(e.startsWith(i))return r+ZE(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),n;if(e&&i.length>0&&ny.isNode(e.contents)){let o={};UE.visit(e.contents,(s,a)=>{ny.isNode(a)&&a.tag&&(o[a.tag]=true);}),n=Object.keys(o);}else n=[];for(let[o,s]of i)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||n.some(a=>a.startsWith(s)))&&r.push(`%TAG ${o} ${s}`);return r.join(`
|
|
39
|
+
`)}};Br.defaultYaml={explicit:false,version:"1.2"};Br.defaultTags={"!!":"tag:yaml.org,2002:"};ry.Directives=Br;});var Mo=N(Hr=>{var iy=K(),qE=qr();function BE(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return true}function oy(t){let e=new Set;return qE.visit(t,{Value(r,i){i.anchor&&e.add(i.anchor);}}),e}function sy(t,e){for(let r=1;;++r){let i=`${t}${r}`;if(!e.has(i))return i}}function HE(t,e){let r=[],i=new Map,n=null;return {onAnchor:o=>{r.push(o),n??(n=oy(t));let s=sy(e,n);return n.add(s),s},setAnchors:()=>{for(let o of r){let s=i.get(o);if(typeof s=="object"&&s.anchor&&(iy.isScalar(s.node)||iy.isCollection(s.node)))s.node.anchor=s.anchor;else {let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:i}}Hr.anchorIsValid=BE;Hr.anchorNames=oy;Hr.createNodeAnchors=HE;Hr.findNewAnchor=sy;});var bl=N(ay=>{function Kr(t,e,r,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let n=0,o=i.length;n<o;++n){let s=i[n],a=Kr(t,i,String(n),s);a===void 0?delete i[n]:a!==s&&(i[n]=a);}else if(i instanceof Map)for(let n of Array.from(i.keys())){let o=i.get(n),s=Kr(t,i,n,o);s===void 0?i.delete(n):s!==o&&i.set(n,s);}else if(i instanceof Set)for(let n of Array.from(i)){let o=Kr(t,i,n,n);o===void 0?i.delete(n):o!==n&&(i.delete(n),i.add(o));}else for(let[n,o]of Object.entries(i)){let s=Kr(t,i,n,o);s===void 0?delete i[n]:s!==o&&(i[n]=s);}return t.call(e,r,i)}ay.applyReviver=Kr;});var Ct=N(ly=>{var KE=K();function cy(t,e,r){if(Array.isArray(t))return t.map((i,n)=>cy(i,String(n),r));if(t&&typeof t.toJSON=="function"){if(!r||!KE.hasAnchor(t))return t.toJSON(e,r);let i={aliasCount:0,count:1,res:void 0};r.anchors.set(t,i),r.onCreate=o=>{i.res=o,delete r.onCreate;};let n=t.toJSON(e,r);return r.onCreate&&r.onCreate(n),n}return typeof t=="bigint"&&!r?.keep?Number(t):t}ly.toJS=cy;});var zo=N(dy=>{var VE=bl(),uy=K(),JE=Ct(),$l=class{constructor(e){Object.defineProperty(this,uy.NODE_TYPE,{value:e});}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:i,onAnchor:n,reviver:o}={}){if(!uy.isDocument(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:true,mapAsMap:r===true,mapKeyWarned:false,maxAliasCount:typeof i=="number"?i:100},a=JE.toJS(this,"",s);if(typeof n=="function")for(let{count:l,res:u}of s.anchors.values())n(u,l);return typeof o=="function"?VE.applyReviver(o,{"":a},"",a):a}};dy.NodeBase=$l;});var Vr=N(my=>{var GE=Mo(),WE=qr(),Ln=K(),YE=zo(),XE=Ct(),_l=class extends YE.NodeBase{constructor(e){super(Ln.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}});}resolve(e,r){let i;r?.aliasResolveCache?i=r.aliasResolveCache:(i=[],WE.visit(e,{Node:(o,s)=>{(Ln.isAlias(s)||Ln.hasAnchor(s))&&i.push(s);}}),r&&(r.aliasResolveCache=i));let n;for(let o of i){if(o===this)break;o.anchor===this.source&&(n=o);}return n}toJSON(e,r){if(!r)return {source:this.source};let{anchors:i,doc:n,maxAliasCount:o}=r,s=this.resolve(n,r);if(!s){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=i.get(s);if(a||(XE.toJS(s,null,r),a=i.get(s)),a?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Lo(n,s,i)),a.count*a.aliasCount>o)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,r,i){let n=`*${this.source}`;if(e){if(GE.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return `${n} `}return n}};function Lo(t,e,r){if(Ln.isAlias(e)){let i=e.resolve(t),n=r&&i&&r.get(i);return n?n.count*n.aliasCount:0}else if(Ln.isCollection(e)){let i=0;for(let n of e.items){let o=Lo(t,n,r);o>i&&(i=o);}return i}else if(Ln.isPair(e)){let i=Lo(t,e.key,r),n=Lo(t,e.value,r);return Math.max(i,n)}return 1}my.Alias=_l;});var fe=N(Sl=>{var QE=K(),e0=zo(),t0=Ct(),n0=t=>!t||typeof t!="function"&&typeof t!="object",At=class extends e0.NodeBase{constructor(e){super(QE.SCALAR),this.value=e;}toJSON(e,r){return r?.keep?this.value:t0.toJS(this.value,e,r)}toString(){return String(this.value)}};At.BLOCK_FOLDED="BLOCK_FOLDED";At.BLOCK_LITERAL="BLOCK_LITERAL";At.PLAIN="PLAIN";At.QUOTE_DOUBLE="QUOTE_DOUBLE";At.QUOTE_SINGLE="QUOTE_SINGLE";Sl.Scalar=At;Sl.isScalarValue=n0;});var Jr=N(py=>{var r0=Vr(),nn=K(),fy=fe(),i0="tag:yaml.org,2002:";function o0(t,e,r){if(e){let i=r.filter(o=>o.tag===e),n=i.find(o=>!o.format)??i[0];if(!n)throw new Error(`Tag ${e} not found`);return n}return r.find(i=>i.identify?.(t)&&!i.format)}function s0(t,e,r){if(nn.isDocument(t)&&(t=t.contents),nn.isNode(t))return t;if(nn.isPair(t)){let m=r.schema[nn.MAP].createNode?.(r.schema,null,r);return m.items.push(t),m}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:i,onAnchor:n,onTagObj:o,schema:s,sourceObjects:a}=r,l;if(i&&t&&typeof t=="object"){if(l=a.get(t),l)return l.anchor??(l.anchor=n(t)),new r0.Alias(l.anchor);l={anchor:null,node:null},a.set(t,l);}e?.startsWith("!!")&&(e=i0+e.slice(2));let u=o0(t,e,s.tags);if(!u){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let m=new fy.Scalar(t);return l&&(l.node=m),m}u=t instanceof Map?s[nn.MAP]:Symbol.iterator in Object(t)?s[nn.SEQ]:s[nn.MAP];}o&&(o(u),delete r.onTagObj);let d=u?.createNode?u.createNode(r.schema,t,r):typeof u?.nodeClass?.from=="function"?u.nodeClass.from(r.schema,t,r):new fy.Scalar(t);return e?d.tag=e:u.default||(d.tag=u.tag),l&&(l.node=d),d}py.createNode=s0;});var Uo=N(jo=>{var a0=Jr(),mt=K(),c0=zo();function wl(t,e,r){let i=r;for(let n=e.length-1;n>=0;--n){let o=e[n];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=i,i=s;}else i=new Map([[o,i]]);}return a0.createNode(i,void 0,{aliasDuplicateObjects:false,keepUndefined:false,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var gy=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,kl=class extends c0.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:true,enumerable:false,writable:true});}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(i=>mt.isNode(i)||mt.isPair(i)?i.clone(e):i),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(gy(e))this.add(r);else {let[i,...n]=e,o=this.get(i,true);if(mt.isCollection(o))o.addIn(n,r);else if(o===void 0&&this.schema)this.set(i,wl(this.schema,n,r));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}deleteIn(e){let[r,...i]=e;if(i.length===0)return this.delete(r);let n=this.get(r,true);if(mt.isCollection(n))return n.deleteIn(i);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}getIn(e,r){let[i,...n]=e,o=this.get(i,true);return n.length===0?!r&&mt.isScalar(o)?o.value:o:mt.isCollection(o)?o.getIn(n,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!mt.isPair(r))return false;let i=r.value;return i==null||e&&mt.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[r,...i]=e;if(i.length===0)return this.has(r);let n=this.get(r,true);return mt.isCollection(n)?n.hasIn(i):false}setIn(e,r){let[i,...n]=e;if(n.length===0)this.set(i,r);else {let o=this.get(i,true);if(mt.isCollection(o))o.setIn(n,r);else if(o===void 0&&this.schema)this.set(i,wl(this.schema,n,r));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}};jo.Collection=kl;jo.collectionFromPath=wl;jo.isEmptyPath=gy;});var Gr=N(Fo=>{var l0=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function xl(t,e){return /^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var u0=(t,e,r)=>t.endsWith(`
|
|
40
|
+
`)?xl(r,e):r.includes(`
|
|
41
|
+
`)?`
|
|
42
|
+
`+xl(r,e):(t.endsWith(" ")?"":" ")+r;Fo.indentComment=xl;Fo.lineComment=u0;Fo.stringifyComment=l0;});var vy=N(Wr=>{var d0="flow",Il="block",Zo="quoted";function m0(t,e,r="flow",{indentAtStart:i,lineWidth:n=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!n||n<0)return t;n<o&&(o=0);let l=Math.max(1+o,1+n-e.length);if(t.length<=l)return t;let u=[],d={},m=n-e.length;typeof i=="number"&&(i>n-Math.max(2,o)?u.push(0):m=n-i);let f,p,v=false,g=-1,y=-1,S=-1;r===Il&&(g=hy(t,g,e.length),g!==-1&&(m=g+l));for(let T;T=t[g+=1];){if(r===Zo&&T==="\\"){switch(y=g,t[g+1]){case "x":g+=3;break;case "u":g+=5;break;case "U":g+=9;break;default:g+=1;}S=g;}if(T===`
|
|
43
|
+
`)r===Il&&(g=hy(t,g,e.length)),m=g+e.length+l,f=void 0;else {if(T===" "&&p&&p!==" "&&p!==`
|
|
44
|
+
`&&p!==" "){let C=t[g+1];C&&C!==" "&&C!==`
|
|
45
|
+
`&&C!==" "&&(f=g);}if(g>=m)if(f)u.push(f),m=f+l,f=void 0;else if(r===Zo){for(;p===" "||p===" ";)p=T,T=t[g+=1],v=true;let C=g>S+1?g-2:y-1;if(d[C])return t;u.push(C),d[C]=true,m=C+l,f=void 0;}else v=true;}p=T;}if(v&&a&&a(),u.length===0)return t;s&&s();let E=t.slice(0,u[0]);for(let T=0;T<u.length;++T){let C=u[T],P=u[T+1]||t.length;C===0?E=`
|
|
46
|
+
${e}${t.slice(0,P)}`:(r===Zo&&d[C]&&(E+=`${t[C]}\\`),E+=`
|
|
47
|
+
${e}${t.slice(C+1,P)}`);}return E}function hy(t,e,r){let i=e,n=e+1,o=t[n];for(;o===" "||o===" ";)if(e<n+r)o=t[++e];else {do o=t[++e];while(o&&o!==`
|
|
48
|
+
`);i=e,n=e+1,o=t[n];}return i}Wr.FOLD_BLOCK=Il;Wr.FOLD_FLOW=d0;Wr.FOLD_QUOTED=Zo;Wr.foldFlowLines=m0;});var Xr=N(yy=>{var tt=fe(),Nt=vy(),Bo=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Ho=t=>/^(%|---|\.\.\.)/m.test(t);function f0(t,e,r){if(!e||e<0)return false;let i=e-r,n=t.length;if(n<=i)return false;for(let o=0,s=0;o<n;++o)if(t[o]===`
|
|
49
|
+
`){if(o-s>i)return true;if(s=o+1,n-s<=i)return false}return true}function Yr(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:i}=e,n=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(Ho(t)?" ":""),s="",a=0;for(let l=0,u=r[l];u;u=r[++l])if(u===" "&&r[l+1]==="\\"&&r[l+2]==="n"&&(s+=r.slice(a,l)+"\\ ",l+=1,a=l,u="\\"),u==="\\")switch(r[l+1]){case "u":{s+=r.slice(a,l);let d=r.substr(l+2,4);switch(d){case "0000":s+="\\0";break;case "0007":s+="\\a";break;case "000b":s+="\\v";break;case "001b":s+="\\e";break;case "0085":s+="\\N";break;case "00a0":s+="\\_";break;case "2028":s+="\\L";break;case "2029":s+="\\P";break;default:d.substr(0,2)==="00"?s+="\\x"+d.substr(2):s+=r.substr(l,6);}l+=5,a=l+1;}break;case "n":if(i||r[l+2]==='"'||r.length<n)l+=1;else {for(s+=r.slice(a,l)+`
|
|
50
|
+
|
|
51
|
+
`;r[l+2]==="\\"&&r[l+3]==="n"&&r[l+4]!=='"';)s+=`
|
|
52
|
+
`,l+=2;s+=o,r[l+2]===" "&&(s+="\\"),l+=1,a=l+1;}break;default:l+=1;}return s=a?s+r.slice(a):r,i?s:Nt.foldFlowLines(s,o,Nt.FOLD_QUOTED,Bo(e,false))}function El(t,e){if(e.options.singleQuote===false||e.implicitKey&&t.includes(`
|
|
53
|
+
`)||/[ \t]\n|\n[ \t]/.test(t))return Yr(t,e);let r=e.indent||(Ho(t)?" ":""),i="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
54
|
+
${r}`)+"'";return e.implicitKey?i:Nt.foldFlowLines(i,r,Nt.FOLD_FLOW,Bo(e,false))}function jn(t,e){let{singleQuote:r}=e.options,i;if(r===false)i=Yr;else {let n=t.includes('"'),o=t.includes("'");n&&!o?i=El:o&&!n?i=Yr:i=r?El:Yr;}return i(t,e)}var Tl;try{Tl=new RegExp(`(^|(?<!
|
|
55
|
+
))
|
|
56
|
+
+(?!
|
|
57
|
+
|$)`,"g");}catch{Tl=/\n+(?!\n|$)/g;}function qo({comment:t,type:e,value:r},i,n,o){let{blockQuote:s,commentString:a,lineWidth:l}=i.options;if(!s||/\n[\t ]+$/.test(r))return jn(r,i);let u=i.indent||(i.forceBlockIndent||Ho(r)?" ":""),d=s==="literal"?true:s==="folded"||e===tt.Scalar.BLOCK_FOLDED?false:e===tt.Scalar.BLOCK_LITERAL?true:!f0(r,l,u.length);if(!r)return d?`|
|
|
58
|
+
`:`>
|
|
59
|
+
`;let m,f;for(f=r.length;f>0;--f){let P=r[f-1];if(P!==`
|
|
60
|
+
`&&P!==" "&&P!==" ")break}let p=r.substring(f),v=p.indexOf(`
|
|
61
|
+
`);v===-1?m="-":r===p||v!==p.length-1?(m="+",o&&o()):m="",p&&(r=r.slice(0,-p.length),p[p.length-1]===`
|
|
62
|
+
`&&(p=p.slice(0,-1)),p=p.replace(Tl,`$&${u}`));let g=false,y,S=-1;for(y=0;y<r.length;++y){let P=r[y];if(P===" ")g=true;else if(P===`
|
|
63
|
+
`)S=y;else break}let E=r.substring(0,S<y?S+1:y);E&&(r=r.substring(E.length),E=E.replace(/\n+/g,`$&${u}`));let C=(g?u?"2":"1":"")+m;if(t&&(C+=" "+a(t.replace(/ ?[\r\n]+/g," ")),n&&n()),!d){let P=r.replace(/\n+/g,`
|
|
64
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`),L=false,V=Bo(i,true);s!=="folded"&&e!==tt.Scalar.BLOCK_FOLDED&&(V.onOverflow=()=>{L=true;});let O=Nt.foldFlowLines(`${E}${P}${p}`,u,Nt.FOLD_BLOCK,V);if(!L)return `>${C}
|
|
65
|
+
${u}${O}`}return r=r.replace(/\n+/g,`$&${u}`),`|${C}
|
|
66
|
+
${u}${E}${r}${p}`}function p0(t,e,r,i){let{type:n,value:o}=t,{actualString:s,implicitKey:a,indent:l,indentStep:u,inFlow:d}=e;if(a&&o.includes(`
|
|
67
|
+
`)||d&&/[[\]{},]/.test(o))return jn(o,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||d||!o.includes(`
|
|
68
|
+
`)?jn(o,e):qo(t,e,r,i);if(!a&&!d&&n!==tt.Scalar.PLAIN&&o.includes(`
|
|
69
|
+
`))return qo(t,e,r,i);if(Ho(o)){if(l==="")return e.forceBlockIndent=true,qo(t,e,r,i);if(a&&l===u)return jn(o,e)}let m=o.replace(/\n+/g,`$&
|
|
70
|
+
${l}`);if(s){let f=g=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(m),{compat:p,tags:v}=e.doc.schema;if(v.some(f)||p?.some(f))return jn(o,e)}return a?m:Nt.foldFlowLines(m,l,Nt.FOLD_FLOW,Bo(e,false))}function g0(t,e,r,i){let{implicitKey:n,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==tt.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=tt.Scalar.QUOTE_DOUBLE);let l=d=>{switch(d){case tt.Scalar.BLOCK_FOLDED:case tt.Scalar.BLOCK_LITERAL:return n||o?jn(s.value,e):qo(s,e,r,i);case tt.Scalar.QUOTE_DOUBLE:return Yr(s.value,e);case tt.Scalar.QUOTE_SINGLE:return El(s.value,e);case tt.Scalar.PLAIN:return p0(s,e,r,i);default:return null}},u=l(a);if(u===null){let{defaultKeyType:d,defaultStringType:m}=e.options,f=n&&d||m;if(u=l(f),u===null)throw new Error(`Unsupported default string type ${f}`)}return u}yy.stringifyString=g0;});var Qr=N(Pl=>{var h0=Mo(),Rt=K(),v0=Gr(),y0=Xr();function b0(t,e){let r=Object.assign({blockQuote:true,commentString:v0.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:false,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:true,indentSeq:true,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:false,singleQuote:null,trueStr:"true",verifyAliasOrder:true},t.schema.toStringOptions,e),i;switch(r.collectionStyle){case "block":i=false;break;case "flow":i=true;break;default:i=null;}return {anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:i,options:r}}function $0(t,e){if(e.tag){let n=t.filter(o=>o.tag===e.tag);if(n.length>0)return n.find(o=>o.format===e.format)??n[0]}let r,i;if(Rt.isScalar(e)){i=e.value;let n=t.filter(o=>o.identify?.(i));if(n.length>1){let o=n.filter(s=>s.test);o.length>0&&(n=o);}r=n.find(o=>o.format===e.format)??n.find(o=>!o.format);}else i=e,r=t.find(n=>n.nodeClass&&i instanceof n.nodeClass);if(!r){let n=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${n} value`)}return r}function _0(t,e,{anchors:r,doc:i}){if(!i.directives)return "";let n=[],o=(Rt.isScalar(t)||Rt.isCollection(t))&&t.anchor;o&&h0.anchorIsValid(o)&&(r.add(o),n.push(`&${o}`));let s=t.tag??(e.default?null:e.tag);return s&&n.push(i.directives.tagString(s)),n.join(" ")}function S0(t,e,r,i){if(Rt.isPair(t))return t.toString(e,r,i);if(Rt.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc);}let n,o=Rt.isNode(t)?t:e.doc.createNode(t,{onTagObj:l=>n=l});n??(n=$0(e.doc.schema.tags,o));let s=_0(o,n,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let a=typeof n.stringify=="function"?n.stringify(o,e,r,i):Rt.isScalar(o)?y0.stringifyString(o,e,r,i):o.toString(e,r,i);return s?Rt.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s}
|
|
71
|
+
${e.indent}${a}`:a}Pl.createStringifyContext=b0;Pl.stringify=S0;});var Sy=N(_y=>{var kt=K(),by=fe(),$y=Qr(),ei=Gr();function w0({key:t,value:e},r,i,n){let{allNullValues:o,doc:s,indent:a,indentStep:l,options:{commentString:u,indentSeq:d,simpleKeys:m}}=r,f=kt.isNode(t)&&t.comment||null;if(m){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(kt.isCollection(t)||!kt.isNode(t)&&typeof t=="object"){let V="With simple keys, collection cannot be used as a key value";throw new Error(V)}}let p=!m&&(!t||f&&e==null&&!r.inFlow||kt.isCollection(t)||(kt.isScalar(t)?t.type===by.Scalar.BLOCK_FOLDED||t.type===by.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:false,implicitKey:!p&&(m||!o),indent:a+l});let v=false,g=false,y=$y.stringify(t,r,()=>v=true,()=>g=true);if(!p&&!r.inFlow&&y.length>1024){if(m)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=true;}if(r.inFlow){if(o||e==null)return v&&i&&i(),y===""?"?":p?`? ${y}`:y}else if(o&&!m||e==null&&p)return y=`? ${y}`,f&&!v?y+=ei.lineComment(y,r.indent,u(f)):g&&n&&n(),y;v&&(f=null),p?(f&&(y+=ei.lineComment(y,r.indent,u(f))),y=`? ${y}
|
|
72
|
+
${a}:`):(y=`${y}:`,f&&(y+=ei.lineComment(y,r.indent,u(f))));let S,E,T;kt.isNode(e)?(S=!!e.spaceBefore,E=e.commentBefore,T=e.comment):(S=false,E=null,T=null,e&&typeof e=="object"&&(e=s.createNode(e))),r.implicitKey=false,!p&&!f&&kt.isScalar(e)&&(r.indentAtStart=y.length+1),g=false,!d&&l.length>=2&&!r.inFlow&&!p&&kt.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let C=false,P=$y.stringify(e,r,()=>C=true,()=>g=true),L=" ";if(f||S||E){if(L=S?`
|
|
73
|
+
`:"",E){let V=u(E);L+=`
|
|
74
|
+
${ei.indentComment(V,r.indent)}`;}P===""&&!r.inFlow?L===`
|
|
75
|
+
`&&T&&(L=`
|
|
76
|
+
|
|
77
|
+
`):L+=`
|
|
78
|
+
${r.indent}`;}else if(!p&&kt.isCollection(e)){let V=P[0],O=P.indexOf(`
|
|
79
|
+
`),re=O!==-1,ct=r.inFlow??e.flow??e.items.length===0;if(re||!ct){let Oe=false;if(re&&(V==="&"||V==="!")){let ie=P.indexOf(" ");V==="&"&&ie!==-1&&ie<O&&P[ie+1]==="!"&&(ie=P.indexOf(" ",ie+1)),(ie===-1||O<ie)&&(Oe=true);}Oe||(L=`
|
|
80
|
+
${r.indent}`);}}else (P===""||P[0]===`
|
|
81
|
+
`)&&(L="");return y+=L+P,r.inFlow?C&&i&&i():T&&!C?y+=ei.lineComment(y,r.indent,u(T)):g&&n&&n(),y}_y.stringifyPair=w0;});var Cl=N(Ol=>{var wy=_t("process");function k0(t,...e){t==="debug"&&console.log(...e);}function x0(t,e){(t==="debug"||t==="warn")&&(typeof wy.emitWarning=="function"?wy.emitWarning(e):console.warn(e));}Ol.debug=k0;Ol.warn=x0;});var Go=N(Jo=>{var ti=K(),ky=fe(),Ko="<<",Vo={identify:t=>t===Ko||typeof t=="symbol"&&t.description===Ko,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ky.Scalar(Symbol(Ko)),{addToJSMap:xy}),stringify:()=>Ko},I0=(t,e)=>(Vo.identify(e)||ti.isScalar(e)&&(!e.type||e.type===ky.Scalar.PLAIN)&&Vo.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===Vo.tag&&r.default);function xy(t,e,r){if(r=t&&ti.isAlias(r)?r.resolve(t.doc):r,ti.isSeq(r))for(let i of r.items)Al(t,e,i);else if(Array.isArray(r))for(let i of r)Al(t,e,i);else Al(t,e,r);}function Al(t,e,r){let i=t&&ti.isAlias(r)?r.resolve(t.doc):r;if(!ti.isMap(i))throw new Error("Merge sources must be maps or map aliases");let n=i.toJSON(null,t,Map);for(let[o,s]of n)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:true,enumerable:true,configurable:true});return e}Jo.addMergeToJSMap=xy;Jo.isMergeKey=I0;Jo.merge=Vo;});var Rl=N(Ty=>{var E0=Cl(),Iy=Go(),T0=Qr(),Ey=K(),Nl=Ct();function P0(t,e,{key:r,value:i}){if(Ey.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,i);else if(Iy.isMergeKey(t,r))Iy.addMergeToJSMap(t,e,i);else {let n=Nl.toJS(r,"",t);if(e instanceof Map)e.set(n,Nl.toJS(i,n,t));else if(e instanceof Set)e.add(n);else {let o=O0(r,n,t),s=Nl.toJS(i,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:true,enumerable:true,configurable:true}):e[o]=s;}}return e}function O0(t,e,r){if(e===null)return "";if(typeof e!="object")return String(e);if(Ey.isNode(t)&&r?.doc){let i=T0.createStringifyContext(r.doc,{});i.anchors=new Set;for(let o of r.anchors.keys())i.anchors.add(o.anchor);i.inFlow=true,i.inStringifyKey=true;let n=t.toString(i);if(!r.mapKeyWarned){let o=JSON.stringify(n);o.length>40&&(o=o.substring(0,36)+'..."'),E0.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=true;}return n}return JSON.stringify(e)}Ty.addPairToJSMap=P0;});var Dt=N(Dl=>{var Py=Jr(),C0=Sy(),A0=Rl(),Wo=K();function N0(t,e,r){let i=Py.createNode(t,void 0,r),n=Py.createNode(e,void 0,r);return new Yo(i,n)}var Yo=class t{constructor(e,r=null){Object.defineProperty(this,Wo.NODE_TYPE,{value:Wo.PAIR}),this.key=e,this.value=r;}clone(e){let{key:r,value:i}=this;return Wo.isNode(r)&&(r=r.clone(e)),Wo.isNode(i)&&(i=i.clone(e)),new t(r,i)}toJSON(e,r){let i=r?.mapAsMap?new Map:{};return A0.addPairToJSMap(r,i,this)}toString(e,r,i){return e?.doc?C0.stringifyPair(this,e,r,i):JSON.stringify(this)}};Dl.Pair=Yo;Dl.createPair=N0;});var Ml=N(Cy=>{var rn=K(),Oy=Qr(),Xo=Gr();function R0(t,e,r){return (e.inFlow??t.flow?M0:D0)(t,e,r)}function D0({comment:t,items:e},r,{blockItemPrefix:i,flowChars:n,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:l,options:{commentString:u}}=r,d=Object.assign({},r,{indent:o,type:null}),m=false,f=[];for(let v=0;v<e.length;++v){let g=e[v],y=null;if(rn.isNode(g))!m&&g.spaceBefore&&f.push(""),Qo(r,f,g.commentBefore,m),g.comment&&(y=g.comment);else if(rn.isPair(g)){let E=rn.isNode(g.key)?g.key:null;E&&(!m&&E.spaceBefore&&f.push(""),Qo(r,f,E.commentBefore,m));}m=false;let S=Oy.stringify(g,d,()=>y=null,()=>m=true);y&&(S+=Xo.lineComment(S,o,u(y))),m&&y&&(m=false),f.push(i+S);}let p;if(f.length===0)p=n.start+n.end;else {p=f[0];for(let v=1;v<f.length;++v){let g=f[v];p+=g?`
|
|
82
|
+
${l}${g}`:`
|
|
83
|
+
`;}}return t?(p+=`
|
|
84
|
+
`+Xo.indentComment(u(t),l),a&&a()):m&&s&&s(),p}function M0({items:t},e,{flowChars:r,itemIndent:i}){let{indent:n,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=e;i+=o;let l=Object.assign({},e,{indent:i,inFlow:true,type:null}),u=false,d=0,m=[];for(let v=0;v<t.length;++v){let g=t[v],y=null;if(rn.isNode(g))g.spaceBefore&&m.push(""),Qo(e,m,g.commentBefore,false),g.comment&&(y=g.comment);else if(rn.isPair(g)){let E=rn.isNode(g.key)?g.key:null;E&&(E.spaceBefore&&m.push(""),Qo(e,m,E.commentBefore,false),E.comment&&(u=true));let T=rn.isNode(g.value)?g.value:null;T?(T.comment&&(y=T.comment),T.commentBefore&&(u=true)):g.value==null&&E?.comment&&(y=E.comment);}y&&(u=true);let S=Oy.stringify(g,l,()=>y=null);v<t.length-1&&(S+=","),y&&(S+=Xo.lineComment(S,i,a(y))),!u&&(m.length>d||S.includes(`
|
|
85
|
+
`))&&(u=true),m.push(S),d=m.length;}let{start:f,end:p}=r;if(m.length===0)return f+p;if(!u){let v=m.reduce((g,y)=>g+y.length+2,2);u=e.options.lineWidth>0&&v>e.options.lineWidth;}if(u){let v=f;for(let g of m)v+=g?`
|
|
86
|
+
${o}${n}${g}`:`
|
|
87
|
+
`;return `${v}
|
|
88
|
+
${n}${p}`}else return `${f}${s}${m.join(" ")}${s}${p}`}function Qo({indent:t,options:{commentString:e}},r,i,n){if(i&&n&&(i=i.replace(/^\n+/,"")),i){let o=Xo.indentComment(e(i),t);r.push(o.trimStart());}}Cy.stringifyCollection=R0;});var zt=N(Ll=>{var z0=Ml(),L0=Rl(),j0=Uo(),Mt=K(),es=Dt(),U0=fe();function ni(t,e){let r=Mt.isScalar(e)?e.value:e;for(let i of t)if(Mt.isPair(i)&&(i.key===e||i.key===r||Mt.isScalar(i.key)&&i.key.value===r))return i}var zl=class extends j0.Collection{static get tagName(){return "tag:yaml.org,2002:map"}constructor(e){super(Mt.MAP,e),this.items=[];}static from(e,r,i){let{keepUndefined:n,replacer:o}=i,s=new this(e),a=(l,u)=>{if(typeof o=="function")u=o.call(r,l,u);else if(Array.isArray(o)&&!o.includes(l))return;(u!==void 0||n)&&s.items.push(es.createPair(l,u,i));};if(r instanceof Map)for(let[l,u]of r)a(l,u);else if(r&&typeof r=="object")for(let l of Object.keys(r))a(l,r[l]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,r){let i;Mt.isPair(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new es.Pair(e,e?.value):i=new es.Pair(e.key,e.value);let n=ni(this.items,i.key),o=this.schema?.sortMapEntries;if(n){if(!r)throw new Error(`Key ${i.key} already set`);Mt.isScalar(n.value)&&U0.isScalarValue(i.value)?n.value.value=i.value:n.value=i.value;}else if(o){let s=this.items.findIndex(a=>o(i,a)<0);s===-1?this.items.push(i):this.items.splice(s,0,i);}else this.items.push(i);}delete(e){let r=ni(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:false}get(e,r){let n=ni(this.items,e)?.value;return (!r&&Mt.isScalar(n)?n.value:n)??void 0}has(e){return !!ni(this.items,e)}set(e,r){this.add(new es.Pair(e,r),true);}toJSON(e,r,i){let n=i?new i:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(n);for(let o of this.items)L0.addPairToJSMap(r,n,o);return n}toString(e,r,i){if(!e)return JSON.stringify(this);for(let n of this.items)if(!Mt.isPair(n))throw new Error(`Map items must all be pairs; found ${JSON.stringify(n)} instead`);return !e.allNullValues&&this.hasAllNullValues(false)&&(e=Object.assign({},e,{allNullValues:true})),z0.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:r})}};Ll.YAMLMap=zl;Ll.findPair=ni;});var Un=N(Ny=>{var F0=K(),Ay=zt(),Z0={collection:"map",default:true,nodeClass:Ay.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return F0.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>Ay.YAMLMap.from(t,e,r)};Ny.map=Z0;});var Lt=N(Ry=>{var q0=Jr(),B0=Ml(),H0=Uo(),ns=K(),K0=fe(),V0=Ct(),jl=class extends H0.Collection{static get tagName(){return "tag:yaml.org,2002:seq"}constructor(e){super(ns.SEQ,e),this.items=[];}add(e){this.items.push(e);}delete(e){let r=ts(e);return typeof r!="number"?false:this.items.splice(r,1).length>0}get(e,r){let i=ts(e);if(typeof i!="number")return;let n=this.items[i];return !r&&ns.isScalar(n)?n.value:n}has(e){let r=ts(e);return typeof r=="number"&&r<this.items.length}set(e,r){let i=ts(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let n=this.items[i];ns.isScalar(n)&&K0.isScalarValue(r)?n.value=r:this.items[i]=r;}toJSON(e,r){let i=[];r?.onCreate&&r.onCreate(i);let n=0;for(let o of this.items)i.push(V0.toJS(o,String(n++),r));return i}toString(e,r,i){return e?B0.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:r}):JSON.stringify(this)}static from(e,r,i){let{replacer:n}=i,o=new this(e);if(r&&Symbol.iterator in Object(r)){let s=0;for(let a of r){if(typeof n=="function"){let l=r instanceof Set?a:String(s++);a=n.call(r,l,a);}o.items.push(q0.createNode(a,void 0,i));}}return o}};function ts(t){let e=ns.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Ry.YAMLSeq=jl;});var Fn=N(My=>{var J0=K(),Dy=Lt(),G0={collection:"seq",default:true,nodeClass:Dy.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return J0.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>Dy.YAMLSeq.from(t,e,r)};My.seq=G0;});var ri=N(zy=>{var W0=Xr(),Y0={identify:t=>typeof t=="string",default:true,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,i){return e=Object.assign({actualString:true},e),W0.stringifyString(t,e,r,i)}};zy.string=Y0;});var rs=N(Uy=>{var Ly=fe(),jy={identify:t=>t==null,createNode:()=>new Ly.Scalar(null),default:true,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ly.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&jy.test.test(t)?t:e.options.nullStr};Uy.nullTag=jy;});var Ul=N(Zy=>{var X0=fe(),Fy={identify:t=>typeof t=="boolean",default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new X0.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&Fy.test.test(t)){let i=t[0]==="t"||t[0]==="T";if(e===i)return t}return e?r.options.trueStr:r.options.falseStr}};Zy.boolTag=Fy;});var Zn=N(qy=>{function Q0({format:t,minFractionDigits:e,tag:r,value:i}){if(typeof i=="bigint")return String(i);let n=typeof i=="number"?i:Number(i);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let o=Object.is(i,-0)?"-0":JSON.stringify(i);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^\d/.test(o)){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=e-(o.length-s-1);for(;a-- >0;)o+="0";}return o}qy.stringifyNumber=Q0;});var Zl=N(is=>{var eT=fe(),Fl=Zn(),tT={identify:t=>typeof t=="number",default:true,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Fl.stringifyNumber},nT={identify:t=>typeof t=="number",default:true,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Fl.stringifyNumber(t)}},rT={identify:t=>typeof t=="number",default:true,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new eT.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:Fl.stringifyNumber};is.float=rT;is.floatExp=nT;is.floatNaN=tT;});var Bl=N(ss=>{var By=Zn(),os=t=>typeof t=="bigint"||Number.isInteger(t),ql=(t,e,r,{intAsBigInt:i})=>i?BigInt(t):parseInt(t.substring(e),r);function Hy(t,e,r){let{value:i}=t;return os(i)&&i>=0?r+i.toString(e):By.stringifyNumber(t)}var iT={identify:t=>os(t)&&t>=0,default:true,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>ql(t,2,8,r),stringify:t=>Hy(t,8,"0o")},oT={identify:os,default:true,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>ql(t,0,10,r),stringify:By.stringifyNumber},sT={identify:t=>os(t)&&t>=0,default:true,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>ql(t,2,16,r),stringify:t=>Hy(t,16,"0x")};ss.int=oT;ss.intHex=sT;ss.intOct=iT;});var Vy=N(Ky=>{var aT=Un(),cT=rs(),lT=Fn(),uT=ri(),dT=Ul(),Hl=Zl(),Kl=Bl(),mT=[aT.map,lT.seq,uT.string,cT.nullTag,dT.boolTag,Kl.intOct,Kl.int,Kl.intHex,Hl.floatNaN,Hl.floatExp,Hl.float];Ky.schema=mT;});var Wy=N(Gy=>{var fT=fe(),pT=Un(),gT=Fn();function Jy(t){return typeof t=="bigint"||Number.isInteger(t)}var as=({value:t})=>JSON.stringify(t),hT=[{identify:t=>typeof t=="string",default:true,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:as},{identify:t=>t==null,createNode:()=>new fT.Scalar(null),default:true,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:as},{identify:t=>typeof t=="boolean",default:true,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:as},{identify:Jy,default:true,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>Jy(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:true,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:as}],vT={default:true,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},yT=[pT.map,gT.seq].concat(hT,vT);Gy.schema=yT;});var Jl=N(Yy=>{var ii=_t("buffer"),Vl=fe(),bT=Xr(),$T={identify:t=>t instanceof Uint8Array,default:false,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof ii.Buffer=="function")return ii.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),i=new Uint8Array(r.length);for(let n=0;n<r.length;++n)i[n]=r.charCodeAt(n);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:r},i,n,o){if(!r)return "";let s=r,a;if(typeof ii.Buffer=="function")a=s instanceof ii.Buffer?s.toString("base64"):ii.Buffer.from(s.buffer).toString("base64");else if(typeof btoa=="function"){let l="";for(let u=0;u<s.length;++u)l+=String.fromCharCode(s[u]);a=btoa(l);}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=Vl.Scalar.BLOCK_LITERAL),e!==Vl.Scalar.QUOTE_DOUBLE){let l=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),u=Math.ceil(a.length/l),d=new Array(u);for(let m=0,f=0;m<u;++m,f+=l)d[m]=a.substr(f,l);a=d.join(e===Vl.Scalar.BLOCK_LITERAL?`
|
|
89
|
+
`:" ");}return bT.stringifyString({comment:t,type:e,value:a},i,n,o)}};Yy.binary=$T;});var us=N(ls=>{var cs=K(),Gl=Dt(),_T=fe(),ST=Lt();function Xy(t,e){if(cs.isSeq(t))for(let r=0;r<t.items.length;++r){let i=t.items[r];if(!cs.isPair(i)){if(cs.isMap(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let n=i.items[0]||new Gl.Pair(new _T.Scalar(null));if(i.commentBefore&&(n.key.commentBefore=n.key.commentBefore?`${i.commentBefore}
|
|
90
|
+
${n.key.commentBefore}`:i.commentBefore),i.comment){let o=n.value??n.key;o.comment=o.comment?`${i.comment}
|
|
91
|
+
${o.comment}`:i.comment;}i=n;}t.items[r]=cs.isPair(i)?i:new Gl.Pair(i);}}else e("Expected a sequence for this tag");return t}function Qy(t,e,r){let{replacer:i}=r,n=new ST.YAMLSeq(t);n.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof i=="function"&&(s=i.call(e,String(o++),s));let a,l;if(Array.isArray(s))if(s.length===2)a=s[0],l=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let u=Object.keys(s);if(u.length===1)a=u[0],l=s[a];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else a=s;n.items.push(Gl.createPair(a,l,r));}return n}var wT={collection:"seq",default:false,tag:"tag:yaml.org,2002:pairs",resolve:Xy,createNode:Qy};ls.createPairs=Qy;ls.pairs=wT;ls.resolvePairs=Xy;});var Xl=N(Yl=>{var eb=K(),Wl=Ct(),oi=zt(),kT=Lt(),tb=us(),on=class t extends kT.YAMLSeq{constructor(){super(),this.add=oi.YAMLMap.prototype.add.bind(this),this.delete=oi.YAMLMap.prototype.delete.bind(this),this.get=oi.YAMLMap.prototype.get.bind(this),this.has=oi.YAMLMap.prototype.has.bind(this),this.set=oi.YAMLMap.prototype.set.bind(this),this.tag=t.tag;}toJSON(e,r){if(!r)return super.toJSON(e);let i=new Map;r?.onCreate&&r.onCreate(i);for(let n of this.items){let o,s;if(eb.isPair(n)?(o=Wl.toJS(n.key,"",r),s=Wl.toJS(n.value,o,r)):o=Wl.toJS(n,"",r),i.has(o))throw new Error("Ordered maps must not include duplicate keys");i.set(o,s);}return i}static from(e,r,i){let n=tb.createPairs(e,r,i),o=new this;return o.items=n.items,o}};on.tag="tag:yaml.org,2002:omap";var xT={collection:"seq",identify:t=>t instanceof Map,nodeClass:on,default:false,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=tb.resolvePairs(t,e),i=[];for(let{key:n}of r.items)eb.isScalar(n)&&(i.includes(n.value)?e(`Ordered maps must not include duplicate keys: ${n.value}`):i.push(n.value));return Object.assign(new on,r)},createNode:(t,e,r)=>on.from(t,e,r)};Yl.YAMLOMap=on;Yl.omap=xT;});var sb=N(Ql=>{var nb=fe();function rb({value:t,source:e},r){return e&&(t?ib:ob).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var ib={identify:t=>t===true,default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new nb.Scalar(true),stringify:rb},ob={identify:t=>t===false,default:true,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new nb.Scalar(false),stringify:rb};Ql.falseTag=ob;Ql.trueTag=ib;});var ab=N(ds=>{var IT=fe(),eu=Zn(),ET={identify:t=>typeof t=="number",default:true,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:eu.stringifyNumber},TT={identify:t=>typeof t=="number",default:true,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():eu.stringifyNumber(t)}},PT={identify:t=>typeof t=="number",default:true,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new IT.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let i=t.substring(r+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length);}return e},stringify:eu.stringifyNumber};ds.float=PT;ds.floatExp=TT;ds.floatNaN=ET;});var lb=N(ai=>{var cb=Zn(),si=t=>typeof t=="bigint"||Number.isInteger(t);function ms(t,e,r,{intAsBigInt:i}){let n=t[0];if((n==="-"||n==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let s=BigInt(t);return n==="-"?BigInt(-1)*s:s}let o=parseInt(t,r);return n==="-"?-1*o:o}function tu(t,e,r){let{value:i}=t;if(si(i)){let n=i.toString(e);return i<0?"-"+r+n.substr(1):r+n}return cb.stringifyNumber(t)}var OT={identify:si,default:true,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>ms(t,2,2,r),stringify:t=>tu(t,2,"0b")},CT={identify:si,default:true,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>ms(t,1,8,r),stringify:t=>tu(t,8,"0")},AT={identify:si,default:true,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>ms(t,0,10,r),stringify:cb.stringifyNumber},NT={identify:si,default:true,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>ms(t,2,16,r),stringify:t=>tu(t,16,"0x")};ai.int=AT;ai.intBin=OT;ai.intHex=NT;ai.intOct=CT;});var ru=N(nu=>{var gs=K(),fs=Dt(),ps=zt(),sn=class t extends ps.YAMLMap{constructor(e){super(e),this.tag=t.tag;}add(e){let r;gs.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new fs.Pair(e.key,null):r=new fs.Pair(e,null),ps.findPair(this.items,r.key)||this.items.push(r);}get(e,r){let i=ps.findPair(this.items,e);return !r&&gs.isPair(i)?gs.isScalar(i.key)?i.key.value:i.key:i}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let i=ps.findPair(this.items,e);i&&!r?this.items.splice(this.items.indexOf(i),1):!i&&r&&this.items.push(new fs.Pair(e));}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(true))return super.toString(Object.assign({},e,{allNullValues:true}),r,i);throw new Error("Set items must all have null values")}static from(e,r,i){let{replacer:n}=i,o=new this(e);if(r&&Symbol.iterator in Object(r))for(let s of r)typeof n=="function"&&(s=n.call(r,s,s)),o.items.push(fs.createPair(s,null,i));return o}};sn.tag="tag:yaml.org,2002:set";var RT={collection:"map",identify:t=>t instanceof Set,nodeClass:sn,default:false,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>sn.from(t,e,r),resolve(t,e){if(gs.isMap(t)){if(t.hasAllNullValues(true))return Object.assign(new sn,t);e("Set items must all have null values");}else e("Expected a mapping for this tag");return t}};nu.YAMLSet=sn;nu.set=RT;});var ou=N(hs=>{var DT=Zn();function iu(t,e){let r=t[0],i=r==="-"||r==="+"?t.substring(1):t,n=s=>e?BigInt(s):Number(s),o=i.replace(/_/g,"").split(":").reduce((s,a)=>s*n(60)+n(a),n(0));return r==="-"?n(-1)*o:o}function ub(t){let{value:e}=t,r=s=>s;if(typeof e=="bigint")r=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return DT.stringifyNumber(t);let i="";e<0&&(i="-",e*=r(-1));let n=r(60),o=[e%n];return e<60?o.unshift(0):(e=(e-o[0])/n,o.unshift(e%n),e>=60&&(e=(e-o[0])/n,o.unshift(e))),i+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var MT={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:true,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>iu(t,r),stringify:ub},zT={identify:t=>typeof t=="number",default:true,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>iu(t,false),stringify:ub},db={identify:t=>t instanceof Date,default:true,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(db.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,i,n,o,s,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0,u=Date.UTC(r,i-1,n,o||0,s||0,a||0,l),d=e[8];if(d&&d!=="Z"){let m=iu(d,false);Math.abs(m)<30&&(m*=60),u-=6e4*m;}return new Date(u)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};hs.floatTime=zT;hs.intTime=MT;hs.timestamp=db;});var pb=N(fb=>{var LT=Un(),jT=rs(),UT=Fn(),FT=ri(),ZT=Jl(),mb=sb(),su=ab(),vs=lb(),qT=Go(),BT=Xl(),HT=us(),KT=ru(),au=ou(),VT=[LT.map,UT.seq,FT.string,jT.nullTag,mb.trueTag,mb.falseTag,vs.intBin,vs.intOct,vs.int,vs.intHex,su.floatNaN,su.floatExp,su.float,ZT.binary,qT.merge,BT.omap,HT.pairs,KT.set,au.intTime,au.floatTime,au.timestamp];fb.schema=VT;});var kb=N(uu=>{var yb=Un(),JT=rs(),bb=Fn(),GT=ri(),WT=Ul(),cu=Zl(),lu=Bl(),YT=Vy(),XT=Wy(),$b=Jl(),ci=Go(),_b=Xl(),Sb=us(),gb=pb(),wb=ru(),ys=ou(),hb=new Map([["core",YT.schema],["failsafe",[yb.map,bb.seq,GT.string]],["json",XT.schema],["yaml11",gb.schema],["yaml-1.1",gb.schema]]),vb={binary:$b.binary,bool:WT.boolTag,float:cu.float,floatExp:cu.floatExp,floatNaN:cu.floatNaN,floatTime:ys.floatTime,int:lu.int,intHex:lu.intHex,intOct:lu.intOct,intTime:ys.intTime,map:yb.map,merge:ci.merge,null:JT.nullTag,omap:_b.omap,pairs:Sb.pairs,seq:bb.seq,set:wb.set,timestamp:ys.timestamp},QT={"tag:yaml.org,2002:binary":$b.binary,"tag:yaml.org,2002:merge":ci.merge,"tag:yaml.org,2002:omap":_b.omap,"tag:yaml.org,2002:pairs":Sb.pairs,"tag:yaml.org,2002:set":wb.set,"tag:yaml.org,2002:timestamp":ys.timestamp};function eP(t,e,r){let i=hb.get(e);if(i&&!t)return r&&!i.includes(ci.merge)?i.concat(ci.merge):i.slice();let n=i;if(!n)if(Array.isArray(t))n=[];else {let o=Array.from(hb.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(t))for(let o of t)n=n.concat(o);else typeof t=="function"&&(n=t(n.slice()));return r&&(n=n.concat(ci.merge)),n.reduce((o,s)=>{let a=typeof s=="string"?vb[s]:s;if(!a){let l=JSON.stringify(s),u=Object.keys(vb).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${u}`)}return o.includes(a)||o.push(a),o},[])}uu.coreKnownTags=QT;uu.getTags=eP;});var fu=N(xb=>{var du=K(),tP=Un(),nP=Fn(),rP=ri(),bs=kb(),iP=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,mu=class t{constructor({compat:e,customTags:r,merge:i,resolveKnownTags:n,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?bs.getTags(e,"compat"):e?bs.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=n?bs.coreKnownTags:{},this.tags=bs.getTags(r,this.name,i),this.toStringOptions=a??null,Object.defineProperty(this,du.MAP,{value:tP.map}),Object.defineProperty(this,du.SCALAR,{value:rP.string}),Object.defineProperty(this,du.SEQ,{value:nP.seq}),this.sortMapEntries=typeof s=="function"?s:s===true?iP:null;}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};xb.Schema=mu;});var Eb=N(Ib=>{var oP=K(),pu=Qr(),li=Gr();function sP(t,e){let r=[],i=e.directives===true;if(e.directives!==false&&t.directives){let l=t.directives.toString(t);l?(r.push(l),i=true):t.directives.docStart&&(i=true);}i&&r.push("---");let n=pu.createStringifyContext(t,e),{commentString:o}=n.options;if(t.commentBefore){r.length!==1&&r.unshift("");let l=o(t.commentBefore);r.unshift(li.indentComment(l,""));}let s=false,a=null;if(t.contents){if(oP.isNode(t.contents)){if(t.contents.spaceBefore&&i&&r.push(""),t.contents.commentBefore){let d=o(t.contents.commentBefore);r.push(li.indentComment(d,""));}n.forceBlockIndent=!!t.comment,a=t.contents.comment;}let l=a?void 0:()=>s=true,u=pu.stringify(t.contents,n,()=>a=null,l);a&&(u+=li.lineComment(u,"",o(a))),(u[0]==="|"||u[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${u}`:r.push(u);}else r.push(pu.stringify(t.contents,n));if(t.directives?.docEnd)if(t.comment){let l=o(t.comment);l.includes(`
|
|
92
|
+
`)?(r.push("..."),r.push(li.indentComment(l,""))):r.push(`... ${l}`);}else r.push("...");else {let l=t.comment;l&&s&&(l=l.replace(/^\n+/,"")),l&&((!s||a)&&r[r.length-1]!==""&&r.push(""),r.push(li.indentComment(o(l),"")));}return r.join(`
|
|
93
|
+
`)+`
|
|
94
|
+
`}Ib.stringifyDocument=sP;});var ui=N(Tb=>{var aP=Vr(),qn=Uo(),Je=K(),cP=Dt(),lP=Ct(),uP=fu(),dP=Eb(),gu=Mo(),mP=bl(),fP=Jr(),hu=yl(),vu=class t{constructor(e,r,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Je.NODE_TYPE,{value:Je.DOC});let n=null;typeof r=="function"||Array.isArray(r)?n=r:i===void 0&&r&&(i=r,r=void 0);let o=Object.assign({intAsBigInt:false,keepSourceTokens:false,logLevel:"warn",prettyErrors:true,strict:true,stringKeys:false,uniqueKeys:true,version:"1.2"},i);this.options=o;let{version:s}=o;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new hu.Directives({version:s}),this.setSchema(s,i),this.contents=e===void 0?null:this.createNode(e,n,i);}clone(){let e=Object.create(t.prototype,{[Je.NODE_TYPE]:{value:Je.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Je.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Bn(this.contents)&&this.contents.add(e);}addIn(e,r){Bn(this.contents)&&this.contents.addIn(e,r);}createAlias(e,r){if(!e.anchor){let i=gu.anchorNames(this);e.anchor=!r||i.has(r)?gu.findNewAnchor(r||"a",i):r;}return new aP.Alias(e.anchor)}createNode(e,r,i){let n;if(typeof r=="function")e=r.call({"":e},"",e),n=r;else if(Array.isArray(r)){let y=E=>typeof E=="number"||E instanceof String||E instanceof Number,S=r.filter(y).map(String);S.length>0&&(r=r.concat(S)),n=r;}else i===void 0&&r&&(i=r,r=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:l,onTagObj:u,tag:d}=i??{},{onAnchor:m,setAnchors:f,sourceObjects:p}=gu.createNodeAnchors(this,s||"a"),v={aliasDuplicateObjects:o??true,keepUndefined:l??false,onAnchor:m,onTagObj:u,replacer:n,schema:this.schema,sourceObjects:p},g=fP.createNode(e,d,v);return a&&Je.isCollection(g)&&(g.flow=true),f(),g}createPair(e,r,i={}){let n=this.createNode(e,null,i),o=this.createNode(r,null,i);return new cP.Pair(n,o)}delete(e){return Bn(this.contents)?this.contents.delete(e):false}deleteIn(e){return qn.isEmptyPath(e)?this.contents==null?false:(this.contents=null,true):Bn(this.contents)?this.contents.deleteIn(e):false}get(e,r){return Je.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return qn.isEmptyPath(e)?!r&&Je.isScalar(this.contents)?this.contents.value:this.contents:Je.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return Je.isCollection(this.contents)?this.contents.has(e):false}hasIn(e){return qn.isEmptyPath(e)?this.contents!==void 0:Je.isCollection(this.contents)?this.contents.hasIn(e):false}set(e,r){this.contents==null?this.contents=qn.collectionFromPath(this.schema,[e],r):Bn(this.contents)&&this.contents.set(e,r);}setIn(e,r){qn.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=qn.collectionFromPath(this.schema,Array.from(e),r):Bn(this.contents)&&this.contents.setIn(e,r);}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let i;switch(e){case "1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new hu.Directives({version:"1.1"}),i={resolveKnownTags:false,schema:"yaml-1.1"};break;case "1.2":case "next":this.directives?this.directives.yaml.version=e:this.directives=new hu.Directives({version:e}),i={resolveKnownTags:true,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let n=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${n}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(i)this.schema=new uP.Schema(Object.assign(i,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:i,maxAliasCount:n,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:i===true,mapKeyWarned:false,maxAliasCount:typeof n=="number"?n:100},l=lP.toJS(this.contents,r??"",a);if(typeof o=="function")for(let{count:u,res:d}of a.anchors.values())o(d,u);return typeof s=="function"?mP.applyReviver(s,{"":l},"",l):l}toJSON(e,r){return this.toJS({json:true,jsonArg:e,mapAsMap:false,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return dP.stringifyDocument(this,e)}};function Bn(t){if(Je.isCollection(t))return true;throw new Error("Expected a YAML collection as document contents")}Tb.Document=vu;});var fi=N(mi=>{var di=class extends Error{constructor(e,r,i,n){super(),this.name=e,this.code=i,this.message=n,this.pos=r;}},yu=class extends di{constructor(e,r,i){super("YAMLParseError",e,r,i);}},bu=class extends di{constructor(e,r,i){super("YAMLWarning",e,r,i);}},pP=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>e.linePos(a));let{line:i,col:n}=r.linePos[0];r.message+=` at line ${i}, column ${n}`;let o=n-1,s=t.substring(e.lineStarts[i-1],e.lineStarts[i]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="\u2026"+s.substring(a),o-=a-1;}if(s.length>80&&(s=s.substring(0,79)+"\u2026"),i>1&&/^ *$/.test(s.substring(0,o))){let a=t.substring(e.lineStarts[i-2],e.lineStarts[i-1]);a.length>80&&(a=a.substring(0,79)+`\u2026
|
|
95
|
+
`),s=a+s;}if(/[^ ]/.test(s)){let a=1,l=r.linePos[1];l?.line===i&&l.col>n&&(a=Math.max(1,Math.min(l.col-n,80-o)));let u=" ".repeat(o)+"^".repeat(a);r.message+=`:
|
|
96
|
+
|
|
97
|
+
${s}
|
|
98
|
+
${u}
|
|
99
|
+
`;}};mi.YAMLError=di;mi.YAMLParseError=yu;mi.YAMLWarning=bu;mi.prettifyError=pP;});var pi=N(Pb=>{function gP(t,{flow:e,indicator:r,next:i,offset:n,onError:o,parentIndent:s,startOnNewline:a}){let l=false,u=a,d=a,m="",f="",p=false,v=false,g=null,y=null,S=null,E=null,T=null,C=null,P=null;for(let O of t)switch(v&&(O.type!=="space"&&O.type!=="newline"&&O.type!=="comma"&&o(O.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),v=false),g&&(u&&O.type!=="comment"&&O.type!=="newline"&&o(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),O.type){case "space":!e&&(r!=="doc-start"||i?.type!=="flow-collection")&&O.source.includes(" ")&&(g=O),d=true;break;case "comment":{d||o(O,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let re=O.source.substring(1)||" ";m?m+=f+re:m=re,f="",u=false;break}case "newline":u?m?m+=O.source:(!C||r!=="seq-item-ind")&&(l=true):f+=O.source,u=true,p=true,(y||S)&&(E=O),d=true;break;case "anchor":y&&o(O,"MULTIPLE_ANCHORS","A node can have at most one anchor"),O.source.endsWith(":")&&o(O.offset+O.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",true),y=O,P??(P=O.offset),u=false,d=false,v=true;break;case "tag":{S&&o(O,"MULTIPLE_TAGS","A node can have at most one tag"),S=O,P??(P=O.offset),u=false,d=false,v=true;break}case r:(y||S)&&o(O,"BAD_PROP_ORDER",`Anchors and tags must be after the ${O.source} indicator`),C&&o(O,"UNEXPECTED_TOKEN",`Unexpected ${O.source} in ${e??"collection"}`),C=O,u=r==="seq-item-ind"||r==="explicit-key-ind",d=false;break;case "comma":if(e){T&&o(O,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),T=O,u=false,d=false;break}default:o(O,"UNEXPECTED_TOKEN",`Unexpected ${O.type} token`),u=false,d=false;}let L=t[t.length-1],V=L?L.offset+L.source.length:n;return v&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&o(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(u&&g.indent<=s||i?.type==="block-map"||i?.type==="block-seq")&&o(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:T,found:C,spaceBefore:l,comment:m,hasNewline:p,anchor:y,tag:S,newlineAfterProp:E,end:V,start:P??V}}Pb.resolveProps=gP;});var $s=N(Ob=>{function $u(t){if(!t)return null;switch(t.type){case "alias":case "scalar":case "double-quoted-scalar":case "single-quoted-scalar":if(t.source.includes(`
|
|
100
|
+
`))return true;if(t.end){for(let e of t.end)if(e.type==="newline")return true}return false;case "flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return true;if(e.sep){for(let r of e.sep)if(r.type==="newline")return true}if($u(e.key)||$u(e.value))return true}return false;default:return true}}Ob.containsNewline=$u;});var _u=N(Cb=>{var hP=$s();function vP(t,e,r){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&hP.containsNewline(e)&&r(i,"BAD_INDENT","Flow end indicator should be more indented than parent",true);}}Cb.flowIndentCheck=vP;});var Su=N(Nb=>{var Ab=K();function yP(t,e,r){let{uniqueKeys:i}=t.options;if(i===false)return false;let n=typeof i=="function"?i:(o,s)=>o===s||Ab.isScalar(o)&&Ab.isScalar(s)&&o.value===s.value;return e.some(o=>n(o.key,r))}Nb.mapIncludes=yP;});var jb=N(Lb=>{var Rb=Dt(),bP=zt(),Db=pi(),$P=$s(),Mb=_u(),_P=Su(),zb="All mapping items must start at the same column";function SP({composeNode:t,composeEmptyNode:e},r,i,n,o){let s=o?.nodeClass??bP.YAMLMap,a=new s(r.schema);r.atRoot&&(r.atRoot=false);let l=i.offset,u=null;for(let d of i.items){let{start:m,key:f,sep:p,value:v}=d,g=Db.resolveProps(m,{indicator:"explicit-key-ind",next:f??p?.[0],offset:l,onError:n,parentIndent:i.indent,startOnNewline:true}),y=!g.found;if(y){if(f&&(f.type==="block-seq"?n(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==i.indent&&n(l,"BAD_INDENT",zb)),!g.anchor&&!g.tag&&!p){u=g.end,g.comment&&(a.comment?a.comment+=`
|
|
101
|
+
`+g.comment:a.comment=g.comment);continue}(g.newlineAfterProp||$P.containsNewline(f))&&n(f??m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line");}else g.found?.indent!==i.indent&&n(l,"BAD_INDENT",zb);r.atKey=true;let S=g.end,E=f?t(r,f,g,n):e(r,S,m,null,g,n);r.schema.compat&&Mb.flowIndentCheck(i.indent,f,n),r.atKey=false,_P.mapIncludes(r,a.items,E)&&n(S,"DUPLICATE_KEY","Map keys must be unique");let T=Db.resolveProps(p??[],{indicator:"map-value-ind",next:v,offset:E.range[2],onError:n,parentIndent:i.indent,startOnNewline:!f||f.type==="block-scalar"});if(l=T.end,T.found){y&&(v?.type==="block-map"&&!T.hasNewline&&n(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&g.start<T.found.offset-1024&&n(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let C=v?t(r,v,T,n):e(r,l,p,null,T,n);r.schema.compat&&Mb.flowIndentCheck(i.indent,v,n),l=C.range[2];let P=new Rb.Pair(E,C);r.options.keepSourceTokens&&(P.srcToken=d),a.items.push(P);}else {y&&n(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),T.comment&&(E.comment?E.comment+=`
|
|
102
|
+
`+T.comment:E.comment=T.comment);let C=new Rb.Pair(E);r.options.keepSourceTokens&&(C.srcToken=d),a.items.push(C);}}return u&&u<l&&n(u,"IMPOSSIBLE","Map comment with trailing content"),a.range=[i.offset,l,u??l],a}Lb.resolveBlockMap=SP;});var Fb=N(Ub=>{var wP=Lt(),kP=pi(),xP=_u();function IP({composeNode:t,composeEmptyNode:e},r,i,n,o){let s=o?.nodeClass??wP.YAMLSeq,a=new s(r.schema);r.atRoot&&(r.atRoot=false),r.atKey&&(r.atKey=false);let l=i.offset,u=null;for(let{start:d,value:m}of i.items){let f=kP.resolveProps(d,{indicator:"seq-item-ind",next:m,offset:l,onError:n,parentIndent:i.indent,startOnNewline:true});if(!f.found)if(f.anchor||f.tag||m)m?.type==="block-seq"?n(f.end,"BAD_INDENT","All sequence items must start at the same column"):n(l,"MISSING_CHAR","Sequence item without - indicator");else {u=f.end,f.comment&&(a.comment=f.comment);continue}let p=m?t(r,m,f,n):e(r,f.end,d,null,f,n);r.schema.compat&&xP.flowIndentCheck(i.indent,m,n),l=p.range[2],a.items.push(p);}return a.range=[i.offset,l,u??l],a}Ub.resolveBlockSeq=IP;});var Hn=N(Zb=>{function EP(t,e,r,i){let n="";if(t){let o=false,s="";for(let a of t){let{source:l,type:u}=a;switch(u){case "space":o=true;break;case "comment":{r&&!o&&i(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let d=l.substring(1)||" ";n?n+=s+d:n=d,s="";break}case "newline":n&&(s+=l),o=true;break;default:i(a,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`);}e+=l.length;}}return {comment:n,offset:e}}Zb.resolveEnd=EP;});var Kb=N(Hb=>{var TP=K(),PP=Dt(),qb=zt(),OP=Lt(),CP=Hn(),Bb=pi(),AP=$s(),NP=Su(),wu="Block collections are not allowed within flow collections",ku=t=>t&&(t.type==="block-map"||t.type==="block-seq");function RP({composeNode:t,composeEmptyNode:e},r,i,n,o){let s=i.start.source==="{",a=s?"flow map":"flow sequence",l=o?.nodeClass??(s?qb.YAMLMap:OP.YAMLSeq),u=new l(r.schema);u.flow=true;let d=r.atRoot;d&&(r.atRoot=false),r.atKey&&(r.atKey=false);let m=i.offset+i.start.source.length;for(let y=0;y<i.items.length;++y){let S=i.items[y],{start:E,key:T,sep:C,value:P}=S,L=Bb.resolveProps(E,{flow:a,indicator:"explicit-key-ind",next:T??C?.[0],offset:m,onError:n,parentIndent:i.indent,startOnNewline:false});if(!L.found){if(!L.anchor&&!L.tag&&!C&&!P){y===0&&L.comma?n(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):y<i.items.length-1&&n(L.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),L.comment&&(u.comment?u.comment+=`
|
|
103
|
+
`+L.comment:u.comment=L.comment),m=L.end;continue}!s&&r.options.strict&&AP.containsNewline(T)&&n(T,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");}if(y===0)L.comma&&n(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(L.comma||n(L.start,"MISSING_CHAR",`Missing , between ${a} items`),L.comment){let V="";e:for(let O of E)switch(O.type){case "comma":case "space":break;case "comment":V=O.source.substring(1);break e;default:break e}if(V){let O=u.items[u.items.length-1];TP.isPair(O)&&(O=O.value??O.key),O.comment?O.comment+=`
|
|
104
|
+
`+V:O.comment=V,L.comment=L.comment.substring(V.length+1);}}if(!s&&!C&&!L.found){let V=P?t(r,P,L,n):e(r,L.end,C,null,L,n);u.items.push(V),m=V.range[2],ku(P)&&n(V.range,"BLOCK_IN_FLOW",wu);}else {r.atKey=true;let V=L.end,O=T?t(r,T,L,n):e(r,V,E,null,L,n);ku(T)&&n(O.range,"BLOCK_IN_FLOW",wu),r.atKey=false;let re=Bb.resolveProps(C??[],{flow:a,indicator:"map-value-ind",next:P,offset:O.range[2],onError:n,parentIndent:i.indent,startOnNewline:false});if(re.found){if(!s&&!L.found&&r.options.strict){if(C)for(let ie of C){if(ie===re.found)break;if(ie.type==="newline"){n(ie,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}L.start<re.found.offset-1024&&n(re.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key");}}else P&&("source"in P&&P.source?.[0]===":"?n(P,"MISSING_CHAR",`Missing space after : in ${a}`):n(re.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let ct=P?t(r,P,re,n):re.found?e(r,re.end,C,null,re,n):null;ct?ku(P)&&n(ct.range,"BLOCK_IN_FLOW",wu):re.comment&&(O.comment?O.comment+=`
|
|
105
|
+
`+re.comment:O.comment=re.comment);let Oe=new PP.Pair(O,ct);if(r.options.keepSourceTokens&&(Oe.srcToken=S),s){let ie=u;NP.mapIncludes(r,ie.items,O)&&n(V,"DUPLICATE_KEY","Map keys must be unique"),ie.items.push(Oe);}else {let ie=new qb.YAMLMap(r.schema);ie.flow=true,ie.items.push(Oe);let Po=(ct??O).range;ie.range=[O.range[0],Po[1],Po[2]],u.items.push(ie);}m=ct?ct.range[2]:re.end;}}let f=s?"}":"]",[p,...v]=i.end,g=m;if(p?.source===f)g=p.offset+p.source.length;else {let y=a[0].toUpperCase()+a.substring(1),S=d?`${y} must end with a ${f}`:`${y} in block collection must be sufficiently indented and end with a ${f}`;n(m,d?"MISSING_CHAR":"BAD_INDENT",S),p&&p.source.length!==1&&v.unshift(p);}if(v.length>0){let y=CP.resolveEnd(v,g,r.options.strict,n);y.comment&&(u.comment?u.comment+=`
|
|
106
|
+
`+y.comment:u.comment=y.comment),u.range=[i.offset,g,y.offset];}else u.range=[i.offset,g,g];return u}Hb.resolveFlowCollection=RP;});var Jb=N(Vb=>{var DP=K(),MP=fe(),zP=zt(),LP=Lt(),jP=jb(),UP=Fb(),FP=Kb();function xu(t,e,r,i,n,o){let s=r.type==="block-map"?jP.resolveBlockMap(t,e,r,i,o):r.type==="block-seq"?UP.resolveBlockSeq(t,e,r,i,o):FP.resolveFlowCollection(t,e,r,i,o),a=s.constructor;return n==="!"||n===a.tagName?(s.tag=a.tagName,s):(n&&(s.tag=n),s)}function ZP(t,e,r,i,n){let o=i.tag,s=o?e.directives.tagName(o.source,f=>n(o,"TAG_RESOLVE_FAILED",f)):null;if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:p}=i,v=f&&o?f.offset>o.offset?f:o:f??o;v&&(!p||p.offset<v.offset)&&n(v,"MISSING_CHAR","Missing newline after block sequence props");}let a=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!o||!s||s==="!"||s===zP.YAMLMap.tagName&&a==="map"||s===LP.YAMLSeq.tagName&&a==="seq")return xu(t,e,r,n,s);let l=e.schema.tags.find(f=>f.tag===s&&f.collection===a);if(!l){let f=e.schema.knownTags[s];if(f?.collection===a)e.schema.tags.push(Object.assign({},f,{default:false})),l=f;else return f?n(o,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,true):n(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,true),xu(t,e,r,n,s)}let u=xu(t,e,r,n,s,l),d=l.resolve?.(u,f=>n(o,"TAG_RESOLVE_FAILED",f),e.options)??u,m=DP.isNode(d)?d:new MP.Scalar(d);return m.range=u.range,m.tag=s,l?.format&&(m.format=l.format),m}Vb.composeCollection=ZP;});var Eu=N(Gb=>{var Iu=fe();function qP(t,e,r){let i=e.offset,n=BP(e,t.options.strict,r);if(!n)return {value:"",type:null,comment:"",range:[i,i,i]};let o=n.mode===">"?Iu.Scalar.BLOCK_FOLDED:Iu.Scalar.BLOCK_LITERAL,s=e.source?HP(e.source):[],a=s.length;for(let g=s.length-1;g>=0;--g){let y=s[g][1];if(y===""||y==="\r")a=g;else break}if(a===0){let g=n.chomp==="+"&&s.length>0?`
|
|
107
|
+
`.repeat(Math.max(1,s.length-1)):"",y=i+n.length;return e.source&&(y+=e.source.length),{value:g,type:o,comment:n.comment,range:[i,y,y]}}let l=e.indent+n.indent,u=e.offset+n.length,d=0;for(let g=0;g<a;++g){let[y,S]=s[g];if(S===""||S==="\r")n.indent===0&&y.length>l&&(l=y.length);else {y.length<l&&r(u+y.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),n.indent===0&&(l=y.length),d=g,l===0&&!t.atRoot&&r(u,"BAD_INDENT","Block scalar values in collections must be indented");break}u+=y.length+S.length+1;}for(let g=s.length-1;g>=a;--g)s[g][0].length>l&&(a=g+1);let m="",f="",p=false;for(let g=0;g<d;++g)m+=s[g][0].slice(l)+`
|
|
108
|
+
`;for(let g=d;g<a;++g){let[y,S]=s[g];u+=y.length+S.length+1;let E=S[S.length-1]==="\r";if(E&&(S=S.slice(0,-1)),S&&y.length<l){let C=`Block scalar lines must not be less indented than their ${n.indent?"explicit indentation indicator":"first line"}`;r(u-S.length-(E?2:1),"BAD_INDENT",C),y="";}o===Iu.Scalar.BLOCK_LITERAL?(m+=f+y.slice(l)+S,f=`
|
|
109
|
+
`):y.length>l||S[0]===" "?(f===" "?f=`
|
|
110
|
+
`:!p&&f===`
|
|
111
|
+
`&&(f=`
|
|
112
|
+
|
|
113
|
+
`),m+=f+y.slice(l)+S,f=`
|
|
114
|
+
`,p=true):S===""?f===`
|
|
115
|
+
`?m+=`
|
|
116
|
+
`:f=`
|
|
117
|
+
`:(m+=f+S,f=" ",p=false);}switch(n.chomp){case "-":break;case "+":for(let g=a;g<s.length;++g)m+=`
|
|
118
|
+
`+s[g][0].slice(l);m[m.length-1]!==`
|
|
119
|
+
`&&(m+=`
|
|
120
|
+
`);break;default:m+=`
|
|
121
|
+
`;}let v=i+n.length+e.source.length;return {value:m,type:o,comment:n.comment,range:[i,v,v]}}function BP({offset:t,props:e},r,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:n}=e[0],o=n[0],s=0,a="",l=-1;for(let f=1;f<n.length;++f){let p=n[f];if(!a&&(p==="-"||p==="+"))a=p;else {let v=Number(p);!s&&v?s=v:l===-1&&(l=t+f);}}l!==-1&&i(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${n}`);let u=false,d="",m=n.length;for(let f=1;f<e.length;++f){let p=e[f];switch(p.type){case "space":u=true;case "newline":m+=p.source.length;break;case "comment":r&&!u&&i(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),m+=p.source.length,d=p.source.substring(1);break;case "error":i(p,"UNEXPECTED_TOKEN",p.message),m+=p.source.length;break;default:{let v=`Unexpected token in block scalar header: ${p.type}`;i(p,"UNEXPECTED_TOKEN",v);let g=p.source;g&&typeof g=="string"&&(m+=g.length);}}}return {mode:o,indent:s,chomp:a,comment:d,length:m}}function HP(t){let e=t.split(/\n( *)/),r=e[0],i=r.match(/^( *)/),o=[i?.[1]?[i[1],r.slice(i[1].length)]:["",r]];for(let s=1;s<e.length;s+=2)o.push([e[s],e[s+1]]);return o}Gb.resolveBlockScalar=qP;});var Pu=N(Yb=>{var Tu=fe(),KP=Hn();function VP(t,e,r){let{offset:i,type:n,source:o,end:s}=t,a,l,u=(f,p,v)=>r(i+f,p,v);switch(n){case "scalar":a=Tu.Scalar.PLAIN,l=JP(o,u);break;case "single-quoted-scalar":a=Tu.Scalar.QUOTE_SINGLE,l=GP(o,u);break;case "double-quoted-scalar":a=Tu.Scalar.QUOTE_DOUBLE,l=WP(o,u);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${n}`),{value:"",type:null,comment:"",range:[i,i+o.length,i+o.length]}}let d=i+o.length,m=KP.resolveEnd(s,d,e,r);return {value:l,type:a,comment:m.comment,range:[i,d,m.offset]}}function JP(t,e){let r="";switch(t[0]){case " ":r="a tab character";break;case ",":r="flow indicator character ,";break;case "%":r="directive indicator character %";break;case "|":case ">":{r=`block scalar indicator ${t[0]}`;break}case "@":case "`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),Wb(t)}function GP(t,e){return (t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Wb(t.slice(1,-1)).replace(/''/g,"'")}function Wb(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
122
|
+
`,"sy"),r=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
123
|
+
`,"sy");}catch{e=/(.*?)[ \t]*\r?\n/sy,r=/[ \t]*(.*?)[ \t]*\r?\n/sy;}let i=e.exec(t);if(!i)return t;let n=i[1],o=" ",s=e.lastIndex;for(r.lastIndex=s;i=r.exec(t);)i[1]===""?o===`
|
|
124
|
+
`?n+=o:o=`
|
|
125
|
+
`:(n+=o+i[1],o=" "),s=r.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=s,i=a.exec(t),n+o+(i?.[1]??"")}function WP(t,e){let r="";for(let i=1;i<t.length-1;++i){let n=t[i];if(!(n==="\r"&&t[i+1]===`
|
|
126
|
+
`))if(n===`
|
|
127
|
+
`){let{fold:o,offset:s}=YP(t,i);r+=o,i=s;}else if(n==="\\"){let o=t[++i],s=XP[o];if(s)r+=s;else if(o===`
|
|
128
|
+
`)for(o=t[i+1];o===" "||o===" ";)o=t[++i+1];else if(o==="\r"&&t[i+1]===`
|
|
129
|
+
`)for(o=t[++i+1];o===" "||o===" ";)o=t[++i+1];else if(o==="x"||o==="u"||o==="U"){let a={x:2,u:4,U:8}[o];r+=QP(t,i+1,a,e),i+=a;}else {let a=t.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),r+=a;}}else if(n===" "||n===" "){let o=i,s=t[i+1];for(;s===" "||s===" ";)s=t[++i+1];s!==`
|
|
130
|
+
`&&!(s==="\r"&&t[i+2]===`
|
|
131
|
+
`)&&(r+=i>o?t.slice(o,i+1):n);}else r+=n;}return (t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function YP(t,e){let r="",i=t[e+1];for(;(i===" "||i===" "||i===`
|
|
132
|
+
`||i==="\r")&&!(i==="\r"&&t[e+2]!==`
|
|
133
|
+
`);)i===`
|
|
134
|
+
`&&(r+=`
|
|
135
|
+
`),e+=1,i=t[e+1];return r||(r=" "),{fold:r,offset:e}}var XP={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
136
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function QP(t,e,r,i){let n=t.substr(e,r),s=n.length===r&&/^[0-9a-fA-F]+$/.test(n)?parseInt(n,16):NaN;if(isNaN(s)){let a=t.substr(e-2,r+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(s)}Yb.resolveFlowScalar=VP;});var e$=N(Qb=>{var an=K(),Xb=fe(),eO=Eu(),tO=Pu();function nO(t,e,r,i){let{value:n,type:o,comment:s,range:a}=e.type==="block-scalar"?eO.resolveBlockScalar(t,e,i):tO.resolveFlowScalar(e,t.options.strict,i),l=r?t.directives.tagName(r.source,m=>i(r,"TAG_RESOLVE_FAILED",m)):null,u;t.options.stringKeys&&t.atKey?u=t.schema[an.SCALAR]:l?u=rO(t.schema,n,l,r,i):e.type==="scalar"?u=iO(t,n,e,i):u=t.schema[an.SCALAR];let d;try{let m=u.resolve(n,f=>i(r??e,"TAG_RESOLVE_FAILED",f),t.options);d=an.isScalar(m)?m:new Xb.Scalar(m);}catch(m){let f=m instanceof Error?m.message:String(m);i(r??e,"TAG_RESOLVE_FAILED",f),d=new Xb.Scalar(n);}return d.range=a,d.source=n,o&&(d.type=o),l&&(d.tag=l),u.format&&(d.format=u.format),s&&(d.comment=s),d}function rO(t,e,r,i,n){if(r==="!")return t[an.SCALAR];let o=[];for(let a of t.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(e))return a;let s=t.knownTags[r];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:false,test:void 0})),s):(n(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[an.SCALAR])}function iO({atKey:t,directives:e,schema:r},i,n,o){let s=r.tags.find(a=>(a.default===true||t&&a.default==="key")&&a.test?.test(i))||r[an.SCALAR];if(r.compat){let a=r.compat.find(l=>l.default&&l.test?.test(i))??r[an.SCALAR];if(s.tag!==a.tag){let l=e.tagString(s.tag),u=e.tagString(a.tag),d=`Value may be parsed as either ${l} or ${u}`;o(n,"TAG_RESOLVE_FAILED",d,true);}}return s}Qb.composeScalar=nO;});var n$=N(t$=>{function oO(t,e,r){if(e){r??(r=e.length);for(let i=r-1;i>=0;--i){let n=e[i];switch(n.type){case "space":case "comment":case "newline":t-=n.source.length;continue}for(n=e[++i];n?.type==="space";)t+=n.source.length,n=e[++i];break}}return t}t$.emptyScalarPosition=oO;});var o$=N(Cu=>{var sO=Vr(),aO=K(),cO=Jb(),r$=e$(),lO=Hn(),uO=n$(),dO={composeNode:i$,composeEmptyNode:Ou};function i$(t,e,r,i){let n=t.atKey,{spaceBefore:o,comment:s,anchor:a,tag:l}=r,u,d=true;switch(e.type){case "alias":u=mO(t,e,i),(a||l)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case "scalar":case "single-quoted-scalar":case "double-quoted-scalar":case "block-scalar":u=r$.composeScalar(t,e,l,i),a&&(u.anchor=a.source.substring(1));break;case "block-map":case "block-seq":case "flow-collection":u=cO.composeCollection(dO,t,e,r,i),a&&(u.anchor=a.source.substring(1));break;default:{let m=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",m),u=Ou(t,e.offset,void 0,null,r,i),d=false;}}return a&&u.anchor===""&&i(a,"BAD_ALIAS","Anchor cannot be an empty string"),n&&t.options.stringKeys&&(!aO.isScalar(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&i(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(u.spaceBefore=true),s&&(e.type==="scalar"&&e.source===""?u.comment=s:u.commentBefore=s),t.options.keepSourceTokens&&d&&(u.srcToken=e),u}function Ou(t,e,r,i,{spaceBefore:n,comment:o,anchor:s,tag:a,end:l},u){let d={type:"scalar",offset:uO.emptyScalarPosition(e,r,i),indent:-1,source:""},m=r$.composeScalar(t,d,a,u);return s&&(m.anchor=s.source.substring(1),m.anchor===""&&u(s,"BAD_ALIAS","Anchor cannot be an empty string")),n&&(m.spaceBefore=true),o&&(m.comment=o,m.range[2]=l),m}function mO({options:t},{offset:e,source:r,end:i},n){let o=new sO.Alias(r.substring(1));o.source===""&&n(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&n(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",true);let s=e+r.length,a=lO.resolveEnd(i,s,t.strict,n);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}Cu.composeEmptyNode=Ou;Cu.composeNode=i$;});var c$=N(a$=>{var fO=ui(),s$=o$(),pO=Hn(),gO=pi();function hO(t,e,{offset:r,start:i,value:n,end:o},s){let a=Object.assign({_directives:e},t),l=new fO.Document(void 0,a),u={atKey:false,atRoot:true,directives:l.directives,options:l.options,schema:l.schema},d=gO.resolveProps(i,{indicator:"doc-start",next:n??o?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:true});d.found&&(l.directives.docStart=true,n&&(n.type==="block-map"||n.type==="block-seq")&&!d.hasNewline&&s(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=n?s$.composeNode(u,n,d,s):s$.composeEmptyNode(u,d.end,i,null,d,s);let m=l.contents.range[2],f=pO.resolveEnd(o,m,false,s);return f.comment&&(l.comment=f.comment),l.range=[r,m,f.offset],l}a$.composeDoc=hO;});var Nu=N(d$=>{var vO=_t("process"),yO=yl(),bO=ui(),gi=fi(),l$=K(),$O=c$(),_O=Hn();function hi(t){if(typeof t=="number")return [t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return [e,e+(typeof r=="string"?r.length:1)]}function u$(t){let e="",r=false,i=false;for(let n=0;n<t.length;++n){let o=t[n];switch(o[0]){case "#":e+=(e===""?"":i?`
|
|
137
|
+
|
|
138
|
+
`:`
|
|
139
|
+
`)+(o.substring(1)||" "),r=true,i=false;break;case "%":t[n+1]?.[0]!=="#"&&(n+=1),r=false;break;default:r||(i=true),r=false;}}return {comment:e,afterEmptyLine:i}}var Au=class{constructor(e={}){this.doc=null,this.atDirectives=false,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,i,n,o)=>{let s=hi(r);o?this.warnings.push(new gi.YAMLWarning(s,i,n)):this.errors.push(new gi.YAMLParseError(s,i,n));},this.directives=new yO.Directives({version:e.version||"1.2"}),this.options=e;}decorate(e,r){let{comment:i,afterEmptyLine:n}=u$(this.prelude);if(i){let o=e.contents;if(r)e.comment=e.comment?`${e.comment}
|
|
140
|
+
${i}`:i;else if(n||e.directives.docStart||!o)e.commentBefore=i;else if(l$.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];l$.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${i}
|
|
141
|
+
${a}`:i;}else {let s=o.commentBefore;o.commentBefore=s?`${i}
|
|
142
|
+
${s}`:i;}}r?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[];}streamInfo(){return {comment:u$(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=false,i=-1){for(let n of e)yield*this.next(n);yield*this.end(r,i);}*next(e){switch(vO.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case "directive":this.directives.add(e.source,(r,i,n)=>{let o=hi(e);o[0]+=r,this.onError(o,"BAD_DIRECTIVE",i,n);}),this.prelude.push(e.source),this.atDirectives=true;break;case "document":{let r=$O.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,false),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=false;break}case "byte-order-mark":case "space":break;case "comment":case "newline":this.prelude.push(e.source);break;case "error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,i=new gi.YAMLParseError(hi(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case "doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new gi.YAMLParseError(hi(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=true;let r=_O.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,true),r.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
|
|
143
|
+
${r.comment}`:r.comment;}this.doc.range[2]=r.offset;break}default:this.errors.push(new gi.YAMLParseError(hi(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`));}}*end(e=false,r=-1){if(this.doc)this.decorate(this.doc,true),yield this.doc,this.doc=null;else if(e){let i=Object.assign({_directives:this.directives},this.options),n=new bO.Document(void 0,i);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,r,r],this.decorate(n,false),yield n;}}};d$.Composer=Au;});var p$=N(_s=>{var SO=Eu(),wO=Pu(),kO=fi(),m$=Xr();function xO(t,e=true,r){if(t){let i=(n,o,s)=>{let a=typeof n=="number"?n:Array.isArray(n)?n[0]:n.offset;if(r)r(a,o,s);else throw new kO.YAMLParseError([a,a+1],o,s)};switch(t.type){case "scalar":case "single-quoted-scalar":case "double-quoted-scalar":return wO.resolveFlowScalar(t,e,i);case "block-scalar":return SO.resolveBlockScalar({options:{strict:e}},t,i)}}return null}function IO(t,e){let{implicitKey:r=false,indent:i,inFlow:n=false,offset:o=-1,type:s="PLAIN"}=e,a=m$.stringifyString({type:s,value:t},{implicitKey:r,indent:i>0?" ".repeat(i):"",inFlow:n,options:{blockQuote:true,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:i,source:`
|
|
144
|
+
`}];switch(a[0]){case "|":case ">":{let u=a.indexOf(`
|
|
145
|
+
`),d=a.substring(0,u),m=a.substring(u+1)+`
|
|
146
|
+
`,f=[{type:"block-scalar-header",offset:o,indent:i,source:d}];return f$(f,l)||f.push({type:"newline",offset:-1,indent:i,source:`
|
|
147
|
+
`}),{type:"block-scalar",offset:o,indent:i,props:f,source:m}}case '"':return {type:"double-quoted-scalar",offset:o,indent:i,source:a,end:l};case "'":return {type:"single-quoted-scalar",offset:o,indent:i,source:a,end:l};default:return {type:"scalar",offset:o,indent:i,source:a,end:l}}}function EO(t,e,r={}){let{afterKey:i=false,implicitKey:n=false,inFlow:o=false,type:s}=r,a="indent"in t?t.indent:null;if(i&&typeof a=="number"&&(a+=2),!s)switch(t.type){case "single-quoted-scalar":s="QUOTE_SINGLE";break;case "double-quoted-scalar":s="QUOTE_DOUBLE";break;case "block-scalar":{let u=t.props[0];if(u.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=u.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN";}let l=m$.stringifyString({type:s,value:e},{implicitKey:n||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:true,lineWidth:-1}});switch(l[0]){case "|":case ">":TO(t,l);break;case '"':Ru(t,l,"double-quoted-scalar");break;case "'":Ru(t,l,"single-quoted-scalar");break;default:Ru(t,l,"scalar");}}function TO(t,e){let r=e.indexOf(`
|
|
148
|
+
`),i=e.substring(0,r),n=e.substring(r+1)+`
|
|
149
|
+
`;if(t.type==="block-scalar"){let o=t.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=i,t.source=n;}else {let{offset:o}=t,s="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:i}];f$(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:`
|
|
150
|
+
`});for(let l of Object.keys(t))l!=="type"&&l!=="offset"&&delete t[l];Object.assign(t,{type:"block-scalar",indent:s,props:a,source:n});}}function f$(t,e){if(e)for(let r of e)switch(r.type){case "space":case "comment":t.push(r);break;case "newline":return t.push(r),true}return false}function Ru(t,e,r){switch(t.type){case "scalar":case "double-quoted-scalar":case "single-quoted-scalar":t.type=r,t.source=e;break;case "block-scalar":{let i=t.props.slice(1),n=e.length;t.props[0].type==="block-scalar-header"&&(n-=t.props[0].source.length);for(let o of i)o.offset+=n;delete t.props,Object.assign(t,{type:r,source:e,end:i});break}case "block-map":case "block-seq":{let n={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
|
|
151
|
+
`};delete t.items,Object.assign(t,{type:r,source:e,end:[n]});break}default:{let i="indent"in t?t.indent:-1,n="end"in t&&Array.isArray(t.end)?t.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(t))o!=="type"&&o!=="offset"&&delete t[o];Object.assign(t,{type:r,indent:i,source:e,end:n});}}}_s.createScalarToken=IO;_s.resolveAsScalar=xO;_s.setScalarValue=EO;});var h$=N(g$=>{var PO=t=>"type"in t?ws(t):Ss(t);function ws(t){switch(t.type){case "block-scalar":{let e="";for(let r of t.props)e+=ws(r);return e+t.source}case "block-map":case "block-seq":{let e="";for(let r of t.items)e+=Ss(r);return e}case "flow-collection":{let e=t.start.source;for(let r of t.items)e+=Ss(r);for(let r of t.end)e+=r.source;return e}case "document":{let e=Ss(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function Ss({start:t,key:e,sep:r,value:i}){let n="";for(let o of t)n+=o.source;if(e&&(n+=ws(e)),r)for(let o of r)n+=o.source;return i&&(n+=ws(i)),n}g$.stringify=PO;});var $$=N(b$=>{var Du=Symbol("break visit"),OO=Symbol("skip children"),v$=Symbol("remove item");function cn(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),y$(Object.freeze([]),t,e);}cn.BREAK=Du;cn.SKIP=OO;cn.REMOVE=v$;cn.itemAtPath=(t,e)=>{let r=t;for(let[i,n]of e){let o=r?.[i];if(o&&"items"in o)r=o.items[n];else return}return r};cn.parentCollection=(t,e)=>{let r=cn.itemAtPath(t,e.slice(0,-1)),i=e[e.length-1][0],n=r?.[i];if(n&&"items"in n)return n;throw new Error("Parent collection not found")};function y$(t,e,r){let i=r(e,t);if(typeof i=="symbol")return i;for(let n of ["key","value"]){let o=e[n];if(o&&"items"in o){for(let s=0;s<o.items.length;++s){let a=y$(Object.freeze(t.concat([[n,s]])),o.items[s],r);if(typeof a=="number")s=a-1;else {if(a===Du)return Du;a===v$&&(o.items.splice(s,1),s-=1);}}typeof i=="function"&&n==="key"&&(i=i(e,t));}}return typeof i=="function"?i(e,t):i}b$.visit=cn;});var ks=N(Me=>{var Mu=p$(),CO=h$(),AO=$$(),zu="\uFEFF",Lu="",ju="",Uu="",NO=t=>!!t&&"items"in t,RO=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function DO(t){switch(t){case zu:return "<BOM>";case Lu:return "<DOC>";case ju:return "<FLOW_END>";case Uu:return "<SCALAR>";default:return JSON.stringify(t)}}function MO(t){switch(t){case zu:return "byte-order-mark";case Lu:return "doc-mode";case ju:return "flow-error-end";case Uu:return "scalar";case "---":return "doc-start";case "...":return "doc-end";case "":case `
|
|
152
|
+
`:case `\r
|
|
153
|
+
`:return "newline";case "-":return "seq-item-ind";case "?":return "explicit-key-ind";case ":":return "map-value-ind";case "{":return "flow-map-start";case "}":return "flow-map-end";case "[":return "flow-seq-start";case "]":return "flow-seq-end";case ",":return "comma"}switch(t[0]){case " ":case " ":return "space";case "#":return "comment";case "%":return "directive-line";case "*":return "alias";case "&":return "anchor";case "!":return "tag";case "'":return "single-quoted-scalar";case '"':return "double-quoted-scalar";case "|":case ">":return "block-scalar-header"}return null}Me.createScalarToken=Mu.createScalarToken;Me.resolveAsScalar=Mu.resolveAsScalar;Me.setScalarValue=Mu.setScalarValue;Me.stringify=CO.stringify;Me.visit=AO.visit;Me.BOM=zu;Me.DOCUMENT=Lu;Me.FLOW_END=ju;Me.SCALAR=Uu;Me.isCollection=NO;Me.isScalar=RO;Me.prettyToken=DO;Me.tokenType=MO;});var qu=N(S$=>{var vi=ks();function nt(t){switch(t){case void 0:case " ":case `
|
|
154
|
+
`:case "\r":case " ":return true;default:return false}}var _$=new Set("0123456789ABCDEFabcdef"),zO=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),xs=new Set(",[]{}"),LO=new Set(` ,[]{}
|
|
155
|
+
\r `),Fu=t=>!t||LO.has(t),Zu=class{constructor(){this.atEnd=false,this.blockScalarIndent=-1,this.blockScalarKeep=false,this.buffer="",this.flowKey=false,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0;}*lex(e,r=false){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null;}this.atEnd=!r;let i=this.next??"stream";for(;i&&(r||this.hasChars(1));)i=yield*this.parseNext(i);}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return !r||r==="#"||r===`
|
|
156
|
+
`?true:r==="\r"?this.buffer[e+1]===`
|
|
157
|
+
`:false}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let r=this.buffer[e];if(this.indentNext>0){let i=0;for(;r===" ";)r=this.buffer[++i+e];if(r==="\r"){let n=this.buffer[i+e+1];if(n===`
|
|
158
|
+
`||!n&&!this.atEnd)return e+i+1}return r===`
|
|
159
|
+
`||i>=this.indentNext||!r&&!this.atEnd?e+i:-1}if(r==="-"||r==="."){let i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&nt(this.buffer[e+3]))return -1}return e}getLine(){let e=this.lineEndPos;return (typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
160
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case "stream":return yield*this.parseStream();case "line-start":return yield*this.parseLineStart();case "block-start":return yield*this.parseBlockStart();case "doc":return yield*this.parseDocument();case "flow":return yield*this.parseFlowCollection();case "quoted-scalar":return yield*this.parseQuotedScalar();case "block-scalar":return yield*this.parseBlockScalar();case "plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===vi.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let r=e.length,i=e.indexOf("#");for(;i!==-1;){let o=e[i-1];if(o===" "||o===" "){r=i-1;break}else i=e.indexOf("#",i+1);}for(;;){let o=e[r-1];if(o===" "||o===" ")r-=1;else break}let n=(yield*this.pushCount(r))+(yield*this.pushSpaces(true));return yield*this.pushCount(e.length-n),this.pushNewline(),"stream"}if(this.atLineEnd()){let r=yield*this.pushSpaces(true);return yield*this.pushCount(e.length-r),yield*this.pushNewline(),"stream"}return yield vi.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let r=this.peek(3);if((r==="---"||r==="...")&&nt(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,r==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(false),this.indentNext>this.indentValue&&!nt(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&nt(r)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(true));return this.indentNext=this.indentValue+1,this.indentValue+=i,yield*this.parseBlockStart()}return "doc"}*parseDocument(){yield*this.pushSpaces(true);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case "#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case "{":case "[":return yield*this.pushCount(1),this.flowKey=false,this.flowLevel=1,"flow";case "}":case "]":return yield*this.pushCount(1),"doc";case "*":return yield*this.pushUntil(Fu),"doc";case '"':case "'":return yield*this.parseQuotedScalar();case "|":case ">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(true),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,i=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(false),this.indentValue=i=r):r=0,r+=yield*this.pushSpaces(true);while(e+r>0);let n=this.getLine();if(n===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&n[0]!=="#"||i===0&&(n.startsWith("---")||n.startsWith("..."))&&nt(n[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(n[0]==="]"||n[0]==="}")))return this.flowLevel=0,yield vi.FLOW_END,yield*this.parseLineStart();let o=0;for(;n[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(true),this.flowKey=false;switch(o+=yield*this.pushIndicators(),n[o]){case void 0:return "flow";case "#":return yield*this.pushCount(n.length-o),"flow";case "{":case "[":return yield*this.pushCount(1),this.flowKey=false,this.flowLevel+=1,"flow";case "}":case "]":return yield*this.pushCount(1),this.flowKey=true,this.flowLevel-=1,this.flowLevel?"flow":"doc";case "*":return yield*this.pushUntil(Fu),"flow";case '"':case "'":return this.flowKey=true,yield*this.parseQuotedScalar();case ":":{let s=this.charAt(1);if(this.flowKey||nt(s)||s===",")return this.flowKey=false,yield*this.pushCount(1),yield*this.pushSpaces(true),"flow"}default:return this.flowKey=false,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),r=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;r!==-1&&this.buffer[r+1]==="'";)r=this.buffer.indexOf("'",r+2);else for(;r!==-1;){let o=0;for(;this.buffer[r-1-o]==="\\";)o+=1;if(o%2===0)break;r=this.buffer.indexOf('"',r+1);}let i=this.buffer.substring(0,r),n=i.indexOf(`
|
|
161
|
+
`,this.pos);if(n!==-1){for(;n!==-1;){let o=this.continueScalar(n+1);if(o===-1)break;n=i.indexOf(`
|
|
162
|
+
`,o);}n!==-1&&(r=n-(i[n-1]==="\r"?2:1));}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length;}return yield*this.pushToIndex(r+1,false),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=false;let e=this.pos;for(;;){let r=this.buffer[++e];if(r==="+")this.blockScalarKeep=true;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>nt(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,i;e:for(let o=this.pos;i=this.buffer[o];++o)switch(i){case " ":r+=1;break;case `
|
|
163
|
+
`:e=o,r=0;break;case "\r":{let s=this.buffer[o+1];if(!s&&!this.atEnd)return this.setNext("block-scalar");if(s===`
|
|
164
|
+
`)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=r:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let o=this.continueScalar(e+1);if(o===-1)break;e=this.buffer.indexOf(`
|
|
165
|
+
`,o);}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length;}}let n=e+1;for(i=this.buffer[n];i===" ";)i=this.buffer[++n];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
|
|
166
|
+
`;)i=this.buffer[++n];e=n-1;}else if(!this.blockScalarKeep)do{let o=e-1,s=this.buffer[o];s==="\r"&&(s=this.buffer[--o]);let a=o;for(;s===" ";)s=this.buffer[--o];if(s===`
|
|
167
|
+
`&&o>=this.pos&&o+1+r>a)e=o;else break}while(true);return yield vi.SCALAR,yield*this.pushToIndex(e+1,true),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,i=this.pos-1,n;for(;n=this.buffer[++i];)if(n===":"){let o=this.buffer[i+1];if(nt(o)||e&&xs.has(o))break;r=i;}else if(nt(n)){let o=this.buffer[i+1];if(n==="\r"&&(o===`
|
|
168
|
+
`?(i+=1,n=`
|
|
169
|
+
`,o=this.buffer[i+1]):r=i),o==="#"||e&&xs.has(o))break;if(n===`
|
|
170
|
+
`){let s=this.continueScalar(i+1);if(s===-1)break;i=Math.max(i,s-2);}}else {if(e&&xs.has(n))break;r=i;}return !n&&!this.atEnd?this.setNext("plain-scalar"):(yield vi.SCALAR,yield*this.pushToIndex(r+1,true),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.length):(r&&(yield ""),0)}*pushIndicators(){switch(this.charAt(0)){case "!":return (yield*this.pushTag())+(yield*this.pushSpaces(true))+(yield*this.pushIndicators());case "&":return (yield*this.pushUntil(Fu))+(yield*this.pushSpaces(true))+(yield*this.pushIndicators());case "-":case "?":case ":":{let e=this.flowLevel>0,r=this.charAt(1);if(nt(r)||e&&xs.has(r))return e?this.flowKey&&(this.flowKey=false):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(true))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!nt(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,false)}else {let e=this.pos+1,r=this.buffer[e];for(;r;)if(zO.has(r))r=this.buffer[++e];else if(r==="%"&&_$.has(this.buffer[e+1])&&_$.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,false)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
171
|
+
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
172
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,i;do i=this.buffer[++r];while(i===" "||e&&i===" ");let n=r-this.pos;return n>0&&(yield this.buffer.substr(this.pos,n),this.pos=r),n}*pushUntil(e){let r=this.pos,i=this.buffer[r];for(;!e(i);)i=this.buffer[++r];return yield*this.pushToIndex(r,false)}};S$.Lexer=Zu;});var Hu=N(w$=>{var Bu=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,i=this.lineStarts.length;for(;r<i;){let o=r+i>>1;this.lineStarts[o]<e?r=o+1:i=o;}if(this.lineStarts[r]===e)return {line:r+1,col:1};if(r===0)return {line:0,col:e};let n=this.lineStarts[r-1];return {line:r,col:e-n+1}};}};w$.LineCounter=Bu;});var Vu=N(T$=>{var jO=_t("process"),k$=ks(),UO=qu();function jt(t,e){for(let r=0;r<t.length;++r)if(t[r].type===e)return true;return false}function x$(t){for(let e=0;e<t.length;++e)switch(t[e].type){case "space":case "comment":case "newline":break;default:return e}return -1}function E$(t){switch(t?.type){case "alias":case "scalar":case "single-quoted-scalar":case "double-quoted-scalar":case "flow-collection":return true;default:return false}}function Is(t){switch(t.type){case "document":return t.start;case "block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case "block-seq":return t.items[t.items.length-1].start;default:return []}}function Kn(t){if(t.length===0)return [];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case "doc-start":case "explicit-key-ind":case "map-value-ind":case "seq-item-ind":case "newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function I$(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!jt(e.start,"explicit-key-ind")&&!jt(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,E$(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep);}var Ku=class{constructor(e){this.atNewLine=true,this.atScalar=false,this.indent=0,this.offset=0,this.onKeyLine=false,this.stack=[],this.source="",this.type="",this.lexer=new UO.Lexer,this.onNewLine=e;}*parse(e,r=false){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(e,r))yield*this.next(i);r||(yield*this.end());}*next(e){if(this.source=e,jO.env.LOG_TOKENS&&console.log("|",k$.prettyToken(e)),this.atScalar){this.atScalar=false,yield*this.step(),this.offset+=e.length;return}let r=k$.tokenType(e);if(r)if(r==="scalar")this.atNewLine=false,this.atScalar=true,this.type="scalar";else {switch(this.type=r,yield*this.step(),r){case "newline":this.atNewLine=true,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case "space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case "explicit-key-ind":case "map-value-ind":case "seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case "doc-mode":case "flow-error-end":return;default:this.atNewLine=false;}this.offset+=e.length;}else {let i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:e}),this.offset+=e.length;}}*end(){for(;this.stack.length>0;)yield*this.pop();}get sourceToken(){return {type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case "document":return yield*this.document(e);case "alias":case "scalar":case "single-quoted-scalar":case "double-quoted-scalar":return yield*this.scalar(e);case "block-scalar":return yield*this.blockScalar(e);case "block-map":return yield*this.blockMap(e);case "block-seq":return yield*this.blockSequence(e);case "flow-collection":return yield*this.flowCollection(e);case "doc-end":return yield*this.documentEnd(e)}yield*this.pop();}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield {type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else {let i=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in i?i.indent:0:r.type==="flow-collection"&&i.type==="document"&&(r.indent=0),r.type==="flow-collection"&&I$(r),i.type){case "document":i.value=r;break;case "block-scalar":i.props.push(r);break;case "block-map":{let n=i.items[i.items.length-1];if(n.value){i.items.push({start:[],key:r,sep:[]}),this.onKeyLine=true;return}else if(n.sep)n.value=r;else {Object.assign(n,{key:r,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case "block-seq":{let n=i.items[i.items.length-1];n.value?i.items.push({start:[],value:r}):n.value=r;break}case "flow-collection":{let n=i.items[i.items.length-1];!n||n.value?i.items.push({start:[],key:r,sep:[]}):n.sep?n.value=r:Object.assign(n,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r);}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let n=r.items[r.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&x$(n.start)===-1&&(r.indent===0||n.start.every(o=>o.type!=="comment"||o.indent<r.indent))&&(i.type==="document"?i.end=n.start:i.items.push({start:n.start}),r.items.splice(-1,1));}}}*stream(){switch(this.type){case "directive-line":yield {type:"directive",offset:this.offset,source:this.source};return;case "byte-order-mark":case "space":case "comment":case "newline":yield this.sourceToken;return;case "doc-mode":case "doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield {type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source};}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case "doc-start":{x$(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case "anchor":case "tag":case "space":case "comment":case "newline":e.start.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):yield {type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source};}*scalar(e){if(this.type==="map-value-ind"){let r=Is(this.peek(2)),i=Kn(r),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:n}]};this.onKeyLine=true,this.stack[this.stack.length-1]=o;}else yield*this.lineEnd(e);}*blockScalar(e){switch(this.type){case "space":case "comment":case "newline":e.props.push(this.sourceToken);return;case "scalar":if(e.source=this.source,this.atNewLine=true,this.indent=0,this.onNewLine){let r=this.source.indexOf(`
|
|
173
|
+
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
174
|
+
`,r)+1;}yield*this.pop();break;default:yield*this.pop(),yield*this.step();}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case "newline":if(this.onKeyLine=false,r.value){let i="end"in r.value?r.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]});}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case "space":case "comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else {if(this.atIndentedComment(r.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,r.start),n.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken);}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,n=i&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",o=[];if(n&&r.sep&&!r.value){let s=[];for(let a=0;a<r.sep.length;++a){let l=r.sep[a];switch(l.type){case "newline":s.push(a);break;case "space":break;case "comment":l.indent>e.indent&&(s.length=0);break;default:s.length=0;}}s.length>=2&&(o=r.sep.splice(s[1]));}switch(this.type){case "anchor":case "tag":n||r.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=true):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case "explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=true):n||r.value?(o.push(this.sourceToken),e.items.push({start:o,explicitKey:true})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:true}]}),this.onKeyLine=true;return;case "map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(jt(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(E$(r.key)&&!jt(r.sep,"newline")){let s=Kn(r.start),a=r.key,l=r.sep;l.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:l}]});}else o.length>0?r.sep=r.sep.concat(o,this.sourceToken):r.sep.push(this.sourceToken);else if(jt(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else {let s=Kn(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});}else r.sep?r.value||n?e.items.push({start:o,key:null,sep:[this.sourceToken]}):jt(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=true;return;case "alias":case "scalar":case "single-quoted-scalar":case "double-quoted-scalar":{let s=this.flowScalar(this.type);n||r.value?(e.items.push({start:o,key:s,sep:[]}),this.onKeyLine=true):r.sep?this.stack.push(s):(Object.assign(r,{key:s,sep:[]}),this.onKeyLine=true);return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!r.explicitKey&&r.sep&&!jt(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step();}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case "newline":if(r.value){let i="end"in r.value?r.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]});}else r.start.push(this.sourceToken);return;case "space":case "comment":if(r.value)e.items.push({start:[this.sourceToken]});else {if(this.atIndentedComment(r.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,r.start),n.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken);}return;case "anchor":case "tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case "seq-item-ind":if(this.indent!==e.indent)break;r.value||jt(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step();}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case "comma":case "explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case "map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case "space":case "comment":case "newline":case "anchor":case "tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case "alias":case "scalar":case "single-quoted-scalar":case "double-quoted-scalar":{let n=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:n,sep:[]}):r.sep?this.stack.push(n):Object.assign(r,{key:n,sep:[]});return}case "flow-map-end":case "flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step());}else {let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let n=Is(i),o=Kn(n);I$(e);let s=e.end.splice(1,e.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:s}]};this.onKeyLine=true,this.stack[this.stack.length-1]=a;}else yield*this.lineEnd(e);}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(`
|
|
175
|
+
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
176
|
+
`,r)+1;}return {type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case "alias":case "scalar":case "single-quoted-scalar":case "double-quoted-scalar":return this.flowScalar(this.type);case "block-scalar-header":return {type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case "flow-map-start":case "flow-seq-start":return {type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case "seq-item-ind":return {type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case "explicit-key-ind":{this.onKeyLine=true;let r=Is(e),i=Kn(r);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:true}]}}case "map-value-ind":{this.onKeyLine=true;let r=Is(e),i=Kn(r);return {type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?false:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()));}*lineEnd(e){switch(this.type){case "comma":case "doc-start":case "doc-end":case "flow-seq-end":case "flow-map-end":case "map-value-ind":yield*this.pop(),yield*this.step();break;case "newline":this.onKeyLine=false;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop());}}};T$.Parser=Ku;});var N$=N(bi=>{var P$=Nu(),FO=ui(),yi=fi(),ZO=Cl(),qO=K(),BO=Hu(),O$=Vu();function C$(t){let e=t.prettyErrors!==false;return {lineCounter:t.lineCounter||e&&new BO.LineCounter||null,prettyErrors:e}}function HO(t,e={}){let{lineCounter:r,prettyErrors:i}=C$(e),n=new O$.Parser(r?.addNewLine),o=new P$.Composer(e),s=Array.from(o.compose(n.parse(t)));if(i&&r)for(let a of s)a.errors.forEach(yi.prettifyError(t,r)),a.warnings.forEach(yi.prettifyError(t,r));return s.length>0?s:Object.assign([],{empty:true},o.streamInfo())}function A$(t,e={}){let{lineCounter:r,prettyErrors:i}=C$(e),n=new O$.Parser(r?.addNewLine),o=new P$.Composer(e),s=null;for(let a of o.compose(n.parse(t),true,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new yi.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&r&&(s.errors.forEach(yi.prettifyError(t,r)),s.warnings.forEach(yi.prettifyError(t,r))),s}function KO(t,e,r){let i;typeof e=="function"?i=e:r===void 0&&e&&typeof e=="object"&&(r=e);let n=A$(t,r);if(!n)return null;if(n.warnings.forEach(o=>ZO.warn(n.options.logLevel,o)),n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];n.errors=[];}return n.toJS(Object.assign({reviver:i},r))}function VO(t,e,r){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let n=Math.round(r);r=n<1?void 0:n>8?{indent:8}:{indent:n};}if(t===void 0){let{keepUndefined:n}=r??e??{};if(!n)return}return qO.isDocument(t)&&!i?t.toString(r):new FO.Document(t,i,r).toString(r)}bi.parse=KO;bi.parseAllDocuments=HO;bi.parseDocument=A$;bi.stringify=VO;});var Gu=N(J=>{var JO=Nu(),GO=ui(),WO=fu(),Ju=fi(),YO=Vr(),Ut=K(),XO=Dt(),QO=fe(),eC=zt(),tC=Lt(),nC=ks(),rC=qu(),iC=Hu(),oC=Vu(),Es=N$(),R$=qr();J.Composer=JO.Composer;J.Document=GO.Document;J.Schema=WO.Schema;J.YAMLError=Ju.YAMLError;J.YAMLParseError=Ju.YAMLParseError;J.YAMLWarning=Ju.YAMLWarning;J.Alias=YO.Alias;J.isAlias=Ut.isAlias;J.isCollection=Ut.isCollection;J.isDocument=Ut.isDocument;J.isMap=Ut.isMap;J.isNode=Ut.isNode;J.isPair=Ut.isPair;J.isScalar=Ut.isScalar;J.isSeq=Ut.isSeq;J.Pair=XO.Pair;J.Scalar=QO.Scalar;J.YAMLMap=eC.YAMLMap;J.YAMLSeq=tC.YAMLSeq;J.CST=nC;J.Lexer=rC.Lexer;J.LineCounter=iC.LineCounter;J.Parser=oC.Parser;J.parse=Es.parse;J.parseAllDocuments=Es.parseAllDocuments;J.parseDocument=Es.parseDocument;J.stringify=Es.stringify;J.visit=R$.visit;J.visitAsync=R$.visitAsync;});function h(t,e,r){function i(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:false}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,l);let u=s.prototype,d=Object.keys(u);for(let m=0;m<d.length;m++){let f=d[m];f in a||(a[f]=u[f].bind(a));}}let n=r?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:t});function s(a){var l;let u=r?.Parent?new o:this;i(u,a),(l=u._zod).deferred??(l.deferred=[]);for(let d of u._zod.deferred)d();return u}return Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?true:a?._zod?.traits?.has(t)}),Object.defineProperty(s,"name",{value:t}),s}function le(t){return t&&Object.assign($i,t),$i}var Wu,Ts,rt,Ft,$i,Vn=_(()=>{Wu=Object.freeze({status:"aborted"});Ts=Symbol("zod_brand"),rt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");}},Ft=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError";}},$i={};});var x={};ne(x,{BIGINT_FORMAT_RANGES:()=>sd,Class:()=>Xu,NUMBER_FORMAT_RANGES:()=>od,aborted:()=>Ht,allowsEval:()=>td,assert:()=>uC,assertEqual:()=>sC,assertIs:()=>cC,assertNever:()=>lC,assertNotEqual:()=>aC,assignProp:()=>qt,base64ToUint8Array:()=>M$,base64urlToUint8Array:()=>EC,cached:()=>Gn,captureStackTrace:()=>Os,cleanEnum:()=>IC,cleanRegex:()=>wi,clone:()=>Ce,cloneDef:()=>mC,createTransparentProxy:()=>yC,defineLazy:()=>q,esc:()=>Ps,escapeRegex:()=>Ge,extend:()=>_C,finalizeIssue:()=>ze,floatSafeRemainder:()=>Qu,getElementAtPath:()=>fC,getEnumValues:()=>Si,getLengthableOrigin:()=>Ii,getParsedType:()=>vC,getSizableOrigin:()=>xi,hexToUint8Array:()=>PC,isObject:()=>ln,isPlainObject:()=>Bt,issue:()=>Wn,joinValues:()=>b,jsonStringifyReplacer:()=>Jn,merge:()=>wC,mergeDefs:()=>xt,normalizeParams:()=>I,nullish:()=>Zt,numKeys:()=>hC,objectClone:()=>dC,omit:()=>$C,optionalKeys:()=>id,parsedType:()=>k,partial:()=>kC,pick:()=>bC,prefixIssues:()=>Be,primitiveTypes:()=>rd,promiseAllObject:()=>pC,propertyKeyTypes:()=>ki,randomString:()=>gC,required:()=>xC,safeExtend:()=>SC,shallowClone:()=>nd,slugify:()=>ed,stringifyPrimitive:()=>w,uint8ArrayToBase64:()=>z$,uint8ArrayToBase64url:()=>TC,uint8ArrayToHex:()=>OC,unwrapMessage:()=>_i});function sC(t){return t}function aC(t){return t}function cC(t){}function lC(t){throw new Error("Unexpected value in exhaustive check")}function uC(t){}function Si(t){let e=Object.values(t).filter(i=>typeof i=="number");return Object.entries(t).filter(([i,n])=>e.indexOf(+i)===-1).map(([i,n])=>n)}function b(t,e="|"){return t.map(r=>w(r)).join(e)}function Jn(t,e){return typeof e=="bigint"?e.toString():e}function Gn(t){return {get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}}}}function Zt(t){return t==null}function wi(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function Qu(t,e){let r=(t.toString().split(".")[1]||"").length,i=e.toString(),n=(i.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(i)){let l=i.match(/\d?e-(\d?)/);l?.[1]&&(n=Number.parseInt(l[1]));}let o=r>n?r:n,s=Number.parseInt(t.toFixed(o).replace(".","")),a=Number.parseInt(e.toFixed(o).replace(".",""));return s%a/10**o}function q(t,e,r){let i;Object.defineProperty(t,e,{get(){if(i!==D$)return i===void 0&&(i=D$,i=r()),i},set(n){Object.defineProperty(t,e,{value:n});},configurable:true});}function dC(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function qt(t,e,r){Object.defineProperty(t,e,{value:r,writable:true,enumerable:true,configurable:true});}function xt(...t){let e={};for(let r of t){let i=Object.getOwnPropertyDescriptors(r);Object.assign(e,i);}return Object.defineProperties({},e)}function mC(t){return xt(t._zod.def)}function fC(t,e){return e?e.reduce((r,i)=>r?.[i],t):t}function pC(t){let e=Object.keys(t),r=e.map(i=>t[i]);return Promise.all(r).then(i=>{let n={};for(let o=0;o<e.length;o++)n[e[o]]=i[o];return n})}function gC(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<t;i++)r+=e[Math.floor(Math.random()*e.length)];return r}function Ps(t){return JSON.stringify(t)}function ed(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function ln(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Bt(t){if(ln(t)===false)return false;let e=t.constructor;if(e===void 0||typeof e!="function")return true;let r=e.prototype;return !(ln(r)===false||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===false)}function nd(t){return Bt(t)?{...t}:Array.isArray(t)?[...t]:t}function hC(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}function Ge(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ce(t,e,r){let i=new t._zod.constr(e??t._zod.def);return (!e||r?.parent)&&(i._zod.parent=t),i}function I(t){let e=t;if(!e)return {};if(typeof e=="string")return {error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message;}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function yC(t){let e;return new Proxy({},{get(r,i,n){return e??(e=t()),Reflect.get(e,i,n)},set(r,i,n,o){return e??(e=t()),Reflect.set(e,i,n,o)},has(r,i){return e??(e=t()),Reflect.has(e,i)},deleteProperty(r,i){return e??(e=t()),Reflect.deleteProperty(e,i)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,i){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(r,i,n){return e??(e=t()),Reflect.defineProperty(e,i,n)}})}function w(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function id(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function bC(t,e){let r=t._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=xt(t._zod.def,{get shape(){let s={};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(s[a]=r.shape[a]);}return qt(this,"shape",s),s},checks:[]});return Ce(t,o)}function $C(t,e){let r=t._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=xt(t._zod.def,{get shape(){let s={...t._zod.def.shape};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete s[a];}return qt(this,"shape",s),s},checks:[]});return Ce(t,o)}function _C(t,e){if(!Bt(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let o=t._zod.def.shape;for(let s in e)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=xt(t._zod.def,{get shape(){let o={...t._zod.def.shape,...e};return qt(this,"shape",o),o}});return Ce(t,n)}function SC(t,e){if(!Bt(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=xt(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e};return qt(this,"shape",i),i}});return Ce(t,r)}function wC(t,e){let r=xt(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e._zod.def.shape};return qt(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:[]});return Ce(t,r)}function kC(t,e,r){let n=e._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=xt(e._zod.def,{get shape(){let a=e._zod.def.shape,l={...a};if(r)for(let u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(l[u]=t?new t({type:"optional",innerType:a[u]}):a[u]);}else for(let u in a)l[u]=t?new t({type:"optional",innerType:a[u]}):a[u];return qt(this,"shape",l),l},checks:[]});return Ce(e,s)}function xC(t,e,r){let i=xt(e._zod.def,{get shape(){let n=e._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new t({type:"nonoptional",innerType:n[s]}));}else for(let s in n)o[s]=new t({type:"nonoptional",innerType:n[s]});return qt(this,"shape",o),o}});return Ce(e,i)}function Ht(t,e=0){if(t.aborted===true)return true;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==true)return true;return false}function Be(t,e){return e.map(r=>{var i;return (i=r).path??(i.path=[]),r.path.unshift(t),r})}function _i(t){return typeof t=="string"?t:t?.message}function ze(t,e,r){let i={...t,path:t.path??[]};if(!t.message){let n=_i(t.inst?._zod.def?.error?.(t))??_i(e?.error?.(t))??_i(r.customError?.(t))??_i(r.localeError?.(t))??"Invalid input";i.message=n;}return delete i.inst,delete i.continue,e?.reportInput||delete i.input,i}function xi(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function Ii(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function k(t){let e=typeof t;switch(e){case "number":return Number.isNaN(t)?"nan":"number";case "object":{if(t===null)return "null";if(Array.isArray(t))return "array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function Wn(...t){let[e,r,i]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:{...e}}function IC(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function M$(t){let e=atob(t),r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return r}function z$(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function EC(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return M$(e+r)}function TC(t){return z$(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function PC(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)r[i/2]=Number.parseInt(e.slice(i,i+2),16);return r}function OC(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var D$,Os,td,vC,ki,rd,od,sd,Xu,D=_(()=>{D$=Symbol("evaluating");Os="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};td=Gn(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return false;try{let t=Function;return new t(""),!0}catch{return false}});vC=t=>{let e=typeof t;switch(e){case "undefined":return "undefined";case "string":return "string";case "number":return Number.isNaN(t)?"nan":"number";case "boolean":return "boolean";case "function":return "function";case "bigint":return "bigint";case "symbol":return "symbol";case "object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},ki=new Set(["string","number","symbol"]),rd=new Set(["string","number","bigint","boolean","symbol","undefined"]);od={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},sd={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};Xu=class{constructor(...e){}};});function Ti(t,e=r=>r.message){let r={},i=[];for(let n of t.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):i.push(e(n));return {formErrors:i,fieldErrors:r}}function Pi(t,e=r=>r.message){let r={_errors:[]},i=n=>{for(let o of n.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>i({issues:s}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)r._errors.push(e(o));else {let s=r,a=0;for(;a<o.path.length;){let l=o.path[a];a===o.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(e(o))):s[l]=s[l]||{_errors:[]},s=s[l],a++;}}};return i(t),r}function ad(t,e=r=>r.message){let r={errors:[]},i=(n,o=[])=>{var s,a;for(let l of n.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(u=>i({issues:u},l.path));else if(l.code==="invalid_key")i({issues:l.issues},l.path);else if(l.code==="invalid_element")i({issues:l.issues},l.path);else {let u=[...o,...l.path];if(u.length===0){r.errors.push(e(l));continue}let d=r,m=0;for(;m<u.length;){let f=u[m],p=m===u.length-1;typeof f=="string"?(d.properties??(d.properties={}),(s=d.properties)[f]??(s[f]={errors:[]}),d=d.properties[f]):(d.items??(d.items=[]),(a=d.items)[f]??(a[f]={errors:[]}),d=d.items[f]),p&&d.errors.push(e(l)),m++;}}};return i(t),r}function j$(t){let e=[],r=t.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function cd(t){let e=[],r=[...t.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of r)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${j$(i.path)}`);return e.join(`
|
|
177
|
+
`)}var L$,Ei,Le,ld=_(()=>{Vn();D();L$=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:false}),Object.defineProperty(t,"issues",{value:e,enumerable:false}),t.message=JSON.stringify(e,Jn,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:false});},Ei=h("$ZodError",L$),Le=h("$ZodError",L$,{Parent:Error});});var Yn,Cs,Xn,As,Qn,ud,er,dd,Ns,AC,Rs,NC,Ds,RC,Ms,DC,zs,MC,Ls,zC,js,LC,Us,jC,md=_(()=>{Vn();ld();D();Yn=t=>(e,r,i,n)=>{let o=i?Object.assign(i,{async:false}):{async:false},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new rt;if(s.issues.length){let a=new(n?.Err??t)(s.issues.map(l=>ze(l,o,le())));throw Os(a,n?.callee),a}return s.value},Cs=Yn(Le),Xn=t=>async(e,r,i,n)=>{let o=i?Object.assign(i,{async:true}):{async:true},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(n?.Err??t)(s.issues.map(l=>ze(l,o,le())));throw Os(a,n?.callee),a}return s.value},As=Xn(Le),Qn=t=>(e,r,i)=>{let n=i?{...i,async:false}:{async:false},o=e._zod.run({value:r,issues:[]},n);if(o instanceof Promise)throw new rt;return o.issues.length?{success:false,error:new(t??Ei)(o.issues.map(s=>ze(s,n,le())))}:{success:true,data:o.value}},ud=Qn(Le),er=t=>async(e,r,i)=>{let n=i?Object.assign(i,{async:true}):{async:true},o=e._zod.run({value:r,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:false,error:new t(o.issues.map(s=>ze(s,n,le())))}:{success:true,data:o.value}},dd=er(Le),Ns=t=>(e,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Yn(t)(e,r,n)},AC=Ns(Le),Rs=t=>(e,r,i)=>Yn(t)(e,r,i),NC=Rs(Le),Ds=t=>async(e,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Xn(t)(e,r,n)},RC=Ds(Le),Ms=t=>async(e,r,i)=>Xn(t)(e,r,i),DC=Ms(Le),zs=t=>(e,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Qn(t)(e,r,n)},MC=zs(Le),Ls=t=>(e,r,i)=>Qn(t)(e,r,i),zC=Ls(Le),js=t=>async(e,r,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return er(t)(e,r,n)},LC=js(Le),Us=t=>async(e,r,i)=>er(t)(e,r,i),jC=Us(Le);});var We={};ne(We,{base64:()=>Td,base64url:()=>Fs,bigint:()=>Rd,boolean:()=>Md,browserEmail:()=>VC,cidrv4:()=>Id,cidrv6:()=>Ed,cuid:()=>fd,cuid2:()=>pd,date:()=>Od,datetime:()=>Ad,domain:()=>WC,duration:()=>bd,e164:()=>Pd,email:()=>_d,emoji:()=>Sd,extendedDuration:()=>UC,guid:()=>$d,hex:()=>YC,hostname:()=>GC,html5Email:()=>BC,idnEmail:()=>KC,integer:()=>Dd,ipv4:()=>wd,ipv6:()=>kd,ksuid:()=>vd,lowercase:()=>jd,mac:()=>xd,md5_base64:()=>QC,md5_base64url:()=>eA,md5_hex:()=>XC,nanoid:()=>yd,null:()=>zd,number:()=>Zs,rfc5322Email:()=>HC,sha1_base64:()=>nA,sha1_base64url:()=>rA,sha1_hex:()=>tA,sha256_base64:()=>oA,sha256_base64url:()=>sA,sha256_hex:()=>iA,sha384_base64:()=>cA,sha384_base64url:()=>lA,sha384_hex:()=>aA,sha512_base64:()=>dA,sha512_base64url:()=>mA,sha512_hex:()=>uA,string:()=>Nd,time:()=>Cd,ulid:()=>gd,undefined:()=>Ld,unicodeEmail:()=>U$,uppercase:()=>Ud,uuid:()=>un,uuid4:()=>FC,uuid6:()=>ZC,uuid7:()=>qC,xid:()=>hd});function Sd(){return new RegExp(JC,"u")}function Z$(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Cd(t){return new RegExp(`^${Z$(t)}$`)}function Ad(t){let e=Z$({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${e}(?:${r.join("|")})`;return new RegExp(`^${F$}T(?:${i})$`)}function Oi(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function Ci(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var fd,pd,gd,hd,vd,yd,bd,UC,$d,un,FC,ZC,qC,_d,BC,HC,U$,KC,VC,JC,wd,kd,xd,Id,Ed,Td,Fs,GC,WC,Pd,F$,Od,Nd,Rd,Dd,Zs,Md,zd,Ld,jd,Ud,YC,XC,QC,eA,tA,nA,rA,iA,oA,sA,aA,cA,lA,uA,dA,mA,qs=_(()=>{D();fd=/^[cC][^\s-]{8,}$/,pd=/^[0-9a-z]+$/,gd=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,hd=/^[0-9a-vA-V]{20}$/,vd=/^[A-Za-z0-9]{27}$/,yd=/^[a-zA-Z0-9_-]{21}$/,bd=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,UC=/^[-+]?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)?)??$/,$d=/^([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})$/,un=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,FC=un(4),ZC=un(6),qC=un(7),_d=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,BC=/^[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])?)*$/,HC=/^(([^<>()\[\]\\.,;:\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,}))$/,U$=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,KC=U$,VC=/^[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])?)*$/,JC="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";wd=/^(?:(?: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])$/,kd=/^(([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}|:))$/,xd=t=>{let e=Ge(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},Id=/^((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])$/,Ed=/^(([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])$/,Td=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Fs=/^[A-Za-z0-9_-]*$/,GC=/^(?=.{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])?)*\.?$/,WC=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Pd=/^\+[1-9]\d{6,14}$/,F$="(?:(?:\\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])))",Od=new RegExp(`^${F$}$`);Nd=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Rd=/^-?\d+n?$/,Dd=/^-?\d+$/,Zs=/^-?\d+(?:\.\d+)?$/,Md=/^(?:true|false)$/i,zd=/^null$/i,Ld=/^undefined$/i,jd=/^[^A-Z]*$/,Ud=/^[^a-z]*$/,YC=/^[0-9a-fA-F]*$/;XC=/^[0-9a-fA-F]{32}$/,QC=Oi(22,"=="),eA=Ci(22),tA=/^[0-9a-fA-F]{40}$/,nA=Oi(27,"="),rA=Ci(27),iA=/^[0-9a-fA-F]{64}$/,oA=Oi(43,"="),sA=Ci(43),aA=/^[0-9a-fA-F]{96}$/,cA=Oi(64,""),lA=Ci(64),uA=/^[0-9a-fA-F]{128}$/,dA=Oi(86,"=="),mA=Ci(86);});function q$(t,e,r){t.issues.length&&e.issues.push(...Be(r,t.issues));}var te,B$,Bs,Hs,Fd,Zd,qd,Bd,Hd,Kd,Vd,Jd,Gd,tr,Wd,Yd,Xd,Qd,em,tm,nm,rm,im,Ks=_(()=>{Vn();qs();D();te=h("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[]);}),B$={number:"number",bigint:"bigint",object:"date"},Bs=h("$ZodCheckLessThan",(t,e)=>{te.init(t,e);let r=B$[typeof e.value];t._zod.onattach.push(i=>{let n=i._zod.bag,o=(e.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?n.maximum=e.value:n.exclusiveMaximum=e.value);}),t._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort});};}),Hs=h("$ZodCheckGreaterThan",(t,e)=>{te.init(t,e);let r=B$[typeof e.value];t._zod.onattach.push(i=>{let n=i._zod.bag,o=(e.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?n.minimum=e.value:n.exclusiveMinimum=e.value);}),t._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort});};}),Fd=h("$ZodCheckMultipleOf",(t,e)=>{te.init(t,e),t._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=e.value);}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):Qu(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort});};}),Zd=h("$ZodCheckNumberFormat",(t,e)=>{te.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),i=r?"int":"number",[n,o]=od[e.format];t._zod.onattach.push(s=>{let a=s._zod.bag;a.format=e.format,a.minimum=n,a.maximum=o,r&&(a.pattern=Dd);}),t._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:i,format:e.format,code:"invalid_type",continue:false,input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:true,continue:!e.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:true,continue:!e.abort});return}}a<n&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:true,inst:t,continue:!e.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:true,inst:t,continue:!e.abort});};}),qd=h("$ZodCheckBigIntFormat",(t,e)=>{te.init(t,e);let[r,i]=sd[e.format];t._zod.onattach.push(n=>{let o=n._zod.bag;o.format=e.format,o.minimum=r,o.maximum=i;}),t._zod.check=n=>{let o=n.value;o<r&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:true,inst:t,continue:!e.abort}),o>i&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:true,inst:t,continue:!e.abort});};}),Bd=h("$ZodCheckMaxSize",(t,e)=>{var r;te.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return !Zt(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum);}),t._zod.check=i=>{let n=i.value;n.size<=e.maximum||i.issues.push({origin:xi(n),code:"too_big",maximum:e.maximum,inclusive:true,input:n,inst:t,continue:!e.abort});};}),Hd=h("$ZodCheckMinSize",(t,e)=>{var r;te.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return !Zt(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum);}),t._zod.check=i=>{let n=i.value;n.size>=e.minimum||i.issues.push({origin:xi(n),code:"too_small",minimum:e.minimum,inclusive:true,input:n,inst:t,continue:!e.abort});};}),Kd=h("$ZodCheckSizeEquals",(t,e)=>{var r;te.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return !Zt(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.size,n.maximum=e.size,n.size=e.size;}),t._zod.check=i=>{let n=i.value,o=n.size;if(o===e.size)return;let s=o>e.size;i.issues.push({origin:xi(n),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:true,exact:true,input:i.value,inst:t,continue:!e.abort});};}),Vd=h("$ZodCheckMaxLength",(t,e)=>{var r;te.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return !Zt(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum);}),t._zod.check=i=>{let n=i.value;if(n.length<=e.maximum)return;let s=Ii(n);i.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:true,input:n,inst:t,continue:!e.abort});};}),Jd=h("$ZodCheckMinLength",(t,e)=>{var r;te.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return !Zt(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum);}),t._zod.check=i=>{let n=i.value;if(n.length>=e.minimum)return;let s=Ii(n);i.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:true,input:n,inst:t,continue:!e.abort});};}),Gd=h("$ZodCheckLengthEquals",(t,e)=>{var r;te.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return !Zt(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length;}),t._zod.check=i=>{let n=i.value,o=n.length;if(o===e.length)return;let s=Ii(n),a=o>e.length;i.issues.push({origin:s,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:true,exact:true,input:i.value,inst:t,continue:!e.abort});};}),tr=h("$ZodCheckStringFormat",(t,e)=>{var r,i;te.init(t,e),t._zod.onattach.push(n=>{let o=n._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern));}),e.pattern?(r=t._zod).check??(r.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:e.format,input:n.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort});}):(i=t._zod).check??(i.check=()=>{});}),Wd=h("$ZodCheckRegex",(t,e)=>{tr.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort});};}),Yd=h("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=jd),tr.init(t,e);}),Xd=h("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Ud),tr.init(t,e);}),Qd=h("$ZodCheckIncludes",(t,e)=>{te.init(t,e);let r=Ge(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=i,t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i);}),t._zod.check=n=>{n.value.includes(e.includes,e.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:n.value,inst:t,continue:!e.abort});};}),em=h("$ZodCheckStartsWith",(t,e)=>{te.init(t,e);let r=new RegExp(`^${Ge(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r);}),t._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:t,continue:!e.abort});};}),tm=h("$ZodCheckEndsWith",(t,e)=>{te.init(t,e);let r=new RegExp(`.*${Ge(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r);}),t._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:t,continue:!e.abort});};});nm=h("$ZodCheckProperty",(t,e)=>{te.init(t,e),t._zod.check=r=>{let i=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>q$(n,r,e.property));q$(i,r,e.property);};}),rm=h("$ZodCheckMimeType",(t,e)=>{te.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(i=>{i._zod.bag.mime=e.mime;}),t._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:t,continue:!e.abort});};}),im=h("$ZodCheckOverwrite",(t,e)=>{te.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value);};});});var Ai,om=_(()=>{Ai=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e);}indented(e){this.indent+=1,e(this),this.indent-=1;}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let i=e.split(`
|
|
178
|
+
`).filter(s=>s),n=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(n)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s);}compile(){let e=Function,r=this?.args,n=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...r,n.join(`
|
|
179
|
+
`))}};});var sm,am=_(()=>{sm={major:4,minor:3,patch:5};});function Pm(t){if(t==="")return true;if(t.length%4!==0)return false;try{return atob(t),!0}catch{return false}}function r_(t){if(!Fs.test(t))return false;let e=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Pm(r)}function i_(t,e=null){try{let r=t.split(".");if(r.length!==3)return !1;let[i]=r;if(!i)return !1;let n=JSON.parse(atob(i));return !("typ"in n&&n?.typ!=="JWT"||!n.alg||e&&(!("alg"in n)||n.alg!==e))}catch{return false}}function K$(t,e,r){t.issues.length&&e.issues.push(...Be(r,t.issues)),e.value[r]=t.value;}function Ys(t,e,r,i,n){if(t.issues.length){if(n&&!(r in i))return;e.issues.push(...Be(r,t.issues));}t.value===void 0?r in i&&(e.value[r]=void 0):e.value[r]=t.value;}function o_(t){let e=Object.keys(t.shape);for(let i of e)if(!t.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let r=id(t.shape);return {...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function s_(t,e,r,i,n,o){let s=[],a=n.keySet,l=n.catchall._zod,u=l.def.type,d=l.optout==="optional";for(let m in e){if(a.has(m))continue;if(u==="never"){s.push(m);continue}let f=l.run({value:e[m],issues:[]},i);f instanceof Promise?t.push(f.then(p=>Ys(p,r,m,e,d))):Ys(f,r,m,e,d);}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o}),t.length?Promise.all(t).then(()=>r):r}function V$(t,e,r,i){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;let n=t.filter(o=>!Ht(o));return n.length===1?(e.value=n[0].value,n[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>ze(s,i,le())))}),e)}function J$(t,e,r,i){let n=t.filter(o=>o.issues.length===0);return n.length===1?(e.value=n[0].value,e):(n.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(s=>ze(s,i,le())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:false}),e)}function cm(t,e){if(t===e)return {valid:true,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return {valid:true,data:t};if(Bt(t)&&Bt(e)){let r=Object.keys(e),i=Object.keys(t).filter(o=>r.indexOf(o)!==-1),n={...t,...e};for(let o of i){let s=cm(t[o],e[o]);if(!s.valid)return {valid:false,mergeErrorPath:[o,...s.mergeErrorPath]};n[o]=s.data;}return {valid:true,data:n}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return {valid:false,mergeErrorPath:[]};let r=[];for(let i=0;i<t.length;i++){let n=t[i],o=e[i],s=cm(n,o);if(!s.valid)return {valid:false,mergeErrorPath:[i,...s.mergeErrorPath]};r.push(s.data);}return {valid:true,data:r}}return {valid:false,mergeErrorPath:[]}}function G$(t,e,r){let i=new Map,n;for(let a of e.issues)if(a.code==="unrecognized_keys"){n??(n=a);for(let l of a.keys)i.has(l)||i.set(l,{}),i.get(l).l=true;}else t.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let l of a.keys)i.has(l)||i.set(l,{}),i.get(l).r=true;else t.issues.push(a);let o=[...i].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&n&&t.issues.push({...n,keys:o}),Ht(t))return t;let s=cm(e.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return t.value=s.data,t}function Vs(t,e,r){t.issues.length&&e.issues.push(...Be(r,t.issues)),e.value[r]=t.value;}function W$(t,e,r,i,n,o,s){t.issues.length&&(ki.has(typeof i)?r.issues.push(...Be(i,t.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:t.issues.map(a=>ze(a,s,le()))})),e.issues.length&&(ki.has(typeof i)?r.issues.push(...Be(i,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:e.issues.map(a=>ze(a,s,le()))})),r.value.set(t.value,e.value);}function Y$(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value);}function X$(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}function Q$(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function e_(t,e){return !t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}function Js(t,e,r){return t.issues.length?(t.aborted=true,t):e._zod.run({value:t.value,issues:t.issues},r)}function Gs(t,e,r){if(t.issues.length)return t.aborted=true,t;if((r.direction||"forward")==="forward"){let n=e.transform(t.value,t);return n instanceof Promise?n.then(o=>Ws(t,o,e.out,r)):Ws(t,n,e.out,r)}else {let n=e.reverseTransform(t.value,t);return n instanceof Promise?n.then(o=>Ws(t,o,e.in,r)):Ws(t,n,e.in,r)}}function Ws(t,e,r,i){return t.issues.length?(t.aborted=true,t):r._zod.run({value:e,issues:t.issues},i)}function t_(t){return t.value=Object.freeze(t.value),t}function n_(t,e,r,i){if(!t){let n={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(n.params=i._zod.def.params),e.issues.push(Wn(n));}}var j,dn,Q,lm,um,dm,mm,fm,pm,gm,hm,vm,ym,bm,$m,_m,Sm,wm,km,xm,Im,Em,Tm,Om,Cm,Am,Nm,Rm,Xs,Dm,Ni,Qs,Mm,zm,Lm,jm,Um,Fm,Zm,qm,Bm,Hm,a_,Km,Ri,Vm,Jm,Gm,ea,Wm,Ym,Xm,Qm,ef,tf,nf,ta,rf,of,sf,af,cf,lf,uf,df,mf,Di,ff,pf,gf,hf,vf,yf,bf=_(()=>{Ks();Vn();om();md();qs();D();am();D();j=h("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=sm;let i=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&i.unshift(t);for(let n of i)for(let o of n._zod.onattach)o(t);if(i.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse;});else {let n=(s,a,l)=>{let u=Ht(s),d;for(let m of a){if(m._zod.def.when){if(!m._zod.def.when(s))continue}else if(u)continue;let f=s.issues.length,p=m._zod.check(s);if(p instanceof Promise&&l?.async===false)throw new rt;if(d||p instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await p,s.issues.length!==f&&(u||(u=Ht(s,f)));});else {if(s.issues.length===f)continue;u||(u=Ht(s,f));}}return d?d.then(()=>s):s},o=(s,a,l)=>{if(Ht(s))return s.aborted=true,s;let u=n(a,i,l);if(u instanceof Promise){if(l.async===false)throw new rt;return u.then(d=>t._zod.parse(d,l))}return t._zod.parse(u,l)};t._zod.run=(s,a)=>{if(a.skipChecks)return t._zod.parse(s,a);if(a.direction==="backward"){let u=t._zod.parse({value:s.value,issues:[]},{...a,skipChecks:true});return u instanceof Promise?u.then(d=>o(d,s,a)):o(u,s,a)}let l=t._zod.parse(s,a);if(l instanceof Promise){if(a.async===false)throw new rt;return l.then(u=>n(u,i,a))}return n(l,i,a)};}q(t,"~standard",()=>({validate:n=>{try{let o=ud(t,n);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return dd(t,n).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}));}),dn=h("$ZodString",(t,e)=>{j.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Nd(t._zod.bag),t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=String(r.value);}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r};}),Q=h("$ZodStringFormat",(t,e)=>{tr.init(t,e),dn.init(t,e);}),lm=h("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=$d),Q.init(t,e);}),um=h("$ZodUUID",(t,e)=>{if(e.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=un(i));}else e.pattern??(e.pattern=un());Q.init(t,e);}),dm=h("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=_d),Q.init(t,e);}),mm=h("$ZodURL",(t,e)=>{Q.init(t,e),t._zod.check=r=>{try{let i=r.value.trim(),n=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=n.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort});}};}),fm=h("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Sd()),Q.init(t,e);}),pm=h("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=yd),Q.init(t,e);}),gm=h("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=fd),Q.init(t,e);}),hm=h("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=pd),Q.init(t,e);}),vm=h("$ZodULID",(t,e)=>{e.pattern??(e.pattern=gd),Q.init(t,e);}),ym=h("$ZodXID",(t,e)=>{e.pattern??(e.pattern=hd),Q.init(t,e);}),bm=h("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=vd),Q.init(t,e);}),$m=h("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Ad(e)),Q.init(t,e);}),_m=h("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Od),Q.init(t,e);}),Sm=h("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Cd(e)),Q.init(t,e);}),wm=h("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=bd),Q.init(t,e);}),km=h("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=wd),Q.init(t,e),t._zod.bag.format="ipv4";}),xm=h("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=kd),Q.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`);}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort});}};}),Im=h("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=xd(e.delimiter)),Q.init(t,e),t._zod.bag.format="mac";}),Em=h("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Id),Q.init(t,e);}),Tm=h("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Ed),Q.init(t,e),t._zod.check=r=>{let i=r.value.split("/");try{if(i.length!==2)throw new Error;let[n,o]=i;if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`);}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort});}};});Om=h("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Td),Q.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{Pm(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort});};});Cm=h("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Fs),Q.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{r_(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort});};}),Am=h("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Pd),Q.init(t,e);});Nm=h("$ZodJWT",(t,e)=>{Q.init(t,e),t._zod.check=r=>{i_(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort});};}),Rm=h("$ZodCustomStringFormat",(t,e)=>{Q.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort});};}),Xs=h("$ZodNumber",(t,e)=>{j.init(t,e),t._zod.pattern=t._zod.bag.pattern??Zs,t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=Number(r.value);}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let o=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:t,...o?{received:o}:{}}),r};}),Dm=h("$ZodNumberFormat",(t,e)=>{Zd.init(t,e),Xs.init(t,e);}),Ni=h("$ZodBoolean",(t,e)=>{j.init(t,e),t._zod.pattern=Md,t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=!!r.value;}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:t}),r};}),Qs=h("$ZodBigInt",(t,e)=>{j.init(t,e),t._zod.pattern=Rd,t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=BigInt(r.value);}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r};}),Mm=h("$ZodBigIntFormat",(t,e)=>{qd.init(t,e),Qs.init(t,e);}),zm=h("$ZodSymbol",(t,e)=>{j.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:t}),r};}),Lm=h("$ZodUndefined",(t,e)=>{j.init(t,e),t._zod.pattern=Ld,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:t}),r};}),jm=h("$ZodNull",(t,e)=>{j.init(t,e),t._zod.pattern=zd,t._zod.values=new Set([null]),t._zod.parse=(r,i)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:t}),r};}),Um=h("$ZodAny",(t,e)=>{j.init(t,e),t._zod.parse=r=>r;}),Fm=h("$ZodUnknown",(t,e)=>{j.init(t,e),t._zod.parse=r=>r;}),Zm=h("$ZodNever",(t,e)=>{j.init(t,e),t._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r);}),qm=h("$ZodVoid",(t,e)=>{j.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:t}),r};}),Bm=h("$ZodDate",(t,e)=>{j.init(t,e),t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=new Date(r.value);}catch{}let n=r.value,o=n instanceof Date;return o&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:t}),r};});Hm=h("$ZodArray",(t,e)=>{j.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:t}),r;r.value=Array(n.length);let o=[];for(let s=0;s<n.length;s++){let a=n[s],l=e.element._zod.run({value:a,issues:[]},i);l instanceof Promise?o.push(l.then(u=>K$(u,r,s))):K$(l,r,s);}return o.length?Promise.all(o).then(()=>r):r};});a_=h("$ZodObject",(t,e)=>{if(j.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let l={...a};return Object.defineProperty(e,"shape",{value:l}),l}});}let i=Gn(()=>o_(e));q(t._zod,"propValues",()=>{let a=e.shape,l={};for(let u in a){let d=a[u]._zod;if(d.values){l[u]??(l[u]=new Set);for(let m of d.values)l[u].add(m);}}return l});let n=ln,o=e.catchall,s;t._zod.parse=(a,l)=>{s??(s=i.value);let u=a.value;if(!n(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:t}),a;a.value={};let d=[],m=s.shape;for(let f of s.keys){let p=m[f],v=p._zod.optout==="optional",g=p._zod.run({value:u[f],issues:[]},l);g instanceof Promise?d.push(g.then(y=>Ys(y,a,f,u,v))):Ys(g,a,f,u,v);}return o?s_(d,u,a,l,i.value,t):d.length?Promise.all(d).then(()=>a):a};}),Km=h("$ZodObjectJIT",(t,e)=>{a_.init(t,e);let r=t._zod.parse,i=Gn(()=>o_(e)),n=f=>{let p=new Ai(["shape","payload","ctx"]),v=i.value,g=T=>{let C=Ps(T);return `shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};p.write("const input = payload.value;");let y=Object.create(null),S=0;for(let T of v.keys)y[T]=`key_${S++}`;p.write("const newResult = {};");for(let T of v.keys){let C=y[T],P=Ps(T),V=f[T]?._zod?.optout==="optional";p.write(`const ${C} = ${g(T)};`),V?p.write(`
|
|
180
|
+
if (${C}.issues.length) {
|
|
181
|
+
if (${P} in input) {
|
|
182
|
+
payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
|
|
183
|
+
...iss,
|
|
184
|
+
path: iss.path ? [${P}, ...iss.path] : [${P}]
|
|
185
|
+
})));
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (${C}.value === undefined) {
|
|
190
|
+
if (${P} in input) {
|
|
191
|
+
newResult[${P}] = undefined;
|
|
192
|
+
}
|
|
193
|
+
} else {
|
|
194
|
+
newResult[${P}] = ${C}.value;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
`):p.write(`
|
|
198
|
+
if (${C}.issues.length) {
|
|
199
|
+
payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
|
|
200
|
+
...iss,
|
|
201
|
+
path: iss.path ? [${P}, ...iss.path] : [${P}]
|
|
202
|
+
})));
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
if (${C}.value === undefined) {
|
|
206
|
+
if (${P} in input) {
|
|
207
|
+
newResult[${P}] = undefined;
|
|
208
|
+
}
|
|
209
|
+
} else {
|
|
210
|
+
newResult[${P}] = ${C}.value;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
`);}p.write("payload.value = newResult;"),p.write("return payload;");let E=p.compile();return (T,C)=>E(f,T,C)},o,s=ln,a=!$i.jitless,u=a&&td.value,d=e.catchall,m;t._zod.parse=(f,p)=>{m??(m=i.value);let v=f.value;return s(v)?a&&u&&p?.async===false&&p.jitless!==true?(o||(o=n(e.shape)),f=o(f,p),d?s_([],v,f,p,m,t):f):r(f,p):(f.issues.push({expected:"object",code:"invalid_type",input:v,inst:t}),f)};});Ri=h("$ZodUnion",(t,e)=>{j.init(t,e),q(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),q(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),q(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),q(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>wi(o.source)).join("|")})$`)}});let r=e.options.length===1,i=e.options[0]._zod.run;t._zod.parse=(n,o)=>{if(r)return i(n,o);let s=false,a=[];for(let l of e.options){let u=l._zod.run({value:n.value,issues:[]},o);if(u instanceof Promise)a.push(u),s=true;else {if(u.issues.length===0)return u;a.push(u);}}return s?Promise.all(a).then(l=>V$(l,n,t,o)):V$(a,n,t,o)};});Vm=h("$ZodXor",(t,e)=>{Ri.init(t,e),e.inclusive=false;let r=e.options.length===1,i=e.options[0]._zod.run;t._zod.parse=(n,o)=>{if(r)return i(n,o);let s=false,a=[];for(let l of e.options){let u=l._zod.run({value:n.value,issues:[]},o);u instanceof Promise?(a.push(u),s=true):a.push(u);}return s?Promise.all(a).then(l=>J$(l,n,t,o)):J$(a,n,t,o)};}),Jm=h("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=false,Ri.init(t,e);let r=t._zod.parse;q(t._zod,"propValues",()=>{let n={};for(let o of e.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[a,l]of Object.entries(s)){n[a]||(n[a]=new Set);for(let u of l)n[a].add(u);}}return n});let i=Gn(()=>{let n=e.options,o=new Map;for(let s of n){let a=s._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let l of a){if(o.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);o.set(l,s);}}return o});t._zod.parse=(n,o)=>{let s=n.value;if(!ln(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),n;let a=i.value.get(s?.[e.discriminator]);return a?a._zod.run(n,o):e.unionFallback?r(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:s,path:[e.discriminator],inst:t}),n)};}),Gm=h("$ZodIntersection",(t,e)=>{j.init(t,e),t._zod.parse=(r,i)=>{let n=r.value,o=e.left._zod.run({value:n,issues:[]},i),s=e.right._zod.run({value:n,issues:[]},i);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([l,u])=>G$(r,l,u)):G$(r,o,s)};});ea=h("$ZodTuple",(t,e)=>{j.init(t,e);let r=e.items;t._zod.parse=(i,n)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:t,expected:"tuple",code:"invalid_type"}),i;i.value=[];let s=[],a=[...r].reverse().findIndex(d=>d._zod.optin!=="optional"),l=a===-1?0:r.length-a;if(!e.rest){let d=o.length>r.length,m=o.length<l-1;if(d||m)return i.issues.push({...d?{code:"too_big",maximum:r.length,inclusive:true}:{code:"too_small",minimum:r.length},input:o,inst:t,origin:"array"}),i}let u=-1;for(let d of r){if(u++,u>=o.length&&u>=l)continue;let m=d._zod.run({value:o[u],issues:[]},n);m instanceof Promise?s.push(m.then(f=>Vs(f,i,u))):Vs(m,i,u);}if(e.rest){let d=o.slice(r.length);for(let m of d){u++;let f=e.rest._zod.run({value:m,issues:[]},n);f instanceof Promise?s.push(f.then(p=>Vs(p,i,u))):Vs(f,i,u);}}return s.length?Promise.all(s).then(()=>i):i};});Wm=h("$ZodRecord",(t,e)=>{j.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!Bt(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:t}),r;let o=[],s=e.keyType._zod.values;if(s){r.value={};let a=new Set;for(let u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);let d=e.valueType._zod.run({value:n[u],issues:[]},i);d instanceof Promise?o.push(d.then(m=>{m.issues.length&&r.issues.push(...Be(u,m.issues)),r.value[u]=m.value;})):(d.issues.length&&r.issues.push(...Be(u,d.issues)),r.value[u]=d.value);}let l;for(let u in n)a.has(u)||(l=l??[],l.push(u));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:t,keys:l});}else {r.value={};for(let a of Reflect.ownKeys(n)){if(a==="__proto__")continue;let l=e.keyType._zod.run({value:a,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Zs.test(a)&&l.issues.length&&l.issues.some(m=>m.code==="invalid_type"&&m.expected==="number")){let m=e.keyType._zod.run({value:Number(a),issues:[]},i);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(l=m);}if(l.issues.length){e.mode==="loose"?r.value[a]=n[a]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(m=>ze(m,i,le())),input:a,path:[a],inst:t});continue}let d=e.valueType._zod.run({value:n[a],issues:[]},i);d instanceof Promise?o.push(d.then(m=>{m.issues.length&&r.issues.push(...Be(a,m.issues)),r.value[l.value]=m.value;})):(d.issues.length&&r.issues.push(...Be(a,d.issues)),r.value[l.value]=d.value);}}return o.length?Promise.all(o).then(()=>r):r};}),Ym=h("$ZodMap",(t,e)=>{j.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:t}),r;let o=[];r.value=new Map;for(let[s,a]of n){let l=e.keyType._zod.run({value:s,issues:[]},i),u=e.valueType._zod.run({value:a,issues:[]},i);l instanceof Promise||u instanceof Promise?o.push(Promise.all([l,u]).then(([d,m])=>{W$(d,m,r,s,n,t,i);})):W$(l,u,r,s,n,t,i);}return o.length?Promise.all(o).then(()=>r):r};});Xm=h("$ZodSet",(t,e)=>{j.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:t,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let s of n){let a=e.valueType._zod.run({value:s,issues:[]},i);a instanceof Promise?o.push(a.then(l=>Y$(l,r))):Y$(a,r);}return o.length?Promise.all(o).then(()=>r):r};});Qm=h("$ZodEnum",(t,e)=>{j.init(t,e);let r=Si(e.entries),i=new Set(r);t._zod.values=i,t._zod.pattern=new RegExp(`^(${r.filter(n=>ki.has(typeof n)).map(n=>typeof n=="string"?Ge(n):n.toString()).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return i.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:t}),n};}),ef=h("$ZodLiteral",(t,e)=>{if(j.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?Ge(i):i?Ge(i.toString()):String(i)).join("|")})$`),t._zod.parse=(i,n)=>{let o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),i};}),tf=h("$ZodFile",(t,e)=>{j.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:t}),r};}),nf=h("$ZodTransform",(t,e)=>{j.init(t,e),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Ft(t.constructor.name);let n=e.transform(r.value,r);if(i.async)return (n instanceof Promise?n:Promise.resolve(n)).then(s=>(r.value=s,r));if(n instanceof Promise)throw new rt;return r.value=n,r};});ta=h("$ZodOptional",(t,e)=>{j.init(t,e),t._zod.optin="optional",t._zod.optout="optional",q(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),q(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${wi(r.source)})?$`):void 0}),t._zod.parse=(r,i)=>{if(e.innerType._zod.optin==="optional"){let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>X$(o,r.value)):X$(n,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,i)};}),rf=h("$ZodExactOptional",(t,e)=>{ta.init(t,e),q(t._zod,"values",()=>e.innerType._zod.values),q(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,i)=>e.innerType._zod.run(r,i);}),of=h("$ZodNullable",(t,e)=>{j.init(t,e),q(t._zod,"optin",()=>e.innerType._zod.optin),q(t._zod,"optout",()=>e.innerType._zod.optout),q(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${wi(r.source)}|null)$`):void 0}),q(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,i)=>r.value===null?r:e.innerType._zod.run(r,i);}),sf=h("$ZodDefault",(t,e)=>{j.init(t,e),t._zod.optin="optional",q(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);if(r.value===void 0)return r.value=e.defaultValue,r;let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>Q$(o,e)):Q$(n,e)};});af=h("$ZodPrefault",(t,e)=>{j.init(t,e),t._zod.optin="optional",q(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,i));}),cf=h("$ZodNonOptional",(t,e)=>{j.init(t,e),q(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),t._zod.parse=(r,i)=>{let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>e_(o,t)):e_(n,t)};});lf=h("$ZodSuccess",(t,e)=>{j.init(t,e),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Ft("ZodSuccess");let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.issues.length===0,r)):(r.value=n.issues.length===0,r)};}),uf=h("$ZodCatch",(t,e)=>{j.init(t,e),q(t._zod,"optin",()=>e.innerType._zod.optin),q(t._zod,"optout",()=>e.innerType._zod.optout),q(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>ze(s,i,le()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=e.catchValue({...r,error:{issues:n.issues.map(o=>ze(o,i,le()))},input:r.value}),r.issues=[]),r)};}),df=h("$ZodNaN",(t,e)=>{j.init(t,e),t._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r);}),mf=h("$ZodPipe",(t,e)=>{j.init(t,e),q(t._zod,"values",()=>e.in._zod.values),q(t._zod,"optin",()=>e.in._zod.optin),q(t._zod,"optout",()=>e.out._zod.optout),q(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,i)=>{if(i.direction==="backward"){let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>Js(s,e.in,i)):Js(o,e.in,i)}let n=e.in._zod.run(r,i);return n instanceof Promise?n.then(o=>Js(o,e.out,i)):Js(n,e.out,i)};});Di=h("$ZodCodec",(t,e)=>{j.init(t,e),q(t._zod,"values",()=>e.in._zod.values),q(t._zod,"optin",()=>e.in._zod.optin),q(t._zod,"optout",()=>e.out._zod.optout),q(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){let o=e.in._zod.run(r,i);return o instanceof Promise?o.then(s=>Gs(s,e,i)):Gs(o,e,i)}else {let o=e.out._zod.run(r,i);return o instanceof Promise?o.then(s=>Gs(s,e,i)):Gs(o,e,i)}};});ff=h("$ZodReadonly",(t,e)=>{j.init(t,e),q(t._zod,"propValues",()=>e.innerType._zod.propValues),q(t._zod,"values",()=>e.innerType._zod.values),q(t._zod,"optin",()=>e.innerType?._zod?.optin),q(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(t_):t_(n)};});pf=h("$ZodTemplateLiteral",(t,e)=>{j.init(t,e);let r=[];for(let i of e.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let n=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(o,s));}else if(i===null||rd.has(typeof i))r.push(Ge(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(i,n)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:t,expected:"string",code:"invalid_type"}),i):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),i);}),gf=h("$ZodFunction",(t,e)=>(j.init(t,e),t._def=e,t._zod.def=e,t.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...i){let n=t._def.input?Cs(t._def.input,i):i,o=Reflect.apply(r,this,n);return t._def.output?Cs(t._def.output,o):o}},t.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let n=t._def.input?await As(t._def.input,i):i,o=await Reflect.apply(r,this,n);return t._def.output?await As(t._def.output,o):o}},t._zod.parse=(r,i)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:t}),r):(t._def.output&&t._def.output._zod.def.type==="promise"?r.value=t.implementAsync(r.value):r.value=t.implement(r.value),r),t.input=(...r)=>{let i=t.constructor;return Array.isArray(r[0])?new i({type:"function",input:new ea({type:"tuple",items:r[0],rest:r[1]}),output:t._def.output}):new i({type:"function",input:r[0],output:t._def.output})},t.output=r=>{let i=t.constructor;return new i({type:"function",input:t._def.input,output:r})},t)),hf=h("$ZodPromise",(t,e)=>{j.init(t,e),t._zod.parse=(r,i)=>Promise.resolve(r.value).then(n=>e.innerType._zod.run({value:n,issues:[]},i));}),vf=h("$ZodLazy",(t,e)=>{j.init(t,e),q(t._zod,"innerType",()=>e.getter()),q(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),q(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),q(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),q(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(r,i)=>t._zod.innerType._zod.run(r,i);}),yf=h("$ZodCustom",(t,e)=>{te.init(t,e),j.init(t,e),t._zod.parse=(r,i)=>r,t._zod.check=r=>{let i=r.value,n=e.fn(i);if(n instanceof Promise)return n.then(o=>n_(o,r,i,t));n_(n,r,i,t);};});});function c_(){return {localeError:pA()}}var pA,l_=_(()=>{D();pA=()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(n){return t[n]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case "invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${w(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:o.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${o.suffix}"`:o.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${o.includes}"`:o.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${o.pattern}`:`${r[o.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case "not_multiple_of":return `\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case "unrecognized_keys":return `\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${b(n.keys,"\u060C ")}`;case "invalid_key":return `\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case "invalid_union":return "\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case "invalid_element":return `\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return "\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};});function u_(){return {localeError:gA()}}var gA,d_=_(()=>{D();gA=()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(n){return t[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${a}`}case "invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${w(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[o.format]??n.format}`}case "not_multiple_of":return `Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case "unrecognized_keys":return `Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${b(n.keys,", ")}`;case "invalid_key":return `${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case "invalid_union":return "Yanl\u0131\u015F d\u0259y\u0259r";case "invalid_element":return `${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return "Yanl\u0131\u015F d\u0259y\u0259r"}}};});function m_(t,e,r,i){let n=Math.abs(t),o=n%10,s=n%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?r:i}function f_(){return {localeError:hA()}}var hA,p_=_(()=>{D();hA=()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(n){return t[n]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case "invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${w(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);if(s){let a=Number(n.maximum),l=m_(a,s.unit.one,s.unit.few,s.unit.many);return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${n.maximum.toString()} ${l}`}return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);if(s){let a=Number(n.minimum),l=m_(a,s.unit.one,s.unit.few,s.unit.many);return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${o}${n.minimum.toString()} ${l}`}return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[o.format]??n.format}`}case "not_multiple_of":return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case "unrecognized_keys":return `\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${b(n.keys,", ")}`;case "invalid_key":return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case "invalid_union":return "\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case "invalid_element":return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return "\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};});function g_(){return {localeError:vA()}}var vA,h_=_(()=>{D();vA=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(n){return t[n]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case "invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${w(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${o}${n.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;if(o.format==="starts_with")return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${o.prefix}"`;if(o.format==="ends_with")return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${o.suffix}"`;if(o.format==="includes")return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${o.includes}"`;if(o.format==="regex")return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${o.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${r[o.format]??n.format}`}case "not_multiple_of":return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case "unrecognized_keys":return `\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${b(n.keys,", ")}`;case "invalid_key":return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case "invalid_union":return "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case "invalid_element":return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};});function v_(){return {localeError:yA()}}var yA,y_=_(()=>{D();yA=()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(n){return t[n]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${a}`}case "invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${w(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${b(n.values," o ")}`;case "too_big":{let o=n.inclusive?"com a m\xE0xim":"menys de",s=e(n.origin);return s?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${o} ${n.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?"com a m\xEDnim":"m\xE9s de",s=e(n.origin);return s?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${o} ${n.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${r[o.format]??n.format}`}case "not_multiple_of":return `N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case "unrecognized_keys":return `Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${b(n.keys,", ")}`;case "invalid_key":return `Clau inv\xE0lida a ${n.origin}`;case "invalid_union":return "Entrada inv\xE0lida";case "invalid_element":return `Element inv\xE0lid a ${n.origin}`;default:return "Entrada inv\xE0lida"}}};});function b_(){return {localeError:bA()}}var bA,$_=_(()=>{D();bA=()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(n){return t[n]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${a}`}case "invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${w(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${r[o.format]??n.format}`}case "not_multiple_of":return `Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case "unrecognized_keys":return `Nezn\xE1m\xE9 kl\xED\u010De: ${b(n.keys,", ")}`;case "invalid_key":return `Neplatn\xFD kl\xED\u010D v ${n.origin}`;case "invalid_union":return "Neplatn\xFD vstup";case "invalid_element":return `Neplatn\xE1 hodnota v ${n.origin}`;default:return "Neplatn\xFD vstup"}}};});function __(){return {localeError:$A()}}var $A,S_=_(()=>{D();$A=()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(n){return t[n]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${a}`:`Ugyldigt input: forventede ${o}, fik ${a}`}case "invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${w(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin),a=i[n.origin]??n.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${o} ${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${o} ${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin),a=i[n.origin]??n.origin;return s?`For lille: forventede ${a} ${s.verb} ${o} ${n.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${o} ${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.format]??n.format}`}case "not_multiple_of":return `Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case "unrecognized_keys":return `${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${b(n.keys,", ")}`;case "invalid_key":return `Ugyldig n\xF8gle i ${n.origin}`;case "invalid_union":return "Ugyldigt input: matcher ingen af de tilladte typer";case "invalid_element":return `Ugyldig v\xE6rdi i ${n.origin}`;default:return "Ugyldigt input"}}};});function w_(){return {localeError:_A()}}var _A,k_=_(()=>{D();_A=()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(n){return t[n]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},i={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${a}`}case "invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${w(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case "invalid_format":{let o=n;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${r[o.format]??n.format}`}case "not_multiple_of":return `Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case "unrecognized_keys":return `${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${b(n.keys,", ")}`;case "invalid_key":return `Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case "invalid_union":return "Ung\xFCltige Eingabe";case "invalid_element":return `Ung\xFCltiger Wert in ${n.origin}`;default:return "Ung\xFCltige Eingabe"}}};});function na(){return {localeError:SA()}}var SA,$f=_(()=>{D();SA=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(n){return t[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return `Invalid input: expected ${o}, received ${a}`}case "invalid_value":return n.values.length===1?`Invalid input: expected ${w(n.values[0])}`:`Invalid option: expected one of ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case "not_multiple_of":return `Invalid number: must be a multiple of ${n.divisor}`;case "unrecognized_keys":return `Unrecognized key${n.keys.length>1?"s":""}: ${b(n.keys,", ")}`;case "invalid_key":return `Invalid key in ${n.origin}`;case "invalid_union":return "Invalid input";case "invalid_element":return `Invalid value in ${n.origin}`;default:return "Invalid input"}}};});function x_(){return {localeError:wA()}}var wA,I_=_(()=>{D();wA=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(n){return t[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${a}`}case "invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${w(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${o}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.format]??n.format}`}case "not_multiple_of":return `Nevalida nombro: devas esti oblo de ${n.divisor}`;case "unrecognized_keys":return `Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${b(n.keys,", ")}`;case "invalid_key":return `Nevalida \u015Dlosilo en ${n.origin}`;case "invalid_union":return "Nevalida enigo";case "invalid_element":return `Nevalida valoro en ${n.origin}`;default:return "Nevalida enigo"}}};});function E_(){return {localeError:kA()}}var kA,T_=_(()=>{D();kA=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(n){return t[n]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${a}`}case "invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${w(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin),a=i[n.origin]??n.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${o}${n.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin),a=i[n.origin]??n.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${o}${n.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${r[o.format]??n.format}`}case "not_multiple_of":return `N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case "unrecognized_keys":return `Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${b(n.keys,", ")}`;case "invalid_key":return `Llave inv\xE1lida en ${i[n.origin]??n.origin}`;case "invalid_union":return "Entrada inv\xE1lida";case "invalid_element":return `Valor inv\xE1lido en ${i[n.origin]??n.origin}`;default:return "Entrada inv\xE1lida"}}};});function P_(){return {localeError:xA()}}var xA,O_=_(()=>{D();xA=()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(n){return t[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case "invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${w(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${b(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case "invalid_format":{let o=n;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[o.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case "not_multiple_of":return `\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case "unrecognized_keys":return `\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${b(n.keys,", ")}`;case "invalid_key":return `\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case "invalid_union":return "\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case "invalid_element":return `\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return "\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};});function C_(){return {localeError:IA()}}var IA,A_=_(()=>{D();IA=()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(n){return t[n]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${a}`}case "invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${w(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${o}${n.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${o}${n.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${r[o.format]??n.format}`}case "not_multiple_of":return `Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case "unrecognized_keys":return `${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${b(n.keys,", ")}`;case "invalid_key":return "Virheellinen avain tietueessa";case "invalid_union":return "Virheellinen unioni";case "invalid_element":return "Virheellinen arvo joukossa";default:return "Virheellinen sy\xF6te"}}};});function N_(){return {localeError:EA()}}var EA,R_=_(()=>{D();EA=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return t[n]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN",number:"nombre",array:"tableau"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${a} re\xE7u`}case "invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${w(n.values[0])} attendu`:`Option invalide : une valeur parmi ${b(n.values,"|")} attendue`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Trop grand : ${n.origin??"valeur"} doit ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n.origin??"valeur"} doit \xEAtre ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Trop petit : ${n.origin} doit ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Trop petit : ${n.origin} doit \xEAtre ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${r[o.format]??n.format} invalide`}case "not_multiple_of":return `Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case "unrecognized_keys":return `Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${b(n.keys,", ")}`;case "invalid_key":return `Cl\xE9 invalide dans ${n.origin}`;case "invalid_union":return "Entr\xE9e invalide";case "invalid_element":return `Valeur invalide dans ${n.origin}`;default:return "Entr\xE9e invalide"}}};});function D_(){return {localeError:TA()}}var TA,M_=_(()=>{D();TA=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return t[n]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${a}`}case "invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${w(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"\u2264":"<",s=e(n.origin);return s?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?"\u2265":">",s=e(n.origin);return s?`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${r[o.format]??n.format} invalide`}case "not_multiple_of":return `Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case "unrecognized_keys":return `Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${b(n.keys,", ")}`;case "invalid_key":return `Cl\xE9 invalide dans ${n.origin}`;case "invalid_union":return "Entr\xE9e invalide";case "invalid_element":return `Valeur invalide dans ${n.origin}`;default:return "Entr\xE9e invalide"}}};});function z_(){return {localeError:PA()}}var PA,L_=_(()=>{D();PA=()=>{let t={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=u=>u?t[u]:void 0,i=u=>{let d=r(u);return d?d.label:u??t.unknown.label},n=u=>`\u05D4${i(u)}`,o=u=>(r(u)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=u=>u?e[u]??null:null,a={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},l={nan:"NaN"};return u=>{switch(u.code){case "invalid_type":{let d=u.expected,m=l[d??""]??i(d),f=k(u.input),p=l[f]??t[f]?.label??f;return /^[A-Z]/.test(u.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${u.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${p}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}, \u05D4\u05EA\u05E7\u05D1\u05DC ${p}`}case "invalid_value":{if(u.values.length===1)return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${w(u.values[0])}`;let d=u.values.map(p=>w(p));if(u.values.length===2)return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d[0]} \u05D0\u05D5 ${d[1]}`;let m=d[d.length-1];return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d.slice(0,-1).join(", ")} \u05D0\u05D5 ${m}`}case "too_big":{let d=s(u.origin),m=n(u.origin??"value");if(u.origin==="string")return `${d?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.maximum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(u.origin==="number"){let v=u.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${u.maximum}`;return `\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${v}`}if(u.origin==="array"||u.origin==="set"){let v=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",g=u.inclusive?`${u.maximum} ${d?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${u.maximum} ${d?.unit??""}`;return `\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${m} ${v} \u05DC\u05D4\u05DB\u05D9\u05DC ${g}`.trim()}let f=u.inclusive?"<=":"<",p=o(u.origin??"value");return d?.unit?`${d.longLabel} \u05DE\u05D3\u05D9: ${m} ${p} ${f}${u.maximum.toString()} ${d.unit}`:`${d?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${m} ${p} ${f}${u.maximum.toString()}`}case "too_small":{let d=s(u.origin),m=n(u.origin??"value");if(u.origin==="string")return `${d?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.minimum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(u.origin==="number"){let v=u.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${u.minimum}`;return `\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${m} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${v}`}if(u.origin==="array"||u.origin==="set"){let v=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(u.minimum===1&&u.inclusive){let y=(u.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return `\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${m} ${v} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`}let g=u.inclusive?`${u.minimum} ${d?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${u.minimum} ${d?.unit??""}`;return `\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${m} ${v} \u05DC\u05D4\u05DB\u05D9\u05DC ${g}`.trim()}let f=u.inclusive?">=":">",p=o(u.origin??"value");return d?.unit?`${d.shortLabel} \u05DE\u05D3\u05D9: ${m} ${p} ${f}${u.minimum.toString()} ${d.unit}`:`${d?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${m} ${p} ${f}${u.minimum.toString()}`}case "invalid_format":{let d=u;if(d.format==="starts_with")return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${d.prefix}"`;if(d.format==="ends_with")return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${d.suffix}"`;if(d.format==="includes")return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${d.includes}"`;if(d.format==="regex")return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${d.pattern}`;let m=a[d.format],f=m?.label??d.format,v=(m?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return `${f} \u05DC\u05D0 ${v}`}case "not_multiple_of":return `\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${u.divisor}`;case "unrecognized_keys":return `\u05DE\u05E4\u05EA\u05D7${u.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${u.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${b(u.keys,", ")}`;case "invalid_key":return "\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case "invalid_union":return "\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case "invalid_element":return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(u.origin??"array")}`;default:return "\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};});function j_(){return {localeError:OA()}}var OA,U_=_(()=>{D();OA=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(n){return t[n]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${a}`}case "invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${w(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${n.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${o}${n.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[o.format]??n.format}`}case "not_multiple_of":return `\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case "unrecognized_keys":return `Ismeretlen kulcs${n.keys.length>1?"s":""}: ${b(n.keys,", ")}`;case "invalid_key":return `\xC9rv\xE9nytelen kulcs ${n.origin}`;case "invalid_union":return "\xC9rv\xE9nytelen bemenet";case "invalid_element":return `\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return "\xC9rv\xE9nytelen bemenet"}}};});function F_(t,e,r){return Math.abs(t)===1?e:r}function nr(t){if(!t)return "";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=t[t.length-1];return t+(e.includes(r)?"\u0576":"\u0568")}function Z_(){return {localeError:CA()}}var CA,q_=_(()=>{D();CA=()=>{let t={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function e(n){return t[n]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case "invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${w(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);if(s){let a=Number(n.maximum),l=F_(a,s.unit.one,s.unit.many);return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${nr(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${n.maximum.toString()} ${l}`}return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${nr(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);if(s){let a=Number(n.minimum),l=F_(a,s.unit.one,s.unit.many);return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${nr(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${n.minimum.toString()} ${l}`}return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${nr(n.origin)} \u056C\u056B\u0576\u056B ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[o.format]??n.format}`}case "not_multiple_of":return `\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case "unrecognized_keys":return `\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${b(n.keys,", ")}`;case "invalid_key":return `\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${nr(n.origin)}-\u0578\u0582\u0574`;case "invalid_union":return "\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case "invalid_element":return `\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${nr(n.origin)}-\u0578\u0582\u0574`;default:return "\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};});function B_(){return {localeError:AA()}}var AA,H_=_(()=>{D();AA=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(n){return t[n]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${o}, diterima ${a}`}case "invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${w(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${r[o.format]??n.format} tidak valid`}case "not_multiple_of":return `Angka tidak valid: harus kelipatan dari ${n.divisor}`;case "unrecognized_keys":return `Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${b(n.keys,", ")}`;case "invalid_key":return `Kunci tidak valid di ${n.origin}`;case "invalid_union":return "Input tidak valid";case "invalid_element":return `Nilai tidak valid di ${n.origin}`;default:return "Input tidak valid"}}};});function K_(){return {localeError:NA()}}var NA,V_=_(()=>{D();NA=()=>{let t={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(n){return t[n]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${o}`}case "invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${w(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${o}${n.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${o}${n.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${r[o.format]??n.format}`}case "not_multiple_of":return `R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case "unrecognized_keys":return `\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${b(n.keys,", ")}`;case "invalid_key":return `Rangur lykill \xED ${n.origin}`;case "invalid_union":return "Rangt gildi";case "invalid_element":return `Rangt gildi \xED ${n.origin}`;default:return "Rangt gildi"}}};});function J_(){return {localeError:RA()}}var RA,G_=_(()=>{D();RA=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(n){return t[n]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${a}`:`Input non valido: atteso ${o}, ricevuto ${a}`}case "invalid_value":return n.values.length===1?`Input non valido: atteso ${w(n.values[0])}`:`Opzione non valida: atteso uno tra ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case "not_multiple_of":return `Numero non valido: deve essere un multiplo di ${n.divisor}`;case "unrecognized_keys":return `Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${b(n.keys,", ")}`;case "invalid_key":return `Chiave non valida in ${n.origin}`;case "invalid_union":return "Input non valido";case "invalid_element":return `Valore non valido in ${n.origin}`;default:return "Input non valido"}}};});function W_(){return {localeError:DA()}}var DA,Y_=_(()=>{D();DA=()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(n){return t[n]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case "invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${w(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${b(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case "too_big":{let o=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=e(n.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${s.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case "too_small":{let o=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=e(n.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${s.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case "invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[o.format]??n.format}`}case "not_multiple_of":return `\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case "unrecognized_keys":return `\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${b(n.keys,"\u3001")}`;case "invalid_key":return `${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case "invalid_union":return "\u7121\u52B9\u306A\u5165\u529B";case "invalid_element":return `${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return "\u7121\u52B9\u306A\u5165\u529B"}}};});function X_(){return {localeError:MA()}}var MA,Q_=_(()=>{D();MA=()=>{let t={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(n){return t[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case "invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${w(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${b(n.values,"|")}-\u10D3\u10D0\u10DC`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.prefix}"-\u10D8\u10D7`:o.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${o.suffix}"-\u10D8\u10D7`:o.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${o.includes}"-\u10E1`:o.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[o.format]??n.format}`}case "not_multiple_of":return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case "unrecognized_keys":return `\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${b(n.keys,", ")}`;case "invalid_key":return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case "invalid_union":return "\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case "invalid_element":return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return "\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};});function ra(){return {localeError:zA()}}var zA,_f=_(()=>{D();zA=()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(n){return t[n]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},i={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case "invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${w(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${o.prefix}"`:o.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${o.suffix}"`:o.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${o.includes}"`:o.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[o.format]??n.format}`}case "not_multiple_of":return `\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case "unrecognized_keys":return `\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${b(n.keys,", ")}`;case "invalid_key":return `\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case "invalid_union":return "\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case "invalid_element":return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return "\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};});function eS(){return ra()}var tS=_(()=>{_f();});function nS(){return {localeError:LA()}}var LA,rS=_(()=>{D();LA=()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(n){return t[n]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case "invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${w(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${b(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case "too_big":{let o=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(n.origin),l=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${l} ${o}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${o}${s}`}case "too_small":{let o=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(n.origin),l=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${l} ${o}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${o}${s}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[o.format]??n.format}`}case "not_multiple_of":return `\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case "unrecognized_keys":return `\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${b(n.keys,", ")}`;case "invalid_key":return `\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case "invalid_union":return "\uC798\uBABB\uB41C \uC785\uB825";case "invalid_element":return `\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return "\uC798\uBABB\uB41C \uC785\uB825"}}};});function iS(t){let e=Math.abs(t),r=e%10,i=e%100;return i>=11&&i<=19||r===0?"many":r===1?"one":"few"}function oS(){return {localeError:jA()}}var Mi,jA,sS=_(()=>{D();Mi=t=>t.charAt(0).toUpperCase()+t.slice(1);jA=()=>{let t={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(n,o,s,a){let l=t[n]??null;return l===null?l:{unit:l.unit[o],verb:l.verb[a][s?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},i={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${o}`}case "invalid_value":return n.values.length===1?`Privalo b\u016Bti ${w(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${b(n.values,"|")} pasirinkim\u0173`;case "too_big":{let o=i[n.origin]??n.origin,s=e(n.origin,iS(Number(n.maximum)),n.inclusive??false,"smaller");if(s?.verb)return `${Mi(o??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.maximum.toString()} ${s.unit??"element\u0173"}`;let a=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return `${Mi(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.maximum.toString()} ${s?.unit}`}case "too_small":{let o=i[n.origin]??n.origin,s=e(n.origin,iS(Number(n.minimum)),n.inclusive??false,"bigger");if(s?.verb)return `${Mi(o??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.minimum.toString()} ${s.unit??"element\u0173"}`;let a=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return `${Mi(o??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.minimum.toString()} ${s?.unit}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${r[o.format]??n.format}`}case "not_multiple_of":return `Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case "unrecognized_keys":return `Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${b(n.keys,", ")}`;case "invalid_key":return "Rastas klaidingas raktas";case "invalid_union":return "Klaidinga \u012Fvestis";case "invalid_element":{let o=i[n.origin]??n.origin;return `${Mi(o??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return "Klaidinga \u012Fvestis"}}};});function aS(){return {localeError:UA()}}var UA,cS=_(()=>{D();UA=()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(n){return t[n]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case "invalid_value":return n.values.length===1?`Invalid input: expected ${w(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case "not_multiple_of":return `\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case "unrecognized_keys":return `${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${b(n.keys,", ")}`;case "invalid_key":return `\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case "invalid_union":return "\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case "invalid_element":return `\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return "\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};});function lS(){return {localeError:FA()}}var FA,uS=_(()=>{D();FA=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(n){return t[n]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${a}`:`Input tidak sah: dijangka ${o}, diterima ${a}`}case "invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${w(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${r[o.format]??n.format} tidak sah`}case "not_multiple_of":return `Nombor tidak sah: perlu gandaan ${n.divisor}`;case "unrecognized_keys":return `Kunci tidak dikenali: ${b(n.keys,", ")}`;case "invalid_key":return `Kunci tidak sah dalam ${n.origin}`;case "invalid_union":return "Input tidak sah";case "invalid_element":return `Nilai tidak sah dalam ${n.origin}`;default:return "Input tidak sah"}}};});function dS(){return {localeError:ZA()}}var ZA,mS=_(()=>{D();ZA=()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(n){return t[n]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},i={nan:"NaN",number:"getal"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${o}, ontving ${a}`}case "invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${w(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin),a=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin),a=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case "invalid_format":{let o=n;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${r[o.format]??n.format}`}case "not_multiple_of":return `Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case "unrecognized_keys":return `Onbekende key${n.keys.length>1?"s":""}: ${b(n.keys,", ")}`;case "invalid_key":return `Ongeldige key in ${n.origin}`;case "invalid_union":return "Ongeldige invoer";case "invalid_element":return `Ongeldige waarde in ${n.origin}`;default:return "Ongeldige invoer"}}};});function fS(){return {localeError:qA()}}var qA,pS=_(()=>{D();qA=()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(n){return t[n]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${a}`:`Ugyldig input: forventet ${o}, fikk ${a}`}case "invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${w(n.values[0])}`:`Ugyldig valg: forventet en av ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${r[o.format]??n.format}`}case "not_multiple_of":return `Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case "unrecognized_keys":return `${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${b(n.keys,", ")}`;case "invalid_key":return `Ugyldig n\xF8kkel i ${n.origin}`;case "invalid_union":return "Ugyldig input";case "invalid_element":return `Ugyldig verdi i ${n.origin}`;default:return "Ugyldig input"}}};});function gS(){return {localeError:BA()}}var BA,hS=_(()=>{D();BA=()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(n){return t[n]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${a}`}case "invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${w(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmal\u0131yd\u0131.`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} olmal\u0131yd\u0131.`}case "invalid_format":{let o=n;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[o.format]??n.format}`}case "not_multiple_of":return `F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case "unrecognized_keys":return `Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${b(n.keys,", ")}`;case "invalid_key":return `${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case "invalid_union":return "Giren tan\u0131namad\u0131.";case "invalid_element":return `${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return "K\u0131ymet tan\u0131namad\u0131."}}};});function vS(){return {localeError:HA()}}var HA,yS=_(()=>{D();HA=()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(n){return t[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case "invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${w(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${b(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0648\u064A`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0648\u064A`}case "invalid_format":{let o=n;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[o.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case "not_multiple_of":return `\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case "unrecognized_keys":return `\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${b(n.keys,", ")}`;case "invalid_key":return `\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case "invalid_union":return "\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case "invalid_element":return `\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return "\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};});function bS(){return {localeError:KA()}}var KA,$S=_(()=>{D();KA=()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(n){return t[n]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},i={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${a}`}case "invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${w(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[o.format]??n.format}`}case "not_multiple_of":return `Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case "unrecognized_keys":return `Nierozpoznane klucze${n.keys.length>1?"s":""}: ${b(n.keys,", ")}`;case "invalid_key":return `Nieprawid\u0142owy klucz w ${n.origin}`;case "invalid_union":return "Nieprawid\u0142owe dane wej\u015Bciowe";case "invalid_element":return `Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return "Nieprawid\u0142owe dane wej\u015Bciowe"}}};});function _S(){return {localeError:VA()}}var VA,SS=_(()=>{D();VA=()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(n){return t[n]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${a}`:`Tipo inv\xE1lido: esperado ${o}, recebido ${a}`}case "invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${w(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${r[o.format]??n.format} inv\xE1lido`}case "not_multiple_of":return `N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case "unrecognized_keys":return `Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${b(n.keys,", ")}`;case "invalid_key":return `Chave inv\xE1lida em ${n.origin}`;case "invalid_union":return "Entrada inv\xE1lida";case "invalid_element":return `Valor inv\xE1lido em ${n.origin}`;default:return "Campo inv\xE1lido"}}};});function wS(t,e,r,i){let n=Math.abs(t),o=n%10,s=n%100;return s>=11&&s<=19?i:o===1?e:o>=2&&o<=4?r:i}function kS(){return {localeError:JA()}}var JA,xS=_(()=>{D();JA=()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(n){return t[n]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case "invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${w(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);if(s){let a=Number(n.maximum),l=wS(a,s.unit.one,s.unit.few,s.unit.many);return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${n.maximum.toString()} ${l}`}return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);if(s){let a=Number(n.minimum),l=wS(a,s.unit.one,s.unit.few,s.unit.many);return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${n.minimum.toString()} ${l}`}return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[o.format]??n.format}`}case "not_multiple_of":return `\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case "unrecognized_keys":return `\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${b(n.keys,", ")}`;case "invalid_key":return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case "invalid_union":return "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case "invalid_element":return `\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};});function IS(){return {localeError:GA()}}var GA,ES=_(()=>{D();GA=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(n){return t[n]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${a}`}case "invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${w(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${r[o.format]??n.format}`}case "not_multiple_of":return `Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case "unrecognized_keys":return `Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${b(n.keys,", ")}`;case "invalid_key":return `Neveljaven klju\u010D v ${n.origin}`;case "invalid_union":return "Neveljaven vnos";case "invalid_element":return `Neveljavna vrednost v ${n.origin}`;default:return "Neveljaven vnos"}}};});function TS(){return {localeError:WA()}}var WA,PS=_(()=>{D();WA=()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(n){return t[n]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${a}`}case "invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${w(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${r[o.format]??n.format}`}case "not_multiple_of":return `Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case "unrecognized_keys":return `${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${b(n.keys,", ")}`;case "invalid_key":return `Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case "invalid_union":return "Ogiltig input";case "invalid_element":return `Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return "Ogiltig input"}}};});function OS(){return {localeError:YA()}}var YA,CS=_(()=>{D();YA=()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(n){return t[n]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case "invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${w(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${b(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${o}${n.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${o}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case "invalid_format":{let o=n;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[o.format]??n.format}`}case "not_multiple_of":return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case "unrecognized_keys":return `\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${b(n.keys,", ")}`;case "invalid_key":return `${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case "invalid_union":return "\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case "invalid_element":return `${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return "\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};});function AS(){return {localeError:XA()}}var XA,NS=_(()=>{D();XA=()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(n){return t[n]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},i={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case "invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${w(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=e(n.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=e(n.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${o.prefix}"`:o.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${o.suffix}"`:o.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[o.format]??n.format}`}case "not_multiple_of":return `\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case "unrecognized_keys":return `\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${b(n.keys,", ")}`;case "invalid_key":return `\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case "invalid_union":return "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case "invalid_element":return `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};});function RS(){return {localeError:QA()}}var QA,DS=_(()=>{D();QA=()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(n){return t[n]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${a}`}case "invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${w(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.format]??n.format}`}case "not_multiple_of":return `Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case "unrecognized_keys":return `Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${b(n.keys,", ")}`;case "invalid_key":return `${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case "invalid_union":return "Ge\xE7ersiz de\u011Fer";case "invalid_element":return `${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return "Ge\xE7ersiz de\u011Fer"}}};});function ia(){return {localeError:eN()}}var eN,Sf=_(()=>{D();eN=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(n){return t[n]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case "invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${w(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[o.format]??n.format}`}case "not_multiple_of":return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case "unrecognized_keys":return `\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${b(n.keys,", ")}`;case "invalid_key":return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case "invalid_union":return "\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case "invalid_element":return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return "\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};});function MS(){return ia()}var zS=_(()=>{Sf();});function LS(){return {localeError:tN()}}var tN,jS=_(()=>{D();tN=()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(n){return t[n]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case "invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${w(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${b(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${o}${n.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${o}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case "invalid_format":{let o=n;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[o.format]??n.format}`}case "not_multiple_of":return `\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case "unrecognized_keys":return `\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${b(n.keys,"\u060C ")}`;case "invalid_key":return `${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case "invalid_union":return "\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case "invalid_element":return `${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return "\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};});function US(){return {localeError:nN()}}var nN,FS=_(()=>{D();nN=()=>{let t={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"}};function e(n){return t[n]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${a}`}case "invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${w(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[o.format]??n.format}`}case "not_multiple_of":return `Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case "unrecognized_keys":return `Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${b(n.keys,", ")}`;case "invalid_key":return `${n.origin} dagi kalit noto\u2018g\u2018ri`;case "invalid_union":return "Noto\u2018g\u2018ri kirish";case "invalid_element":return `${n.origin} da noto\u2018g\u2018ri qiymat`;default:return "Noto\u2018g\u2018ri kirish"}}};});function ZS(){return {localeError:rN()}}var rN,qS=_(()=>{D();rN=()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(n){return t[n]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case "invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${w(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${r[o.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case "not_multiple_of":return `S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case "unrecognized_keys":return `Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${b(n.keys,", ")}`;case "invalid_key":return `Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case "invalid_union":return "\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case "invalid_element":return `Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return "\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};});function BS(){return {localeError:iN()}}var iN,HS=_(()=>{D();iN=()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(n){return t[n]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case "invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${w(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${r[o.format]??n.format}`}case "not_multiple_of":return `\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case "unrecognized_keys":return `\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${b(n.keys,", ")}`;case "invalid_key":return `${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case "invalid_union":return "\u65E0\u6548\u8F93\u5165";case "invalid_element":return `${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return "\u65E0\u6548\u8F93\u5165"}}};});function KS(){return {localeError:oN()}}var oN,VS=_(()=>{D();oN=()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(n){return t[n]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${a}`}case "invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${w(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${r[o.format]??n.format}`}case "not_multiple_of":return `\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case "unrecognized_keys":return `\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${b(n.keys,"\u3001")}`;case "invalid_key":return `${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case "invalid_union":return "\u7121\u6548\u7684\u8F38\u5165\u503C";case "invalid_element":return `${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return "\u7121\u6548\u7684\u8F38\u5165\u503C"}}};});function JS(){return {localeError:sN()}}var sN,GS=_(()=>{D();sN=()=>{let t={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(n){return t[n]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case "invalid_type":{let o=i[n.expected]??n.expected,s=k(n.input),a=i[s]??s;return /^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case "invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${w(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${b(n.values,"|")}`;case "too_big":{let o=n.inclusive?"<=":"<",s=e(n.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${s.verb} ${o}${n.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.maximum}`}case "too_small":{let o=n.inclusive?">=":">",s=e(n.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${s.verb} ${o}${n.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.minimum}`}case "invalid_format":{let o=n;return o.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${r[o.format]??n.format}`}case "not_multiple_of":return `N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case "unrecognized_keys":return `B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${b(n.keys,", ")}`;case "invalid_key":return `B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case "invalid_union":return "\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case "invalid_element":return `Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return "\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};});var zi={};ne(zi,{ar:()=>c_,az:()=>u_,be:()=>f_,bg:()=>g_,ca:()=>v_,cs:()=>b_,da:()=>__,de:()=>w_,en:()=>na,eo:()=>x_,es:()=>E_,fa:()=>P_,fi:()=>C_,fr:()=>N_,frCA:()=>D_,he:()=>z_,hu:()=>j_,hy:()=>Z_,id:()=>B_,is:()=>K_,it:()=>J_,ja:()=>W_,ka:()=>X_,kh:()=>eS,km:()=>ra,ko:()=>nS,lt:()=>oS,mk:()=>aS,ms:()=>lS,nl:()=>dS,no:()=>fS,ota:()=>gS,pl:()=>bS,ps:()=>vS,pt:()=>_S,ru:()=>kS,sl:()=>IS,sv:()=>TS,ta:()=>OS,th:()=>AS,tr:()=>RS,ua:()=>MS,uk:()=>ia,ur:()=>LS,uz:()=>US,vi:()=>ZS,yo:()=>JS,zhCN:()=>BS,zhTW:()=>KS});var wf=_(()=>{l_();d_();p_();h_();y_();$_();S_();k_();$f();I_();T_();O_();A_();R_();M_();L_();U_();q_();H_();V_();G_();Y_();Q_();tS();_f();rS();sS();cS();uS();mS();pS();hS();yS();$S();SS();xS();ES();PS();CS();NS();DS();zS();Sf();jS();FS();qS();HS();VS();GS();});function sa(){return new oa}var WS,kf,xf,oa,ke,Li=_(()=>{kf=Symbol("ZodOutput"),xf=Symbol("ZodInput"),oa=class{constructor(){this._map=new WeakMap,this._idmap=new Map;}add(e,...r){let i=r[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let i={...this.get(r)??{}};delete i.id;let n={...i,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};(WS=globalThis).__zod_globalRegistry??(WS.__zod_globalRegistry=sa());ke=globalThis.__zod_globalRegistry;});function If(t,e){return new t({type:"string",...I(e)})}function Ef(t,e){return new t({type:"string",coerce:true,...I(e)})}function aa(t,e){return new t({type:"string",format:"email",check:"string_format",abort:false,...I(e)})}function ji(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:false,...I(e)})}function ca(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:false,...I(e)})}function la(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:false,version:"v4",...I(e)})}function ua(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:false,version:"v6",...I(e)})}function da(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:false,version:"v7",...I(e)})}function Ui(t,e){return new t({type:"string",format:"url",check:"string_format",abort:false,...I(e)})}function ma(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:false,...I(e)})}function fa(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:false,...I(e)})}function pa(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:false,...I(e)})}function ga(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:false,...I(e)})}function ha(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:false,...I(e)})}function va(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:false,...I(e)})}function ya(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:false,...I(e)})}function ba(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:false,...I(e)})}function $a(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:false,...I(e)})}function Tf(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:false,...I(e)})}function _a(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:false,...I(e)})}function Sa(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:false,...I(e)})}function wa(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:false,...I(e)})}function ka(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:false,...I(e)})}function xa(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:false,...I(e)})}function Ia(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:false,...I(e)})}function Of(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:false,local:false,precision:null,...I(e)})}function Cf(t,e){return new t({type:"string",format:"date",check:"string_format",...I(e)})}function Af(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...I(e)})}function Nf(t,e){return new t({type:"string",format:"duration",check:"string_format",...I(e)})}function Rf(t,e){return new t({type:"number",checks:[],...I(e)})}function Df(t,e){return new t({type:"number",coerce:true,checks:[],...I(e)})}function Mf(t,e){return new t({type:"number",check:"number_format",abort:false,format:"safeint",...I(e)})}function zf(t,e){return new t({type:"number",check:"number_format",abort:false,format:"float32",...I(e)})}function Lf(t,e){return new t({type:"number",check:"number_format",abort:false,format:"float64",...I(e)})}function jf(t,e){return new t({type:"number",check:"number_format",abort:false,format:"int32",...I(e)})}function Uf(t,e){return new t({type:"number",check:"number_format",abort:false,format:"uint32",...I(e)})}function Ff(t,e){return new t({type:"boolean",...I(e)})}function Zf(t,e){return new t({type:"boolean",coerce:true,...I(e)})}function qf(t,e){return new t({type:"bigint",...I(e)})}function Bf(t,e){return new t({type:"bigint",coerce:true,...I(e)})}function Hf(t,e){return new t({type:"bigint",check:"bigint_format",abort:false,format:"int64",...I(e)})}function Kf(t,e){return new t({type:"bigint",check:"bigint_format",abort:false,format:"uint64",...I(e)})}function Vf(t,e){return new t({type:"symbol",...I(e)})}function Jf(t,e){return new t({type:"undefined",...I(e)})}function Gf(t,e){return new t({type:"null",...I(e)})}function Wf(t){return new t({type:"any"})}function Yf(t){return new t({type:"unknown"})}function Xf(t,e){return new t({type:"never",...I(e)})}function Qf(t,e){return new t({type:"void",...I(e)})}function ep(t,e){return new t({type:"date",...I(e)})}function tp(t,e){return new t({type:"date",coerce:true,...I(e)})}function np(t,e){return new t({type:"nan",...I(e)})}function ft(t,e){return new Bs({check:"less_than",...I(e),value:t,inclusive:false})}function He(t,e){return new Bs({check:"less_than",...I(e),value:t,inclusive:true})}function pt(t,e){return new Hs({check:"greater_than",...I(e),value:t,inclusive:false})}function Ae(t,e){return new Hs({check:"greater_than",...I(e),value:t,inclusive:true})}function Ea(t){return pt(0,t)}function Ta(t){return ft(0,t)}function Pa(t){return He(0,t)}function Oa(t){return Ae(0,t)}function Kt(t,e){return new Fd({check:"multiple_of",...I(e),value:t})}function Vt(t,e){return new Bd({check:"max_size",...I(e),maximum:t})}function gt(t,e){return new Hd({check:"min_size",...I(e),minimum:t})}function mn(t,e){return new Kd({check:"size_equals",...I(e),size:t})}function fn(t,e){return new Vd({check:"max_length",...I(e),maximum:t})}function It(t,e){return new Jd({check:"min_length",...I(e),minimum:t})}function pn(t,e){return new Gd({check:"length_equals",...I(e),length:t})}function rr(t,e){return new Wd({check:"string_format",format:"regex",...I(e),pattern:t})}function ir(t){return new Yd({check:"string_format",format:"lowercase",...I(t)})}function or(t){return new Xd({check:"string_format",format:"uppercase",...I(t)})}function sr(t,e){return new Qd({check:"string_format",format:"includes",...I(e),includes:t})}function ar(t,e){return new em({check:"string_format",format:"starts_with",...I(e),prefix:t})}function cr(t,e){return new tm({check:"string_format",format:"ends_with",...I(e),suffix:t})}function Ca(t,e,r){return new nm({check:"property",property:t,schema:e,...I(r)})}function lr(t,e){return new rm({check:"mime_type",mime:t,...I(e)})}function it(t){return new im({check:"overwrite",tx:t})}function ur(t){return it(e=>e.normalize(t))}function dr(){return it(t=>t.trim())}function mr(){return it(t=>t.toLowerCase())}function fr(){return it(t=>t.toUpperCase())}function pr(){return it(t=>ed(t))}function rp(t,e,r){return new t({type:"array",element:e,...I(r)})}function cN(t,e,r){return new t({type:"union",options:e,...I(r)})}function lN(t,e,r){return new t({type:"union",options:e,inclusive:false,...I(r)})}function uN(t,e,r,i){return new t({type:"union",options:r,discriminator:e,...I(i)})}function dN(t,e,r){return new t({type:"intersection",left:e,right:r})}function mN(t,e,r,i){let n=r instanceof j,o=n?i:r,s=n?r:null;return new t({type:"tuple",items:e,rest:s,...I(o)})}function fN(t,e,r,i){return new t({type:"record",keyType:e,valueType:r,...I(i)})}function pN(t,e,r,i){return new t({type:"map",keyType:e,valueType:r,...I(i)})}function gN(t,e,r){return new t({type:"set",valueType:e,...I(r)})}function hN(t,e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new t({type:"enum",entries:i,...I(r)})}function vN(t,e,r){return new t({type:"enum",entries:e,...I(r)})}function yN(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...I(r)})}function ip(t,e){return new t({type:"file",...I(e)})}function bN(t,e){return new t({type:"transform",transform:e})}function $N(t,e){return new t({type:"optional",innerType:e})}function _N(t,e){return new t({type:"nullable",innerType:e})}function SN(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():nd(r)}})}function wN(t,e,r){return new t({type:"nonoptional",innerType:e,...I(r)})}function kN(t,e){return new t({type:"success",innerType:e})}function xN(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function IN(t,e,r){return new t({type:"pipe",in:e,out:r})}function EN(t,e){return new t({type:"readonly",innerType:e})}function TN(t,e,r){return new t({type:"template_literal",parts:e,...I(r)})}function PN(t,e){return new t({type:"lazy",getter:e})}function ON(t,e){return new t({type:"promise",innerType:e})}function op(t,e,r){let i=I(r);return i.abort??(i.abort=true),new t({type:"custom",check:"custom",fn:e,...i})}function sp(t,e,r){return new t({type:"custom",check:"custom",fn:e,...I(r)})}function ap(t){let e=YS(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(Wn(i,r.value,e._zod.def));else {let n=i;n.fatal&&(n.continue=false),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=e),n.continue??(n.continue=!e._zod.def.abort),r.issues.push(Wn(n));}},t(r.value,r)));return e}function YS(t,e){let r=new te({check:"custom",...I(e)});return r._zod.check=t,r}function cp(t){let e=new te({check:"describe"});return e._zod.onattach=[r=>{let i=ke.get(r)??{};ke.add(r,{...i,description:t});}],e._zod.check=()=>{},e}function lp(t){let e=new te({check:"meta"});return e._zod.onattach=[r=>{let i=ke.get(r)??{};ke.add(r,{...i,...t});}],e._zod.check=()=>{},e}function up(t,e){let r=I(e),i=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(p=>typeof p=="string"?p.toLowerCase():p),n=n.map(p=>typeof p=="string"?p.toLowerCase():p));let o=new Set(i),s=new Set(n),a=t.Codec??Di,l=t.Boolean??Ni,u=t.String??dn,d=new u({type:"string",error:r.error}),m=new l({type:"boolean",error:r.error}),f=new a({type:"pipe",in:d,out:m,transform:((p,v)=>{let g=p;return r.case!=="sensitive"&&(g=g.toLowerCase()),o.has(g)?true:s.has(g)?false:(v.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:v.value,inst:f,continue:false}),{})}),reverseTransform:((p,v)=>p===true?i[0]||"true":n[0]||"false"),error:r.error});return f}function gr(t,e,r,i={}){let n=I(i),o={...I(i),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:a=>r.test(a),...n};return r instanceof RegExp&&(o.pattern=r),new t(o)}var Pf,XS=_(()=>{Ks();Li();bf();D();Pf={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};});function Jt(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??ke,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function G(t,e,r={path:[],schemaPath:[]}){var i;let n=t._zod.def,o=e.seen.get(t);if(o)return o.count++,r.schemaPath.includes(t)&&(o.cycle=r.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,s);let a=t._zod.toJSONSchema?.();if(a)s.schema=a;else {let d={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,s.schema,d);else {let f=s.schema,p=e.processors[n.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);p(t,e,f,d);}let m=t._zod.parent;m&&(s.ref||(s.ref=m),G(m,e,d),e.seen.get(m).isParent=true);}let l=e.metadataRegistry.get(t);return l&&Object.assign(s.schema,l),e.io==="input"&&Ne(t)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&s.schema._prefault&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(t).schema}function Gt(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let s of t.seen.entries()){let a=t.metadataRegistry.get(s[0])?.id;if(a){let l=i.get(a);if(l&&l!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(a,s[0]);}}let n=s=>{let a=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let m=t.external.registry.get(s[0])?.id,f=t.external.uri??(v=>v);if(m)return {ref:f(m)};let p=s[1].defId??s[1].schema.id??`schema${t.counter++}`;return s[1].defId=p,{defId:p,ref:`${f("__shared")}#/${a}/${p}`}}if(s[1]===r)return {ref:"#"};let u=`#/${a}/`,d=s[1].schema.id??`__schema${t.counter++}`;return {defId:d,ref:u+d}},o=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:l,defId:u}=n(s);a.def={...a.schema},u&&(a.defId=u);let d=a.schema;for(let m in d)delete d[m];d.$ref=l;};if(t.cycles==="throw")for(let s of t.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
214
|
+
|
|
215
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of t.seen.entries()){let a=s[1];if(e===s[0]){o(s);continue}if(t.external){let u=t.external.registry.get(s[0])?.id;if(e!==s[0]&&u){o(s);continue}}if(t.metadataRegistry.get(s[0])?.id){o(s);continue}if(a.cycle){o(s);continue}if(a.count>1&&t.reused==="ref"){o(s);continue}}}function Wt(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=s=>{let a=t.seen.get(s);if(a.ref===null)return;let l=a.def??a.schema,u={...l},d=a.ref;if(a.ref=null,d){i(d);let f=t.seen.get(d),p=f.schema;if(p.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(p)):Object.assign(l,p),Object.assign(l,u),s._zod.parent===d)for(let g in l)g==="$ref"||g==="allOf"||g in u||delete l[g];if(p.$ref)for(let g in l)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(l[g])===JSON.stringify(f.def[g])&&delete l[g];}let m=s._zod.parent;if(m&&m!==d){i(m);let f=t.seen.get(m);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(let p in l)p==="$ref"||p==="allOf"||p in f.def&&JSON.stringify(l[p])===JSON.stringify(f.def[p])&&delete l[p];}t.override({zodSchema:s,jsonSchema:l,path:a.path??[]});};for(let s of [...t.seen.entries()].reverse())i(s[0]);let n={};if(t.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let s=t.external.registry.get(e)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=t.external.uri(s);}Object.assign(n,r.def??r.schema);let o=t.external?.defs??{};for(let s of t.seen.entries()){let a=s[1];a.def&&a.defId&&(o[a.defId]=a.def);}t.external||Object.keys(o).length>0&&(t.target==="draft-2020-12"?n.$defs=o:n.definitions=o);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...e["~standard"],jsonSchema:{input:hr(e,"input",t.processors),output:hr(e,"output",t.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Ne(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return false;r.seen.add(t);let i=t._zod.def;if(i.type==="transform")return true;if(i.type==="array")return Ne(i.element,r);if(i.type==="set")return Ne(i.valueType,r);if(i.type==="lazy")return Ne(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return Ne(i.innerType,r);if(i.type==="intersection")return Ne(i.left,r)||Ne(i.right,r);if(i.type==="record"||i.type==="map")return Ne(i.keyType,r)||Ne(i.valueType,r);if(i.type==="pipe")return Ne(i.in,r)||Ne(i.out,r);if(i.type==="object"){for(let n in i.shape)if(Ne(i.shape[n],r))return true;return false}if(i.type==="union"){for(let n of i.options)if(Ne(n,r))return true;return false}if(i.type==="tuple"){for(let n of i.items)if(Ne(n,r))return true;return !!(i.rest&&Ne(i.rest,r))}return false}var dp,hr,Fi=_(()=>{Li();dp=(t,e={})=>r=>{let i=Jt({...r,processors:e});return G(t,i),Gt(i,t),Wt(i,t)},hr=(t,e,r={})=>i=>{let{libraryOptions:n,target:o}=i??{},s=Jt({...n??{},target:o,io:e,processors:r});return G(t,s),Gt(s,t),Wt(s,t)};});function Da(t,e){if("_idmap"in t){let i=t,n=Jt({...e,processors:Aa}),o={};for(let l of i._idmap.entries()){let[u,d]=l;G(d,n);}let s={},a={registry:i,uri:e?.uri,defs:o};n.external=a;for(let l of i._idmap.entries()){let[u,d]=l;Gt(n,d),s[u]=Wt(n,d);}if(Object.keys(o).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[l]:o};}return {schemas:s}}let r=Jt({...e,processors:Aa});return G(t,r),Gt(r,t),Wt(r,t)}var CN,mp,fp,pp,gp,hp,vp,yp,bp,$p,_p,Sp,wp,kp,xp,Ip,Ep,Tp,Pp,Op,Cp,Ap,Np,Rp,Dp,Mp,Na,zp,Lp,jp,Up,Fp,Zp,qp,Bp,Hp,Kp,Vp,Ra,Jp,Aa,Zi=_(()=>{Fi();D();CN={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},mp=(t,e,r,i)=>{let n=r;n.type="string";let{minimum:o,maximum:s,format:a,patterns:l,contentEncoding:u}=t._zod.bag;if(typeof o=="number"&&(n.minLength=o),typeof s=="number"&&(n.maxLength=s),a&&(n.format=CN[a]??a,n.format===""&&delete n.format,a==="time"&&delete n.format),u&&(n.contentEncoding=u),l&&l.size>0){let d=[...l];d.length===1?n.pattern=d[0].source:d.length>1&&(n.allOf=[...d.map(m=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))]);}},fp=(t,e,r,i)=>{let n=r,{minimum:o,maximum:s,format:a,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:d}=t._zod.bag;typeof a=="string"&&a.includes("int")?n.type="integer":n.type="number",typeof d=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(n.minimum=d,n.exclusiveMinimum=true):n.exclusiveMinimum=d),typeof o=="number"&&(n.minimum=o,typeof d=="number"&&e.target!=="draft-04"&&(d>=o?delete n.minimum:delete n.exclusiveMinimum)),typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(n.maximum=u,n.exclusiveMaximum=true):n.exclusiveMaximum=u),typeof s=="number"&&(n.maximum=s,typeof u=="number"&&e.target!=="draft-04"&&(u<=s?delete n.maximum:delete n.exclusiveMaximum)),typeof l=="number"&&(n.multipleOf=l);},pp=(t,e,r,i)=>{r.type="boolean";},gp=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},hp=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},vp=(t,e,r,i)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=true,r.enum=[null]):r.type="null";},yp=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},bp=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},$p=(t,e,r,i)=>{r.not={};},_p=(t,e,r,i)=>{},Sp=(t,e,r,i)=>{},wp=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},kp=(t,e,r,i)=>{let n=t._zod.def,o=Si(n.entries);o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),r.enum=o;},xp=(t,e,r,i)=>{let n=t._zod.def,o=[];for(let s of n.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s));}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];r.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[s]:r.const=s;}else o.every(s=>typeof s=="number")&&(r.type="number"),o.every(s=>typeof s=="string")&&(r.type="string"),o.every(s=>typeof s=="boolean")&&(r.type="boolean"),o.every(s=>s===null)&&(r.type="null"),r.enum=o;},Ip=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Ep=(t,e,r,i)=>{let n=r,o=t._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=o.source;},Tp=(t,e,r,i)=>{let n=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:l}=t._zod.bag;s!==void 0&&(o.minLength=s),a!==void 0&&(o.maxLength=a),l?l.length===1?(o.contentMediaType=l[0],Object.assign(n,o)):(Object.assign(n,o),n.anyOf=l.map(u=>({contentMediaType:u}))):Object.assign(n,o);},Pp=(t,e,r,i)=>{r.type="boolean";},Op=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Cp=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Ap=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Np=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Rp=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Dp=(t,e,r,i)=>{let n=r,o=t._zod.def,{minimum:s,maximum:a}=t._zod.bag;typeof s=="number"&&(n.minItems=s),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=G(o.element,e,{...i,path:[...i.path,"items"]});},Mp=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="object",n.properties={};let s=o.shape;for(let u in s)n.properties[u]=G(s[u],e,{...i,path:[...i.path,"properties",u]});let a=new Set(Object.keys(s)),l=new Set([...a].filter(u=>{let d=o.shape[u]._zod;return e.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(n.required=Array.from(l)),o.catchall?._zod.def.type==="never"?n.additionalProperties=false:o.catchall?o.catchall&&(n.additionalProperties=G(o.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(n.additionalProperties=false);},Na=(t,e,r,i)=>{let n=t._zod.def,o=n.inclusive===false,s=n.options.map((a,l)=>G(a,e,{...i,path:[...i.path,o?"oneOf":"anyOf",l]}));o?r.oneOf=s:r.anyOf=s;},zp=(t,e,r,i)=>{let n=t._zod.def,o=G(n.left,e,{...i,path:[...i.path,"allOf",0]}),s=G(n.right,e,{...i,path:[...i.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,l=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];r.allOf=l;},Lp=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",l=o.items.map((f,p)=>G(f,e,{...i,path:[...i.path,s,p]})),u=o.rest?G(o.rest,e,{...i,path:[...i.path,a,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null;e.target==="draft-2020-12"?(n.prefixItems=l,u&&(n.items=u)):e.target==="openapi-3.0"?(n.items={anyOf:l},u&&n.items.anyOf.push(u),n.minItems=l.length,u||(n.maxItems=l.length)):(n.items=l,u&&(n.additionalItems=u));let{minimum:d,maximum:m}=t._zod.bag;typeof d=="number"&&(n.minItems=d),typeof m=="number"&&(n.maxItems=m);},jp=(t,e,r,i)=>{let n=r,o=t._zod.def;n.type="object";let s=o.keyType,l=s._zod.bag?.patterns;if(o.mode==="loose"&&l&&l.size>0){let d=G(o.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});n.patternProperties={};for(let m of l)n.patternProperties[m.source]=d;}else (e.target==="draft-07"||e.target==="draft-2020-12")&&(n.propertyNames=G(o.keyType,e,{...i,path:[...i.path,"propertyNames"]})),n.additionalProperties=G(o.valueType,e,{...i,path:[...i.path,"additionalProperties"]});let u=s._zod.values;if(u){let d=[...u].filter(m=>typeof m=="string"||typeof m=="number");d.length>0&&(n.required=d);}},Up=(t,e,r,i)=>{let n=t._zod.def,o=G(n.innerType,e,i),s=e.seen.get(t);e.target==="openapi-3.0"?(s.ref=n.innerType,r.nullable=true):r.anyOf=[o,{type:"null"}];},Fp=(t,e,r,i)=>{let n=t._zod.def;G(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType;},Zp=(t,e,r,i)=>{let n=t._zod.def;G(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue));},qp=(t,e,r,i)=>{let n=t._zod.def;G(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)));},Bp=(t,e,r,i)=>{let n=t._zod.def;G(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType;let s;try{s=n.catchValue(void 0);}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s;},Hp=(t,e,r,i)=>{let n=t._zod.def,o=e.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;G(o,e,i);let s=e.seen.get(t);s.ref=o;},Kp=(t,e,r,i)=>{let n=t._zod.def;G(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType,r.readOnly=true;},Vp=(t,e,r,i)=>{let n=t._zod.def;G(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType;},Ra=(t,e,r,i)=>{let n=t._zod.def;G(n.innerType,e,i);let o=e.seen.get(t);o.ref=n.innerType;},Jp=(t,e,r,i)=>{let n=t._zod.innerType;G(n,e,i);let o=e.seen.get(t);o.ref=n;},Aa={string:mp,number:fp,boolean:pp,bigint:gp,symbol:hp,null:vp,undefined:yp,void:bp,never:$p,any:_p,unknown:Sp,date:wp,enum:kp,literal:xp,nan:Ip,template_literal:Ep,file:Tp,success:Pp,custom:Op,function:Cp,transform:Ap,map:Np,set:Rp,array:Dp,object:Mp,union:Na,intersection:zp,tuple:Lp,record:jp,nullable:Up,nonoptional:Fp,default:Zp,prefault:qp,catch:Bp,pipe:Hp,readonly:Kp,promise:Vp,optional:Ra,lazy:Jp};});var Ma,QS=_(()=>{Zi();Fi();Ma=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e;}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Jt({processors:Aa,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}});}process(e,r={path:[],schemaPath:[]}){return G(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Gt(this.ctx,e);let i=Wt(this.ctx,e),{"~standard":n,...o}=i;return o}};});var ew={};var tw=_(()=>{});var Et={};ne(Et,{$ZodAny:()=>Um,$ZodArray:()=>Hm,$ZodAsyncError:()=>rt,$ZodBase64:()=>Om,$ZodBase64URL:()=>Cm,$ZodBigInt:()=>Qs,$ZodBigIntFormat:()=>Mm,$ZodBoolean:()=>Ni,$ZodCIDRv4:()=>Em,$ZodCIDRv6:()=>Tm,$ZodCUID:()=>gm,$ZodCUID2:()=>hm,$ZodCatch:()=>uf,$ZodCheck:()=>te,$ZodCheckBigIntFormat:()=>qd,$ZodCheckEndsWith:()=>tm,$ZodCheckGreaterThan:()=>Hs,$ZodCheckIncludes:()=>Qd,$ZodCheckLengthEquals:()=>Gd,$ZodCheckLessThan:()=>Bs,$ZodCheckLowerCase:()=>Yd,$ZodCheckMaxLength:()=>Vd,$ZodCheckMaxSize:()=>Bd,$ZodCheckMimeType:()=>rm,$ZodCheckMinLength:()=>Jd,$ZodCheckMinSize:()=>Hd,$ZodCheckMultipleOf:()=>Fd,$ZodCheckNumberFormat:()=>Zd,$ZodCheckOverwrite:()=>im,$ZodCheckProperty:()=>nm,$ZodCheckRegex:()=>Wd,$ZodCheckSizeEquals:()=>Kd,$ZodCheckStartsWith:()=>em,$ZodCheckStringFormat:()=>tr,$ZodCheckUpperCase:()=>Xd,$ZodCodec:()=>Di,$ZodCustom:()=>yf,$ZodCustomStringFormat:()=>Rm,$ZodDate:()=>Bm,$ZodDefault:()=>sf,$ZodDiscriminatedUnion:()=>Jm,$ZodE164:()=>Am,$ZodEmail:()=>dm,$ZodEmoji:()=>fm,$ZodEncodeError:()=>Ft,$ZodEnum:()=>Qm,$ZodError:()=>Ei,$ZodExactOptional:()=>rf,$ZodFile:()=>tf,$ZodFunction:()=>gf,$ZodGUID:()=>lm,$ZodIPv4:()=>km,$ZodIPv6:()=>xm,$ZodISODate:()=>_m,$ZodISODateTime:()=>$m,$ZodISODuration:()=>wm,$ZodISOTime:()=>Sm,$ZodIntersection:()=>Gm,$ZodJWT:()=>Nm,$ZodKSUID:()=>bm,$ZodLazy:()=>vf,$ZodLiteral:()=>ef,$ZodMAC:()=>Im,$ZodMap:()=>Ym,$ZodNaN:()=>df,$ZodNanoID:()=>pm,$ZodNever:()=>Zm,$ZodNonOptional:()=>cf,$ZodNull:()=>jm,$ZodNullable:()=>of,$ZodNumber:()=>Xs,$ZodNumberFormat:()=>Dm,$ZodObject:()=>a_,$ZodObjectJIT:()=>Km,$ZodOptional:()=>ta,$ZodPipe:()=>mf,$ZodPrefault:()=>af,$ZodPromise:()=>hf,$ZodReadonly:()=>ff,$ZodRealError:()=>Le,$ZodRecord:()=>Wm,$ZodRegistry:()=>oa,$ZodSet:()=>Xm,$ZodString:()=>dn,$ZodStringFormat:()=>Q,$ZodSuccess:()=>lf,$ZodSymbol:()=>zm,$ZodTemplateLiteral:()=>pf,$ZodTransform:()=>nf,$ZodTuple:()=>ea,$ZodType:()=>j,$ZodULID:()=>vm,$ZodURL:()=>mm,$ZodUUID:()=>um,$ZodUndefined:()=>Lm,$ZodUnion:()=>Ri,$ZodUnknown:()=>Fm,$ZodVoid:()=>qm,$ZodXID:()=>ym,$ZodXor:()=>Vm,$brand:()=>Ts,$constructor:()=>h,$input:()=>xf,$output:()=>kf,Doc:()=>Ai,JSONSchema:()=>ew,JSONSchemaGenerator:()=>Ma,NEVER:()=>Wu,TimePrecision:()=>Pf,_any:()=>Wf,_array:()=>rp,_base64:()=>wa,_base64url:()=>ka,_bigint:()=>qf,_boolean:()=>Ff,_catch:()=>xN,_check:()=>YS,_cidrv4:()=>_a,_cidrv6:()=>Sa,_coercedBigint:()=>Bf,_coercedBoolean:()=>Zf,_coercedDate:()=>tp,_coercedNumber:()=>Df,_coercedString:()=>Ef,_cuid:()=>pa,_cuid2:()=>ga,_custom:()=>op,_date:()=>ep,_decode:()=>Rs,_decodeAsync:()=>Ms,_default:()=>SN,_discriminatedUnion:()=>uN,_e164:()=>xa,_email:()=>aa,_emoji:()=>ma,_encode:()=>Ns,_encodeAsync:()=>Ds,_endsWith:()=>cr,_enum:()=>hN,_file:()=>ip,_float32:()=>zf,_float64:()=>Lf,_gt:()=>pt,_gte:()=>Ae,_guid:()=>ji,_includes:()=>sr,_int:()=>Mf,_int32:()=>jf,_int64:()=>Hf,_intersection:()=>dN,_ipv4:()=>ba,_ipv6:()=>$a,_isoDate:()=>Cf,_isoDateTime:()=>Of,_isoDuration:()=>Nf,_isoTime:()=>Af,_jwt:()=>Ia,_ksuid:()=>ya,_lazy:()=>PN,_length:()=>pn,_literal:()=>yN,_lowercase:()=>ir,_lt:()=>ft,_lte:()=>He,_mac:()=>Tf,_map:()=>pN,_max:()=>He,_maxLength:()=>fn,_maxSize:()=>Vt,_mime:()=>lr,_min:()=>Ae,_minLength:()=>It,_minSize:()=>gt,_multipleOf:()=>Kt,_nan:()=>np,_nanoid:()=>fa,_nativeEnum:()=>vN,_negative:()=>Ta,_never:()=>Xf,_nonnegative:()=>Oa,_nonoptional:()=>wN,_nonpositive:()=>Pa,_normalize:()=>ur,_null:()=>Gf,_nullable:()=>_N,_number:()=>Rf,_optional:()=>$N,_overwrite:()=>it,_parse:()=>Yn,_parseAsync:()=>Xn,_pipe:()=>IN,_positive:()=>Ea,_promise:()=>ON,_property:()=>Ca,_readonly:()=>EN,_record:()=>fN,_refine:()=>sp,_regex:()=>rr,_safeDecode:()=>Ls,_safeDecodeAsync:()=>Us,_safeEncode:()=>zs,_safeEncodeAsync:()=>js,_safeParse:()=>Qn,_safeParseAsync:()=>er,_set:()=>gN,_size:()=>mn,_slugify:()=>pr,_startsWith:()=>ar,_string:()=>If,_stringFormat:()=>gr,_stringbool:()=>up,_success:()=>kN,_superRefine:()=>ap,_symbol:()=>Vf,_templateLiteral:()=>TN,_toLowerCase:()=>mr,_toUpperCase:()=>fr,_transform:()=>bN,_trim:()=>dr,_tuple:()=>mN,_uint32:()=>Uf,_uint64:()=>Kf,_ulid:()=>ha,_undefined:()=>Jf,_union:()=>cN,_unknown:()=>Yf,_uppercase:()=>or,_url:()=>Ui,_uuid:()=>ca,_uuidv4:()=>la,_uuidv6:()=>ua,_uuidv7:()=>da,_void:()=>Qf,_xid:()=>va,_xor:()=>lN,clone:()=>Ce,config:()=>le,createStandardJSONSchemaMethod:()=>hr,createToJSONSchemaMethod:()=>dp,decode:()=>NC,decodeAsync:()=>DC,describe:()=>cp,encode:()=>AC,encodeAsync:()=>RC,extractDefs:()=>Gt,finalize:()=>Wt,flattenError:()=>Ti,formatError:()=>Pi,globalConfig:()=>$i,globalRegistry:()=>ke,initializeContext:()=>Jt,isValidBase64:()=>Pm,isValidBase64URL:()=>r_,isValidJWT:()=>i_,locales:()=>zi,meta:()=>lp,parse:()=>Cs,parseAsync:()=>As,prettifyError:()=>cd,process:()=>G,regexes:()=>We,registry:()=>sa,safeDecode:()=>zC,safeDecodeAsync:()=>jC,safeEncode:()=>MC,safeEncodeAsync:()=>LC,safeParse:()=>ud,safeParseAsync:()=>dd,toDotPath:()=>j$,toJSONSchema:()=>Da,treeifyError:()=>ad,util:()=>x,version:()=>sm});var je=_(()=>{Vn();md();ld();bf();Ks();am();D();qs();wf();Li();om();XS();Fi();Zi();QS();tw();});var za={};ne(za,{endsWith:()=>cr,gt:()=>pt,gte:()=>Ae,includes:()=>sr,length:()=>pn,lowercase:()=>ir,lt:()=>ft,lte:()=>He,maxLength:()=>fn,maxSize:()=>Vt,mime:()=>lr,minLength:()=>It,minSize:()=>gt,multipleOf:()=>Kt,negative:()=>Ta,nonnegative:()=>Oa,nonpositive:()=>Pa,normalize:()=>ur,overwrite:()=>it,positive:()=>Ea,property:()=>Ca,regex:()=>rr,size:()=>mn,slugify:()=>pr,startsWith:()=>ar,toLowerCase:()=>mr,toUpperCase:()=>fr,trim:()=>dr,uppercase:()=>or});var La=_(()=>{je();});var vr={};ne(vr,{ZodISODate:()=>Ua,ZodISODateTime:()=>ja,ZodISODuration:()=>Za,ZodISOTime:()=>Fa,date:()=>Wp,datetime:()=>Gp,duration:()=>Xp,time:()=>Yp});function Gp(t){return Of(ja,t)}function Wp(t){return Cf(Ua,t)}function Yp(t){return Af(Fa,t)}function Xp(t){return Nf(Za,t)}var ja,Ua,Fa,Za,qi=_(()=>{je();Hi();ja=h("ZodISODateTime",(t,e)=>{$m.init(t,e),ee.init(t,e);});Ua=h("ZodISODate",(t,e)=>{_m.init(t,e),ee.init(t,e);});Fa=h("ZodISOTime",(t,e)=>{Sm.init(t,e),ee.init(t,e);});Za=h("ZodISODuration",(t,e)=>{wm.init(t,e),ee.init(t,e);});});var nw,NN,Ue,Qp=_(()=>{je();je();D();nw=(t,e)=>{Ei.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>Pi(t,r)},flatten:{value:r=>Ti(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Jn,2);}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Jn,2);}},isEmpty:{get(){return t.issues.length===0}}});},NN=h("ZodError",nw),Ue=h("ZodError",nw,{Parent:Error});});var eg,tg,ng,rg,ig,og,sg,ag,cg,lg,ug,dg,mg=_(()=>{je();Qp();eg=Yn(Ue),tg=Xn(Ue),ng=Qn(Ue),rg=er(Ue),ig=Ns(Ue),og=Rs(Ue),sg=Ds(Ue),ag=Ms(Ue),cg=zs(Ue),lg=Ls(Ue),ug=js(Ue),dg=Us(Ue);});var Bi={};ne(Bi,{ZodAny:()=>$g,ZodArray:()=>kg,ZodBase64:()=>ic,ZodBase64URL:()=>oc,ZodBigInt:()=>wr,ZodBigIntFormat:()=>cc,ZodBoolean:()=>Sr,ZodCIDRv4:()=>nc,ZodCIDRv6:()=>rc,ZodCUID:()=>Ga,ZodCUID2:()=>Wa,ZodCatch:()=>Kg,ZodCodec:()=>hc,ZodCustom:()=>no,ZodCustomStringFormat:()=>$r,ZodDate:()=>Yi,ZodDefault:()=>Ug,ZodDiscriminatedUnion:()=>Ig,ZodE164:()=>sc,ZodEmail:()=>Ka,ZodEmoji:()=>Va,ZodEnum:()=>yr,ZodExactOptional:()=>zg,ZodFile:()=>Dg,ZodFunction:()=>th,ZodGUID:()=>Ki,ZodIPv4:()=>ec,ZodIPv6:()=>tc,ZodIntersection:()=>Eg,ZodJWT:()=>ac,ZodKSUID:()=>Qa,ZodLazy:()=>Xg,ZodLiteral:()=>Rg,ZodMAC:()=>fg,ZodMap:()=>Ag,ZodNaN:()=>Jg,ZodNanoID:()=>Ja,ZodNever:()=>Sg,ZodNonOptional:()=>pc,ZodNull:()=>yg,ZodNullable:()=>jg,ZodNumber:()=>_r,ZodNumberFormat:()=>hn,ZodObject:()=>Qi,ZodOptional:()=>fc,ZodPipe:()=>gc,ZodPrefault:()=>Zg,ZodPromise:()=>eh,ZodReadonly:()=>Gg,ZodRecord:()=>to,ZodSet:()=>Ng,ZodString:()=>br,ZodStringFormat:()=>ee,ZodSuccess:()=>Hg,ZodSymbol:()=>hg,ZodTemplateLiteral:()=>Yg,ZodTransform:()=>Mg,ZodTuple:()=>Pg,ZodType:()=>U,ZodULID:()=>Ya,ZodURL:()=>Wi,ZodUUID:()=>ht,ZodUndefined:()=>vg,ZodUnion:()=>eo,ZodUnknown:()=>_g,ZodVoid:()=>wg,ZodXID:()=>Xa,ZodXor:()=>xg,_ZodString:()=>Ha,_default:()=>Fg,_function:()=>ck,any:()=>Uw,array:()=>Xi,base64:()=>ww,base64url:()=>kw,bigint:()=>Dw,boolean:()=>gg,catch:()=>Vg,check:()=>lk,cidrv4:()=>_w,cidrv6:()=>Sw,codec:()=>ok,cuid:()=>fw,cuid2:()=>pw,custom:()=>uk,date:()=>Zw,describe:()=>dk,discriminatedUnion:()=>Jw,e164:()=>xw,email:()=>rw,emoji:()=>dw,enum:()=>dc,exactOptional:()=>Lg,file:()=>tk,float32:()=>Cw,float64:()=>Aw,function:()=>ck,guid:()=>iw,hash:()=>Ow,hex:()=>Pw,hostname:()=>Tw,httpUrl:()=>uw,instanceof:()=>fk,int:()=>Ba,int32:()=>Nw,int64:()=>Mw,intersection:()=>Tg,ipv4:()=>yw,ipv6:()=>$w,json:()=>gk,jwt:()=>Iw,keyof:()=>qw,ksuid:()=>vw,lazy:()=>Qg,literal:()=>ek,looseObject:()=>Kw,looseRecord:()=>Ww,mac:()=>bw,map:()=>Yw,meta:()=>mk,nan:()=>ik,nanoid:()=>mw,nativeEnum:()=>Qw,never:()=>lc,nonoptional:()=>Bg,null:()=>bg,nullable:()=>Ji,nullish:()=>nk,number:()=>pg,object:()=>Bw,optional:()=>Vi,partialRecord:()=>Gw,pipe:()=>Gi,prefault:()=>qg,preprocess:()=>hk,promise:()=>ak,readonly:()=>Wg,record:()=>Cg,refine:()=>nh,set:()=>Xw,strictObject:()=>Hw,string:()=>qa,stringFormat:()=>Ew,stringbool:()=>pk,success:()=>rk,superRefine:()=>rh,symbol:()=>Lw,templateLiteral:()=>sk,transform:()=>mc,tuple:()=>Og,uint32:()=>Rw,uint64:()=>zw,ulid:()=>gw,undefined:()=>jw,union:()=>uc,unknown:()=>gn,url:()=>lw,uuid:()=>ow,uuidv4:()=>sw,uuidv6:()=>aw,uuidv7:()=>cw,void:()=>Fw,xid:()=>hw,xor:()=>Vw});function qa(t){return If(br,t)}function rw(t){return aa(Ka,t)}function iw(t){return ji(Ki,t)}function ow(t){return ca(ht,t)}function sw(t){return la(ht,t)}function aw(t){return ua(ht,t)}function cw(t){return da(ht,t)}function lw(t){return Ui(Wi,t)}function uw(t){return Ui(Wi,{protocol:/^https?$/,hostname:We.domain,...x.normalizeParams(t)})}function dw(t){return ma(Va,t)}function mw(t){return fa(Ja,t)}function fw(t){return pa(Ga,t)}function pw(t){return ga(Wa,t)}function gw(t){return ha(Ya,t)}function hw(t){return va(Xa,t)}function vw(t){return ya(Qa,t)}function yw(t){return ba(ec,t)}function bw(t){return Tf(fg,t)}function $w(t){return $a(tc,t)}function _w(t){return _a(nc,t)}function Sw(t){return Sa(rc,t)}function ww(t){return wa(ic,t)}function kw(t){return ka(oc,t)}function xw(t){return xa(sc,t)}function Iw(t){return Ia(ac,t)}function Ew(t,e,r={}){return gr($r,t,e,r)}function Tw(t){return gr($r,"hostname",We.hostname,t)}function Pw(t){return gr($r,"hex",We.hex,t)}function Ow(t,e){let r=e?.enc??"hex",i=`${t}_${r}`,n=We[i];if(!n)throw new Error(`Unrecognized hash format: ${i}`);return gr($r,i,n,e)}function pg(t){return Rf(_r,t)}function Ba(t){return Mf(hn,t)}function Cw(t){return zf(hn,t)}function Aw(t){return Lf(hn,t)}function Nw(t){return jf(hn,t)}function Rw(t){return Uf(hn,t)}function gg(t){return Ff(Sr,t)}function Dw(t){return qf(wr,t)}function Mw(t){return Hf(cc,t)}function zw(t){return Kf(cc,t)}function Lw(t){return Vf(hg,t)}function jw(t){return Jf(vg,t)}function bg(t){return Gf(yg,t)}function Uw(){return Wf($g)}function gn(){return Yf(_g)}function lc(t){return Xf(Sg,t)}function Fw(t){return Qf(wg,t)}function Zw(t){return ep(Yi,t)}function Xi(t,e){return rp(kg,t,e)}function qw(t){let e=t._zod.def.shape;return dc(Object.keys(e))}function Bw(t,e){let r={type:"object",shape:t??{},...x.normalizeParams(e)};return new Qi(r)}function Hw(t,e){return new Qi({type:"object",shape:t,catchall:lc(),...x.normalizeParams(e)})}function Kw(t,e){return new Qi({type:"object",shape:t,catchall:gn(),...x.normalizeParams(e)})}function uc(t,e){return new eo({type:"union",options:t,...x.normalizeParams(e)})}function Vw(t,e){return new xg({type:"union",options:t,inclusive:false,...x.normalizeParams(e)})}function Jw(t,e,r){return new Ig({type:"union",options:e,discriminator:t,...x.normalizeParams(r)})}function Tg(t,e){return new Eg({type:"intersection",left:t,right:e})}function Og(t,e,r){let i=e instanceof j,n=i?r:e,o=i?e:null;return new Pg({type:"tuple",items:t,rest:o,...x.normalizeParams(n)})}function Cg(t,e,r){return new to({type:"record",keyType:t,valueType:e,...x.normalizeParams(r)})}function Gw(t,e,r){let i=Ce(t);return i._zod.values=void 0,new to({type:"record",keyType:i,valueType:e,...x.normalizeParams(r)})}function Ww(t,e,r){return new to({type:"record",keyType:t,valueType:e,mode:"loose",...x.normalizeParams(r)})}function Yw(t,e,r){return new Ag({type:"map",keyType:t,valueType:e,...x.normalizeParams(r)})}function Xw(t,e){return new Ng({type:"set",valueType:t,...x.normalizeParams(e)})}function dc(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new yr({type:"enum",entries:r,...x.normalizeParams(e)})}function Qw(t,e){return new yr({type:"enum",entries:t,...x.normalizeParams(e)})}function ek(t,e){return new Rg({type:"literal",values:Array.isArray(t)?t:[t],...x.normalizeParams(e)})}function tk(t){return ip(Dg,t)}function mc(t){return new Mg({type:"transform",transform:t})}function Vi(t){return new fc({type:"optional",innerType:t})}function Lg(t){return new zg({type:"optional",innerType:t})}function Ji(t){return new jg({type:"nullable",innerType:t})}function nk(t){return Vi(Ji(t))}function Fg(t,e){return new Ug({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():x.shallowClone(e)}})}function qg(t,e){return new Zg({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():x.shallowClone(e)}})}function Bg(t,e){return new pc({type:"nonoptional",innerType:t,...x.normalizeParams(e)})}function rk(t){return new Hg({type:"success",innerType:t})}function Vg(t,e){return new Kg({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function ik(t){return np(Jg,t)}function Gi(t,e){return new gc({type:"pipe",in:t,out:e})}function ok(t,e,r){return new hc({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function Wg(t){return new Gg({type:"readonly",innerType:t})}function sk(t,e){return new Yg({type:"template_literal",parts:t,...x.normalizeParams(e)})}function Qg(t){return new Xg({type:"lazy",getter:t})}function ak(t){return new eh({type:"promise",innerType:t})}function ck(t){return new th({type:"function",input:Array.isArray(t?.input)?Og(t?.input):t?.input??Xi(gn()),output:t?.output??gn()})}function lk(t){let e=new te({check:"custom"});return e._zod.check=t,e}function uk(t,e){return op(no,t??(()=>true),e)}function nh(t,e={}){return sp(no,t,e)}function rh(t){return ap(t)}function fk(t,e={}){let r=new no({type:"custom",check:"custom",fn:i=>i instanceof t,abort:true,...x.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=i=>{i.value instanceof t||i.issues.push({code:"invalid_type",expected:t.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]});},r}function gk(t){let e=Qg(()=>uc([qa(t),pg(),gg(),bg(),Xi(e),Cg(qa(),e)]));return e}function hk(t,e){return Gi(mc(t),e)}var U,Ha,br,ee,Ka,Ki,ht,Wi,Va,Ja,Ga,Wa,Ya,Xa,Qa,ec,fg,tc,nc,rc,ic,oc,sc,ac,$r,_r,hn,Sr,wr,cc,hg,vg,yg,$g,_g,Sg,wg,Yi,kg,Qi,eo,xg,Ig,Eg,Pg,to,Ag,Ng,yr,Rg,Dg,Mg,fc,zg,jg,Ug,Zg,pc,Hg,Kg,Jg,gc,hc,Gg,Yg,Xg,eh,th,no,dk,mk,pk,Hi=_(()=>{je();je();Zi();Fi();La();qi();mg();U=h("ZodType",(t,e)=>(j.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:hr(t,"input"),output:hr(t,"output")}}),t.toJSONSchema=dp(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone(x.mergeDefs(e,{checks:[...e.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:true}),t.with=t.check,t.clone=(r,i)=>Ce(t,r,i),t.brand=()=>t,t.register=((r,i)=>(r.add(t,i),t)),t.parse=(r,i)=>eg(t,r,i,{callee:t.parse}),t.safeParse=(r,i)=>ng(t,r,i),t.parseAsync=async(r,i)=>tg(t,r,i,{callee:t.parseAsync}),t.safeParseAsync=async(r,i)=>rg(t,r,i),t.spa=t.safeParseAsync,t.encode=(r,i)=>ig(t,r,i),t.decode=(r,i)=>og(t,r,i),t.encodeAsync=async(r,i)=>sg(t,r,i),t.decodeAsync=async(r,i)=>ag(t,r,i),t.safeEncode=(r,i)=>cg(t,r,i),t.safeDecode=(r,i)=>lg(t,r,i),t.safeEncodeAsync=async(r,i)=>ug(t,r,i),t.safeDecodeAsync=async(r,i)=>dg(t,r,i),t.refine=(r,i)=>t.check(nh(r,i)),t.superRefine=r=>t.check(rh(r)),t.overwrite=r=>t.check(it(r)),t.optional=()=>Vi(t),t.exactOptional=()=>Lg(t),t.nullable=()=>Ji(t),t.nullish=()=>Vi(Ji(t)),t.nonoptional=r=>Bg(t,r),t.array=()=>Xi(t),t.or=r=>uc([t,r]),t.and=r=>Tg(t,r),t.transform=r=>Gi(t,mc(r)),t.default=r=>Fg(t,r),t.prefault=r=>qg(t,r),t.catch=r=>Vg(t,r),t.pipe=r=>Gi(t,r),t.readonly=()=>Wg(t),t.describe=r=>{let i=t.clone();return ke.add(i,{description:r}),i},Object.defineProperty(t,"description",{get(){return ke.get(t)?.description},configurable:true}),t.meta=(...r)=>{if(r.length===0)return ke.get(t);let i=t.clone();return ke.add(i,r[0]),i},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t.apply=r=>r(t),t)),Ha=h("_ZodString",(t,e)=>{dn.init(t,e),U.init(t,e),t._zod.processJSONSchema=(i,n,o)=>mp(t,i,n,o);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...i)=>t.check(rr(...i)),t.includes=(...i)=>t.check(sr(...i)),t.startsWith=(...i)=>t.check(ar(...i)),t.endsWith=(...i)=>t.check(cr(...i)),t.min=(...i)=>t.check(It(...i)),t.max=(...i)=>t.check(fn(...i)),t.length=(...i)=>t.check(pn(...i)),t.nonempty=(...i)=>t.check(It(1,...i)),t.lowercase=i=>t.check(ir(i)),t.uppercase=i=>t.check(or(i)),t.trim=()=>t.check(dr()),t.normalize=(...i)=>t.check(ur(...i)),t.toLowerCase=()=>t.check(mr()),t.toUpperCase=()=>t.check(fr()),t.slugify=()=>t.check(pr());}),br=h("ZodString",(t,e)=>{dn.init(t,e),Ha.init(t,e),t.email=r=>t.check(aa(Ka,r)),t.url=r=>t.check(Ui(Wi,r)),t.jwt=r=>t.check(Ia(ac,r)),t.emoji=r=>t.check(ma(Va,r)),t.guid=r=>t.check(ji(Ki,r)),t.uuid=r=>t.check(ca(ht,r)),t.uuidv4=r=>t.check(la(ht,r)),t.uuidv6=r=>t.check(ua(ht,r)),t.uuidv7=r=>t.check(da(ht,r)),t.nanoid=r=>t.check(fa(Ja,r)),t.guid=r=>t.check(ji(Ki,r)),t.cuid=r=>t.check(pa(Ga,r)),t.cuid2=r=>t.check(ga(Wa,r)),t.ulid=r=>t.check(ha(Ya,r)),t.base64=r=>t.check(wa(ic,r)),t.base64url=r=>t.check(ka(oc,r)),t.xid=r=>t.check(va(Xa,r)),t.ksuid=r=>t.check(ya(Qa,r)),t.ipv4=r=>t.check(ba(ec,r)),t.ipv6=r=>t.check($a(tc,r)),t.cidrv4=r=>t.check(_a(nc,r)),t.cidrv6=r=>t.check(Sa(rc,r)),t.e164=r=>t.check(xa(sc,r)),t.datetime=r=>t.check(Gp(r)),t.date=r=>t.check(Wp(r)),t.time=r=>t.check(Yp(r)),t.duration=r=>t.check(Xp(r));});ee=h("ZodStringFormat",(t,e)=>{Q.init(t,e),Ha.init(t,e);}),Ka=h("ZodEmail",(t,e)=>{dm.init(t,e),ee.init(t,e);});Ki=h("ZodGUID",(t,e)=>{lm.init(t,e),ee.init(t,e);});ht=h("ZodUUID",(t,e)=>{um.init(t,e),ee.init(t,e);});Wi=h("ZodURL",(t,e)=>{mm.init(t,e),ee.init(t,e);});Va=h("ZodEmoji",(t,e)=>{fm.init(t,e),ee.init(t,e);});Ja=h("ZodNanoID",(t,e)=>{pm.init(t,e),ee.init(t,e);});Ga=h("ZodCUID",(t,e)=>{gm.init(t,e),ee.init(t,e);});Wa=h("ZodCUID2",(t,e)=>{hm.init(t,e),ee.init(t,e);});Ya=h("ZodULID",(t,e)=>{vm.init(t,e),ee.init(t,e);});Xa=h("ZodXID",(t,e)=>{ym.init(t,e),ee.init(t,e);});Qa=h("ZodKSUID",(t,e)=>{bm.init(t,e),ee.init(t,e);});ec=h("ZodIPv4",(t,e)=>{km.init(t,e),ee.init(t,e);});fg=h("ZodMAC",(t,e)=>{Im.init(t,e),ee.init(t,e);});tc=h("ZodIPv6",(t,e)=>{xm.init(t,e),ee.init(t,e);});nc=h("ZodCIDRv4",(t,e)=>{Em.init(t,e),ee.init(t,e);});rc=h("ZodCIDRv6",(t,e)=>{Tm.init(t,e),ee.init(t,e);});ic=h("ZodBase64",(t,e)=>{Om.init(t,e),ee.init(t,e);});oc=h("ZodBase64URL",(t,e)=>{Cm.init(t,e),ee.init(t,e);});sc=h("ZodE164",(t,e)=>{Am.init(t,e),ee.init(t,e);});ac=h("ZodJWT",(t,e)=>{Nm.init(t,e),ee.init(t,e);});$r=h("ZodCustomStringFormat",(t,e)=>{Rm.init(t,e),ee.init(t,e);});_r=h("ZodNumber",(t,e)=>{Xs.init(t,e),U.init(t,e),t._zod.processJSONSchema=(i,n,o)=>fp(t,i,n,o),t.gt=(i,n)=>t.check(pt(i,n)),t.gte=(i,n)=>t.check(Ae(i,n)),t.min=(i,n)=>t.check(Ae(i,n)),t.lt=(i,n)=>t.check(ft(i,n)),t.lte=(i,n)=>t.check(He(i,n)),t.max=(i,n)=>t.check(He(i,n)),t.int=i=>t.check(Ba(i)),t.safe=i=>t.check(Ba(i)),t.positive=i=>t.check(pt(0,i)),t.nonnegative=i=>t.check(Ae(0,i)),t.negative=i=>t.check(ft(0,i)),t.nonpositive=i=>t.check(He(0,i)),t.multipleOf=(i,n)=>t.check(Kt(i,n)),t.step=(i,n)=>t.check(Kt(i,n)),t.finite=()=>t;let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=true,t.format=r.format??null;});hn=h("ZodNumberFormat",(t,e)=>{Dm.init(t,e),_r.init(t,e);});Sr=h("ZodBoolean",(t,e)=>{Ni.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>pp(t,r,i,n);});wr=h("ZodBigInt",(t,e)=>{Qs.init(t,e),U.init(t,e),t._zod.processJSONSchema=(i,n,o)=>gp(t,i,n,o),t.gte=(i,n)=>t.check(Ae(i,n)),t.min=(i,n)=>t.check(Ae(i,n)),t.gt=(i,n)=>t.check(pt(i,n)),t.gte=(i,n)=>t.check(Ae(i,n)),t.min=(i,n)=>t.check(Ae(i,n)),t.lt=(i,n)=>t.check(ft(i,n)),t.lte=(i,n)=>t.check(He(i,n)),t.max=(i,n)=>t.check(He(i,n)),t.positive=i=>t.check(pt(BigInt(0),i)),t.negative=i=>t.check(ft(BigInt(0),i)),t.nonpositive=i=>t.check(He(BigInt(0),i)),t.nonnegative=i=>t.check(Ae(BigInt(0),i)),t.multipleOf=(i,n)=>t.check(Kt(i,n));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null;});cc=h("ZodBigIntFormat",(t,e)=>{Mm.init(t,e),wr.init(t,e);});hg=h("ZodSymbol",(t,e)=>{zm.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>hp(t,r,i,n);});vg=h("ZodUndefined",(t,e)=>{Lm.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>yp(t,r,i,n);});yg=h("ZodNull",(t,e)=>{jm.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>vp(t,r,i,n);});$g=h("ZodAny",(t,e)=>{Um.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>_p(t,r,i,n);});_g=h("ZodUnknown",(t,e)=>{Fm.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Sp(t,r,i,n);});Sg=h("ZodNever",(t,e)=>{Zm.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>$p(t,r,i,n);});wg=h("ZodVoid",(t,e)=>{qm.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>bp(t,r,i,n);});Yi=h("ZodDate",(t,e)=>{Bm.init(t,e),U.init(t,e),t._zod.processJSONSchema=(i,n,o)=>wp(t,i,n,o),t.min=(i,n)=>t.check(Ae(i,n)),t.max=(i,n)=>t.check(He(i,n));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null;});kg=h("ZodArray",(t,e)=>{Hm.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Dp(t,r,i,n),t.element=e.element,t.min=(r,i)=>t.check(It(r,i)),t.nonempty=r=>t.check(It(1,r)),t.max=(r,i)=>t.check(fn(r,i)),t.length=(r,i)=>t.check(pn(r,i)),t.unwrap=()=>t.element;});Qi=h("ZodObject",(t,e)=>{Km.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Mp(t,r,i,n),x.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>dc(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:gn()}),t.loose=()=>t.clone({...t._zod.def,catchall:gn()}),t.strict=()=>t.clone({...t._zod.def,catchall:lc()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>x.extend(t,r),t.safeExtend=r=>x.safeExtend(t,r),t.merge=r=>x.merge(t,r),t.pick=r=>x.pick(t,r),t.omit=r=>x.omit(t,r),t.partial=(...r)=>x.partial(fc,t,r[0]),t.required=(...r)=>x.required(pc,t,r[0]);});eo=h("ZodUnion",(t,e)=>{Ri.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Na(t,r,i,n),t.options=e.options;});xg=h("ZodXor",(t,e)=>{eo.init(t,e),Vm.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Na(t,r,i,n),t.options=e.options;});Ig=h("ZodDiscriminatedUnion",(t,e)=>{eo.init(t,e),Jm.init(t,e);});Eg=h("ZodIntersection",(t,e)=>{Gm.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>zp(t,r,i,n);});Pg=h("ZodTuple",(t,e)=>{ea.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Lp(t,r,i,n),t.rest=r=>t.clone({...t._zod.def,rest:r});});to=h("ZodRecord",(t,e)=>{Wm.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>jp(t,r,i,n),t.keyType=e.keyType,t.valueType=e.valueType;});Ag=h("ZodMap",(t,e)=>{Ym.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Np(t,r,i,n),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(gt(...r)),t.nonempty=r=>t.check(gt(1,r)),t.max=(...r)=>t.check(Vt(...r)),t.size=(...r)=>t.check(mn(...r));});Ng=h("ZodSet",(t,e)=>{Xm.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Rp(t,r,i,n),t.min=(...r)=>t.check(gt(...r)),t.nonempty=r=>t.check(gt(1,r)),t.max=(...r)=>t.check(Vt(...r)),t.size=(...r)=>t.check(mn(...r));});yr=h("ZodEnum",(t,e)=>{Qm.init(t,e),U.init(t,e),t._zod.processJSONSchema=(i,n,o)=>kp(t,i,n,o),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(i,n)=>{let o={};for(let s of i)if(r.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new yr({...e,checks:[],...x.normalizeParams(n),entries:o})},t.exclude=(i,n)=>{let o={...e.entries};for(let s of i)if(r.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new yr({...e,checks:[],...x.normalizeParams(n),entries:o})};});Rg=h("ZodLiteral",(t,e)=>{ef.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>xp(t,r,i,n),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}});});Dg=h("ZodFile",(t,e)=>{tf.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Tp(t,r,i,n),t.min=(r,i)=>t.check(gt(r,i)),t.max=(r,i)=>t.check(Vt(r,i)),t.mime=(r,i)=>t.check(lr(Array.isArray(r)?r:[r],i));});Mg=h("ZodTransform",(t,e)=>{nf.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ap(t,r,i,n),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Ft(t.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(x.issue(o,r.value,e));else {let s=o;s.fatal&&(s.continue=false),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=t),r.issues.push(x.issue(s));}};let n=e.transform(r.value,r);return n instanceof Promise?n.then(o=>(r.value=o,r)):(r.value=n,r)};});fc=h("ZodOptional",(t,e)=>{ta.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ra(t,r,i,n),t.unwrap=()=>t._zod.def.innerType;});zg=h("ZodExactOptional",(t,e)=>{rf.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ra(t,r,i,n),t.unwrap=()=>t._zod.def.innerType;});jg=h("ZodNullable",(t,e)=>{of.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Up(t,r,i,n),t.unwrap=()=>t._zod.def.innerType;});Ug=h("ZodDefault",(t,e)=>{sf.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Zp(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap;});Zg=h("ZodPrefault",(t,e)=>{af.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>qp(t,r,i,n),t.unwrap=()=>t._zod.def.innerType;});pc=h("ZodNonOptional",(t,e)=>{cf.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Fp(t,r,i,n),t.unwrap=()=>t._zod.def.innerType;});Hg=h("ZodSuccess",(t,e)=>{lf.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Pp(t,r,i,n),t.unwrap=()=>t._zod.def.innerType;});Kg=h("ZodCatch",(t,e)=>{uf.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Bp(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap;});Jg=h("ZodNaN",(t,e)=>{df.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ip(t,r,i,n);});gc=h("ZodPipe",(t,e)=>{mf.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Hp(t,r,i,n),t.in=e.in,t.out=e.out;});hc=h("ZodCodec",(t,e)=>{gc.init(t,e),Di.init(t,e);});Gg=h("ZodReadonly",(t,e)=>{ff.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Kp(t,r,i,n),t.unwrap=()=>t._zod.def.innerType;});Yg=h("ZodTemplateLiteral",(t,e)=>{pf.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ep(t,r,i,n);});Xg=h("ZodLazy",(t,e)=>{vf.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Jp(t,r,i,n),t.unwrap=()=>t._zod.def.getter();});eh=h("ZodPromise",(t,e)=>{hf.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Vp(t,r,i,n),t.unwrap=()=>t._zod.def.innerType;});th=h("ZodFunction",(t,e)=>{gf.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Cp(t,r,i,n);});no=h("ZodCustom",(t,e)=>{yf.init(t,e),U.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Op(t,r,i,n);});dk=cp,mk=lp;pk=(...t)=>up({Codec:hc,Boolean:Sr,String:br},...t);});function MN(t){le({customError:t});}function zN(){return le().customError}var DN,ih,vk=_(()=>{je();je();DN={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"};ih||(ih={});});function jN(t,e){let r=t.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function UN(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let i=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){let n=r[1];if(!n||!e.defs[n])throw new Error(`Reference not found: ${t}`);return e.defs[n]}throw new Error(`Reference not found: ${t}`)}function yk(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return A.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let n=t.$ref;if(e.refs.has(n))return e.refs.get(n);if(e.processing.has(n))return A.lazy(()=>{if(!e.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return e.refs.get(n)});e.processing.add(n);let o=UN(n,e),s=Ie(o,e);return e.refs.set(n,s),e.processing.delete(n),s}if(t.enum!==void 0){let n=t.enum;if(e.version==="openapi-3.0"&&t.nullable===true&&n.length===1&&n[0]===null)return A.null();if(n.length===0)return A.never();if(n.length===1)return A.literal(n[0]);if(n.every(s=>typeof s=="string"))return A.enum(n);let o=n.map(s=>A.literal(s));return o.length<2?o[0]:A.union([o[0],o[1],...o.slice(2)])}if(t.const!==void 0)return A.literal(t.const);let r=t.type;if(Array.isArray(r)){let n=r.map(o=>{let s={...t,type:o};return yk(s,e)});return n.length===0?A.never():n.length===1?n[0]:A.union(n)}if(!r)return A.any();let i;switch(r){case "string":{let n=A.string();if(t.format){let o=t.format;o==="email"?n=n.check(A.email()):o==="uri"||o==="uri-reference"?n=n.check(A.url()):o==="uuid"||o==="guid"?n=n.check(A.uuid()):o==="date-time"?n=n.check(A.iso.datetime()):o==="date"?n=n.check(A.iso.date()):o==="time"?n=n.check(A.iso.time()):o==="duration"?n=n.check(A.iso.duration()):o==="ipv4"?n=n.check(A.ipv4()):o==="ipv6"?n=n.check(A.ipv6()):o==="mac"?n=n.check(A.mac()):o==="cidr"?n=n.check(A.cidrv4()):o==="cidr-v6"?n=n.check(A.cidrv6()):o==="base64"?n=n.check(A.base64()):o==="base64url"?n=n.check(A.base64url()):o==="e164"?n=n.check(A.e164()):o==="jwt"?n=n.check(A.jwt()):o==="emoji"?n=n.check(A.emoji()):o==="nanoid"?n=n.check(A.nanoid()):o==="cuid"?n=n.check(A.cuid()):o==="cuid2"?n=n.check(A.cuid2()):o==="ulid"?n=n.check(A.ulid()):o==="xid"?n=n.check(A.xid()):o==="ksuid"&&(n=n.check(A.ksuid()));}typeof t.minLength=="number"&&(n=n.min(t.minLength)),typeof t.maxLength=="number"&&(n=n.max(t.maxLength)),t.pattern&&(n=n.regex(new RegExp(t.pattern))),i=n;break}case "number":case "integer":{let n=r==="integer"?A.number().int():A.number();typeof t.minimum=="number"&&(n=n.min(t.minimum)),typeof t.maximum=="number"&&(n=n.max(t.maximum)),typeof t.exclusiveMinimum=="number"?n=n.gt(t.exclusiveMinimum):t.exclusiveMinimum===true&&typeof t.minimum=="number"&&(n=n.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?n=n.lt(t.exclusiveMaximum):t.exclusiveMaximum===true&&typeof t.maximum=="number"&&(n=n.lt(t.maximum)),typeof t.multipleOf=="number"&&(n=n.multipleOf(t.multipleOf)),i=n;break}case "boolean":{i=A.boolean();break}case "null":{i=A.null();break}case "object":{let n={},o=t.properties||{},s=new Set(t.required||[]);for(let[l,u]of Object.entries(o)){let d=Ie(u,e);n[l]=s.has(l)?d:d.optional();}if(t.propertyNames){let l=Ie(t.propertyNames,e),u=t.additionalProperties&&typeof t.additionalProperties=="object"?Ie(t.additionalProperties,e):A.any();if(Object.keys(n).length===0){i=A.record(l,u);break}let d=A.object(n).passthrough(),m=A.looseRecord(l,u);i=A.intersection(d,m);break}if(t.patternProperties){let l=t.patternProperties,u=Object.keys(l),d=[];for(let f of u){let p=Ie(l[f],e),v=A.string().regex(new RegExp(f));d.push(A.looseRecord(v,p));}let m=[];if(Object.keys(n).length>0&&m.push(A.object(n).passthrough()),m.push(...d),m.length===0)i=A.object({}).passthrough();else if(m.length===1)i=m[0];else {let f=A.intersection(m[0],m[1]);for(let p=2;p<m.length;p++)f=A.intersection(f,m[p]);i=f;}break}let a=A.object(n);t.additionalProperties===false?i=a.strict():typeof t.additionalProperties=="object"?i=a.catchall(Ie(t.additionalProperties,e)):i=a.passthrough();break}case "array":{let n=t.prefixItems,o=t.items;if(n&&Array.isArray(n)){let s=n.map(l=>Ie(l,e)),a=o&&typeof o=="object"&&!Array.isArray(o)?Ie(o,e):void 0;a?i=A.tuple(s).rest(a):i=A.tuple(s),typeof t.minItems=="number"&&(i=i.check(A.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(A.maxLength(t.maxItems)));}else if(Array.isArray(o)){let s=o.map(l=>Ie(l,e)),a=t.additionalItems&&typeof t.additionalItems=="object"?Ie(t.additionalItems,e):void 0;a?i=A.tuple(s).rest(a):i=A.tuple(s),typeof t.minItems=="number"&&(i=i.check(A.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(A.maxLength(t.maxItems)));}else if(o!==void 0){let s=Ie(o,e),a=A.array(s);typeof t.minItems=="number"&&(a=a.min(t.minItems)),typeof t.maxItems=="number"&&(a=a.max(t.maxItems)),i=a;}else i=A.array(A.any());break}default:throw new Error(`Unsupported type: ${r}`)}return t.description&&(i=i.describe(t.description)),t.default!==void 0&&(i=i.default(t.default)),i}function Ie(t,e){if(typeof t=="boolean")return t?A.any():A.never();let r=yk(t,e),i=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let a=t.anyOf.map(u=>Ie(u,e)),l=A.union(a);r=i?A.intersection(r,l):l;}if(t.oneOf&&Array.isArray(t.oneOf)){let a=t.oneOf.map(u=>Ie(u,e)),l=A.xor(a);r=i?A.intersection(r,l):l;}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=i?r:A.any();else {let a=i?r:Ie(t.allOf[0],e),l=i?0:1;for(let u=l;u<t.allOf.length;u++)a=A.intersection(a,Ie(t.allOf[u],e));r=a;}t.nullable===true&&e.version==="openapi-3.0"&&(r=A.nullable(r)),t.readOnly===true&&(r=A.readonly(r));let n={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of o)a in t&&(n[a]=t[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in t&&(n[a]=t[a]);for(let a of Object.keys(t))LN.has(a)||(n[a]=t[a]);return Object.keys(n).length>0&&e.registry.add(r,n),r}function bk(t,e){if(typeof t=="boolean")return t?A.any():A.never();let r=jN(t,e?.defaultTarget),i=t.$defs||t.definitions||{},n={version:r,defs:i,refs:new Map,processing:new Set,rootSchema:t,registry:e?.registry??ke};return Ie(t,n)}var A,LN,$k=_(()=>{Li();La();qi();Hi();A={...Bi,...za,iso:vr},LN=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);});var oh={};ne(oh,{bigint:()=>BN,boolean:()=>qN,date:()=>HN,number:()=>ZN,string:()=>FN});function FN(t){return Ef(br,t)}function ZN(t){return Df(_r,t)}function qN(t){return Zf(Sr,t)}function BN(t){return Bf(wr,t)}function HN(t){return tp(Yi,t)}var _k=_(()=>{je();Hi();});var z={};ne(z,{$brand:()=>Ts,$input:()=>xf,$output:()=>kf,NEVER:()=>Wu,TimePrecision:()=>Pf,ZodAny:()=>$g,ZodArray:()=>kg,ZodBase64:()=>ic,ZodBase64URL:()=>oc,ZodBigInt:()=>wr,ZodBigIntFormat:()=>cc,ZodBoolean:()=>Sr,ZodCIDRv4:()=>nc,ZodCIDRv6:()=>rc,ZodCUID:()=>Ga,ZodCUID2:()=>Wa,ZodCatch:()=>Kg,ZodCodec:()=>hc,ZodCustom:()=>no,ZodCustomStringFormat:()=>$r,ZodDate:()=>Yi,ZodDefault:()=>Ug,ZodDiscriminatedUnion:()=>Ig,ZodE164:()=>sc,ZodEmail:()=>Ka,ZodEmoji:()=>Va,ZodEnum:()=>yr,ZodError:()=>NN,ZodExactOptional:()=>zg,ZodFile:()=>Dg,ZodFirstPartyTypeKind:()=>ih,ZodFunction:()=>th,ZodGUID:()=>Ki,ZodIPv4:()=>ec,ZodIPv6:()=>tc,ZodISODate:()=>Ua,ZodISODateTime:()=>ja,ZodISODuration:()=>Za,ZodISOTime:()=>Fa,ZodIntersection:()=>Eg,ZodIssueCode:()=>DN,ZodJWT:()=>ac,ZodKSUID:()=>Qa,ZodLazy:()=>Xg,ZodLiteral:()=>Rg,ZodMAC:()=>fg,ZodMap:()=>Ag,ZodNaN:()=>Jg,ZodNanoID:()=>Ja,ZodNever:()=>Sg,ZodNonOptional:()=>pc,ZodNull:()=>yg,ZodNullable:()=>jg,ZodNumber:()=>_r,ZodNumberFormat:()=>hn,ZodObject:()=>Qi,ZodOptional:()=>fc,ZodPipe:()=>gc,ZodPrefault:()=>Zg,ZodPromise:()=>eh,ZodReadonly:()=>Gg,ZodRealError:()=>Ue,ZodRecord:()=>to,ZodSet:()=>Ng,ZodString:()=>br,ZodStringFormat:()=>ee,ZodSuccess:()=>Hg,ZodSymbol:()=>hg,ZodTemplateLiteral:()=>Yg,ZodTransform:()=>Mg,ZodTuple:()=>Pg,ZodType:()=>U,ZodULID:()=>Ya,ZodURL:()=>Wi,ZodUUID:()=>ht,ZodUndefined:()=>vg,ZodUnion:()=>eo,ZodUnknown:()=>_g,ZodVoid:()=>wg,ZodXID:()=>Xa,ZodXor:()=>xg,_ZodString:()=>Ha,_default:()=>Fg,_function:()=>ck,any:()=>Uw,array:()=>Xi,base64:()=>ww,base64url:()=>kw,bigint:()=>Dw,boolean:()=>gg,catch:()=>Vg,check:()=>lk,cidrv4:()=>_w,cidrv6:()=>Sw,clone:()=>Ce,codec:()=>ok,coerce:()=>oh,config:()=>le,core:()=>Et,cuid:()=>fw,cuid2:()=>pw,custom:()=>uk,date:()=>Zw,decode:()=>og,decodeAsync:()=>ag,describe:()=>dk,discriminatedUnion:()=>Jw,e164:()=>xw,email:()=>rw,emoji:()=>dw,encode:()=>ig,encodeAsync:()=>sg,endsWith:()=>cr,enum:()=>dc,exactOptional:()=>Lg,file:()=>tk,flattenError:()=>Ti,float32:()=>Cw,float64:()=>Aw,formatError:()=>Pi,fromJSONSchema:()=>bk,function:()=>ck,getErrorMap:()=>zN,globalRegistry:()=>ke,gt:()=>pt,gte:()=>Ae,guid:()=>iw,hash:()=>Ow,hex:()=>Pw,hostname:()=>Tw,httpUrl:()=>uw,includes:()=>sr,instanceof:()=>fk,int:()=>Ba,int32:()=>Nw,int64:()=>Mw,intersection:()=>Tg,ipv4:()=>yw,ipv6:()=>$w,iso:()=>vr,json:()=>gk,jwt:()=>Iw,keyof:()=>qw,ksuid:()=>vw,lazy:()=>Qg,length:()=>pn,literal:()=>ek,locales:()=>zi,looseObject:()=>Kw,looseRecord:()=>Ww,lowercase:()=>ir,lt:()=>ft,lte:()=>He,mac:()=>bw,map:()=>Yw,maxLength:()=>fn,maxSize:()=>Vt,meta:()=>mk,mime:()=>lr,minLength:()=>It,minSize:()=>gt,multipleOf:()=>Kt,nan:()=>ik,nanoid:()=>mw,nativeEnum:()=>Qw,negative:()=>Ta,never:()=>lc,nonnegative:()=>Oa,nonoptional:()=>Bg,nonpositive:()=>Pa,normalize:()=>ur,null:()=>bg,nullable:()=>Ji,nullish:()=>nk,number:()=>pg,object:()=>Bw,optional:()=>Vi,overwrite:()=>it,parse:()=>eg,parseAsync:()=>tg,partialRecord:()=>Gw,pipe:()=>Gi,positive:()=>Ea,prefault:()=>qg,preprocess:()=>hk,prettifyError:()=>cd,promise:()=>ak,property:()=>Ca,readonly:()=>Wg,record:()=>Cg,refine:()=>nh,regex:()=>rr,regexes:()=>We,registry:()=>sa,safeDecode:()=>lg,safeDecodeAsync:()=>dg,safeEncode:()=>cg,safeEncodeAsync:()=>ug,safeParse:()=>ng,safeParseAsync:()=>rg,set:()=>Xw,setErrorMap:()=>MN,size:()=>mn,slugify:()=>pr,startsWith:()=>ar,strictObject:()=>Hw,string:()=>qa,stringFormat:()=>Ew,stringbool:()=>pk,success:()=>rk,superRefine:()=>rh,symbol:()=>Lw,templateLiteral:()=>sk,toJSONSchema:()=>Da,toLowerCase:()=>mr,toUpperCase:()=>fr,transform:()=>mc,treeifyError:()=>ad,trim:()=>dr,tuple:()=>Og,uint32:()=>Rw,uint64:()=>zw,ulid:()=>gw,undefined:()=>jw,union:()=>uc,unknown:()=>gn,uppercase:()=>or,url:()=>lw,util:()=>x,uuid:()=>ow,uuidv4:()=>sw,uuidv6:()=>aw,uuidv7:()=>cw,void:()=>Fw,xid:()=>hw,xor:()=>Vw});var sh=_(()=>{je();Hi();La();Qp();mg();vk();je();$f();je();Zi();$k();wf();qi();qi();_k();le(na());});var Sk=_(()=>{sh();sh();});var wk,kk=_(()=>{wk={API_DEFAULT:3e4,API_MIN:5e3,API_MAX:3e5,API_LONG_RUNNING:3e6,HEALTH_CHECK:1e4,HEALTH_CACHE_TTL:6e4,REDIS_CONNECT:5e3,REDIS_RETRY_MAX:10,REDIS_RETRY_BASE_MS:100,REDIS_RETRY_MAX_MS:3e3,SESSION_LOG_MAX_AGE_DAYS:7,LOG_MAX_SIZE_MB:5,LOG_MAX_FILES:10,RECOVERY_PROMPT_MS:3e4};});var ah,ch,KN,VN,JN,GN,WN,YN,xk,Ik,lh=_(()=>{Sk();kk();ah=1e3,ch=36e5,KN=z.object({method:z.enum(["none","bearer","api_key"]),token:z.string().optional(),tokenEnv:z.string().optional(),apiKey:z.string().optional(),apiKeyEnv:z.string().optional()}),VN=z.object({temperature:z.number().min(0).max(2).optional(),maxTokens:z.number().positive().optional(),timeout:z.number().min(ah).max(ch).optional(),requestsPerMinute:z.number().positive().optional(),tokensPerMinute:z.number().positive().optional()}).optional(),JN=z.object({id:z.string().regex(/^[a-z][a-z0-9-]*$/,"ID must start with a letter and contain only lowercase letters, numbers, and hyphens"),name:z.string().min(1,"Name is required"),type:z.enum(["local","anthropic","openai","perplexity","custom"]),enabled:z.boolean(),endpoint:z.string().optional(),auth:KN,defaultModel:z.string().min(1,"Default model is required"),models:z.array(z.string()).optional(),settings:VN,envVars:z.record(z.string(),z.string()).optional(),description:z.string().optional(),timeout:z.number().min(ah).max(ch).optional()}),GN=z.object({enabled:z.boolean(),port:z.number().min(1).max(65535),host:z.string().optional(),autoStart:z.boolean().optional(),corsOrigin:z.string().optional()}).optional(),WN=z.object({level:z.enum(["debug","info","warn","error"]),timestamps:z.boolean().optional(),colors:z.boolean().optional(),file:z.string().optional()}).optional(),YN=z.object({id:z.string().regex(/^[a-z][a-z0-9-]*$/,"ID must start with a letter and contain only lowercase letters, numbers, and hyphens"),name:z.string().min(1,"Name is required"),path:z.string().min(1,"Path is required"),description:z.string().optional(),pinned:z.boolean().optional(),defaultProvider:z.string().optional(),defaultModel:z.string().optional()}),xk=z.object({version:z.string(),defaultProvider:z.string().optional(),providers:z.array(JN),proxy:GN,logging:WN,workspaces:z.array(YN).optional()}),Ik={min:ah,max:ch,default:wk.API_DEFAULT};});var bn={};ne(bn,{addWorkspace:()=>pR,createProvider:()=>mR,deleteProvider:()=>sR,deleteProviderFile:()=>uR,ensureConfigDir:()=>vc,getAllProviders:()=>oR,getConfigDir:()=>tR,getConfigFile:()=>nR,getDefaultProvider:()=>Ke,getEnabledProviders:()=>st,getPinnedWorkspaces:()=>yc,getProvider:()=>ot,getProvidersDir:()=>rR,getWorkspace:()=>fR,getWorkspaces:()=>mh,loadConfig:()=>B,loadProviderFile:()=>cR,providerExists:()=>aR,removeWorkspace:()=>hR,saveConfig:()=>Fe,saveProvider:()=>dh,saveProviderFile:()=>lR,setDefaultProvider:()=>yn,updateWorkspace:()=>gR,validateProvider:()=>dR});function vc(){existsSync(oo)||mkdirSync(oo,{recursive:true}),existsSync(kr)||mkdirSync(kr,{recursive:true});}function tR(){return oo}function nR(){return ro}function rR(){return kr}function B(){if(vc(),!existsSync(ro)){let t=uh();return Fe(t),t}try{let t=readFileSync(ro,"utf-8"),e=(0,xr.parse)(t);e.version||(e.version="1.0"),e.providers||(e.providers=[]);let r=xk.safeParse(e);if(!r.success){console.error(M.red(`
|
|
216
|
+
\u274C Configuration validation failed:`));for(let i of r.error.issues){let n=i.path.map(String).join(".");console.error(M.dim(` \u2022 ${n}: ${i.message}`));}return console.error(M.yellow(`
|
|
217
|
+
Falling back to default configuration.`)),console.error(M.dim(`Fix your config file at: ${ro}
|
|
218
|
+
`)),uh()}return iR(r.data),r.data}catch(t){return console.error(M.red("Error loading config:"),t),console.error(M.yellow("Using default configuration. Please fix your config file.")),uh()}}function iR(t){let e=false;for(let r of t.providers)(r.auth.token||r.auth.apiKey)&&(e||(console.warn(M.yellow(`
|
|
219
|
+
\u26A0\uFE0F Security Warning:`)),e=true),console.warn(M.yellow(` Provider "${r.name}" has direct credentials in config.`)));e&&(console.warn(M.dim(" Recommended: Use environment variables (tokenEnv/apiKeyEnv) instead.")),console.warn(M.dim(` Example: tokenEnv: "ANTHROPIC_AUTH_TOKEN"
|
|
220
|
+
`)));}function Fe(t){vc();let e=join(tmpdir(),`mcc-config-${Date.now()}.tmp`);try{writeFileSync(e,(0,xr.stringify)(t,{indent:2}),"utf-8"),renameSync(e,ro);}catch(r){try{unlinkSync(e);}catch{}throw console.error("Error saving config:",r),r}}function ot(t){return B().providers.find(r=>r.id===t)}function st(){return B().providers.filter(e=>e.enabled)}function oR(){return B().providers}function dh(t){let e=B(),r=e.providers.findIndex(i=>i.id===t.id);r>=0?e.providers[r]=t:e.providers.push(t),Fe(e);}function sR(t){let e=B(),r=e.providers.length;return e.providers=e.providers.filter(i=>i.id!==t),e.providers.length!==r?(Fe(e),true):false}function yn(t){let e=B();e.defaultProvider=t,Fe(e);}function Ke(){return B().defaultProvider}function aR(t){return ot(t)!==void 0}function cR(t){let e=join(kr,`${t}.yaml`);if(existsSync(e))try{let r=readFileSync(e,"utf-8");return (0,xr.parse)(r)}catch{return}}function lR(t){vc();let e=join(kr,`${t.id}.yaml`);writeFileSync(e,(0, xr.stringify)(t,{indent:2}),"utf-8");}function uR(t){let e=join(kr,`${t}.yaml`);return existsSync(e)?(unlinkSync(e),true):false}function uh(){return {version:"1.0",defaultProvider:"claude-max",providers:[{id:"claude-max",name:"Claude Max Subscription",type:"anthropic",enabled:false,auth:{method:"bearer",tokenEnv:"ANTHROPIC_AUTH_TOKEN"},defaultModel:"claude-sonnet-4-6-20250219",models:["claude-opus-4-6-20250219","claude-sonnet-4-6-20250219","claude-haiku-4-5-20251001","claude-opus-4-5-20251101","claude-sonnet-4-5-20250929","claude-sonnet-4-20250514","claude-3-7-sonnet-20250219","claude-3-5-sonnet-20241022","claude-3-5-haiku-20241022"],description:'Claude Max subscription with bearer token. Run "claude setup-token" to configure.',timeout:12e4,envVars:{ANTHROPIC_AUTH_TOKEN:"${ANTHROPIC_AUTH_TOKEN}"},claudeCode:{model:"claude-sonnet-4-6-20250219",opusModel:"claude-opus-4-6-20250219",sonnetModel:"claude-sonnet-4-6-20250219",haikuModel:"claude-haiku-4-5-20251001"}},{id:"zai-coding-plan",name:"Z.AI GLM",type:"custom",enabled:false,endpoint:"https://api.z.ai/api/anthropic",auth:{method:"bearer",tokenEnv:"ZAI_API_KEY"},defaultModel:"glm-5",models:["glm-5","glm-4.7","glm-4.6v","glm-4.7-flash","glm-4.6","glm-4.5"],description:"Z.AI GLM-5 series (Opus: glm-5, Sonnet: glm-4.7, Haiku: glm-4.6v). Get API key at https://z.ai",timeout:3e6,envVars:{ANTHROPIC_BASE_URL:"https://api.z.ai/api/anthropic",ANTHROPIC_AUTH_TOKEN:"${ZAI_API_KEY}",API_TIMEOUT_MS:"3000000",CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1",ANTHROPIC_MODEL:"glm-5",ANTHROPIC_SMALL_FAST_MODEL:"glm-4.6v",ANTHROPIC_DEFAULT_SONNET_MODEL:"glm-4.7",ANTHROPIC_DEFAULT_OPUS_MODEL:"glm-5",ANTHROPIC_DEFAULT_HAIKU_MODEL:"glm-4.6v"}},{id:"minimax-coding-plan",name:"MiniMax",type:"custom",enabled:false,endpoint:"https://api.minimax.io/anthropic",auth:{method:"bearer",tokenEnv:"MINIMAX_API_KEY"},defaultModel:"MiniMax-M2.5-highspeed",models:["MiniMax-M2.5-highspeed","minimax-m2.5"],description:"MiniMax M2.5 models. Get API key at https://platform.minimax.io",timeout:3e6,envVars:{ANTHROPIC_BASE_URL:"https://api.minimax.io/anthropic",ANTHROPIC_AUTH_TOKEN:"${MINIMAX_API_KEY}",API_TIMEOUT_MS:"3000000",CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1",ANTHROPIC_MODEL:"MiniMax-M2.5-highspeed",ANTHROPIC_SMALL_FAST_MODEL:"MiniMax-M2.5-highspeed",ANTHROPIC_DEFAULT_SONNET_MODEL:"MiniMax-M2.5-highspeed",ANTHROPIC_DEFAULT_OPUS_MODEL:"MiniMax-M2.5-highspeed",ANTHROPIC_DEFAULT_HAIKU_MODEL:"MiniMax-M2.5-highspeed"}},{id:"deepinfra",name:"DeepInfra",type:"custom",enabled:false,endpoint:"https://api.deepinfra.com/v1/openai",auth:{method:"bearer",tokenEnv:"DEEPINFRA_API_KEY"},defaultModel:"anthropic/claude-sonnet-4-5-20250929",models:["anthropic/claude-opus-4-5-20251101","anthropic/claude-sonnet-4-5-20250929","anthropic/claude-3-5-sonnet-20241022","anthropic/claude-3-5-haiku-20241022","deepseek-ai/DeepSeek-V3","meta-llama/Llama-4-Maverick-17B-128E-Instruct","meta-llama/Llama-3.3-70B-Instruct","meta-llama/Llama-3.2-90B-Vision-Instruct","mistralai/Mistral-Small-24B-Instruct-2501","moonshotai/Kimi-K2.5","Qwen/Qwen3-235B-A22B","Qwen/Qwen3-Max-Thinking","Qwen/Qwen2.5-72B-Instruct","zai-org/GLM-5"],description:"DeepInfra multi-model API (Claude, GLM, Kimi, Llama, Qwen, Mistral, DeepSeek). OpenAI-compatible endpoint. Get API key at https://deepinfra.com",timeout:3e5,envVars:{ANTHROPIC_BASE_URL:"https://api.deepinfra.com/v1/openai",ANTHROPIC_AUTH_TOKEN:"${DEEPINFRA_API_KEY}",ANTHROPIC_MODEL:"anthropic/claude-sonnet-4-5-20250929",ANTHROPIC_SMALL_FAST_MODEL:"anthropic/claude-3-5-haiku-20241022",ANTHROPIC_DEFAULT_SONNET_MODEL:"anthropic/claude-sonnet-4-5-20250929",ANTHROPIC_DEFAULT_OPUS_MODEL:"anthropic/claude-opus-4-5-20251101",ANTHROPIC_DEFAULT_HAIKU_MODEL:"anthropic/claude-3-5-haiku-20241022",CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1"}},{id:"lm-studio",name:"LM Studio (Custom)",type:"local",enabled:false,endpoint:"http://localhost:1234/v1",auth:{method:"none"},defaultModel:"custom-model",models:["custom-model"],description:"LM Studio with custom models via Anthropic-compatible /v1/messages endpoint. Configure model name in settings.",timeout:3e5,envVars:{ANTHROPIC_BASE_URL:"http://localhost:1234/v1",ANTHROPIC_MODEL:"custom-model",ANTHROPIC_SMALL_FAST_MODEL:"custom-model",CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1"}},{id:"glm-local",name:"GLM-4.7 (LM Studio)",type:"local",enabled:false,endpoint:"http://localhost:1234/v1",auth:{method:"none"},defaultModel:"zai-org/glm-4.7-flash",models:["zai-org/glm-4.7-flash"],description:"Local GLM-4.7-Flash via LM Studio",timeout:3e5,envVars:{ANTHROPIC_MODEL:"zai-org/glm-4.7-flash",ANTHROPIC_SMALL_FAST_MODEL:"zai-org/glm-4.7-flash",CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1"}}],proxy:{enabled:false,port:9e3,host:"127.0.0.1",autoStart:false},logging:{level:"info",timestamps:true,colors:true}}}function dR(t){let e=[];return t.id||e.push("Provider ID is required"),t.name||e.push("Provider name is required"),t.type||e.push("Provider type is required"),t.type==="local"&&!t.endpoint&&e.push("Local providers require an endpoint URL"),t.auth&&(t.auth.method==="bearer"&&!t.auth.token&&!t.auth.tokenEnv&&e.push("Bearer auth requires token or tokenEnv"),t.auth.method==="api_key"&&!t.auth.apiKey&&!t.auth.apiKeyEnv&&e.push("API key auth requires apiKey or apiKeyEnv")),e}function mR(t={}){return {id:t.id??`provider-${Date.now()}`,name:t.name??"New Provider",type:t.type??"local",enabled:t.enabled??true,endpoint:t.endpoint,auth:t.auth??{method:"none"},defaultModel:t.defaultModel??"",models:t.models??[],settings:t.settings??{},envVars:t.envVars??{},description:t.description??"",...t}}function mh(){return B().workspaces??[]}function yc(){return mh().filter(t=>t.pinned)}function fR(t){return mh().find(e=>e.id===t)}function pR(t){let e=B();if(e.workspaces??=[],e.workspaces.some(r=>r.id===t.id))throw new Error(`Workspace ID "${t.id}" already exists`);e.workspaces.push(t),Fe(e);}function gR(t,e){let r=B();if(!r.workspaces)throw new Error("No workspaces configured");let i=r.workspaces.findIndex(n=>n.id===t);if(i===-1)throw new Error(`Workspace "${t}" not found`);r.workspaces[i]={...r.workspaces[i],...e},Fe(r);}function hR(t){let e=B();if(!e.workspaces)return false;let r=e.workspaces.findIndex(i=>i.id===t);return r===-1?false:(e.workspaces.splice(r,1),Fe(e),true)}var xr,oo,ro,kr,Ee=_(()=>{xr=bv(Gu());St();lh();oo=join(homedir(),".config","mcc"),ro=join(oo,"config.yaml"),kr=join(oo,"providers");});function fh(t){if(!(t&&yR(t)&&t.name==="TypeError"&&typeof t.message=="string"))return false;let{message:r,stack:i}=t;return r==="Load failed"?i===void 0||"__sentry_captured__"in t:r.startsWith("error sending request for url")?true:bR.has(r)}var vR,yR,bR,Ck=_(()=>{vR=Object.prototype.toString,yR=t=>vR.call(t)==="[object Error]",bR=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);});function $R(t){if(typeof t=="number"){if(t<0)throw new TypeError("Expected `retries` to be a non-negative number.");if(Number.isNaN(t))throw new TypeError("Expected `retries` to be a valid number or Infinity, got NaN.")}else if(t!==void 0)throw new TypeError("Expected `retries` to be a number or Infinity.")}function bc(t,e,{min:r=0,allowInfinity:i=false}={}){if(e!==void 0){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected \`${t}\` to be a number${i?" or Infinity":""}.`);if(!i&&!Number.isFinite(e))throw new TypeError(`Expected \`${t}\` to be a finite number.`);if(e<r)throw new TypeError(`Expected \`${t}\` to be \u2265 ${r}.`)}}function _R(t,e){let r=Math.max(1,t+1),i=e.randomize?Math.random()+1:1,n=Math.round(i*e.minTimeout*e.factor**(r-1));return n=Math.min(n,e.maxTimeout),n}function Ak(t,e){return Number.isFinite(e)?e-(performance.now()-t):e}async function SR({error:t,attemptNumber:e,retriesConsumed:r,startTime:i,options:n}){let o=t instanceof Error?t:new TypeError(`Non-error was thrown: "${t}". You should only throw errors.`);if(o instanceof Yt)throw o.originalError;let s=Number.isFinite(n.retries)?Math.max(0,n.retries-r):n.retries,a=n.maxRetryTime??Number.POSITIVE_INFINITY,l=Object.freeze({error:o,attemptNumber:e,retriesLeft:s,retriesConsumed:r});if(await n.onFailedAttempt(l),Ak(i,a)<=0)throw o;let u=await n.shouldConsumeRetry(l),d=Ak(i,a);if(d<=0||s<=0)throw o;if(o instanceof TypeError&&!fh(o)){if(u)throw o;return n.signal?.throwIfAborted(),false}if(!await n.shouldRetry(l))throw o;if(!u)return n.signal?.throwIfAborted(),false;let m=_R(r,n),f=Math.min(m,d);return n.signal?.throwIfAborted(),f>0&&await new Promise((p,v)=>{let g=()=>{clearTimeout(y),n.signal?.removeEventListener("abort",g),v(n.signal.reason);},y=setTimeout(()=>{n.signal?.removeEventListener("abort",g),p();},f);n.unref&&y.unref?.(),n.signal?.addEventListener("abort",g,{once:true});}),n.signal?.throwIfAborted(),true}async function ph(t,e={}){if(e={...e},$R(e.retries),Object.hasOwn(e,"forever"))throw new Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");e.retries??=10,e.factor??=2,e.minTimeout??=1e3,e.maxTimeout??=Number.POSITIVE_INFINITY,e.maxRetryTime??=Number.POSITIVE_INFINITY,e.randomize??=false,e.onFailedAttempt??=()=>{},e.shouldRetry??=()=>true,e.shouldConsumeRetry??=()=>true,bc("factor",e.factor,{min:0,allowInfinity:false}),bc("minTimeout",e.minTimeout,{min:0,allowInfinity:false}),bc("maxTimeout",e.maxTimeout,{min:0,allowInfinity:true}),bc("maxRetryTime",e.maxRetryTime,{min:0,allowInfinity:true}),e.factor>0||(e.factor=1),e.signal?.throwIfAborted();let r=0,i=0,n=performance.now();for(;!Number.isFinite(e.retries)||i<=e.retries;){r++;try{e.signal?.throwIfAborted();let o=await t(r);return e.signal?.throwIfAborted(),o}catch(o){await SR({error:o,attemptNumber:r,retriesConsumed:i,startTime:n,options:e})&&i++;}}throw new Error("Retry attempts exhausted without throwing an error.")}var Yt,Nk=_(()=>{Ck();Yt=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e;}};});function X(t){return t instanceof gh||t instanceof Error?t.message:typeof t=="string"?t:"Unknown error"}function Ze(t,e={}){let{showHint:r=true,showHelp:i=true}=e,n=X(t),o="",s="",a=n.toLowerCase();a.includes("no provider")||a.includes("provider not found")?(o='Run "mcc add" to add a new provider, or "mcc list" to see available providers.',s="mcc add"):a.includes("credential")||a.includes("api key")||a.includes("token")?(o='Check your credentials with "mcc config" or run "mcc add" to set up a new provider.',s="mcc config"):a.includes("connection")||a.includes("network")||a.includes("timeout")?(o='Check your internet connection and provider status with "mcc health".',s="mcc health"):a.includes("not configured")||a.includes("disabled")?(o='Enable the provider with "mcc configure" or add a new one with "mcc add".',s="mcc configure"):a.includes("session")&&a.includes("not found")&&(o='List available sessions with "mcc sessions ls".',s="mcc sessions ls");let l=n;return o&&r&&(l+=`
|
|
221
|
+
|
|
222
|
+
\u{1F4A1} ${o}`),s&&i&&(l+=`
|
|
223
|
+
|
|
224
|
+
\u{1F449} Run: ${s}`),l}var gh,vt=_(()=>{gh=class extends Error{constructor(r,i,n,o){super(i);this.code=r;this.cause=n;this.context=o;this.name="MCCError";}toString(){let r=`[${this.code}] ${this.message}`;return this.context&&(r+=` | Context: ${JSON.stringify(this.context)}`),this.cause&&(r+=` | Cause: ${this.cause.message}`),r}toJSON(){return {name:this.name,code:this.code,message:this.message,context:this.context,cause:this.cause?.message}}};});function kR(t){if(t instanceof Error){if(t instanceof yt)return false;let e=t.message.toLowerCase();if(e.includes("econnrefused")||e.includes("etimedout")||e.includes("enotfound")||e.includes("timeout")||e.includes("network")||e.includes("socket"))return true;if("status"in t){let r=t.status;return r>=500||r===429}}return false}function xR(t){if(t instanceof Error&&"status"in t){let e=t.status;return e===401||e===403}return false}function IR(t){if(t instanceof Error&&"status"in t){let e=t.status;return e>=400&&e<500&&e!==429}return false}async function so(t,e={}){let r={...wR,...e};return ph(async()=>{try{return await t()}catch(i){throw i instanceof yt?new Yt(X(i)):hh(i)?new Yt(X(i)):xR(i)?new Yt(X(i)):IR(i)?new Yt(X(i)):i}},{retries:r.retries,minTimeout:r.minTimeout,maxTimeout:r.maxTimeout,randomize:true,onFailedAttempt:i=>{let n=i.attemptNumber??1,o=X(i);!r.silent&&kR(i)&&console.log(M.yellow(` \u21BB Retry ${n}/${r.retries+1}: ${o}`)),r.onRetry&&i instanceof Error&&r.onRetry(i,n);}})}function hh(t){return !!(t instanceof Error&&(t.name==="AbortError"||t.message.toLowerCase().includes("abort")))}async function vh(t,e,r){let i=e?.timeout??3e4;try{return await so(async()=>{let n=new AbortController,o=setTimeout(()=>{n.abort();},i);try{let s=await fetch(t,{...e,signal:n.signal});if(!s.ok)throw new Ir(`HTTP ${s.status}: ${s.statusText}`,s.status);return s}catch(s){throw hh(s)?new yt(`Request timed out after ${i}ms`):s}finally{clearTimeout(o);}},r)}catch(n){throw n instanceof yt?n:hh(n)?new yt(`Request timed out after ${i}ms`):n}}var wR,Ir,yt,yh=_(()=>{Nk();St();vt();wR={retries:3,minTimeout:1e3,maxTimeout:8e3};Ir=class extends Error{status;constructor(e,r){super(e),this.name="RetryableError",this.status=r;}},yt=class extends Error{constructor(e){super(e),this.name="TimeoutError";}};});var kh={};ne(kh,{deleteCredential:()=>_c,formatCredentialStatus:()=>Sc,getCredential:()=>co,getCredentialSource:()=>Xt,getCredentialsFile:()=>Uk,hasAnyCredentials:()=>wc,hasCredential:()=>wh,listCredentials:()=>lo,resolveCredential:()=>Re,setCredential:()=>at});function zR(){let t=process.env.USER??process.env.USERNAME??"default",e=homedir();return `mcc-${t}-${e}`}function Lk(t){return scryptSync(zR(),t,MR)}function LR(t){let e=randomBytes($n),r=Lk(e),i=randomBytes(ao),n=createCipheriv(zk,r,i),o=Buffer.concat([n.update(t,"utf8"),n.final()]),s=n.getAuthTag();return Buffer.concat([e,i,s,o])}function jR(t){let e=t.subarray(0,$n),r=t.subarray($n,$n+ao),i=t.subarray($n+ao,$n+ao+Dk),n=t.subarray($n+ao+Dk),o=Lk(e),s=createDecipheriv(zk,o,r);return s.setAuthTag(i),s.update(n).toString("utf8")+s.final("utf8")}function Sh(){existsSync($c)||mkdirSync($c,{recursive:true});}function bh(t,e){try{Sh();let r=new Date().toISOString(),i=existsSync(Er)?statSync(Er).size:0,n=`[${r}] ${t}: ${e} (file_size=${i})
|
|
225
|
+
`;appendFileSync(DR,n,{mode:384});}catch{}}function Tr(){if(Sh(),!existsSync(Er))return {version:"1.0",credentials:{}};try{let t=readFileSync(Er),e=jR(t),r=JSON.parse(e);if(!r||typeof r!="object")return console.error("[MCC] Invalid credentials file format - returning empty store"),bh("invalid_format","parsed value is not an object"),{version:"1.0",credentials:{}};let i=r;return !i.credentials||typeof i.credentials!="object"?(console.error("[MCC] Invalid credentials file: missing credentials object - returning empty store"),bh("missing_credentials","credentials field missing or not an object"),{version:"1.0",credentials:{}}):(i.version&&typeof i.version!="string"&&console.error("[MCC] Invalid credentials file: invalid version field - using default"),i)}catch(t){let e=t instanceof Error?t.message:String(t);return console.error(`[MCC] Failed to load credentials: ${e} - returning empty store`),bh("decrypt_failed",e),{version:"1.0",credentials:{}}}}function jk(t){Sh();let e=LR(JSON.stringify(t));writeFileSync(Er,e,{mode:384});}function at(t,e){if(!t||typeof t!="string")throw new Error("Credential key must be a non-empty string");if(!/^[A-Z_][A-Z0-9_]*$/.test(t))throw new Error("Credential key must match pattern: uppercase letters, numbers, underscores, cannot start with number");if(!e||typeof e!="string")throw new Error("Credential value must be a non-empty string");if(e.length>1e4)throw new Error("Credential value too large (max 10000 characters)");let r=Tr();r.credentials[t]=e,jk(r);}function co(t){return Tr().credentials[t]}function _c(t){let e=Tr();if(t in e.credentials){let{[t]:r,...i}=e.credentials;return e.credentials=i,jk(e),true}return false}function lo(){let t=Tr();return Object.keys(t.credentials)}function wh(t){let e=Tr();return t in e.credentials}function Re(t){let e=co(t);return e||process.env[t]}function Xt(t){return wh(t)?"stored":process.env[t]?"env":"none"}function Sc(t){switch(Xt(t)){case "stored":return M.green("\u2713 Stored (encrypted)");case "env":return M.yellow("\u2713 Environment variable");case "none":return M.red("\u2717 Not configured")}}function Uk(){return Er}function wc(){let t=Tr();return Object.keys(t.credentials).length>0?true:["ANTHROPIC_AUTH_TOKEN","ANTHROPIC_API_KEY","ZAI_API_KEY","MINIMAX_API_KEY","DEEPINFRA_API_KEY","OPENAI_API_KEY"].some(r=>process.env[r])}var $c,Er,DR,zk,MR,ao,Dk,$n,bt=_(()=>{St();$c=join(homedir(),".config","mcc"),Er=join($c,".credentials"),DR=join($c,".credentials-audit.log"),zk="aes-256-gcm",MR=32,ao=16,Dk=16,$n=32;});var xc={};ne(xc,{checkAllProviders:()=>Ih,checkProvider:()=>Ye,formatHealthResult:()=>Fk,formatHealthResultVerbose:()=>KR,getHealthSummary:()=>VR});function xh(t){return t.timeout??Ik.default}function kc(t){if(t instanceof Error){let e=t.message.toLowerCase(),r=UR(t);if(e.includes("timeout")||t.name==="TimeoutError"||r==="ETIMEDOUT")return {category:"timeout",suggestion:"Try increasing the timeout value in provider settings"};if(r==="ECONNREFUSED"||r==="ENOTFOUND"||r==="ECONNRESET"||e.includes("network")||e.includes("socket")||e.includes("dns"))return {category:"network",suggestion:"Check if the endpoint is reachable and the service is running"};if(r==="401"||r==="403"||e.includes("unauthorized")||e.includes("forbidden")||e.includes("invalid api key")||e.includes("authentication"))return {category:"auth",suggestion:"Verify your API key or token is correct"};if(/^5\d{2}$/.test(r)||e.includes("internal server error"))return {category:"server",suggestion:"The server is experiencing issues. Try again later"}}return {category:"unknown",suggestion:"Check provider configuration and try again"}}function UR(t){let r=t.message.match(/\b(E[A-Z]+|401|403|404|429|5\d{2})\b/i);return r?r[1].toUpperCase():""}async function Ye(t){let e=Date.now();try{switch(t.type){case "local":return await FR(t,e);case "anthropic":return ZR(t,e);case "openai":return await qR(t,e);case "perplexity":return BR(t,e);case "custom":return await HR(t,e);default:return {ok:!1,message:`Unknown provider type: ${t.type}`,latencyMs:Date.now()-e,category:"config",suggestion:"Use a valid provider type: local, anthropic, openai, perplexity, or custom"}}}catch(r){let{category:i,suggestion:n}=kc(r);return {ok:false,message:X(r),latencyMs:Date.now()-e,error:r instanceof Error?r.stack:String(r),category:i,suggestion:n}}}async function Ih(t){let e=new Map;return await Promise.all(t.map(async r=>{let i=await Ye(r);e.set(r.id,i);})),e}async function FR(t,e){let r=t.endpoint??"http://localhost:1234/v1",i=xh(t);try{let s=(await(await so(async()=>{let l=`${r}/models`,u=await fetch(l,{method:"GET",signal:AbortSignal.timeout(i)});if(!u.ok){let d=new Error(`HTTP ${u.status}: ${u.statusText}`);throw d.status=u.status,d}return u},{retries:2,silent:!0})).json()).data?.map(l=>l.id)??[];return !(t.defaultModel?s.includes(t.defaultModel):s.length>0)&&t.defaultModel?{ok:!1,message:`Model ${t.defaultModel} not found`,latencyMs:Date.now()-e,models:s,category:"config",suggestion:`Available models: ${s.slice(0,3).join(", ")}${s.length>3?"...":""}`}:{ok:!0,message:s.length>0?`${s.length} models available`:"Connected (no models listed)",latencyMs:Date.now()-e,models:s}}catch(n){let{category:o,suggestion:s}=kc(n);return n instanceof Error&&n.name==="TimeoutError"?{ok:false,message:`Connection timeout (${i}ms)`,latencyMs:Date.now()-e,category:"timeout",suggestion:"Try increasing the timeout value or check if the service is running"}:{ok:false,message:`Cannot connect to ${r}`,latencyMs:Date.now()-e,category:o,suggestion:s}}}function ZR(t,e){let r=uo(t),i=t.auth.method==="bearer";if(!r){let n=t.auth.tokenEnv??t.auth.apiKeyEnv??"ANTHROPIC_AUTH_TOKEN";return {ok:false,message:"No credentials configured",latencyMs:0,category:"auth",suggestion:i?`Run "claude setup-token" in terminal, then set ${n} environment variable`:`Set the ${n} environment variable`}}return {ok:true,message:i?"Bearer token configured":"API key configured",latencyMs:0}}async function qR(t,e){let r=uo(t),i=xh(t);if(!r)return {ok:false,message:"No API key configured",latencyMs:0,category:"auth",suggestion:`Set the ${t.auth.apiKeyEnv??"OPENAI_API_KEY"} environment variable`};if(!r.startsWith("sk-"))return {ok:false,message:"API key format invalid",latencyMs:0,category:"auth",suggestion:"OpenAI API keys should start with sk-"};try{return await so(async()=>{let n=await fetch("https://api.openai.com/v1/models",{headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json"},signal:AbortSignal.timeout(i)});if(!n.ok){let o=new Error(`API error: ${n.status}`);throw o.status=n.status,o}return n},{retries:2,silent:!0}),{ok:!0,message:"Connected to OpenAI",latencyMs:Date.now()-e}}catch(n){let{category:o,suggestion:s}=kc(n);return {ok:false,message:X(n),latencyMs:Date.now()-e,category:o,suggestion:s}}}function BR(t,e){return uo(t)?{ok:true,message:"Perplexity API key configured",latencyMs:0}:{ok:false,message:"No API key configured",latencyMs:0,category:"auth",suggestion:`Set the ${t.auth.apiKeyEnv??"PERPLEXITY_API_KEY"} environment variable`}}async function HR(t,e){if(!t.endpoint)return {ok:false,message:"No endpoint URL configured",latencyMs:0,category:"config",suggestion:"Add an endpoint URL to the provider configuration"};if(t.auth.method==="api_key"||t.auth.method==="bearer"){if(!uo(t))return {ok:false,message:"No credentials configured",latencyMs:0,category:"auth",suggestion:`Set the ${t.auth.tokenEnv??t.auth.apiKeyEnv??"CUSTOM_API_KEY"} environment variable`};if(t.endpoint.includes("/anthropic")||t.envVars?.ANTHROPIC_BASE_URL!==void 0)return {ok:true,message:t.auth.method==="bearer"?"Bearer token configured":"API key configured",latencyMs:0}}if(t.auth.method==="none")return {ok:true,message:"Endpoint configured (no auth required)",latencyMs:0};let r=xh(t);try{let o=(await(await so(async()=>{let s=`${t.endpoint}/models`,a={"Content-Type":"application/json"},l=uo(t);l&&(t.auth.method==="bearer"?a.Authorization=`Bearer ${l}`:a["x-api-key"]=l);let u=await fetch(s,{method:"GET",headers:a,signal:AbortSignal.timeout(r)});if(!u.ok){let d=new Error(`HTTP ${u.status}: ${u.statusText}`);throw d.status=u.status,d}return u},{retries:2,silent:!0})).json()).data?.map(s=>s.id)??[];return {ok:!0,message:o.length>0?`${o.length} models available`:"Connected",latencyMs:Date.now()-e,models:o}}catch(i){let{category:n,suggestion:o}=kc(i);return i instanceof Error&&i.name==="TimeoutError"?{ok:false,message:`Connection timeout (${r}ms)`,latencyMs:Date.now()-e,category:"timeout",suggestion:"Try increasing the timeout value or check if the endpoint is reachable"}:{ok:false,message:`Cannot connect to ${t.endpoint}`,latencyMs:Date.now()-e,category:n,suggestion:o}}}function uo(t){if(t.auth.token)return t.auth.token;if(t.auth.apiKey)return t.auth.apiKey;let e=t.auth.tokenEnv??t.auth.apiKeyEnv;if(e)return Re(e)}function Fk(t,e=50){let r=t.ok?"\u2705":"\u274C",i=t.message.length>e?t.message.substring(0,e)+"...":t.message,n=`${r} ${i}`;return t.latencyMs!==void 0&&t.latencyMs>0&&(n+=` (${t.latencyMs}ms)`),n}function KR(t){let e=Fk(t,100);return !t.ok&&t.suggestion&&(e+=`
|
|
226
|
+
\u{1F4A1} ${t.suggestion}`),e}function VR(t){let e=0,r=0;for(let i of t.values())i.ok?e++:r++;return {total:t.size,healthy:e,unhealthy:r,providers:t}}var Qt=_(()=>{yh();vt();lh();bt();});async function Hk(t){await Zk;let e=t(),r=(async()=>{try{await e;}catch(i){throw console.error("Error in state-locked operation:",i),i}})();return Zk=r,await r,e}function Kk(){if(!existsSync(mo))return null;try{let t=readFileSync(mo,"utf-8"),e=JSON.parse(t);if(!e||typeof e!="object")return console.error("Invalid control state: not an object"),null;let r=e;return !r.activeProvider||typeof r.activeProvider!="string"?(console.error("Invalid control state: missing or invalid activeProvider"),null):!r.providers||typeof r.providers!="object"?(console.error("Invalid control state: missing or invalid providers"),null):typeof r.updatedAt!="number"?(console.error("Invalid control state: missing or invalid updatedAt"),null):r}catch(t){return console.error("Failed to read control state:",t),null}}function Vk(t){mkdirSync(Bk,{recursive:true}),writeFileSync(mo,JSON.stringify(t,null,2));}function nD(t,e){let r={};for(let o of t){if(!o.enabled)continue;let s=o.auth.tokenEnv??o.auth.apiKeyEnv,a=s?Re(s)??process.env[s]:void 0;r[o.id]={id:o.id,name:o.name,endpoint:o.endpoint??"https://api.anthropic.com",model:o.defaultModel,authMethod:o.auth.method,authEnvVar:s,authToken:a,timeout:o.timeout};}let i=e;if(!(i in r)){let o=Object.keys(r)[0];if(!o)throw new Error("No enabled providers found in configuration");i=o;}let n={activeProvider:i,providers:r,updatedAt:Date.now()};return Vk(n),n}function rD(t){Vk(t),_n=t;}async function Jk(t){return _n=nD(t.providers,t.defaultProvider),Ec||(watchFile(mo,{interval:500},()=>{Hk(()=>{let e=Kk();if(e&&_n&&e.activeProvider!==_n.activeProvider){let r=_n.activeProvider,i=e.activeProvider;_n=e,t.onSwitch?.(r,i);}});}),Ec=true),new Promise((e,r)=>{let i=createServer((n,o)=>{iD(n,o);});i.on("error",n=>{n.code==="EADDRINUSE"?r(new Error(`Port ${t.port} already in use`)):r(n);}),i.listen(t.port,t.host,()=>{Ic=i,e({server:i,port:t.port});});})}async function Gk(){if(Ic){let t=Ic;await new Promise((e,r)=>{t.close(i=>{i?r(i):e();});}),Ic=null;}Ec&&(unwatchFile(mo),Ec=false);}function Wk(t,e){return `http://${e}:${t}`}async function iD(t,e){let r=await Hk(()=>Kk()??_n);if(!r?.activeProvider){e.writeHead(503,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:{type:"proxy_error",message:"No active provider configured"}}));return}if(!(r.activeProvider in r.providers)){e.writeHead(503,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:{type:"proxy_error",message:`Provider "${r.activeProvider}" not found`}}));return}let i=r.providers[r.activeProvider];if(e.setHeader("Access-Control-Allow-Origin","*"),e.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS"),e.setHeader("Access-Control-Allow-Headers","Content-Type, x-api-key, anthropic-version, Authorization"),t.method==="OPTIONS"){e.writeHead(204),e.end();return}let n=t.url??"/";n==="/v1/messages"&&t.method==="POST"?await oD(t,e,i):n==="/v1/models"&&t.method==="GET"?cD(t,e,i):n==="/mcc/switch"&&t.method==="POST"?await sD(t,e,r):n==="/mcc/status"&&t.method==="GET"?aD(t,e,r):(e.writeHead(404,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:{type:"not_found",message:`Route not found: ${n}`}})));}async function oD(t,e,r){let i=await Yk(t),n;try{n=JSON.parse(i);}catch{e.writeHead(400,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:{type:"invalid_request",message:"Invalid JSON body"}}));return}let o=n.model,s=n.stream===true,a={"Content-Type":"application/json"};r.authMethod==="bearer"&&r.authToken?a.Authorization=`Bearer ${r.authToken}`:r.authMethod==="api_key"&&r.authToken&&(a["x-api-key"]=r.authToken);let l=!r.endpoint.includes("anthropic.com"),u=r.timeout??12e4;if(l){let d=uD(n,o);try{let m=await vh(`${r.endpoint}/chat/completions`,{method:"POST",headers:a,body:JSON.stringify(d),timeout:u},{retries:2,silent:!0});if(s&&m.body)await lD(m,e,o);else {let f=await m.json(),p=dD(f,n.model);e.writeHead(200,{"Content-Type":"application/json"}),e.end(JSON.stringify(p));}}catch(m){if(m instanceof Ir&&m.status){e.writeHead(m.status,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:{type:"upstream_error",message:`Provider error: ${m.message}`}}));return}if(m instanceof yt||m instanceof Error&&(m.name==="AbortError"||m.name==="TimeoutError"||m.message.toLowerCase().includes("abort")||m.message.toLowerCase().includes("timeout"))){e.writeHead(504,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:{type:"timeout",message:`Provider request timed out after ${u}ms`}}));return}e.writeHead(502,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:{type:"proxy_error",message:`Failed to connect to provider: ${m instanceof Error?m.message:String(m)}`}}));}}else try{let d=await vh(`${r.endpoint}/v1/messages`,{method:"POST",headers:a,body:JSON.stringify({...n,model:o}),timeout:u},{retries:2,silent:!0});if(s&&d.body){e.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"});let m=d.body.getReader(),f=new TextDecoder;for(;;){let p=await m.read();if(p.done)break;e.write(f.decode(p.value,{stream:!0}));}e.end();}else {let m=await d.text();e.writeHead(200,{"Content-Type":"application/json"}),e.end(m);}}catch(d){if(d instanceof Ir&&d.status){e.writeHead(d.status,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:{type:"upstream_error",message:`Provider error: ${d.message}`}}));return}if(d instanceof yt||d instanceof Error&&(d.name==="AbortError"||d.name==="TimeoutError"||d.message.toLowerCase().includes("abort")||d.message.toLowerCase().includes("timeout"))){e.writeHead(504,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:{type:"timeout",message:`Provider request timed out after ${u}ms`}}));return}e.writeHead(502,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:{type:"proxy_error",message:`Failed to connect to provider: ${d instanceof Error?d.message:String(d)}`}}));}}async function sD(t,e,r){let i=await Yk(t),n;try{n=JSON.parse(i);}catch{e.writeHead(400,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:"Invalid JSON"}));return}let o=n.provider;if(!o){e.writeHead(400,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:"Missing provider field"}));return}if(!(o in r.providers)){e.writeHead(404,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:`Provider "${o}" not found`,available:Object.keys(r.providers)}));return}let s=r.activeProvider;r.activeProvider=o,r.updatedAt=Date.now(),rD(r),e.writeHead(200,{"Content-Type":"application/json"}),e.end(JSON.stringify({success:true,from:s,to:o,provider:r.providers[o]}));}function aD(t,e,r){let i=r.providers[r.activeProvider];e.writeHead(200,{"Content-Type":"application/json"}),e.end(JSON.stringify({activeProvider:r.activeProvider,activeProviderName:i?.name,activeProviderModel:i?.model,availableProviders:Object.entries(r.providers).map(([n,o])=>({id:n,name:o.name,model:o.model})),updatedAt:r.updatedAt}));}function cD(t,e,r){e.writeHead(200,{"Content-Type":"application/json"}),e.end(JSON.stringify({data:[{id:r.model,display_name:r.model,created_at:new Date().toISOString()}]}));}async function lD(t,e,r){let i=t.body?.getReader();if(!i){e.end();return}e.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"});let n=new TextDecoder,a={type:"message_start",message:{id:`msg_${Date.now()}`,type:"message",role:"assistant",content:[],model:r,stop_reason:null,stop_sequence:null,usage:{input_tokens:0,output_tokens:0}}};e.write(`event: message_start
|
|
227
|
+
data: ${JSON.stringify(a)}
|
|
228
|
+
|
|
229
|
+
`);let l={type:"content_block_start",index:0,content_block:{type:"text",text:""}};e.write(`event: content_block_start
|
|
230
|
+
data: ${JSON.stringify(l)}
|
|
231
|
+
|
|
232
|
+
`);let u=0,d="";try{for(;;){let v=await i.read();if(v.done||!v.value)break;let g=v.value;d+=n.decode(g,{stream:!0});let y=d.split(`
|
|
233
|
+
`);d=y.pop()??"";for(let S of y){if(!S.startsWith("data: "))continue;let E=S.slice(6).trim();if(E!=="[DONE]")try{let T=JSON.parse(E),C=mD(T);C&&(u++,e.write(`event: content_block_delta
|
|
234
|
+
data: ${JSON.stringify(C)}
|
|
235
|
+
|
|
236
|
+
`));}catch{continue}}}}catch{}let m={type:"content_block_stop",index:0};e.write(`event: content_block_stop
|
|
237
|
+
data: ${JSON.stringify(m)}
|
|
238
|
+
|
|
239
|
+
`);let f={type:"message_delta",delta:{stop_reason:"end_turn",stop_sequence:null},usage:{output_tokens:u}};e.write(`event: message_delta
|
|
240
|
+
data: ${JSON.stringify(f)}
|
|
241
|
+
|
|
242
|
+
`);let p={type:"message_stop"};e.write(`event: message_stop
|
|
243
|
+
data: ${JSON.stringify(p)}
|
|
244
|
+
|
|
245
|
+
`),e.end();}function uD(t,e){return {model:e,messages:[...t.system?[{role:"system",content:typeof t.system=="string"?t.system:t.system.filter(r=>r.type==="text"&&r.text).map(r=>r.text??"").join(`
|
|
246
|
+
`)}]:[],...t.messages.map(r=>({role:r.role,content:typeof r.content=="string"?r.content:r.content.filter(i=>i.type==="text"&&i.text).map(i=>i.text??"").join(`
|
|
247
|
+
`)}))],temperature:t.temperature,max_tokens:t.max_tokens,stream:t.stream}}function dD(t,e){let r=t.choices[0];return {id:t.id,type:"message",role:"assistant",content:[{type:"text",text:r.message.content}],model:e,stop_reason:r.finish_reason,usage:{input_tokens:t.usage?.prompt_tokens??0,output_tokens:t.usage?.completion_tokens??0}}}function mD(t){let e=t.choices[0]?.delta?.content;return e?{type:"content_block_delta",index:0,delta:{type:"text_delta",text:e}}:null}function Yk(t){return new Promise((e,r)=>{let i=[];t.on("data",n=>{i.push(n);}),t.on("end",()=>{e(Buffer.concat(i).toString("utf8"));}),t.on("error",r);})}var Bk,mo,_n,Ic,Ec,Zk,Xk=_(()=>{bt();yh();Bk=join(homedir(),".config","mcc"),mo=join(Bk,".proxy-control.json"),_n=null,Ic=null,Ec=false,Zk=Promise.resolve();});function Qk(t){let e=t.split(`
|
|
248
|
+
`),r=0,i=0,n={},o=[],s=new Set;for(let a of e){let l=a.trim(),u=hD.exec(l);if(!u)continue;let[,d,m,f,p]=u;f==="error"?(r++,n[d]=(n[d]??0)+1,o.push({file:d,line:parseInt(m,10),message:p})):i++,s.add(d);}return {errors:r,warnings:i,errorsByFile:n,topErrors:o.slice(0,5),fileCount:s.size}}async function vD(t,e=gD){let r=Date.now(),i=join(t,"tsconfig.json");if(!existsSync(i))return {workspace:t,hasTypeScript:false,hasTsConfig:false,errors:0,warnings:0,files:0,errorsByFile:{},topErrors:[],checkedAt:new Date().toISOString(),durationMs:Date.now()-r};try{let o;try{o=_t.resolve("typescript/bin/tsc");}catch{o="npx";}let s=o==="npx"?["tsc","--noEmit","--pretty","false"]:["--noEmit","--pretty","false"],{stdout:a,stderr:l}=await Tc(o,s,{cwd:t,timeout:e,env:{...process.env,NODE_NO_WARNINGS:"1"}}),u=a+`
|
|
249
|
+
`+l,d=Qk(u);return {workspace:t,hasTypeScript:!0,hasTsConfig:!0,errors:d.errors,warnings:d.warnings,files:d.fileCount,errorsByFile:d.errorsByFile,topErrors:d.topErrors,checkedAt:new Date().toISOString(),durationMs:Date.now()-r}}catch(o){if(yD(o)&&o.stdout){let s=(o.stdout??"")+`
|
|
250
|
+
`+(o.stderr??""),a=Qk(s);return {workspace:t,hasTypeScript:true,hasTsConfig:true,errors:a.errors,warnings:a.warnings,files:a.fileCount,errorsByFile:a.errorsByFile,topErrors:a.topErrors,checkedAt:new Date().toISOString(),durationMs:Date.now()-r}}return {workspace:t,hasTypeScript:true,hasTsConfig:true,errors:-1,warnings:0,files:0,errorsByFile:{},topErrors:[],checkedAt:new Date().toISOString(),durationMs:Date.now()-r}}}function yD(t){return typeof t=="object"&&t!==null&&"stdout"in t}function bD(t){return existsSync(join(t,"bun.lockb"))||existsSync(join(t,"bun.lock"))?"bun":existsSync(join(t,"pnpm-lock.yaml"))?"pnpm":existsSync(join(t,"yarn.lock"))?"yarn":existsSync(join(t,"package-lock.json"))?"npm":null}async function ex(t){let[e,r,i,n]=await Promise.all([vD(t).catch(()=>null),Tc("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:t}).then(s=>s.stdout.trim()).catch(()=>null),Tc("git",["status","--porcelain"],{cwd:t}).then(s=>s.stdout.trim().length>0).catch(()=>false),Tc("node",["--version"]).then(s=>s.stdout.trim()).catch(()=>null)]),o=bD(t);return {diagnostics:e,gitBranch:r,gitDirty:i,nodeVersion:n,packageManager:o}}function tx(t){if(!t.hasTypeScript)return c.dim("No TypeScript project detected");if(t.errors===-1)return c.dim("TypeScript check timed out");if(t.errors===0){let n=t.warnings>0?` ${c.warning(`${t.warnings} warning${t.warnings===1?"":"s"}`)}`:"";return `${c.success("0 errors")}${n} ${c.dim(`(${t.durationMs}ms)`)}`}let e=`${c.error(`${t.errors} error${t.errors===1?"":"s"}`)} in ${t.files} file${t.files===1?"":"s"}`,r=t.topErrors.slice(0,3);if(r.length===0)return e;let i=r.map(n=>` ${c.dim(n.file)}:${c.dim(String(n.line))} ${c.subtle(n.message)}`).join(`
|
|
251
|
+
`);return `${e}
|
|
252
|
+
${i}`}var Tc,gD,hD,nx=_(()=>{qe();Tc=promisify(execFile),gD=15e3,hD=/^(.+)\((\d+),\d+\):\s+(error|warning)\s+TS\d+:\s+(.+)$/;});var rx=_(()=>{nx();});function ox(t){if(ix[t])return ix[t];let e=t.toLowerCase();return e.includes("opus")?{...fo,tier:"opus",inputPerMTok:15,outputPerMTok:75}:e.includes("sonnet")?{...fo,tier:"sonnet",inputPerMTok:3,outputPerMTok:15}:e.includes("haiku")?{...fo,tier:"haiku",inputPerMTok:.8,outputPerMTok:4}:e.includes("local")||e.includes("llama")||e.includes("mistral")?{...fo,tier:"local"}:{...fo}}function sx(t){return t===0?"$0.00":t<.01?"< $0.01":t<1?`$${t.toFixed(4)}`:`$${t.toFixed(2)}`}function ax(t){return t<1e3?String(t):t<1e6?`${(t/1e3).toFixed(1)}K`:`${(t/1e6).toFixed(1)}M`}var ix,fo,cx=_(()=>{ix={"claude-opus-4-6-20250219":{inputPerMTok:5,outputPerMTok:25,contextWindow:1e6,tier:"opus"},"claude-sonnet-4-6-20250219":{inputPerMTok:3,outputPerMTok:15,contextWindow:2e5,tier:"sonnet"},"claude-haiku-4-5-20251001":{inputPerMTok:.25,outputPerMTok:1.25,contextWindow:2e5,tier:"haiku"},"claude-opus-4-5-20251101":{inputPerMTok:5,outputPerMTok:25,contextWindow:2e5,tier:"opus"},"claude-sonnet-4-5-20250929":{inputPerMTok:3,outputPerMTok:15,contextWindow:2e5,tier:"sonnet"},"claude-opus-4-20250514":{inputPerMTok:15,outputPerMTok:75,contextWindow:2e5,tier:"opus"},"claude-sonnet-4-20250514":{inputPerMTok:3,outputPerMTok:15,contextWindow:2e5,tier:"sonnet"},"claude-3-7-sonnet-20250219":{inputPerMTok:3,outputPerMTok:15,contextWindow:2e5,tier:"sonnet"},"claude-3-5-sonnet-20241022":{inputPerMTok:3,outputPerMTok:15,contextWindow:2e5,tier:"sonnet"},"claude-3-5-haiku-20241022":{inputPerMTok:.8,outputPerMTok:4,contextWindow:2e5,tier:"haiku"},"gpt-4o":{inputPerMTok:2.5,outputPerMTok:10,contextWindow:128e3,tier:"sonnet"},"gpt-4o-mini":{inputPerMTok:.15,outputPerMTok:.6,contextWindow:128e3,tier:"haiku"},"glm-5":{inputPerMTok:0,outputPerMTok:0,contextWindow:128e3,tier:"opus"},"glm-4.7":{inputPerMTok:0,outputPerMTok:0,contextWindow:128e3,tier:"sonnet"},"glm-4.6v":{inputPerMTok:0,outputPerMTok:0,contextWindow:128e3,tier:"haiku"},"MiniMax-M2.5-highspeed":{inputPerMTok:0,outputPerMTok:0,contextWindow:128e3,tier:"sonnet"},local:{inputPerMTok:0,outputPerMTok:0,contextWindow:8192,tier:"local"}},fo={inputPerMTok:0,outputPerMTok:0,contextWindow:128e3,tier:"unknown"};});function ux(){return Eh||(Eh=new Th),Eh}var xD,Th,Eh,dx=_(()=>{xD=join(homedir(),".config","mcc","cost-history.json"),Th=class{storePath;cachedRecords=null;cacheDirty=false;constructor(e){this.storePath=e??xD;}record(e){let r=this.loadRecords();r.push({...e,timestamp:new Date().toISOString()}),this.saveRecords(r);}getUsageStats(e=30){let r=this.loadRecords(),i=new Date;i.setDate(i.getDate()-e);let n=i.toISOString(),o=r.filter(g=>g.timestamp>=n),s={},a={},l=new Set,u=0,d=0,m=0;for(let g of o)u+=g.cost,d+=g.inputTokens,m+=g.outputTokens,l.add(g.sessionId),s[g.provider]||(s[g.provider]={cost:0,sessions:0}),s[g.provider].cost+=g.cost,s[g.provider].sessions+=1,a[g.model]||(a[g.model]={cost:0,sessions:0}),a[g.model].cost+=g.cost,a[g.model].sessions+=1;let f=o.map(g=>g.timestamp),p=f.length>0?f[0]:n,v=f.length>0?f[f.length-1]:new Date().toISOString();return {totalCost:u,totalInputTokens:d,totalOutputTokens:m,sessionCount:l.size,byProvider:s,byModel:a,period:{from:p,to:v}}}getDailySpend(){let e=new Date().toISOString().slice(0,10);return this.loadRecords().filter(i=>i.timestamp.startsWith(e)).reduce((i,n)=>i+n.cost,0)}getMonthlySpend(){let e=new Date().toISOString().slice(0,7);return this.loadRecords().filter(i=>i.timestamp.startsWith(e)).reduce((i,n)=>i+n.cost,0)}checkBudget(e){if(!e.enabled)return {ok:true,warning:false};let r=this.loadRecords(),i=new Date().toISOString().slice(0,10),n=new Date().toISOString().slice(0,7),o=0,s=0;for(let a of r)a.timestamp.startsWith(i)&&(o+=a.cost),a.timestamp.startsWith(n)&&(s+=a.cost);if(e.dailyLimit!==void 0){if(o>=e.dailyLimit)return {ok:false,warning:false,message:`Daily budget exceeded: $${o.toFixed(2)} / $${e.dailyLimit.toFixed(2)}`};if(o>=e.dailyLimit*e.warningThreshold)return {ok:true,warning:true,message:`Approaching daily limit: $${o.toFixed(2)} / $${e.dailyLimit.toFixed(2)}`}}if(e.monthlyLimit!==void 0){if(s>=e.monthlyLimit)return {ok:false,warning:false,message:`Monthly budget exceeded: $${s.toFixed(2)} / $${e.monthlyLimit.toFixed(2)}`};if(s>=e.monthlyLimit*e.warningThreshold)return {ok:true,warning:true,message:`Approaching monthly limit: $${s.toFixed(2)} / $${e.monthlyLimit.toFixed(2)}`}}return {ok:true,warning:false}}getHistory(e){let r=this.loadRecords();return e===void 0?r:r.slice(-e)}clearHistory(){this.saveRecords([]);}loadRecords(){if(this.cachedRecords!==null&&!this.cacheDirty)return this.cachedRecords;if(!existsSync(this.storePath))return this.cachedRecords=[],this.cacheDirty=false,[];try{let e=readFileSync(this.storePath,"utf-8"),r=JSON.parse(e);return this.cachedRecords=r.records??[],this.cacheDirty=!1,this.cachedRecords}catch{return this.cachedRecords=[],this.cacheDirty=false,[]}}saveRecords(e){let r=join(this.storePath,"..");mkdirSync(r,{recursive:true});let i={records:e};writeFileSync(this.storePath,JSON.stringify(i,null,2)),this.cachedRecords=e,this.cacheDirty=false;}};});var mx=_(()=>{cx();dx();});async function Ph(t,e=[],r={}){try{let{stdout:i,stderr:n}=await TD(t,e,{cwd:r.cwd,timeout:r.timeout??5e3,encoding:"utf-8"});return {stdout:i.trim(),stderr:n.trim(),success:!0}}catch(i){let n=i,o=n.stdout?.trim()??"",s=n.stderr?.trim()??"";return {stdout:o,stderr:s,success:false}}}var TD,fx=_(()=>{TD=promisify(execFile);});var Sn={};ne(Sn,{SessionManager:()=>Pc,getSessionManager:()=>be});function be(){return vx??=new Pc,vx}var AD,ND,Pc,vx,Xe=_(()=>{fx();AD=join(homedir(),".config","mcc","sessions"),ND=join(homedir(),".config","mcc",".active-session.json"),Pc=class{sessionDir;activeFile;constructor(){this.sessionDir=AD,this.activeFile=ND,this.ensureDirectories();}createSession(e){let r=new Date().toISOString(),i=randomUUID().slice(0,8),n={sessionId:i,workspace:e.workspace,provider:e.provider,model:e.model,createdAt:r,lastActive:r,state:"active",messages:[],files:[],env:{},metadata:e.metadata};return this.saveSession(n),this.setActiveSession(i),n}getSession(e){let r=this.getSessionFile(e);if(!existsSync(r))return null;try{let i=readFileSync(r,"utf-8");return JSON.parse(i)}catch{return null}}getAllSessions(){if(!existsSync(this.sessionDir))return [];let e=[],r=readdirSync(this.sessionDir);for(let i of r){if(!i.endsWith(".json")||i===basename(this.activeFile))continue;let n=join(this.sessionDir,i);try{let o=readFileSync(n,"utf-8"),s=JSON.parse(o);e.push(s);}catch{}}return e.sort((i,n)=>new Date(n.lastActive).getTime()-new Date(i.lastActive).getTime())}getSessionSummaries(){return this.getAllSessions().map(e=>({sessionId:e.sessionId,workspace:basename(e.workspace),provider:e.provider,model:e.model,state:e.state,createdAt:e.createdAt,lastActive:e.lastActive,messageCount:e.messages.length,fileCount:e.files.length,metadata:e.metadata}))}getActiveSession(){if(!existsSync(this.activeFile))return null;try{let e=readFileSync(this.activeFile,"utf-8"),i=JSON.parse(e).id;return typeof i!="string"?null:this.getSession(i)}catch{return null}}updateSessionState(e,r){let i=this.getSession(e);i&&(i.state=r,i.lastActive=new Date().toISOString(),this.saveSession(i));}addMessage(e,r,i){let n=this.getSession(e);if(!n)return;let o={role:r,content:i,timestamp:new Date().toISOString()};n.messages.push(o),n.lastActive=new Date().toISOString(),this.saveSession(n);}addFileAccess(e,r,i,n){let o=this.getSession(e);if(!o)return;let s=o.files.find(a=>a.path===r);if(s)s.accessedAt=new Date().toISOString(),s.action=n;else {let a={path:r,hash:i,accessedAt:new Date().toISOString(),action:n};o.files.push(a);}o.lastActive=new Date().toISOString(),this.saveSession(o);}setSessionEnv(e,r,i){let n=this.getSession(e);n&&(n.env[r]=i,this.saveSession(n));}deleteSession(e){let r=this.getSessionFile(e);if(!existsSync(r))return false;try{return unlinkSync(r),this.getActiveSession()?.sessionId===e&&this.clearActiveSession(),!0}catch{return false}}cleanOldSessions(e=30){let r=Date.now()-e*24*60*60*1e3,i=0;for(let n of this.getAllSessions())new Date(n.lastActive).getTime()<r&&this.deleteSession(n.sessionId)&&i++;return i}clearActiveSession(){try{unlinkSync(this.activeFile);}catch{}}setActiveSession(e){this.ensureDirectories(),writeFileSync(this.activeFile,JSON.stringify({id:e,timestamp:Date.now()}));}saveSession(e){this.ensureDirectories();let r=this.getSessionFile(e.sessionId);writeFileSync(r,JSON.stringify(e,null,2));}async detectWorkspace(e=process.cwd()){let r=existsSync(join(e,".git")),i,n;if(r)try{let o=await Ph("git",["branch","--show-current"],{cwd:e});o.success&&(i=o.stdout);let s=await Ph("git",["config","--get","remote.origin.url"],{cwd:e});s.success&&(n=s.stdout);}catch{}return {root:e,isGitRepo:r,gitBranch:i,gitRemote:n}}findRecentSessionForWorkspace(e){return this.getAllSessions().find(i=>i.workspace===e&&i.state==="active")??null}getSessionFile(e){return join(this.sessionDir,`${e}.json`)}ensureDirectories(){existsSync(this.sessionDir)||mkdirSync(this.sessionDir,{recursive:true});}},vx=null;});function kn(t){return Nr?t!==void 0:Nr=new Oc(t),Nr}function wx(t){return Nr=new Oc(t),Nr}var _x,MD,Sx,zD,LD,jD,Oc,Nr,Cc=_(()=>{qe();_x=join(homedir(),".config","mcc","logs"),MD="mcc.log",Sx="session-",zD=5,LD=10,jD=7,Oc=class{logDir;mainLogFile;currentSessionId;constructor(e){this.logDir=_x,this.mainLogFile=join(_x,MD),this.currentSessionId=e,this.ensureDirectories();}setSessionId(e){this.currentSessionId=e;}debug(e,r,i){this.log("debug",e,r,i);}info(e,r,i){this.log("info",e,r,i);}warn(e,r,i){this.log("warn",e,r,i);}error(e,r,i,n){this.log("error",e,r,n,i);}fatal(e,r,i,n){this.log("fatal",e,r,n,i);}session(e,r){this.info("session",e,{...r,sessionId:this.currentSessionId});}provider(e,r){this.info("provider",e,r);}launch(e,r){this.info("launch",e,r);}recovery(e,r){this.info("recovery",e,r);}getStats(){let e={totalEntries:0,errors:0,warnings:0,categories:{}};if(!existsSync(this.mainLogFile))return e;try{let i=readFileSync(this.mainLogFile,"utf-8").split(`
|
|
253
|
+
`).filter(Boolean),n,o;for(let s of i)try{let a=JSON.parse(s);e.totalEntries++,(a.level==="error"||a.level==="fatal")&&e.errors++,a.level==="warn"&&e.warnings++,(!n||a.timestamp<n)&&(n=a.timestamp),(!o||a.timestamp>o)&&(o=a.timestamp),e.categories[a.category]=(e.categories[a.category]??0)+1;}catch{}e.oldestEntry=n,e.newestEntry=o;}catch{}return e}getRecentEntries(e=100,r){if(!existsSync(this.mainLogFile))return [];try{let n=readFileSync(this.mainLogFile,"utf-8").split(`
|
|
254
|
+
`).filter(Boolean),o=[];for(let s=n.length-1;s>=0&&o.length<e;s--)try{let a=JSON.parse(n[s]);(!r||a.level===r||r==="error"&&a.level==="fatal")&&o.unshift(a);}catch{}return o}catch{return []}}getSessionLogFile(e){return join(this.logDir,`${Sx}${e}.log`)}writeToSessionLog(e,r){let i=this.getSessionLogFile(e);appendFileSync(i,JSON.stringify(r)+`
|
|
255
|
+
`);}rotateLogs(){this.rotateMainLog(),this.cleanOldSessionLogs();}clearLogs(){if(!existsSync(this.logDir))return;let e=readdirSync(this.logDir);for(let r of e)if(r.endsWith(".log")||r.endsWith(".log.bak"))try{unlinkSync(join(this.logDir,r));}catch{}}formatEntry(e,r=false){let i=this.getLevelColor(e.level),n=this.getLevelIcon(e.level),o=new Date(e.timestamp).toLocaleTimeString(),s=`${c.dim(o)} ${i(n)} ${i(e.level.padEnd(5))} `;return s+=`${c.subtle(`[${e.category}]`)} ${e.message}`,r&&e.details&&(s+=`
|
|
256
|
+
${c.dim(JSON.stringify(e.details,null,2).split(`
|
|
257
|
+
`).join(`
|
|
258
|
+
`))}`),r&&e.error&&(s+=`
|
|
259
|
+
${c.error(`Error: ${e.error.message}`)}`,e.error.stack&&(s+=`
|
|
260
|
+
${c.dim(e.error.stack.split(`
|
|
261
|
+
`).slice(0,3).join(`
|
|
262
|
+
`))}`)),s}displayRecent(e=20,r,i=false){let n=this.getRecentEntries(e,r);if(n.length===0){console.log(c.dim("No log entries found."));return}console.log(c.dim("\u2501".repeat(60))),console.log(c.dim(` Recent Log Entries (${n.length})`)),console.log(c.dim("\u2501".repeat(60)));for(let o of n)console.log(this.formatEntry(o,i));}log(e,r,i,n,o){let s={timestamp:new Date().toISOString(),level:e,category:r,sessionId:this.currentSessionId,message:i};n&&(s.details=n),o&&(s.error={name:o.name,message:o.message,stack:o.stack}),this.writeToLog(s),this.currentSessionId&&this.writeToSessionLog(this.currentSessionId,s),e==="error"||e==="fatal"?console.error(this.formatEntry(s,false)):e==="warn"&&console.warn(this.formatEntry(s,false));}writeToLog(e){this.ensureDirectories(),appendFileSync(this.mainLogFile,JSON.stringify(e)+`
|
|
263
|
+
`);}ensureDirectories(){existsSync(this.logDir)||mkdirSync(this.logDir,{recursive:true});}rotateMainLog(){if(existsSync(this.mainLogFile))try{if(_t("fs").statSync(this.mainLogFile).size/(1024*1024)>=zD){let i=new Date().toISOString().replace(/[:.]/g,"-"),n=join(this.logDir,`mcc-${i}.log.bak`);_t("fs").renameSync(this.mainLogFile,n);let o=readdirSync(this.logDir).filter(s=>s.startsWith("mcc-")&&s.endsWith(".log.bak")).sort().reverse();for(let s=LD;s<o.length;s++)unlinkSync(join(this.logDir,o[s]));}}catch{}}cleanOldSessionLogs(){if(!existsSync(this.logDir))return;let e=Date.now()-jD*24*60*60*1e3,r=readdirSync(this.logDir);for(let i of r)if(i.startsWith(Sx))try{let n=join(this.logDir,i);_t("fs").statSync(n).mtimeMs<e&&unlinkSync(n);}catch{}}getLevelColor(e){switch(e){case "debug":return c.dim;case "info":return c.success;case "warn":return c.warning;case "error":return c.error;case "fatal":return r=>c.error(c.primary.bold(r))}}getLevelIcon(e){switch(e){case "debug":return "\u25CB";case "info":return "\u25CF";case "warn":return "\u26A0";case "error":return "\u2717";case "fatal":return "\u2620"}}},Nr=null;});function Lh(){return kx??=new Dh,kx}function Ix(){if(xx)return;xx=true;let t=kn(),e=Lh(),r=n=>{t.warn("session",`Process received ${n}`,{signal:n}),e.clearCrashMarker(),process.exit(0);},i=(n,o)=>{t.fatal("error",`Process ${o}`,n);};process.on("SIGINT",()=>r("SIGINT")),process.on("SIGTERM",()=>r("SIGTERM")),process.on("uncaughtException",n=>i(n,"crashed")),process.on("unhandledRejection",n=>{let o=n instanceof Error?n:new Error(String(n));i(o,"unhandled rejection");});}var zh,BD,HD,Dh,kx,xx,jh=_(()=>{qe();Xe();Cc();zh=join(homedir(),".config","mcc"),BD=join(zh,".crash-detection"),HD=join(zh,"sessions"),Dh=class{configDir;crashMarkerFile;sessionDir;constructor(){this.configDir=zh,this.crashMarkerFile=BD,this.sessionDir=HD;}markSessionActive(e){let r={sessionId:e,startedAt:new Date().toISOString(),pid:process.pid};writeFileSync(this.crashMarkerFile,JSON.stringify(r,null,2));}clearCrashMarker(){try{unlinkSync(this.crashMarkerFile);}catch{}}detectCrashedSession(){if(!existsSync(this.crashMarkerFile))return null;try{let e=readFileSync(this.crashMarkerFile,"utf-8"),r=JSON.parse(e),n=be().getSession(r.sessionId);if(!n)return this.clearCrashMarker(),null;let s=kn().getSessionLogFile(r.sessionId),a=existsSync(s),l;if(a)try{l=readFileSync(s,"utf-8").split(`
|
|
264
|
+
`).filter(Boolean).slice(-10).map(p=>JSON.parse(p));}catch{}let u=this.detectInterruptionType(n,l),{recoverable:d,hint:m}=this.assessRecoverability(n,u);return {sessionId:r.sessionId,session:n,interruptedAt:r.startedAt,interruptionType:u,hasSessionLog:a,logEntries:l,recoverable:d,recoveryHint:m}}catch{return this.clearCrashMarker(),null}}findRecoverableSessions(){let r=be().getAllSessions(),i=[];for(let n of r){if(n.state!=="active")continue;let s=kn().getSessionLogFile(n.sessionId),a=existsSync(s),l;if(a)try{l=readFileSync(s,"utf-8").split(`
|
|
265
|
+
`).filter(Boolean).slice(-5).map(p=>JSON.parse(p));}catch{}let u=this.detectInterruptionType(n,l),{recoverable:d,hint:m}=this.assessRecoverability(n,u);d&&i.push({sessionId:n.sessionId,session:n,interruptedAt:n.lastActive,interruptionType:u,hasSessionLog:a,logEntries:l,recoverable:d,recoveryHint:m});}return i}async resumeSession(e){return be().updateSessionState(e.sessionId,"active"),this.clearCrashMarker(),kn().recovery(`Session ${e.sessionId} resumed after ${e.interruptionType}`),{recovered:true,action:"resumed",message:`Session ${e.sessionId} resumed successfully`}}async archiveSession(e){return be().updateSessionState(e.sessionId,"failed"),this.clearCrashMarker(),kn().recovery(`Session ${e.sessionId} archived after ${e.interruptionType}`),{recovered:true,action:"archived",message:`Session ${e.sessionId} archived as failed`}}async discardSession(e){return be().deleteSession(e.sessionId),this.clearCrashMarker(),kn().recovery(`Session ${e.sessionId} discarded after ${e.interruptionType}`),{recovered:true,action:"discarded",message:`Session ${e.sessionId} discarded`}}async checkAndPromptRecovery(){let e=this.detectCrashedSession();if(!e){let i=this.findRecoverableSessions();return i.length>0&&(console.log(c.warning(`
|
|
266
|
+
${$.warning} Found ${i.length} other interrupted session(s)`)),console.log(c.dim(` Run 'mcc recover' to manage them
|
|
267
|
+
`))),null}switch(this.displayRecoveryInfo(e),await this.promptRecoveryAction(e)){case "resume":return await this.resumeSession(e),e;case "archive":return await this.archiveSession(e),null;case "discard":return await this.discardSession(e),null;default:return null}}displayRecoveryInfo(e){if(console.log(""),console.log(H(60)),console.log(` ${c.warning("\u26A0 Previous session interrupted")}`),console.log(H(60)),console.log(` ${c.dim("Session:")} ${c.primary(e.sessionId)}`),console.log(` ${c.dim("Provider:")} ${c.subtle(e.session.provider)}`),console.log(` ${c.dim("Model:")} ${c.subtle(e.session.model)}`),console.log(` ${c.dim("Workspace:")} ${c.subtle(basename(e.session.workspace))}`),console.log(` ${c.dim("Interrupted:")} ${c.subtle(this.formatTime(e.interruptedAt))}`),console.log(` ${c.dim("Type:")} ${c.subtle(e.interruptionType)}`),e.recoveryHint&&console.log(` ${c.dim("Hint:")} ${c.accent(e.recoveryHint)}`),e.logEntries&&e.logEntries.length>0){console.log(""),console.log(c.dim(" Last log entries:"));for(let r of e.logEntries.slice(-3)){let i=new Date(r.timestamp).toLocaleTimeString();console.log(` ${c.dim(i)} ${c.subtle(r.message.slice(0,60))}`);}}console.log(H(60));}detectInterruptionType(e,r){if(r&&r.length>0){let o=r[r.length-1];if(o.message.toLowerCase().includes("sigint"))return "sigint";if(o.message.toLowerCase().includes("sigterm"))return "sigterm";if(o.level==="error"||o.level==="fatal")return "crash"}return Date.now()-new Date(e.lastActive).getTime()<6e4?"crash":"unknown"}assessRecoverability(e,r){if((Date.now()-new Date(e.lastActive).getTime())/(1e3*60*60)>24)return {recoverable:false,hint:"Session too old (>24h)"};if(r==="crash"&&e.messages.length===0)return {recoverable:false,hint:"No activity before crash"};switch(r){case "sigint":return {recoverable:true,hint:"User interrupted (Ctrl+C)"};case "sigterm":return {recoverable:true,hint:"Process terminated externally"};case "crash":return {recoverable:true,hint:"Application crashed"};default:return {recoverable:true,hint:"Unknown interruption"}}}async promptRecoveryAction(e){try{let r=(await import('@inquirer/select')).default;return await r({message:"How would you like to handle this session?",choices:[{value:"resume",name:"Resume",description:"Continue from where you left off"},{value:"archive",name:"Archive",description:"Mark as failed but keep the data"},{value:"discard",name:"Discard",description:"Delete the session permanently"},{value:"skip",name:"Skip",description:"Leave as-is and start fresh"}],default:"resume"})}catch{return "skip"}}formatTime(e){let r=new Date(e),n=new Date().getTime()-r.getTime(),o=Math.floor(n/6e4),s=Math.floor(o/60),a=Math.floor(s/24);return o<1?"just now":o<60?`${o}m ago`:s<24?`${s}h ago`:`${a}d ago`}},kx=null;xx=false;});var Px={};ne(Px,{LaunchValidationError:()=>Tt,launchClaudeCode:()=>Rr,verifyProviderHealth:()=>lM});function XD(t,e){console.log(""),console.log(c.dim("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501")),console.log(c.dim(" \u{1F4CA} Environment Diagnostics")),console.log(c.dim("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"));let r=e.MCC_MODEL??t.defaultModel;console.log(` ${c.dim("Model:")} ${c.primary(r)}`),console.log(` ${c.dim("Type:")} ${c.subtle(t.type)}`),console.log(` ${c.dim("Provider:")} ${c.subtle(t.id)} (${c.subtle(t.name)})`);let n=(e.ANTHROPIC_BASE_URL??"default").replace(/\/\/[^@]+@/,"//***@");console.log(` ${c.dim("Endpoint:")} ${c.subtle(n)}`);let o=!!e.ANTHROPIC_API_KEY,s=o?c.success("\u2713 Set"):c.error("\u2717 Missing");if(console.log(` ${c.dim("API Key:")} ${s}`),t.type==="custom"){let a=t.auth.tokenEnv??t.auth.apiKeyEnv;if(a){let u=!!(Re(a)??process.env[a])?c.success("\u2713 In env"):c.warning("\u26A0 In store");console.log(` ${c.dim("Credential:")}${u} ${c.subtle(a)}`);}console.log(` ${c.dim("Auth:")} ${c.subtle(t.auth.method)}`);}console.log(""),console.log(c.dim(" Environment Variables:")),console.log(` ${c.dim("MCC_MODEL=")} ${c.primary(e.MCC_MODEL??"not set")}`),console.log(` ${c.dim("MCC_PROVIDER=")} ${c.subtle(e.MCC_PROVIDER??"not set")}`),console.log(` ${c.dim("MCC_PROVIDER_ID=")}${c.subtle(e.MCC_PROVIDER_ID??"not set")}`),console.log(` ${c.dim("MCC_PROVIDER_TYPE=")}${c.subtle(e.MCC_PROVIDER_TYPE??"not set")}`),console.log(""),console.log(c.dim(" Anthropic Variables:")),console.log(` ${c.dim("ANTHROPIC_BASE_URL=")} ${c.subtle(e.ANTHROPIC_BASE_URL??"default")}`),console.log(` ${c.dim("ANTHROPIC_API_KEY=")} ${o?c.success("***SET***"):c.error("NOT SET")}`),console.log(c.dim("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501")),console.log("");}function QD(t){mkdirSync(Ex,{recursive:true}),writeFileSync(Tx,JSON.stringify(t,null,2));}function eM(){try{unlinkSync(Tx);}catch(t){t.code!=="ENOENT"&&console.error("Warning: Failed to clear session:",t.message);}}function tM(t){let e=Math.floor(t/1e3);if(e<60)return `${e}s`;let r=Math.floor(e/60),i=e%60;if(r<60)return `${r}m ${i}s`;let n=Math.floor(r/60),o=r%60;return `${n}h ${o}m`}async function Rr(t,e){Ix();let r=randomUUID().slice(0,8),i=wx(r),n=Lh(),o=new Date,s=process.cwd(),a=e??s;i.launch("Launch initiated",{provider:t.id,model:t.defaultModel,workspace:a});let l=await n.checkAndPromptRecovery();l&&i.recovery("Resuming from recovered session",{previousSessionId:l.sessionId}),console.log(`
|
|
268
|
+
`+H(50,"gradient")),console.log(` ${$.rocket} ${c.primary.bold("Launching:")} ${c.accent.bold(t.name)}`),console.log(H(50,"gradient")),iM(t,a);let u=null;try{let O=(await import('ora')).default,re=O("Checking workspace...").start();u=await ex(a),re.stop(),u.diagnostics&&console.log(` ${c.dim("TypeScript")} ${tx(u.diagnostics)}`),u.gitBranch&&console.log(` ${c.dim("Git")} ${c.subtle(u.gitBranch)}${u.gitDirty?c.warning(" (dirty)"):""}`),u.packageManager&&console.log(` ${c.dim("Package")} ${c.subtle(u.packageManager)}`),console.log("");}catch{}let d=B(),m=d.providers.filter(O=>O.enabled);try{if(!t.defaultModel)throw new Tt("missing_model",`Provider ${t.id} has no default model configured`,"Set a default model in the provider configuration");if(t.models&&t.models.length>0&&(t.models.includes(t.defaultModel)||(console.warn(c.warning(`
|
|
269
|
+
\u26A0 Warning: Default model "${t.defaultModel}" not in provider's model list`)),console.warn(c.dim(` Available: ${t.models.join(", ")}`)),console.warn(c.dim(` This may cause issues if the provider rejects unknown models.
|
|
270
|
+
`)))),t.type==="custom"){let O=t.auth.tokenEnv??t.auth.apiKeyEnv;if(!O)throw new Tt("missing_auth",`Provider ${t.id} has no credential source configured`,"Add tokenEnv or apiKeyEnv to the provider auth config");if(!!!(Re(O)??process.env[O]))throw new Tt("missing_credential",`Credential ${O} not found`,`Run 'mcc config' or export: ${O}=your-key`);if(!t.endpoint)throw new Tt("missing_endpoint",`Provider ${t.id} has no endpoint configured`,"Add an endpoint URL to the provider configuration")}if(t.type==="anthropic"&&!process.env.ANTHROPIC_AUTH_TOKEN&&!Re("ANTHROPIC_AUTH_TOKEN"))throw new Tt("missing_auth",`Provider ${t.id} requires ANTHROPIC_AUTH_TOKEN`,'Run "claude setup-token" or export ANTHROPIC_AUTH_TOKEN')}catch(O){throw O instanceof Tt&&(console.error(c.error(`\u2717 ${O.message}`)),O.suggestion&&console.error(c.dim(` Suggestion: ${O.suggestion}`)),i.error("launch","Validation failed",O)),O}let f=nM(t);rM(f,t),t.type==="anthropic"&&(delete f.ANTHROPIC_BASE_URL,f.ANTHROPIC_MODEL=t.defaultModel,f.ANTHROPIC_DEFAULT_SONNET_MODEL=t.defaultModel),XD(t,f),f.MCC_SESSION_ID=r,f.MCC_PROVIDER=t.name,f.MCC_PROVIDER_ID=t.id,f.MCC_PROVIDER_TYPE=t.type,f.MCC_MODEL=t.defaultModel,f.MCC_VERSION=Se,f.MCC_STARTED_AT=o.toISOString(),f.MCC_WORKSPACE=a,u?.diagnostics&&u.diagnostics.errors>0&&(f.MCC_TS_ERRORS=String(u.diagnostics.errors),f.MCC_TS_WARNINGS=String(u.diagnostics.warnings));let p=(await import('ora')).default,v=p("Starting multi-provider proxy...").start(),g=d.proxy;if(g?.enabled){let O=g.port,re=g.host??"127.0.0.1",ct={port:O,host:re,providers:m,defaultProvider:t.id,onSwitch:(Oe,ie)=>{let Po=m.find(al=>al.id===Oe)?.name??Oe,ZI=m.find(al=>al.id===ie)?.name??ie;console.log(c.dim(`
|
|
271
|
+
${$.info} Provider switched: ${c.subtle(Po)} \u2192 ${c.primary(ZI)}
|
|
272
|
+
`));}};try{let Oe=await Jk(ct),ie=Wk(Oe.port,re);f.ANTHROPIC_BASE_URL=ie,f.MCC_PROXY_PORT=String(Oe.port),v.succeed(`${c.success("Multi-provider proxy")} ${c.dim("\u2192")} ${c.subtle(ie)}`);}catch(Oe){throw v.fail("Failed to start proxy"),console.error(c.error(` ${X(Oe)}`)),Oe}}else v.stop(),console.log(c.dim(` ${$.info} Direct connection mode (proxy disabled)`));let y={id:r,workspace:a,provider:t.name,model:t.defaultModel,type:t.type,endpoint:t.endpoint,startedAt:o.toISOString(),pid:process.pid,version:Se};QD(y);let S=be(),E=S.createSession({workspace:a,provider:t.id,model:t.defaultModel});n.markSessionActive(E.sessionId),i.session("Session created",{persistentSessionId:E.sessionId}),oM(t,r,m.length,d.proxy?.enabled??false);let T=aM(),C=process.argv.indexOf("--"),P=C!==-1?process.argv.slice(C+1):[],L=["--model",t.defaultModel,...P],V=p("Starting Claude Code...").start();try{i.launch("Spawning Claude Code",{command:T,args:L}),await cM(T,L,f,V);}catch(O){throw V.fail("Failed to start Claude Code"),i.error("launch","Failed to spawn Claude Code",O instanceof Error?O:void 0),O}finally{S.updateSessionState(E.sessionId,"paused"),n.clearCrashMarker(),i.session("Session ended",{duration:Date.now()-o.getTime()}),eM(),d.proxy?.enabled&&await Gk(),sM(t,o);}}function nM(t,e=false){try{let r={...process.env};if(t.envVars)for(let[i,n]of Object.entries(t.envVars)){let o=n.replace(/\$\{(\w+)\}/g,(s,a)=>{let l=Re(a)??process.env[a]??"";return e&&!l&&console.warn(c.dim(` \u26A0 Variable ${a} not found in credentials or environment`)),l});r[i]=o,e&&console.log(c.dim(` Set ${i}=${o.substring(0,20)}...`));}if(t.type==="custom"&&t.endpoint){if(r.ANTHROPIC_BASE_URL=t.endpoint,t.auth.method==="bearer"&&t.auth.tokenEnv){let i=Re(t.auth.tokenEnv)??process.env[t.auth.tokenEnv];i?r.ANTHROPIC_API_KEY=i:e&&console.warn(c.dim(` \u26A0 Token not found for ${t.auth.tokenEnv}`));}else if(t.auth.method==="api_key"&&t.auth.apiKeyEnv){let i=Re(t.auth.apiKeyEnv)??process.env[t.auth.apiKeyEnv];i?r.ANTHROPIC_API_KEY=i:e&&console.warn(c.dim(` \u26A0 API key not found for ${t.auth.apiKeyEnv}`));}if(!r.ANTHROPIC_API_KEY)throw new Error(`Custom provider ${t.id} requires API key but none was set. Check that ${t.auth.tokenEnv??t.auth.apiKeyEnv} is configured.`)}else t.endpoint&&(r.ANTHROPIC_BASE_URL=t.endpoint);return r}catch(r){throw console.error(c.error("Failed to build environment:")),console.error(c.dim(` ${X(r)}`)),r}}function rM(t,e){let r=e.claudeCode;if(!r)return t;if(r.model&&(t.ANTHROPIC_MODEL=r.model),r.sonnetModel&&(t.ANTHROPIC_DEFAULT_SONNET_MODEL=r.sonnetModel),r.opusModel&&(t.ANTHROPIC_DEFAULT_OPUS_MODEL=r.opusModel),r.haikuModel&&(t.ANTHROPIC_DEFAULT_HAIKU_MODEL=r.haikuModel),r.baseUrl&&e.type!=="anthropic"&&(t.ANTHROPIC_BASE_URL=r.baseUrl),r.timeout&&(t.API_TIMEOUT_MS=String(r.timeout)),r.maxTokens&&(t.ANTHROPIC_MAX_OUTPUT_TOKENS=String(r.maxTokens)),r.disableTelemetry&&(t.CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC="1"),r.additionalEnv)for(let[i,n]of Object.entries(r.additionalEnv))t[i]=n;return t}function iM(t,e){console.log(H(50)),console.log(` ${c.dim("Workspace")} ${c.subtle(e)}`),console.log(` ${c.dim("Provider")} ${c.subtle(t.name)}`),console.log(` ${c.dim("Type")} ${c.subtle(t.type)}`),t.endpoint&&console.log(` ${c.dim("Endpoint")} ${c.subtle(t.endpoint)}`),console.log(` ${c.dim("Model")} ${c.subtle(t.defaultModel)}`),console.log(H(50)),console.log("");}function oM(t,e,r,i){let n=t.defaultModel?c.accent(t.defaultModel):c.dim("default"),o=ox(t.defaultModel),s=c.muted(`[${o.tier}]`),a=c.dim(`${ax(o.contextWindow)} ctx`),l=i&&r>1?c.dim('Ctrl+C to exit \u2022 Use "mcc switch <provider>" to change provider'):c.dim("Ctrl+C to exit");console.log(""),console.log(` ${c.dim("\u250C")} ${$.bolt} ${c.primary.bold("MCC")} ${c.dim("v"+Se)} ${c.dim("\u2502")} ${c.subtle(t.name)} ${c.dim("\u2502")} ${n} ${s} ${a} ${c.dim("\u2502")} ${c.dim("sid:")}${c.muted(e)}`),console.log(` ${c.dim("\u2514")} ${l}`),console.log("");}function sM(t,e){let r=tM(Date.now()-e.getTime()),n=ux().getDailySpend(),o=[];n>0&&o.push(`${$.coins} ${c.dim("today:")} ${c.warning(sx(n))}`);let s=o.length>0?` ${c.dim("\u2502")} ${o.join(" ")}`:"";console.log(""),console.log(H(50)),console.log(` ${$.success} ${c.dim("Session ended")} ${c.dim("\u2502")} ${c.subtle(t.name)} ${c.dim("\u2502")} ${c.muted(r)}${s}`),console.log(H(50));}function aM(){let t=process.platform;if(t==="win32")return "claude.cmd";let e=process.env.PATH??"",r=t==="win32"?";":":";for(let i of e.split(r)){let n=join(i,"claude");if(existsSync(n)||existsSync(n+".cmd")||existsSync(n+".exe"))return "claude"}return "claude"}async function cM(t,e,r,i){return new Promise((n,o)=>{i&&i.succeed(`${c.success("Claude Code")} starting...`),console.log(c.dim(`
|
|
273
|
+
${$.launch} ${t} ${e.join(" ")}
|
|
274
|
+
`));let s=process.cwd(),a=spawn(t,e,{cwd:s,env:r,stdio:"inherit",shell:process.platform==="win32"});a.on("error",l=>{console.error(c.error(`
|
|
275
|
+
${$.error} Failed to launch Claude Code: ${l.message}`)),console.log(c.dim(`
|
|
276
|
+
Make sure Claude Code is installed and in your PATH.`)),console.log(c.dim(`Download from: https://claude.com/download
|
|
277
|
+
`)),o(l);}),a.on("exit",l=>{l===0?n():(console.log(c.warning(`
|
|
278
|
+
${$.warning} Claude Code exited with code ${l}`)),process.exit(l??1));}),process.on("SIGINT",()=>{a.kill("SIGINT"),process.exit(130);});})}async function lM(t){let{checkProvider:e}=await Promise.resolve().then(()=>(Qt(),xc)),r=await e(t);return r.ok?true:(console.warn(c.warning(`
|
|
279
|
+
${$.warning} Provider health check failed:`)),console.warn(` ${r.message}
|
|
280
|
+
`),await(await import('@inquirer/confirm')).default({message:"Try to launch anyway?",default:false}))}var Tt,Ex,Tx,Zh=_(()=>{bt();vt();Xk();Ee();qe();rx();mx();Xe();Cc();jh();Tt=class extends Error{constructor(r,i,n){super(i);this.code=r;this.suggestion=n;this.name="LaunchValidationError";}};Ex=join(homedir(),".config","mcc"),Tx=join(Ex,".session.json");});var Jh={};ne(Jh,{addModelToProvider:()=>Dc,duplicateProvider:()=>gM,enableProvider:()=>Kh,getProviderForEdit:()=>Nc,listAllProviders:()=>Rc,removeModelFromProvider:()=>Hh,resetProviderToDefaults:()=>Vh,setDefaultProvider:()=>Mc,setTierModels:()=>Bh,updateProviderModels:()=>go});function $t(){if(!existsSync(qh))throw new Error("Configuration file not found. Run MCC first to initialize.");let t=readFileSync(qh,"utf-8");return (0, Ac.parse)(t)}function en(t){writeFileSync(qh,(0, Ac.stringify)(t,{indent:2}),"utf-8");}function Nc(t){return $t().providers.find(r=>r.id===t)}function Rc(){return $t().providers}function go(t,e){let r=$t(),i=r.providers.findIndex(o=>o.id===t);if(i===-1)return false;let n=r.providers[i];return e.name&&(n.name=e.name),e.description&&(n.description=e.description),e.endpoint&&(n.endpoint=e.endpoint),e.timeout&&(n.timeout=e.timeout),e.models&&(n.models=e.models),e.defaultModel&&(n.defaultModel=e.defaultModel,n.envVars&&(n.envVars.ANTHROPIC_MODEL=e.defaultModel)),e.envVars&&n.envVars&&(n.envVars={...n.envVars,...e.envVars}),r.providers[i]=n,en(r),true}function Bh(t,e){let r=$t(),i=r.providers.findIndex(o=>o.id===t);if(i===-1)return false;let n=r.providers[i];return n.envVars||(n.envVars={}),e.defaultModel&&(n.defaultModel=e.defaultModel,n.envVars.ANTHROPIC_MODEL=e.defaultModel),e.opusModel&&(n.envVars.ANTHROPIC_DEFAULT_OPUS_MODEL=e.opusModel),e.sonnetModel&&(n.envVars.ANTHROPIC_DEFAULT_SONNET_MODEL=e.sonnetModel),e.haikuModel&&(n.envVars.ANTHROPIC_DEFAULT_HAIKU_MODEL=e.haikuModel),e.smallFastModel&&(n.envVars.ANTHROPIC_SMALL_FAST_MODEL=e.smallFastModel),e.models&&(n.models=e.models),r.providers[i]=n,en(r),true}function Dc(t,e){let r=$t(),i=r.providers.findIndex(o=>o.id===t);if(i===-1)return false;let n=r.providers[i];return n.models||(n.models=[]),n.models.includes(e)||(n.models.push(e),r.providers[i]=n,en(r)),true}function Hh(t,e){let r=$t(),i=r.providers.findIndex(s=>s.id===t);if(i===-1)return false;let n=r.providers[i];if(!n.models)return false;let o=n.models.indexOf(e);return o>-1&&(n.models.splice(o,1),r.providers[i]=n,en(r)),true}function Mc(t){let e=$t();return e.providers.find(i=>i.id===t)?(e.defaultProvider=t,en(e),true):false}function Kh(t,e=true){let r=$t(),i=r.providers.findIndex(n=>n.id===t);return i===-1?false:(r.providers[i].enabled=e,en(r),true)}function gM(t,e,r){let i=$t(),n=i.providers.find(s=>s.id===t);if(!n||i.providers.some(s=>s.id===e))return false;let o={...JSON.parse(JSON.stringify(n)),id:e,name:r,enabled:false};return i.providers.push(o),en(i),true}function Vh(t){let r=hM().find(o=>o.id===t);if(!r)return false;let i=$t(),n=i.providers.findIndex(o=>o.id===t);if(n===-1)i.providers.push({...r,enabled:false});else {let o=i.providers[n].enabled;i.providers[n]={...r,enabled:o};}return en(i),true}function hM(){return [{id:"claude-max",name:"Claude Max",type:"anthropic",enabled:true,auth:{method:"bearer",tokenEnv:"ANTHROPIC_AUTH_TOKEN"},defaultModel:"claude-sonnet-4-5-20250929",models:["claude-opus-4-5-20251101","claude-sonnet-4-5-20250929","claude-haiku-4-5-20251001"],description:"Claude Max subscription with bearer token.",timeout:12e4,envVars:{ANTHROPIC_AUTH_TOKEN:"${ANTHROPIC_AUTH_TOKEN}"}},{id:"zai-coding-plan",name:"Z.AI GLM",type:"custom",enabled:false,endpoint:"https://api.z.ai/api/anthropic",auth:{method:"bearer",tokenEnv:"ZAI_API_KEY"},defaultModel:"glm-5",models:["glm-5","glm-4.7","glm-4.6v","glm-4.7-flash","glm-4.6","glm-4.5"],description:"Z.AI GLM-5 series (Opus: glm-5, Sonnet: glm-4.7, Haiku: glm-4.6v).",timeout:3e6,envVars:{ANTHROPIC_BASE_URL:"https://api.z.ai/api/anthropic",ANTHROPIC_AUTH_TOKEN:"${ZAI_API_KEY}",API_TIMEOUT_MS:"3000000",CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1",ANTHROPIC_MODEL:"glm-5",ANTHROPIC_SMALL_FAST_MODEL:"glm-4.6v",ANTHROPIC_DEFAULT_SONNET_MODEL:"glm-4.7",ANTHROPIC_DEFAULT_OPUS_MODEL:"glm-5",ANTHROPIC_DEFAULT_HAIKU_MODEL:"glm-4.6v"}},{id:"minimax-coding-plan",name:"MiniMax",type:"custom",enabled:false,endpoint:"https://api.minimax.io/anthropic",auth:{method:"bearer",tokenEnv:"MINIMAX_API_KEY"},defaultModel:"MiniMax-M2.5-highspeed",models:["MiniMax-M2.5-highspeed","minimax-m2.5"],description:"MiniMax M2.5 models.",timeout:3e6,envVars:{ANTHROPIC_BASE_URL:"https://api.minimax.io/anthropic",ANTHROPIC_AUTH_TOKEN:"${MINIMAX_API_KEY}",API_TIMEOUT_MS:"3000000",CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1",ANTHROPIC_MODEL:"MiniMax-M2.5-highspeed",ANTHROPIC_SMALL_FAST_MODEL:"MiniMax-M2.5-highspeed",ANTHROPIC_DEFAULT_SONNET_MODEL:"MiniMax-M2.5-highspeed",ANTHROPIC_DEFAULT_OPUS_MODEL:"MiniMax-M2.5-highspeed",ANTHROPIC_DEFAULT_HAIKU_MODEL:"MiniMax-M2.5-highspeed"}},{id:"deepinfra",name:"DeepInfra",type:"custom",enabled:false,endpoint:"https://api.deepinfra.com/v1/openai",auth:{method:"bearer",tokenEnv:"DEEPINFRA_API_KEY"},defaultModel:"anthropic/claude-sonnet-4-5-20250929",models:["anthropic/claude-opus-4-5-20251101","anthropic/claude-sonnet-4-5-20250929","anthropic/claude-3-5-sonnet-20241022","anthropic/claude-3-5-haiku-20241022","deepseek-ai/DeepSeek-V3","meta-llama/Llama-4-Maverick-17B-128E-Instruct","meta-llama/Llama-3.3-70B-Instruct","Qwen/Qwen3-235B-A22B","Qwen/Qwen3-Max-Thinking","Qwen/Qwen2.5-72B-Instruct","mistralai/Mistral-Small-24B-Instruct-2501","moonshotai/Kimi-K2.5","zai-org/GLM-5"],description:"DeepInfra multi-model API (Claude, GLM, Kimi, Llama, Qwen, Mistral, DeepSeek). OpenAI-compatible endpoint.",timeout:3e5,envVars:{ANTHROPIC_BASE_URL:"https://api.deepinfra.com/v1/openai",ANTHROPIC_AUTH_TOKEN:"${DEEPINFRA_API_KEY}",ANTHROPIC_MODEL:"anthropic/claude-sonnet-4-5-20250929",ANTHROPIC_SMALL_FAST_MODEL:"anthropic/claude-3-5-haiku-20241022",ANTHROPIC_DEFAULT_SONNET_MODEL:"anthropic/claude-sonnet-4-5-20250929",ANTHROPIC_DEFAULT_OPUS_MODEL:"anthropic/claude-opus-4-5-20251101",ANTHROPIC_DEFAULT_HAIKU_MODEL:"anthropic/claude-3-5-haiku-20241022",CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1"}},{id:"lm-studio",name:"LM Studio (Custom)",type:"local",enabled:false,endpoint:"http://localhost:1234/v1",auth:{method:"none"},defaultModel:"custom-model",models:["custom-model"],description:"LM Studio with custom models. Configure model name via mcc configure.",timeout:3e5,envVars:{ANTHROPIC_BASE_URL:"http://localhost:1234/v1",ANTHROPIC_MODEL:"custom-model",ANTHROPIC_SMALL_FAST_MODEL:"custom-model",CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1"}}]}var Ac,pM,qh,zc=_(()=>{Ac=bv(Gu()),pM=join(homedir(),".config","mcc"),qh=join(pM,"config.yaml");});var Cx=_(()=>{bt();});var Gh={};ne(Gh,{addProviderWizard:()=>Lc,configureProvider:()=>wM,quickConfigureModel:()=>kM});async function bM(t){if(console.log(""),console.log(M.bold(` ${t.name}`)),console.log(c.dim(` ID: ${t.id}`)),console.log(c.dim(` Type: ${t.type}`)),console.log(c.dim(` Enabled: ${t.enabled?"Yes":"No"}`)),t.endpoint&&console.log(c.dim(` Endpoint: ${t.endpoint}`)),console.log(c.dim(` Default Model: ${t.defaultModel}`)),t.models&&t.models.length>0){console.log(c.dim(" Available Models:"));for(let e of t.models){let r=e===t.defaultModel;console.log(` ${r?$.success:c.dim("\u2022")} ${e}`);}}if(t.envVars){let e=t.envVars.ANTHROPIC_DEFAULT_OPUS_MODEL,r=t.envVars.ANTHROPIC_DEFAULT_SONNET_MODEL,i=t.envVars.ANTHROPIC_DEFAULT_HAIKU_MODEL;(e||r||i)&&(console.log(c.dim(" Tier Assignments:")),e&&console.log(` Opus: ${e}`),r&&console.log(` Sonnet: ${r}`),i&&console.log(` Haiku: ${i}`));}console.log("");}async function $M(t){console.log(ve(`Configure Models: ${t.name}`));let{action:e}=await de.prompt([{type:"list",name:"action",message:"What would you like to configure?",choices:[{name:"Set tier models (Opus/Sonnet/Haiku)",value:"tiers"},{name:"Add a new model",value:"add"},{name:"Remove a model",value:"remove"},{name:"Set default model",value:"default"},{name:"Back",value:"back"}]}]);if(e!=="back")switch(e){case "tiers":{let r=await de.prompt([{type:"input",name:"opusModel",message:"Opus model (most capable):",default:t.envVars?.ANTHROPIC_DEFAULT_OPUS_MODEL||t.defaultModel},{type:"input",name:"sonnetModel",message:"Sonnet model (balanced):",default:t.envVars?.ANTHROPIC_DEFAULT_SONNET_MODEL||t.defaultModel},{type:"input",name:"haikuModel",message:"Haiku model (fast):",default:t.envVars?.ANTHROPIC_DEFAULT_HAIKU_MODEL||t.defaultModel}]),i={opusModel:r.opusModel,sonnetModel:r.sonnetModel,haikuModel:r.haikuModel,smallFastModel:r.haikuModel};Bh(t.id,i)&&console.log(c.success(`${$.success} Tier models updated`));break}case "add":{let{modelName:r}=await de.prompt([{type:"input",name:"modelName",message:"Enter model name to add:"}]);Dc(t.id,r)&&console.log(c.success(`${$.success} Model "${r}" added`));break}case "remove":{if(!t.models||t.models.length===0){console.log(c.dim("No models to remove"));break}let{modelName:r}=await de.prompt([{type:"list",name:"modelName",message:"Select model to remove:",choices:[...t.models,"Cancel"]}]);r!=="Cancel"&&Hh(t.id,r)&&console.log(c.success(`${$.success} Model "${r}" removed`));break}case "default":{if(!t.models||t.models.length===0){let{modelName:r}=await de.prompt([{type:"input",name:"modelName",message:"Enter default model name:"}]);go(t.id,{defaultModel:r})&&console.log(c.success(`${$.success} Default model set to "${r}"`));}else {let{modelName:r}=await de.prompt([{type:"list",name:"modelName",message:"Select default model:",choices:t.models,default:t.defaultModel}]);go(t.id,{defaultModel:r})&&console.log(c.success(`${$.success} Default model set to "${r}"`));}break}}}async function _M(t){console.log(ve(`Configure Endpoint: ${t.name}`));let e=await de.prompt([{type:"input",name:"endpoint",message:"API endpoint URL:",default:t.endpoint||""},{type:"number",name:"timeout",message:"Timeout (ms):",default:t.timeout||3e4}]),r={endpoint:e.endpoint,timeout:e.timeout};go(t.id,r)&&console.log(c.success(`${$.success} Endpoint configuration updated`));}async function SM(t){console.log(ve(`Configure Credentials: ${t.name}`));let e=yM[t.id]||`${t.id.toUpperCase().replace(/-/g,"_")}_API_KEY`,r=await co(e),i=r?`${r.slice(0,8)}...${r.slice(-4)}`:"Not set";console.log(c.dim(` Environment variable: ${e}`)),console.log(c.dim(` Current value: ${i}`)),console.log("");let{action:n}=await de.prompt([{type:"list",name:"action",message:"Credential action:",choices:[{name:"Set new credential",value:"set"},{name:"Clear credential",value:"clear"},{name:"Back",value:"back"}]}]);if(n!=="back")if(n==="set"){let{credential:o}=await de.prompt([{type:"password",name:"credential",message:"Enter API key/token:",mask:"*"}]);await at(e,o),console.log(c.success(`${$.success} Credential saved securely`));}else n==="clear"&&(await at(e,""),console.log(c.success(`${$.success} Credential cleared`)));}async function wM(t){console.log(ve("Provider Configuration"));let e=Rc(),r=t;if(!r){let o=[...e.map(a=>({name:`${a.enabled?$.success:c.dim("\u25CB")} ${a.name} ${c.dim(`(${a.id})`)}`,value:a.id})),{name:c.dim("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"),value:"__separator__",disabled:true},{name:`${c.success("+")} Add New Provider`,value:"__add__"}],s=await de.prompt([{type:"list",name:"providerId",message:"Select provider to configure:",choices:o}]);if(s.providerId==="__add__"){await Lc();return}r=s.providerId;}if(!r){console.log(c.error("No provider selected"));return}let i=Nc(r);if(!i){console.log(c.error(`Provider "${r}" not found`));return}await bM(i);let n=true;for(;n;){let{action:o}=await de.prompt([{type:"list",name:"action",message:"Configure:",choices:[{name:"Models (tiers, add/remove)",value:"models"},{name:"Endpoint & Timeout",value:"endpoint"},{name:"Credentials (API keys)",value:"credentials"},{name:"Enable/Disable",value:"toggle"},{name:"Set as Default Provider",value:"default"},{name:"Reset to Defaults",value:"reset"},{name:"Back to Main Menu",value:"back"}]}]);switch(o){case "models":await $M(i);break;case "endpoint":await _M(i);break;case "credentials":await SM(i);break;case "toggle":Kh(i.id,!i.enabled),i.enabled=!i.enabled,console.log(c.success(`${$.success} Provider ${i.enabled?"enabled":"disabled"}`));break;case "default":Mc(i.id),console.log(c.success(`${$.success} Set as default provider`));break;case "reset":{let{confirm:s}=await de.prompt([{type:"confirm",name:"confirm",message:"Reset all settings to defaults?",default:false}]);s&&Vh(i.id)&&(console.log(c.success(`${$.success} Provider reset to defaults`)),n=false);break}case "back":n=false;break}if(n&&o!=="back"){let s=Nc(r);s&&Object.assign(i,s);}}console.log(ce());}async function kM(t,e){Dc(t,e)?console.log(c.success(`${$.success} Added "${e}" to ${t}`)):console.log(c.error(`Failed to add model to ${t}`));}function PM(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}async function Lc(){console.log(ve("Add New Provider"));let{providerType:t}=await de.prompt([{type:"list",name:"providerType",message:"Provider type:",choices:xM.map(S=>({name:`${S.name} - ${c.dim(S.description)}`,value:S.value}))}]),e=EM[t];if(t==="local"||t==="custom"){let{endpointInput:S}=await de.prompt([{type:"input",name:"endpointInput",message:"API endpoint URL:",default:e}]);e=S;}let r=IM[t],{authMethod:i}=await de.prompt([{type:"list",name:"authMethod",message:"Authentication method:",choices:r.map(S=>({name:`${S.name} - ${c.dim(S.description)}`,value:S.value}))}]),n={method:i};if(i!=="none"){let S=TM[t]||`${t.toUpperCase()}_API_KEY`,{envVarName:E,credentialValue:T}=await de.prompt([{type:"input",name:"envVarName",message:"Environment variable name to store credential:",default:S},{type:"password",name:"credentialValue",message:`Enter ${i==="bearer"?"token":"API key"} (optional - can set later):`,mask:"*"}]);i==="bearer"?n={method:"bearer",tokenEnv:E}:n={method:"api_key",apiKeyEnv:E},T&&(await at(E,T),console.log(c.success(`${$.success} Credential saved securely`)));}let o=II("Testing connection...").start(),a=await Ye({id:"__test__",name:"Test",type:t,enabled:true,endpoint:e,auth:n,defaultModel:"",timeout:3e4});if(o.stop(),a.ok)console.log(c.success(`${$.success} Connected successfully!`)),a.latencyMs&&console.log(c.dim(` Latency: ${a.latencyMs}ms`));else {console.log(c.error(`${$.error} Connection failed: ${a.message}`)),a.suggestion&&console.log(c.dim(` \u{1F4A1} ${a.suggestion}`));let{proceedAnyway:S}=await de.prompt([{type:"confirm",name:"proceedAnyway",message:"Save provider anyway? (you can fix the issue later)",default:false}]);if(!S){console.log(c.dim("Provider not saved.")),console.log(ce());return}}let l=a.models||[],u="";if(l.length>0){console.log(c.dim(`Found ${l.length} models`));let{selectedModel:S}=await de.prompt([{type:"list",name:"selectedModel",message:"Select default model:",choices:l}]);u=S;}else {let{manualModel:S}=await de.prompt([{type:"input",name:"manualModel",message:"Enter default model name:"}]);u=S,l=[S];}let d=Rc(),m=PM(u||t),{providerName:f,providerId:p}=await de.prompt([{type:"input",name:"providerName",message:"Provider display name:",default:t==="local"?"Local Provider":t==="anthropic"?"Anthropic Claude":t==="openai"?"OpenAI":t==="perplexity"?"Perplexity":"Custom Provider"},{type:"input",name:"providerId",message:"Provider ID (unique identifier):",default:m,validate:S=>d.some(E=>E.id===S)?"This ID already exists. Please choose a different one.":/^[a-z0-9-]+$/.test(S)?true:"ID can only contain lowercase letters, numbers, and hyphens."}]),v={id:p,name:f,type:t,enabled:true,endpoint:e||void 0,auth:n,defaultModel:u,models:l.length>0?l:void 0,description:`Added via wizard on ${new Date().toISOString().split("T")[0]}`,timeout:3e4,envVars:OM(t,e,n,u)},g=B();g.providers.push(v),Fe(g),console.log(""),console.log(c.success(`${$.success} Provider "${f}" added successfully!`)),console.log(c.dim(` ID: ${p}`)),console.log(c.dim(` Type: ${t}`)),e&&console.log(c.dim(` Endpoint: ${e}`)),console.log(c.dim(` Default model: ${u}`));let{setAsDefault:y}=await de.prompt([{type:"confirm",name:"setAsDefault",message:"Set as default provider?",default:g.providers.length===1}]);y&&(Mc(p),console.log(c.success(`${$.success} Set as default provider`))),console.log(ce());}function OM(t,e,r,i){let n={};return e&&(t==="local"||t==="custom")&&(n.ANTHROPIC_BASE_URL=e),r.method==="bearer"&&r.tokenEnv?n.ANTHROPIC_AUTH_TOKEN=`\${${r.tokenEnv}}`:r.method==="api_key"&&r.apiKeyEnv&&(n.ANTHROPIC_API_KEY=`\${${r.apiKeyEnv}}`),i&&(n.ANTHROPIC_MODEL=i),n}var yM,xM,IM,EM,TM,jc=_(()=>{St();zc();Ee();Cx();Qt();qe();yM={"claude-max":"ANTHROPIC_AUTH_TOKEN","zai-coding-plan":"ZAI_API_KEY","minimax-coding-plan":"MINIMAX_API_KEY",deepinfra:"DEEPINFRA_API_KEY"};xM=[{name:"Local (LM Studio, Ollama, etc.)",value:"local",description:"Local LLM server running on your machine"},{name:"Anthropic Claude",value:"anthropic",description:"Official Anthropic Claude API"},{name:"Claude Agent SDK",value:"agent-sdk",description:"Anthropic Agent SDK with full tool support"},{name:"OpenAI",value:"openai",description:"OpenAI GPT models"},{name:"Perplexity",value:"perplexity",description:"Perplexity AI models"},{name:"Custom (OpenAI-compatible)",value:"custom",description:"Any OpenAI-compatible API endpoint"}],IM={local:[{name:"No authentication",value:"none",description:"Local server requires no auth"}],anthropic:[{name:"Bearer token",value:"bearer",description:"Use ANTHROPIC_AUTH_TOKEN"},{name:"API key",value:"api_key",description:"Use ANTHROPIC_API_KEY"}],"agent-sdk":[{name:"Bearer token",value:"bearer",description:"Use ANTHROPIC_AUTH_TOKEN"},{name:"API key",value:"api_key",description:"Use ANTHROPIC_API_KEY"}],openai:[{name:"API key",value:"api_key",description:"Use OPENAI_API_KEY"}],perplexity:[{name:"API key",value:"api_key",description:"Use PERPLEXITY_API_KEY"}],custom:[{name:"No authentication",value:"none",description:"No auth required"},{name:"Bearer token",value:"bearer",description:"Authorization: Bearer <token>"},{name:"API key (X-API-Key header)",value:"api_key",description:"Custom API key header"}]},EM={local:"http://localhost:1234/v1",anthropic:"https://api.anthropic.com","agent-sdk":"https://api.anthropic.com",openai:"https://api.openai.com/v1",perplexity:"https://api.perplexity.ai",custom:""},TM={local:"",anthropic:"ANTHROPIC_AUTH_TOKEN","agent-sdk":"ANTHROPIC_AUTH_TOKEN",openai:"OPENAI_API_KEY",perplexity:"PERPLEXITY_API_KEY",custom:""};});var ho={};ne(ho,{formatSessionList:()=>CM,resumeSession:()=>NM});function CM(t){let e=`
|
|
281
|
+
${ae("Sessions")}
|
|
282
|
+
${H(50)}
|
|
283
|
+
`;if(t.length===0)return e+=`
|
|
284
|
+
${c.dim("No sessions found yet. Sessions are created when you")}
|
|
285
|
+
${c.dim("launch Claude Code with MCC.")}
|
|
286
|
+
`,e+=ce(),e;for(let r of t){let i=AM(r.state),n=c.dim(basename(r.workspace)),o=c.primary(r.provider),s=c.dim(r.model),a=new Date(r.lastActive).toLocaleDateString();e+=`
|
|
287
|
+
${i} ${M.bold(c.primary(r.sessionId))} ${c.dim(`\u2022 ${a}`)}
|
|
288
|
+
${n} ${c.dim("\u2022")} ${o} ${c.dim("\u2022")} ${s}
|
|
289
|
+
${c.dim(`${r.messageCount} messages \u2022 ${r.fileCount} files`)}
|
|
290
|
+
`;}return e+=ce(),e}function AM(t){switch(t){case "active":return c.success("\u25CF");case "paused":return c.warning("\u25D0");case "completed":return c.info("\u2714");case "failed":return c.error("\u2716");default:return c.dim("\u25CB")}}async function NM(t,e){let r=e.getSession(t);r||(console.error(c.error(`Session not found: ${t}`)),console.log(c.dim(`
|
|
291
|
+
Run "mcc sessions ls" to see available sessions.
|
|
292
|
+
`)),process.exit(1)),console.log(ae(`
|
|
293
|
+
Resuming Session`)),console.log(H(50)),console.log(` ${c.dim("Session ID:")} ${c.primary(r.sessionId)}`),console.log(` ${c.dim("Workspace:")} ${c.subtle(basename(r.workspace))}`),console.log(` ${c.dim("Provider:")} ${c.primary(r.provider)} ${c.dim("\u2022")} ${c.dim(r.model)}`),console.log(` ${c.dim("Last active:")} ${new Date(r.lastActive).toLocaleString()}`),console.log(H(50)),e.setActiveSession(r.sessionId);let{loadConfig:i}=await Promise.resolve().then(()=>(Ee(),bn)),{launchClaudeCode:n}=await Promise.resolve().then(()=>(Zh(),Px)),s=i().providers.find(a=>a.id===r.provider||a.name===r.provider);s||(console.error(c.error(`Provider not found: ${r.provider}`)),process.exit(1)),s.defaultModel=r.model,console.log(c.dim(`
|
|
294
|
+
Session context restored. Launching...
|
|
295
|
+
`)),await n(s,r.workspace);}var vo=_(()=>{St();qe();});var Fc={};ne(Fc,{exportSession:()=>Nx,exportSessionToFile:()=>Uc,importSession:()=>Rx,importSessionFromFile:()=>zM});function Nx(t,e={}){let i=be().getSession(t);if(!i)return null;let n={version:"2.0.0",exportedAt:new Date().toISOString(),session:{...i,messages:e.includeMessages!==false?i.messages:[],files:e.includeFiles!==false?i.files:[],env:e.includeEnv!==false?i.env:{}}};return e.maxMessages&&n.session.messages.length>e.maxMessages&&(n.session.messages=n.session.messages.slice(-e.maxMessages)),n}function Uc(t,e,r={}){let i=Nx(t,r);if(!i)return false;try{return writeFileSync(e,JSON.stringify(i,null,2)),!0}catch{return false}}function Rx(t,e={}){let r=be();if(t.version===void 0||t.session===void 0)return null;let i={...t.session,sessionId:e.preserveSessionId?t.session.sessionId:LM(),createdAt:e.preserveSessionId?t.session.createdAt:new Date().toISOString(),lastActive:new Date().toISOString(),state:"active",metadata:e.metadata??t.session.metadata};return r.saveSession(i),i}function zM(t,e={}){if(!existsSync(t))return null;try{let r=readFileSync(t,"utf-8"),i=JSON.parse(r);return Rx(i,e)}catch{return null}}function LM(){return UM.randomUUID().slice(0,8)}var UM,Dr=_(()=>{Xe();UM={randomUUID:randomUUID};});var In={};ne(In,{applySnapshot:()=>GM,createSnapshot:()=>zx,createSnapshotFromActive:()=>WM,deleteSnapshot:()=>JM,getSnapshot:()=>Lx,listSnapshots:()=>VM});function Mx(){existsSync(xn)||mkdirSync(xn,{recursive:true});}function KM(){return `snap-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function zx(t,e={}){let i=be().getSession(t);if(!i)return null;Mx();let n=e.maxMessages?i.messages.slice(-e.maxMessages):i.messages,o={id:KM(),name:e.name||`Snapshot ${new Date().toLocaleDateString()}`,createdAt:new Date().toISOString(),sourceProvider:i.provider,sourceModel:i.model,workspace:i.workspace,messages:n,files:i.files,env:i.env,metadata:{description:e.description,tags:e.tags}},s=join(xn,`${o.id}.json`);return writeFileSync(s,JSON.stringify(o,null,2)),o}function VM(){Mx();let t=readdirSync(xn).filter(r=>r.endsWith(".json")),e=[];for(let r of t)try{let i=readFileSync(join(xn,r),"utf-8");e.push(JSON.parse(i));}catch{}return e.sort((r,i)=>new Date(i.createdAt).getTime()-new Date(r.createdAt).getTime())}function Lx(t){let e=join(xn,`${t}.json`);if(!existsSync(e))return null;try{let r=readFileSync(e,"utf-8");return JSON.parse(r)}catch{return null}}function JM(t){let e=join(xn,`${t}.json`);if(!existsSync(e))return false;try{return unlinkSync(e),!0}catch{return false}}function GM(t,e={}){let r=Lx(t);if(!r)return null;let i=e.targetProvider||r.sourceProvider,n=e.targetModel||r.sourceModel;return {messages:r.messages,files:r.files,env:{...r.env,MCC_SNAPSHOT_ID:t,MCC_TARGET_PROVIDER:i,MCC_TARGET_MODEL:n}}}function WM(t={}){let r=be().getActiveSession();return r?zx(r.sessionId,t):null}var xn,tn=_(()=>{Xe();xn=join(homedir(),".config","mcc","snapshots");});function jx(t,e){let r=[];if(t.system){let n=typeof t.system=="string"?t.system:t.system.filter(o=>o.type==="text"&&o.text).map(o=>o.text).join(`
|
|
296
|
+
`);n&&r.push({role:"system",content:n});}for(let n of t.messages){let o=typeof n.content=="string"?n.content:n.content.filter(s=>s.type==="text"&&s.text).map(s=>s.text??"").join(`
|
|
297
|
+
`);r.push({role:n.role,content:o});}let i={model:e,messages:r,max_tokens:t.max_tokens>0?t.max_tokens:4096,temperature:t.temperature??.7,stream:t.stream??false};return t.stop_sequences&&(i.stop=t.stop_sequences),t.top_p!==void 0&&(i.top_p=t.top_p),i}function Ux(t,e){let r=t.choices[0],i=r.message.content,o=r.finish_reason==="length"?"max_tokens":"end_turn";return {id:`msg_${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`,type:"message",role:"assistant",content:[{type:"text",text:i}],model:e,stop_reason:o,stop_sequence:null,usage:{input_tokens:t.usage?.prompt_tokens??0,output_tokens:t.usage?.completion_tokens??0}}}function Fx(t){let r=t.choices[0].delta.content;return r?{type:"content_block_delta",index:0,delta:{type:"text_delta",text:r}}:null}var Zx=_(()=>{});function Zc(t){return `http://${t.host}:${t.port}`}async function qc(t){return Mr||new Promise((e,r)=>{let i=createServer((n,o)=>{ez(n,o,t);});i.on("error",n=>{n.code==="EADDRINUSE"?r(new Error(`Port ${t.port} already in use`)):r(n);}),i.listen(t.port,t.host,()=>{Mr=i,e(i);});})}function bo(){Mr&&(Mr.close(),Mr=null);}async function ez(t,e,r){if(e.setHeader("Access-Control-Allow-Origin","*"),e.setHeader("Access-Control-Allow-Methods","POST, GET, OPTIONS"),e.setHeader("Access-Control-Allow-Headers","Content-Type, x-api-key, anthropic-version, Authorization"),t.method==="OPTIONS"){e.writeHead(204),e.end();return}let i=t.url??"/";i==="/v1/messages"&&t.method==="POST"?await tz(t,e,r):i==="/v1/models"&&t.method==="GET"?await rz(e,r):(e.writeHead(404,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:{type:"not_found",message:`Route not found: ${i}`}})));}async function tz(t,e,r){let i=await iz(t),n;try{n=JSON.parse(i);}catch{e.writeHead(400,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:{type:"invalid_request",message:"Invalid JSON body"}}));return}let o=n.stream===true,s=jx(n,r.model);try{let a={"Content-Type":"application/json"};r.authMethod==="bearer"&&r.authToken?a.Authorization=`Bearer ${r.authToken}`:r.authMethod==="api_key"&&r.authToken&&(a["x-api-key"]=r.authToken);let l=r.timeout??XM,u=new AbortController,d=setTimeout(()=>u.abort(),l),m;try{m=await fetch(`${r.targetUrl}/chat/completions`,{method:"POST",headers:a,body:JSON.stringify(s),signal:u.signal});}finally{clearTimeout(d);}if(!m.ok){let f=await m.text();e.writeHead(m.status,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:{type:"upstream_error",message:`LM Studio error: ${m.status} ${f}`}}));return}if(o&&m.body)e.writeHead(200,{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}),await nz(m,e,n.model);else {let f=await m.json(),p=Ux(f,n.model);e.writeHead(200,{"Content-Type":"application/json"}),e.end(JSON.stringify(p));}}catch(a){e.writeHead(502,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:{type:"proxy_error",message:`Failed to connect to LM Studio: ${X(a)}`}}));}}async function nz(t,e,r){let i=t.body?.getReader();if(!i){e.end();return}let n=new TextDecoder,a={type:"message_start",message:{id:`msg_${Date.now()}`,type:"message",role:"assistant",content:[],model:r,stop_reason:null,stop_sequence:null,usage:{input_tokens:0,output_tokens:0}}};e.write(`event: message_start
|
|
298
|
+
data: ${JSON.stringify(a)}
|
|
299
|
+
|
|
300
|
+
`);let l={type:"content_block_start",index:0,content_block:{type:"text",text:""}};e.write(`event: content_block_start
|
|
301
|
+
data: ${JSON.stringify(l)}
|
|
302
|
+
|
|
303
|
+
`);let u=0,d="";try{for(;;){let v=await i.read();if(v.done||!v.value)break;let g=v.value;d+=n.decode(g,{stream:!0});let y=d.split(`
|
|
304
|
+
`);d=y.pop()??"";for(let S of y){if(!S.startsWith("data: "))continue;let E=S.slice(6).trim();if(E!=="[DONE]")try{let T=JSON.parse(E),C=Fx(T);C&&(u++,e.write(`event: content_block_delta
|
|
305
|
+
data: ${JSON.stringify(C)}
|
|
306
|
+
|
|
307
|
+
`));}catch{continue}}}}catch{}let m={type:"content_block_stop",index:0};e.write(`event: content_block_stop
|
|
308
|
+
data: ${JSON.stringify(m)}
|
|
309
|
+
|
|
310
|
+
`);let f={type:"message_delta",delta:{stop_reason:"end_turn",stop_sequence:null},usage:{output_tokens:u}};e.write(`event: message_delta
|
|
311
|
+
data: ${JSON.stringify(f)}
|
|
312
|
+
|
|
313
|
+
`);let p={type:"message_stop"};e.write(`event: message_stop
|
|
314
|
+
data: ${JSON.stringify(p)}
|
|
315
|
+
|
|
316
|
+
`),e.end();}async function rz(t,e){try{let r={};e.authMethod==="bearer"&&e.authToken?r.Authorization=`Bearer ${e.authToken}`:e.authMethod==="api_key"&&e.authToken&&(r["x-api-key"]=e.authToken);let i=new AbortController,n=setTimeout(()=>i.abort(),QM),o;try{o=await fetch(`${e.targetUrl}/models`,{headers:Object.keys(r).length>0?r:void 0,signal:i.signal});}finally{clearTimeout(n);}if(!o.ok){t.writeHead(o.status,{"Content-Type":"application/json"}),t.end(JSON.stringify({error:{type:"upstream_error",message:"Failed to fetch models"}}));return}let l=((await o.json()).data??[]).map(u=>({id:u.id,display_name:u.id,created_at:new Date().toISOString()}));t.writeHead(200,{"Content-Type":"application/json"}),t.end(JSON.stringify({data:l}));}catch(r){t.writeHead(502,{"Content-Type":"application/json"}),t.end(JSON.stringify({error:{type:"proxy_error",message:X(r)}}));}}function iz(t){return new Promise((e,r)=>{let i=[];t.on("data",n=>{i.push(n);}),t.on("end",()=>{e(Buffer.concat(i).toString("utf8"));}),t.on("error",r);})}var XM,QM,Mr,Yh=_(()=>{Zx();vt();XM=3e4,QM=1e4,Mr=null;});function Bc(t){let e={...process.env};if(t.envVars)for(let[r,i]of Object.entries(t.envVars)){let n=i.replace(/\$\{(\w+)\}/g,(o,s)=>Re(s)??process.env[s]??"");e[r]=n;}return t.endpoint&&(e.ANTHROPIC_BASE_URL=t.endpoint),e}function Hc(){let t=process.platform;if(t==="win32")return "claude.cmd";let e=process.env.PATH??"",r=t==="win32"?";":":";for(let i of e.split(r)){let n=join(i,"claude");if(existsSync(n)||existsSync(n+".cmd")||existsSync(n+".exe"))return "claude"}return "claude"}var Qh=_(()=>{bt();});var _o={};ne(_o,{batchMsg:()=>pz,cancelMsg:()=>mz,createMessageStream:()=>ev,deserialize:()=>qx,errorMsg:()=>dz,generateId:()=>pe,heartbeatMsg:()=>fz,resultMsg:()=>$o,serialize:()=>cz,spawnMsg:()=>lz,statusMsg:()=>uz,taskUpdateMsg:()=>tv});function pe(t="task"){return `${t}_${randomBytes(8).toString("hex")}`}function cz(t){return JSON.stringify(t)+`
|
|
317
|
+
`}function qx(t){let e=t.trim();if(!e)return null;try{let r=JSON.parse(e);return !r.id||!r.type?null:r}catch{return null}}function ev(t,e,r){let i=createInterface({input:t,crlfDelay:1/0});return i.on("line",n=>{let o=qx(n);o&&e(o);}),i.on("error",n=>{r?.(n instanceof Error?n:new Error(String(n)));}),i}function lz(t,e,r){return {id:pe("spawn"),type:"spawn",timestamp:Date.now(),provider:t,prompt:e,model:r?.model,capabilities:r?.capabilities}}function uz(t,e,r){return {id:pe("status"),type:"status",timestamp:Date.now(),taskId:t,state:e,...r}}function $o(t,e,r,i,n,o){return {id:pe("result"),type:"result",timestamp:Date.now(),taskId:t,output:e,exitCode:r,elapsed:i,provider:n,model:o}}function dz(t,e,r){return {id:pe("err"),type:"error",timestamp:Date.now(),taskId:r,code:t,message:e}}function mz(t){return {id:pe("cancel"),type:"cancel",timestamp:Date.now(),taskId:t}}function tv(t,e,r){return {id:pe("update"),type:"task_update",timestamp:Date.now(),taskId:t,state:e,detail:r}}function fz(t,e,r){return {id:pe("hb"),type:"heartbeat",timestamp:Date.now(),taskId:t,uptimeMs:e,memoryMb:r}}function pz(t){return {id:pe("batch"),type:"batch",timestamp:Date.now(),tasks:t}}var Pt=_(()=>{});var So,Bx=_(()=>{Ee();Yh();Qh();Pt();So=class extends EventEmitter{taskId;provider;model;prompt;child=null;proxyOptions=null;state="queued";startedAt=0;stdout="";stderr="";outputBytes=0;timeoutHandle=null;killTimerHandle=null;timeout;maxOutputBytes;cwd;onSigInt;onSigTerm;constructor(e){super(),this.taskId=pe("agent"),this.provider=e.provider,this.model=e.model??e.provider.defaultModel,this.prompt=e.prompt,this.timeout=e.timeout??3e5,this.maxOutputBytes=e.maxOutputBytes??10485760,this.cwd=e.cwd,this.onSigInt=()=>{this.kill("SIGINT");},this.onSigTerm=()=>{this.kill("SIGTERM");};}get pid(){return this.child?.pid}get currentState(){return this.state}get info(){return {taskId:this.taskId,pid:this.pid,provider:this.provider.id,model:this.model,state:this.state,startedAt:this.startedAt,elapsed:this.startedAt?Date.now()-this.startedAt:0,outputBytes:this.outputBytes}}async start(){this.setState("spawning"),this.startedAt=Date.now();let e=this.buildEnvironment();await this.setupProxy(e);let r=this.getClaudeCommand(),i=["--print","--output-format","json","-p",this.prompt];return this.setState("running"),new Promise((n,o)=>{this.child=spawn(r,i,{env:e,stdio:["ignore","pipe","pipe"],shell:process.platform==="win32",cwd:this.cwd}),this.timeout>0&&(this.timeoutHandle=setTimeout(()=>{this.kill("SIGTERM"),o(new Error(`Task ${this.taskId} timed out after ${this.timeout}ms`));},this.timeout)),this.child.stdout&&(ev(this.child.stdout,s=>{this.emit("message",s);}),this.child.stdout.on("data",s=>{let a=s.toString();this.stdout=this.appendCapped(this.stdout,a),this.emitOutput(a,"stdout");})),this.child.stderr&&this.child.stderr.on("data",s=>{let a=s.toString();this.stderr=this.appendCapped(this.stderr,a),this.emitOutput(a,"stderr");}),this.child.on("error",s=>{this.clearTimeout(),this.removeSignalHandlers(),this.setState("failed"),this.cleanupProxy(),o(s);}),this.child.on("exit",s=>{this.clearTimeout(),this.clearKillTimer(),this.removeSignalHandlers();let a=s??1,l=Date.now()-this.startedAt;a===0?this.setState("completed"):this.setState("failed"),this.cleanupProxy();let u=$o(this.taskId,this.stdout,a,l,this.provider.id,this.model);this.emit("result",u),n(u);}),process.on("SIGINT",this.onSigInt),process.on("SIGTERM",this.onSigTerm);})}kill(e="SIGTERM"){this.child&&!this.child.killed&&(this.child.kill(e),this.setState("cancelled"),e==="SIGTERM"&&(this.killTimerHandle=setTimeout(()=>{this.child&&!this.child.killed&&this.child.kill("SIGKILL");},5e3))),this.clearTimeout();}setState(e){this.state=e;let r=tv(this.taskId,e);this.emit("state",r);}emitOutput(e,r){let i={id:pe("out"),type:"output",timestamp:Date.now(),taskId:this.taskId,chunk:e,stream:r};this.emit("output",i);}buildEnvironment(){return Bc(this.provider)}async setupProxy(e){if(this.provider.type!=="local"||!this.provider.endpoint)return;let r=B(),i=r.proxy?.port??9e3,n=r.proxy?.host??"127.0.0.1";this.proxyOptions={port:i,host:n,targetUrl:this.provider.endpoint,model:this.model},await qc(this.proxyOptions),e.ANTHROPIC_BASE_URL=Zc(this.proxyOptions);}cleanupProxy(){this.proxyOptions&&(bo(),this.proxyOptions=null);}appendCapped(e,r){let i=e+r;if(this.outputBytes+=Buffer.byteLength(r,"utf8"),Buffer.byteLength(i,"utf8")<=this.maxOutputBytes)return i;let n=Buffer.from(i,"utf8");return n.subarray(n.length-this.maxOutputBytes).toString("utf8")}removeSignalHandlers(){process.removeListener("SIGINT",this.onSigInt),process.removeListener("SIGTERM",this.onSigTerm);}clearKillTimer(){this.killTimerHandle&&(clearTimeout(this.killTimerHandle),this.killTimerHandle=null);}clearTimeout(){this.timeoutHandle&&(clearTimeout(this.timeoutHandle),this.timeoutHandle=null);}getClaudeCommand(){return Hc()}};});var Hx,nv,Kc,Kx=_(()=>{Bx();Hx={high:0,normal:1,low:2},nv=3,Kc=class extends EventEmitter{maxConcurrency;defaultTimeout;active=new Map;queue=[];consecutiveFailures=new Map;completedCount=0;failedCount=0;evictedCount=0;draining=false;constructor(e={}){super(),this.maxConcurrency=e.maxConcurrency??4,this.defaultTimeout=e.defaultTimeout??3e5;}get status(){let e=[...this.active.values()].map(r=>({taskId:r.taskId,provider:r.provider.id,model:r.model,state:r.currentState,pid:r.pid,elapsed:r.info.elapsed}));return {running:this.active.size,queued:this.queue.length,completed:this.completedCount,failed:this.failedCount,evicted:this.evictedCount,maxConcurrency:this.maxConcurrency,agents:e}}async submit(e,r="normal"){if(this.draining)throw new Error("Pool is draining, not accepting new tasks");let i=e.provider.id;if(this.isEvicted(i))throw this.evictedCount++,new Error(`Provider "${i}" evicted due to ${nv}+ consecutive failures`);return e.timeout??=this.defaultTimeout,this.active.size<this.maxConcurrency?this.spawn(e):new Promise((n,o)=>{this.queue.push({opts:e,priority:r,resolve:n,reject:o}),this.emit("queued",{taskId:"pending",queueSize:this.queue.length});})}async warmUp(e,r=1){let i=[];for(let n of e)for(let o=0;o<r&&!(this.active.size>=this.maxConcurrency);o++)n.timeout??=this.defaultTimeout,this.isEvicted(n.provider.id)||i.push(this.spawn(n));return Promise.all(i)}cancel(e){let r=this.active.get(e);if(r)return r.kill(),this.active.delete(e),this.failedCount++,this.drainQueue(),true;let i=this.queue.findIndex(n=>new So(n.opts).taskId===e);if(i>=0){let[n]=this.queue.splice(i,1);return n.reject(new Error("Task cancelled")),true}return false}cancelAll(){for(let e of this.active.values())e.kill();this.active.clear();for(let e of this.queue)e.reject(new Error("Pool shutdown"));this.queue.length=0;}async drain(e=1e4){this.draining=true;for(let o of this.queue)o.reject(new Error("Pool draining"));if(this.queue.length=0,this.active.size===0)return;let r=Date.now()+e,i=Promise.all([...this.active.values()].map(o=>new Promise(s=>{o.once("result",()=>{s();}),o.once("state",a=>{(a.state==="failed"||a.state==="cancelled")&&s();});}))),n=new Promise(o=>{setTimeout(()=>{for(let s of this.active.values())(s.currentState==="running"||s.currentState==="spawning")&&s.kill("SIGKILL");o();},Math.max(0,r-Date.now()));});await Promise.race([i,n]),this.active.clear(),this.draining=false;}getAgent(e){return this.active.get(e)}isEvicted(e){return (this.consecutiveFailures.get(e)??0)>=nv}recordSuccess(e){this.consecutiveFailures.set(e,0);}recordFailure(e){let r=this.consecutiveFailures.get(e)??0;this.consecutiveFailures.set(e,r+1);}async spawn(e){let r=new So(e);this.active.set(r.taskId,r),this.emit("spawn",{taskId:r.taskId,provider:e.provider.id}),r.on("output",i=>{this.emit("output",i);}),r.on("state",i=>{this.emit("state",i);});try{let i=await r.start();return this.active.delete(r.taskId),i.exitCode===0?(this.completedCount++,this.recordSuccess(e.provider.id)):(this.failedCount++,this.recordFailure(e.provider.id)),this.emit("result",i),this.drainQueue(),i}catch(i){throw this.active.delete(r.taskId),this.failedCount++,this.recordFailure(e.provider.id),this.drainQueue(),i}}drainQueue(){if(!this.draining)for(this.queue.sort((e,r)=>Hx[e.priority]-Hx[r.priority]);this.queue.length>0&&this.active.size<this.maxConcurrency;){let e=this.queue.shift();if(!e)break;if(this.isEvicted(e.opts.provider.id)){this.evictedCount++,e.reject(new Error(`Provider "${e.opts.provider.id}" evicted due to ${nv}+ consecutive failures`));continue}this.spawn(e.opts).then(e.resolve).catch(e.reject);}}};});var yz,bz,$z,_z,Vc,Vx=_(()=>{yz={anthropic:["code","reasoning","long_context"],openai:["code","reasoning","vision"],local:["fast","cheap"],custom:["code"],perplexity:["reasoning"]},bz=20,$z=5,_z=3e4,Vc=class{metrics=new Map;capabilityOverrides=new Map;setCapabilities(e,r){this.capabilityOverrides.set(e,r);}recordLatency(e,r){let i=this.getOrCreateMetrics(e);i.latencies.push(r),i.latencies.length>bz&&i.latencies.shift(),i.successes++,i.consecutiveErrors=0,i.lastUsed=Date.now();}recordError(e){let r=this.getOrCreateMetrics(e);r.errors++,r.consecutiveErrors++,r.lastErrorAt=Date.now(),r.lastUsed=Date.now();}getCircuitState(e){let r=this.metrics.get(e);return !r||r.consecutiveErrors<$z?"closed":r.lastErrorAt>Date.now()-_z?"open":"half-open"}route(e,r={}){if(r.preferProvider){let n=e.find(o=>o.enabled&&o.id===r.preferProvider&&this.getCircuitState(o.id)!=="open");if(n)return n}return this.filterAndScore(e,r)[0]??null}routeMultiple(e,r={},i=2){return this.filterAndScore(e,r).slice(0,i)}filterAndScore(e,r){let i=e.filter(s=>s.enabled&&this.getCircuitState(s.id)!=="open"),n=r.excludeProviders;n?.length&&(i=i.filter(s=>!n.includes(s.id)));let o=r.capabilities;return o?.length&&(i=i.filter(s=>{let a=this.getCapabilities(s);return o.every(l=>a.includes(l))})),i.sort((s,a)=>this.getRouteScore(s.id)-this.getRouteScore(a.id)),i}getMetrics(e){return this.metrics.get(e)}getAllMetrics(){return new Map(this.metrics)}getCapabilities(e){return this.capabilityOverrides.get(e.id)??yz[e.type]??[]}getRouteScore(e){let r=this.getP50Latency(e),i=this.getErrorRate(e);return r*(1+i)}getErrorRate(e){let r=this.metrics.get(e);if(!r)return 0;let i=r.errors+r.successes;return i===0?0:r.errors/i}getP50Latency(e){let r=this.metrics.get(e);if(!r||r.latencies.length===0)return 1/0;let i=[...r.latencies].sort((o,s)=>o-s),n=Math.floor(i.length/2);return i.length%2===0?(i[n-1]+i[n])/2:i[n]}getOrCreateMetrics(e){let r=this.metrics.get(e);return r||(r={providerId:e,latencies:[],errors:0,successes:0,lastUsed:0,consecutiveErrors:0,lastErrorAt:0},this.metrics.set(e,r)),r}};});var Jc,Jx=_(()=>{Ee();Jc=class extends EventEmitter{orchestratorId;role;db;lastHeartbeat=0;heartbeatInterval=null;constructor(e,r,i){super(),this.orchestratorId=e,this.role=r,this.db=i,this.initializeOrchestrator(),this.startHeartbeat();}initializeOrchestrator(){if(this.db.getOrchestrator(this.orchestratorId)){console.log(`Orchestrator ${this.orchestratorId} (${this.role}) already initialized`);return}let r=this.getCapabilities();this.db.insertOrchestrator({id:this.orchestratorId,role:this.role,status:"active",last_heartbeat:Date.now(),capabilities:JSON.stringify(r),provider_id:null,model:null}),console.log(`Initialized orchestrator ${this.orchestratorId} (${this.role}) with capabilities: ${r.join(", ")}`),this.emit("initialized",{orchestratorId:this.orchestratorId,role:this.role});}updateStatus(e){this.db.updateOrchestrator(this.orchestratorId,{status:e,last_heartbeat:Date.now()}),this.heartbeatInterval&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null),e==="active"&&this.startHeartbeat(),this.emit("status",{orchestratorId:this.orchestratorId,role:this.role,status:e});}startHeartbeat(){this.heartbeatInterval||(this.heartbeatInterval=setInterval(()=>{this.lastHeartbeat=Date.now(),this.db.updateOrchestrator(this.orchestratorId,{last_heartbeat:this.lastHeartbeat});},5e3));}stopHeartbeat(){this.heartbeatInterval&&(clearInterval(this.heartbeatInterval),this.heartbeatInterval=null);}ensureActive(){let e=this.db.getOrchestrator(this.orchestratorId);if(!e)throw new Error(`Orchestrator ${this.orchestratorId} not found in database`);e.status!=="active"&&(console.log(`Activating orchestrator ${this.orchestratorId} (current status: ${e.status})`),this.updateStatus("active"));}recordTask(e,r,i,n,o,s=1){this.db.insertTask({id:e,orchestrator_id:this.orchestratorId,status:o,priority:"normal",prompt:n,provider:r,model:i,started_at:o==="running"||o==="spawning"?Date.now():null,completed_at:null,exit_code:null,output:null,error:null,session:null,retry_of:null,attempt:s});}updateTaskStatus(e,r,i){let n={status:r};i&&Object.assign(n,i),(r==="completed"||r==="failed")&&(n.completed_at=Date.now()),this.db.updateTask(e,n);}resolveProvider(e){let r={capabilities:e.capabilities},i=st(),n=this.routeProviders(i,r);if(!n)throw new Error("No provider matches required capabilities");return this.ensureActive(),n}routeProviders(e,r){let i=r.capabilities??[],n=e.filter(o=>o.enabled);if(i.length>0){let o=this.getCapabilities(),s=new Map(e.map(a=>{let l=this.getProviderCapabilities(a);return [a.id,l]}));n=n.filter(a=>{let l=s.get(a.id)??[];return i.every(u=>l.includes(u))||i.some(u=>o.includes(u))});}return n.length===0?null:n[0]}async shutdown(e=1e4){console.log(`Shutting down orchestrator ${this.orchestratorId} (${this.role})`),this.stopHeartbeat(),this.updateStatus("idle"),await new Promise(r=>setTimeout(r,e)),this.emit("shutdown",{orchestratorId:this.orchestratorId,role:this.role});}getState(){let e=this.db.getOrchestrator(this.orchestratorId),r=this.db.getTasksByOrchestrator(this.orchestratorId),i=r.filter(s=>s.status==="running"||s.status==="spawning").length,n=r.filter(s=>s.status==="completed").length,o=r.filter(s=>s.status==="failed").length;return {orchestratorId:this.orchestratorId,role:this.role,status:e?.status??"idle",tasksRunning:i,tasksCompleted:n,tasksFailed:o,currentCapacity:i,maxCapacity:10}}};});var wz,kz,xz,Iz,Ez,Tz,Pz,Oz,Cz,Gc,Gx=_(()=>{Jx();wz=["debug","investigate","trace","diagnose","race condition","memory leak"],kz=["fix typo","rename","update comment","change string","bump version"],xz=["refactor","restructure","reorganize","migrate","convert"],Iz=["architecture","design system","infrastructure","scalability","distributed"],Ez=/[\w-]+\.(?:ts|js|py|go|rs|tsx|jsx|vue|svelte)\b/g,Tz=/(?:src\/|\.ts\b|\.js\b|\.py\b|\.go\b|\.rs\b|\/[\w-]+\/[\w-]+\.\w+)/,Pz=/(?:function\s+\w+|const\s+\w+\s*=|class\s+\w+|def\s+\w+|fn\s+\w+)/,Oz=/```[\s\S]*?```/,Cz=/\band\b|\bthen\b|\balso\b|\badditionally\b/gi,Gc=class extends Jc{constructor(e="orch_planning",r){super(e,"planning",r);}getCapabilities(){return ["reasoning","planning","analysis"]}getProviderCapabilities(e){return e.type==="anthropic"?["reasoning","planning","analysis"]:[]}analyzeTaskComplexity(e){let i=e.split(/\s+/).filter(P=>P.length>0).length,n=e.toLowerCase(),o=Oz.test(e),s=Tz.test(e),a=Pz.test(e),l=e.match(Ez)??[],u=l.length>1,m=(e.match(Cz)??[]).length,f=wz.some(P=>n.includes(P)),p=kz.some(P=>n.includes(P)),v=xz.some(P=>n.includes(P)),g=Iz.some(P=>n.includes(P)),y=[];(o||s||a)&&y.push("code"),(f||g)&&y.push("reasoning"),(v||g)&&y.push("planning"),i>500&&y.push("long_context"),y.length===0&&y.push("code");let S=[],E;u||g||i>100&&o?(E="complex",u&&S.push(`references ${l.length} files`),g&&S.push("architecture-level task"),i>100&&S.push(`${i} words`)):i>=20||o||v||f||m>0?(E="moderate",i>=20&&S.push(`${i} words`),o&&S.push("contains code blocks"),v&&S.push("refactoring task"),f&&S.push("debugging task"),m>0&&S.push(`${m} task conjunctions`)):(E="simple",p&&S.push("simple keyword detected"),S.push(`${i} words`));let T;switch(E){case "simple":T=1;break;case "moderate":T=Math.min(2+m,3);break;case "complex":T=Math.min(3+m+(u?l.length:0),7);break}let C;return p||E==="simple"&&!o?C="haiku":f||g||E==="complex"?C="opus":C="sonnet",{complexity:E,estimatedSubtasks:T,suggestedTier:C,capabilities:y,reasoning:S.join("; ")||"default classification"}}suggestModelTier(e){return this.analyzeTaskComplexity(e).suggestedTier}decomposeTask(e,r){this.ensureActive();let i=this.analyzeTaskComplexity(e);if(i.complexity==="simple")return {subtasks:[e],reason:`Simple task (${i.reasoning}) - no decomposition needed`};this.emit("decomposing",{orchestratorId:this.orchestratorId,prompt:e,capabilities:r});try{let n=this.generateSubtasks(e),o=i.complexity==="complex"?7:3,s=n.slice(0,o);s.length===0&&s.push(e);let a=`Generated ${s.length} subtasks (${i.complexity}: ${i.reasoning})`;return this.emit("decomposed",{orchestratorId:this.orchestratorId,subtasks:s,count:s.length,reason:a}),{subtasks:s,reason:a}}catch(n){throw this.emit("decomposition_failed",{orchestratorId:this.orchestratorId,error:n instanceof Error?n.message:String(n)}),n}}generateSubtasks(e){let r=[],i=e.match(/```(?:typescript|javascript|py|python)?\n([\s\S]*?)```/g);if(i)for(let s of i.slice(1))s.trim()&&r.push(`Implement: ${s.trim()}`);if(r.length>0)return r;let n=e.match(/(?:in|from|create|update|modify)\s+['"`]([^'"`]+)['"`]/gi);if(n)for(let s of n){let a=s[1].replace(/['"`]/g,"");r.push(`Process file: ${a}`);}if(r.length>0)return r;let o=e.split(/\n\n|\n/).filter(s=>s.trim().length>0);for(let s of o.slice(0,3))s.trim()&&r.push(s.trim());return r.length===0&&r.push(e),r}estimateComplexity(e,r){let i=e.length/4,n=e.includes("```")||e.match(/```[\s\S]*?```/g)!==null,o=(e.match(/file/g)??[]).length>2;return !!(n||o||i>2e3||r.includes("planning")||r.includes("analysis"))}getState(){return super.getState()}};});var Wx,Yx,Xx,Qx=_(()=>{Wx=`
|
|
318
|
+
-- Orchestrators table
|
|
319
|
+
CREATE TABLE IF NOT EXISTS orchestrators (
|
|
320
|
+
id TEXT PRIMARY KEY,
|
|
321
|
+
role TEXT NOT NULL CHECK (role IN ('planning', 'execution')),
|
|
322
|
+
status TEXT NOT NULL CHECK (status IN ('active', 'idle', 'paused')),
|
|
323
|
+
last_heartbeat INTEGER,
|
|
324
|
+
capabilities TEXT,
|
|
325
|
+
provider_id TEXT,
|
|
326
|
+
model TEXT,
|
|
327
|
+
created_at INTEGER NOT NULL,
|
|
328
|
+
updated_at INTEGER NOT NULL
|
|
329
|
+
);
|
|
330
|
+
|
|
331
|
+
CREATE TABLE IF NOT EXISTS tasks (
|
|
332
|
+
id TEXT PRIMARY KEY,
|
|
333
|
+
orchestrator_id TEXT NOT NULL,
|
|
334
|
+
status TEXT NOT NULL CHECK (status IN ('queued', 'spawning', 'running', 'completing', 'completed', 'failed', 'cancelled')),
|
|
335
|
+
priority TEXT NOT NULL CHECK (priority IN ('high', 'normal', 'low')),
|
|
336
|
+
prompt TEXT NOT NULL,
|
|
337
|
+
provider TEXT,
|
|
338
|
+
model TEXT,
|
|
339
|
+
started_at INTEGER,
|
|
340
|
+
completed_at INTEGER,
|
|
341
|
+
exit_code INTEGER,
|
|
342
|
+
output TEXT,
|
|
343
|
+
error TEXT,
|
|
344
|
+
session TEXT,
|
|
345
|
+
retry_of TEXT,
|
|
346
|
+
attempt INTEGER DEFAULT 1,
|
|
347
|
+
created_at INTEGER NOT NULL,
|
|
348
|
+
FOREIGN KEY (orchestrator_id) REFERENCES orchestrators(id) ON DELETE CASCADE
|
|
349
|
+
);
|
|
350
|
+
|
|
351
|
+
CREATE TABLE IF NOT EXISTS queue (
|
|
352
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
353
|
+
task_id TEXT NOT NULL,
|
|
354
|
+
orchestrator_id TEXT NOT NULL,
|
|
355
|
+
priority INTEGER NOT NULL CHECK (priority IN (0, 1, 2)),
|
|
356
|
+
enqueued_at INTEGER NOT NULL,
|
|
357
|
+
scheduled_at INTEGER,
|
|
358
|
+
assigned_at INTEGER,
|
|
359
|
+
FOREIGN KEY (task_id) REFERENCES tasks(id) ON DELETE CASCADE,
|
|
360
|
+
FOREIGN KEY (orchestrator_id) REFERENCES orchestrators(id) ON DELETE CASCADE
|
|
361
|
+
);
|
|
362
|
+
|
|
363
|
+
CREATE TABLE IF NOT EXISTS routing_metrics (
|
|
364
|
+
provider_id TEXT PRIMARY KEY,
|
|
365
|
+
p50_latency REAL,
|
|
366
|
+
error_rate REAL,
|
|
367
|
+
successes INTEGER DEFAULT 0,
|
|
368
|
+
errors INTEGER DEFAULT 0,
|
|
369
|
+
consecutive_errors INTEGER DEFAULT 0,
|
|
370
|
+
last_used INTEGER,
|
|
371
|
+
last_error_at INTEGER,
|
|
372
|
+
updated_at INTEGER NOT NULL
|
|
373
|
+
);
|
|
374
|
+
|
|
375
|
+
CREATE TABLE IF NOT EXISTS flow_state (
|
|
376
|
+
session_id TEXT PRIMARY KEY,
|
|
377
|
+
flow_type TEXT NOT NULL CHECK (flow_type IN ('simple', 'decomposed', 'parallel', 'cascading')),
|
|
378
|
+
state_json TEXT NOT NULL,
|
|
379
|
+
current_step TEXT,
|
|
380
|
+
status TEXT NOT NULL CHECK (status IN ('pending', 'in_progress', 'completed', 'failed', 'paused')),
|
|
381
|
+
created_at INTEGER NOT NULL,
|
|
382
|
+
updated_at INTEGER NOT NULL
|
|
383
|
+
);
|
|
384
|
+
|
|
385
|
+
CREATE TABLE IF NOT EXISTS cache (
|
|
386
|
+
key TEXT PRIMARY KEY,
|
|
387
|
+
value TEXT NOT NULL,
|
|
388
|
+
expires_at INTEGER,
|
|
389
|
+
created_at INTEGER NOT NULL
|
|
390
|
+
);
|
|
391
|
+
|
|
392
|
+
CREATE INDEX IF NOT EXISTS idx_queue_priority ON queue(priority, enqueued_at);
|
|
393
|
+
CREATE INDEX IF NOT EXISTS idx_tasks_status ON tasks(status, started_at);
|
|
394
|
+
CREATE INDEX IF NOT EXISTS idx_tasks_session ON tasks(session, started_at);
|
|
395
|
+
CREATE INDEX IF NOT EXISTS idx_tasks_orchestrator ON tasks(orchestrator_id, status);
|
|
396
|
+
CREATE INDEX IF NOT EXISTS idx_flow_session ON flow_state(session_id);
|
|
397
|
+
CREATE INDEX IF NOT EXISTS idx_cache_expires ON cache(expires_at);
|
|
398
|
+
CREATE INDEX IF NOT EXISTS idx_routing_updated ON routing_metrics(updated_at);
|
|
399
|
+
`,Yx=`
|
|
400
|
+
DROP TABLE IF EXISTS queue;
|
|
401
|
+
DROP TABLE IF EXISTS tasks;
|
|
402
|
+
DROP TABLE IF EXISTS orchestrators;
|
|
403
|
+
DROP TABLE IF EXISTS routing_metrics;
|
|
404
|
+
DROP TABLE IF EXISTS flow_state;
|
|
405
|
+
DROP TABLE IF EXISTS cache;
|
|
406
|
+
`,Xx=`
|
|
407
|
+
DELETE FROM orchestrators;
|
|
408
|
+
DELETE FROM tasks;
|
|
409
|
+
DELETE FROM queue;
|
|
410
|
+
DELETE FROM routing_metrics;
|
|
411
|
+
DELETE FROM flow_state;
|
|
412
|
+
DELETE FROM cache;
|
|
413
|
+
`;});var Rz,Dz,En,Wc,tI=_(()=>{Qx();Rz=join(homedir(),".config","mcc"),Dz=join(Rz,"orchestration.db"),En=null,Wc=class t{db;constructor(e=Dz){this.db=new Az(e),this.db.pragma("journal_mode = WAL"),this.db.pragma("synchronous = NORMAL"),this.db.pragma("cache_size = -64000"),this.db.pragma("foreign_keys = ON");}static getInstance(e){return En??=new t(e),En}static resetInstance(){En&&(En.close(),En=null);}initialize(){this.db.exec(Wx);}dropAll(){this.db.exec(Yx);}truncateAll(){this.db.exec(Xx);}close(){this.db.close(),En===this&&(En=null);}get database(){return this.db}insertOrchestrator(e){let r=Date.now();this.db.prepare(`INSERT INTO orchestrators (id, role, status, last_heartbeat, capabilities, provider_id, model, created_at, updated_at)
|
|
414
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(e.id,e.role,e.status,e.last_heartbeat,JSON.stringify(e.capabilities),e.provider_id,e.model,r,r);}updateOrchestrator(e,r){let i=[],n=[];for(let[o,s]of Object.entries(r))i.push(`${o} = ?`),o==="capabilities"?n.push(JSON.stringify(s)):n.push(s);i.length>0&&(i.push("updated_at = ?"),n.push(Date.now()),n.push(e),this.db.prepare(`UPDATE orchestrators SET ${i.join(", ")} WHERE id = ?`).run(...n));}getOrchestrator(e){let r=this.db.prepare("SELECT * FROM orchestrators WHERE id = ?").get(e);if(r)return {...r,capabilities:r.capabilities}}getAllOrchestrators(){return this.db.prepare("SELECT * FROM orchestrators").all().map(r=>({...r,capabilities:r.capabilities}))}insertTask(e){let r=Date.now();this.db.prepare(`INSERT INTO tasks (id, orchestrator_id, status, priority, prompt, provider, model, started_at, completed_at, exit_code, output, error, session, retry_of, attempt, created_at)
|
|
415
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(e.id,e.orchestrator_id,e.status,e.priority,e.prompt,e.provider,e.model,e.started_at,e.completed_at,e.exit_code,e.output,e.error,e.session,e.retry_of,e.attempt,r);}updateTask(e,r){let i=[],n=[];for(let[o,s]of Object.entries(r))i.push(`${o} = ?`),n.push(s);i.length>0&&(n.push(e),this.db.prepare(`UPDATE tasks SET ${i.join(", ")} WHERE id = ?`).run(...n));}getTask(e){return this.db.prepare("SELECT * FROM tasks WHERE id = ?").get(e)}getTasksByStatus(e){return this.db.prepare("SELECT * FROM tasks WHERE status = ? ORDER BY created_at DESC").all(e)}getTasksBySession(e){return this.db.prepare("SELECT * FROM tasks WHERE session = ? ORDER BY created_at").all(e)}getTasksByOrchestrator(e){return this.db.prepare("SELECT * FROM tasks WHERE orchestrator_id = ? ORDER BY created_at DESC").all(e)}enqueueTask(e){let r=Date.now();return this.db.prepare(`INSERT INTO queue (task_id, orchestrator_id, priority, enqueued_at, scheduled_at, assigned_at)
|
|
416
|
+
VALUES (?, ?, ?, ?, ?, ?)`).run(e.task_id,e.orchestrator_id,e.priority,r,e.scheduled_at,e.assigned_at).lastInsertRowid}dequeueTask(e,r=1){return this.db.prepare(`SELECT * FROM queue
|
|
417
|
+
WHERE orchestrator_id = ?
|
|
418
|
+
ORDER BY priority ASC, enqueued_at ASC
|
|
419
|
+
LIMIT ?`).all(e,r)}removeFromQueue(e){this.db.prepare("DELETE FROM queue WHERE id = ?").run(e);}updateRoutingMetrics(e){let r=Date.now();this.db.prepare(`INSERT INTO routing_metrics (provider_id, p50_latency, error_rate, successes, errors, consecutive_errors, last_used, last_error_at, updated_at)
|
|
420
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
421
|
+
ON CONFLICT(provider_id) DO UPDATE SET
|
|
422
|
+
p50_latency = excluded.p50_latency,
|
|
423
|
+
error_rate = excluded.error_rate,
|
|
424
|
+
successes = excluded.successes,
|
|
425
|
+
errors = excluded.errors,
|
|
426
|
+
consecutive_errors = excluded.consecutive_errors,
|
|
427
|
+
last_used = excluded.last_used,
|
|
428
|
+
last_error_at = excluded.last_error_at,
|
|
429
|
+
updated_at = excluded.updated_at`).run(e.provider_id,e.p50_latency,e.error_rate,e.successes,e.errors,e.consecutive_errors,e.last_used,e.last_error_at,r);}getRoutingMetrics(e){return this.db.prepare("SELECT * FROM routing_metrics WHERE provider_id = ?").get(e)}getAllRoutingMetrics(){return this.db.prepare("SELECT * FROM routing_metrics ORDER BY updated_at DESC").all()}insertFlowState(e){let r=Date.now();this.db.prepare(`INSERT INTO flow_state (session_id, flow_type, state_json, current_step, status, created_at, updated_at)
|
|
430
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)`).run(e.session_id,e.flow_type,JSON.stringify(e.state_json),e.current_step,e.status,r,r);}updateFlowState(e,r){let i=[],n=[];for(let[o,s]of Object.entries(r))i.push(`${o} = ?`),o==="state_json"?n.push(JSON.stringify(s)):n.push(s);i.length>0&&(i.push("updated_at = ?"),n.push(Date.now()),n.push(e),this.db.prepare(`UPDATE flow_state SET ${i.join(", ")} WHERE session_id = ?`).run(...n));}getFlowState(e){let r=this.db.prepare("SELECT * FROM flow_state WHERE session_id = ?").get(e);if(r)return {...r,state_json:r.state_json}}deleteFlowState(e){this.db.prepare("DELETE FROM flow_state WHERE session_id = ?").run(e);}cacheSet(e,r,i){let n=Date.now();this.db.prepare(`INSERT INTO cache (key, value, expires_at, created_at)
|
|
431
|
+
VALUES (?, ?, ?, ?)
|
|
432
|
+
ON CONFLICT(key) DO UPDATE SET
|
|
433
|
+
value = excluded.value,
|
|
434
|
+
expires_at = excluded.expires_at`).run(e,JSON.stringify(r),i??null,n);}cacheGet(e){let r=this.db.prepare("SELECT * FROM cache WHERE key = ? AND (expires_at IS NULL OR expires_at > ?)").get(e,Date.now());if(!r)return null;try{return JSON.parse(r.value)}catch{return r.value}}cacheDel(e){this.db.prepare("DELETE FROM cache WHERE key = ?").run(e);}cacheClean(){return this.db.prepare("DELETE FROM cache WHERE expires_at IS NOT NULL AND expires_at < ?").run(Date.now()).changes}beginTransaction(){this.db.exec("BEGIN TRANSACTION");}commitTransaction(){this.db.exec("COMMIT");}rollbackTransaction(){this.db.exec("ROLLBACK");}};});var rv,Yc,nI=_(()=>{Pt();Gx();tI();rv={maxConcurrentAgents:3,taskTimeout:3e5,retryPolicy:{maxRetries:2,backoffMs:1e3,backoffMultiplier:2},modelRouting:{simple:"haiku",moderate:"sonnet",complex:"opus"}},Yc=class extends EventEmitter{tasks=new Map;config;cancelled=false;constructor(e){super(),this.config={...rv,...e,retryPolicy:{...rv.retryPolicy,...e?.retryPolicy},modelRouting:{...rv.modelRouting,...e?.modelRouting}};}async planExecution(e){let r=Wc.getInstance(),i=new Gc("orch_coordinator_plan",r),n=i.analyzeTaskComplexity(e),{subtasks:o}=i.decomposeTask(e,n.capabilities),s=pe("coord");return o.map(l=>{let u=i.analyzeTaskComplexity(l),d={taskId:pe("sub"),parentTaskId:s,prompt:l,tier:u.suggestedTier,status:"pending",retries:0};return this.tasks.set(d.taskId,d),d})}async executeTask(e){let{getOrchestrator:r}=await Promise.resolve().then(()=>(Pn(),Tn)),i=r();e.status="running",e.startedAt=new Date().toISOString(),this.emit("task:start",{taskId:e.taskId,tier:e.tier});let n=this.config.retryPolicy.maxRetries+1,o,s;for(let a=1;a<=n;a++){if(this.cancelled)return e.status="failed",e.error="Cancelled",e.completedAt=new Date().toISOString(),e;try{let l=await Promise.race([i.submit({prompt:e.prompt,provider:e.provider,model:e.model,timeout:this.config.taskTimeout}),this.createTimeout(e.taskId,u=>{s=u;})]);if(s&&(clearTimeout(s),s=void 0),l.exitCode===0)return e.status="completed",e.result=l.output,e.completedAt=new Date().toISOString(),this.emit("task:complete",{taskId:e.taskId,elapsed:l.elapsed}),e;o=`Exit code ${l.exitCode}: ${l.output.slice(0,200)}`;}catch(l){s&&(clearTimeout(s),s=void 0),o=l instanceof Error?l.message:String(l);}if(a<n){e.status="retrying",e.retries=a;let l=this.config.retryPolicy.backoffMs*Math.pow(this.config.retryPolicy.backoffMultiplier,a-1);await this.sleep(l);}}return e.status="failed",e.error=o??"Unknown error",e.completedAt=new Date().toISOString(),this.emit("task:failed",{taskId:e.taskId,error:e.error}),e}async executePlan(e){let r=[],i=[...e],n=new Set,o=async()=>{for(;i.length>0&&!this.cancelled;){if(n.size>=this.config.maxConcurrentAgents)return;let s=i.shift();if(!s)return;let l=(async()=>{let u=await this.executeTask(s);r.push(u);})().finally(()=>{n.delete(l);});n.add(l);}};for(;(i.length>0||n.size>0)&&!this.cancelled;)await o(),n.size>0&&await Promise.race([...n]);return n.size>0&&await Promise.allSettled([...n]),this.emit("plan:complete",{total:e.length,completed:r.filter(s=>s.status==="completed").length,failed:r.filter(s=>s.status==="failed").length}),r}getStatus(){let e=[...this.tasks.values()];return {total:e.length,pending:e.filter(r=>r.status==="pending").length,running:e.filter(r=>r.status==="running"||r.status==="assigned"||r.status==="retrying").length,completed:e.filter(r=>r.status==="completed").length,failed:e.filter(r=>r.status==="failed").length,tasks:e}}cancel(e){if(e){let r=this.tasks.get(e);r&&r.status!=="completed"&&r.status!=="failed"&&(r.status="failed",r.error="Cancelled by user",r.completedAt=new Date().toISOString());}else {this.cancelled=true;for(let r of this.tasks.values())r.status!=="completed"&&r.status!=="failed"&&(r.status="failed",r.error="Cancelled by user",r.completedAt=new Date().toISOString());}}createTimeout(e,r){return new Promise((i,n)=>{let o=setTimeout(()=>{n(new Error(`Task ${e} timed out after ${this.config.taskTimeout}ms`));},this.config.taskTimeout);r&&r(o);})}sleep(e){return new Promise(r=>setTimeout(r,e))}};});function zr(t,e,r,i){return {id:`env_${randomBytes(8).toString("hex")}`,channel:t,from:e,to:i?.to,correlationId:i?.correlationId,timestamp:Date.now(),payload:r,ack:i?.ack}}var Xc,iI=_(()=>{Xc=class{name;bufferSize;overflow;subscriptions=new Map;buffer=[];stats={published:0,delivered:0,dropped:0};constructor(e,r){this.name=e,this.bufferSize=r?.bufferSize??1e3,this.overflow=r?.overflow??"drop-oldest";}subscribe(e,r,i){let n=`sub_${randomBytes(8).toString("hex")}`,o={id:n,channel:this.name,agentId:e,handler:r,filter:i};return this.subscriptions.set(n,o),o}unsubscribe(e){return this.subscriptions.delete(e)}publish(e){this.stats.published++,this.buffer.push(e),this.enforceBuffer(),this.deliver(e);}getStats(){return {name:this.name,subscribers:this.subscriptions.size,published:this.stats.published,delivered:this.stats.delivered,dropped:this.stats.dropped,pending:this.buffer.length}}drain(){this.buffer.length=0;}deliver(e){for(let r of this.subscriptions.values())e.to&&e.to!==r.agentId||r.filter&&!r.filter(e)||(r.handler(e),this.stats.delivered++);}enforceBuffer(){for(;this.buffer.length>this.bufferSize;)if(this.overflow==="drop-oldest")this.buffer.shift(),this.stats.dropped++;else if(this.overflow==="drop-newest")this.buffer.pop(),this.stats.dropped++;else break}};});var Qc,oI=_(()=>{iI();Pt();Qc=class{agents=new Map;channels=new Map;pendingRequests=new Map;defaultChannelOpts;requestTimeout;constructor(e){this.defaultChannelOpts=e?.defaultChannelOpts??{},this.requestTimeout=e?.requestTimeout??3e4;}register(e,r,i){let n={agentId:e,taskId:r,capabilities:i,registeredAt:Date.now()};return this.agents.set(e,n),n}unregister(e){return this.agents.delete(e)}getAgent(e){return this.agents.get(e)}getAgents(){return [...this.agents.values()]}createChannel(e,r){let i=new Xc(e,r??this.defaultChannelOpts);return this.channels.set(e,i),i}getChannel(e){return this.channels.get(e)}ensureChannel(e,r){let i=this.channels.get(e);return i||this.createChannel(e,r)}publish(e,r,i,n){let o=this.getOrCreateChannel(e),s=zr(e,r,i,{to:n?.to});o.publish(s);}subscribe(e,r,i,n){return this.getOrCreateChannel(e).subscribe(r,i,n).id}unsubscribe(e,r){let i=this.channels.get(e);return i?i.unsubscribe(r):false}request(e,r,i,n,o){let s=pe("req"),a=this.getOrCreateChannel(e),l=zr(e,r,n,{to:i,correlationId:s});return new Promise((u,d)=>{let m=setTimeout(()=>{this.pendingRequests.delete(s),d(new Error(`Request timeout after ${o??this.requestTimeout}ms`));},o??this.requestTimeout),f={resolve:u,reject:d,timer:m,correlationId:s};this.pendingRequests.set(s,f),a.publish(l);})}reply(e,r,i){let n=e.correlationId;if(!n)return;let o=this.pendingRequests.get(n);if(!o){let a=this.getOrCreateChannel(e.channel),l=zr(e.channel,r,i,{to:e.from,correlationId:n});a.publish(l);return}clearTimeout(o.timer),this.pendingRequests.delete(n);let s=zr(e.channel,r,i,{to:e.from,correlationId:n});o.resolve(s);}broadcast(e,r){for(let[i,n]of this.channels){let o=zr(i,e,r);n.publish(o);}}getStats(){let e=[],r=0,i=0;for(let n of this.channels.values()){let o=n.getStats();e.push(o),r+=o.published,i+=o.delivered;}return {agents:this.agents.size,channels:e,totalPublished:r,totalDelivered:i,pendingRequests:this.pendingRequests.size}}shutdown(){for(let e of this.pendingRequests.values())clearTimeout(e.timer),e.reject(new Error("Bus shutdown"));this.pendingRequests.clear();for(let e of this.channels.values())e.drain();this.channels.clear(),this.agents.clear();}getOrCreateChannel(e){let r=this.channels.get(e);return r||this.createChannel(e)}};});var On,iv=_(()=>{Ee();Kx();Vx();Pt();nI();oI();vt();On=class extends EventEmitter{pool;router;bus;tasks=new Map;constructor(e){super(),this.pool=new Kc(e),this.router=new Vc,this.bus=new Qc,this.bus.ensureChannel("results"),this.bus.ensureChannel("coordination"),this.bus.ensureChannel("discovery"),this.pool.on("result",r=>{this.updateTask(r.taskId,{state:r.exitCode===0?"completed":"failed",completedAt:Date.now(),result:r}),this.router.recordLatency(r.provider,r.elapsed),this.bus.publish("results",r.taskId,{type:"task_result",taskId:r.taskId,provider:r.provider,model:r.model,exitCode:r.exitCode,elapsed:r.elapsed}),this.emit("result",r);}),this.pool.on("output",r=>{this.emit("output",r);}),this.pool.on("state",r=>{this.emit("state",r);});}async submit(e){if(this.shouldDecompose(e.prompt)){let r=await this.submitDecomposed(e);if(r)return r}return this.submitSingle(e)}shouldDecompose(e){return e.length<=200?false:/\band\b|\bthen\b|\n/.test(e)}async submitDecomposed(e){let r=new Yc,i=await r.planExecution(e.prompt);if(i.length<=1)return null;let n=pe("task");this.tasks.set(n,{taskId:n,prompt:e.prompt,provider:e.provider??"coordinator",model:e.model??"auto",state:"queued",startedAt:Date.now()}),this.emit("decomposed",{taskId:n,subtaskCount:i.length});try{let o=await r.executePlan(i),s=o.filter(d=>d.status==="completed"&&d.result).map(d=>d.result),a=o.some(d=>d.status==="failed"),l=s.join(`
|
|
435
|
+
---
|
|
436
|
+
`),u=$o(n,l||"No output from subtasks",a?1:0,Date.now()-(this.tasks.get(n)?.startedAt??Date.now()),e.provider??"coordinator",e.model??"auto");return this.updateTask(n,{state:a?"failed":"completed",completedAt:Date.now(),result:u}),this.emit("result",u),u}catch(o){let s=X(o);throw this.updateTask(n,{state:"failed",error:s}),o}}async submitSingle(e){let r=this.resolveProvider(e),i=pe("task");this.tasks.set(i,{taskId:i,prompt:e.prompt,provider:r.id,model:e.model??r.defaultModel,state:"queued",startedAt:Date.now()}),this.bus.register(i,i,e.capabilities),this.bus.publish("coordination",i,{type:"task_queued",provider:r.id}),this.emit("submit",{taskId:i,provider:r.id});try{let n=await this.pool.submit({provider:r,prompt:e.prompt,model:e.model,timeout:e.timeout,cwd:e.cwd});return this.updateTask(i,{state:n.exitCode===0?"completed":"failed",completedAt:Date.now(),result:n}),this.bus.unregister(i),n}catch(n){let o=X(n);throw this.updateTask(i,{state:"failed",error:o}),this.router.recordError(r.id),this.bus.publish("coordination",i,{type:"task_failed",error:o}),this.bus.unregister(i),n}}async fanOut(e){let r=this.resolveFanOutProviders(e),i=Math.min(e.count??r.length,r.length),o=r.slice(0,i).map(s=>this.submit({prompt:e.prompt,provider:s.id,timeout:e.timeout,capabilities:e.capabilities,cwd:e.cwd}));switch(e.strategy??"all"){case "first":return [await Promise.race(o)];case "best":{let a=(await Promise.allSettled(o)).filter(l=>l.status==="fulfilled").map(l=>l.value).filter(l=>l.exitCode===0).sort((l,u)=>l.elapsed-u.elapsed);return a.length>0?[a[0]]:[]}default:return (await Promise.allSettled(o)).filter(a=>a.status==="fulfilled").map(a=>a.value)}}cancel(e){let r=this.pool.cancel(e);return r&&this.updateTask(e,{state:"cancelled"}),r}async shutdown(e){await this.pool.drain(e),this.bus.shutdown(),this.emit("shutdown");}get status(){let r=st().map(i=>{let n=this.router.getMetrics(i.id);return {id:i.id,name:i.name,capabilities:this.getProviderCapabilities(i),p50Latency:n?.latencies.length?this.computeP50(n.latencies):null,errors:n?.errors??0,successes:n?.successes??0}});return {pool:this.pool.status,tasks:[...this.tasks.values()],bus:this.bus.getStats(),routing:{providers:r}}}getTask(e){return this.tasks.get(e)}setProviderCapabilities(e,r){this.router.setCapabilities(e,r);}resolveProvider(e){if(e.provider){let o=ot(e.provider);if(!o)throw new Error(`Provider not found: ${e.provider}`);if(!o.enabled)throw new Error(`Provider disabled: ${e.provider}`);return o}let r=st();if(r.length===0)throw new Error("No enabled providers");let i={capabilities:e.capabilities},n=this.router.route(r,i);if(!n)throw new Error("No provider matches required capabilities");return n}resolveFanOutProviders(e){if(e.providers?.length)return e.providers.map(n=>ot(n)).filter(n=>n?.enabled===true);let r=st(),i={capabilities:e.capabilities};return this.router.routeMultiple(r,i,e.count??r.length)}updateTask(e,r){let i=this.tasks.get(e);i&&Object.assign(i,r);}getProviderCapabilities(e){return {anthropic:["code","reasoning","long_context"],openai:["code","reasoning","vision"],local:["fast","cheap"],custom:["code"],perplexity:["reasoning"]}[e.type]??[]}computeP50(e){let r=[...e].sort((n,o)=>n-o),i=Math.floor(r.length/2);return r.length%2===0?(r[i-1]+r[i])/2:r[i]}};});var Tn={};ne(Tn,{fanOutWithRetry:()=>qz,getMetrics:()=>Uz,getOrchestrator:()=>Lz,resetMetrics:()=>Fz,shutdownOrchestrator:()=>jz,submitWithRetry:()=>Zz});function Lz(t){let e=t??{};return Cn&&JSON.stringify(ov)===JSON.stringify(e)||(Cn=new On(e),ov=e),Cn}async function jz(t){Cn&&(await Cn.shutdown(t),Cn=null,ov=null);}function Uz(){return {...xe}}function Fz(){xe.totalSubmits=0,xe.totalFanOuts=0,xe.totalRetries=0,xe.totalFailures=0;}async function Zz(t,e,r){xe.totalSubmits++;let i=null,n=r.backoffMs,o=r.maxBackoffMs??3e4;for(let s=0;s<=r.retries;s++)try{let a=await t.submit(e);if(a.exitCode===0)return a;if(s<r.retries){xe.totalRetries++,i=new Error(`Exit code ${a.exitCode}`),await tl(el(n),r.signal),n=Math.min(n*2,o);continue}return xe.totalFailures++,a}catch(a){if(i=a instanceof Error?a:new Error(String(a)),s<r.retries){xe.totalRetries++,await tl(el(n),r.signal),n=Math.min(n*2,o);continue}throw xe.totalFailures++,i}throw xe.totalFailures++,i??new Error("Retry exhausted")}async function qz(t,e,r){xe.totalFanOuts++;let i=null,n=r.backoffMs,o=r.maxBackoffMs??3e4;for(let s=0;s<=r.retries;s++)try{let a=await t.fanOut(e);if(a.some(u=>u.exitCode===0))return a;if(s>=r.retries)return xe.totalFailures++,a;xe.totalRetries++,i=new Error("All providers failed"),await tl(el(n),r.signal),n=Math.min(n*2,o);}catch(a){if(i=a instanceof Error?a:new Error(String(a)),s<r.retries){xe.totalRetries++,await tl(el(n),r.signal),n=Math.min(n*2,o);continue}throw xe.totalFailures++,i}throw xe.totalFailures++,i??new Error("Retry exhausted")}function el(t){return t*(.75+Math.random()*.5)}function sI(t){return t.reason instanceof Error?t.reason:new Error("Aborted")}function tl(t,e){return e?.aborted?Promise.reject(sI(e)):new Promise((r,i)=>{let n=setTimeout(r,t);if(!e)return;let o=()=>{clearTimeout(n),i(sI(e));};e.addEventListener("abort",o,{once:true});})}var Cn,ov,xe,Pn=_(()=>{iv();Cn=null,ov=null;xe={totalSubmits:0,totalFanOuts:0,totalRetries:0,totalFailures:0};});var aI=_(()=>{});var cI=_(()=>{});function nl(){return Bz}var Bz,lI=_(()=>{aI();cI();Bz=null;});var An={};ne(An,{addTask:()=>mI,addTaskCached:()=>i1,clearState:()=>n1,getActiveTasks:()=>Xz,getRecentTasks:()=>pI,getRecentTasksCached:()=>s1,getSessionTasks:()=>e1,getTask:()=>fI,getTaskCached:()=>o1,listSessions:()=>t1,loadState:()=>Ot,pruneOldTasks:()=>Qz,saveState:()=>wo,updateTask:()=>Yz});function Wz(){existsSync(rl)||mkdirSync(rl,{recursive:true});}function Ot(){if(!existsSync(sv))return {version:1,updatedAt:Date.now(),tasks:[]};try{let t=readFileSync(sv,"utf-8");return JSON.parse(t)}catch{return {version:1,updatedAt:Date.now(),tasks:[]}}}function wo(t){Wz(),t.updatedAt=Date.now(),writeFileSync(uI,JSON.stringify(t,null,2),"utf-8"),renameSync(uI,sv);}function mI(t){let e=Ot(),r=e.tasks.findIndex(i=>i.taskId===t.taskId);r>=0?e.tasks[r]=t:e.tasks.push(t),wo(e);}function Yz(t,e){let r=Ot(),i=r.tasks.find(n=>n.taskId===t);i&&(Object.assign(i,e),wo(r));}function fI(t){return Ot().tasks.find(r=>r.taskId===t)}function Xz(){return Ot().tasks.filter(e=>e.state==="queued"||e.state==="spawning"||e.state==="running")}function pI(t=20){return Ot().tasks.sort((r,i)=>i.startedAt-r.startedAt).slice(0,t)}function Qz(t=7){let e=Ot(),r=Date.now()-t*24*60*60*1e3,i=e.tasks.length;e.tasks=e.tasks.filter(o=>o.state==="running"||o.state==="queued"||o.startedAt>r);let n=i-e.tasks.length;return n>0&&wo(e),n}function e1(t){return Ot().tasks.filter(r=>r.session===t).sort((r,i)=>r.startedAt-i.startedAt)}function t1(){let t=Ot(),e=new Map;for(let r of t.tasks){let i=r.session??"(none)",n=e.get(i),o=r.completedAt??r.startedAt;n?(n.count++,o>n.lastActivity&&(n.lastActivity=o)):e.set(i,{count:1,lastActivity:o});}return [...e.entries()].map(([r,i])=>({name:r,...i}))}function n1(){wo({version:1,updatedAt:Date.now(),tasks:[]});}async function i1(t){let e=nl();if(e?.connected){await e.set(`${lv}${t.taskId}`,t);let r=await e.get(av)??[];if(r.includes(t.taskId)||(r.push(t.taskId),await e.set(av,r)),t.session){let i=`${r1}${t.session}`,n=await e.get(i)??[];n.includes(t.taskId)||(n.push(t.taskId),await e.set(i,n));}}mI(t);}async function o1(t){let e=nl();if(e?.connected){let r=await e.get(`${lv}${t}`);if(r)return r}return fI(t)}async function s1(t=20){let e=nl();if(e?.connected){let r=await e.get(av);if(r&&r.length>0){let i=[],n=r.slice(-t).reverse();for(let o of n){let s=await e.get(`${lv}${o}`);s&&i.push(s);}if(i.length>0)return i}}return pI(t)}var rl,sv,uI,lv,av,r1,Nn=_(()=>{lI();rl=join(homedir(),".config","mcc"),sv=join(rl,"state.json"),uI=join(rl,"state.json.tmp");lv="task:",av="tasks:all",r1="session:";});var $e={};ne($e,{EXIT:()=>F,headlessAddModel:()=>S1,headlessBatch:()=>h1,headlessBusStatus:()=>$1,headlessClearState:()=>b1,headlessConfig:()=>d1,headlessConfigure:()=>_1,headlessFanOut:()=>p1,headlessHealth:()=>l1,headlessLaunch:()=>c1,headlessList:()=>u1,headlessListModels:()=>w1,headlessPipe:()=>g1,headlessPoolStatus:()=>y1,headlessSpawn:()=>f1,headlessTest:()=>m1,headlessWatch:()=>v1});function R(t){process.stdout.write(t+`
|
|
437
|
+
`);}function he(t){process.stderr.write(`error: ${t}
|
|
438
|
+
`);}function ge(t){process.stderr.write(`info: ${t}
|
|
439
|
+
`);}function W(t){process.stdout.write(JSON.stringify(t,null,2)+`
|
|
440
|
+
`);}async function c1(t,e){let r=B(),i=t??Ke();i||(he("no provider specified and no default configured"),e.json&&W({ok:false,error:"no_provider",message:"No provider specified and no default configured"}),process.exit(F.CONFIG_ERROR));let n=ot(i);n||(he(`provider not found: ${i}`),e.json&&W({ok:false,error:"provider_not_found",provider:i}),process.exit(F.CONFIG_ERROR)),n.enabled||(he(`provider "${n.name}" is disabled`),e.json&&W({ok:false,error:"provider_disabled",provider:i}),process.exit(F.CONFIG_ERROR)),e.model&&(n.defaultModel=e.model),ge(`provider: ${n.name} (${n.id})`),ge(`model: ${n.defaultModel}`),n.endpoint&&ge(`endpoint: ${n.endpoint}`);let o=Bc(n),s=null;if(n.type==="local"&&n.endpoint){let d=r.proxy?.port??9e3,m=r.proxy?.host??"127.0.0.1";s={port:d,host:m,targetUrl:n.endpoint,model:n.defaultModel},ge("starting translation proxy...");try{await qc(s);let f=Zc(s);o.ANTHROPIC_BASE_URL=f,ge(`proxy: ${f} -> ${n.endpoint}`);}catch(f){let p=X(f);he(`proxy failed: ${p}`),e.json&&W({ok:false,error:"proxy_failed",message:p}),process.exit(F.ERROR);}}let a=Hc(),l=process.argv.includes("--")?process.argv.slice(process.argv.indexOf("--")+1):[],u=["--model",n.defaultModel,...l];ge(`launching: ${a} ${u.join(" ")}`);try{let d=await k1(a,u,o);s&&bo(),process.exit(d);}catch(d){s&&bo(),he(`launch failed: ${X(d)}`),process.exit(F.ERROR);}}async function l1(t,e){if(t){let o=ot(t);o||(he(`provider not found: ${t}`),e.json&&W({ok:false,error:"provider_not_found",provider:t}),process.exit(F.CONFIG_ERROR));let s=await Ye(o);if(e.json)W({provider:o.id,name:o.name,...s});else {let a=s.ok?"ok":"fail";R(`${o.id}: ${a} - ${s.message}${s.latencyMs?` (${s.latencyMs}ms)`:""}`),!s.ok&&s.suggestion&&R(` suggestion: ${s.suggestion}`);}process.exit(s.ok?F.SUCCESS:F.ERROR);}let r=st();r.length===0&&(he("no enabled providers"),e.json&&W({ok:false,error:"no_providers",providers:[]}),process.exit(F.CONFIG_ERROR));let i=await Ih(r),n=true;if(e.json){let o=[];for(let s of r){let a=i.get(s.id);a&&(o.push({provider:s.id,name:s.name,...a}),a.ok||(n=false));}W({ok:n,providers:o});}else for(let o of r){let s=i.get(o.id);if(s){let a=s.ok?"ok":"fail";R(`${o.id}: ${a} - ${s.message}${s.latencyMs?` (${s.latencyMs}ms)`:""}`),s.ok||(n=false,s.suggestion&&R(` suggestion: ${s.suggestion}`));}}process.exit(n?F.SUCCESS:F.ERROR);}function u1(t){let e=B(),r=Ke();if(t.json){let i=e.providers.map(n=>({id:n.id,name:n.name,type:n.type,enabled:n.enabled,default:n.id===r,model:n.defaultModel,endpoint:n.endpoint??null}));W({defaultProvider:r??null,providers:i});}else for(let i of e.providers){let n=i.enabled?"enabled":"disabled",o=i.id===r?" (default)":"";R(`${i.id}: ${i.name} [${n}]${o}`),R(` type=${i.type} model=${i.defaultModel}${i.endpoint?` endpoint=${i.endpoint}`:""}`);}process.exit(F.SUCCESS);}async function d1(t){let{getConfigFile:e}=await Promise.resolve().then(()=>(Ee(),bn)),{getCredentialsFile:r,listCredentials:i}=await Promise.resolve().then(()=>(bt(),kh)),n=B(),o=e(),s=r(),a=i(),l=Ke();t.json?W({configFile:o,credentialsFile:s,defaultProvider:l??null,providersTotal:n.providers.length,providersEnabled:n.providers.filter(u=>u.enabled).length,credentialsStored:a.length,credentials:a}):(R(`config: ${o}`),R(`credentials: ${s}`),R(`providers: ${n.providers.filter(u=>u.enabled).length} enabled / ${n.providers.length} total`),R(`default: ${l??"(none)"}`),a.length>0&&R(`stored credentials: ${a.join(", ")}`)),process.exit(F.SUCCESS);}async function m1(t,e){t||(he("provider ID required for headless test"),e.json&&W({ok:false,error:"missing_provider_id"}),process.exit(F.CONFIG_ERROR));let r=ot(t);r||(he(`provider not found: ${t}`),e.json&&W({ok:false,error:"provider_not_found",provider:t}),process.exit(F.CONFIG_ERROR)),ge(`testing: ${r.name} (${r.type})`),r.endpoint&&ge(`endpoint: ${r.endpoint}`);let i=Date.now(),n=await Ye(r),o=Date.now()-i;e.json?W({provider:r.id,name:r.name,type:r.type,endpoint:r.endpoint??null,model:r.defaultModel,elapsed:o,...n}):n.ok?(R(`ok: ${n.message} (${o}ms)`),n.models&&n.models.length>0&&R(`models: ${n.models.join(", ")}`)):(R(`fail: ${n.message} (${o}ms)`),n.suggestion&&R(`suggestion: ${n.suggestion}`)),process.exit(n.ok?F.SUCCESS:F.ERROR);}async function f1(t,e){let{getOrchestrator:r,submitWithRetry:i}=await Promise.resolve().then(()=>(Pn(),Tn)),{addTask:n}=await Promise.resolve().then(()=>(Nn(),An)),{serialize:o}=await Promise.resolve().then(()=>(Pt(),_o)),s=r(),a=e.timeout?parseInt(e.timeout,10):void 0,l=e.retries?parseInt(e.retries,10):0,u=e.backoff?parseInt(e.backoff,10):1e3;e.stream&&(s.on("output",d=>{process.stdout.write(o(d));}),s.on("state",d=>{process.stdout.write(o(d));})),ge(`submitting task to ${e.provider??"auto-routed provider"}`);try{let d={prompt:t,provider:e.provider,model:e.model,timeout:a,cwd:e.cwd},m=l>0?await i(s,d,{retries:l,backoffMs:u}):await s.submit(d);n({taskId:m.taskId,provider:m.provider,model:m.model,prompt:t,state:m.exitCode===0?"completed":"failed",startedAt:Date.now()-m.elapsed,completedAt:Date.now(),exitCode:m.exitCode,output:m.output,session:e.session}),e.stream?process.stdout.write(o(m)):e.json?W(m):m.exitCode===0?R(m.output):(he(`task failed with exit code ${m.exitCode}`),m.output&&R(m.output)),process.exit(m.exitCode===0?F.SUCCESS:F.ERROR);}catch(d){let m=X(d);he(m),(e.json||e.stream)&&W({ok:false,error:"spawn_failed",message:m}),process.exit(F.ERROR);}}async function p1(t,e){let{getOrchestrator:r,fanOutWithRetry:i}=await Promise.resolve().then(()=>(Pn(),Tn)),{serialize:n}=await Promise.resolve().then(()=>(Pt(),_o)),o=r(),s=e.providers?.split(",").map(f=>f.trim()),a=e.count?parseInt(e.count,10):void 0,l=e.timeout?parseInt(e.timeout,10):void 0,u=e.strategy??"all",d=e.retries?parseInt(e.retries,10):0,m=e.backoff?parseInt(e.backoff,10):1e3;e.stream&&(o.on("output",f=>{process.stdout.write(n(f));}),o.on("state",f=>{process.stdout.write(n(f));})),ge(`fan-out: strategy=${u} count=${a??"all"} providers=${s?.join(",")??"auto"}`);try{let f={prompt:t,providers:s,count:a,strategy:u,timeout:l,cwd:e.cwd},p=d>0?await i(o,f,{retries:d,backoffMs:m}):await o.fanOut(f);if(e.stream)for(let g of p)process.stdout.write(n(g));else if(e.json)W({ok:!0,count:p.length,results:p});else for(let g of p)R(`--- ${g.provider} (${g.model}) [${g.elapsed}ms, exit=${g.exitCode}] ---`),R(g.output),R("");let v=p.every(g=>g.exitCode===0);process.exit(v?F.SUCCESS:F.ERROR);}catch(f){let p=X(f);he(p),(e.json||e.stream)&&W({ok:false,error:"fanout_failed",message:p}),process.exit(F.ERROR);}}async function g1(t){let{createInterface:e}=await import('readline'),{getOrchestrator:r}=await Promise.resolve().then(()=>(Pn(),Tn)),{serialize:i,deserialize:n}=await Promise.resolve().then(()=>(Pt(),_o)),{addTask:o}=await Promise.resolve().then(()=>(Nn(),An)),s=t.concurrency?parseInt(t.concurrency,10):4,a=t.timeout?parseInt(t.timeout,10):void 0,l=r({maxConcurrency:s});l.on("output",m=>{process.stdout.write(i(m));}),l.on("state",m=>{process.stdout.write(i(m));});let u=e({input:process.stdin,crlfDelay:1/0}),d=[];u.on("line",m=>{let f=m.trim();if(!f)return;let p=n(f),v,g,y,S=a;p?.type==="spawn"&&"prompt"in p&&typeof p.prompt=="string"?(v=p.prompt,g=typeof p.provider=="string"?p.provider:void 0,y=typeof p.model=="string"?p.model:void 0):v=f;let E=l.submit({prompt:v,provider:g,model:y,timeout:S}).then(T=>{process.stdout.write(i(T)),o({taskId:T.taskId,provider:T.provider,model:T.model,prompt:v,state:T.exitCode===0?"completed":"failed",startedAt:Date.now()-T.elapsed,completedAt:Date.now(),exitCode:T.exitCode,output:T.output,session:t.session});}).catch(T=>{he(X(T));});d.push(E);}),await new Promise(m=>{u.on("close",m);}),await Promise.allSettled(d),await l.shutdown(5e3),process.exit(F.SUCCESS);}async function h1(t,e){let{readFileSync:r}=await import('fs'),{getOrchestrator:i,submitWithRetry:n}=await Promise.resolve().then(()=>(Pn(),Tn)),{serialize:o}=await Promise.resolve().then(()=>(Pt(),_o)),{addTask:s}=await Promise.resolve().then(()=>(Nn(),An)),a;try{a=r(t,"utf-8").split(`
|
|
441
|
+
`).filter(y=>y.trim());}catch(y){he(`cannot read file: ${X(y)}`),process.exit(F.CONFIG_ERROR);}let l=e.concurrency?parseInt(e.concurrency,10):4,u=e.timeout?parseInt(e.timeout,10):void 0,d=e.retries?parseInt(e.retries,10):0,m=e.backoff?parseInt(e.backoff,10):1e3,f=i({maxConcurrency:l});e.stream&&(f.on("output",y=>{process.stdout.write(o(y));}),f.on("state",y=>{process.stdout.write(o(y));})),ge(`batch: ${a.length} tasks, concurrency=${l}`);let p=[],v=a.map(async y=>{let S,E,T;try{let P=JSON.parse(y);S=P.prompt??y,E=P.provider,T=P.model;}catch{S=y;}let C={prompt:S,provider:E,model:T,timeout:u};try{let P=d>0?await n(f,C,{retries:d,backoffMs:m}):await f.submit(C);s({taskId:P.taskId,provider:P.provider,model:P.model,prompt:S,state:P.exitCode===0?"completed":"failed",startedAt:Date.now()-P.elapsed,completedAt:Date.now(),exitCode:P.exitCode,output:P.output,session:e.session}),e.stream&&process.stdout.write(o(P)),p.push({prompt:S.slice(0,80),taskId:P.taskId,exitCode:P.exitCode,elapsed:P.elapsed,provider:P.provider});}catch(P){he(`task failed: ${X(P)}`);}});if(await Promise.allSettled(v),e.json){let y=p.filter(S=>S.exitCode===0).length;W({ok:y===p.length,total:a.length,successes:y,failures:p.length-y,results:p});}else if(!e.stream){let y=p.filter(S=>S.exitCode===0).length;R(`batch complete: ${y}/${p.length} succeeded`);for(let S of p){let E=S.exitCode===0?"ok":"fail";R(` [${E}] ${S.taskId} ${S.provider} ${S.elapsed}ms "${S.prompt}"`);}}let g=p.every(y=>y.exitCode===0);process.exit(g?F.SUCCESS:F.ERROR);}async function v1(t,e){let{getTask:r}=await Promise.resolve().then(()=>(Nn(),An)),i=r(t);i||(he(`task not found: ${t}`),process.exit(F.ERROR)),e.json?W(i):(R(`task: ${i.taskId}`),R(`provider: ${i.provider} model: ${i.model}`),R(`state: ${i.state}`),R(`prompt: ${i.prompt}`),i.session&&R(`session: ${i.session}`),i.startedAt&&R(`started: ${new Date(i.startedAt).toISOString()}`),i.completedAt&&(R(`completed: ${new Date(i.completedAt).toISOString()}`),R(`duration: ${i.completedAt-i.startedAt}ms`)),i.exitCode!==void 0&&R(`exit: ${i.exitCode}`),i.error&&R(`error: ${i.error}`),i.output&&(R("--- output ---"),R(i.output))),process.exit(F.SUCCESS);}async function y1(t){let{getRecentTasks:e,getActiveTasks:r,getSessionTasks:i,listSessions:n}=await Promise.resolve().then(()=>(Nn(),An));if(t.session){let l=i(t.session);if(t.json)W({session:t.session,count:l.length,tasks:l});else {R(`session "${t.session}": ${l.length} tasks`);for(let u of l){let d=u.completedAt?`${u.completedAt-u.startedAt}ms`:"running";R(` ${u.taskId}: ${u.provider} [${u.state}] ${d} "${u.prompt.slice(0,50)}"`);}}process.exit(F.SUCCESS);}let o=r(),s=e(10),a=n();if(t.json)W({active:o,recent:s,sessions:a});else {if(o.length>0){R(`active tasks: ${o.length}`);for(let l of o)R(` ${l.taskId}: ${l.provider} [${l.state}] "${l.prompt.slice(0,60)}"`);}else R("no active tasks");if(s.length>0){R(`
|
|
442
|
+
recent tasks:`);for(let l of s){let u=l.completedAt?`${l.completedAt-l.startedAt}ms`:"running",d=l.session?` (${l.session})`:"";R(` ${l.taskId}: ${l.provider} [${l.state}] ${u}${d}`);}}if(a.length>0){R(`
|
|
443
|
+
sessions:`);for(let l of a)R(` ${l.name}: ${l.count} tasks, last activity ${new Date(l.lastActivity).toISOString()}`);}}process.exit(F.SUCCESS);}async function b1(t){let{clearState:e,pruneOldTasks:r}=await Promise.resolve().then(()=>(Nn(),An));if(t.json)e(),W({ok:true,message:"state cleared"});else {let i=r(0);R(`cleared ${i} tasks`);}process.exit(F.SUCCESS);}async function $1(t){let{getOrchestrator:e}=await Promise.resolve().then(()=>(Pn(),Tn)),i=e().bus.getStats();if(t.json)W(i);else if(R(`agents: ${i.agents}`),R(`channels: ${i.channels.length}`),R(`published: ${i.totalPublished}`),R(`delivered: ${i.totalDelivered}`),R(`pending requests: ${i.pendingRequests}`),i.channels.length>0){R("");for(let n of i.channels)R(` [${n.name}] subs=${n.subscribers} pending=${n.pending} pub=${n.published} del=${n.delivered}`);}process.exit(F.SUCCESS);}async function _1(t,e){let{getProviderForEdit:r,updateProviderModels:i,setTierModels:n,addModelToProvider:o,enableProvider:s,setDefaultProvider:a}=await Promise.resolve().then(()=>(zc(),Jh));if(r(t)||(he(`provider not found: ${t}`),e.json&&W({ok:false,error:"provider_not_found",provider:t}),process.exit(F.CONFIG_ERROR)),e.enable){let d=e.enable==="true"||e.enable==="1";s(t,d),ge(`provider ${d?"enabled":"disabled"}: ${t}`);}if(e.default&&(a(t),ge(`set as default provider: ${t}`)),e.model&&(o(t,e.model),i(t,{defaultModel:e.model}),ge(`default model set: ${e.model}`)),e.opus||e.sonnet||e.haiku){let d={};e.opus&&(d.opusModel=e.opus,ge(`opus model: ${e.opus}`)),e.sonnet&&(d.sonnetModel=e.sonnet,ge(`sonnet model: ${e.sonnet}`)),e.haiku&&(d.haikuModel=e.haiku,d.smallFastModel=e.haiku,ge(`haiku model: ${e.haiku}`)),n(t,d);}if(e.endpoint||e.timeout){let d={};e.endpoint&&(d.endpoint=e.endpoint,ge(`endpoint: ${e.endpoint}`)),e.timeout&&(d.timeout=parseInt(e.timeout,10),ge(`timeout: ${d.timeout}ms`)),i(t,d);}let u=r(t);e.json?W({ok:true,provider:u}):R("provider updated successfully"),process.exit(F.SUCCESS);}async function S1(t,e,r){let{addModelToProvider:i}=await Promise.resolve().then(()=>(zc(),Jh));ot(t)||(he(`provider not found: ${t}`),r.json&&W({ok:false,error:"provider_not_found",provider:t}),process.exit(F.CONFIG_ERROR)),i(t,e)?(r.json?W({ok:true,provider:t,model:e,action:"added"}):ge(`model "${e}" added to ${t}`),process.exit(F.SUCCESS)):(he("failed to add model"),r.json&&W({ok:false,error:"add_failed",provider:t,model:e}),process.exit(F.ERROR));}async function w1(t,e){let r=B();if(t){let i=ot(t);i||(he(`provider not found: ${t}`),process.exit(F.CONFIG_ERROR));let n=i.models||[];if(e.json)W({provider:t,default:i.defaultModel,models:n,tiers:{opus:i.envVars?.ANTHROPIC_DEFAULT_OPUS_MODEL,sonnet:i.envVars?.ANTHROPIC_DEFAULT_SONNET_MODEL,haiku:i.envVars?.ANTHROPIC_DEFAULT_HAIKU_MODEL}});else {R(`Provider: ${i.name}`),R(`Default: ${i.defaultModel}`),R(""),R("Models:");for(let o of n){let s=o===i.defaultModel?" *":"";R(` ${o}${s}`);}}}else {let i={};for(let n of r.providers)i[n.id]={default:n.defaultModel,models:n.models||[]};if(e.json)W(i);else for(let n of r.providers){if(R(`${n.name}: ${n.defaultModel}`),n.models)for(let o of n.models)R(` ${o}`);R("");}}process.exit(F.SUCCESS);}function k1(t,e,r){return new Promise((i,n)=>{let o=spawn(t,e,{env:r,stdio:"inherit",shell:process.platform==="win32"});o.on("error",s=>{n(new Error(`Failed to launch Claude Code: ${s.message}`));}),o.on("exit",s=>{i(s??F.ERROR);}),process.on("SIGINT",()=>{o.kill("SIGINT");}),process.on("SIGTERM",()=>{o.kill("SIGTERM");});})}var F,_e=_(()=>{Yh();Ee();Qt();vt();Qh();F={SUCCESS:0,ERROR:1,CONFIG_ERROR:2,SIGNAL:130};});var NI={};ne(NI,{checkAndRunFirstRun:()=>gv,isFirstRun:()=>EI,runSetupWizard:()=>TI});function EI(){return !existsSync(z1)}async function TI(){console.clear(),console.log(`
|
|
444
|
+
${c.dim("\u256D"+"\u2500".repeat(62)+"\u256E")}
|
|
445
|
+
${c.dim("\u2502")} ${ae("Welcome to MCC v"+Se)}${" ".repeat(34)}${c.dim("\u2502")}
|
|
446
|
+
${c.dim("\u2502")} ${c.dim("Multi-Client Coder for Claude")}${" ".repeat(26)}${c.dim("\u2502")}
|
|
447
|
+
${c.dim("\u2570"+"\u2500".repeat(62)+"\u256F")}
|
|
448
|
+
|
|
449
|
+
${c.dim("This wizard will help you:")}
|
|
450
|
+
${c.dim(" 1.")} Choose and configure a provider
|
|
451
|
+
${c.dim(" 2.")} Set up your API credentials
|
|
452
|
+
${c.dim(" 3.")} Launch Claude Code
|
|
453
|
+
|
|
454
|
+
`);let{wantSetup:t}=await L1("Ready to get started?",true);if(!t){console.log(c.dim(`
|
|
455
|
+
You can run "mcc" anytime to configure providers.
|
|
456
|
+
`));return}await PI();}async function L1(t,e){return {wantSetup:await me({message:t,default:e})}}async function PI(){switch(console.log(c.dim(`
|
|
457
|
+
\u250C\u2500 Choose Setup Path \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510`)),await Te({message:c.dim("How would you like to proceed?"),choices:[{name:`${$.rocket} Quick Setup`,value:"quick",description:"Configure a popular provider in 30 seconds"},{name:`${$.settings} Full Setup`,value:"full",description:"Choose from all providers with custom options"},{name:`${$.globe} Local Only`,value:"local",description:"Use LM Studio or local server (no API key needed)"},{name:c.dim("Skip for now"),value:"skip",description:'Configure manually later with "mcc config"'}]})){case "quick":await j1();break;case "full":await U1();break;case "local":await Z1();break;case "skip":console.log(c.dim(`
|
|
458
|
+
Run "mcc" anytime to configure providers.
|
|
459
|
+
`));break}}async function j1(){console.log(c.dim(`
|
|
460
|
+
\u250C\u2500 Quick Setup \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510`)),console.log(c.dim(" \u2502")+c.dim(" Select a provider to configure")+c.dim(" \u2502")),console.log(c.dim(" \u2514"+"\u2500".repeat(56)+`\u2518
|
|
461
|
+
`));let t=fv.map(i=>({name:` ${i.name}`,value:i.id,description:c.dim(i.description)}));t.push({name:c.dim(" \u2190 Back"),value:"_back",description:""});let e=await Te({message:c.dim("Select provider:"),choices:t});if(e==="_back")return PI();let r=fv.find(i=>i.id===e);r&&await OI(r);}async function OI(t){console.log(c.dim(`
|
|
462
|
+
\u250C\u2500 Configure ${t.name} \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510`)),console.log(c.dim(" \u2502")+c.dim(` ${t.tip}`.padEnd(55)+c.dim("\u2502"))),console.log(c.dim(" \u2514"+"\u2500".repeat(56)+`\u2518
|
|
463
|
+
`));let e=Xt(t.envVar);if(e!=="none"&&(console.log(c.success(` ${$.success} Found existing credential (${e})`)),await me({message:"Use existing credential?",default:true})))return pv(t.id);console.log(c.dim(` Get your API key: ${t.getUrl}
|
|
464
|
+
`));let r=await xI({message:"Enter your API key:",mask:"*",validate:n=>!n||n.trim().length===0?"API key is required":t.validate(n.trim())?true:"Invalid API key format"}),i=II({text:c.dim("Saving credential..."),color:"cyan"}).start();try{await at(t.envVar,r.trim()),i.succeed(c.success(" Credential saved securely"));}catch(n){i.fail(c.error(" Failed to save credential")),console.error(c.error(` ${n instanceof Error?n.message:"Unknown error"}`));return}await pv(t.id);}async function pv(t){let e=B(),r=e.providers.find(s=>s.id===t);if(!r){console.log(c.error(" Provider not found"));return}let i=II({text:c.dim("Verifying connection..."),color:"cyan"}).start();r.enabled=true,Fe(e);let n=await Ye(r);i.stop(),n.ok?(console.log(c.success(`
|
|
465
|
+
${$.success} Connection verified!`)),n.latencyMs&&console.log(c.dim(` Latency: ${n.latencyMs}ms`))):(console.log(c.warning(`
|
|
466
|
+
${$.warning} Could not verify connection`)),console.log(c.dim(` ${n.message}`)),console.log(c.dim(` You can still use this provider - it may work at runtime.
|
|
467
|
+
`)));let o=await me({message:`Set ${r.name} as default provider?`,default:true});o&&(yn(t),console.log(c.success(` ${$.success} Default provider set`))),await CI(r,o);}async function CI(t,e){console.log(`
|
|
468
|
+
${c.dim("\u256D"+"\u2500".repeat(62)+"\u256E")}
|
|
469
|
+
${c.dim("\u2502")} ${ae("Setup Complete!")}${" ".repeat(44)}${c.dim("\u2502")}
|
|
470
|
+
${c.dim("\u2570"+"\u2500".repeat(62)+"\u256F")}
|
|
471
|
+
|
|
472
|
+
${c.success($.success+" Provider:")} ${t.name}
|
|
473
|
+
${c.success($.success+" Model:")} ${t.defaultModel}
|
|
474
|
+
${e?c.success($.star+" Default: Yes"):c.dim(" Default: No")}
|
|
475
|
+
|
|
476
|
+
${c.dim("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")}
|
|
477
|
+
|
|
478
|
+
${c.dim("Next steps:")}
|
|
479
|
+
${c.dim(" 1.")} Run ${c.primary("mcc")} to launch Claude Code
|
|
480
|
+
${c.dim(" 2.")} Or use ${c.primary(`mcc quick ${t.id}`)} to skip the menu
|
|
481
|
+
${c.dim(" 3.")} Configure more providers with ${c.primary("mcc config")}
|
|
482
|
+
|
|
483
|
+
${c.dim("Need help?")} Run ${c.primary("mcc --help")} or visit:
|
|
484
|
+
${c.dim(" https://github.com/velocity-digital/mcc#readme")}
|
|
485
|
+
`),await me({message:"Launch Claude Code now?",default:true})&&console.log(c.dim(`
|
|
486
|
+
Starting MCC menu...
|
|
487
|
+
`));}async function U1(){console.log(c.dim(`
|
|
488
|
+
Full setup from all providers...
|
|
489
|
+
`));let t=B(),e=t.providers.map(n=>({name:` ${n.enabled?c.success("\u25CF"):c.dim("\u25CB")} ${n.name}`,value:n.id,description:c.dim(n.description??"")})),r=await Te({message:c.dim("Select provider to configure:"),choices:e}),i=t.providers.find(n=>n.id===r);if(i)if(i.type==="local")await AI(i);else {let n=fv.find(o=>o.id===r);n?await OI(n):await F1(i);}}async function AI(t){console.log(c.dim(`
|
|
490
|
+
Configuring ${t.name}...
|
|
491
|
+
`));let e=await uv({message:"Endpoint URL:",default:t.endpoint??"http://localhost:1234/v1",validate:s=>{try{return new URL(s),!0}catch{return "Invalid URL format"}}}),r=await uv({message:"Model name:",default:t.defaultModel}),i=B(),n=i.providers.findIndex(s=>s.id===t.id);n>=0&&(i.providers[n].endpoint=e,i.providers[n].defaultModel=r,i.providers[n].enabled=true,Fe(i)),console.log(c.success(`
|
|
492
|
+
${$.success} ${t.name} configured`));let o=await me({message:"Set as default provider?",default:false});o&&yn(t.id),await CI(i.providers[n],o);}async function F1(t){let e=t.auth.tokenEnv??t.auth.apiKeyEnv??"";console.log(c.dim(`
|
|
493
|
+
Configuring ${t.name}...
|
|
494
|
+
`));let r=await xI({message:`Enter API key${e?` (${e})`:""}:`,mask:"*",validate:o=>o.trim().length>0||"API key is required"});e&&await at(e,r.trim());let i=B(),n=i.providers.findIndex(o=>o.id===t.id);n>=0&&(i.providers[n].enabled=true,Fe(i)),await pv(t.id);}async function Z1(){console.log(c.dim(`
|
|
495
|
+
\u250C\u2500 Local Provider Setup \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510`)),console.log(c.dim(" \u2502")+c.dim(" Configure LM Studio or a local server")+c.dim(" \u2502")),console.log(c.dim(" \u2514"+"\u2500".repeat(56)+`\u2518
|
|
496
|
+
`));let e=B().providers.filter(o=>o.type==="local");if(e.length===0){console.log(c.warning(" No local providers available"));return}let r=e.map(o=>({name:` ${o.name}`,value:o.id,description:c.dim(o.description??"")})),i=await Te({message:c.dim("Select local provider:"),choices:r}),n=e.find(o=>o.id===i);n&&await AI(n);}async function gv(){if(!EI())return false;let e=B().providers.filter(i=>i.enabled).length,r=wc();return e>0||r?false:(await TI(),true)}var z1,fv,hv=_(()=>{Ee();bt();Qt();qe();z1=join(homedir(),".config","mcc","config.yaml"),fv=[{id:"claude-max",name:"Claude Max / Anthropic",description:"Official Claude API with bearer token",envVar:"ANTHROPIC_AUTH_TOKEN",getUrl:"https://console.anthropic.com/",tip:'Run "claude setup-token" or get API key from console.anthropic.com',validate:t=>t.startsWith("sk-ant-")||t.length>20},{id:"zai-coding-plan",name:"Z.AI GLM",description:"GLM-5 series (Opus: glm-5, Sonnet: glm-4.7)",envVar:"ZAI_API_KEY",getUrl:"https://z.ai/subscribe",tip:"Sign up at z.ai and create an API key",validate:t=>t.length>10},{id:"deepinfra",name:"DeepInfra",description:"Multi-model API (Claude, GLM, Llama, Qwen)",envVar:"DEEPINFRA_API_KEY",getUrl:"https://deepinfra.com/",tip:"Create API key at deepinfra.com/dash/api_keys",validate:t=>t.length>10}];});var RI=_(()=>{});var DI=_(()=>{Xe();Dr();Cc();jh();tn();RI();});var LI={};ne(LI,{generatePlan:()=>zI,runAutopilot:()=>q1});async function q1(t){let e=be(),r=await e.detectWorkspace(t.workspace),i=t.provider??"auto",n=t.model,o=e.createSession({workspace:r.root,provider:i,model:n??"auto",metadata:{title:t.prompt.slice(0,50)+(t.prompt.length>50?"...":""),tags:["autopilot"],description:t.prompt}});e.addMessage(o.sessionId,"user",t.prompt);let s=zI(t.prompt);if(s.tasks.length===0)return await B1(o,t,r);let a=new On({maxConcurrency:1});try{let l=0,u=[];for(let m of s.tasks){let p={prompt:H1(m,t.prompt),provider:t.provider,model:t.model,timeout:t.timeout??3e5,cwd:r.root};e.addMessage(o.sessionId,"system",`Executing task: ${m.description}`);try{let v=await a.submit(p);v.exitCode===0?(l++,e.addMessage(o.sessionId,"assistant",v.output||"Task completed successfully"),u.push(`\u2713 ${m.description}`)):(e.addMessage(o.sessionId,"system",`Task failed: ${v.output||"Unknown error"}`),u.push(`\u2717 ${m.description}: ${v.output||"Failed"}`));}catch(v){let g=v instanceof Error?v.message:String(v);u.push(`\u2717 ${m.description}: ${g}`);}}let d=l===s.tasks.length;if(t.exportOnComplete){let m=t.exportFile??resolve(process.cwd(),`mcc-autopilot-${o.sessionId}.json`);Uc(o.sessionId,m,{includeMessages:!0,includeFiles:!0});}return {success:d,iterations:s.tasks.length,sessionId:o.sessionId,summary:u.join(`
|
|
497
|
+
`),output:u.join(`
|
|
498
|
+
`),exitCode:d?0:1}}finally{await a.shutdown();}}function zI(t,e){let r=[],i=t.toLowerCase();return (i.includes("create")||i.includes("add")||i.includes("implement"))&&r.push({id:randomUUID().slice(0,8),description:`Implement: ${Io(t)}`,type:"create",files:ol(t),priority:"high",prompt:t}),(i.includes("fix")||i.includes("bug")||i.includes("error"))&&r.push({id:randomUUID().slice(0,8),description:`Fix: ${Io(t)}`,type:"modify",files:ol(t),priority:"high",prompt:t}),(i.includes("refactor")||i.includes("clean up")||i.includes("improve"))&&r.push({id:randomUUID().slice(0,8),description:`Refactor: ${Io(t)}`,type:"modify",files:ol(t),priority:"medium",prompt:t}),(i.includes("test")||i.includes("verify")||i.includes("check"))&&r.push({id:randomUUID().slice(0,8),description:`Test/Verify: ${Io(t)}`,type:"test",files:ol(t),priority:"medium",prompt:t}),r.length===0&&r.push({id:randomUUID().slice(0,8),description:`Task: ${Io(t)}`,type:"create",files:[],priority:"medium",prompt:t}),{tasks:r,dependencies:[],estimatedSteps:r.length}}async function B1(t,e,r){let i=new On({maxConcurrency:1});try{let n={prompt:e.prompt,provider:e.provider,model:e.model,timeout:e.timeout??3e5,cwd:r.root},o=await i.submit(n),s=o.exitCode===0,a=o.output||"No output";if(be().addMessage(t.sessionId,"assistant",a),e.exportOnComplete){let l=e.exportFile??resolve(process.cwd(),`mcc-autopilot-${t.sessionId}.json`);Uc(t.sessionId,l,{includeMessages:!0,includeFiles:!0});}return {success:s,iterations:1,sessionId:t.sessionId,summary:a,output:o.output||void 0,error:s?void 0:o.output,exitCode:o.exitCode}}finally{await i.shutdown();}}function H1(t,e){return `
|
|
499
|
+
You are working on the following task: ${t.description}
|
|
500
|
+
|
|
501
|
+
Original request: ${e}
|
|
502
|
+
|
|
503
|
+
${t.files.length>0?`Files mentioned: ${t.files.join(", ")}`:""}
|
|
504
|
+
|
|
505
|
+
Please complete this task. Make code changes as needed. If you create new files, use standard conventions for the project.
|
|
506
|
+
`.trim()}function Io(t){let e=t.replace(/^(please|can you|could you|i need|i want|help me)\s+/i,"").replace(/^(create|add|implement|fix|refactor|build|make)\s+/i,"").trim();return e.length>60&&(e=e.slice(0,57)+"..."),e||"Task"}function ol(t){let e=/[\w-]+\.[a-z]{2,4}/gi,r=t.match(e)??[];return [...new Set(r)]}var jI=_(()=>{DI();iv();Dr();});var vv={};ne(vv,{showProviderStatus:()=>G1,switchProvider:()=>J1});async function J1(t){console.log(ae(`
|
|
507
|
+
Switch Provider`)),console.log(H(50)),existsSync(sl)||(console.log(c.dim(`
|
|
508
|
+
No active MCC session found.`)),console.log(c.dim(` Make sure you launched Claude using "mcc launch".
|
|
509
|
+
`)),process.exit(1));let e;try{let s=readFileSync(sl,"utf-8");e=JSON.parse(s);}catch{console.log(c.dim(`
|
|
510
|
+
No active MCC session found.
|
|
511
|
+
`)),process.exit(1);}let i=e.providers[e.activeProvider]?.name??e.activeProvider;if(!(t.id in e.providers)){console.log(c.warning(`
|
|
512
|
+
${$.warning} Provider "${t.name}" is not configured in the active session.`)),console.log(c.dim(" Available providers:"));for(let[s,a]of Object.entries(e.providers)){let u=s===e.activeProvider?c.primary("\u2192"):" ";console.log(` ${u} ${c.primary(a.name)} (${c.dim(s)})`);}console.log(""),process.exit(1);}let o=`http://127.0.0.1:${process.env.MCC_PROXY_PORT?parseInt(process.env.MCC_PROXY_PORT,10):9e3}/mcc/switch`;try{let s=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t.id})});if(!s.ok){let l=await s.json().catch(()=>({error:"Unknown error"}));console.log(c.error(`
|
|
513
|
+
${$.error} Failed to switch provider:`)),console.log(c.dim(` ${JSON.stringify(l)}
|
|
514
|
+
`)),process.exit(1);}let a=await s.json();console.log(` ${c.success("\u2714")} Provider switched:`),console.log(` ${c.dim("From:")} ${c.subtle(i)}`),console.log(` ${c.dim("To:")} ${c.primary(a.provider.name)}`),console.log(` ${c.dim("Model:")} ${c.subtle(a.provider.model)}`),console.log(H(50)),console.log(c.dim(`
|
|
515
|
+
Next request will use the new provider.
|
|
516
|
+
`));}catch{console.log(c.error(`
|
|
517
|
+
${$.error} Failed to connect to proxy.`)),console.log(c.dim(` Make sure Claude was launched with "mcc launch"
|
|
518
|
+
`)),process.exit(1);}}function G1(){if(!existsSync(sl)){console.log(c.dim(`
|
|
519
|
+
No active MCC session found.
|
|
520
|
+
`));return}let t;try{let n=readFileSync(sl,"utf-8");t=JSON.parse(n);}catch{console.log(c.dim(`
|
|
521
|
+
No active MCC session found.
|
|
522
|
+
`));return}let e=t.providers[t.activeProvider],r=e?.name??t.activeProvider,i=e?.model??"unknown";console.log(ae(`
|
|
523
|
+
Active Provider`)),console.log(H(50)),console.log(` ${c.dim("Provider:")} ${c.primary(r)}`),console.log(` ${c.dim("Model:")} ${c.subtle(i)}`),console.log(H(50)),console.log(c.dim(`
|
|
524
|
+
Available providers:`));for(let[n,o]of Object.entries(t.providers)){let s=n===t.activeProvider,a=s?c.primary("\u2192"):" ",l=s?c.primary(o.name):o.name;console.log(` ${a} ${l} ${c.dim(`(${o.model})`)}`);}console.log("");}var sl,yv=_(()=>{qe();sl=join(homedir(),".config","mcc",".proxy-control.json");});St();qe();var kE="https://api.github.com/repos/velocity-digital/mcc/releases/latest",xE="https://github.com/velocity-digital/mcc/releases/download";async function Bv(){let{default:t}=await import('update-notifier'),e=t({pkg:{name:"@velocity-digital/mcc",version:Se},updateCheckInterval:1e3*60*60*24,shouldNotifyInNpmScript:true});if(e.update?.version){let r=`${$.warning} Update available: ${Se} \u2192 ${e.update.version}`;console.log(c.warning(`
|
|
525
|
+
${r}`)),console.log(c.dim(` Run ${c.primary("mcc update")} to upgrade
|
|
526
|
+
`));}}function pl(){let t=platform();return t==="darwin"?"macos":t==="win32"?"windows":"linux"}function IE(){let t=process.arch;return t==="arm64"||t==="aarch64"?"arm64":"x64"}function EE(){let t=pl(),e=IE();return t==="macos"?e==="arm64"?"mcc-v2-macos-arm64.tar.gz":"mcc-v2-macos-x64.tar.gz":t==="linux"?e==="arm64"?"mcc-v2-ubuntu-arm64.tar.gz":"mcc-v2-ubuntu-x64.tar.gz":"mcc-v2-windows-x64.zip"}function Hv(){let t=pl(),e=homedir();return t==="windows"?process.env.LOCALAPPDATA||join(e,"AppData","Local"):join(e,".local","bin")}function TE(){let t=Hv(),r=pl()==="windows"?"mcc.exe":"mcc";return join(t,"mcc",r)}function Kv(t,e){try{let r=readdirSync(t);for(let i of r){let n=join(t,i);if(statSync(n).isDirectory()){let s=Kv(n,e);if(s)return s}else if(i===e||e==="mcc"&&i==="mcc.exe")return n}}catch{}return null}async function PE(t){return new Promise(e=>{let r=spawn(t,["--version"],{shell:process.platform==="win32"}),i="";r.stdout.on("data",n=>{i+=n;}),r.stderr.on("data",()=>{}),r.on("close",()=>{e(i.trim());}),r.on("error",()=>{e("unknown");});})}async function OE(){console.log(c.dim(" Checking for updates..."));try{let t=await fetch(kE,{headers:{"User-Agent":"MCC-Update-Checker"}});if(!t.ok)throw new Error(`HTTP ${t.status}`);return (await t.json()).tag_name.replace(/^v/,"")}catch(t){throw new Error(`Failed to fetch latest version: ${t instanceof Error?t.message:"Unknown error"}`)}}async function CE(t,e){let r=EE(),i=`${xE}/v${t}/${r}`,n=join(tmpdir(),`mcc-update-${Date.now()}`),o=join(Hv(),"mcc");console.log(c.dim(` Downloading ${r}...`)),mkdirSync(n,{recursive:true});try{let s=join(n,r),a=await fetch(i);if(!a.ok)throw new Error(`Download failed: HTTP ${a.status}`);if(!a.body)throw new Error("No response body");let l=createWriteStream(s);if(await pipeline(Readable.from(a.body),l),console.log(c.success(` Downloaded ${r}`)),e.dryRun){console.log(c.dim(`
|
|
527
|
+
Dry run - would install to: ${o}`));return}if(console.log(c.dim(" Extracting...")),r.endsWith(".zip")){let{default:g}=await import('unzipper');await pipeline(createReadStream(s),g.Extract({path:n}));}else await(await import('tar')).x({file:s,cwd:n,gzip:!0});let u=TE(),d=`${u}.backup`;if(existsSync(u)){console.log(c.dim(" Backing up current installation..."));let g=readFileSync(u);writeFileSync(d,g);}console.log(c.dim(" Installing..."));let m=[join(n,"mcc","mcc"),join(n,"mcc"),join(n,"bin","mcc")],f=null;for(let g of m)if(existsSync(g)){f=g;break}if(!f){let g=Kv(n,"mcc");g&&(f=g);}if(!f)throw new Error("Could not find mcc binary in downloaded package");mkdirSync(dirname(u),{recursive:!0});let p=readFileSync(f);writeFileSync(u,p),chmodSync(u,493),console.log(c.success(` Installed to: ${u}`));let v=await PE(u);console.log(c.success(` New version: ${v}`)),console.log(c.success(`
|
|
528
|
+
${$.success} Update complete!
|
|
529
|
+
`));}catch(s){throw console.error(c.error(`
|
|
530
|
+
Update failed: ${s instanceof Error?s.message:"Unknown error"}`)),s}finally{try{rmSync(n,{recursive:!0,force:!0});}catch{}}}async function AE(t={}){console.log(ve("MCC Update")),console.log("");let e=Se;console.log(c.dim(` Current version: ${e}`));try{let r=await OE();if(console.log(c.dim(` Latest version: ${r}`)),r===e&&!t.force){console.log(c.success(`
|
|
531
|
+
${$.success} You're running the latest version!
|
|
532
|
+
`)),console.log(ce());return}console.log(c.warning(`
|
|
533
|
+
${$.warning} Update available: ${e} \u2192 ${r}`)),console.log(""),t.dryRun||await CE(r,t);}catch(r){console.error(c.error(`
|
|
534
|
+
${$.error} Update check failed: ${r instanceof Error?r.message:"Unknown error"}`)),console.log(c.dim(`
|
|
535
|
+
You can also update manually:`)),console.log(c.dim(" 1. Download the latest release from:")),console.log(c.dim(" https://github.com/velocity-digital/mcc/releases")),console.log(c.dim(" 2. Extract and install the binary")),console.log(""),console.log(ce()),process.exit(1);}console.log(ce());}function Vv(){return new Command("update").description("Check for and install updates").option("-f, --force","Force update even if already on latest version").option("--dry-run","Show what would be updated without making changes").action(async e=>{await AE(e);})}St();Ee();Qt();Zh();jc();bt();vt();qe();var I1={"claude-max":"https://console.anthropic.com/","zai-coding-plan":"https://z.ai/subscribe","minimax-coding-plan":"https://platform.minimax.io/user-center/basic-information/interface-key"},E1={"claude-max":'Run "claude setup-token" in terminal to get your bearer token',"zai-coding-plan":"Sign up at z.ai and create an API key in your dashboard","minimax-coding-plan":"Create a Coding Plan key at platform.minimax.io"};function T1(t,e,r){let i=r?ae(r):c.dim("none");console.log(`
|
|
536
|
+
${c.dim("\u256D"+"\u2500".repeat(62)+"\u256E")}
|
|
537
|
+
${c.dim("\u2502")} ${ae("MCC v"+Se)} \u2022 ${Dv.padEnd(20)}${c.dim("\u2502")}
|
|
538
|
+
${c.dim("\u2502")} ${Mv.padEnd(55)}${c.dim("\u2502")}
|
|
539
|
+
${c.dim("\u2570"+"\u2500".repeat(62)+"\u256F")}
|
|
540
|
+
|
|
541
|
+
${c.dim(" \u250C\u2500 Providers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510")}
|
|
542
|
+
${c.dim(" \u2502")} ${c.primary(String(t))}/${c.dim(String(e))} configured Default: ${i}${" ".repeat(15)}${c.dim("\u2502")}
|
|
543
|
+
${c.dim(" \u2514"+"\u2500".repeat(56)+"\u2518")}
|
|
544
|
+
`);}function P1(){let t=["Tip: Press \u2191/\u2193 to navigate, Enter to select",'Tip: Add a new provider with "mcc add"',"Tip: Create snapshots to transfer context between providers",'Tip: Use "mcc headless" for batch automation','Tip: Run "mcc health" to check all providers'],e=t[Math.floor(Math.random()*t.length)];console.log(c.dim(` ${e}
|
|
545
|
+
`));}async function Y(){console.clear();let t=B(),e=t.providers,r=e.filter(f=>f.enabled),i=e.filter(f=>!f.enabled),n=Ke(),o=t.providers.find(f=>f.id===n)?.name;T1(r.length,e.length,o),P1();let s=II({text:c.dim("Checking providers..."),color:"cyan",spinner:fl.pulse}).start(),l=(await Promise.allSettled(r.map(async f=>{try{let p=await Ye(f);return {provider:f,health:p,status:"success"}}catch(p){return {provider:f,health:null,status:"error",error:p instanceof Error?p.message:String(p)}}}))).map((f,p)=>{if(f.status==="fulfilled")return f.value;{let v=f.reason,g=v instanceof Error?v.message:"Unknown error";return {provider:r[p],health:null,status:"error",error:g}}});s.stop();let u=[];if(l.length>0){u.push(new Separator(c.dim("Providers")));for(let f of l){let{provider:p,health:v}=f,g=v?.ok?c.success("\u25CF"):c.error("\u25CF"),y=v?.latencyMs&&v.latencyMs>0?c.dim(` [${v.latencyMs}ms]`):"",E=p.id===Ke()?$.star+" ":"";u.push({name:` ${g} ${E}${p.name}${y}`,value:p.id,description:v?.ok?c.dim(p.defaultModel):v?c.error(v.message):c.error("Health check failed")});}}if(i.length>0){u.push(new Separator(c.dim("Available (not configured)")));for(let f of i){let p=f.auth.tokenEnv??f.auth.apiKeyEnv,g=(p?Xt(p)!=="none":false)?c.warning("\u25CB"):c.dim("\u25CB");u.push({name:` ${g} ${c.dim(f.name)}`,value:`setup:${f.id}`,description:c.dim(f.description??"Click to configure")});}}let d=yc();u.push(new Separator("")),u.push({name:` ${$.launch} Launch ${c.dim("[l] Start Claude")}`,value:"_launch"}),d.length>0&&u.push({name:` ${$.globe} Workspaces ${c.dim(`[${d.length} pinned]`)}`,value:"_workspaces"}),u.push({name:` ${$.settings} Resume ${c.dim("[r] Recover previous session")}`,value:"_resume"}),u.push({name:` ${$.rocket} Autopilot ${c.dim("[a] Fully autonomous execution")}`,value:"_autopilot"}),u.push({name:` ${$.bolt} Sessions ${c.dim("[s] Manage saved sessions")}`,value:"_sessions"}),u.push({name:` ${$.sparkle} Snapshots ${c.dim("[p] Context snapshots")}`,value:"_snapshots"}),u.push({name:` ${$.radar||"\u{1F4E1}"} Headless ${c.dim("[h] Batch & automation")}`,value:"_headless"}),u.push({name:` ${$.key} Config ${c.dim("[c] Providers & credentials")}`,value:"config"}),u.push(new Separator("")),u.push({name:c.dim(" Exit [q]"),value:"exit"}),r.length===0&&console.log(c.dim(`
|
|
546
|
+
${$.warning} No providers configured. Select one below to set it up.
|
|
547
|
+
`));let m=await Te({message:c.dim("Select action or provider:"),choices:u,pageSize:16,loop:false});await O1(m,l);}async function O1(t,e){if(t==="exit"&&(console.log(c.dim(`
|
|
548
|
+
${$.success} Goodbye!
|
|
549
|
+
`)),process.exit(0)),t==="config")return mv();if(t.startsWith("setup:")){let i=t.replace("setup:","");return vI(i)}if(t==="_resume")return console.log(c.dim(`
|
|
550
|
+
Session recovery coming soon!
|
|
551
|
+
`)),Y();if(t==="_autopilot")return console.log(c.dim(`
|
|
552
|
+
Autopilot mode coming soon!
|
|
553
|
+
`)),Y();if(t==="_sessions")return yI();if(t==="_snapshots")return Lr();if(t==="_headless")return bI();if(t==="_workspaces")return C1(e);if(t==="_launch"){let i=Ke();if(i){let n=e.find(o=>o.provider.id===i);if(n)return dv(n)}return console.log(c.dim(`
|
|
554
|
+
Select a provider first
|
|
555
|
+
`)),await me({message:"Press Enter to continue...",default:true}),Y()}let r=e.find(i=>i.provider.id===t);return r?dv(r):Y()}async function dv(t,e){let{provider:r,health:i}=t;if(!i){let o=Ze(new Error(`Connection to ${r.name} failed. The provider may be offline or misconfigured.`),{showHint:true,showHelp:true});return console.log(c.error(`
|
|
556
|
+
${$.error} ${o}
|
|
557
|
+
`)),await me({message:"Press Enter to continue...",default:true}),Y()}if(!i.ok){console.log(""),console.log(c.warning(` ${$.warning} ${r.name} has issues:`)),console.log(c.error(` ${i.message}`)),i.suggestion&&console.log(c.dim(` ${$.bolt} ${i.suggestion}`)),console.log("");let o=await Te({message:"What would you like to do?",choices:[{name:`${$.launch} Launch anyway`,value:"launch"},{name:`${$.key} Configure credentials`,value:"configure"},{name:`${$.back} Back`,value:"back"}]});if(o==="back")return Y();if(o==="configure")return vI(r.id)}if(r.id===Ke()||await me({message:`Set ${c.primary(r.name)} as default?`,default:false})&&(yn(r.id),console.log(c.success(` ${$.success} ${r.name} is now default
|
|
558
|
+
`))),r.models&&r.models.length>1&&!await me({message:`Use ${c.primary(r.defaultModel)}?`,default:true})){let s=await Te({message:`${$.bolt} Select model:`,choices:r.models.map(a=>({name:a===r.defaultModel?`${a} ${c.dim("(default)")}`:a,value:a}))});r.defaultModel=s;}await Rr(r,e);}async function C1(t){try{let e=yc(),r=[...e.map(o=>({name:` ${$.star} ${M.bold(o.name)}`,value:o.id,description:c.dim(o.path)})),new Separator(""),{name:` ${$.globe} Current directory`,value:"_current"},new Separator(""),{name:c.dim(` ${$.back} Back`),value:"back"}],i=await Te({message:`${$.globe} Select workspace:`,choices:r,pageSize:12});if(i==="back")return Y();let n;i==="_current"?n=process.cwd():n=e.find(s=>s.id===i)?.path??process.cwd(),await A1(n,t);}catch(e){return e instanceof ExitPromptError||e instanceof CancelPromptError||(console.error(""),console.error(Ze(e,{showHint:true,showHelp:true}))),Y()}}async function A1(t,e){let r=e.map(a=>a.provider),i=Ke(),n=[...r.map(a=>{let u=a.id===i?` ${$.star}`:"";return {name:` ${$.bolt} ${a.name}${u}`,value:a.id,description:c.dim(a.defaultModel)}}),new Separator(""),{name:c.dim(` ${$.back} Back`),value:"back"}],o=await Te({message:`${$.launch} Select provider for ${c.primary(t)}:`,choices:n,pageSize:12});if(o==="back")return Y();let s=e.find(a=>a.provider.id===o);if(s)return dv(s,t)}async function vI(t){let r=B().providers.find(d=>d.id===t);if(!r){let d=Ze(new Error(`Provider "${t}" not found`),{showHint:true,showHelp:true});return console.error(c.error(` ${d}`)),await me({message:"Press Enter...",default:true}),Y()}console.clear(),console.log(ae("Setup: "+r.name)),console.log(H(50));let i=I1[t],n=E1[t];console.log(`
|
|
559
|
+
${c.dim("Type:")} ${r.type}
|
|
560
|
+
${c.dim("Model:")} ${r.defaultModel}
|
|
561
|
+
${r.endpoint?`${c.dim("Endpoint:")} ${r.endpoint}
|
|
562
|
+
`:""}
|
|
563
|
+
${n?c.info(` ${$.bolt} ${n}
|
|
564
|
+
`):""}
|
|
565
|
+
${i?c.dim(` ${$.globe} ${i}
|
|
566
|
+
`):""}`);let o=r.auth.tokenEnv??r.auth.apiKeyEnv;if(o){let d=Xt(o);if(console.log(` ${c.dim("Credential:")} ${M.bold(o)}`),console.log(` ${c.dim("Status:")} ${Sc(o)}
|
|
567
|
+
`),d!=="none"){let m=await Te({message:"Credential exists. What to do?",choices:[{name:`${$.success} Keep existing`,value:"keep"},{name:`${c.warning("Update")} credential`,value:"update"},{name:`${$.back} Cancel`,value:"cancel"}]});if(m==="cancel")return Y();m==="update"&&await gI(r,o);}else await gI(r,o);}r.enabled=true,dh(r),console.log(c.success(`
|
|
568
|
+
${$.success} ${r.name} enabled!
|
|
569
|
+
`));let s=II({text:"Verifying connection...",spinner:fl.pulse}).start(),a=await Ye(r);if(a.ok?s.succeed(c.success("Connection verified")):s.warn(c.warning(`Connection issue: ${a.message}`)),console.log(""),await me({message:"Set as default?",default:true})&&(yn(r.id),console.log(c.success(` Set as default
|
|
570
|
+
`))),await me({message:`${$.rocket} Launch now?`,default:true}))await Rr(r);else return Y()}async function gI(t,e){let r=t.auth.method==="bearer"?"bearer token":"API key",i=await xI({message:`${$.key} Enter your ${r}:`,mask:"*",validate:n=>n&&n.length>0?true:"Credential is required"});at(e,i),console.log(c.success(`
|
|
571
|
+
${$.lock} Credential saved
|
|
572
|
+
`));}async function mv(){try{console.clear(),console.log(ae("Config")),console.log(H(40));let t=B(),e=lo();console.log(` ${c.dim("Providers:")} ${t.providers.length} total, ${t.providers.filter(n=>n.enabled).length} enabled`),console.log(` ${c.dim("Credentials:")} ${e.length} stored`),console.log(` ${c.dim("Default:")} ${Ke()??"None"}
|
|
573
|
+
`);let r=[{name:` ${c.success("Add")} provider`,value:"add"},{name:` ${$.key} Credentials`,value:"credentials"},new Separator(""),{name:c.dim(` ${$.back} Back`),value:"back"}];switch(await Te({message:`${$.settings} Settings:`,choices:r,pageSize:10})){case "add":await Lc();break;case "credentials":await N1();break;case "back":return Y()}return mv()}catch(t){return t instanceof ExitPromptError||t instanceof CancelPromptError||(console.error(""),console.error(Ze(t,{showHint:true,showHelp:true}))),Y()}}async function N1(){try{console.clear(),console.log(ae("Credentials")),console.log(H(40));let t=lo(),e=B();if(console.log(` ${c.dim(`Encrypted with AES-256-GCM
|
|
574
|
+
`)}`),t.length>0){for(let n of t){let o=e.providers.find(a=>a.auth.tokenEnv===n||a.auth.apiKeyEnv===n),s=o?c.dim(` \u2192 ${o.name}`):"";console.log(` ${$.enabled} ${n}${s}`);}console.log("");}else console.log(c.dim(` No credentials stored.
|
|
575
|
+
`));let r=[{name:` ${c.error("Delete")} credential`,value:"delete",disabled:t.length===0?"None stored":!1},new Separator(""),{name:c.dim(` ${$.back} Back`),value:"back"}];if(await Te({message:"Options:",choices:r,pageSize:10})==="delete"){let n=await Te({message:"Select credential to delete:",choices:t.map(s=>({name:s,value:s}))});await me({message:`Delete ${n}?`,default:!1})&&(_c(n),console.log(c.success(` Deleted ${n}
|
|
576
|
+
`)));}return await me({message:"Press Enter...",default:!0}),mv()}catch(t){return t instanceof ExitPromptError||t instanceof CancelPromptError||(console.error(""),console.error(Ze(t,{showHint:true,showHelp:true}))),Y()}}async function yI(){try{console.clear(),console.log(ve("Sessions","Manage your saved sessions"));let{getSessionManager:t}=await Promise.resolve().then(()=>(Xe(),Sn)),{formatSessionList:e,resumeSession:r}=await Promise.resolve().then(()=>(vo(),ho)),{exportSessionToFile:i}=await Promise.resolve().then(()=>(Dr(),Fc)),n=t(),o=n.getSessionSummaries();o.length===0?console.log(c.dim(`
|
|
577
|
+
No sessions yet. Start Claude to create one.
|
|
578
|
+
`)):console.log(e(o));let s=await Te({message:"What would you like to do?",choices:[{name:`${$.launch} Resume a session`,value:"resume"},{name:`${$.sparkle} Export a session`,value:"export"},{name:`${c.error("\u2716")} Delete a session`,value:"delete"},new Separator(""),{name:c.dim(` ${$.back} Back`),value:"back"}]});if(s==="back")return Y();if(o.length>0){let a=o.map(u=>({name:`${u.provider} ${c.dim(`(${u.messageCount} messages)`)}`,value:u.sessionId})),l=await Te({message:"Select session:",choices:[...a,{name:"Cancel",value:"__cancel__"}]});if(l!=="__cancel__"){if(s==="resume"){await r(l,n);return}if(s==="export"){let u=`mcc-session-${l}.json`,d=await uv({message:"Export path:",default:u}),m=i(l,d||u);console.log(m?c.success(`
|
|
579
|
+
${$.success} Session exported to ${d||u}
|
|
580
|
+
`):c.error(`
|
|
581
|
+
${$.error} Failed to export session
|
|
582
|
+
`)),await me({message:"Press Enter to continue...",default:!0});}if(s==="delete"&&await me({message:`Delete session ${l}?`,default:!1})){let d=n.deleteSession(l);console.log(d?c.success(`
|
|
583
|
+
${$.success} Session deleted
|
|
584
|
+
`):c.error(`
|
|
585
|
+
${$.error} Failed to delete session
|
|
586
|
+
`)),await me({message:"Press Enter to continue...",default:!0});}}}return yI()}catch(t){return t instanceof ExitPromptError||t instanceof CancelPromptError||(console.error(""),console.error(Ze(t,{showHint:true,showHelp:true}))),Y()}}async function Lr(){try{console.clear(),console.log(ve("Context Snapshots","Transfer context between providers"));let{listSnapshots:t,getSnapshot:e,createSnapshotFromActive:r,deleteSnapshot:i,applySnapshot:n}=await Promise.resolve().then(()=>(tn(),In)),o=t();if(o.length===0)console.log(c.dim(`
|
|
587
|
+
No snapshots yet.
|
|
588
|
+
`)),console.log(c.info(` ${$.sparkle} Tip: Create a snapshot before switching providers to preserve context.
|
|
589
|
+
`));else {console.log(c.dim(` Recent snapshots:
|
|
590
|
+
`));for(let a of o.slice(0,5))console.log(` ${c.primary(a.id)} ${c.dim(a.name)}`),console.log(c.dim(` ${a.sourceProvider} \u2192 ${a.messages.length} messages`));console.log("");}let s=await Te({message:"What would you like to do?",choices:[{name:`${$.sparkle} Create snapshot from current session`,value:"create"},{name:`${$.launch} Apply snapshot to new provider`,value:"apply"},{name:`${c.error("\u2716")} Delete a snapshot`,value:"delete"},new Separator(""),{name:c.dim(` ${$.back} Back`),value:"back"}]});if(s==="back")return Y();if(s==="create"){let a=r({name:`Snapshot ${new Date().toLocaleDateString()}`});a?(console.log(c.success(`
|
|
591
|
+
${$.success} Created snapshot: ${a.id}`)),console.log(c.dim(` ${a.messages.length} messages, ${a.files.length} files`))):console.log(c.warning(`
|
|
592
|
+
${$.warning} No active session to snapshot`));}if(s==="apply"){if(o.length===0)return console.log(c.warning(`
|
|
593
|
+
${$.warning} No snapshots available to apply`)),await me({message:"Press Enter to continue...",default:!0}),Lr();let a=await Te({message:"Select snapshot to apply:",choices:[...o.map(l=>({name:`${l.name} ${c.dim(`(${l.sourceProvider}, ${l.messages.length} messages)`)}`,value:l.id})),{name:"Cancel",value:"__cancel__"}]});if(a!=="__cancel__"){let l=st();if(l.length===0)return console.log(c.warning(`
|
|
594
|
+
${$.warning} No enabled providers available`)),await me({message:"Press Enter to continue...",default:!0}),Lr();let u=await Te({message:"Select target provider:",choices:[...l.map(d=>({name:`${d.name} ${c.dim(`(${d.defaultModel})`)}`,value:d.id})),{name:"Cancel",value:"__cancel__"}]});if(u!=="__cancel__"){let d=n(a,{targetProvider:u}),m=e(a),f=l.find(v=>v.id===u);if(!d||!m||!f)return console.log(c.error(`
|
|
595
|
+
${$.error} Failed to apply snapshot
|
|
596
|
+
`)),await me({message:"Press Enter to continue...",default:!0}),Lr();console.log(c.success(`
|
|
597
|
+
${$.success} Snapshot applied to ${f.name}`)),console.log(c.dim(` ${d.messages.length} messages, ${d.files.length} files`));let p={};for(let[v,g]of Object.entries(d.env))p[v]=process.env[v],process.env[v]=g;try{await Rr(f,m.workspace);}catch(v){let g=Ze(v,{showHint:!0,showHelp:!0});console.log(c.error(`
|
|
598
|
+
${$.error} ${g}
|
|
599
|
+
`)),await me({message:"Press Enter to continue...",default:!0});}finally{for(let[v,g]of Object.entries(p))g===void 0?delete process.env[v]:process.env[v]=g;}}}}if(s==="delete"){if(o.length===0)return console.log(c.warning(`
|
|
600
|
+
${$.warning} No snapshots available to delete`)),await me({message:"Press Enter to continue...",default:!0}),Lr();let a=await Te({message:"Select snapshot to delete:",choices:[...o.map(l=>({name:`${l.name} ${c.dim(`(${l.sourceProvider})`)}`,value:l.id})),{name:"Cancel",value:"__cancel__"}]});if(a!=="__cancel__"&&await me({message:`Delete snapshot ${a}?`,default:!1})){let u=i(a);console.log(u?c.success(`
|
|
601
|
+
${$.success} Snapshot deleted
|
|
602
|
+
`):c.error(`
|
|
603
|
+
${$.error} Failed to delete snapshot
|
|
604
|
+
`)),await me({message:"Press Enter to continue...",default:!0});}}return await me({message:`
|
|
605
|
+
Press Enter to continue...`,default:!0}),Lr()}catch(t){return t instanceof ExitPromptError||t instanceof CancelPromptError||(console.error(""),console.error(Ze(t,{showHint:true,showHelp:true}))),Y()}}async function bI(){try{console.clear(),console.log(ve("Headless Mode","Batch processing & automation")),console.log(c.dim(`
|
|
606
|
+
Headless mode lets you:
|
|
607
|
+
\u2022 Run multiple prompts in parallel
|
|
608
|
+
\u2022 Process prompts from files
|
|
609
|
+
\u2022 Automate Claude Code tasks
|
|
610
|
+
|
|
611
|
+
`)),console.log(c.dim(` Run "mcc headless tasks" in terminal for active task monitoring.
|
|
612
|
+
`));let t=await Te({message:"Select action:",choices:[{name:`${$.bolt} View active tasks`,value:"tasks"},{name:`${$.globe} Run batch from file`,value:"batch"},{name:`${$.rocket} Fan-out (multiple providers)`,value:"fanout"},new Separator(""),{name:c.dim(` ${$.back} Back to main menu`),value:"back"}]});if(t==="back")return Y();let{headlessPoolStatus:e,headlessBatch:r,headlessFanOut:i}=await Promise.resolve().then(()=>(_e(),$e));if(t==="tasks"){await e({json:!1});return}if(t==="batch"){let n=await uv({message:"Path to batch file:",validate:o=>o.trim().length>0?!0:"File path is required"});await r(n.trim(),{concurrency:"4"});return}if(t==="fanout"){let n=await uv({message:"Prompt to run across providers:",validate:o=>o.trim().length>0?!0:"Prompt is required"});await i(n.trim(),{strategy:"all"});return}return await me({message:"Press Enter to continue...",default:!0}),bI()}catch(t){return t instanceof ExitPromptError||t instanceof CancelPromptError||(console.error(""),console.error(Ze(t,{showHint:true,showHelp:true}))),Y()}}async function $I(t){let e=B(),r=e.providers.find(i=>i.id===t);if(!r){console.error(c.error(`Provider not found: ${t}`)),console.log(c.dim(`
|
|
613
|
+
Available providers:`));for(let i of e.providers)console.log(` ${c.dim("\u2022")} ${i.id}: ${i.name}`);process.exit(1);}r.enabled||(console.log(c.warning(`
|
|
614
|
+
${$.warning} ${r.name} is not configured.`)),console.log(c.dim(` Run "mcc" to configure it first.
|
|
615
|
+
`)),process.exit(1)),await Rr(r);}function _I(){let t=B(),e=Ke();console.log(ae("Providers")),console.log(H(40)),console.log("");for(let r of t.providers){let n=r.id===e?` ${$.star}`:"",o=r.enabled?c.success("\u25CF"):c.dim("\u25CB");console.log(` ${o} ${M.bold(r.name)}${n}`),console.log(` ${c.dim(r.id)} \u2022 ${c.dim(r.type)} \u2022 ${c.dim(r.defaultModel)}`),console.log("");}console.log(ce());}Ee();vt();qe();vt();var SI=false;function wI(){SI||(SI=true,process.on("uncaughtException",t=>{console.error(""),console.error(Ze(t,{showHint:true,showHelp:true})),process.exit(1);}),process.on("unhandledRejection",t=>{let e=t instanceof Error?t:new Error(String(t));console.error(""),console.error(Ze(e,{showHint:true,showHelp:true})),process.exit(1);}),process.on("SIGINT",()=>{console.log(c.dim(`
|
|
616
|
+
Goodbye!`)),process.exit(130);}),process.on("SIGTERM",()=>{console.log(c.dim(`
|
|
617
|
+
Terminated.`)),process.exit(143);}));}function Z(t){return async(...e)=>{try{await t(...e);}catch(r){console.error(""),console.error(Ze(r,{showHint:true,showHelp:true})),process.exit(1);}}}qe();hv();wI();setTimeout(()=>{Bv();},2e3);var ue=new Command;ue.name("mcc").description(`${ae("MCC")} - Multi-Client Coder for Claude
|
|
618
|
+
${c.dim("Session-aware launcher with autopilot")}
|
|
619
|
+
${c.dim("Built by Velocity Digital")}`).version(Se);ue.command("launch [provider-id]").alias("l").description("Launch Claude Code with selected provider (interactive menu if omitted)").action(Z(async t=>{t?await $I(t):await Y();}));ue.command("start",{isDefault:true}).description("Show provider selection menu and launch Claude Code").action(Z(async()=>{await gv(),await Y();}));ue.command("list").alias("ls").description("List all configured providers").action(Z(()=>{_I();}));ue.command("setup").description("Run the guided setup wizard to configure providers").action(Z(async()=>{let{runSetupWizard:t}=await Promise.resolve().then(()=>(hv(),NI));await t();}));ue.command("health [provider-id]").option("-v, --verbose","Show detailed output with suggestions").description("Check provider health. Run all if no ID specified.").action(Z(async(t,e)=>{let r=(await import('ora')).default,{checkProvider:i,formatHealthResult:n,formatHealthResultVerbose:o}=await Promise.resolve().then(()=>(Qt(),xc)),{loadConfig:s,getEnabledProviders:a,getProvider:l}=await Promise.resolve().then(()=>(Ee(),bn)),u=s(),d=e.verbose?o:n;if(console.log(ve("Provider Health Check")),console.log(""),t){let m=l(t);if(!m){console.error(c.error(`Provider not found: ${t}`)),console.log(`
|
|
620
|
+
Available providers:`);for(let v of u.providers)console.log(` ${c.dim("\u2022")} ${v.id}: ${v.name}`);process.exit(1);}let f=r({text:`Checking ${m.name}...`,color:"cyan"}).start(),p=await i(m);f.stop(),console.log(`${M.bold(m.name)}:`),console.log(` ${d(p)}`);}else {let m=a(),f=!0;for(let p of m){let v=r({text:`Checking ${p.name}...`,color:"cyan"}).start(),g=await i(p);v.stop(),console.log(`${M.bold(p.name)}:`),console.log(` ${d(g)}`),console.log(""),g.ok||(f=!1);}console.log(H(50)),f?console.log(c.success(`${$.success} All providers are healthy
|
|
621
|
+
`)):(console.log(c.warning(`${$.warning} Some providers have issues
|
|
622
|
+
`)),e.verbose||console.log(c.dim(` Run with -v for suggestions
|
|
623
|
+
`)));}console.log(ce());}));ue.command("test [provider-id]").description("Test provider connection with detailed diagnostics").action(Z(async t=>{let e=(await import('ora')).default,r=(await import('@inquirer/select')).default,{checkProvider:i}=await Promise.resolve().then(()=>(Qt(),xc)),{getEnabledProviders:n,getProvider:o}=await Promise.resolve().then(()=>(Ee(),bn)),s;if(t)s=o(t),s||(console.error(c.error(`Provider not found: ${t}`)),process.exit(1));else {let u=n();u.length===0&&(console.error(c.error("No enabled providers found")),process.exit(1));let d=await r({message:`${$.bolt} Select provider to test:`,choices:u.map(f=>({name:f.name,value:f.id}))}),m=u.find(f=>f.id===d);m||(console.error(c.error("Provider not found")),process.exit(1)),s=m;}console.log(ve(`Testing: ${s.name}`)),console.log(c.dim(`
|
|
624
|
+
Type: ${s.type}`)),s.endpoint&&console.log(c.dim(` Endpoint: ${s.endpoint}`)),console.log(c.dim(` Auth: ${s.auth.method}`)),console.log(c.dim(` Timeout: ${s.timeout??3e4}ms`)),console.log(c.dim(` Model: ${s.defaultModel}`)),console.log(`
|
|
625
|
+
`+H(50)+`
|
|
626
|
+
`);let a=e({text:"Connecting...",color:"cyan"}).start(),l=Date.now();try{let u=await i(s),d=Date.now()-l;u.ok?(a.succeed(c.success(`Connected (${d}ms)`)),u.models&&u.models.length>0&&(console.log(c.dim(`
|
|
627
|
+
Available models (${u.models.length}):`)),u.models.slice(0,5).forEach(m=>{console.log(c.dim(` ${$.enabled} ${m}`));}),u.models.length>5&&console.log(c.dim(` ... and ${u.models.length-5} more`))),console.log(c.success(`
|
|
628
|
+
${$.success} Provider "${s.name}" is healthy
|
|
629
|
+
`)),console.log(ce()),process.exit(0)):(a.fail(c.error(u.message)),"suggestion"in u&&u.suggestion&&console.log(c.warning(`
|
|
630
|
+
\u{1F4A1} ${u.suggestion}`)),console.log(c.error(`
|
|
631
|
+
${$.error} Provider "${s.name}" test failed
|
|
632
|
+
`)),console.log(ce()),process.exit(1));}catch(u){a.fail(c.error(X(u))),console.log(ce()),process.exit(1);}}));ue.command("config").description("Show configuration directory and info").action(Z(async()=>{let{getConfigFile:t,getDefaultProvider:e,loadConfig:r}=await Promise.resolve().then(()=>(Ee(),bn)),{getCredentialsFile:i,listCredentials:n}=await Promise.resolve().then(()=>(bt(),kh)),o=t(),s=i(),a=n(),l=e(),u=r();if(console.log(ve("MCC Configuration")),console.log(M.bold(`
|
|
633
|
+
Paths`)),console.log(H(40)),console.log(` ${c.dim("Config:")} ${o}`),console.log(` ${c.dim("Credentials:")} ${s}`),console.log(""),console.log(M.bold(" Providers")),console.log(H(40)),console.log(` ${c.dim("Total:")} ${u.providers.length}`),console.log(` ${c.dim("Enabled:")} ${u.providers.filter(f=>f.enabled).length}`),console.log(` ${c.dim("Default:")} ${l??c.dim("(none)")}`),console.log(""),console.log(M.bold(" Credentials")),console.log(H(40)),console.log(` ${c.dim("Stored:")} ${a.length}`),a.length>0){console.log("");for(let f of a){let p=u.providers.find(g=>g.auth.tokenEnv===f||g.auth.apiKeyEnv===f),v=p?c.dim(` \u2192 ${p.name}`):c.dim(" (unused)");console.log(` ${$.enabled} ${f}${v}`);}}let m=["ANTHROPIC_AUTH_TOKEN","ZAI_API_KEY","MINIMAX_API_KEY","OPENAI_API_KEY"].filter(f=>process.env[f]);if(m.length>0){console.log(""),console.log(c.dim(" Environment variables detected:"));for(let f of m)console.log(` ${c.warning("\u25CF")} ${f}`);}console.log(ce());}));ue.command("configure [provider-id]").alias("config-provider").description("Configure provider settings, models, and credentials").action(Z(async t=>{let{configureProvider:e}=await Promise.resolve().then(()=>(jc(),Gh));await e(t);}));ue.command("add").description("Add a new provider (interactive wizard)").action(Z(async()=>{let{addProviderWizard:t}=await Promise.resolve().then(()=>(jc(),Gh));await t();}));var Pe=ue.command("headless").description("Non-interactive headless mode for CI/CD and scripts");Pe.command("launch [provider-id]").description("Launch Claude Code without prompts (uses default provider if omitted)").option("--json","Output status as JSON").option("--model <model>","Override the default model").action(Z(async(t,e)=>{let{headlessLaunch:r}=await Promise.resolve().then(()=>(_e(),$e));await r(t,e);}));Pe.command("health [provider-id]").description("Check provider health (all enabled if no ID)").option("--json","Output as JSON").action(Z(async(t,e)=>{let{headlessHealth:r}=await Promise.resolve().then(()=>(_e(),$e));await r(t,e);}));Pe.command("list").description("List all configured providers").option("--json","Output as JSON").action(Z(async t=>{let{headlessList:e}=await Promise.resolve().then(()=>(_e(),$e));e(t);}));Pe.command("config").description("Show configuration info").option("--json","Output as JSON").action(Z(async t=>{let{headlessConfig:e}=await Promise.resolve().then(()=>(_e(),$e));await e(t);}));Pe.command("test <provider-id>").description("Test provider connection").option("--json","Output as JSON").action(Z(async(t,e)=>{let{headlessTest:r}=await Promise.resolve().then(()=>(_e(),$e));await r(t,e);}));Pe.command("spawn <prompt>").description("Submit a prompt to an agent (auto-routes or specify provider)").option("--provider <id>","Target provider (auto-routes if omitted)").option("--model <model>","Override model").option("--timeout <ms>","Timeout in milliseconds").option("--json","Output as JSON").option("--stream","Stream NDJSON events in real-time").option("--cwd <dir>","Working directory for Claude process").option("--session <name>","Group task under a session name").option("--retries <n>","Retry count on failure (default: 0)").option("--backoff <ms>","Initial backoff delay in ms (default: 1000)").action(Z(async(t,e)=>{let{headlessSpawn:r}=await Promise.resolve().then(()=>(_e(),$e));await r(t,e);}));Pe.command("fan-out <prompt>").description("Send prompt to multiple providers in parallel").option("--providers <ids>","Comma-separated provider IDs").option("--count <n>","Max providers to use").option("--strategy <s>","all | first | best (default: all)").option("--timeout <ms>","Timeout per provider").option("--json","Output as JSON").option("--stream","Stream NDJSON events in real-time").option("--cwd <dir>","Working directory for Claude processes").option("--session <name>","Group tasks under a session name").option("--retries <n>","Retry count on failure (default: 0)").option("--backoff <ms>","Initial backoff delay in ms (default: 1000)").action(Z(async(t,e)=>{let{headlessFanOut:r}=await Promise.resolve().then(()=>(_e(),$e));await r(t,e);}));Pe.command("pipe").description("Pipeline mode: read prompts from stdin, emit NDJSON results to stdout").option("--concurrency <n>","Max parallel tasks (default: 4)").option("--timeout <ms>","Default timeout per task").option("--session <name>","Group all piped tasks under a session").action(Z(async t=>{let{headlessPipe:e}=await Promise.resolve().then(()=>(_e(),$e));await e(t);}));Pe.command("batch <file>").description("Run prompts from a file (one per line or NDJSON objects)").option("--concurrency <n>","Max parallel tasks (default: 4)").option("--timeout <ms>","Timeout per task").option("--json","Output summary as JSON").option("--stream","Stream NDJSON events in real-time").option("--session <name>","Group batch tasks under a session").option("--retries <n>","Retry count on failure (default: 0)").option("--backoff <ms>","Initial backoff delay in ms (default: 1000)").action(Z(async(t,e)=>{let{headlessBatch:r}=await Promise.resolve().then(()=>(_e(),$e));await r(t,e);}));Pe.command("watch <task-id>").description("Show details and output of a specific task").option("--json","Output as JSON").action(Z(async(t,e)=>{let{headlessWatch:r}=await Promise.resolve().then(()=>(_e(),$e));await r(t,e);}));Pe.command("tasks").description("Show active and recent tasks").option("--json","Output as JSON").option("--session <name>","Filter by session name").action(Z(async t=>{let{headlessPoolStatus:e}=await Promise.resolve().then(()=>(_e(),$e));await e(t);}));Pe.command("clear").description("Clear task history").option("--json","Output as JSON").action(Z(async t=>{let{headlessClearState:e}=await Promise.resolve().then(()=>(_e(),$e));await e(t);}));Pe.command("bus").description("Show inter-agent communication bus status").option("--json","Output as JSON").action(Z(async t=>{let{headlessBusStatus:e}=await Promise.resolve().then(()=>(_e(),$e));await e(t);}));Pe.command("configure <provider-id>").description("Configure provider settings (models, endpoint, tiers)").option("--model <name>","Set default model").option("--opus <name>","Set Opus tier model").option("--sonnet <name>","Set Sonnet tier model").option("--haiku <name>","Set Haiku tier model").option("--endpoint <url>","Set API endpoint").option("--timeout <ms>","Set timeout in milliseconds").option("--enable <true|false>","Enable or disable provider").option("--default","Set as default provider").option("--json","Output as JSON").action(Z(async(t,e)=>{let{headlessConfigure:r}=await Promise.resolve().then(()=>(_e(),$e));await r(t,e);}));Pe.command("add-model <provider-id> <model-name>").description("Add a model to a provider").option("--json","Output as JSON").action(Z(async(t,e,r)=>{let{headlessAddModel:i}=await Promise.resolve().then(()=>(_e(),$e));await i(t,e,r);}));Pe.command("models [provider-id]").description("List models for a provider (or all providers)").option("--json","Output as JSON").action(Z(async(t,e)=>{let{headlessListModels:r}=await Promise.resolve().then(()=>(_e(),$e));await r(t,e);}));ue.command("changelog").alias("changes").description("Show version history and changelog").option("-n, --limit <number>","Limit number of versions shown","5").action(Z(t=>{let e=t.limit?parseInt(t.limit,10):void 0;console.log(Lv(e));}));ue.command("about").description("Show about information").action(Z(()=>{let t=B(),e=t.providers.filter(r=>r.enabled).length;console.log(zv({enabled:e,total:t.providers.length,defaultProvider:t.providers.find(r=>r.id===t.defaultProvider)?.name})),console.log(`
|
|
634
|
+
${ae("MCC - Multi-Client Coder")}
|
|
635
|
+
|
|
636
|
+
${c.dim("A session-aware launcher for Claude Code that enables")}
|
|
637
|
+
${c.dim("switching between multiple AI providers with secure")}
|
|
638
|
+
${c.dim("credential management and autopilot mode.")}
|
|
639
|
+
|
|
640
|
+
${M.bold("Features:")}
|
|
641
|
+
${c.dim("\u2022")} Multi-provider support (Anthropic, Z.AI, MiniMax, Local)
|
|
642
|
+
${c.dim("\u2022")} Session recovery and context transfer
|
|
643
|
+
${c.dim("\u2022")} Autopilot mode for autonomous execution
|
|
644
|
+
${c.dim("\u2022")} AES-256-GCM encrypted credential storage
|
|
645
|
+
${c.dim("\u2022")} Interactive provider selection menu
|
|
646
|
+
${c.dim("\u2022")} Health checking with retry logic
|
|
647
|
+
|
|
648
|
+
${M.bold("Links:")}
|
|
649
|
+
${c.dim("\u2022")} ${c.primary("https://velocitydigi.com")}
|
|
650
|
+
${c.dim("\u2022")} ${c.primary("https://github.com/velocity-digital/mcc")}
|
|
651
|
+
`),console.log(ce());}));ue.addCommand(Vv());var Eo=ue.command("sessions").description("Session management (list, resume, export, import, clean)");Eo.command("ls").description("List all sessions").action(Z(async()=>{let{getSessionManager:t}=await Promise.resolve().then(()=>(Xe(),Sn)),{formatSessionList:e}=await Promise.resolve().then(()=>(vo(),ho)),i=t().getSessionSummaries();console.log(e(i));}));Eo.command("resume <session-id>").description("Resume a previous session").action(Z(async t=>{let{getSessionManager:e}=await Promise.resolve().then(()=>(Xe(),Sn)),{resumeSession:r}=await Promise.resolve().then(()=>(vo(),ho)),i=e();await r(t,i);}));Eo.command("export <session-id> [file]").description("Export session to file").action(Z(async(t,e)=>{let{getSessionManager:r}=await Promise.resolve().then(()=>(Xe(),Sn)),{exportSessionToFile:i}=await Promise.resolve().then(()=>(Dr(),Fc));r().getSession(t)||(console.error(c.error(`Session not found: ${t}`)),process.exit(1));let s=e??`mcc-session-${t}.json`;i(t,s)?console.log(c.success(`Exported session to ${s}`)):(console.error(c.error("Failed to export session")),process.exit(1));}));Eo.command("import <file>").description("Import session from file").action(Z(async t=>{let{importSessionFromFile:e}=await Promise.resolve().then(()=>(Dr(),Fc)),r=e(t);r?console.log(c.success(`Imported session: ${r.sessionId}`)):(console.error(c.error("Failed to import session")),process.exit(1));}));Eo.command("clean [days]").description("Remove sessions older than N days (default: 30)").action(Z(async t=>{let{getSessionManager:e}=await Promise.resolve().then(()=>(Xe(),Sn)),r=t?parseInt(t,10):30,n=e().cleanOldSessions(r);console.log(c.success(`Cleaned ${n} old session(s)`));}));var To=ue.command("snapshot").description("Context snapshot management for provider switching");To.command("create [name]").description("Create context snapshot from active session").option("-d, --description <text>","Snapshot description").option("--max-messages <n>","Maximum messages to include").action(Z(async(t,e)=>{let{createSnapshotFromActive:r}=await Promise.resolve().then(()=>(tn(),In)),i=r({name:t,description:e.description,maxMessages:e.maxMessages?parseInt(e.maxMessages,10):void 0});i?(console.log(c.success(`${$.success} Created snapshot: ${i.id}`)),console.log(c.dim(` Name: ${i.name}`)),console.log(c.dim(` Messages: ${i.messages.length}`)),console.log(c.dim(` Files: ${i.files.length}`))):(console.error(c.error("No active session to snapshot")),process.exit(1));}));To.command("list").alias("ls").description("List all context snapshots").action(Z(async()=>{let{listSnapshots:t}=await Promise.resolve().then(()=>(tn(),In)),e=t();if(e.length===0){console.log(c.dim("No snapshots found"));return}console.log(ve("Context Snapshots")),console.log("");for(let r of e)console.log(`${c.primary(r.id)} ${c.dim(r.name)}`),console.log(c.dim(` Provider: ${r.sourceProvider} | Model: ${r.sourceModel}`)),console.log(c.dim(` Messages: ${r.messages.length} | Files: ${r.files.length}`)),console.log(c.dim(` Created: ${new Date(r.createdAt).toLocaleString()}`)),console.log("");console.log(ce());}));To.command("show <snapshot-id>").description("Show snapshot details").action(Z(async t=>{let{getSnapshot:e}=await Promise.resolve().then(()=>(tn(),In)),r=e(t);if(r||(console.error(c.error(`Snapshot not found: ${t}`)),process.exit(1)),console.log(ve(`Snapshot: ${r.name}`)),console.log(""),console.log(c.dim(` ID: ${r.id}`)),console.log(c.dim(` Source: ${r.sourceProvider} / ${r.sourceModel}`)),console.log(c.dim(` Workspace: ${r.workspace}`)),console.log(c.dim(` Messages: ${r.messages.length}`)),console.log(c.dim(` Files: ${r.files.length}`)),console.log(c.dim(` Created: ${new Date(r.createdAt).toLocaleString()}`)),r.messages.length>0){console.log(""),console.log(M.bold(" Recent messages:"));for(let i of r.messages.slice(-3)){let n=i.content.slice(0,60).replace(/\n/g," ");console.log(c.dim(` ${i.role}: ${n}...`));}}console.log(ce());}));To.command("apply <snapshot-id>").description("Apply snapshot context to new session (outputs env vars)").option("-p, --provider <id>","Target provider").option("-m, --model <name>","Target model").action(Z(async(t,e)=>{let{applySnapshot:r}=await Promise.resolve().then(()=>(tn(),In)),i=r(t,{targetProvider:e.provider,targetModel:e.model});i||(console.error(c.error(`Snapshot not found: ${t}`)),process.exit(1)),console.log("# Apply this context by sourcing these variables:"),console.log("");for(let[n,o]of Object.entries(i.env))console.log(`export ${n}="${o}"`);console.log(""),console.log(c.dim(`# ${i.messages.length} messages and ${i.files.length} files will be available`));}));To.command("delete <snapshot-id>").description("Delete a snapshot").action(Z(async t=>{let{deleteSnapshot:e}=await Promise.resolve().then(()=>(tn(),In));e(t)?console.log(c.success(`Deleted snapshot: ${t}`)):(console.error(c.error(`Snapshot not found: ${t}`)),process.exit(1));}));ue.command("autopilot <prompt>").description("Fully autonomous execution from idea to working code").option("-p, --provider <id>","Target provider").option("-m, --model <name>","Model to use").option("-t, --timeout <ms>","Task timeout in milliseconds","300000").option("--export","Export session on completion").option("-o, --output <file>","Export to specific file").action(Z(async(t,e)=>{let{runAutopilot:r}=await Promise.resolve().then(()=>(jI(),LI));console.log(ae(`
|
|
652
|
+
Autopilot Mode`)),console.log(H(50)),console.log(` ${c.dim("Prompt:")} ${t}`),console.log(` ${c.dim("Provider:")} ${e.provider??"auto"}`),console.log(` ${c.dim("Model:")} ${e.model??"default"}`),console.log(` ${c.dim("Timeout:")} ${e.timeout}ms`),console.log(H(50));let i=(await import('ora')).default({text:"Analyzing and planning...",spinner:"dots"}).start();try{let n=await r({prompt:t,provider:e.provider,model:e.model,timeout:e.timeout?parseInt(e.timeout,10):void 0,exportOnComplete:e.export,exportFile:e.output});i.succeed("Autopilot complete"),console.log(H(50)),console.log(` ${c.dim("Session ID:")} ${c.primary(n.sessionId)}`),console.log(` ${c.dim("Tasks:")} ${n.iterations}`),console.log(` ${c.dim("Status:")} ${n.success?c.success("Success"):c.error("Failed")}`),console.log(H(50)),n.output&&(console.log(`
|
|
653
|
+
${c.dim("Output:")}`),console.log(` ${n.output}`)),n.error&&(console.log(`
|
|
654
|
+
${c.error("Error:")}`),console.log(` ${n.error}`)),console.log(""),process.exit(n.exitCode??(n.success?0:1));}catch(n){i.fail("Autopilot failed");let o=n instanceof Error?n.message:String(n);console.error(c.error(`
|
|
655
|
+
${o}
|
|
656
|
+
`)),process.exit(1);}}));ue.command("resume [session-id]").description("Resume previous session (uses active if no ID specified)").action(Z(async t=>{let{getSessionManager:e}=await Promise.resolve().then(()=>(Xe(),Sn)),{resumeSession:r}=await Promise.resolve().then(()=>(vo(),ho)),i=e(),n=t??i.getActiveSession()?.sessionId;n||(console.log(c.dim(`
|
|
657
|
+
No active session found. Use "mcc sessions ls" to see available sessions.
|
|
658
|
+
`)),process.exit(1)),await r(n,i);}));ue.command("switch [provider-id]").description("Switch active provider for running Claude instance").action(Z(async t=>{let{getEnabledProviders:e}=await Promise.resolve().then(()=>(Ee(),bn)),{switchProvider:r}=await Promise.resolve().then(()=>(yv(),vv)),i=(await import('@inquirer/select')).default,n=e();n.length===0&&(console.log(c.dim(`
|
|
659
|
+
No enabled providers found.
|
|
660
|
+
`)),process.exit(1));let o=t;o===void 0&&(o=await i({message:`${$.bolt} Select provider to switch to:`,choices:n.map(a=>({name:`${$.bolt} ${a.name}`,value:a.id,description:c.dim(a.defaultModel)}))}));let s=n.find(a=>a.id===o);if(!s){console.error(c.error(`Provider not found: ${o}`)),console.log(c.dim(`
|
|
661
|
+
Available providers:`));for(let a of n)console.log(` ${c.dim("\u2022")} ${a.id}: ${a.name}`);process.exit(1);}await r(s);}));ue.command("status").description("Show current provider status and available providers").action(Z(()=>{Promise.resolve().then(()=>(yv(),vv)).then(({showProviderStatus:t})=>{t();}).catch(t=>{console.error("Failed to load status:",t);});}));ue.parse();process.argv.slice(2).length||(console.log(`
|
|
662
|
+
${ae(" MCC")} ${c.dim("- Multi-Client Coder")}
|
|
663
|
+
${c.dim(" Session-aware launcher with autopilot \u2022 v"+Se)}
|
|
664
|
+
`),ue.outputHelp(),console.log(`
|
|
665
|
+
${M.bold("Examples:")}
|
|
666
|
+
${c.primary("mcc")} ${c.dim("# Show interactive menu")}
|
|
667
|
+
${c.primary("mcc launch")} ${c.dim("# Same as above")}
|
|
668
|
+
${c.primary("mcc launch zai")} ${c.dim("# Quick launch with provider")}
|
|
669
|
+
${c.primary("mcc list")} ${c.dim("# List all providers")}
|
|
670
|
+
${c.primary("mcc health")} ${c.dim("# Check all provider health")}
|
|
671
|
+
${c.primary("mcc about")} ${c.dim("# About MCC")}
|
|
672
|
+
${c.primary("mcc config")} ${c.dim("# Show configuration info")}
|
|
673
|
+
${c.primary("mcc add")} ${c.dim("# Add new provider (wizard)")}
|
|
674
|
+
|
|
675
|
+
${M.bold("Sessions:")}
|
|
676
|
+
${c.primary("mcc sessions ls")} ${c.dim("# List all sessions")}
|
|
677
|
+
${c.primary("mcc sessions resume")} ${c.dim("# Resume previous session")}
|
|
678
|
+
|
|
679
|
+
${M.bold("Multi-Provider:")}
|
|
680
|
+
${c.primary("mcc switch")} ${c.dim("# Switch active provider (no restart)")}
|
|
681
|
+
${c.primary("mcc switch zai")} ${c.dim("# Switch to specific provider")}
|
|
682
|
+
${c.primary("mcc status")} ${c.dim("# Show current provider status")}
|
|
683
|
+
|
|
684
|
+
${M.bold("Autopilot (NEW):")}
|
|
685
|
+
${c.primary('mcc autopilot "fix bug"')} ${c.dim("# Fully autonomous execution")}
|
|
686
|
+
|
|
687
|
+
${M.bold("Headless (CI/CD):")}
|
|
688
|
+
${c.primary("mcc headless launch")} ${c.dim("# Launch with default provider")}
|
|
689
|
+
${c.primary("mcc headless launch zai")} ${c.dim("# Launch specific provider")}
|
|
690
|
+
${c.primary("mcc headless health --json")} ${c.dim("# JSON health check")}
|
|
691
|
+
${c.primary("mcc headless list --json")} ${c.dim("# JSON provider list")}
|
|
692
|
+
${c.primary("mcc headless test zai --json")} ${c.dim("# JSON connection test")}
|
|
693
|
+
|
|
694
|
+
${M.bold("Orchestration:")}
|
|
695
|
+
${c.primary('mcc headless spawn "fix bug"')} ${c.dim("# Submit task (auto-route)")}
|
|
696
|
+
${c.primary('mcc headless spawn "fix" --provider zai --stream')} ${c.dim("# Stream NDJSON events")}
|
|
697
|
+
${c.primary('mcc headless spawn "q" --retries 3 --backoff 2000')} ${c.dim("# Retry with backoff")}
|
|
698
|
+
${c.primary('mcc headless fan-out "review" --strategy first')} ${c.dim("# First response wins")}
|
|
699
|
+
${c.primary("mcc headless pipe")} ${c.dim("# Pipeline: stdin prompts \u2192 stdout results")}
|
|
700
|
+
${c.primary("mcc headless batch tasks.txt --concurrency 8")} ${c.dim("# Batch from file")}
|
|
701
|
+
${c.primary("mcc headless watch <task-id>")} ${c.dim("# Inspect task output")}
|
|
702
|
+
${c.primary("mcc headless tasks --session deploy")} ${c.dim("# Filter by session")}
|
|
703
|
+
${c.primary("mcc headless clear")} ${c.dim("# Clear task state")}
|
|
704
|
+
`),console.log(ce()));//# sourceMappingURL=index.mjs.map
|
|
705
|
+
//# sourceMappingURL=index.mjs.map
|