logsdx
Version:
<div align="center"><img alt="logsdx" width="300" src="https://github.com/user-attachments/assets/cc2a3b55-5bfd-44e8-a330-bfa146b50059" /></div>
1 lines • 97 kB
JavaScript
var{defineProperty:tr,getOwnPropertyNames:Zo,getOwnPropertyDescriptor:so}=Object,nf=Object.prototype.hasOwnProperty;var jr=new WeakMap,rf=(n)=>{var r=jr.get(n),t;if(r)return r;if(r=tr({},"__esModule",{value:!0}),n&&typeof n==="object"||typeof n==="function")Zo(n).map((o)=>!nf.call(r,o)&&tr(r,o,{get:()=>n[o],enumerable:!(t=so(n,o))||t.enumerable}));return jr.set(n,r),r};var Q=(n,r)=>{for(var t in r)tr(n,t,{get:r[t],enumerable:!0,configurable:!0,set:(o)=>r[t]=()=>o})};var j=(n,r)=>()=>(n&&(r=n(n=0)),r);function Ct(n){if(!n)return[];let r=["bold","italic","underline","dim","blink","reverse","strikethrough"];return n.filter((t)=>r.includes(t))}function Pn(n,r){if(r[n])return r[n];return n}function Dr(n,r){if(typeof n==="string")return{color:Pn(n,r)};return{...n,color:Pn(n.color,r)}}function w(n){let r={defaultStyle:{color:Pn(n.defaultTextColor||n.colors.text||"white",n.colors)},matchWords:{},matchPatterns:[],whiteSpace:n.whiteSpace||"preserve",newLine:n.newLine||"preserve"},t=n.presets||["logLevels","booleans","brackets","strings","numbers","dates"];for(let o of t){let f=In[o];if(!f)continue;if(f.words)for(let[i,e]of Object.entries(f.words)){let m=Dr(e,n.colors);r.matchWords[i]=m}if(f.patterns)for(let i of f.patterns){let e={...i,options:Dr(i.options,n.colors)};r.matchPatterns.push(e)}}if(n.customWords)for(let[o,f]of Object.entries(n.customWords)){let i=Dr(f,n.colors);r.matchWords[o]=i}if(n.customPatterns)for(let o of n.customPatterns){let f={name:o.name,pattern:o.pattern,options:{color:Pn(o.color,n.colors),styleCodes:Ct(o.style)}};r.matchPatterns.push(f)}return{name:n.name,description:n.description,mode:n.mode,schema:r,colors:n.colors}}function Hr(n,r,t={}){return w({name:n,colors:r,...t})}function Wr(n,r){let t={name:r.name||`${n.name}-extended`,description:r.description||`Extended version of ${n.name}`,colors:r.colors||{},presets:r.presets,customWords:r.customWords,customPatterns:r.customPatterns,defaultTextColor:r.defaultTextColor,whiteSpace:r.whiteSpace||n.schema.whiteSpace,newLine:r.newLine||n.schema.newLine};if(!r.presets){let o=n.schema.matchWords||{},f=n.schema.matchPatterns||[];t.customWords={...o,...t.customWords},t.customPatterns=[...f.map((i)=>({name:i.name,pattern:i.pattern,color:i.options.color,style:i.options.styleCodes||[]})),...t.customPatterns||[]],t.presets=[]}return w(t)}class vn{config={};constructor(n){this.config.name=n}colors(n){return this.config.colors=n,this}mode(n){return this.config.mode=n,this}build(){if(!this.config.name||!this.config.colors){let n=[];if(!this.config.name)n.push("name");if(!this.config.colors)n.push("colors");throw Error(`Theme validation failed: Missing required fields: ${n.join(", ")}. Please provide a theme name and color configuration.`)}return w(this.config)}static create(n){return new vn(n)}}var In;var X=j(()=>{In={logLevels:{name:"Log Levels",words:{ERROR:{color:"error",styleCodes:["bold"]},WARN:{color:"warning",styleCodes:["bold"]},WARNING:{color:"warning",styleCodes:["bold"]},INFO:{color:"info",styleCodes:["bold"]},DEBUG:{color:"debug"},SUCCESS:{color:"success",styleCodes:["bold"]},TRACE:{color:"muted"},FATAL:{color:"error",styleCodes:["bold"]},CRITICAL:{color:"error",styleCodes:["bold"]}},patterns:[{name:"log-level-brackets",pattern:/\[(ERROR|WARN|WARNING|INFO|DEBUG|SUCCESS|TRACE|FATAL|CRITICAL)\]/gi,options:{color:"primary"}},{name:"log-level-error-bracket",pattern:/\[ERROR\]/gi,options:{color:"error",styleCodes:["bold"]}},{name:"log-level-warn-bracket",pattern:/\[WARN(?:ING)?\]/gi,options:{color:"warning",styleCodes:["bold"]}},{name:"log-level-info-bracket",pattern:/\[INFO\]/gi,options:{color:"info",styleCodes:["bold"]}},{name:"log-level-success-bracket",pattern:/\[SUCCESS\]/gi,options:{color:"success",styleCodes:["bold"]}},{name:"log-level-debug-bracket",pattern:/\[DEBUG\]/gi,options:{color:"debug"}}]},booleans:{name:"Boolean Values",words:{true:{color:"success"},false:{color:"error"},null:{color:"muted",styleCodes:["italic"]},undefined:{color:"muted",styleCodes:["italic"]}},patterns:[]},brackets:{name:"Brackets and Punctuation",patterns:[{name:"curly-brace-left",pattern:"\\{",options:{color:"accent"}},{name:"curly-brace-right",pattern:"\\}",options:{color:"accent"}},{name:"square-bracket-left",pattern:"\\[",options:{color:"accent"}},{name:"square-bracket-right",pattern:"\\]",options:{color:"accent"}},{name:"parenthesis-left",pattern:"\\(",options:{color:"accent"}},{name:"parenthesis-right",pattern:"\\)",options:{color:"accent"}},{name:"equal-sign",pattern:"=",options:{color:"text"}}]},strings:{name:"Strings and Quotes",patterns:[{name:"double-quoted-string",pattern:/"([^"]*)"/g,options:{color:"secondary"}},{name:"single-quoted-string",pattern:/'([^']*)'/g,options:{color:"secondary"}}]},numbers:{name:"Numbers",patterns:[{name:"decimal-number",pattern:/\b\d+\.\d+\b/g,options:{color:"accent"}},{name:"integer",pattern:/\b\d+\b/g,options:{color:"accent"}}]},dates:{name:"Dates and Times",patterns:[{name:"bracketed-timestamp",pattern:/\[\d{4}-\d{2}-\d{2}[T\s]\d{2}:\d{2}:\d{2}[^\]]*\]/g,options:{color:"info"}},{name:"iso-date",pattern:/\d{4}-\d{2}-\d{2}/g,options:{color:"info"}},{name:"time",pattern:/\d{2}:\d{2}:\d{2}/g,options:{color:"info"}}]},timestamps:{name:"Timestamps",patterns:[{name:"iso8601-timestamp",pattern:/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z?/g,options:{color:"info"}}]},urls:{name:"URLs",patterns:[{name:"http-url",pattern:/https?:\/\/[^\s]+/g,options:{color:"accent",styleCodes:["underline"]}}]},paths:{name:"File Paths",patterns:[{name:"unix-path",pattern:/\/[\w\-./]+/g,options:{color:"muted"}},{name:"windows-path",pattern:/[A-Z]:\\[\w\-.\\]+/g,options:{color:"muted"}}]},json:{name:"JSON Keys",patterns:[{name:"json-key",pattern:/"(\w+)":/g,options:{color:"accent"}},{name:"json-key-unquoted",pattern:/\b(\w+):/g,options:{color:"accent"}}]},semantic:{name:"Semantic Versions",patterns:[{name:"semantic-version",pattern:/\bv?\d+\.\d+\.\d+\b/g,options:{color:"primary",styleCodes:["bold"]}}]}}});var Vt={};Q(Vt,{ohMyZsh:()=>pt,default:()=>li});var pt,li;var yt=j(()=>{X();pt=w({name:"oh-my-zsh",description:"Theme inspired by Oh My Zsh terminal colors",mode:"dark",colors:{primary:"#f1c40f",secondary:"#1abc9c",accent:"#f39c12",error:"#e74c3c",warning:"#f39c12",info:"#3498db",success:"#27ae60",debug:"#2ecc71",text:"#ecf0f1",background:"#2c3e50",muted:"#9b59b6"}}),li=pt});var Ft={};Q(Ft,{dracula:()=>Kt,default:()=>mi});var Kt,mi;var Pt=j(()=>{X();Kt=w({name:"dracula",description:"Dark theme based on the popular Dracula color scheme",mode:"dark",colors:{primary:"#ff79c6",secondary:"#8be9fd",accent:"#ffb86c",error:"#ff5555",warning:"#ffb86c",info:"#8be9fd",success:"#50fa7b",debug:"#bd93f9",text:"#f8f8f2",background:"#282a36",muted:"#6272a4"}}),mi=Kt});var at={};Q(at,{nord:()=>It,default:()=>_i});var It,_i;var dt=j(()=>{X();It=w({name:"nord",description:"Arctic, north-bluish clean and elegant theme",mode:"dark",colors:{primary:"#88c0d0",secondary:"#a3be8c",accent:"#ebcb8b",error:"#bf616a",warning:"#d08770",info:"#5e81ac",success:"#a3be8c",debug:"#b48ead",text:"#eceff4",background:"#2e3440",muted:"#4c566a"}}),_i=It});var st={};Q(st,{monokai:()=>Zt,default:()=>gi});var Zt,gi;var no=j(()=>{X();Zt=w({name:"monokai",description:"Classic Monokai color scheme",mode:"dark",colors:{primary:"#f92672",secondary:"#a6e22e",accent:"#fd971f",error:"#f92672",warning:"#fd971f",info:"#66d9ef",success:"#a6e22e",debug:"#ae81ff",text:"#f8f8f2",background:"#272822",muted:"#75715e"}}),gi=Zt});var to={};Q(to,{githubLight:()=>ro,default:()=>Ei});var ro,Ei;var oo=j(()=>{X();ro=w({name:"github-light",description:"Light theme inspired by GitHub's default color scheme",mode:"light",colors:{primary:"#0969da",secondary:"#1f883d",accent:"#656d76",error:"#cf222e",warning:"#fb8500",info:"#0969da",success:"#1f883d",debug:"#8250df",text:"#1f2328",background:"#ffffff",muted:"#656d76"}}),Ei=ro});var io={};Q(io,{githubDark:()=>fo,default:()=>bi});var fo,bi;var eo=j(()=>{X();fo=w({name:"github-dark",description:"Dark theme inspired by GitHub's dark mode",mode:"dark",colors:{primary:"#58a6ff",secondary:"#3fb950",accent:"#8b949e",error:"#f85149",warning:"#f0883e",info:"#58a6ff",success:"#3fb950",debug:"#a5a5ff",text:"#e6edf3",background:"#0d1117",muted:"#8b949e"}}),bi=fo});var mo={};Q(mo,{solarizedLight:()=>lo,default:()=>Si});var lo,Si;var _o=j(()=>{X();lo=w({name:"solarized-light",description:"Light theme based on the popular Solarized color scheme",mode:"light",colors:{primary:"#2aa198",secondary:"#859900",accent:"#b58900",error:"#dc322f",warning:"#cb4b16",info:"#268bd2",success:"#859900",debug:"#6c71c4",text:"#657b83",background:"#fdf6e3",muted:"#d33682"}}),Si=lo});var Eo={};Q(Eo,{solarizedDark:()=>go,default:()=>ui});var go,ui;var bo=j(()=>{X();go=w({name:"solarized-dark",description:"Dark theme based on the popular Solarized color scheme",mode:"dark",colors:{primary:"#2aa198",secondary:"#859900",accent:"#b58900",error:"#dc322f",warning:"#cb4b16",info:"#268bd2",success:"#859900",debug:"#6c71c4",text:"#839496",background:"#002b36",muted:"#d33682"}}),ui=go});var xe={};Q(xe,{watchBackgroundChanges:()=>Nr,validateThemeSafe:()=>ao,validateTheme:()=>xr,tokenize:()=>_n,renderLine:()=>jt,renderLightBoxLine:()=>Fn,renderLightBox:()=>wr,registerThemeLoader:()=>vr,registerTheme:()=>Mo,preloadTheme:()=>Yr,preloadAllThemes:()=>qr,isLightThemeStyle:()=>Br,isLightBackground:()=>Tr,isDarkBackground:()=>Kn,getThemeNames:()=>Jr,getThemeAsync:()=>ho,getTheme:()=>Yn,getRecommendedThemeMode:()=>gn,getLogsDX:()=>ke,getAllThemes:()=>an,extendTheme:()=>Wr,detectTerminalBackground:()=>Vn,detectSystemBackground:()=>yn,detectBrowserBackground:()=>Wn,detectBackground:()=>Gn,default:()=>Ue,createTheme:()=>w,createSimpleTheme:()=>Hr,applyTheme:()=>Hn,ThemeBuilder:()=>vn,THEME_PRESETS:()=>In,LogsDX:()=>H});module.exports=rf(xe);var Cr=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})/,pr=/\b(ERROR|WARN|INFO|DEBUG)\b/,or=/\t+/,fr=/ {2,}/,ir=/ /,er=/\n/,lr=/\r/,Vr=/\s/,yr="tab",mr="spaces",_r="space",Kr="newline",Fr="carriage-return",Pr="whitespace",Ir="timestamp",ar="level",dr="word",gr="regex",Er="default",Zr="char",br="word",$n="regex";var sr="trim",nt="trim";function Sr(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Z(n){return typeof n==="object"&&n!==null}function rt(n){let r=Sr(n);return new RegExp(`\\b${r}\\b`,"i")}function tt(n){if(!Z(n))return;return n.style}function ot(n){if(!Z(n))return;let r=n.pattern;return typeof r==="string"?r:void 0}function ft(n){return Boolean(n.metadata?.style)}function ur(n){try{return new RegExp(n)}catch{return}}function Dn(n){return Array.isArray(n)}class et{text;type;value;ignored;constructor(n,r){this.text=n;this.type=r}accept(n,r){this.type=n,this.value=r}ignore(){this.ignored=!0}}class lt{rules=[];inputContent="";position=0;rule(n,r){this.rules=[...this.rules,{pattern:n,action:r}]}input(n){this.inputContent=n,this.position=0}token(){if(this.position>=this.inputContent.length)return null;let n=this.inputContent.slice(this.position),r=this.findMatchingToken(n);if(r)return r;return this.consumeUnmatchedText()}findMatchingToken(n){for(let{pattern:r,action:t}of this.rules){r.lastIndex=0;let o=r.exec(n);if(o&&o.index===0){let f=o[0],i=new et(f,"");if(t(i),this.position+=f.length,i.ignored)return this.token();return{type:i.type,text:i.text,value:i.value}}}return null}consumeUnmatchedText(){let n=this.position,r=n;while(r<this.inputContent.length){let o=this.inputContent.slice(r);if(this.rules.some(({pattern:i})=>{i.lastIndex=0;let e=i.exec(o);return e&&e.index===0}))break;r++}if(r===n)r=n+1;let t=this.inputContent.slice(n,r);return this.position=r,{type:Zr,text:t}}tokenize(n){this.input(n);let r=[],t;while((t=this.token())!==null)r.push(t);return r}}function tf(n){n.rule(or,(r)=>{r.accept(yr)}),n.rule(fr,(r)=>{r.accept(mr)}),n.rule(ir,(r)=>{r.accept(_r)}),n.rule(er,(r)=>{r.accept(Kr)}),n.rule(lr,(r)=>{r.accept(Fr)}),n.rule(Vr,(r)=>{r.accept(Pr)})}function of(n){n.rule(Cr,(r)=>{r.accept(Ir)}),n.rule(pr,(r)=>{r.accept(ar)})}function ff(n){n.rule(or,(r)=>{r.ignore()}),n.rule(fr,(r)=>{r.accept(mr,{trimmed:!0,originalLength:r.text.length})}),n.rule(ir,(r)=>{r.accept(_r,{trimmed:!0})})}function ef(n){n.rule(er,(r)=>{r.ignore()}),n.rule(lr,(r)=>{r.ignore()})}function lf(n,r){let t=Object.entries(r);for(let[o,f]of t){let i=rt(o);n.rule(i,(e)=>{e.accept(dr,{matchType:br,pattern:o,style:f})})}}function mf(n){return new RegExp(Sr(n),"gi")}function _f(n,r){let t=typeof r==="string"?ur(r):r;if(!t)return!1;t.lastIndex=0;let o=t.exec(n.text);return o!==null&&o[0]===n.text}function gf(n,r){for(let t=0;t<r.length;t++){let o=r[t];if(o.identifier&&typeof o.identifier==="string"){let i=mf(o.identifier);n.rule(i,(e)=>{if(!_f(e,o.pattern)){e.ignore();return}e.accept(gr,{matchType:$n,pattern:o.pattern,name:o.name,index:t,style:o.options})});continue}let f=typeof o.pattern==="string"?ur(o.pattern):o.pattern;if(!f){console.warn(`Invalid regex pattern in theme: ${o.pattern}`);continue}n.rule(f,(i)=>{i.accept(gr,{matchType:$n,pattern:o.pattern,name:o.name,index:t,style:o.options})})}}function Ef(n,r){let t=r.schema;if(!t)return;if(t.whiteSpace===sr)ff(n);if(t.newLine===nt)ef(n);if(t.matchWords)lf(n,t.matchWords);if(t.matchPatterns&&Dn(t.matchPatterns))gf(n,t.matchPatterns);else if(t.matchPatterns)console.warn("matchPatterns is not an array in theme schema")}function bf(n){let r=new lt;if(tf(r),of(r),n)Ef(r,n);return r}function it(n){return{content:n,metadata:{matchType:Er,matchPattern:Er}}}function Sf(n){if(!n)return!1;if(!n.schema)return!0;if(n.schema.matchPatterns&&!Dn(n.schema.matchPatterns))return!0;return!1}function uf(n,r,t){let o=ot(t),f={matchType:n,matchPattern:o||r};if(!Z(t))return f;let i=tt(t);if(i)f.style=i;if(o)f.pattern=o;if(t.name)f.name=t.name;if(t.index!==void 0)f.index=t.index;if(t.trimmed)f.trimmed=t.trimmed;return f}function Af(n){let r=n.type,t=uf(r,n.type,n.value);return{content:n.text,metadata:t}}function Rf(n){return n.map(Af)}function _n(n,r){try{if(Sf(r))return[it(n)];let o=bf(r).tokenize(n);return Rf(o)}catch(t){return console.warn("Tokenization failed:",t),[it(n)]}}function hf(n,r){if(!Dn(n))return;let t=n.find((o)=>Z(o)&&o.name===r);return Z(t)?t:void 0}function Mf(n,r){if(!Dn(n))return;let t=n[r];return Z(t)?t:void 0}function Tf(n,r){let t=n.metadata;if(!t||t.matchType!==br)return;let o=t.pattern;if(typeof o!=="string")return;let f=r.schema?.matchWords;if(!f)return;let i=f[o];if(!i)return;return{...n,metadata:{...t,style:i}}}function Nf(n,r){let t=n.metadata;if(!t||t.matchType!==$n)return;let o=t.name;if(!o)return;let f=hf(r.schema?.matchPatterns,o);if(!f||!f.options)return;return{content:n.content,metadata:{...t,style:f.options}}}function wf(n,r){let t=n.metadata;if(!t||t.matchType!==$n)return;let o=t.index;if(typeof o!=="number")return;let f=Mf(r.schema?.matchPatterns,o);if(!f||!f.options)return;return{content:n.content,metadata:{...t,style:f.options}}}function Bf(n,r){let t=r.schema?.defaultStyle;if(!t)return n;return{...n,metadata:{...n.metadata,style:t}}}function Lf(n,r){if(!n.metadata)return n;if(ft(n))return n;let t=Tf(n,r);if(t)return t;let o=Nf(n,r);if(o)return o;let f=wf(n,r);if(f)return f;return Bf(n,r)}function Hn(n,r){if(!r||!r.schema)return n;return n.map((t)=>Lf(t,r))}var mt="default",_t="white",Ar=4,s=" ",gt="<br>",nn="";var Et=new Set(["whitespace","newline","space","spaces","tab","carriage-return"]),bt=new Set(["spaces","space"]),St="font-weight: bold",ut="font-style: italic",At="text-decoration: underline",Rt="opacity: 0.8",ht="logsdx-bold",Mt="logsdx-italic",Tt="logsdx-underline",Nt="logsdx-dim";function wt(){if(process.env.NO_COLOR)return!1;if(process.env.FORCE_COLOR)return!0;if(process.stdout&&process.stdout.isTTY===!1)return!1;let n=process.env.TERM;if(!n){if(typeof Bun<"u"||"Deno"in globalThis)return!0;return!1}if(n==="dumb")return!1;if(n.includes("color")||n.includes("256")||n.includes("ansi")||n==="xterm"||n==="screen"||n==="tmux"||process.env.COLORTERM)return!0;return!1}var Bt=["iTerm.app","WarpTerminal","Hyper","Alacritty","kitty","WezTerm"],Lt=["Apple_Terminal"],ct={scheme:"dark",confidence:"low",source:"default"},Rr={scheme:"auto",confidence:"low",source:"default"},jn={black:{ansi:"\x1B[30m",hex:"#000000",className:"logsdx__color--black"},red:{ansi:"\x1B[31m",hex:"#ff0000",className:"logsdx__color--red"},green:{ansi:"\x1B[32m",hex:"#00ff00",className:"logsdx__color--green"},yellow:{ansi:"\x1B[33m",hex:"#ffff00",className:"logsdx__color--yellow"},blue:{ansi:"\x1B[34m",hex:"#0000ff",className:"logsdx__color--blue"},magenta:{ansi:"\x1B[35m",hex:"#ff00ff",className:"logsdx__color--magenta"},cyan:{ansi:"\x1B[36m",hex:"#00ffff",className:"logsdx__color--cyan"},white:{ansi:"\x1B[37m",hex:"#ffffff",className:"logsdx__color--white"},brightBlack:{ansi:"\x1B[90m",hex:"#808080",className:"logsdx__color--brightBlack"},brightRed:{ansi:"\x1B[91m",hex:"#ff5555",className:"logsdx__color--brightRed"},brightGreen:{ansi:"\x1B[92m",hex:"#55ff55",className:"logsdx__color--brightGreen"},brightYellow:{ansi:"\x1B[93m",hex:"#ffff55",className:"logsdx__color--brightYellow"},brightBlue:{ansi:"\x1B[94m",hex:"#5555ff",className:"logsdx__color--brightBlue"},brightMagenta:{ansi:"\x1B[95m",hex:"#ff55ff",className:"logsdx__color--brightMagenta"},brightCyan:{ansi:"\x1B[96m",hex:"#55ffff",className:"logsdx__color--brightCyan"},brightWhite:{ansi:"\x1B[97m",hex:"#ffffff",className:"logsdx__color--brightWhite"}};function Cn(n,r){if(jn[n])return jn[n];if(r&&"colorDefinitions"in r&&typeof r.colorDefinitions==="object"&&r.colorDefinitions&&n in r.colorDefinitions)return r.colorDefinitions[n];if(n.startsWith("#"))return{ansi:`\x1B[38;2;${cf(n).join(";")}m`,hex:n,className:`logsdx__color--custom-${n.slice(1)}`};let o={lightGray:"white",darkGray:"brightBlack",gray:"brightBlack",orange:"yellow",purple:"magenta",pink:"brightMagenta",lightGreen:"brightGreen",lightBlue:"brightCyan",forestGreen:"green",base00:"black",base0:"white",violet:"magenta"}[n];if(o&&jn[o])return jn[o];return}function cf(n){let r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return r?[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)]:[0,0,0]}var Ot={black:{ansi:"\x1B[40m",hex:"#000000",className:"logsdx__bg--black"},red:{ansi:"\x1B[41m",hex:"#ff0000",className:"logsdx__bg--red"},green:{ansi:"\x1B[42m",hex:"#00ff00",className:"logsdx__bg--green"},yellow:{ansi:"\x1B[43m",hex:"#ffff00",className:"logsdx__bg--yellow"},blue:{ansi:"\x1B[44m",hex:"#0000ff",className:"logsdx__bg--blue"},magenta:{ansi:"\x1B[45m",hex:"#ff00ff",className:"logsdx__bg--magenta"},cyan:{ansi:"\x1B[46m",hex:"#00ffff",className:"logsdx__bg--cyan"},white:{ansi:"\x1B[47m",hex:"#ffffff",className:"logsdx__bg--white"},brightBlack:{ansi:"\x1B[100m",hex:"#808080",className:"logsdx__bg--brightBlack"},brightRed:{ansi:"\x1B[101m",hex:"#ff5555",className:"logsdx__bg--brightRed"},brightGreen:{ansi:"\x1B[102m",hex:"#55ff55",className:"logsdx__bg--brightGreen"},brightYellow:{ansi:"\x1B[103m",hex:"#ffff55",className:"logsdx__bg--brightYellow"},brightBlue:{ansi:"\x1B[104m",hex:"#5555ff",className:"logsdx__bg--brightBlue"},brightMagenta:{ansi:"\x1B[105m",hex:"#ff55ff",className:"logsdx__bg--brightMagenta"},brightCyan:{ansi:"\x1B[106m",hex:"#55ffff",className:"logsdx__bg--brightCyan"},brightWhite:{ansi:"\x1B[107m",hex:"#ffffff",className:"logsdx__bg--brightWhite"}},W={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",blink:"\x1B[5m",inverse:"\x1B[7m",hidden:"\x1B[8m",strikethrough:"\x1B[9m",resetBold:"\x1B[22m",resetDim:"\x1B[22m",resetItalic:"\x1B[23m",resetUnderline:"\x1B[24m",resetBlink:"\x1B[25m",resetInverse:"\x1B[27m",resetHidden:"\x1B[28m",resetStrikethrough:"\x1B[29m",resetColor:"\x1B[39m",resetBackground:"\x1B[49m"};var Of=/[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d/#&.:=?%@~_]*)*)?\u0007)|(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-ntqry=><~]))/g;function $t(n){return n.replace(Of,"")}function hr(n){return[[/&/g,"&"],[/</g,"<"],[/>/g,">"],[/"/g,"""],[/'/g,"'"]].reduce((t,[o,f])=>t.replace(o,f),n)}var Dt=$t;function D(n,r){if(!n)return!1;return n.includes(r)}function Ht(n){let r=n.split(";");if(r.length<2)return;let t=parseInt(r[1],10);return isNaN(t)?void 0:t}function Wt(n){return[7,15].includes(n)}function rn(n,r){return n.repeat(Math.max(0,r))}function Gt(n,r){let t=Math.max(0,n-r),o=Math.floor(t/2),f=t-o;return[o,f]}function Mr(){return typeof window<"u"}function pn(){return Mr()&&typeof window.matchMedia==="function"}function z(n,r,t,o){return{scheme:n,confidence:r,source:t,...o&&{details:o}}}function $f(){let n=process.env.COLORFGBG;if(!n)return;let r=Ht(n);if(r===void 0)return;let t=Wt(r)?"light":"dark";return z(t,"high","terminal",{colorFgBg:n})}function vt(n,r){return r.includes(n)}function Df(){let n=process.env.TERM_PROGRAM;if(!n)return;if(vt(n,Bt))return z("dark","medium","terminal",{termProgram:n});if(vt(n,Lt))return z("light","medium","terminal",{termProgram:n});return}function Hf(){let n=Boolean(process.env.VSCODE_PID),r=Boolean(process.env.TERM_PROGRAM_VERSION?.includes("vscode"));return n||r}function Wf(){if(!Hf())return;return z("auto","low","terminal",{termProgram:"vscode"})}function Vn(){let n=$f();if(n)return n;let r=Df();if(r)return r;let t=Wf();if(t)return t;return ct}function Yt(n){if(!pn())return!1;return window.matchMedia(`(prefers-color-scheme: ${n})`).matches}function Wn(){if(!pn())return Rr;if(Yt("dark"))return z("dark","high","browser",{mediaQuery:!0,systemPreference:"dark"});if(Yt("light"))return z("light","high","browser",{mediaQuery:!0,systemPreference:"light"});return z("auto","medium","browser",{mediaQuery:!1})}function Gf(){if(process.platform!=="darwin")return;let n=process.env.APPLE_INTERFACE_STYLE;if(!n)return;let r=n.toLowerCase()==="dark"?"dark":"light";return z(r,"high","system",{systemPreference:n})}function vf(){if(process.platform!=="win32")return;return z("auto","low","system")}function Yf(){let n=process.env.DESKTOP_SESSION,r=process.env.XDG_CURRENT_DESKTOP;if(!n&&!r)return;return z("auto","medium","system",{systemPreference:n||r})}function yn(){let n=Gf();if(n)return n;let r=vf();if(r)return r;let t=Yf();if(t)return t;return Rr}function qf(n,r){let t={high:3,medium:2,low:1};return t[n]>=t[r]}function Gn(){if(Mr()){let o=Wn();if(o.confidence==="high")return o}let n=Vn();if(n.confidence==="high"||n.confidence==="medium")return n;let t=yn();if(t.confidence==="high")return t;return qf(n.confidence,t.confidence)?n:t}function Kn(){let n=Gn(),r=n.scheme==="auto"&&n.source==="default";return n.scheme==="dark"||r}function Tr(){return Gn().scheme==="light"}function gn(){return Kn()?"dark":"light"}function Jf(n){if(!pn())return()=>{};let r=window.matchMedia("(prefers-color-scheme: dark)"),t=window.matchMedia("(prefers-color-scheme: light)"),o=()=>{n(Wn())};if(r.addEventListener)return r.addEventListener("change",o),t.addEventListener("change",o),()=>{r.removeEventListener("change",o),t.removeEventListener("change",o)};if(r.addListener)return r.addListener(o),t.addListener(o),()=>{r.removeListener(o),t.removeListener(o)};return()=>{}}function Nr(n){return Jf(n)}var Qf={rounded:{topLeft:"╭",topRight:"╮",bottomLeft:"╰",bottomRight:"╯",horizontal:"─",vertical:"│"},square:{topLeft:"┌",topRight:"┐",bottomLeft:"└",bottomRight:"┘",horizontal:"─",vertical:"│"},double:{topLeft:"╔",topRight:"╗",bottomLeft:"╚",bottomRight:"╝",horizontal:"═",vertical:"║"},simple:{topLeft:"+",topRight:"+",bottomLeft:"+",bottomRight:"+",horizontal:"-",vertical:"|"}},zf={"github-light":"\x1B[48;2;255;255;255m","solarized-light":"\x1B[48;2;253;246;227m","one-light":"\x1B[48;2;250;250;250m","atom-one-light":"\x1B[48;2;250;250;250m"},Xf="\x1B[48;5;255m",qt="\x1B[0m",Jt=80,kf=2,Qt=!0,zt="rounded";function xf(n){let r=typeof n==="string"?n:n.name;return zf[r]||Xf}function Xt(n){return Qf[n]}function Uf(n,r,t){if(!t)return r.topLeft+rn(r.horizontal,n-2)+r.topRight;let o=` ${t} `,[f,i]=Gt(n-2,o.length);return r.topLeft+rn(r.horizontal,f)+o+rn(r.horizontal,i)+r.topRight}function jf(n,r){return r.bottomLeft+rn(r.horizontal,n-2)+r.bottomRight}function Cf(n,r,t){return n-(r?2:0)-t*2}function pf(n,r,t,o,f){let i=Dt(n).length,e=Math.max(0,r-i),m=rn(" ",t),_=rn(" ",e),A=`${m}${n}${_}${m}`;if(f)return`${f}${o}${A}${qt}${f}`;return`${o}${A}${qt}`}function Fn(n,r,t={}){let o=t.width??Jt,f=t.padding??kf,i=t.border??Qt,e=t.borderStyle??zt,m=t.backgroundColor??xf(r),_=Xt(e),A=Cf(o,i,f),O=i?_.vertical:void 0;return pf(n,A,f,m,O)}function wr(n,r,t,o={}){let f=o.width??Jt,i=o.border??Qt,e=o.borderStyle??zt,m=Xt(e),_=[];if(i)_.push(Uf(f,m,t));for(let A of n)_.push(Fn(A,r,o));if(i)_.push(jf(f,m));return _}function Br(n){if(typeof n==="object"&&n.mode)return n.mode==="light";let t=(typeof n==="string"?n:n.name).toLowerCase();return t.includes("light")||t.includes("white")}var Vf={name:mt,schema:{defaultStyle:{color:_t}}};function Lr(n){let r=n.metadata?.matchType;return Boolean(r&&Et.has(r))}function kt(n){return Boolean(n.metadata?.trimmed)}function yf(n){let r=n.metadata?.matchType;if(r==="spaces"&&n.metadata?.originalLength)return" ";if(r==="space")return n.content;return nn}function Kf(n,r){let t=n;if(D(r,"bold"))t=ri(t);if(D(r,"italic"))t=ti(t);if(D(r,"underline"))t=oi(t);if(D(r,"dim"))t=fi(t);return t}function Ff(n,r){if(Lr(n)){if(kt(n))return yf(n);return n.content}let t=n.metadata?.style;if(!t||!r)return n.content;let o=n.content;if(t.color)o=ni(o,t.color);if(o=Kf(o,t.styleCodes),"backgroundColor"in t&&typeof t.backgroundColor==="string")o=ii(o,t.backgroundColor);return o}function cr(n,r){let t=r??wt();return n.map((o)=>Ff(o,t)).join(nn)}function xt(n){if(kt(n)){let t=n.metadata?.matchType;if(t&&bt.has(t))return s;return nn}let r=n.metadata?.matchType;if(r==="tab")return s.repeat(Ar*n.content.length);if(r==="spaces")return s.repeat(n.content.length);if(r==="space")return s;return n.content.replace(/ /g,s).replace(/\t/g,s.repeat(Ar))}function Ut(n){let r=n.metadata?.matchType;if(r==="newline")return gt;if(r==="carriage-return")return nn;return null}function Pf(n,r){let t=[];if(n?.color){let o=Cn(n.color);t.push(`color: ${o?.hex||n.color}`)}if(D(r,"bold"))t.push(St);if(D(r,"italic"))t.push(ut);if(D(r,"underline"))t.push(At);if(D(r,"dim"))t.push(Rt);return t}function If(n,r){if(r.length===0)return n;return`<span style="${r.join("; ")}">${n}</span>`}function af(n,r){let t=Ut(n);if(t!==null)return t;if(Lr(n))return xt(n);let o=n.metadata?.style,f=r.escapeHtml!==!1?hr(n.content):n.content;if(!o)return f;let i=Pf(o,o.styleCodes);return If(f,i)}function Or(n,r={}){return n.map((t)=>af(t,r)).join(nn)}function df(n,r){let t=[];if(n?.color){let o=Cn(n.color);if(o?.className)t.push(o.className)}if(D(r,"bold"))t.push(ht);if(D(r,"italic"))t.push(Mt);if(D(r,"underline"))t.push(Tt);if(D(r,"dim"))t.push(Nt);return t}function Zf(n,r){if(r.length===0)return n;return`<span class="${r.join(" ")}">${n}</span>`}function sf(n,r){let t=Ut(n);if(t!==null)return t;if(Lr(n))return xt(n);let o=n.metadata?.style,f=r.escapeHtml!==!1?hr(n.content):n.content;if(!o)return f;let i=df(o,o.styleCodes);return Zf(f,i)}function $r(n,r={}){return n.map((t)=>sf(t,r)).join(nn)}function jt(n,r,t={}){let o=_n(n,r),f=Hn(o,r||Vf);if(t.outputFormat==="html"){if(t.htmlStyleFormat==="className")return $r(f,t);return Or(f,t)}return cr(f)}function ni(n,r){let t=Cn(r);if(!t)return n;return`${t.ansi}${n}${W.resetColor}`}function ri(n){return`${W.bold}${n}${W.resetBold}`}function ti(n){return`${W.italic}${n}${W.resetItalic}`}function oi(n){return`${W.underline}${n}${W.resetUnderline}`}function fi(n){return`${W.dim}${n}${W.resetDim}`}function ii(n,r){let t=Ot[r];if(!t)return n;return`${t.ansi}${n}${W.resetBackground}`}X();class So{themes=new Map;defaultThemeName="oh-my-zsh";initPromise=null;constructor(){this.registerBuiltInThemes(),this.initPromise=this.initializeDefaultThemes()}registerBuiltInThemes(){let n={"oh-my-zsh":()=>Promise.resolve().then(() => (yt(),Vt)),dracula:()=>Promise.resolve().then(() => (Pt(),Ft)),nord:()=>Promise.resolve().then(() => (dt(),at)),monokai:()=>Promise.resolve().then(() => (no(),st)),"github-light":()=>Promise.resolve().then(() => (oo(),to)),"github-dark":()=>Promise.resolve().then(() => (eo(),io)),"solarized-light":()=>Promise.resolve().then(() => (_o(),mo)),"solarized-dark":()=>Promise.resolve().then(() => (bo(),Eo))};for(let[r,t]of Object.entries(n))this.themes.set(r,{name:r,loader:t})}async initializeDefaultThemes(){try{await this.preloadTheme(this.defaultThemeName)}catch(n){console.warn("Failed to preload default theme:",n)}}async getTheme(n){let r=this.themes.get(n);if(!r){let t=this.themes.get(this.defaultThemeName);if(!t)throw Error(`Default theme "${this.defaultThemeName}" not found in registry`);return this.loadTheme(t)}return this.loadTheme(r)}async loadTheme(n){if(n.theme)return n.theme;if(!n.loader)throw Error(`No loader found for theme "${n.name}"`);let r=await n.loader();return n.theme=r.default,n.theme}getThemeSync(n){let r=this.themes.get(n);if(!r?.theme)return this.themes.get(this.defaultThemeName)?.theme;return r.theme}registerTheme(n){this.themes.set(n.name,{name:n.name,theme:n})}registerThemeLoader(n,r){this.themes.set(n,{name:n,loader:r})}getThemeNames(){return Array.from(this.themes.keys())}getAllLoadedThemes(){let n={};for(let[r,t]of this.themes.entries())if(t.theme)n[r]=t.theme;return n}async preloadTheme(n){await this.getTheme(n)}async preloadAllThemes(){let n=Array.from(this.themes.keys()).map((r)=>this.getTheme(r));await Promise.all(n)}setDefaultTheme(n){this.defaultThemeName=n}hasTheme(n){return this.themes.has(n)}}var K=new So;async function Gr(n){return K.getTheme(n)}function uo(n){K.registerTheme(n)}function vr(n,r){K.registerThemeLoader(n,r)}function Ao(){return K.getThemeNames()}function Ro(){return K.getAllLoadedThemes()}async function Yr(n){return K.preloadTheme(n)}async function qr(){return K.preloadAllThemes()}async function Yn(n){return Gr(n)}async function ho(n){return Gr(n)}function an(){return Ro()}function Jr(){return Ao()}function Mo(n){uo(n)}var Ai=Symbol("Let zodToJsonSchema decide on which parser to use");var T={};Q(T,{void:()=>si,util:()=>M,unknown:()=>di,union:()=>oe,undefined:()=>Pi,tuple:()=>ee,transformer:()=>Re,symbol:()=>Fi,string:()=>Do,strictObject:()=>te,setErrorMap:()=>Mi,set:()=>_e,record:()=>le,quotelessJson:()=>Ri,promise:()=>Ae,preprocess:()=>Te,pipeline:()=>Ne,ostring:()=>we,optional:()=>he,onumber:()=>Be,oboolean:()=>Le,objectUtil:()=>Qr,object:()=>re,number:()=>Ho,nullable:()=>Me,null:()=>Ii,never:()=>Zi,nativeEnum:()=>ue,nan:()=>Vi,map:()=>me,makeIssue:()=>qn,literal:()=>be,lazy:()=>Ee,late:()=>Ci,isValid:()=>F,isDirty:()=>Zn,isAsync:()=>bn,isAborted:()=>dn,intersection:()=>ie,instanceof:()=>pi,getParsedType:()=>k,getErrorMap:()=>En,function:()=>ge,enum:()=>Se,effect:()=>Re,discriminatedUnion:()=>fe,defaultErrorMap:()=>C,datetimeRegex:()=>co,date:()=>Ki,custom:()=>$o,coerce:()=>ce,boolean:()=>Wo,bigint:()=>yi,array:()=>ne,any:()=>ai,addIssueToContext:()=>E,ZodVoid:()=>Qn,ZodUnknown:()=>P,ZodUnion:()=>Mn,ZodUndefined:()=>Rn,ZodType:()=>h,ZodTuple:()=>U,ZodTransformer:()=>J,ZodSymbol:()=>Jn,ZodString:()=>G,ZodSet:()=>en,ZodSchema:()=>h,ZodRecord:()=>zn,ZodReadonly:()=>On,ZodPromise:()=>ln,ZodPipeline:()=>xn,ZodParsedType:()=>g,ZodOptional:()=>Y,ZodObject:()=>N,ZodNumber:()=>I,ZodNullable:()=>V,ZodNull:()=>hn,ZodNever:()=>x,ZodNativeEnum:()=>Bn,ZodNaN:()=>kn,ZodMap:()=>Xn,ZodLiteral:()=>wn,ZodLazy:()=>Nn,ZodIssueCode:()=>l,ZodIntersection:()=>Tn,ZodFunction:()=>un,ZodFirstPartyTypeKind:()=>u,ZodError:()=>$,ZodEnum:()=>d,ZodEffects:()=>J,ZodDiscriminatedUnion:()=>sn,ZodDefault:()=>Ln,ZodDate:()=>on,ZodCatch:()=>cn,ZodBranded:()=>nr,ZodBoolean:()=>An,ZodBigInt:()=>a,ZodArray:()=>v,ZodAny:()=>fn,Schema:()=>h,ParseStatus:()=>B,OK:()=>c,NEVER:()=>Oe,INVALID:()=>S,EMPTY_PATH:()=>Ti,DIRTY:()=>tn,BRAND:()=>ji});var M;(function(n){n.assertEqual=(f)=>{};function r(f){}n.assertIs=r;function t(f){throw Error()}n.assertNever=t,n.arrayToEnum=(f)=>{let i={};for(let e of f)i[e]=e;return i},n.getValidEnumValues=(f)=>{let i=n.objectKeys(f).filter((m)=>typeof f[f[m]]!=="number"),e={};for(let m of i)e[m]=f[m];return n.objectValues(e)},n.objectValues=(f)=>{return n.objectKeys(f).map(function(i){return f[i]})},n.objectKeys=typeof Object.keys==="function"?(f)=>Object.keys(f):(f)=>{let i=[];for(let e in f)if(Object.prototype.hasOwnProperty.call(f,e))i.push(e);return i},n.find=(f,i)=>{for(let e of f)if(i(e))return e;return},n.isInteger=typeof Number.isInteger==="function"?(f)=>Number.isInteger(f):(f)=>typeof f==="number"&&Number.isFinite(f)&&Math.floor(f)===f;function o(f,i=" | "){return f.map((e)=>typeof e==="string"?`'${e}'`:e).join(i)}n.joinValues=o,n.jsonStringifyReplacer=(f,i)=>{if(typeof i==="bigint")return i.toString();return i}})(M||(M={}));var Qr;(function(n){n.mergeShapes=(r,t)=>{return{...r,...t}}})(Qr||(Qr={}));var g=M.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),k=(n)=>{switch(typeof n){case"undefined":return g.undefined;case"string":return g.string;case"number":return Number.isNaN(n)?g.nan:g.number;case"boolean":return g.boolean;case"function":return g.function;case"bigint":return g.bigint;case"symbol":return g.symbol;case"object":if(Array.isArray(n))return g.array;if(n===null)return g.null;if(n.then&&typeof n.then==="function"&&n.catch&&typeof n.catch==="function")return g.promise;if(typeof Map<"u"&&n instanceof Map)return g.map;if(typeof Set<"u"&&n instanceof Set)return g.set;if(typeof Date<"u"&&n instanceof Date)return g.date;return g.object;default:return g.unknown}};var l=M.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Ri=(n)=>{return JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:")};class $ extends Error{get errors(){return this.issues}constructor(n){super();this.issues=[],this.addIssue=(t)=>{this.issues=[...this.issues,t]},this.addIssues=(t=[])=>{this.issues=[...this.issues,...t]};let r=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,r);else this.__proto__=r;this.name="ZodError",this.issues=n}format(n){let r=n||function(f){return f.message},t={_errors:[]},o=(f)=>{for(let i of f.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)t._errors.push(r(i));else{let e=t,m=0;while(m<i.path.length){let _=i.path[m];if(m!==i.path.length-1)e[_]=e[_]||{_errors:[]};else e[_]=e[_]||{_errors:[]},e[_]._errors.push(r(i));e=e[_],m++}}};return o(this),t}static assert(n){if(!(n instanceof $))throw Error(`Not a ZodError: ${n}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,M.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(n=(r)=>r.message){let r={},t=[];for(let o of this.issues)if(o.path.length>0){let f=o.path[0];r[f]=r[f]||[],r[f].push(n(o))}else t.push(n(o));return{formErrors:t,fieldErrors:r}}get formErrors(){return this.flatten()}}$.create=(n)=>{return new $(n)};var hi=(n,r)=>{let t;switch(n.code){case l.invalid_type:if(n.received===g.undefined)t="Required";else t=`Expected ${n.expected}, received ${n.received}`;break;case l.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,M.jsonStringifyReplacer)}`;break;case l.unrecognized_keys:t=`Unrecognized key(s) in object: ${M.joinValues(n.keys,", ")}`;break;case l.invalid_union:t="Invalid input";break;case l.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${M.joinValues(n.options)}`;break;case l.invalid_enum_value:t=`Invalid enum value. Expected ${M.joinValues(n.options)}, received '${n.received}'`;break;case l.invalid_arguments:t="Invalid function arguments";break;case l.invalid_return_type:t="Invalid function return type";break;case l.invalid_date:t="Invalid date";break;case l.invalid_string:if(typeof n.validation==="object")if("includes"in n.validation){if(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position==="number")t=`${t} at one or more positions greater than or equal to ${n.validation.position}`}else if("startsWith"in n.validation)t=`Invalid input: must start with "${n.validation.startsWith}"`;else if("endsWith"in n.validation)t=`Invalid input: must end with "${n.validation.endsWith}"`;else M.assertNever(n.validation);else if(n.validation!=="regex")t=`Invalid ${n.validation}`;else t="Invalid";break;case l.too_small:if(n.type==="array")t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`;else if(n.type==="string")t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`;else if(n.type==="number")t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`;else if(n.type==="bigint")t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`;else if(n.type==="date")t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`;else t="Invalid input";break;case l.too_big:if(n.type==="array")t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`;else if(n.type==="string")t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`;else if(n.type==="number")t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`;else if(n.type==="bigint")t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`;else if(n.type==="date")t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`;else t="Invalid input";break;case l.custom:t="Invalid input";break;case l.invalid_intersection_types:t="Intersection results could not be merged";break;case l.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case l.not_finite:t="Number must be finite";break;default:t=r.defaultError,M.assertNever(n)}return{message:t}},C=hi;var To=C;function Mi(n){To=n}function En(){return To}var qn=(n)=>{let{data:r,path:t,errorMaps:o,issueData:f}=n,i=[...t,...f.path||[]],e={...f,path:i};if(f.message!==void 0)return{...f,path:i,message:f.message};let m="",_=o.filter((A)=>!!A).slice().reverse();for(let A of _)m=A(e,{data:r,defaultError:m}).message;return{...f,path:i,message:m}},Ti=[];function E(n,r){let t=En(),o=qn({issueData:r,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===C?void 0:C].filter((f)=>!!f)});n.common.issues.push(o)}class B{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(n,r){let t=[];for(let o of r){if(o.status==="aborted")return S;if(o.status==="dirty")n.dirty();t.push(o.value)}return{status:n.value,value:t}}static async mergeObjectAsync(n,r){let t=[];for(let o of r){let f=await o.key,i=await o.value;t.push({key:f,value:i})}return B.mergeObjectSync(n,t)}static mergeObjectSync(n,r){let t={};for(let o of r){let{key:f,value:i}=o;if(f.status==="aborted")return S;if(i.status==="aborted")return S;if(f.status==="dirty")n.dirty();if(i.status==="dirty")n.dirty();if(f.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet))t[f.value]=i.value}return{status:n.value,value:t}}}var S=Object.freeze({status:"aborted"}),tn=(n)=>({status:"dirty",value:n}),c=(n)=>({status:"valid",value:n}),dn=(n)=>n.status==="aborted",Zn=(n)=>n.status==="dirty",F=(n)=>n.status==="valid",bn=(n)=>typeof Promise<"u"&&n instanceof Promise;var b;(function(n){n.errToObj=(r)=>typeof r==="string"?{message:r}:r||{},n.toString=(r)=>typeof r==="string"?r:r?.message})(b||(b={}));class q{constructor(n,r,t,o){this._cachedPath=[],this.parent=n,this.data=r,this._path=t,this._key=o}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var No=(n,r)=>{if(F(r))return{success:!0,data:r.value};else{if(!n.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new $(n.common.issues);return this._error=t,this._error}}}};function R(n){if(!n)return{};let{errorMap:r,invalid_type_error:t,required_error:o,description:f}=n;if(r&&(t||o))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(r)return{errorMap:r,description:f};return{errorMap:(e,m)=>{let{message:_}=n;if(e.code==="invalid_enum_value")return{message:_??m.defaultError};if(typeof m.data>"u")return{message:_??o??m.defaultError};if(e.code!=="invalid_type")return{message:m.defaultError};return{message:_??t??m.defaultError}},description:f}}class h{get description(){return this._def.description}_getType(n){return k(n.data)}_getOrReturnCtx(n,r){return r||{common:n.parent.common,data:n.data,parsedType:k(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}_processInputParams(n){return{status:new B,ctx:{common:n.parent.common,data:n.data,parsedType:k(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}}_parseSync(n){let r=this._parse(n);if(bn(r))throw Error("Synchronous parse encountered promise.");return r}_parseAsync(n){let r=this._parse(n);return Promise.resolve(r)}parse(n,r){let t=this.safeParse(n,r);if(t.success)return t.data;throw t.error}safeParse(n,r){let t={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:k(n)},o=this._parseSync({data:n,path:t.path,parent:t});return No(t,o)}"~validate"(n){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:k(n)};if(!this["~standard"].async)try{let t=this._parseSync({data:n,path:[],parent:r});return F(t)?{value:t.value}:{issues:r.common.issues}}catch(t){if(t?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;r.common={issues:[],async:!0}}return this._parseAsync({data:n,path:[],parent:r}).then((t)=>F(t)?{value:t.value}:{issues:r.common.issues})}async parseAsync(n,r){let t=await this.safeParseAsync(n,r);if(t.success)return t.data;throw t.error}async safeParseAsync(n,r){let t={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:k(n)},o=this._parse({data:n,path:t.path,parent:t}),f=await(bn(o)?o:Promise.resolve(o));return No(t,f)}refine(n,r){let t=(o)=>{if(typeof r==="string"||typeof r>"u")return{message:r};else if(typeof r==="function")return r(o);else return r};return this._refinement((o,f)=>{let i=n(o),e=()=>f.addIssue({code:l.custom,...t(o)});if(typeof Promise<"u"&&i instanceof Promise)return i.then((m)=>{if(!m)return e(),!1;else return!0});if(!i)return e(),!1;else return!0})}refinement(n,r){return this._refinement((t,o)=>{if(!n(t))return o.addIssue(typeof r==="function"?r(t,o):r),!1;else return!0})}_refinement(n){return new J({schema:this,typeName:u.ZodEffects,effect:{type:"refinement",refinement:n}})}superRefine(n){return this._refinement(n)}constructor(n){this.spa=this.safeParseAsync,this._def=n,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(r)=>this["~validate"](r)}}optional(){return Y.create(this,this._def)}nullable(){return V.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return v.create(this)}promise(){return ln.create(this,this._def)}or(n){return Mn.create([this,n],this._def)}and(n){return Tn.create(this,n,this._def)}transform(n){return new J({...R(this._def),schema:this,typeName:u.ZodEffects,effect:{type:"transform",transform:n}})}default(n){let r=typeof n==="function"?n:()=>n;return new Ln({...R(this._def),innerType:this,defaultValue:r,typeName:u.ZodDefault})}brand(){return new nr({typeName:u.ZodBranded,type:this,...R(this._def)})}catch(n){let r=typeof n==="function"?n:()=>n;return new cn({...R(this._def),innerType:this,catchValue:r,typeName:u.ZodCatch})}describe(n){return new this.constructor({...this._def,description:n})}pipe(n){return xn.create(this,n)}readonly(){return On.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var Ni=/^c[^\s-]{8,}$/i,wi=/^[0-9a-z]+$/,Bi=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Li=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ci=/^[a-z0-9_-]{21}$/i,Oi=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$i=/^[-+]?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)?)??$/,Di=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Hi="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",zr,Wi=/^(?:(?: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])$/,Gi=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,vi=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Yi=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,qi=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ji=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Bo="((\\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])))",Qi=new RegExp(`^${Bo}$`);function Lo(n){let r="[0-5]\\d";if(n.precision)r=`${r}\\.\\d{${n.precision}}`;else if(n.precision==null)r=`${r}(\\.\\d+)?`;let t=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${r})${t}`}function zi(n){return new RegExp(`^${Lo(n)}$`)}function co(n){let r=`${Bo}T${Lo(n)}`,t=[];if(t.push(n.local?"Z?":"Z"),n.offset)t.push("([+-]\\d{2}:?\\d{2})");return r=`${r}(${t.join("|")})`,new RegExp(`^${r}$`)}function Xi(n,r){if((r==="v4"||!r)&&Wi.test(n))return!0;if((r==="v6"||!r)&&vi.test(n))return!0;return!1}function ki(n,r){if(!Oi.test(n))return!1;try{let[t]=n.split(".");if(!t)return!1;let o=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),f=JSON.parse(atob(o));if(typeof f!=="object"||f===null)return!1;if("typ"in f&&f?.typ!=="JWT")return!1;if(!f.alg)return!1;if(r&&f.alg!==r)return!1;return!0}catch{return!1}}function xi(n,r){if((r==="v4"||!r)&&Gi.test(n))return!0;if((r==="v6"||!r)&&Yi.test(n))return!0;return!1}class G extends h{_parse(n){if(this._def.coerce)n.data=String(n.data);if(this._getType(n)!==g.string){let f=this._getOrReturnCtx(n);return E(f,{code:l.invalid_type,expected:g.string,received:f.parsedType}),S}let t=new B,o=void 0;for(let f of this._def.checks)if(f.kind==="min"){if(n.data.length<f.value)o=this._getOrReturnCtx(n,o),E(o,{code:l.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),t.dirty()}else if(f.kind==="max"){if(n.data.length>f.value)o=this._getOrReturnCtx(n,o),E(o,{code:l.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),t.dirty()}else if(f.kind==="length"){let i=n.data.length