@stacksjs/bunpress 0.1.11 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/bin/cli.d.ts +26 -0
  2. package/dist/bin/cli.js +1 -1
  3. package/dist/bin/commands/clean.d.ts +9 -0
  4. package/dist/bin/commands/config.d.ts +15 -0
  5. package/dist/bin/commands/doctor.d.ts +7 -0
  6. package/dist/bin/commands/init.d.ts +9 -0
  7. package/dist/bin/commands/new.d.ts +9 -0
  8. package/dist/bin/commands/preview.d.ts +11 -0
  9. package/dist/bin/commands/seo.d.ts +7 -0
  10. package/dist/bin/commands/stats.d.ts +8 -0
  11. package/dist/bin/utils.d.ts +83 -0
  12. package/dist/{chunk-w6byd4st.js → chunk-43fsk0jg.js} +1 -1
  13. package/dist/chunk-bqrr0kn9.js +688 -0
  14. package/dist/chunk-ejcvtq7c.js +496 -0
  15. package/dist/{chunk-0sfpwr5e.js → chunk-h07knheg.js} +1 -1
  16. package/dist/{chunk-e5q66hsy.js → chunk-pa3gwajr.js} +1 -1
  17. package/dist/{chunk-semwkmam.js → chunk-sd994fph.js} +1 -1
  18. package/dist/{chunk-zdvnysqn.js → chunk-xenbc8gk.js} +3 -3
  19. package/dist/src/index.js +1 -1
  20. package/dist/{themes → src/themes}/bun/index.d.ts +1 -0
  21. package/dist/{themes → src/themes}/index.d.ts +3 -6
  22. package/dist/src/themes/vitepress/index.d.ts +33 -0
  23. package/dist/{types.d.ts → src/types.d.ts} +10 -0
  24. package/dist/templates/sidebar-section.stx +1 -1
  25. package/package.json +5 -4
  26. package/dist/chunk-rfaz4x5j.js +0 -658
  27. package/dist/chunk-sregzvcv.js +0 -466
  28. package/dist/chunk-ss6yzy9f.js +0 -33
  29. package/dist/themes/vitepress/index.d.ts +0 -210
  30. /package/dist/{config.d.ts → src/config.d.ts} +0 -0
  31. /package/dist/{data-loader.d.ts → src/data-loader.d.ts} +0 -0
  32. /package/dist/{highlighter.d.ts → src/highlighter.d.ts} +0 -0
  33. /package/dist/{index.d.ts → src/index.d.ts} +0 -0
  34. /package/dist/{robots.d.ts → src/robots.d.ts} +0 -0
  35. /package/dist/{rss.d.ts → src/rss.d.ts} +0 -0
  36. /package/dist/{serve.d.ts → src/serve.d.ts} +0 -0
  37. /package/dist/{sitemap.d.ts → src/sitemap.d.ts} +0 -0
  38. /package/dist/{stx-components.d.ts → src/stx-components.d.ts} +0 -0
  39. /package/dist/{template-loader.d.ts → src/template-loader.d.ts} +0 -0
  40. /package/dist/{toc.d.ts → src/toc.d.ts} +0 -0
@@ -0,0 +1,688 @@
1
+ // @bun
2
+ import{N as V}from"./chunk-43fsk0jg.js";import{existsSync as Do,readFileSync as Lo}from"fs";import{join as Ar}from"path";import{existsSync as zr,statSync as Tr}from"fs";import{existsSync as Lc,mkdirSync as $f,readdirSync as ed,readFileSync as Wc,writeFileSync as td}from"fs";import{homedir as ce}from"os";import{dirname as ad,resolve as I}from"path";import mt from"process";import{existsSync as Fr,statSync as Or}from"fs";import{existsSync as Kt,mkdirSync as Mc,readdirSync as qc,writeFileSync as Ic}from"fs";import{homedir as ue}from"os";import{dirname as Rr,resolve as L}from"path";import le from"process";import{join as Zc,relative as Uc,resolve as Br}from"path";import et from"process";import{existsSync as Gi,mkdirSync as pd,readdirSync as gd,writeFileSync as md}from"fs";import{homedir as At}from"os";import{dirname as wd,resolve as D}from"path";import Ne from"process";import{join as Qc,relative as Hc,resolve as Yr}from"path";import tt from"process";import{existsSync as _i,mkdirSync as Ed,readdirSync as Ad,writeFileSync as Sd}from"fs";import{dirname as jd,resolve as rt}from"path";import Vt from"process";import{Buffer as oe}from"buffer";import{createCipheriv as Xc,createDecipheriv as Kc,randomBytes as St}from"crypto";import{closeSync as Nt,createReadStream as Pr,createWriteStream as Vc,existsSync as jt,fsyncSync as Dr,openSync as Lr,writeFileSync as Gc}from"fs";import{access as _c,constants as Wr,mkdir as Jc,readdir as Re,rename as Mr,stat as fe,unlink as Be,writeFile as zt}from"fs/promises";import{join as de}from"path";import B from"process";import{pipeline as $c}from"stream/promises";import{createGzip as qr}from"zlib";import he from"process";import J from"process";import{Buffer as G}from"buffer";import{createCipheriv as eu,createDecipheriv as tu,randomBytes as Tt}from"crypto";import{closeSync as Ft,createReadStream as Ir,createWriteStream as ru,existsSync as Ye,fsyncSync as Zr,openSync as Ur,writeFileSync as iu}from"fs";import{access as au,constants as Qr,mkdir as ou,readdir as Pe,rename as Hr,stat as pe,unlink as De,writeFile as Ot}from"fs/promises";import{isAbsolute as nu,join as ge,resolve as su}from"path";import C from"process";import{pipeline as lu}from"stream/promises";import{createGzip as Xr}from"zlib";import me from"process";import $ from"process";import Le from"process";import{existsSync as We}from"fs";import{resolve as Rt}from"path";import{existsSync as cu}from"fs";import{existsSync as uu,readdirSync as fu}from"fs";import{extname as Bt,resolve as Kr}from"path";import du from"process";import{join as hu,relative as pu,resolve as Vr}from"path";import it from"process";import{Buffer as _}from"buffer";import{createCipheriv as gu,createDecipheriv as mu,randomBytes as Yt}from"crypto";import{closeSync as Pt,createReadStream as Gr,createWriteStream as yu,existsSync as Me,fsyncSync as _r,openSync as Jr,writeFileSync as bu}from"fs";import{access as wu,constants as $r,mkdir as vu,readdir as qe,rename as ei,stat as ye,unlink as Ie,writeFile as Dt}from"fs/promises";import{isAbsolute as xu,join as be,resolve as ku}from"path";import E from"process";import{pipeline as Cu}from"stream/promises";import{createGzip as ti}from"zlib";import we from"process";import ee from"process";import Ze from"process";import{existsSync as Ue}from"fs";import{resolve as Lt}from"path";import{existsSync as Eu}from"fs";var br=new Map,ae=new Map,Oa={col:"col",row:"row",jc:"justify",ji:"justify-items",js:"justify-self",ai:"items",ac:"content",as:"self",wrap:"wrap",nowrap:"nowrap",c:"center",s:"start",e:"end",sb:"between",sa:"around",se:"evenly",st:"stretch",thin:"thin",extralight:"extralight",light:"light",normal:"normal",medium:"medium",semibold:"semibold",bold:"bold",extrabold:"extrabold",black:"black",t:"top",r:"right",b:"bottom",l:"left"},Ra=/[%#()]/,Ba=/^\d+(\.\d+)?(px|rem|em|vh|vw|dvh|dvw|svh|svw|lvh|lvw|ch|ex|lh|cap|ic|rlh|vi|vb|vmin|vmax|cqw|cqh|cqi|cqb|cqmin|cqmax|cm|mm|in|pt|pc|Q)$/;function q(e){return Ra.test(e)||Ba.test(e)}function Fe(e){if(!e.includes("_"))return e;let t="",r=0;while(r<e.length){let i=e[r];if(i==="\\"&&e[r+1]==="_"){t+="_",r+=2;continue}if(i==="u"&&e.slice(r,r+4)==="url("){let a=r,o=1;r+=4;while(r<e.length&&o>0){if(e[r]==="(")o++;else if(e[r]===")")o--;r++}t+=e.slice(a,r);continue}t+=i==="_"?" ":i,r++}return t}function wr(e,t){if(t.length!==2)return null;let[r,i]=t;if(r!=="min"&&r!=="max")return null;return[q(i)?`${r}-${e}-[${i}]`:`${r}-${e}-${i}`]}var Ya={flex:{expand:(e,t)=>{let r=t[e]||e;if(["col","row","col-reverse","row-reverse","wrap","nowrap","wrap-reverse"].includes(r))return`flex-${r}`;let i=e.match(/^(jc|ji|js|ai|ac|as)-(.+)$/);if(i){let a=t[i[1]]||i[1],o=t[i[2]]||i[2];return`${a}-${o}`}if(/^\d+$/.test(r)||["grow","shrink","auto","initial","none"].includes(r))return`flex-${r}`;return null}},grid:{expand:(e,t)=>{let r=t[e]||e;if(e.startsWith("cols-")||e.startsWith("rows-"))return`grid-${e}`;if(e.startsWith("flow-"))return`grid-${e}`;if(e.startsWith("gap-"))return e;return null}},text:{expand:(e,t)=>{let r=t[e]||e;if(q(r))return`text-[${r}]`;if(/^\d{3}$/.test(r))return{"100":"font-thin","200":"font-extralight","300":"font-light","400":"font-normal","500":"font-medium","600":"font-semibold","700":"font-bold","800":"font-extrabold","900":"font-black"}[r]||`font-[${r}]`;if(/^[a-z-]+$/i.test(r)&&!["xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","9xl"].includes(r)){if(["white","black","red","blue","green","yellow","purple","pink","gray","slate","zinc","neutral","stone","orange","amber","lime","emerald","teal","cyan","sky","indigo","violet","fuchsia","rose","inherit","current","transparent"].includes(r.toLowerCase()))return`text-${r}`;return`font-[${r}]`}return`text-${r}`}},font:{expand:(e,t)=>{let r=t[e]||e,i=["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],a=["sans","serif","mono"];if(i.includes(r)||a.includes(r))return`font-${r}`;if(/^\d{3}$/.test(r))return{"100":"font-thin","200":"font-extralight","300":"font-light","400":"font-normal","500":"font-medium","600":"font-semibold","700":"font-bold","800":"font-extrabold","900":"font-black"}[r]||`font-[${r}]`;return`font-[${r}]`}},bg:{expand:(e,t)=>{return`bg-${t[e]||e}`}},w:{expand:(e,t)=>{let r=t[e]||e;if(q(r))return`w-[${r}]`;return`w-${r}`},multiValue:(e)=>wr("w",e)},h:{expand:(e,t)=>{let r=t[e]||e;if(q(r))return`h-[${r}]`;return`h-${r}`},multiValue:(e)=>wr("h",e)},p:{expand:(e)=>`p-${e}`},px:{expand:(e)=>`px-${e}`},py:{expand:(e)=>`py-${e}`},pt:{expand:(e)=>`pt-${e}`},pr:{expand:(e)=>`pr-${e}`},pb:{expand:(e)=>`pb-${e}`},pl:{expand:(e)=>`pl-${e}`},m:{expand:(e)=>`m-${e}`},mx:{expand:(e)=>`mx-${e}`},my:{expand:(e)=>`my-${e}`},mt:{expand:(e)=>`mt-${e}`},mr:{expand:(e)=>`mr-${e}`},mb:{expand:(e)=>`mb-${e}`},ml:{expand:(e)=>`ml-${e}`},scroll:{expand:(e)=>{if(["x","y"].includes(e))return null;if(["auto","hidden","scroll","visible"].includes(e))return`overflow-${e}`;return null},multiValue:(e)=>{if(e.length===2){let[t,r]=e;if(["x","y"].includes(t)&&["auto","hidden","scroll","visible"].includes(r))return[`overflow-${t}-${r}`]}return null}},overflow:{expand:(e)=>`overflow-${e}`,multiValue:(e)=>{if(e.length===2){let[t,r]=e;if(["x","y"].includes(t))return[`overflow-${t}-${r}`]}return null}},border:{expand:(e)=>`border-${e}`},rounded:{expand:(e)=>`rounded-${e}`},shadow:{expand:(e)=>`shadow-${e}`},gap:{expand:(e)=>{if(e.startsWith("x-")||e.startsWith("y-"))return`gap-${e}`;return`gap-${e}`}},space:{expand:(e)=>`space-${e}`},opacity:{expand:(e)=>`opacity-${e}`},z:{expand:(e)=>`z-${e}`},inset:{expand:(e,t)=>{let r=t[e]||e;if(r.startsWith("x-")||r.startsWith("y-"))return`inset-${r}`;if(q(r))return`inset-[${r}]`;return`inset-${r}`}},top:{expand:(e)=>q(e)?`top-[${e}]`:`top-${e}`},right:{expand:(e)=>q(e)?`right-[${e}]`:`right-${e}`},bottom:{expand:(e)=>q(e)?`bottom-[${e}]`:`bottom-${e}`},left:{expand:(e)=>q(e)?`left-[${e}]`:`left-${e}`},duration:{expand:(e)=>`duration-${e}`},delay:{expand:(e)=>`delay-${e}`},ease:{expand:(e)=>`ease-${e}`},transition:{expand:(e)=>{if(["all","none","colors","opacity","shadow","transform"].includes(e))return`transition-${e}`;if(/^\d+$/.test(e))return`duration-${e}`;if(["linear","in","out","in-out","ease-linear","ease-in","ease-out","ease-in-out"].includes(e))return e.startsWith("ease-")?e:`ease-${e}`;return`transition-${e}`}},translate:{expand:(e)=>{if(e.startsWith("x-")||e.startsWith("y-")||e.startsWith("z-"))return`translate-${e}`;return`translate-${e}`}},rotate:{expand:(e)=>{if(e.startsWith("x-")||e.startsWith("y-")||e.startsWith("z-"))return`rotate-${e}`;return`rotate-${e}`}},scale:{expand:(e)=>{if(e.startsWith("x-")||e.startsWith("y-")||e.startsWith("z-"))return`scale-${e}`;return`scale-${e}`}},skew:{expand:(e)=>{if(e.startsWith("x-")||e.startsWith("y-"))return`skew-${e}`;return`skew-${e}`}},origin:{expand:(e)=>`origin-${e}`},cursor:{expand:(e)=>`cursor-${e}`},select:{expand:(e)=>`select-${e}`},resize:{expand:(e)=>`resize-${e}`},appearance:{expand:(e)=>`appearance-${e}`},pointer:{expand:(e)=>`pointer-events-${e}`},outline:{expand:(e)=>`outline-${e}`},ring:{expand:(e)=>`ring-${e}`},blur:{expand:(e)=>`blur-${e}`},brightness:{expand:(e)=>`brightness-${e}`},contrast:{expand:(e)=>`contrast-${e}`},grayscale:{expand:(e)=>`grayscale-${e}`},saturate:{expand:(e)=>`saturate-${e}`},sepia:{expand:(e)=>`sepia-${e}`},backdrop:{expand:(e)=>`backdrop-${e}`},aspect:{expand:(e)=>`aspect-${e}`},columns:{expand:(e)=>`columns-${e}`},break:{expand:(e)=>`break-${e}`},object:{expand:(e)=>`object-${e}`},overscroll:{expand:(e)=>`overscroll-${e}`},place:{expand:(e)=>`place-${e}`},items:{expand:(e)=>`items-${e}`},justify:{expand:(e)=>`justify-${e}`},content:{expand:(e)=>`content-${e}`},self:{expand:(e)=>`self-${e}`},order:{expand:(e)=>`order-${e}`},col:{expand:(e)=>`col-${e}`},row:{expand:(e)=>`row-${e}`},tracking:{expand:(e)=>`tracking-${e}`},leading:{expand:(e)=>`leading-${e}`},list:{expand:(e)=>`list-${e}`},decoration:{expand:(e)=>`decoration-${e}`},underline:{expand:(e)=>`underline-${e}`},accent:{expand:(e)=>`accent-${e}`},caret:{expand:(e)=>`caret-${e}`},"scroll-m":{expand:(e)=>`scroll-m-${e}`},"scroll-p":{expand:(e)=>`scroll-p-${e}`},snap:{expand:(e)=>`snap-${e}`},touch:{expand:(e)=>`touch-${e}`},will:{expand:(e)=>`will-change-${e}`},fill:{expand:(e)=>`fill-${e}`},stroke:{expand:(e)=>`stroke-${e}`},sr:{expand:(e)=>`sr-${e}`},invert:{expand:(e)=>`invert-${e}`},"hue-rotate":{expand:(e)=>q(e)?`hue-rotate-[${e}]`:`hue-rotate-${e}`},"drop-shadow":{expand:(e)=>`drop-shadow-${e}`},"backdrop-invert":{expand:(e)=>`backdrop-invert-${e}`},"backdrop-hue-rotate":{expand:(e)=>q(e)?`backdrop-hue-rotate-[${e}]`:`backdrop-hue-rotate-${e}`},animate:{expand:(e)=>`animate-${e}`},"forced-colors":{expand:(e)=>`forced-colors-${e}`}},Ee=new Set(["sm","md","lg","xl","2xl","hover","focus","active","visited","disabled","enabled","focus-within","focus-visible","group-hover","group-focus","peer-hover","peer-focus","dark","first","last","odd","even","only","first-of-type","last-of-type","checked","indeterminate","default","required","valid","invalid","in-range","out-of-range","placeholder-shown","autofill","read-only","empty","before","after","selection","marker","file","print","motion-safe","motion-reduce","contrast-more","contrast-less","rtl","ltr","portrait","landscape","@sm","@md","@lg","@xl","@2xl"]);function gi(e,t){let r=`${e}:${t?.colonSyntax}:${JSON.stringify(t?.aliases||{})}`,i=ae.get(r);if(i)return i;let a={...Oa,...t?.aliases};if(t?.colonSyntax===!0){let p=e.match(/^([a-z][a-z0-9-]*):([^[\]:]+)$/i);if(p){let[,b,g]=p;if(!Ee.has(b)){if(q(g)){let w=[`${b}-[${g}]`];return ae.set(r,w),w}let m=[`${b}-${g}`];return ae.set(r,m),m}}}let o="",s=e,l=!1;if(s.startsWith("-"))l=!0,s=s.slice(1);let n=s.match(/^((?:[a-z@][a-z0-9-]*:)+)(.+)$/i);if(n){if(n[1].slice(0,-1).split(":").every((p)=>Ee.has(p)))o=n[1],s=n[2]}let c=s.match(/^([a-z][a-z0-9-]*)\[([^\]]*)\]$/i);if(!c||s.includes("-[")){let p=[e];return ae.set(r,p),p}let[,u,f]=c,d=f.split(/\s+/).filter(Boolean);if(d.length===0)return ae.set(r,[]),[];let h=Ya[u.toLowerCase()];if(h?.multiValue){let p=h.multiValue(d,a);if(p){let b=p.map((g)=>{return`${o}${l?"-":""}${g}`});return ae.set(r,b),b}}if(!h){let p=[];for(let b of d){let g=b.match(/^([a-z@][a-z0-9-]*):(.+)$/i),m="",w=b;if(g&&Ee.has(g[1]))m=`${g[1]}:`,w=g[2];let j="";if(w.startsWith("-"))j="-",w=w.slice(1);let k="";if(w.endsWith("!"))k="!",w=w.slice(0,-1);let X=l?"-":"";if(q(w))p.push(`${o}${m}${k}${X}${j}${u}-[${w}]`);else p.push(`${o}${m}${k}${X}${j}${u}-${w}`)}return ae.set(r,p),p}let y=[];for(let p of d){let b=p.match(/^([a-z@][a-z0-9-]*):(.+)$/i),g="",m=p;if(b&&Ee.has(b[1]))g=`${b[1]}:`,m=b[2];let w="";if(m.startsWith("-"))w="-",m=m.slice(1);let j="";if(m.endsWith("!"))j="!",m=m.slice(0,-1);let k=h.expand(m,a);if(k){let X=l?"-":"";y.push(`${o}${g}${j}${X}${w}${k}`)}}return ae.set(r,y),y}function mi(e,t){let r=new Set;if(!t?.enabled)return r;let i=t.prefix??"hw-",a=["class","className","style","id","name","type","value","href","src","alt","title","role","for","action","method","target","rel","placeholder","disabled","checked","selected","readonly","required","maxlength","minlength","pattern","autocomplete","autofocus","tabindex","contenteditable","draggable","spellcheck","lang","dir","hidden","slot","part","is","key","ref"],o=t.ignoreAttributes||a,s=(c)=>{let u=c.includes(":")?c.split(":").pop():c;for(let f of o)if(f.endsWith("*")){if(u.startsWith(f.slice(0,-1)))return!0}else if(u===f)return!0;if(u.startsWith("on"))return!0;if(u.startsWith("data-")||u.startsWith("aria-"))return!0;return!1},l=/<([a-z][a-z0-9-]*)\s([^>]*)>/gi,n;while((n=l.exec(e))!==null){let c=n[2],u=/([a-z][a-z0-9-:]*)(?:=["']([^"']*)["'])?(?=\s|$|\/?>)/gi,f;while((f=u.exec(c))!==null){let d=f[1],h=f[2];if(i){if(!d.startsWith(i))continue;d=d.slice(i.length)}if(s(d))continue;let y="",p=d,b=d.match(/^((?:[a-z@][a-z0-9-]*:)+)([a-z][a-z0-9-]*)$/i);if(b){if(b[1].slice(0,-1).split(":").every((g)=>Ee.has(g)))y=b[1],p=b[2]}if(h!==void 0){let g=h.split(/\s+/).filter(Boolean);for(let m of g){let w=`${y}${p}-${m}`;if(vr(w.replace(/^(?:[a-z@][a-z0-9-]*:)+/gi,"")))r.add(w)}}else{let g=`${y}${p}`;if(vr(p))r.add(g)}}}return r}function vr(e){if(!e||e.length===0)return!1;return/^[a-z][a-z0-9-/]*(?:-\[[^\]]+\])?$/i.test(e)}function yi(e){let t=br.get(e);if(t)return t;let r=Pa(e);return br.set(e,r),r}function Pa(e){let t=!1,r=e;if(e.startsWith("!"))t=!0,r=e.slice(1);else if(e.endsWith("!")&&e.length>1)t=!0,r=e.slice(0,-1);let i=r.match(/^\[([a-z-]+):(.+)\]$/);if(i)return{raw:e,variants:[],utility:i[1],value:Fe(i[2]),important:t,arbitrary:!0};let a=r.match(/^((?:[a-z-]+:)*)(-?[a-z-]+?)-\[([^\]]+)\]\/\[([^\]]+)\]$/);if(a){let[,g,m,w,j]=a,k=g?g.split(":").filter(Boolean):[],X=m.startsWith("-"),ke=X?m.slice(1):m,Ce=Fe(w);if(X)Ce=Ce.startsWith("-")?Ce:`-${Ce}`;return{raw:e,variants:k,utility:ke,value:`${Ce}/${j}`,important:t,arbitrary:!0}}let o=r.match(/^((?:[a-z-]+:)*)(-?[a-z-]+?)-\[(.+)\]$/);if(o){let g=o[1],m=g?g.split(":").filter(Boolean):[],w=o[2],j=w.startsWith("-");if(j)w=w.slice(1);let k=Fe(o[3]),X,ke=k.match(/^(color|length|url|number|percentage|position|line-width|absolute-size|relative-size|image|angle|time|flex|string|family-name):(.*)/i);if(ke)X=ke[1].toLowerCase(),k=ke[2];if(j)k=k.startsWith("-")?k:`-${k}`;return{raw:e,variants:m,utility:w,value:k,important:t,arbitrary:!0,typeHint:X}}let s=[],l="",n=0;for(let g=0;g<r.length;g++){let m=r[g];if(m==="[")n++;else if(m==="]")n--;if(m===":"&&n===0)s.push(l),l="";else l+=m}s.push(l);let c=s[s.length-1],u=s.slice(0,-1);if(c.startsWith("!")&&c.length>1)t=!0,c=c.slice(1);else if(c.endsWith("!")&&c.length>1)t=!0,c=c.slice(0,-1);if(u.length>0)r=`${u.join(":")}:${c}`;else r=c;if(["inline-block","inline-flex","inline-grid","flex-row","flex-row-reverse","flex-col","flex-col-reverse","flex-wrap","flex-wrap-reverse","flex-nowrap","flex-1","flex-auto","flex-initial","flex-none","flex-grow","flex-shrink"].includes(c))return{raw:e,variants:u,utility:c,value:void 0,important:t,arbitrary:!1};let f=c.match(/^([a-z-]+?)-\[(.+?)\]$/);if(f){let g=Fe(f[2]),m,w=g.match(/^(color|length|url|number|percentage|position|line-width|absolute-size|relative-size|image|angle|time|flex|string|family-name):(.*)/i);if(w)m=w[1].toLowerCase(),g=w[2];return{raw:e,variants:u,utility:f[1],value:g,important:t,arbitrary:!0,typeHint:m}}let d=["inset-x","inset-y","border-t","border-r","border-b","border-l","border-x","border-y","border-s","border-e","grid-cols","grid-rows","grid-flow","auto-cols","auto-rows","col-span","row-span","col-start","col-end","row-start","row-end","translate-x","translate-y","translate-z","scale-x","scale-y","scale-z","rotate-x","rotate-y","rotate-z","skew-x","skew-y","scroll-m","scroll-mx","scroll-my","scroll-mt","scroll-mr","scroll-mb","scroll-ml","scroll-p","scroll-px","scroll-py","scroll-pt","scroll-pr","scroll-pb","scroll-pl","gap-x","gap-y","overflow-x","overflow-y","min-w","max-w","min-h","max-h","space-x","space-y","ring-offset","underline-offset","outline-offset","backdrop-blur","backdrop-brightness","backdrop-contrast","backdrop-grayscale","backdrop-invert","backdrop-saturate","backdrop-sepia","hue-rotate","drop-shadow","mask-clip","flex-grow","flex-shrink","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","perspective-origin","justify-self","form-input","form-textarea","form-select","form-multiselect","form-checkbox","form-radio","mix-blend","bg-blend","line-clamp","border-spacing","border-spacing-x","border-spacing-y","rounded-s","rounded-e","rounded-ss","rounded-se","rounded-es","rounded-ee","rounded-t","rounded-r","rounded-b","rounded-l","rounded-tl","rounded-tr","rounded-bl","rounded-br","border-opacity","ring-opacity","stroke-dasharray","stroke-dashoffset","animate-iteration","animate-duration","animate-delay","text-emphasis-color","text-emphasis","word-spacing","column-gap","column-rule"];if(c==="divide-x"||c==="divide-y")return{raw:e,variants:u,utility:c,value:void 0,important:t,arbitrary:!1};let h=c.match(/^(divide-[xy])-(.+)$/);if(h)return{raw:e,variants:u,utility:h[1],value:h[2],important:t,arbitrary:!1};for(let g of d)if(c.startsWith(`${g}-`))return{raw:e,variants:u,utility:g,value:c.slice(g.length+1),important:t,arbitrary:!1};if(c.startsWith("-")){let g=c.slice(1);for(let w of d)if(g.startsWith(`${w}-`))return{raw:e,variants:u,utility:w,value:`-${g.slice(w.length+1)}`,important:t,arbitrary:!1};let m=g.match(/^([a-z]+(?:-[a-z]+)*?)-(.+)$/);if(m)return{raw:e,variants:u,utility:m[1],value:`-${m[2]}`,important:t,arbitrary:!1};return{raw:e,variants:u,utility:g,value:void 0,important:t,arbitrary:!1}}let y=c.match(/^([a-z]+(?:-[a-z]+)*?)-(.+?)\/(\d+|\[\d*\.?\d+\])$/);if(y&&["bg","text","border","ring","placeholder","divide","accent","caret","fill","stroke","outline","decoration","shadow","ring-offset","from","via","to"].includes(y[1]))return{raw:e,variants:u,utility:y[1],value:`${y[2]}/${y[3]}`,important:t,arbitrary:!1};let p=c.match(/^([a-z]+(?:-[a-z]+)*?)-(\d+)\/(\d+)$/);if(p)return{raw:e,variants:u,utility:p[1],value:`${p[2]}/${p[3]}`,important:t,arbitrary:!1};let b=c.match(/^([a-z]+(?:-[a-z]+)*?)-(.+)$/);if(b)return{raw:e,variants:u,utility:b[1],value:b[2],important:t,arbitrary:!1};return{raw:e,variants:u,utility:c,value:void 0,important:t,arbitrary:!1}}function Da(e,t){if(!e||e.length===0)return!1;if(/^\[[a-z-]+:[^\]]+\]$/i.test(e))return!0;if(t?.enabled&&/^[a-z]+\[[^\]]+\]$/i.test(e))return!0;if(t?.colonSyntax&&/^[a-z]+:[^[\]:]+$/i.test(e))return!0;return/^!?-?[a-z][a-z0-9.-]*(?:-\[[^\]]+\])?(?::!?-?[a-z][a-z0-9.-]*(?:-\[[^\]]+\])?)*$/i.test(e)}function xr(e){let t=[],r="",i=0;for(let a of e)if(a==="[")i++,r+=a;else if(a==="]")i--,r+=a;else if(/\s/.test(a)&&i===0){if(r)t.push(r),r=""}else r+=a;if(r)t.push(r);return t}function Se(e,t){let r=new Set,i=[/class(?:Name)?=["']([^"']+)["']/g,/class(?:Name)?=\{["']([^"']+)["']\}/g,/class(?:Name)?=\{`([^`]+)`\}/g];for(let a of i){let o;while((o=a.exec(e))!==null){let s=o[1],l=s.match(/["']([^"']+)["']/g);if(l)for(let u of l){let f=u.replace(/["']/g,""),d=xr(f);for(let h of d)kr(r,h,t)}let n=s.replace(/["'`]/g," ").replace(/\$\{[^}]+\}/g," "),c=xr(n).filter((u)=>Da(u,t?.bracketSyntax));for(let u of c)kr(r,u,t)}}if(t?.attributify?.enabled){let a=mi(e,t.attributify);for(let o of a)r.add(o)}return r}function kr(e,t,r){if(r?.bracketSyntax?.enabled){let i=/^[a-z]+\[[^\]]+\]$/i.test(t),a=r.bracketSyntax.colonSyntax&&/^[a-z]+:[^[\]]+$/i.test(t);if(i||a){let o=gi(t,r.bracketSyntax);for(let s of o)e.add(s);return}}e.add(t)}var La=(e,t)=>{let r={"0":"0",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",none:"none",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",screen:"100vw"};if(e.utility==="min-w"&&e.value)return{"min-width":t.theme.spacing[e.value]||r[e.value]||e.value};if(e.utility==="max-w"&&e.value)return{"max-width":t.theme.spacing[e.value]||r[e.value]||e.value};if(e.utility==="min-h"&&e.value){let i={...r,screen:"100vh"};return{"min-height":t.theme.spacing[e.value]||i[e.value]||e.value}}if(e.utility==="max-h"&&e.value){let i={...r,screen:"100vh"};return{"max-height":t.theme.spacing[e.value]||i[e.value]||e.value}}},Wa=(e,t)=>{if(e.utility==="ring"){if(e.value==="inset")return{"--hw-ring-inset":"inset"};if(e.value){let i=ie(e.value,t);if(i)return{"--hw-ring-color":i}}let r={0:"0",1:"1px",2:"2px",4:"4px",8:"8px",DEFAULT:"3px"};return{"--hw-ring-offset-shadow":"var(--hw-ring-inset) 0 0 0 var(--hw-ring-offset-width) var(--hw-ring-offset-color)","--hw-ring-shadow":`var(--hw-ring-inset) 0 0 0 calc(${e.value?r[e.value]||e.value:r.DEFAULT} + var(--hw-ring-offset-width)) var(--hw-ring-color)`,"box-shadow":"var(--hw-ring-offset-shadow), var(--hw-ring-shadow), var(--hw-shadow, 0 0 #0000)"}}if(e.utility==="ring-offset"&&e.value){let r={0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"};if(r[e.value])return{"--hw-ring-offset-width":r[e.value]};let i=ie(e.value,t);if(i)return{"--hw-ring-offset-color":i}}if(e.utility==="ring-opacity"&&e.value)return{"--hw-ring-opacity":{0:"0",5:"0.05",10:"0.1",20:"0.2",25:"0.25",30:"0.3",40:"0.4",50:"0.5",60:"0.6",70:"0.7",75:"0.75",80:"0.8",90:"0.9",95:"0.95",100:"1"}[e.value]||e.value}},Ma=(e)=>{if(e.utility==="border-opacity"&&e.value)return{"--hw-border-opacity":{0:"0",5:"0.05",10:"0.1",20:"0.2",25:"0.25",30:"0.3",40:"0.4",50:"0.5",60:"0.6",70:"0.7",75:"0.75",80:"0.8",90:"0.9",95:"0.95",100:"1"}[e.value]||e.value}},qa=(e,t)=>{if(e.utility==="space-x"&&e.value){if(e.value==="reverse")return{properties:{"--hw-space-x-reverse":"1"},childSelector:"> :not([hidden]) ~ :not([hidden])"};let r;if(e.value.startsWith("-")){let i=e.value.slice(1),a=t.theme.spacing[i];r=a?`-${a}`:e.value}else r=t.theme.spacing[e.value]||e.value;return{properties:{"--hw-space-x-reverse":"0","margin-right":`calc(${r} * var(--hw-space-x-reverse))`,"margin-left":`calc(${r} * calc(1 - var(--hw-space-x-reverse)))`},childSelector:"> :not([hidden]) ~ :not([hidden])"}}if(e.utility==="space-y"&&e.value){if(e.value==="reverse")return{properties:{"--hw-space-y-reverse":"1"},childSelector:"> :not([hidden]) ~ :not([hidden])"};let r;if(e.value.startsWith("-")){let i=e.value.slice(1),a=t.theme.spacing[i];r=a?`-${a}`:e.value}else r=t.theme.spacing[e.value]||e.value;return{properties:{"--hw-space-y-reverse":"0","margin-top":`calc(${r} * calc(1 - var(--hw-space-y-reverse)))`,"margin-bottom":`calc(${r} * var(--hw-space-y-reverse))`},childSelector:"> :not([hidden]) ~ :not([hidden])"}}},Ia=(e)=>{if(e.utility==="border"&&e.value){let t={solid:"solid",dashed:"dashed",dotted:"dotted",double:"double",hidden:"hidden",none:"none"};if(t[e.value])return{"border-style":t[e.value]}}},Za=(e,t)=>{if(e.utility==="divide"&&e.value){let r={solid:"solid",dashed:"dashed",dotted:"dotted",double:"double",none:"none"};if(r[e.value])return{properties:{"border-style":r[e.value]},childSelector:"> :not([hidden]) ~ :not([hidden])"}}if(e.utility==="divide-x"){if(e.value==="reverse")return{properties:{"--hw-divide-x-reverse":"1"},childSelector:"> :not([hidden]) ~ :not([hidden])"};let r={0:"0",2:"2px",4:"4px",8:"8px",DEFAULT:"1px"},i=e.value?r[e.value]||e.value:r.DEFAULT;return{properties:{"--hw-divide-x-reverse":"0","border-right-width":`calc(${i} * var(--hw-divide-x-reverse))`,"border-left-width":`calc(${i} * calc(1 - var(--hw-divide-x-reverse)))`},childSelector:"> :not([hidden]) ~ :not([hidden])"}}if(e.utility==="divide-y"){if(e.value==="reverse")return{properties:{"--hw-divide-y-reverse":"1"},childSelector:"> :not([hidden]) ~ :not([hidden])"};let r={0:"0",2:"2px",4:"4px",8:"8px",DEFAULT:"1px"},i=e.value?r[e.value]||e.value:r.DEFAULT;return{properties:{"--hw-divide-y-reverse":"0","border-top-width":`calc(${i} * calc(1 - var(--hw-divide-y-reverse)))`,"border-bottom-width":`calc(${i} * var(--hw-divide-y-reverse))`},childSelector:"> :not([hidden]) ~ :not([hidden])"}}if(e.utility==="divide"&&e.value){let r=e.value.indexOf("/"),i=e.value,a;if(r!==-1){i=e.value.slice(0,r);let c=e.value.slice(r+1);if(c.charCodeAt(0)===91&&c.charCodeAt(c.length-1)===93){if(a=Number.parseFloat(c.slice(1,-1)),Number.isNaN(a)||a<0||a>1)return}else{let u=Number.parseInt(c,10);if(Number.isNaN(u)||u<0||u>100)return;a=u/100}}let o=(c)=>{if(a!==void 0){if(c.charCodeAt(0)===35){let u=c.slice(1);if(u.length===3)u=u[0]+u[0]+u[1]+u[1]+u[2]+u[2];let f=Number.parseInt(u.slice(0,2),16),d=Number.parseInt(u.slice(2,4),16),h=Number.parseInt(u.slice(4,6),16);c=`rgb(${f} ${d} ${h} / ${a})`}else if(c.startsWith("oklch("))c=c.replace(")",` / ${a})`)}return{properties:{"border-color":c},childSelector:"> :not([hidden]) ~ :not([hidden])"}},s={current:"currentColor",transparent:"transparent",inherit:"inherit"};if(s[i])return o(s[i]);let l=t.theme.colors[i];if(typeof l==="string")return o(l);if(typeof l==="object"&&l!==null&&typeof l.DEFAULT==="string")return o(l.DEFAULT);let n=i.split("-");if(n.length>=2){let c=n[n.length-1],u=n.slice(0,-1).join("-"),f=t.theme.colors[u];if(typeof f==="object"&&f[c])return o(f[c])}}},Ua=(e,t)=>{let r=(i)=>{let a=null,o=i,s=i.indexOf("/");if(s!==-1){o=i.slice(0,s);let u=i.slice(s+1);if(u.startsWith("[")&&u.endsWith("]"))a=u.slice(1,-1);else{let f=Number.parseInt(u,10);if(!Number.isNaN(f))a=(f/100).toString()}}let l=(u)=>{if(!a)return u;let f=u.match(/^(oklch|rgb|hsl|oklab|lab|lch)\(([^)]+)\)$/i);if(f){let d=f[1],h=f[2].split("/")[0].trim();return`${d}(${h} / ${a})`}if(/^#[0-9a-f]{3,8}$/i.test(u)){let d=u.replace("#",""),h=(g)=>Number.parseInt(g.length===1?g+g:g,16),y=h(d.slice(0,d.length===3?1:2)),p=h(d.slice(d.length===3?1:2,d.length===3?2:4)),b=h(d.slice(d.length===3?2:4,d.length===3?3:6));return`rgb(${y} ${p} ${b} / ${a})`}return`color-mix(in srgb, ${u} ${Math.round(Number.parseFloat(a)*100)}%, transparent)`};if(o.startsWith("[")&&o.endsWith("]"))o=o.slice(1,-1);let n=t.theme.colors[o];if(typeof n==="string")return l(n);if(typeof n==="object"&&n!==null&&typeof n.DEFAULT==="string")return l(n.DEFAULT);let c=o.split("-");if(c.length>=2){let u=c.slice(0,-1).join("-"),f=c[c.length-1],d=t.theme.colors[u];if(typeof d==="object"&&d[f])return l(d[f])}if(o.startsWith("#"))return l(o);return l(o)};if(e.utility==="from"&&e.value)return{"--hw-gradient-from":r(e.value),"--hw-gradient-to":"rgb(255 255 255 / 0)","--hw-gradient-stops":"var(--hw-gradient-from), var(--hw-gradient-to)"};if(e.utility==="via"&&e.value)return{"--hw-gradient-to":"rgb(255 255 255 / 0)","--hw-gradient-stops":`var(--hw-gradient-from), ${r(e.value)}, var(--hw-gradient-to)`};if(e.utility==="to"&&e.value)return{"--hw-gradient-to":r(e.value),"--hw-gradient-stops":"var(--hw-gradient-from), var(--hw-gradient-to)"}},Qa=(e)=>{if(e.utility==="order"&&e.value)return{order:{first:"-9999",last:"9999",none:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12"}[e.value]||e.value}},Ha=(e,t)=>{if(e.utility==="basis"&&e.value){if(e.value.includes("/")){let[r,i]=e.value.split("/").map(Number);return{"flex-basis":`${r/i*100}%`}}return{"flex-basis":{auto:"auto",full:"100%",0:"0"}[e.value]||t.theme.spacing[e.value]||e.value}}},Xa=(e)=>{if(e.utility==="justify-self"){let t={auto:"auto",start:"start",end:"end",center:"center",stretch:"stretch"};return e.value?{"justify-self":t[e.value]||e.value}:void 0}},Ka=(e)=>{if(e.utility==="self"){let t={auto:"auto",start:"flex-start",end:"flex-end",center:"center",stretch:"stretch",baseline:"baseline"};return e.value?{"align-self":t[e.value]||e.value}:void 0}},Va=(e,t)=>{if(e.utility==="container"){if(!e.value)return{width:"100%","margin-left":"auto","margin-right":"auto","max-width":t.theme.screens.xl||"1280px"};let r={sm:t.theme.screens.sm||"640px",md:t.theme.screens.md||"768px",lg:t.theme.screens.lg||"1024px",xl:t.theme.screens.xl||"1280px","2xl":t.theme.screens["2xl"]||"1536px",full:"100%",prose:"65ch","3xl":"1920px"};if(r[e.value])return{width:"100%","margin-left":"auto","margin-right":"auto","max-width":r[e.value]};if(e.arbitrary)return{width:"100%","margin-left":"auto","margin-right":"auto","max-width":e.value}}},Ga=(e)=>{let t=e.raw.replace(/^!/,"");if(e.arbitrary&&e.utility&&e.value&&t.startsWith("["))return{[e.utility]:e.value}},_a=[La,Wa,Ma,Ia,qa,Za,Ua,Qa,Ha,Xa,Ka,Va,Ga],xt=null,Cr=null;function Ja(e){let t=new Map;for(let[r,i]of Object.entries(e))if(typeof i==="string")t.set(r,i);else if(typeof i==="object"&&i!==null){for(let[a,o]of Object.entries(i))if(typeof o==="string")t.set(a==="DEFAULT"?r:`${r}-${a}`,o)}return t}function $a(e,t){if(e.charCodeAt(0)===35){let r=e.slice(1);if(r.length===3)r=r[0]+r[0]+r[1]+r[1]+r[2]+r[2];let i=Number.parseInt(r.slice(0,2),16),a=Number.parseInt(r.slice(2,4),16),o=Number.parseInt(r.slice(4,6),16);return`rgb(${i} ${a} ${o} / ${t})`}return e}function eo(e){return e.replace(/rgba?\([^)]+\)/g,"var(--hw-shadow-color)")}var to=(e)=>{if(e.utility==="bg"&&e.value){let t={fixed:"fixed",local:"local",scroll:"scroll"};return t[e.value]?{"background-attachment":t[e.value]}:void 0}return},ro=(e)=>{if(e.utility==="bg"&&e.value&&e.value.startsWith("clip-")){let t=e.value.replace("clip-",""),r={border:"border-box",padding:"padding-box",content:"content-box",text:"text"};return r[t]?{"background-clip":r[t]}:void 0}return},io=(e)=>{if(e.utility==="bg"&&e.value){let t={"gradient-to-t":"linear-gradient(to top, var(--hw-gradient-stops))","gradient-to-tr":"linear-gradient(to top right, var(--hw-gradient-stops))","gradient-to-r":"linear-gradient(to right, var(--hw-gradient-stops))","gradient-to-br":"linear-gradient(to bottom right, var(--hw-gradient-stops))","gradient-to-b":"linear-gradient(to bottom, var(--hw-gradient-stops))","gradient-to-bl":"linear-gradient(to bottom left, var(--hw-gradient-stops))","gradient-to-l":"linear-gradient(to left, var(--hw-gradient-stops))","gradient-to-tl":"linear-gradient(to top left, var(--hw-gradient-stops))"};if(t[e.value])return{"background-image":t[e.value]}}},ao=(e)=>{let t={"bg-origin-border":"border-box","bg-origin-padding":"padding-box","bg-origin-content":"content-box"};return t[e.raw]?{"background-origin":t[e.raw]}:void 0},oo=(e)=>{let t={"bg-bottom":"bottom","bg-center":"center","bg-left":"left","bg-left-bottom":"left bottom","bg-left-top":"left top","bg-right":"right","bg-right-bottom":"right bottom","bg-right-top":"right top","bg-top":"top"};return t[e.raw]?{"background-position":t[e.raw]}:void 0},no=(e)=>{let t={"bg-repeat":"repeat","bg-no-repeat":"no-repeat","bg-repeat-x":"repeat-x","bg-repeat-y":"repeat-y","bg-repeat-round":"round","bg-repeat-space":"space"};return t[e.raw]?{"background-repeat":t[e.raw]}:void 0},so=(e)=>{let t={"bg-auto":"auto","bg-cover":"cover","bg-contain":"contain"};return t[e.raw]?{"background-size":t[e.raw]}:void 0},lo=(e)=>{if(e.utility==="border"&&e.value){let t={solid:"solid",dashed:"dashed",dotted:"dotted",double:"double",hidden:"hidden",none:"none"};return t[e.value]?{"border-style":t[e.value]}:void 0}return},co=(e,t)=>{if(e.utility==="outline-offset"&&e.value)return{"outline-offset":{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"}[e.value]||e.value};if(e.utility==="outline"&&e.value){let r={none:"none",solid:"solid",dashed:"dashed",dotted:"dotted",double:"double"};if(r[e.value])return{"outline-style":r[e.value]}}if(e.utility==="outline"){if(!e.value)return{"outline-width":"1px"};let r=ie(e.value,t);if(r)return{"outline-color":r};let i={0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"};if(i[e.value])return{"outline-width":i[e.value]};return{"outline-width":e.value}}},uo=(e,t)=>{if(e.utility==="shadow"){let r=e.value?t.theme.boxShadow[e.value]:t.theme.boxShadow.DEFAULT;if(!r)return;if(r==="none")return{"--hw-shadow":"0 0 #0000","box-shadow":"var(--hw-ring-offset-shadow, 0 0 #0000), var(--hw-ring-shadow, 0 0 #0000), var(--hw-shadow)"};let i=eo(r);return{"--hw-shadow":r,"--hw-shadow-colored":i,"box-shadow":"var(--hw-ring-offset-shadow, 0 0 #0000), var(--hw-ring-shadow, 0 0 #0000), var(--hw-shadow)"}}},fo=(e,t)=>{if(e.utility!=="shadow"||!e.value)return;if(t.theme.boxShadow[e.value])return;if(xt===null||Cr!==t.theme.colors)xt=Ja(t.theme.colors),Cr=t.theme.colors;let r=e.value,i=r.indexOf("/"),a,o;if(i!==-1){a=r.slice(0,i);let l=r.slice(i+1);if(l.charCodeAt(0)===91&&l.charCodeAt(l.length-1)===93){let n=Number.parseFloat(l.slice(1,-1));if(Number.isNaN(n)||n<0||n>1)return;o=n}else{let n=Number.parseInt(l,10);if(Number.isNaN(n)||n<0||n>100)return;o=n/100}}else a=r;let s=xt.get(a);if(!s)return;return{"--hw-shadow-color":o!==void 0?$a(s,o):s,"--hw-shadow":"var(--hw-shadow-colored)"}},ho=(e)=>{if(e.utility==="text-shadow"){let t={sm:"0 1px 2px rgba(0, 0, 0, 0.05)",DEFAULT:"0 1px 3px rgba(0, 0, 0, 0.1)",md:"0 4px 6px rgba(0, 0, 0, 0.1)",lg:"0 10px 15px rgba(0, 0, 0, 0.1)",xl:"0 20px 25px rgba(0, 0, 0, 0.1)",none:"none"};return e.value?{"text-shadow":t[e.value]||e.value}:void 0}},po=(e)=>{if(e.utility==="opacity"&&e.value)return{opacity:{0:"0",5:"0.05",10:"0.1",20:"0.2",25:"0.25",30:"0.3",40:"0.4",50:"0.5",60:"0.6",70:"0.7",75:"0.75",80:"0.8",90:"0.9",95:"0.95",100:"1"}[e.value]||e.value}},go=(e)=>{if(e.utility==="mix-blend"){let t=["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"];return e.value&&t.includes(e.value)?{"mix-blend-mode":e.value}:void 0}},mo=(e)=>{if(e.utility==="bg-blend"){let t=["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"];return e.value&&t.includes(e.value)?{"background-blend-mode":e.value}:void 0}},yo=(e)=>{if(e.utility==="mask-clip"&&e.value)return{"mask-clip":{border:"border-box",padding:"padding-box",content:"content-box",text:"text",fill:"fill-box",stroke:"stroke-box",view:"view-box","no-clip":"no-clip"}[e.value]||e.value};if(e.utility==="mask-composite"&&e.value)return["add","subtract","intersect","exclude"].includes(e.value)?{"mask-composite":e.value}:void 0;if(e.utility==="mask-image"&&e.value){if(e.value==="none")return{"mask-image":"none"};return{"mask-image":`url(${e.value})`}}if(e.utility==="mask-mode"&&e.value)return["alpha","luminance","match-source"].includes(e.value)?{"mask-mode":e.value}:void 0;if(e.utility==="mask-origin"&&e.value)return{"mask-origin":{border:"border-box",padding:"padding-box",content:"content-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}[e.value]||e.value};if(e.utility==="mask-position"&&e.value)return{"mask-position":{center:"center",top:"top",right:"right",bottom:"bottom",left:"left","top-left":"top left","top-right":"top right","bottom-left":"bottom left","bottom-right":"bottom right"}[e.value]||e.value};if(e.utility==="mask-repeat"&&e.value)return{"mask-repeat":{repeat:"repeat","no-repeat":"no-repeat","repeat-x":"repeat-x","repeat-y":"repeat-y",round:"round",space:"space"}[e.value]||e.value};if(e.utility==="mask-size"&&e.value)return{"mask-size":{auto:"auto",cover:"cover",contain:"contain"}[e.value]||e.value};if(e.utility==="mask-type"&&e.value)return["alpha","luminance"].includes(e.value)?{"mask-type":e.value}:void 0},Er=[to,ro,io,ao,oo,no,so,lo,co,uo,fo,ho,po,go,mo,yo],pt={appearance:"none","background-color":"#fff","border-color":"#6b7280","border-width":"1px","border-radius":"0px","padding-top":"0.5rem","padding-right":"0.75rem","padding-bottom":"0.5rem","padding-left":"0.75rem","font-size":"1rem","line-height":"1.5rem"},bi={appearance:"none",padding:"0","print-color-adjust":"exact",display:"inline-block","vertical-align":"middle","background-origin":"border-box","user-select":"none","flex-shrink":"0",height:"1rem",width:"1rem",color:"#2563eb","background-color":"#fff","border-color":"#6b7280","border-width":"1px"},bo=(e)=>{if(e.utility==="form-input"&&!e.value)return pt},wo=(e)=>{if(e.utility==="form-textarea"&&!e.value)return pt},vo=(e)=>{if(e.utility==="form-select"&&!e.value)return{...pt,"background-image":`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e")`,"background-position":"right 0.5rem center","background-repeat":"no-repeat","background-size":"1.5em 1.5em","padding-right":"2.5rem","print-color-adjust":"exact"}},xo=(e)=>{if(e.utility==="form-multiselect"&&!e.value)return{...pt,"background-image":"initial","background-position":"initial","background-repeat":"unset","background-size":"initial","print-color-adjust":"unset"}},ko=(e)=>{if(e.utility==="form-checkbox"&&!e.value)return{...bi,"border-radius":"0px"}},Co=(e)=>{if(e.utility==="form-radio"&&!e.value)return{...bi,"border-radius":"100%"}},Eo=[bo,wo,vo,xo,ko,Co],Ao=(e)=>{if(e.utility==="grid-cols"){let t={1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))",none:"none",subgrid:"subgrid"};return e.value?{"grid-template-columns":t[e.value]||e.value}:void 0}},So=(e)=>{if(e.utility==="col"){let t={auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"};return e.value?{"grid-column":t[e.value]||e.value}:void 0}if(e.utility==="col-span"&&e.value){let t={auto:"auto",1:"span 1 / span 1",2:"span 2 / span 2",3:"span 3 / span 3",4:"span 4 / span 4",5:"span 5 / span 5",6:"span 6 / span 6",7:"span 7 / span 7",8:"span 8 / span 8",9:"span 9 / span 9",10:"span 10 / span 10",11:"span 11 / span 11",12:"span 12 / span 12",full:"1 / -1"};if(e.arbitrary)return{"grid-column":`span ${e.value} / span ${e.value}`};return{"grid-column":t[e.value]||e.value}}if(e.utility==="col-start"&&e.value)return{"grid-column-start":e.value};if(e.utility==="col-end"&&e.value)return{"grid-column-end":e.value}},No=(e)=>{if(e.utility==="grid-rows"){let t={1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",none:"none",subgrid:"subgrid"};return e.value?{"grid-template-rows":t[e.value]||e.value}:void 0}},jo=(e)=>{if(e.utility==="row"){let t={auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-full":"1 / -1"};return e.value?{"grid-row":t[e.value]||e.value}:void 0}if(e.utility==="row-span"&&e.value){let t={auto:"auto",1:"span 1 / span 1",2:"span 2 / span 2",3:"span 3 / span 3",4:"span 4 / span 4",5:"span 5 / span 5",6:"span 6 / span 6",full:"1 / -1"};if(e.arbitrary)return{"grid-row":`span ${e.value} / span ${e.value}`};return{"grid-row":t[e.value]||e.value}}if(e.utility==="row-start"&&e.value)return{"grid-row-start":e.value};if(e.utility==="row-end"&&e.value)return{"grid-row-end":e.value}},zo=(e)=>{if(e.utility==="grid-flow"&&e.value){let t={row:"row",col:"column",dense:"dense","row-dense":"row dense","col-dense":"column dense"};return t[e.value]?{"grid-auto-flow":t[e.value]}:void 0}return},To=(e)=>{if(e.utility==="auto-cols"){let t={auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"};return e.value?{"grid-auto-columns":t[e.value]||e.value}:void 0}},Fo=(e)=>{if(e.utility==="auto-rows"){let t={auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"};return e.value?{"grid-auto-rows":t[e.value]||e.value}:void 0}};function kt(e,t){let r=e.theme.spacing?.[t];if(r!==void 0)return r;if(/^\d+(?:\.\d+)?$/.test(t)){let i=Number.parseFloat(t);if(Number.isFinite(i))return`${i*0.25}rem`}return t}var Oo=(e,t)=>{if(e.utility==="gap"&&e.value)return{gap:kt(t,e.value)};if(e.utility==="gap-x"&&e.value)return{"column-gap":kt(t,e.value)};if(e.utility==="gap-y"&&e.value)return{"row-gap":kt(t,e.value)}},Ro=(e)=>{if(e.utility==="place"&&e.value&&e.value.startsWith("content-")){let t=e.value.replace("content-",""),r={center:"center",start:"start",end:"end",between:"space-between",around:"space-around",evenly:"space-evenly",stretch:"stretch"};return r[t]?{"place-content":r[t]}:void 0}return},Bo=(e)=>{if(e.utility==="place"&&e.value&&e.value.startsWith("items-")){let t=e.value.replace("items-",""),r={start:"start",end:"end",center:"center",stretch:"stretch"};return r[t]?{"place-items":r[t]}:void 0}return},Yo=(e)=>{if(e.utility==="place"&&e.value&&e.value.startsWith("self-")){let t=e.value.replace("self-",""),r={auto:"auto",start:"start",end:"end",center:"center",stretch:"stretch"};return r[t]?{"place-self":r[t]}:void 0}return},Po=[Ao,So,No,jo,zo,To,Fo,Oo,Ro,Bo,Yo],Oe=new Map;function Wo(e){if(Oe.has(e))return Oe.get(e);let t=[Ar(process.cwd(),"node_modules","@iconify-json",e,"icons.json"),Ar(process.cwd(),"node_modules",".bun","@iconify-json",e,"icons.json")];for(let r of t)if(Do(r))try{let i=JSON.parse(Lo(r,"utf-8"));return Oe.set(e,i),i}catch{}return Oe.set(e,null),null}function Mo(e,t){let r=e.icons[t];if(r)return r;let i=e.aliases?.[t];if(i)return e.icons[i.parent]??null;return null}function qo(e,t){let r=t.width??e.width??24,i=t.height??e.height??24,a=t.left??0,o=t.top??0;return`<svg xmlns='http://www.w3.org/2000/svg' viewBox='${a} ${o} ${r} ${i}' width='${r}' height='${i}'>${t.body}</svg>`}function Io(e){return`url("data:image/svg+xml;utf8,${e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\?/g,"%3F").replace(/\s+/g," ")}")`}var Zo=/^i-([a-z][a-z0-9]*)-(.+)$/,Uo=(e,t)=>{let r=e.raw.match(Zo);if(!r)return;let[,i,a]=r,o=Wo(i);if(!o)return;let s=Mo(o,a);if(!s)return;let l=Io(qo(o,s));return{display:"inline-block",width:"1em",height:"1em","background-color":"currentColor","-webkit-mask":`${l} no-repeat`,mask:`${l} no-repeat`,"-webkit-mask-size":"100% 100%","mask-size":"100% 100%","vertical-align":"-0.125em"}},Je={none:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},Qo=(e)=>{if(e.raw==="filter-none")return{filter:"none"};if(e.utility==="blur"){let t=e.value||"DEFAULT";return{filter:`blur(${Je[t]??(e.value?/^\d/.test(e.value)?`${e.value}px`:e.value:Je.DEFAULT)})`}}if(e.utility==="brightness"&&e.value)return{filter:`brightness(${Number(e.value)/100})`};if(e.utility==="contrast"&&e.value)return{filter:`contrast(${Number(e.value)/100})`};if(e.utility==="grayscale"&&e.value)return{filter:`grayscale(${Number(e.value)/100})`};if(e.utility==="invert"&&e.value)return{filter:`invert(${Number(e.value)/100})`};if(e.utility==="saturate"&&e.value)return{filter:`saturate(${Number(e.value)/100})`};if(e.utility==="sepia"&&e.value)return{filter:`sepia(${Number(e.value)/100})`};if(e.utility==="hue-rotate"&&e.value)return{filter:`hue-rotate(${e.value}deg)`};if(e.utility==="drop-shadow"){let t={sm:"drop-shadow(0 1px 1px rgb(0 0 0 / 0.05))",DEFAULT:"drop-shadow(0 1px 2px rgb(0 0 0 / 0.1)) drop-shadow(0 1px 1px rgb(0 0 0 / 0.06))",md:"drop-shadow(0 4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.06))",lg:"drop-shadow(0 10px 8px rgb(0 0 0 / 0.04)) drop-shadow(0 4px 3px rgb(0 0 0 / 0.1))",xl:"drop-shadow(0 20px 13px rgb(0 0 0 / 0.03)) drop-shadow(0 8px 5px rgb(0 0 0 / 0.08))","2xl":"drop-shadow(0 25px 25px rgb(0 0 0 / 0.15))",none:"drop-shadow(0 0 #0000)"};return{filter:e.value?t[e.value]||`drop-shadow(${e.value})`:t.DEFAULT}}},Ho=(e)=>{if(e.raw==="backdrop-filter-none")return{"backdrop-filter":"none"};if(e.utility==="backdrop-blur"){let t=e.value||"DEFAULT",r=Je[t]??(e.value?/^\d/.test(e.value)?`${e.value}px`:e.value:Je.DEFAULT);return{"-webkit-backdrop-filter":`blur(${r})`,"backdrop-filter":`blur(${r})`}}if(e.utility==="backdrop-brightness"&&e.value){let t=`brightness(${Number(e.value)/100})`;return{"-webkit-backdrop-filter":t,"backdrop-filter":t}}if(e.utility==="backdrop-contrast"&&e.value){let t=`contrast(${Number(e.value)/100})`;return{"-webkit-backdrop-filter":t,"backdrop-filter":t}}if(e.utility==="backdrop-grayscale"&&e.value){let t=`grayscale(${Number(e.value)/100})`;return{"-webkit-backdrop-filter":t,"backdrop-filter":t}}if(e.utility==="backdrop-invert"&&e.value){let t=`invert(${Number(e.value)/100})`;return{"-webkit-backdrop-filter":t,"backdrop-filter":t}}if(e.utility==="backdrop-saturate"&&e.value){let t=`saturate(${Number(e.value)/100})`;return{"-webkit-backdrop-filter":t,"backdrop-filter":t}}if(e.utility==="backdrop-sepia"&&e.value){let t=`sepia(${Number(e.value)/100})`;return{"-webkit-backdrop-filter":t,"backdrop-filter":t}}},Xo=(e)=>{let t={"border-collapse":"collapse","border-separate":"separate"};return t[e.raw]?{"border-collapse":t[e.raw]}:void 0},Ko=(e,t)=>{if(e.utility==="border-spacing"&&e.value){let r=t.theme.spacing[e.value]||e.value;return{"border-spacing":`${r} ${r}`}}if(e.utility==="border-spacing-x"&&e.value)return{"border-spacing":`${t.theme.spacing[e.value]||e.value} 0`};if(e.utility==="border-spacing-y"&&e.value)return{"border-spacing":`0 ${t.theme.spacing[e.value]||e.value}`}},Vo=(e)=>{if(e.utility==="table"&&e.value){let t={auto:"auto",fixed:"fixed"};return t[e.value]?{"table-layout":t[e.value]}:void 0}return},Go=(e)=>{let t={"caption-top":"top","caption-bottom":"bottom"};return t[e.raw]?{"caption-side":t[e.raw]}:void 0},_o=(e,t)=>{if(e.utility==="accent"&&e.value){let r=ie(e.value,t);if(r)return{"accent-color":r}}},Jo=(e)=>{let t={"appearance-none":"none","appearance-auto":"auto"};return t[e.raw]?{appearance:t[e.raw]}:void 0},$o=(e,t)=>{if(e.utility==="caret"&&e.value){let r=ie(e.value,t);if(r)return{"caret-color":r}}},en=(e)=>{let t={"color-scheme-normal":"normal","color-scheme-light":"light","color-scheme-dark":"dark","color-scheme-light-dark":"light dark"};return t[e.raw]?{"color-scheme":t[e.raw]}:void 0},tn=(e)=>{let t={"field-sizing-content":"content","field-sizing-fixed":"fixed"};return t[e.raw]?{"field-sizing":t[e.raw]}:void 0},rn=(e)=>{let t={"cursor-auto":"auto","cursor-default":"default","cursor-pointer":"pointer","cursor-wait":"wait","cursor-text":"text","cursor-move":"move","cursor-help":"help","cursor-not-allowed":"not-allowed","cursor-none":"none","cursor-context-menu":"context-menu","cursor-progress":"progress","cursor-cell":"cell","cursor-crosshair":"crosshair","cursor-vertical-text":"vertical-text","cursor-alias":"alias","cursor-copy":"copy","cursor-no-drop":"no-drop","cursor-grab":"grab","cursor-grabbing":"grabbing","cursor-all-scroll":"all-scroll","cursor-col-resize":"col-resize","cursor-row-resize":"row-resize","cursor-n-resize":"n-resize","cursor-e-resize":"e-resize","cursor-s-resize":"s-resize","cursor-w-resize":"w-resize","cursor-ne-resize":"ne-resize","cursor-nw-resize":"nw-resize","cursor-se-resize":"se-resize","cursor-sw-resize":"sw-resize","cursor-ew-resize":"ew-resize","cursor-ns-resize":"ns-resize","cursor-nesw-resize":"nesw-resize","cursor-nwse-resize":"nwse-resize","cursor-zoom-in":"zoom-in","cursor-zoom-out":"zoom-out"};return t[e.raw]?{cursor:t[e.raw]}:void 0},an=(e)=>{let t={"pointer-events-none":"none","pointer-events-auto":"auto"};return t[e.raw]?{"pointer-events":t[e.raw]}:void 0},on=(e)=>{let t={"resize-none":"none",resize:"both","resize-y":"vertical","resize-x":"horizontal"};return t[e.raw]?{resize:t[e.raw]}:void 0},nn=(e)=>{let t={"scroll-auto":"auto","scroll-smooth":"smooth"};return t[e.raw]?{"scroll-behavior":t[e.raw]}:void 0},sn=(e,t)=>{let r={"scroll-m":["scroll-margin"],"scroll-mx":["scroll-margin-left","scroll-margin-right"],"scroll-my":["scroll-margin-top","scroll-margin-bottom"],"scroll-mt":["scroll-margin-top"],"scroll-mr":["scroll-margin-right"],"scroll-mb":["scroll-margin-bottom"],"scroll-ml":["scroll-margin-left"]}[e.utility];if(!r||!e.value)return;let i=t.theme.spacing[e.value]||e.value,a={};for(let o of r)a[o]=i;return a},ln=(e,t)=>{let r={"scroll-p":["scroll-padding"],"scroll-px":["scroll-padding-left","scroll-padding-right"],"scroll-py":["scroll-padding-top","scroll-padding-bottom"],"scroll-pt":["scroll-padding-top"],"scroll-pr":["scroll-padding-right"],"scroll-pb":["scroll-padding-bottom"],"scroll-pl":["scroll-padding-left"]}[e.utility];if(!r||!e.value)return;let i=t.theme.spacing[e.value]||e.value,a={};for(let o of r)a[o]=i;return a},cn=(e)=>{let t={"snap-none":"none","snap-x":"x mandatory","snap-y":"y mandatory","snap-both":"both mandatory","snap-mandatory":"mandatory","snap-proximity":"proximity"};if(t[e.raw])return e.raw.includes("mandatory")||e.raw.includes("proximity")?{"scroll-snap-type":t[e.raw]}:{"scroll-snap-type":t[e.raw]};let r={"snap-start":"start","snap-end":"end","snap-center":"center","snap-align-none":"none"};if(r[e.raw])return{"scroll-snap-align":r[e.raw]};let i={"snap-normal":"normal","snap-always":"always"};if(i[e.raw])return{"scroll-snap-stop":i[e.raw]}},un=(e)=>{let t={"touch-auto":"auto","touch-none":"none","touch-pan-x":"pan-x","touch-pan-left":"pan-left","touch-pan-right":"pan-right","touch-pan-y":"pan-y","touch-pan-up":"pan-up","touch-pan-down":"pan-down","touch-pinch-zoom":"pinch-zoom","touch-manipulation":"manipulation"};return t[e.raw]?{"touch-action":t[e.raw]}:void 0},fn=(e)=>{let t={"select-none":"none","select-text":"text","select-all":"all","select-auto":"auto"};return t[e.raw]?{"user-select":t[e.raw]}:void 0},dn=(e)=>{let t={"will-change-auto":"auto","will-change-scroll":"scroll-position","will-change-contents":"contents","will-change-transform":"transform"};return t[e.raw]?{"will-change":t[e.raw]}:void 0},hn=(e,t)=>{if(e.utility==="fill"&&e.value){if(e.value==="none")return{fill:"none"};let r=ie(e.value,t);if(r)return{fill:r}}},pn=(e,t)=>{if(e.utility==="stroke"&&e.value){if(e.value==="none")return{stroke:"none"};let r=ie(e.value,t);if(r)return{stroke:r}}},gn=(e)=>{if(e.utility==="stroke"&&e.value)return{"stroke-width":{0:"0",1:"1",2:"2"}[e.value]||e.value}},mn=(e)=>{if(e.utility==="stroke-dasharray"&&e.value)return{"stroke-dasharray":e.value==="none"?"none":e.value}},yn=(e)=>{if(e.utility==="stroke-dashoffset"&&e.value)return{"stroke-dashoffset":e.value}},bn=(e)=>{let t={"stroke-linecap-butt":"butt","stroke-linecap-round":"round","stroke-linecap-square":"square"};return t[e.raw]?{"stroke-linecap":t[e.raw]}:void 0},wn=(e)=>{let t={"stroke-linejoin-miter":"miter","stroke-linejoin-round":"round","stroke-linejoin-bevel":"bevel"};return t[e.raw]?{"stroke-linejoin":t[e.raw]}:void 0},vn=(e)=>{if(e.raw==="sr-only")return{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)","white-space":"nowrap","border-width":"0"};if(e.raw==="not-sr-only")return{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",clip:"auto","white-space":"normal"};return},xn=(e)=>{let t={"forced-color-adjust-auto":"auto","forced-color-adjust-none":"none"};return t[e.raw]?{"forced-color-adjust":t[e.raw]}:void 0},kn=[Qo,Ho,Xo,Ko,Vo,Go,_o,Jo,$o,en,tn,rn,an,on,nn,sn,ln,cn,un,fn,dn,hn,pn,gn,mn,yn,bn,wn,vn,xn],Cn=(e)=>{if(e.utility==="aspect"){let t={auto:"auto",square:"1 / 1",video:"16 / 9"};return e.value?{"aspect-ratio":t[e.value]||e.value}:void 0}},En=(e,t)=>{if(e.utility==="columns"&&e.value){let r={"1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","10":"10","11":"11","12":"12",auto:"auto"},i={"3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"};if(r[e.value])return{columns:r[e.value]};if(i[e.value])return{columns:i[e.value]};if(t.theme.spacing[e.value])return{columns:t.theme.spacing[e.value]};return{columns:e.value}}},An=(e)=>{let t={"column-fill-auto":"auto","column-fill-balance":"balance","column-fill-balance-all":"balance-all"};return t[e.raw]?{"column-fill":t[e.raw]}:void 0},Sn=(e,t)=>{if(e.utility==="column-gap"&&e.value)return{"column-gap":t.theme.spacing[e.value]||e.value}},Nn=(e,t)=>{if(e.utility==="column-rule"&&e.value){let r={"0":"0px","1":"1px","2":"2px","4":"4px","8":"8px"};if(r[e.value])return{"column-rule-width":r[e.value]};let i=e.value.split("-");if(i.length===2){let[s,l]=i,n=t.theme.colors[s];if(typeof n==="object"&&n[l])return{"column-rule-color":n[l]}}let a=t.theme.colors[e.value];if(typeof a==="string")return{"column-rule-color":a};if(typeof a==="object"&&a!==null&&typeof a.DEFAULT==="string")return{"column-rule-color":a.DEFAULT};let o={solid:"solid",dashed:"dashed",dotted:"dotted",double:"double",hidden:"hidden",none:"none"};if(o[e.value])return{"column-rule-style":o[e.value]}}},jn=(e)=>{let t={"column-span-all":"all","column-span-none":"none"};return t[e.raw]?{"column-span":t[e.raw]}:void 0},zn=(e)=>{return{"break-before-auto":{"break-before":"auto"},"break-before-avoid":{"break-before":"avoid"},"break-before-all":{"break-before":"all"},"break-before-avoid-page":{"break-before":"avoid-page"},"break-before-page":{"break-before":"page"},"break-after-auto":{"break-after":"auto"},"break-after-avoid":{"break-after":"avoid"},"break-after-all":{"break-after":"all"},"break-after-avoid-page":{"break-after":"avoid-page"},"break-after-page":{"break-after":"page"},"break-inside-auto":{"break-inside":"auto"},"break-inside-avoid":{"break-inside":"avoid"},"break-inside-avoid-page":{"break-inside":"avoid-page"},"break-inside-avoid-column":{"break-inside":"avoid-column"}}[e.raw]},Tn=(e)=>{let t={"box-decoration-clone":"clone","box-decoration-slice":"slice"};return t[e.raw]?{"box-decoration-break":t[e.raw]}:void 0},Fn=(e)=>{let t={"box-border":"border-box","box-content":"content-box"};return t[e.raw]?{"box-sizing":t[e.raw]}:void 0},On=(e)=>{let t={"float-start":"inline-start","float-end":"inline-end","float-right":"right","float-left":"left","float-none":"none"};return t[e.raw]?{float:t[e.raw]}:void 0},Rn=(e)=>{let t={"clear-start":"inline-start","clear-end":"inline-end","clear-left":"left","clear-right":"right","clear-both":"both","clear-none":"none"};return t[e.raw]?{clear:t[e.raw]}:void 0},Bn=(e)=>{let t={isolate:"isolate","isolation-auto":"auto"};return t[e.raw]?{isolation:t[e.raw]}:void 0},Yn=(e)=>{let t={"object-contain":"contain","object-cover":"cover","object-fill":"fill","object-none":"none","object-scale-down":"scale-down"};return t[e.raw]?{"object-fit":t[e.raw]}:void 0},Pn=(e)=>{let t={"object-bottom":"bottom","object-center":"center","object-left":"left","object-left-bottom":"left bottom","object-left-top":"left top","object-right":"right","object-right-bottom":"right bottom","object-right-top":"right top","object-top":"top"};return t[e.raw]?{"object-position":t[e.raw]}:void 0},Dn=(e)=>{if(e.utility==="overflow"){let t=["auto","hidden","clip","visible","scroll"];if(e.value&&t.includes(e.value))return{overflow:e.value}}if(e.utility==="overflow-x"||e.utility==="overflow-y"){let t=["auto","hidden","clip","visible","scroll"];if(e.value&&t.includes(e.value))return{[e.utility]:e.value}}},Ln=(e)=>{let t={"overscroll-auto":"auto","overscroll-contain":"contain","overscroll-none":"none","overscroll-x-auto":"auto","overscroll-x-contain":"contain","overscroll-x-none":"none","overscroll-y-auto":"auto","overscroll-y-contain":"contain","overscroll-y-none":"none"},r=e.raw.startsWith("overscroll-x")?"overscroll-behavior-x":e.raw.startsWith("overscroll-y")?"overscroll-behavior-y":"overscroll-behavior";return t[e.raw]?{[r]:t[e.raw]}:void 0},Wn=(e)=>{if(["static","fixed","absolute","relative","sticky"].includes(e.utility))return{position:e.utility}},Mn=(e,t)=>{let r={inset:["top","right","bottom","left"],"inset-x":["left","right"],"inset-y":["top","bottom"],top:["top"],right:["right"],bottom:["bottom"],left:["left"],start:["inset-inline-start"],end:["inset-inline-end"]}[e.utility];if(!r||!e.value)return;let i=(s)=>{if(s.includes("/")){let[l,n]=s.split("/").map(Number);if(!Number.isNaN(l)&&!Number.isNaN(n)&&n!==0)return`${l/n*100}%`}if(s==="full")return"100%";if(s==="auto")return"auto";return t.theme.spacing[s]||s},a;if(e.value.startsWith("-")){let s=e.value.slice(1),l=i(s);if(l.endsWith("%"))a=`${-Number.parseFloat(l)}%`;else a=l.startsWith("-")?l:`-${l}`}else a=i(e.value);let o={};for(let s of r)o[s]=a;return o},qn=(e)=>{let t={visible:"visible",invisible:"hidden",collapse:"collapse"};return t[e.utility]?{visibility:t[e.utility]}:void 0},In=(e)=>{if(e.utility==="z"&&e.value)return{"z-index":{0:"0",10:"10",20:"20",30:"30",40:"40",50:"50",auto:"auto"}[e.value]||e.value}},Zn=[Cn,En,An,Sn,Nn,jn,zn,Tn,Fn,On,Rn,Bn,Yn,Pn,Dn,Ln,Wn,Mn,qn,In],Un=(e)=>{let t={transform:"translate(var(--hw-translate-x), var(--hw-translate-y)) rotate(var(--hw-rotate)) skewX(var(--hw-skew-x)) skewY(var(--hw-skew-y)) scaleX(var(--hw-scale-x)) scaleY(var(--hw-scale-y))","transform-cpu":"translate(var(--hw-translate-x), var(--hw-translate-y)) rotate(var(--hw-rotate)) skewX(var(--hw-skew-x)) skewY(var(--hw-skew-y)) scaleX(var(--hw-scale-x)) scaleY(var(--hw-scale-y))","transform-gpu":"translate3d(var(--hw-translate-x), var(--hw-translate-y), 0) rotate(var(--hw-rotate)) skewX(var(--hw-skew-x)) skewY(var(--hw-skew-y)) scaleX(var(--hw-scale-x)) scaleY(var(--hw-scale-y))","transform-none":"none"};return t[e.raw]?{transform:t[e.raw]}:void 0},Qn=(e)=>{if(e.utility==="scale"){if(!e.value)return{transform:"scale(1)"};if(e.arbitrary)return{transform:`scale(${e.value})`};return{transform:`scale(${Number(e.value)/100})`}}if(e.utility==="scale-x"){if(!e.value)return{transform:"scaleX(1)"};if(e.arbitrary)return{transform:`scaleX(${e.value})`};return{transform:`scaleX(${Number(e.value)/100})`}}if(e.utility==="scale-y"){if(!e.value)return{transform:"scaleY(1)"};if(e.arbitrary)return{transform:`scaleY(${e.value})`};return{transform:`scaleY(${Number(e.value)/100})`}}if(e.utility==="scale-z"){if(!e.value)return{transform:"scaleZ(1)"};if(e.arbitrary)return{transform:`scaleZ(${e.value})`};return{transform:`scaleZ(${Number(e.value)/100})`}}},Hn=(e)=>{if(e.utility==="rotate"&&e.value)return{transform:`rotate(${e.arbitrary||e.value.includes("deg")||e.value.includes("rad")||e.value.includes("turn")?e.value:`${e.value}deg`})`};if(e.utility==="rotate-x"&&e.value)return{transform:`rotateX(${e.arbitrary||e.value.includes("deg")||e.value.includes("rad")||e.value.includes("turn")?e.value:`${e.value}deg`})`};if(e.utility==="rotate-y"&&e.value)return{transform:`rotateY(${e.arbitrary||e.value.includes("deg")||e.value.includes("rad")||e.value.includes("turn")?e.value:`${e.value}deg`})`};if(e.utility==="rotate-z"&&e.value)return{transform:`rotateZ(${e.arbitrary||e.value.includes("deg")||e.value.includes("rad")||e.value.includes("turn")?e.value:`${e.value}deg`})`}},Xn=(e,t)=>{let r=(i)=>{if(i.includes("/")){let[a,o]=i.split("/");return`${Number(a)/Number(o)*100}%`}if(i==="full")return"100%";if(i==="half")return"50%";return t.theme.spacing[i]||i};if(e.utility==="translate-x"&&e.value){let i;if(e.value.startsWith("-")){let a=e.value.slice(1);i=`-${r(a)}`}else i=r(e.value);return{transform:`translateX(${i})`}}if(e.utility==="translate-y"&&e.value){let i;if(e.value.startsWith("-")){let a=e.value.slice(1);i=`-${r(a)}`}else i=r(e.value);return{transform:`translateY(${i})`}}if(e.utility==="translate-z"&&e.value){let i;if(e.value.startsWith("-")){let a=e.value.slice(1);i=`-${r(a)}`}else i=r(e.value);return{transform:`translateZ(${i})`}}},Kn=(e)=>{if(e.utility==="skew-x"&&e.value)return{transform:`skewX(${e.arbitrary||e.value.includes("deg")||e.value.includes("rad")||e.value.includes("turn")?e.value:`${e.value}deg`})`};if(e.utility==="skew-y"&&e.value)return{transform:`skewY(${e.arbitrary||e.value.includes("deg")||e.value.includes("rad")||e.value.includes("turn")?e.value:`${e.value}deg`})`}},Vn=(e)=>{if(e.utility==="origin"&&e.value){if(e.arbitrary)return{"transform-origin":e.value.replace(/_/g," ")};let t={center:"center",top:"top","top-right":"top right",right:"right","bottom-right":"bottom right",bottom:"bottom","bottom-left":"bottom left",left:"left","top-left":"top left"};return t[e.value]?{"transform-origin":t[e.value]}:void 0}return},Gn=(e)=>{if(e.utility==="perspective"&&e.value){if(e.value==="none")return{perspective:"none"};if(e.arbitrary||e.value.includes("px")||e.value.includes("rem")||e.value.includes("em"))return{perspective:e.value};return{perspective:`${e.value}px`}}return},_n=(e)=>{if(e.utility==="perspective-origin"&&e.value)return{"perspective-origin":{center:"center",top:"top","top-right":"top right",right:"right","bottom-right":"bottom right",bottom:"bottom","bottom-left":"bottom left",left:"left","top-left":"top left"}[e.value]||e.value}},Jn=(e)=>{let t={"backface-visible":"visible","backface-hidden":"hidden"};return t[e.raw]?{"backface-visibility":t[e.raw]}:void 0},$n=(e)=>{let t={"transform-flat":"flat","transform-3d":"preserve-3d"};return t[e.raw]?{"transform-style":t[e.raw]}:void 0},es=(e)=>{let t={"transition-none":"none","transition-all":"all",transition:"color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter","transition-colors":"color, background-color, border-color, text-decoration-color, fill, stroke","transition-opacity":"opacity","transition-shadow":"box-shadow","transition-transform":"transform"};return t[e.raw]?{"transition-property":t[e.raw]}:void 0},ts=(e)=>{if(e.utility==="duration"&&e.value)return{"transition-duration":{"0":"0s","75":"75ms","100":"100ms","150":"150ms","200":"200ms","300":"300ms","500":"500ms","700":"700ms","1000":"1000ms"}[e.value]||`${e.value}ms`}},rs=(e)=>{let t={"ease-linear":"linear","ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"};return t[e.raw]?{"transition-timing-function":t[e.raw]}:void 0},is=(e)=>{if(e.utility==="delay"&&e.value)return{"transition-delay":{"0":"0s","75":"75ms","100":"100ms","150":"150ms","200":"200ms","300":"300ms","500":"500ms","700":"700ms","1000":"1000ms"}[e.value]||`${e.value}ms`}},as=(e)=>{let t={"transition-behavior-normal":"normal","transition-behavior-allow-discrete":"allow-discrete"};return t[e.raw]?{"transition-behavior":t[e.raw]}:void 0},os=(e)=>{if(e.utility!=="animate")return;let t={none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite",pulse:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",bounce:"bounce 1s infinite"};if(e.arbitrary&&e.value)return{animation:e.value.replace(/_/g," ")};if(e.value&&t[e.value])return{animation:t[e.value]};return},ns=(e)=>{let t={"animate-running":"running","animate-paused":"paused"};return t[e.raw]?{"animation-play-state":t[e.raw]}:void 0},ss=(e)=>{let t={"animate-normal":"normal","animate-reverse":"reverse","animate-alternate":"alternate","animate-alternate-reverse":"alternate-reverse"};return t[e.raw]?{"animation-direction":t[e.raw]}:void 0},ls=(e)=>{let t={"animate-fill-none":"none","animate-fill-forwards":"forwards","animate-fill-backwards":"backwards","animate-fill-both":"both"};return t[e.raw]?{"animation-fill-mode":t[e.raw]}:void 0},cs=(e)=>{if(e.utility==="animate-iteration"&&e.value)return{"animation-iteration-count":e.value==="infinite"?"infinite":e.value}},us=(e)=>{if(e.utility==="animate-duration"&&e.value)return{"animation-duration":{"75":"75ms","100":"100ms","150":"150ms","200":"200ms","300":"300ms","500":"500ms","700":"700ms","1000":"1000ms"}[e.value]||`${e.value}ms`}},fs=(e)=>{if(e.utility==="animate-delay"&&e.value)return{"animation-delay":{"75":"75ms","100":"100ms","150":"150ms","200":"200ms","300":"300ms","500":"500ms","700":"700ms","1000":"1000ms"}[e.value]||`${e.value}ms`}},ds=(e)=>{let t={"animate-ease-linear":"linear","animate-ease-in":"cubic-bezier(0.4, 0, 1, 1)","animate-ease-out":"cubic-bezier(0, 0, 0.2, 1)","animate-ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"};return t[e.raw]?{"animation-timing-function":t[e.raw]}:void 0},hs=[Un,Qn,Hn,Xn,Kn,Vn,Gn,_n,Jn,$n,es,as,ts,rs,is,os,ns,ss,ls,cs,us,fs,ds],ps=(e,t)=>{if(e.utility==="font"&&e.value){let r=t.theme.fontFamily[e.value];if(r)return{"font-family":r.join(", ")}}},gs=(e)=>{return{antialiased:{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale"},"subpixel-antialiased":{"-webkit-font-smoothing":"auto","-moz-osx-font-smoothing":"auto"}}[e.raw]},ms=(e)=>{let t={italic:"italic","not-italic":"normal"};return t[e.raw]?{"font-style":t[e.raw]}:void 0},ys=(e)=>{if(e.utility==="font-stretch"){let t=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"];return e.value&&t.includes(e.value)?{"font-stretch":e.value}:void 0}},bs=(e)=>{let t={"normal-nums":"normal",ordinal:"ordinal","slashed-zero":"slashed-zero","lining-nums":"lining-nums","oldstyle-nums":"oldstyle-nums","proportional-nums":"proportional-nums","tabular-nums":"tabular-nums","diagonal-fractions":"diagonal-fractions","stacked-fractions":"stacked-fractions"};return t[e.raw]?{"font-variant-numeric":t[e.raw]}:void 0},ws=(e)=>{if(e.utility==="tracking"){let t={tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"};if(!e.value)return;if(e.value.startsWith("-")){let r=e.value.slice(1);return{"letter-spacing":`-${t[r]||r}`}}return{"letter-spacing":t[e.value]||e.value}}},vs=(e)=>{if(e.utility==="line-clamp"&&e.value)return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":e.value}},xs=(e)=>{if(e.utility==="list-image"&&e.value)return{"list-style-image":e.value==="none"?"none":`url(${e.value})`}},ks=(e)=>{let t={"list-inside":"inside","list-outside":"outside"};return t[e.raw]?{"list-style-position":t[e.raw]}:void 0},Cs=(e)=>{if(e.utility!=="list"||!e.value)return;let t={none:"none",disc:"disc",decimal:"decimal"};return t[e.value]?{"list-style-type":t[e.value]}:void 0},Es=(e,t)=>{let r={underline:"underline",overline:"overline","line-through":"line-through","no-underline":"none"};if(r[e.raw])return{"text-decoration-line":r[e.raw]};if(e.utility==="decoration"&&e.value){let i={solid:"solid",double:"double",dotted:"dotted",dashed:"dashed",wavy:"wavy"};if(i[e.value])return{"text-decoration-style":i[e.value]};let a={auto:"auto","from-font":"from-font","0":"0px","1":"1px","2":"2px","4":"4px","8":"8px"};if(a[e.value])return{"text-decoration-thickness":a[e.value]};if(e.arbitrary)return{"text-decoration-thickness":e.value};let o=ie(e.value,t);if(o)return{"text-decoration-color":o};return{"text-decoration-color":e.value}}return},As=(e)=>{if(e.utility==="underline-offset"&&e.value)return{"text-underline-offset":{auto:"auto",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"}[e.value]||e.value}},Ss=(e)=>{let t={uppercase:"uppercase",lowercase:"lowercase",capitalize:"capitalize","normal-case":"none"};return t[e.raw]?{"text-transform":t[e.raw]}:void 0},Ns=(e)=>{return{truncate:{overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"},"text-ellipsis":{"text-overflow":"ellipsis"},"text-clip":{"text-overflow":"clip"}}[e.raw]},js=(e)=>{let t={"text-wrap":"wrap","text-nowrap":"nowrap","text-balance":"balance","text-pretty":"pretty"};return t[e.raw]?{"text-wrap":t[e.raw]}:void 0},zs=(e,t)=>{if(e.utility==="indent"&&e.value){if(e.value.startsWith("-")){let r=e.value.slice(1);return{"text-indent":`-${t.theme.spacing[r]||r}`}}return{"text-indent":t.theme.spacing[e.value]||e.value}}},Ts=(e)=>{let t={"align-baseline":"baseline","align-top":"top","align-middle":"middle","align-bottom":"bottom","align-text-top":"text-top","align-text-bottom":"text-bottom","align-sub":"sub","align-super":"super"};return t[e.raw]?{"vertical-align":t[e.raw]}:void 0},Fs=(e)=>{let t={"whitespace-normal":"normal","whitespace-nowrap":"nowrap","whitespace-pre":"pre","whitespace-pre-line":"pre-line","whitespace-pre-wrap":"pre-wrap","whitespace-break-spaces":"break-spaces"};return t[e.raw]?{"white-space":t[e.raw]}:void 0},Os=(e)=>{if(e.raw==="break-normal")return{"overflow-wrap":"normal","word-break":"normal"};if(e.raw==="break-words")return{"overflow-wrap":"break-word"};let t={"break-all":"break-all","break-keep":"keep-all"};return t[e.raw]?{"word-break":t[e.raw]}:void 0},Rs=(e)=>{let t={"overflow-wrap-normal":"normal","overflow-wrap-break":"break-word","overflow-wrap-anywhere":"anywhere"};return t[e.raw]?{"overflow-wrap":t[e.raw]}:void 0},Bs=(e)=>{let t={"hyphens-none":"none","hyphens-manual":"manual","hyphens-auto":"auto"};return t[e.raw]?{hyphens:t[e.raw]}:void 0},Ys=(e)=>{if(e.utility==="content"&&e.value){let t={none:"none"};if(t[e.value]||e.value.startsWith('"')||e.value.startsWith("'"))return{content:t[e.value]||e.value};return{content:`"${e.value}"`}}},Ps=(e,t)=>{if(e.utility==="leading"){if(!e.value)return;return{"line-height":{none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"}[e.value]||e.value}}},Ds=(e)=>{let t={"writing-horizontal-tb":"horizontal-tb","writing-vertical-rl":"vertical-rl","writing-vertical-lr":"vertical-lr"};return t[e.raw]?{"writing-mode":t[e.raw]}:void 0},Ls=(e)=>{let t={"text-orientation-mixed":"mixed","text-orientation-upright":"upright","text-orientation-sideways":"sideways"};return t[e.raw]?{"text-orientation":t[e.raw]}:void 0},Ws=(e)=>{let t={"direction-ltr":"ltr","direction-rtl":"rtl"};return t[e.raw]?{direction:t[e.raw]}:void 0},Ms=(e)=>{if(e.utility==="text-emphasis"&&e.value)return{"text-emphasis":{none:"none",filled:"filled",open:"open",dot:"dot",circle:"circle","double-circle":"double-circle",triangle:"triangle",sesame:"sesame"}[e.value]||e.value}},qs=(e,t)=>{if(e.utility==="text-emphasis-color"&&e.value){let r=e.value.split("-");if(r.length===2){let[a,o]=r,s=t.theme.colors[a];if(typeof s==="object"&&s[o])return{"text-emphasis-color":s[o]}}let i=t.theme.colors[e.value];if(typeof i==="string")return{"text-emphasis-color":i};if(typeof i==="object"&&i!==null&&typeof i.DEFAULT==="string")return{"text-emphasis-color":i.DEFAULT}}},Is=(e,t)=>{if(e.utility==="word-spacing"&&e.value)return{"word-spacing":{tighter:"-0.05em",tight:"-0.025em",normal:"normal",wide:"0.025em",wider:"0.05em",widest:"0.1em"}[e.value]||t.theme.spacing[e.value]||e.value}},Zs=(e)=>{let t={"small-caps":"small-caps","all-small-caps":"all-small-caps","petite-caps":"petite-caps","all-petite-caps":"all-petite-caps",unicase:"unicase","titling-caps":"titling-caps","normal-caps":"normal"};return t[e.raw]?{"font-variant-caps":t[e.raw]}:void 0},Us=(e)=>{let t={"ligatures-normal":"normal","ligatures-none":"none","common-ligatures":"common-ligatures","no-common-ligatures":"no-common-ligatures","discretionary-ligatures":"discretionary-ligatures","no-discretionary-ligatures":"no-discretionary-ligatures","historical-ligatures":"historical-ligatures","no-historical-ligatures":"no-historical-ligatures",contextual:"contextual","no-contextual":"no-contextual"};return t[e.raw]?{"font-variant-ligatures":t[e.raw]}:void 0},Qs=[ps,gs,ms,ys,bs,Zs,Us,ws,Ps,vs,xs,ks,Cs,Es,As,Ss,Ns,js,zs,Ts,Fs,Os,Rs,Bs,Ys,Ds,Ls,Ws,Ms,qs,Is],wi=(e)=>{if(["block","inline-block","inline","flex","inline-flex","grid","inline-grid","hidden","none","contents","flow-root","list-item"].includes(e.utility)&&!e.value)return{display:e.utility==="hidden"?"none":e.utility};if(e.utility==="table"){if(!e.value)return{display:"table"};if(new Set(["cell","row","row-group","column","column-group","header-group","footer-group","caption"]).has(e.value))return{display:`table-${e.value}`}}if(e.utility==="inline"&&e.value==="table")return{display:"inline-table"};if(e.utility==="flow"&&e.value==="root")return{display:"flow-root"};if(e.utility==="list"&&e.value==="item")return{display:"list-item"}},vi=(e)=>{if(e.utility==="scrollbar"&&e.value){let t={auto:"auto",thin:"thin",none:"none"}[e.value];if(t)return{"scrollbar-width":t}}},xi=(e)=>{if(e.utility==="content"){if(e.value==="none")return{content:"none"};if(e.value==="empty")return{content:'""'};if(e.arbitrary&&e.value)return{content:e.value}}},ki=(e)=>{if(e.utility==="@container")return{"container-type":"inline-size"};if(e.utility==="@container-normal")return{"container-type":"normal"};if(e.utility.startsWith("@container/"))return{"container-type":"inline-size","container-name":e.utility.slice(11)}},Ci=(e)=>{let t={"flex-row":"row","flex-row-reverse":"row-reverse","flex-col":"column","flex-col-reverse":"column-reverse"};return t[e.utility]?{"flex-direction":t[e.utility]}:void 0},Ei=(e)=>{let t={"flex-wrap":"wrap","flex-wrap-reverse":"wrap-reverse","flex-nowrap":"nowrap"};return t[e.utility]?{"flex-wrap":t[e.utility]}:void 0},Ai=(e)=>{if(e.utility==="flex"||e.utility.startsWith("flex-")){let t={"flex-1":"1 1 0%","flex-auto":"1 1 auto","flex-initial":"0 1 auto","flex-none":"none"};if(t[e.utility])return{flex:t[e.utility]};if(e.utility==="flex"&&e.arbitrary&&e.value)return{flex:e.value.replace(/_/g," ")}}return},Si=(e)=>{if(e.utility==="flex-grow"&&!e.value)return{"flex-grow":"1"};if(e.utility==="flex-grow"&&e.value)return{"flex-grow":e.value}},Ni=(e)=>{if(e.utility==="flex-shrink"&&!e.value)return{"flex-shrink":"1"};if(e.utility==="flex-shrink"&&e.value)return{"flex-shrink":e.value}},ji=(e)=>{if(e.utility==="justify"&&e.value){let t={start:"flex-start",end:"flex-end",center:"center",between:"space-between",around:"space-around",evenly:"space-evenly"};if(t[e.value])return{"justify-content":t[e.value]};if(e.arbitrary)return{"justify-content":e.value}}return},zi=(e)=>{if(e.utility==="items"&&e.value){let t={start:"flex-start",end:"flex-end",center:"center",baseline:"baseline",stretch:"stretch"};if(t[e.value])return{"align-items":t[e.value]};if(e.arbitrary)return{"align-items":e.value}}return},Ti=(e)=>{if(e.utility==="justify"&&e.value&&e.value.startsWith("items-")){let t={"items-start":"start","items-end":"end","items-center":"center","items-stretch":"stretch"};return t[e.value]?{"justify-items":t[e.value]}:void 0}return},Fi=(e)=>{if(e.utility==="content"&&e.value){let t={normal:"normal",center:"center",start:"flex-start",end:"flex-end",between:"space-between",around:"space-around",evenly:"space-evenly",baseline:"baseline",stretch:"stretch"};return t[e.value]?{"align-content":t[e.value]}:void 0}return},Oi=(e,t)=>{let r={p:["padding"],px:["padding-left","padding-right"],py:["padding-top","padding-bottom"],pt:["padding-top"],pr:["padding-right"],pb:["padding-bottom"],pl:["padding-left"],ps:["padding-inline-start"],pe:["padding-inline-end"],m:["margin"],mx:["margin-left","margin-right"],my:["margin-top","margin-bottom"],mt:["margin-top"],mr:["margin-right"],mb:["margin-bottom"],ml:["margin-left"],ms:["margin-inline-start"],me:["margin-inline-end"]}[e.utility];if(!r||!e.value)return;let i=(s)=>{let l=t.theme.spacing[s];if(l!==void 0)return l;if(/^\d+(?:\.\d+)?$/.test(s)){let n=Number.parseFloat(s);if(Number.isFinite(n))return`${n*0.25}rem`}return s},a;if(e.value.startsWith("-")){let s=e.value.slice(1);if(s==="0")a=t.theme.spacing[s]||"0";else{let l=i(s);a=l===s?e.value:`-${l}`}}else a=i(e.value);let o={};for(let s of r)o[s]=a;return o},Ri=(e,t)=>{if(e.utility==="w"&&e.value){let r={full:"100%",screen:"100vw",svw:"100svw",lvw:"100lvw",dvw:"100dvw",auto:"auto",min:"min-content",max:"max-content",fit:"fit-content"};if(e.value.includes("/")){let[i,a]=e.value.split("/").map(Number);if(Number.isNaN(i)||Number.isNaN(a)||a===0)return;return{width:`${i/a*100}%`}}return{width:t.theme.spacing[e.value]||r[e.value]||e.value}}if(e.utility==="h"&&e.value){let r={full:"100%",screen:"100vh",svh:"100svh",lvh:"100lvh",dvh:"100dvh",auto:"auto",min:"min-content",max:"max-content",fit:"fit-content"};if(e.value.includes("/")){let[i,a]=e.value.split("/").map(Number);if(Number.isNaN(i)||Number.isNaN(a)||a===0)return;return{height:`${i/a*100}%`}}return{height:t.theme.spacing[e.value]||r[e.value]||e.value}}if(e.utility==="size"&&e.value){let r={full:"100%",auto:"auto",min:"min-content",max:"max-content",fit:"fit-content"};if(e.value.includes("/")){let[a,o]=e.value.split("/").map(Number);if(Number.isNaN(a)||Number.isNaN(o)||o===0)return;let s=`${a/o*100}%`;return{width:s,height:s}}let i=t.theme.spacing[e.value]||r[e.value]||e.value;return{width:i,height:i}}return},ne=null,$e=null,Hs={bg:"background-color",text:"color",border:"border-color"},Bi={current:"currentColor",transparent:"transparent",inherit:"inherit"};function Yi(e){let t=new Map;for(let[r,i]of Object.entries(e))if(typeof i==="string")t.set(r,i);else if(typeof i==="object"&&i!==null){for(let[a,o]of Object.entries(i))if(typeof o==="string")t.set(a==="DEFAULT"?r:`${r}-${a}`,o)}return t}var Pi=(e,t)=>{let r=Hs[e.utility];if(!r||!e.value)return;let i=e.value;if(e.arbitrary&&e.typeHint==="color")return{[r]:i};if(ne===null||$e!==t.theme.colors)ne=Yi(t.theme.colors),$e=t.theme.colors;let a=i.indexOf("/");if(a===-1){let n=ne.get(i);if(n)return{[r]:n}}let o,s=i;if(a!==-1){s=i.slice(0,a);let n=i.slice(a+1);if(n.charCodeAt(0)===91&&n.charCodeAt(n.length-1)===93){let u=Number.parseFloat(n.slice(1,-1));if(Number.isNaN(u)||u<0||u>1)return;o=u}else{let u=Number.parseInt(n,10);if(Number.isNaN(u)||u<0||u>100)return;o=u/100}let c=ne.get(s);if(c)return{[r]:te(c,o)}}let l=Bi[s];if(l)return{[r]:l};if((e.arbitrary||s&&s.charCodeAt(0)===91)&&s){let n=o!==void 0?te(s,o):s;return{[r]:n}}return};function te(e,t){let r=e;if(e.charCodeAt(0)===91&&e.charCodeAt(e.length-1)===93)r=e.slice(1,-1);if(r.charCodeAt(0)===35){let i=r.slice(1);if(i.length===3)i=i[0]+i[0]+i[1]+i[1]+i[2]+i[2];let a=Number.parseInt(i.slice(0,2),16),o=Number.parseInt(i.slice(2,4),16),s=Number.parseInt(i.slice(4,6),16);return`rgb(${a} ${o} ${s} / ${t})`}if(r.charCodeAt(0)===114){let i=r.match(/rgb\((\d+)\s+(\d+)\s+(\d+)/);if(i)return`rgb(${i[1]} ${i[2]} ${i[3]} / ${t})`}if(r.charCodeAt(0)===111){let i=r.match(/oklch\(([^)]+)\)/);if(i)return`oklch(${i[1]} / ${t})`}if(r.charCodeAt(0)===104){let i=r.match(/hsl\(([^)]+)\)/);if(i)return`hsl(${i[1]} / ${t})`}return r}function ie(e,t){let r=e.indexOf("/"),i=e,a;if(r!==-1){i=e.slice(0,r);let n=e.slice(r+1);if(n.charCodeAt(0)===91&&n.charCodeAt(n.length-1)===93){if(a=Number.parseFloat(n.slice(1,-1)),Number.isNaN(a)||a<0||a>1)return}else{let c=Number.parseInt(n,10);if(Number.isNaN(c)||c<0||c>100)return;a=c/100}}let o={current:"currentColor",transparent:"transparent",inherit:"inherit",auto:"auto"};if(o[i])return a!==void 0?te(o[i],a):o[i];let s=t.theme.colors[i];if(typeof s==="string")return a!==void 0?te(s,a):s;if(typeof s==="object"&&s!==null&&typeof s.DEFAULT==="string")return a!==void 0?te(s.DEFAULT,a):s.DEFAULT;let l=i.split("-");if(l.length>=2){let n=l[l.length-1],c=l.slice(0,-1).join("-"),u=t.theme.colors[c];if(typeof u==="object"&&u[n])return a!==void 0?te(u[n],a):u[n]}if(i.startsWith("var(")||i.startsWith("#")||i.startsWith("rgb(")||i.startsWith("rgba(")||i.startsWith("hsl(")||i.startsWith("hsla(")||i.startsWith("oklch(")||i.startsWith("oklab(")||i.startsWith("lab(")||i.startsWith("lch(")||i.startsWith("color(")||i.startsWith("color-mix("))return a!==void 0?te(i,a):i;return}var Di=(e,t)=>{if(e.utility!=="placeholder"||!e.value)return;if(ne===null||$e!==t.theme.colors)ne=Yi(t.theme.colors),$e=t.theme.colors;let r=e.value,i=r.indexOf("/");if(i===-1){let o=ne.get(r);if(o)return{properties:{color:o},pseudoElement:"::placeholder"}}else{let o=r.slice(0,i),s=r.slice(i+1),l;if(s.charCodeAt(0)===91&&s.charCodeAt(s.length-1)===93){let c=Number.parseFloat(s.slice(1,-1));if(Number.isNaN(c)||c<0||c>1)return;l=c}else{let c=Number.parseInt(s,10);if(Number.isNaN(c)||c<0||c>100)return;l=c/100}let n=ne.get(o);if(n)return{properties:{color:te(n,l)},pseudoElement:"::placeholder"}}let a=Bi[e.value];if(a)return{properties:{color:a},pseudoElement:"::placeholder"};return},Li=(e,t)=>{if(e.utility==="text"&&e.value){let r=e.value,i,a=r.lastIndexOf("/");if(a!==-1&&!e.value.startsWith("[")&&!r.slice(a+1).includes("]"));if(a!==-1){let s=r.slice(0,a),l=r.slice(a+1);if(l&&(t.theme.fontSize[s]||e.arbitrary)){r=s;let n={none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"};i=t.theme.lineHeight?.[l]??n[l]??l}}if(e.arbitrary){if(e.typeHint){if(e.typeHint==="color")return;let l={"font-size":r};if(i)l["line-height"]=i;return l}if(/^#|^rgb|^hsl|^hwb|^lab|^lch|^oklch|^oklab|^color\(|^var\(--/.test(r))return;let s={"font-size":r};if(i)s["line-height"]=i;return s}let o=t.theme.fontSize[r];if(o)return{"font-size":o[0],"line-height":i??o[1].lineHeight}}},Wi=(e)=>{if(e.utility==="font"&&e.value){if(e.arbitrary){let r=e.typeHint;return r==="family-name"||r==="string"?{"font-family":e.value}:{"font-weight":e.value}}let t={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"};return t[e.value]?{"font-weight":t[e.value]}:void 0}return},Mi=(e)=>{if(e.utility==="leading"&&e.value){if(e.arbitrary)return{"line-height":e.value};let t={none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2","3":"0.75rem","4":"1rem","5":"1.25rem","6":"1.5rem","7":"1.75rem","8":"2rem","9":"2.25rem","10":"2.5rem"};return t[e.value]?{"line-height":t[e.value]}:void 0}return},qi=(e)=>{if(e.utility==="text"&&e.value){let t={left:"left",center:"center",right:"right",justify:"justify"};return t[e.value]?{"text-align":t[e.value]}:void 0}},Ii=(e)=>{if(e.utility==="border"){if(!e.value)return{"border-width":"1px"};let t={0:"0px",2:"2px",4:"4px",8:"8px"};if(t[e.value])return{"border-width":t[e.value]};let r={t:"border-top-width",r:"border-right-width",b:"border-bottom-width",l:"border-left-width",s:"border-inline-start-width",e:"border-inline-end-width"};if(e.value==="x")return{"border-left-width":"1px","border-right-width":"1px"};if(e.value==="y")return{"border-top-width":"1px","border-bottom-width":"1px"};let i=r[e.value];if(typeof i==="string")return{[i]:"1px"};return}},Zi=(e,t)=>{let r={"border-t":"border-top-width","border-r":"border-right-width","border-b":"border-bottom-width","border-l":"border-left-width","border-x":["border-left-width","border-right-width"],"border-y":["border-top-width","border-bottom-width"],"border-s":"border-inline-start-width","border-e":"border-inline-end-width"},i={"border-t":"border-top-color","border-r":"border-right-color","border-b":"border-bottom-color","border-l":"border-left-color","border-x":["border-left-color","border-right-color"],"border-y":["border-top-color","border-bottom-color"],"border-s":"border-inline-start-color","border-e":"border-inline-end-color"},a=r[e.utility];if(!a)return;let o={0:"0px",2:"2px",4:"4px",8:"8px"};if(!e.value){let l=a;if(Array.isArray(l))return l.reduce((n,c)=>({...n,[c]:"1px"}),{});return{[l]:"1px"}}if(e.arbitrary){let l=e.value,n=(/^#|^(?:rgb|rgba|hsl|hsla|oklch|oklab|lab|lch)\(|^(?:currentColor|transparent|inherit)$/i.test(l)?i[e.utility]:a)??a;if(Array.isArray(n))return n.reduce((c,u)=>({...c,[u]:l}),{});return{[n]:l}}if(o[e.value]){let l=a;if(Array.isArray(l))return l.reduce((n,c)=>({...n,[c]:o[e.value]}),{});return{[l]:o[e.value]}}let s=i[e.utility];if(s&&t){let l=e.value.split("-");if(l.length>=2){let c=l[l.length-1],u=l.slice(0,-1).join("-"),f=t.theme.colors[u];if(f&&typeof f==="object"&&f[c]){let d=s;if(Array.isArray(d))return d.reduce((h,y)=>({...h,[y]:f[c]}),{});return{[d]:f[c]}}}let n=t.theme.colors[e.value];if(typeof n==="string"){let c=s;if(Array.isArray(c))return c.reduce((u,f)=>({...u,[f]:n}),{});return{[c]:n}}if(n&&typeof n==="object"&&typeof n.DEFAULT==="string"){let c=s;if(Array.isArray(c))return c.reduce((u,f)=>({...u,[f]:n.DEFAULT}),{});return{[c]:n.DEFAULT}}if(e.value==="transparent"||e.value==="current"||e.value==="inherit"){let c=e.value==="current"?"currentColor":e.value,u=s;if(Array.isArray(u))return u.reduce((f,d)=>({...f,[d]:c}),{});return{[u]:c}}}return},Ui=(e,t)=>{if(e.utility==="rounded"){if(e.arbitrary&&e.value)return{"border-radius":e.value};let i=e.value?t.theme.borderRadius[e.value]:t.theme.borderRadius.DEFAULT;return i?{"border-radius":i}:void 0}if(e.utility==="rounded-s"&&e.value){let i=t.theme.borderRadius[e.value]||e.value;return{"border-start-start-radius":i,"border-end-start-radius":i}}if(e.utility==="rounded-e"&&e.value){let i=t.theme.borderRadius[e.value]||e.value;return{"border-start-end-radius":i,"border-end-end-radius":i}}if(e.utility==="rounded-ss"&&e.value)return{"border-start-start-radius":t.theme.borderRadius[e.value]||e.value};if(e.utility==="rounded-se"&&e.value)return{"border-start-end-radius":t.theme.borderRadius[e.value]||e.value};if(e.utility==="rounded-es"&&e.value)return{"border-end-start-radius":t.theme.borderRadius[e.value]||e.value};if(e.utility==="rounded-ee"&&e.value)return{"border-end-end-radius":t.theme.borderRadius[e.value]||e.value};let r={"rounded-t":["border-top-left-radius","border-top-right-radius"],"rounded-r":["border-top-right-radius","border-bottom-right-radius"],"rounded-b":["border-bottom-left-radius","border-bottom-right-radius"],"rounded-l":["border-top-left-radius","border-bottom-left-radius"],"rounded-tl":["border-top-left-radius"],"rounded-tr":["border-top-right-radius"],"rounded-bl":["border-bottom-left-radius"],"rounded-br":["border-bottom-right-radius"]}[e.utility];if(r&&e.value){let i=t.theme.borderRadius[e.value]||e.value,a={};for(let o of r)a[o]=i;return a}},Ht=[Uo,Oi,Ri,Fi,Li,qi,...Qs,Wi,Mi,...Er,Di,Pi,..._a,...Zn,Ci,Ei,Ai,Si,Ni,ji,zi,Ti,...Po,...hs,...Er,...kn,...Eo,Zi,Ii,Ui,ki,vi,xi,wi];function Xt(e,t){let r={...e};for(let i in t){let a=t[i],o=r[i];if(a&&typeof a==="object"&&!Array.isArray(a)&&o&&typeof o==="object"&&!Array.isArray(o))r[i]=Xt(o,a);else if(a!==void 0)r[i]=a}return r}var Xs={block:{display:"block"},"inline-block":{display:"inline-block"},inline:{display:"inline"},flex:{display:"flex"},"inline-flex":{display:"inline-flex"},grid:{display:"grid"},"inline-grid":{display:"inline-grid"},hidden:{display:"none"},none:{display:"none"}},Ks={"flex-row":{"flex-direction":"row"},"flex-row-reverse":{"flex-direction":"row-reverse"},"flex-col":{"flex-direction":"column"},"flex-col-reverse":{"flex-direction":"column-reverse"}},Vs={"flex-wrap":{"flex-wrap":"wrap"},"flex-wrap-reverse":{"flex-wrap":"wrap-reverse"},"flex-nowrap":{"flex-wrap":"nowrap"}},Gs={"flex-1":{flex:"1 1 0%"},"flex-auto":{flex:"1 1 auto"},"flex-initial":{flex:"0 1 auto"},"flex-none":{flex:"none"}},_s={grow:{"flex-grow":"1"},"grow-0":{"flex-grow":"0"},shrink:{"flex-shrink":"1"},"shrink-0":{"flex-shrink":"0"}},Js={start:"flex-start",end:"flex-end",center:"center",between:"space-between",around:"space-around",evenly:"space-evenly"},$s={start:"flex-start",end:"flex-end",center:"center",baseline:"baseline",stretch:"stretch"},el={normal:"normal",center:"center",start:"flex-start",end:"flex-end",between:"space-between",around:"space-around",evenly:"space-evenly",baseline:"baseline",stretch:"stretch"},tl={auto:"auto",start:"flex-start",end:"flex-end",center:"center",stretch:"stretch",baseline:"baseline"},rl={"border-solid":{"border-style":"solid"},"border-dashed":{"border-style":"dashed"},"border-dotted":{"border-style":"dotted"},"border-double":{"border-style":"double"},"border-none":{"border-style":"none"}},il={transform:{transform:"translate(var(--hw-translate-x), var(--hw-translate-y)) rotate(var(--hw-rotate)) skewX(var(--hw-skew-x)) skewY(var(--hw-skew-y)) scaleX(var(--hw-scale-x)) scaleY(var(--hw-scale-y))"},"transform-cpu":{transform:"translate(var(--hw-translate-x), var(--hw-translate-y)) rotate(var(--hw-rotate)) skewX(var(--hw-skew-x)) skewY(var(--hw-skew-y)) scaleX(var(--hw-scale-x)) scaleY(var(--hw-scale-y))"},"transform-gpu":{transform:"translate3d(var(--hw-translate-x), var(--hw-translate-y), 0) rotate(var(--hw-rotate)) skewX(var(--hw-skew-x)) skewY(var(--hw-skew-y)) scaleX(var(--hw-scale-x)) scaleY(var(--hw-scale-y))"},"transform-none":{transform:"none"}},al={"transition-none":{"transition-property":"none"},"transition-all":{"transition-property":"all"},transition:{"transition-property":"color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter"},"transition-colors":{"transition-property":"color, background-color, border-color, text-decoration-color, fill, stroke"},"transition-opacity":{"transition-property":"opacity"},"transition-shadow":{"transition-property":"box-shadow"},"transition-transform":{"transition-property":"transform"}},ol={"ease-linear":{"transition-timing-function":"linear"},"ease-in":{"transition-timing-function":"cubic-bezier(0.4, 0, 1, 1)"},"ease-out":{"transition-timing-function":"cubic-bezier(0, 0, 0.2, 1)"},"ease-in-out":{"transition-timing-function":"cubic-bezier(0.4, 0, 0.2, 1)"}},nl={"animate-none":{animation:"none"},"animate-spin":{animation:"spin 1s linear infinite"},"animate-ping":{animation:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite"},"animate-pulse":{animation:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite"},"animate-bounce":{animation:"bounce 1s infinite"}},sl={spin:`@keyframes spin {
3
+ from { transform: rotate(0deg); }
4
+ to { transform: rotate(360deg); }
5
+ }`,ping:`@keyframes ping {
6
+ 75%, 100% { transform: scale(2); opacity: 0; }
7
+ }`,pulse:`@keyframes pulse {
8
+ 0%, 100% { opacity: 1; }
9
+ 50% { opacity: .5; }
10
+ }`,bounce:`@keyframes bounce {
11
+ 0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
12
+ 50% { transform: translateY(0); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
13
+ }`},ll={center:"center",top:"top","top-right":"top right",right:"right","bottom-right":"bottom right",bottom:"bottom","bottom-left":"bottom left",left:"left","top-left":"top left"},cl={"1":"repeat(1, minmax(0, 1fr))","2":"repeat(2, minmax(0, 1fr))","3":"repeat(3, minmax(0, 1fr))","4":"repeat(4, minmax(0, 1fr))","5":"repeat(5, minmax(0, 1fr))","6":"repeat(6, minmax(0, 1fr))","7":"repeat(7, minmax(0, 1fr))","8":"repeat(8, minmax(0, 1fr))","9":"repeat(9, minmax(0, 1fr))","10":"repeat(10, minmax(0, 1fr))","11":"repeat(11, minmax(0, 1fr))","12":"repeat(12, minmax(0, 1fr))",none:"none",subgrid:"subgrid"},ul={"1":"repeat(1, minmax(0, 1fr))","2":"repeat(2, minmax(0, 1fr))","3":"repeat(3, minmax(0, 1fr))","4":"repeat(4, minmax(0, 1fr))","5":"repeat(5, minmax(0, 1fr))","6":"repeat(6, minmax(0, 1fr))",none:"none",subgrid:"subgrid"},fl={auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},dl={auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-full":"1 / -1"},hl={row:"row",col:"column",dense:"dense","row-dense":"row dense","col-dense":"column dense"},Sr={auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},Ct={center:"center",start:"start",end:"end",between:"space-between",around:"space-around",evenly:"space-evenly",stretch:"stretch"},pl={ring:{"box-shadow":"0 0 0 3px var(--hw-ring-color, rgba(59, 130, 246, 0.5))"},"ring-0":{"box-shadow":"0 0 0 0px var(--hw-ring-color, rgba(59, 130, 246, 0.5))"},"ring-1":{"box-shadow":"0 0 0 1px var(--hw-ring-color, rgba(59, 130, 246, 0.5))"},"ring-2":{"box-shadow":"0 0 0 2px var(--hw-ring-color, rgba(59, 130, 246, 0.5))"},"ring-4":{"box-shadow":"0 0 0 4px var(--hw-ring-color, rgba(59, 130, 246, 0.5))"},"ring-8":{"box-shadow":"0 0 0 8px var(--hw-ring-color, rgba(59, 130, 246, 0.5))"},"ring-inset":{"--hw-ring-inset":"inset"}},gl={"shadow-sm":{"--hw-shadow":"0 1px 2px 0 rgb(0 0 0 / 0.05)","--hw-shadow-colored":"0 1px 2px 0 var(--hw-shadow-color)","box-shadow":"var(--hw-ring-offset-shadow, 0 0 #0000), var(--hw-ring-shadow, 0 0 #0000), var(--hw-shadow)"},shadow:{"--hw-shadow":"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)","--hw-shadow-colored":"0 1px 3px 0 var(--hw-shadow-color), 0 1px 2px -1px var(--hw-shadow-color)","box-shadow":"var(--hw-ring-offset-shadow, 0 0 #0000), var(--hw-ring-shadow, 0 0 #0000), var(--hw-shadow)"},"shadow-md":{"--hw-shadow":"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)","--hw-shadow-colored":"0 4px 6px -1px var(--hw-shadow-color), 0 2px 4px -2px var(--hw-shadow-color)","box-shadow":"var(--hw-ring-offset-shadow, 0 0 #0000), var(--hw-ring-shadow, 0 0 #0000), var(--hw-shadow)"},"shadow-lg":{"--hw-shadow":"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)","--hw-shadow-colored":"0 10px 15px -3px var(--hw-shadow-color), 0 4px 6px -4px var(--hw-shadow-color)","box-shadow":"var(--hw-ring-offset-shadow, 0 0 #0000), var(--hw-ring-shadow, 0 0 #0000), var(--hw-shadow)"},"shadow-xl":{"--hw-shadow":"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","--hw-shadow-colored":"0 20px 25px -5px var(--hw-shadow-color), 0 8px 10px -6px var(--hw-shadow-color)","box-shadow":"var(--hw-ring-offset-shadow, 0 0 #0000), var(--hw-ring-shadow, 0 0 #0000), var(--hw-shadow)"},"shadow-2xl":{"--hw-shadow":"0 25px 50px -12px rgb(0 0 0 / 0.25)","--hw-shadow-colored":"0 25px 50px -12px var(--hw-shadow-color)","box-shadow":"var(--hw-ring-offset-shadow, 0 0 #0000), var(--hw-ring-shadow, 0 0 #0000), var(--hw-shadow)"},"shadow-inner":{"--hw-shadow":"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)","--hw-shadow-colored":"inset 0 2px 4px 0 var(--hw-shadow-color)","box-shadow":"var(--hw-ring-offset-shadow, 0 0 #0000), var(--hw-ring-shadow, 0 0 #0000), var(--hw-shadow)"},"shadow-none":{"--hw-shadow":"0 0 #0000","box-shadow":"var(--hw-ring-offset-shadow, 0 0 #0000), var(--hw-ring-shadow, 0 0 #0000), var(--hw-shadow)"}},ml={"rounded-none":{"border-radius":"0px"},"rounded-sm":{"border-radius":"0.125rem"},rounded:{"border-radius":"0.25rem"},"rounded-md":{"border-radius":"0.375rem"},"rounded-lg":{"border-radius":"0.5rem"},"rounded-xl":{"border-radius":"0.75rem"},"rounded-2xl":{"border-radius":"1rem"},"rounded-3xl":{"border-radius":"1.5rem"},"rounded-full":{"border-radius":"9999px"},"rounded-t-none":{"border-top-left-radius":"0px","border-top-right-radius":"0px"},"rounded-t-sm":{"border-top-left-radius":"0.125rem","border-top-right-radius":"0.125rem"},"rounded-t-lg":{"border-top-left-radius":"0.5rem","border-top-right-radius":"0.5rem"},"rounded-r-lg":{"border-top-right-radius":"0.5rem","border-bottom-right-radius":"0.5rem"},"rounded-b-lg":{"border-bottom-left-radius":"0.5rem","border-bottom-right-radius":"0.5rem"},"rounded-l-lg":{"border-top-left-radius":"0.5rem","border-bottom-left-radius":"0.5rem"},"rounded-tl-lg":{"border-top-left-radius":"0.5rem"},"rounded-tr-lg":{"border-top-right-radius":"0.5rem"},"rounded-br-lg":{"border-bottom-right-radius":"0.5rem"},"rounded-bl-lg":{"border-bottom-left-radius":"0.5rem"}},yl={border:{"border-width":"1px"},"border-0":{"border-width":"0px"},"border-2":{"border-width":"2px"},"border-4":{"border-width":"4px"},"border-8":{"border-width":"8px"},"border-t":{"border-top-width":"1px"},"border-r":{"border-right-width":"1px"},"border-b":{"border-bottom-width":"1px"},"border-l":{"border-left-width":"1px"},"border-t-0":{"border-top-width":"0px"},"border-r-0":{"border-right-width":"0px"},"border-b-0":{"border-bottom-width":"0px"},"border-l-0":{"border-left-width":"0px"},"border-t-2":{"border-top-width":"2px"},"border-r-2":{"border-right-width":"2px"},"border-b-2":{"border-bottom-width":"2px"},"border-l-2":{"border-left-width":"2px"},"border-t-4":{"border-top-width":"4px"},"border-r-4":{"border-right-width":"4px"},"border-b-4":{"border-bottom-width":"4px"},"border-l-4":{"border-left-width":"4px"},"border-x":{"border-left-width":"1px","border-right-width":"1px"},"border-y":{"border-top-width":"1px","border-bottom-width":"1px"},"border-x-0":{"border-left-width":"0px","border-right-width":"0px"},"border-y-0":{"border-top-width":"0px","border-bottom-width":"0px"},"border-x-2":{"border-left-width":"2px","border-right-width":"2px"},"border-y-2":{"border-top-width":"2px","border-bottom-width":"2px"}},bl={"ring-offset-0":{"--hw-ring-offset-width":"0px"},"ring-offset-1":{"--hw-ring-offset-width":"1px"},"ring-offset-2":{"--hw-ring-offset-width":"2px"},"ring-offset-4":{"--hw-ring-offset-width":"4px"},"ring-offset-8":{"--hw-ring-offset-width":"8px"}},wl={"opacity-0":{opacity:"0"},"opacity-5":{opacity:"0.05"},"opacity-10":{opacity:"0.1"},"opacity-20":{opacity:"0.2"},"opacity-25":{opacity:"0.25"},"opacity-30":{opacity:"0.3"},"opacity-40":{opacity:"0.4"},"opacity-50":{opacity:"0.5"},"opacity-60":{opacity:"0.6"},"opacity-70":{opacity:"0.7"},"opacity-75":{opacity:"0.75"},"opacity-80":{opacity:"0.8"},"opacity-90":{opacity:"0.9"},"opacity-95":{opacity:"0.95"},"opacity-100":{opacity:"1"}},W={"0":"0",px:"1px","0.5":"0.125rem","1":"0.25rem","1.5":"0.375rem","2":"0.5rem","2.5":"0.625rem","3":"0.75rem","3.5":"0.875rem","4":"1rem","5":"1.25rem","6":"1.5rem","7":"1.75rem","8":"2rem","9":"2.25rem","10":"2.5rem","11":"2.75rem","12":"3rem","14":"3.5rem","16":"4rem","20":"5rem","24":"6rem","28":"7rem","32":"8rem","36":"9rem","40":"10rem","44":"11rem","48":"12rem","52":"13rem","56":"14rem","60":"15rem","64":"16rem","72":"18rem","80":"20rem","96":"24rem"},Nr={...W,auto:"auto",full:"100%",screen:"100vw",min:"min-content",max:"max-content",fit:"fit-content","1/2":"50%","1/3":"33.33333333333333%","2/3":"66.66666666666666%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666666666666664%","2/6":"33.33333333333333%","3/6":"50%","4/6":"66.66666666666666%","5/6":"83.33333333333334%"},Et={"gray-50":"oklch(98.5% 0.002 247.839)","gray-100":"oklch(96.7% 0.003 264.542)","gray-200":"oklch(92.8% 0.006 264.531)","gray-300":"oklch(87.2% 0.01 258.338)","gray-400":"oklch(70.7% 0.022 261.325)","gray-500":"oklch(55.1% 0.027 264.364)","gray-600":"oklch(44.6% 0.03 256.802)","gray-700":"oklch(37.3% 0.034 259.733)","gray-800":"oklch(27.8% 0.033 256.848)","gray-900":"oklch(21% 0.034 264.665)","gray-950":"oklch(13% 0.028 261.692)","red-50":"oklch(97.1% 0.013 17.38)","red-100":"oklch(93.6% 0.032 17.717)","red-200":"oklch(88.5% 0.062 18.334)","red-300":"oklch(80.8% 0.114 19.571)","red-400":"oklch(70.4% 0.191 22.216)","red-500":"oklch(63.7% 0.237 25.331)","red-600":"oklch(57.7% 0.245 27.325)","red-700":"oklch(50.5% 0.213 27.518)","red-800":"oklch(44.4% 0.177 26.899)","red-900":"oklch(39.6% 0.141 25.723)","red-950":"oklch(25.8% 0.092 26.042)","blue-50":"oklch(97% 0.014 254.604)","blue-100":"oklch(93.2% 0.032 255.585)","blue-200":"oklch(88.2% 0.059 254.128)","blue-300":"oklch(80.9% 0.105 251.813)","blue-400":"oklch(70.7% 0.165 254.624)","blue-500":"oklch(62.3% 0.214 259.815)","blue-600":"oklch(54.6% 0.245 262.881)","blue-700":"oklch(48.8% 0.243 264.376)","blue-800":"oklch(42.4% 0.199 265.638)","blue-900":"oklch(37.9% 0.146 265.522)","blue-950":"oklch(28.2% 0.091 267.935)","green-50":"oklch(98.2% 0.018 155.826)","green-100":"oklch(96.2% 0.044 156.743)","green-200":"oklch(92.5% 0.084 155.995)","green-300":"oklch(87.1% 0.15 154.449)","green-400":"oklch(79.2% 0.209 151.711)","green-500":"oklch(72.3% 0.219 149.579)","green-600":"oklch(62.7% 0.194 149.214)","green-700":"oklch(52.7% 0.154 150.069)","green-800":"oklch(44.8% 0.119 151.328)","green-900":"oklch(39.3% 0.095 152.535)","green-950":"oklch(26.6% 0.065 152.934)","yellow-50":"oklch(98.7% 0.026 102.212)","yellow-100":"oklch(97.3% 0.071 103.193)","yellow-200":"oklch(94.5% 0.129 101.54)","yellow-300":"oklch(90.5% 0.182 98.111)","yellow-400":"oklch(85.2% 0.199 91.936)","yellow-500":"oklch(79.5% 0.184 86.047)","yellow-600":"oklch(68.1% 0.162 75.834)","yellow-700":"oklch(55.4% 0.135 66.442)","yellow-800":"oklch(47.6% 0.114 61.907)","yellow-900":"oklch(42.1% 0.095 57.708)","yellow-950":"oklch(28.6% 0.066 53.813)","purple-50":"oklch(97.7% 0.014 308.299)","purple-100":"oklch(94.6% 0.033 307.174)","purple-200":"oklch(90.2% 0.063 306.703)","purple-300":"oklch(82.7% 0.119 306.383)","purple-400":"oklch(71.4% 0.203 305.504)","purple-500":"oklch(62.7% 0.265 303.9)","purple-600":"oklch(55.8% 0.288 302.321)","purple-700":"oklch(49.6% 0.265 301.924)","purple-800":"oklch(43.8% 0.218 303.724)","purple-900":"oklch(38.1% 0.176 304.987)","purple-950":"oklch(29.1% 0.149 302.717)","pink-50":"oklch(97.1% 0.014 343.198)","pink-100":"oklch(94.8% 0.028 342.258)","pink-200":"oklch(89.9% 0.061 343.231)","pink-300":"oklch(82.3% 0.116 346.018)","pink-400":"oklch(71.8% 0.202 349.761)","pink-500":"oklch(65.6% 0.241 354.308)","pink-600":"oklch(59.2% 0.249 0.584)","pink-700":"oklch(52.5% 0.223 3.958)","pink-800":"oklch(45.9% 0.187 3.815)","pink-900":"oklch(40.8% 0.153 2.432)","pink-950":"oklch(28.4% 0.109 3.907)","indigo-50":"oklch(96.2% 0.018 272.314)","indigo-100":"oklch(93% 0.034 272.788)","indigo-200":"oklch(87% 0.065 274.039)","indigo-300":"oklch(78.5% 0.115 274.713)","indigo-400":"oklch(67.3% 0.182 276.935)","indigo-500":"oklch(58.5% 0.233 277.117)","indigo-600":"oklch(51.1% 0.262 276.966)","indigo-700":"oklch(45.7% 0.24 277.023)","indigo-800":"oklch(39.8% 0.195 277.366)","indigo-900":"oklch(35.9% 0.144 278.697)","indigo-950":"oklch(26.9% 0.096 280.79)","cyan-50":"oklch(98.4% 0.019 200.873)","cyan-100":"oklch(95.6% 0.045 203.388)","cyan-200":"oklch(91.7% 0.08 205.041)","cyan-300":"oklch(86.5% 0.127 207.078)","cyan-400":"oklch(78.9% 0.154 211.53)","cyan-500":"oklch(71.5% 0.143 215.221)","cyan-600":"oklch(60.9% 0.126 221.723)","cyan-700":"oklch(52% 0.105 223.128)","cyan-800":"oklch(45% 0.085 224.283)","cyan-900":"oklch(39.8% 0.07 227.392)","cyan-950":"oklch(30.2% 0.056 229.695)","emerald-50":"oklch(97.9% 0.021 166.113)","emerald-100":"oklch(95% 0.052 163.051)","emerald-200":"oklch(90.5% 0.093 164.15)","emerald-300":"oklch(84.5% 0.143 164.978)","emerald-400":"oklch(76.5% 0.177 163.223)","emerald-500":"oklch(69.6% 0.17 162.48)","emerald-600":"oklch(59.6% 0.145 163.225)","emerald-700":"oklch(50.8% 0.118 165.612)","emerald-800":"oklch(43.2% 0.095 166.913)","emerald-900":"oklch(37.8% 0.077 168.94)","emerald-950":"oklch(26.2% 0.051 172.552)",white:"#fff",black:"#000",transparent:"transparent",current:"currentColor"},vl={"font-thin":{"font-weight":"100"},"font-extralight":{"font-weight":"200"},"font-light":{"font-weight":"300"},"font-normal":{"font-weight":"400"},"font-medium":{"font-weight":"500"},"font-semibold":{"font-weight":"600"},"font-bold":{"font-weight":"700"},"font-extrabold":{"font-weight":"800"},"font-black":{"font-weight":"900"}},xl={italic:{"font-style":"italic"},"not-italic":{"font-style":"normal"}},kl={uppercase:{"text-transform":"uppercase"},lowercase:{"text-transform":"lowercase"},capitalize:{"text-transform":"capitalize"},"normal-case":{"text-transform":"none"}},Cl={underline:{"text-decoration-line":"underline"},overline:{"text-decoration-line":"overline"},"line-through":{"text-decoration-line":"line-through"},"no-underline":{"text-decoration-line":"none"}},El={"decoration-solid":{"text-decoration-style":"solid"},"decoration-double":{"text-decoration-style":"double"},"decoration-dotted":{"text-decoration-style":"dotted"},"decoration-dashed":{"text-decoration-style":"dashed"},"decoration-wavy":{"text-decoration-style":"wavy"}},Al={"text-left":{"text-align":"left"},"text-center":{"text-align":"center"},"text-right":{"text-align":"right"},"text-justify":{"text-align":"justify"},"text-start":{"text-align":"start"},"text-end":{"text-align":"end"}},Sl={truncate:{overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"},"text-ellipsis":{"text-overflow":"ellipsis"},"text-clip":{"text-overflow":"clip"}},Nl={"text-wrap":{"text-wrap":"wrap"},"text-nowrap":{"text-wrap":"nowrap"},"text-balance":{"text-wrap":"balance"},"text-pretty":{"text-wrap":"pretty"}},jl={"whitespace-normal":{"white-space":"normal"},"whitespace-nowrap":{"white-space":"nowrap"},"whitespace-pre":{"white-space":"pre"},"whitespace-pre-line":{"white-space":"pre-line"},"whitespace-pre-wrap":{"white-space":"pre-wrap"},"whitespace-break-spaces":{"white-space":"break-spaces"}},zl={"break-normal":{"overflow-wrap":"normal","word-break":"normal"},"break-words":{"overflow-wrap":"break-word"},"break-all":{"word-break":"break-all"},"break-keep":{"word-break":"keep-all"}},Tl={"align-baseline":{"vertical-align":"baseline"},"align-top":{"vertical-align":"top"},"align-middle":{"vertical-align":"middle"},"align-bottom":{"vertical-align":"bottom"},"align-text-top":{"vertical-align":"text-top"},"align-text-bottom":{"vertical-align":"text-bottom"},"align-sub":{"vertical-align":"sub"},"align-super":{"vertical-align":"super"}},Fl={"list-none":{"list-style-type":"none"},"list-disc":{"list-style-type":"disc"},"list-decimal":{"list-style-type":"decimal"},"list-inside":{"list-style-position":"inside"},"list-outside":{"list-style-position":"outside"}},Ol={"hyphens-none":{hyphens:"none"},"hyphens-manual":{hyphens:"manual"},"hyphens-auto":{hyphens:"auto"}},Rl={static:{position:"static"},fixed:{position:"fixed"},absolute:{position:"absolute"},relative:{position:"relative"},sticky:{position:"sticky"}},Bl={visible:{visibility:"visible"},invisible:{visibility:"hidden"},collapse:{visibility:"collapse"}},Yl={"float-left":{float:"left"},"float-right":{float:"right"},"float-none":{float:"none"},"float-start":{float:"inline-start"},"float-end":{float:"inline-end"}},Pl={"clear-left":{clear:"left"},"clear-right":{clear:"right"},"clear-both":{clear:"both"},"clear-none":{clear:"none"},"clear-start":{clear:"inline-start"},"clear-end":{clear:"inline-end"}},Dl={isolate:{isolation:"isolate"},"isolation-auto":{isolation:"auto"}},Ll={"object-contain":{"object-fit":"contain"},"object-cover":{"object-fit":"cover"},"object-fill":{"object-fit":"fill"},"object-none":{"object-fit":"none"},"object-scale-down":{"object-fit":"scale-down"}},Wl={"object-bottom":{"object-position":"bottom"},"object-center":{"object-position":"center"},"object-left":{"object-position":"left"},"object-left-bottom":{"object-position":"left bottom"},"object-left-top":{"object-position":"left top"},"object-right":{"object-position":"right"},"object-right-bottom":{"object-position":"right bottom"},"object-right-top":{"object-position":"right top"},"object-top":{"object-position":"top"}},Ml={"overflow-auto":{overflow:"auto"},"overflow-hidden":{overflow:"hidden"},"overflow-clip":{overflow:"clip"},"overflow-visible":{overflow:"visible"},"overflow-scroll":{overflow:"scroll"},"overflow-x-auto":{"overflow-x":"auto"},"overflow-x-hidden":{"overflow-x":"hidden"},"overflow-x-clip":{"overflow-x":"clip"},"overflow-x-visible":{"overflow-x":"visible"},"overflow-x-scroll":{"overflow-x":"scroll"},"overflow-y-auto":{"overflow-y":"auto"},"overflow-y-hidden":{"overflow-y":"hidden"},"overflow-y-clip":{"overflow-y":"clip"},"overflow-y-visible":{"overflow-y":"visible"},"overflow-y-scroll":{"overflow-y":"scroll"}},ql={"overscroll-auto":{"overscroll-behavior":"auto"},"overscroll-contain":{"overscroll-behavior":"contain"},"overscroll-none":{"overscroll-behavior":"none"},"overscroll-x-auto":{"overscroll-behavior-x":"auto"},"overscroll-x-contain":{"overscroll-behavior-x":"contain"},"overscroll-x-none":{"overscroll-behavior-x":"none"},"overscroll-y-auto":{"overscroll-behavior-y":"auto"},"overscroll-y-contain":{"overscroll-behavior-y":"contain"},"overscroll-y-none":{"overscroll-behavior-y":"none"}},Il={"z-0":{"z-index":"0"},"z-10":{"z-index":"10"},"z-20":{"z-index":"20"},"z-30":{"z-index":"30"},"z-40":{"z-index":"40"},"z-50":{"z-index":"50"},"z-auto":{"z-index":"auto"}},Zl={"aspect-auto":{"aspect-ratio":"auto"},"aspect-square":{"aspect-ratio":"1 / 1"},"aspect-video":{"aspect-ratio":"16 / 9"}},Ul={"box-border":{"box-sizing":"border-box"},"box-content":{"box-sizing":"content-box"}},Ql={"box-decoration-clone":{"box-decoration-break":"clone"},"box-decoration-slice":{"box-decoration-break":"slice"}},Hl={"bg-fixed":{"background-attachment":"fixed"},"bg-local":{"background-attachment":"local"},"bg-scroll":{"background-attachment":"scroll"}},Xl={"bg-clip-border":{"background-clip":"border-box"},"bg-clip-padding":{"background-clip":"padding-box"},"bg-clip-content":{"background-clip":"content-box"},"bg-clip-text":{"background-clip":"text","-webkit-background-clip":"text"}},Kl={"bg-origin-border":{"background-origin":"border-box"},"bg-origin-padding":{"background-origin":"padding-box"},"bg-origin-content":{"background-origin":"content-box"}},Vl={"bg-bottom":{"background-position":"bottom"},"bg-center":{"background-position":"center"},"bg-left":{"background-position":"left"},"bg-left-bottom":{"background-position":"left bottom"},"bg-left-top":{"background-position":"left top"},"bg-right":{"background-position":"right"},"bg-right-bottom":{"background-position":"right bottom"},"bg-right-top":{"background-position":"right top"},"bg-top":{"background-position":"top"}},Gl={"bg-repeat":{"background-repeat":"repeat"},"bg-no-repeat":{"background-repeat":"no-repeat"},"bg-repeat-x":{"background-repeat":"repeat-x"},"bg-repeat-y":{"background-repeat":"repeat-y"},"bg-repeat-round":{"background-repeat":"round"},"bg-repeat-space":{"background-repeat":"space"}},_l={"bg-auto":{"background-size":"auto"},"bg-cover":{"background-size":"cover"},"bg-contain":{"background-size":"contain"}},Jl={"bg-none":{"background-image":"none"},"bg-gradient-to-t":{"background-image":"linear-gradient(to top, var(--hw-gradient-stops))"},"bg-gradient-to-tr":{"background-image":"linear-gradient(to top right, var(--hw-gradient-stops))"},"bg-gradient-to-r":{"background-image":"linear-gradient(to right, var(--hw-gradient-stops))"},"bg-gradient-to-br":{"background-image":"linear-gradient(to bottom right, var(--hw-gradient-stops))"},"bg-gradient-to-b":{"background-image":"linear-gradient(to bottom, var(--hw-gradient-stops))"},"bg-gradient-to-bl":{"background-image":"linear-gradient(to bottom left, var(--hw-gradient-stops))"},"bg-gradient-to-l":{"background-image":"linear-gradient(to left, var(--hw-gradient-stops))"},"bg-gradient-to-tl":{"background-image":"linear-gradient(to top left, var(--hw-gradient-stops))"},"bg-radial":{"background-image":"radial-gradient(var(--hw-gradient-stops))"},"bg-radial-at-t":{"background-image":"radial-gradient(at top, var(--hw-gradient-stops))"},"bg-radial-at-tr":{"background-image":"radial-gradient(at top right, var(--hw-gradient-stops))"},"bg-radial-at-r":{"background-image":"radial-gradient(at right, var(--hw-gradient-stops))"},"bg-radial-at-br":{"background-image":"radial-gradient(at bottom right, var(--hw-gradient-stops))"},"bg-radial-at-b":{"background-image":"radial-gradient(at bottom, var(--hw-gradient-stops))"},"bg-radial-at-bl":{"background-image":"radial-gradient(at bottom left, var(--hw-gradient-stops))"},"bg-radial-at-l":{"background-image":"radial-gradient(at left, var(--hw-gradient-stops))"},"bg-radial-at-tl":{"background-image":"radial-gradient(at top left, var(--hw-gradient-stops))"},"bg-radial-at-c":{"background-image":"radial-gradient(at center, var(--hw-gradient-stops))"},"bg-conic":{"background-image":"conic-gradient(var(--hw-gradient-stops))"},"bg-conic-from-t":{"background-image":"conic-gradient(from 0deg at center, var(--hw-gradient-stops))"},"bg-conic-from-tr":{"background-image":"conic-gradient(from 45deg at center, var(--hw-gradient-stops))"},"bg-conic-from-r":{"background-image":"conic-gradient(from 90deg at center, var(--hw-gradient-stops))"},"bg-conic-from-br":{"background-image":"conic-gradient(from 135deg at center, var(--hw-gradient-stops))"},"bg-conic-from-b":{"background-image":"conic-gradient(from 180deg at center, var(--hw-gradient-stops))"},"bg-conic-from-bl":{"background-image":"conic-gradient(from 225deg at center, var(--hw-gradient-stops))"},"bg-conic-from-l":{"background-image":"conic-gradient(from 270deg at center, var(--hw-gradient-stops))"},"bg-conic-from-tl":{"background-image":"conic-gradient(from 315deg at center, var(--hw-gradient-stops))"}},$l={"content-none":{content:"none"},"content-empty":{content:'""'}},ec={"scrollbar-auto":{"scrollbar-width":"auto"},"scrollbar-thin":{"scrollbar-width":"thin"},"scrollbar-none":{"scrollbar-width":"none"}},tc={"cursor-auto":{cursor:"auto"},"cursor-default":{cursor:"default"},"cursor-pointer":{cursor:"pointer"},"cursor-wait":{cursor:"wait"},"cursor-text":{cursor:"text"},"cursor-move":{cursor:"move"},"cursor-help":{cursor:"help"},"cursor-not-allowed":{cursor:"not-allowed"},"cursor-none":{cursor:"none"},"cursor-context-menu":{cursor:"context-menu"},"cursor-progress":{cursor:"progress"},"cursor-cell":{cursor:"cell"},"cursor-crosshair":{cursor:"crosshair"},"cursor-vertical-text":{cursor:"vertical-text"},"cursor-alias":{cursor:"alias"},"cursor-copy":{cursor:"copy"},"cursor-no-drop":{cursor:"no-drop"},"cursor-grab":{cursor:"grab"},"cursor-grabbing":{cursor:"grabbing"},"cursor-all-scroll":{cursor:"all-scroll"},"cursor-col-resize":{cursor:"col-resize"},"cursor-row-resize":{cursor:"row-resize"},"cursor-n-resize":{cursor:"n-resize"},"cursor-e-resize":{cursor:"e-resize"},"cursor-s-resize":{cursor:"s-resize"},"cursor-w-resize":{cursor:"w-resize"},"cursor-ne-resize":{cursor:"ne-resize"},"cursor-nw-resize":{cursor:"nw-resize"},"cursor-se-resize":{cursor:"se-resize"},"cursor-sw-resize":{cursor:"sw-resize"},"cursor-ew-resize":{cursor:"ew-resize"},"cursor-ns-resize":{cursor:"ns-resize"},"cursor-nesw-resize":{cursor:"nesw-resize"},"cursor-nwse-resize":{cursor:"nwse-resize"},"cursor-zoom-in":{cursor:"zoom-in"},"cursor-zoom-out":{cursor:"zoom-out"}},rc={"pointer-events-none":{"pointer-events":"none"},"pointer-events-auto":{"pointer-events":"auto"}},ic={"resize-none":{resize:"none"},"resize-y":{resize:"vertical"},"resize-x":{resize:"horizontal"},resize:{resize:"both"}},ac={"select-none":{"user-select":"none"},"select-text":{"user-select":"text"},"select-all":{"user-select":"all"},"select-auto":{"user-select":"auto"}},oc={"scroll-auto":{"scroll-behavior":"auto"},"scroll-smooth":{"scroll-behavior":"smooth"}},nc={"snap-none":{"scroll-snap-type":"none"},"snap-x":{"scroll-snap-type":"x var(--hw-scroll-snap-strictness)"},"snap-y":{"scroll-snap-type":"y var(--hw-scroll-snap-strictness)"},"snap-both":{"scroll-snap-type":"both var(--hw-scroll-snap-strictness)"},"snap-mandatory":{"--hw-scroll-snap-strictness":"mandatory"},"snap-proximity":{"--hw-scroll-snap-strictness":"proximity"},"snap-start":{"scroll-snap-align":"start"},"snap-end":{"scroll-snap-align":"end"},"snap-center":{"scroll-snap-align":"center"},"snap-align-none":{"scroll-snap-align":"none"},"snap-normal":{"scroll-snap-stop":"normal"},"snap-always":{"scroll-snap-stop":"always"}},sc={"touch-auto":{"touch-action":"auto"},"touch-none":{"touch-action":"none"},"touch-pan-x":{"touch-action":"pan-x"},"touch-pan-left":{"touch-action":"pan-left"},"touch-pan-right":{"touch-action":"pan-right"},"touch-pan-y":{"touch-action":"pan-y"},"touch-pan-up":{"touch-action":"pan-up"},"touch-pan-down":{"touch-action":"pan-down"},"touch-pinch-zoom":{"touch-action":"pinch-zoom"},"touch-manipulation":{"touch-action":"manipulation"}},lc={"will-change-auto":{"will-change":"auto"},"will-change-scroll":{"will-change":"scroll-position"},"will-change-contents":{"will-change":"contents"},"will-change-transform":{"will-change":"transform"}},cc={"appearance-none":{appearance:"none"},"appearance-auto":{appearance:"auto"}},uc={"border-collapse":{"border-collapse":"collapse"},"border-separate":{"border-collapse":"separate"}},fc={"table-auto":{"table-layout":"auto"},"table-fixed":{"table-layout":"fixed"}},dc={"caption-top":{"caption-side":"top"},"caption-bottom":{"caption-side":"bottom"}},hc={"sr-only":{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)","white-space":"nowrap","border-width":"0"},"not-sr-only":{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",clip:"auto","white-space":"normal"}},pc={"forced-color-adjust-auto":{"forced-color-adjust":"auto"},"forced-color-adjust-none":{"forced-color-adjust":"none"}},gc={"fill-none":{fill:"none"},"fill-current":{fill:"currentColor"},"fill-inherit":{fill:"inherit"}},mc={"stroke-none":{stroke:"none"},"stroke-current":{stroke:"currentColor"},"stroke-inherit":{stroke:"inherit"},"stroke-0":{"stroke-width":"0"},"stroke-1":{"stroke-width":"1"},"stroke-2":{"stroke-width":"2"}},yc={"stroke-linecap-butt":{"stroke-linecap":"butt"},"stroke-linecap-round":{"stroke-linecap":"round"},"stroke-linecap-square":{"stroke-linecap":"square"}},bc={"stroke-linejoin-miter":{"stroke-linejoin":"miter"},"stroke-linejoin-round":{"stroke-linejoin":"round"},"stroke-linejoin-bevel":{"stroke-linejoin":"bevel"}},wc={"blur-none":{filter:"blur(0)"},"blur-sm":{filter:"blur(4px)"},blur:{filter:"blur(8px)"},"blur-md":{filter:"blur(12px)"},"blur-lg":{filter:"blur(16px)"},"blur-xl":{filter:"blur(24px)"},"blur-2xl":{filter:"blur(40px)"},"blur-3xl":{filter:"blur(64px)"}},vc={"backdrop-blur-none":{"-webkit-backdrop-filter":"blur(0)","backdrop-filter":"blur(0)"},"backdrop-blur-sm":{"-webkit-backdrop-filter":"blur(4px)","backdrop-filter":"blur(4px)"},"backdrop-blur":{"-webkit-backdrop-filter":"blur(8px)","backdrop-filter":"blur(8px)"},"backdrop-blur-md":{"-webkit-backdrop-filter":"blur(12px)","backdrop-filter":"blur(12px)"},"backdrop-blur-lg":{"-webkit-backdrop-filter":"blur(16px)","backdrop-filter":"blur(16px)"},"backdrop-blur-xl":{"-webkit-backdrop-filter":"blur(24px)","backdrop-filter":"blur(24px)"},"backdrop-blur-2xl":{"-webkit-backdrop-filter":"blur(40px)","backdrop-filter":"blur(40px)"},"backdrop-blur-3xl":{"-webkit-backdrop-filter":"blur(64px)","backdrop-filter":"blur(64px)"}},xc={"grayscale-0":{filter:"grayscale(0)"},grayscale:{filter:"grayscale(100%)"},"invert-0":{filter:"invert(0)"},invert:{filter:"invert(100%)"},"sepia-0":{filter:"sepia(0)"},sepia:{filter:"sepia(100%)"}},kc={"backdrop-grayscale-0":{"-webkit-backdrop-filter":"grayscale(0)","backdrop-filter":"grayscale(0)"},"backdrop-grayscale":{"-webkit-backdrop-filter":"grayscale(100%)","backdrop-filter":"grayscale(100%)"},"backdrop-invert-0":{"-webkit-backdrop-filter":"invert(0)","backdrop-filter":"invert(0)"},"backdrop-invert":{"-webkit-backdrop-filter":"invert(100%)","backdrop-filter":"invert(100%)"},"backdrop-sepia-0":{"-webkit-backdrop-filter":"sepia(0)","backdrop-filter":"sepia(0)"},"backdrop-sepia":{"-webkit-backdrop-filter":"sepia(100%)","backdrop-filter":"sepia(100%)"}},Cc={"drop-shadow-sm":{filter:"drop-shadow(0 1px 1px rgb(0 0 0 / 0.05))"},"drop-shadow":{filter:"drop-shadow(0 1px 2px rgb(0 0 0 / 0.1)) drop-shadow(0 1px 1px rgb(0 0 0 / 0.06))"},"drop-shadow-md":{filter:"drop-shadow(0 4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.06))"},"drop-shadow-lg":{filter:"drop-shadow(0 10px 8px rgb(0 0 0 / 0.04)) drop-shadow(0 4px 3px rgb(0 0 0 / 0.1))"},"drop-shadow-xl":{filter:"drop-shadow(0 20px 13px rgb(0 0 0 / 0.03)) drop-shadow(0 8px 5px rgb(0 0 0 / 0.08))"},"drop-shadow-2xl":{filter:"drop-shadow(0 25px 25px rgb(0 0 0 / 0.15))"},"drop-shadow-none":{filter:"drop-shadow(0 0 #0000)"}},Ec={"mix-blend-normal":{"mix-blend-mode":"normal"},"mix-blend-multiply":{"mix-blend-mode":"multiply"},"mix-blend-screen":{"mix-blend-mode":"screen"},"mix-blend-overlay":{"mix-blend-mode":"overlay"},"mix-blend-darken":{"mix-blend-mode":"darken"},"mix-blend-lighten":{"mix-blend-mode":"lighten"},"mix-blend-color-dodge":{"mix-blend-mode":"color-dodge"},"mix-blend-color-burn":{"mix-blend-mode":"color-burn"},"mix-blend-hard-light":{"mix-blend-mode":"hard-light"},"mix-blend-soft-light":{"mix-blend-mode":"soft-light"},"mix-blend-difference":{"mix-blend-mode":"difference"},"mix-blend-exclusion":{"mix-blend-mode":"exclusion"},"mix-blend-hue":{"mix-blend-mode":"hue"},"mix-blend-saturation":{"mix-blend-mode":"saturation"},"mix-blend-color":{"mix-blend-mode":"color"},"mix-blend-luminosity":{"mix-blend-mode":"luminosity"},"mix-blend-plus-darker":{"mix-blend-mode":"plus-darker"},"mix-blend-plus-lighter":{"mix-blend-mode":"plus-lighter"}},Ac={"bg-blend-normal":{"background-blend-mode":"normal"},"bg-blend-multiply":{"background-blend-mode":"multiply"},"bg-blend-screen":{"background-blend-mode":"screen"},"bg-blend-overlay":{"background-blend-mode":"overlay"},"bg-blend-darken":{"background-blend-mode":"darken"},"bg-blend-lighten":{"background-blend-mode":"lighten"},"bg-blend-color-dodge":{"background-blend-mode":"color-dodge"},"bg-blend-color-burn":{"background-blend-mode":"color-burn"},"bg-blend-hard-light":{"background-blend-mode":"hard-light"},"bg-blend-soft-light":{"background-blend-mode":"soft-light"},"bg-blend-difference":{"background-blend-mode":"difference"},"bg-blend-exclusion":{"background-blend-mode":"exclusion"},"bg-blend-hue":{"background-blend-mode":"hue"},"bg-blend-saturation":{"background-blend-mode":"saturation"},"bg-blend-color":{"background-blend-mode":"color"},"bg-blend-luminosity":{"background-blend-mode":"luminosity"}},Sc={...Xs,...Ks,...Vs,...Gs,..._s,...rl,...il,...al,...ol,...nl,...pl,...gl,...ml,...yl,...bl,...wl,...vl,...xl,...kl,...Cl,...El,...Al,...Sl,...Nl,...jl,...zl,...Tl,...Fl,...Ol,...Rl,...Bl,...Yl,...Pl,...Dl,...Ll,...Wl,...Ml,...ql,...Il,...Zl,...Ul,...Ql,...Hl,...Xl,...Kl,...Vl,...Gl,..._l,...Jl,...tc,...rc,...ic,...ac,...oc,...nc,...sc,...lc,...cc,...uc,...fc,...dc,...hc,...pc,...gc,...mc,...yc,...bc,...wc,...vc,...xc,...kc,...Cc,...Ec,...Ac,...$l,...ec},Nc={hover:":hover",focus:":focus",active:":active",disabled:":disabled",visited:":visited",checked:":checked","focus-within":":focus-within","focus-visible":":focus-visible",first:":first-child",last:":last-child",odd:":nth-child(odd)",even:":nth-child(even)","first-of-type":":first-of-type","last-of-type":":last-of-type",before:"::before",after:"::after",marker:"::marker",placeholder:"::placeholder",selection:"::selection",file:"::file-selector-button",required:":required",valid:":valid",invalid:":invalid","read-only":":read-only",autofill:":autofill",open:"[open]",closed:":not([open])",empty:":empty",enabled:":enabled",only:":only-child",target:":target",indeterminate:":indeterminate",default:":default",optional:":optional"},jc={"not-first":":not(:first-child)","not-last":":not(:last-child)","not-only":":not(:only-child)","not-empty":":not(:empty)","not-disabled":":not(:disabled)","not-checked":":not(:checked)","not-first-of-type":":not(:first-of-type)","not-last-of-type":":not(:last-of-type)"},zc={dark:".dark ",light:".light ",rtl:'[dir="rtl"] ',ltr:'[dir="ltr"] '},jr=new WeakMap;function Tc(e){let t=jr.get(e);if(t)return t;if(e.presets&&e.presets.length>0){for(let s of e.presets)if(s.theme)e.theme=Xt(e.theme,s.theme)}let r=e.theme.extend?.colors?e.theme.extend.colors:null;if(e.theme.extend){let{extend:s,...l}=e.theme;if(s)e.theme=Xt(l,s)}let i=[],a=new Set;for(let s of e.blocklist)if(s.includes("*"))i.push(new RegExp(`^${s.replace(/\*/g,".*")}$`));else a.add(s);let o={config:e,variantEnabled:e.variants,screenBreakpoints:new Map(Object.entries(e.theme.screens)),blocklistRegexCache:i,blocklistExact:a,extendColors:r,hasBlocklist:i.length>0||a.size>0,hasShortcuts:Object.keys(e.shortcuts).length>0};return jr.set(e,o),o}class gt{config;rules=new Map;classCache=new Set;selectorCache=new Map;mediaQueryCache=new Map;ruleCache=new Map;variantEnabled;screenBreakpoints;noMatchCache=new Set;usedKeyframes=new Set;extendColors=null;processed;constructor(e){this.config=e,this.processed=Tc(e),this.variantEnabled=this.processed.variantEnabled,this.screenBreakpoints=this.processed.screenBreakpoints,this.extendColors=this.processed.extendColors}buildRuleLookup(){}generateBatch(e){for(let t=0;t<e.length;t++)this.generate(e[t])}generate(e){if(this.classCache.has(e))return;if(this.classCache.add(e),this.processed.hasShortcuts){let n=this.config.shortcuts[e];if(n){let c=Array.isArray(n)?n:n.split(/\s+/);for(let u of c)this.generate(u);return}}if(this.processed.hasBlocklist){if(this.processed.blocklistExact.has(e))return;let n=this.processed.blocklistRegexCache;for(let c=0;c<n.length;c++)if(n[c].test(e))return}let t=yi(e),r=Sc[t.raw];if(r){if(this.addRule(t,r),r.animation){let n=r.animation.split(" ")[0];if(n&&n!=="none")this.usedKeyframes.add(n)}return}let{utility:i,value:a}=t;if(i==="w"&&a){let n=Nr[a]||this.config.theme.spacing[a];if(n){this.addRule(t,{width:n});return}if(t.arbitrary){let c=a.match(/^(\d+)\/(\d+)$/);if(c){let u=Number(c[1]),f=Number(c[2]);if(!Number.isNaN(u)&&!Number.isNaN(f)&&f!==0){this.addRule(t,{width:`${u/f*100}%`});return}}this.addRule(t,{width:a});return}}if(i==="h"&&a){let n=Nr[a]||this.config.theme.spacing[a];if(n){this.addRule(t,{height:a==="screen"?"100vh":n});return}if(t.arbitrary){let c=a.match(/^(\d+)\/(\d+)$/);if(c){let u=Number(c[1]),f=Number(c[2]);if(!Number.isNaN(u)&&!Number.isNaN(f)&&f!==0){this.addRule(t,{height:`${u/f*100}%`});return}}this.addRule(t,{height:a});return}}if(i==="p"&&a){let n=W[a];if(n){this.addRule(t,{padding:n});return}}if(i==="px"&&a){let n=W[a];if(n){this.addRule(t,{"padding-left":n,"padding-right":n});return}}if(i==="py"&&a){let n=W[a];if(n){this.addRule(t,{"padding-top":n,"padding-bottom":n});return}}if((i==="pt"||i==="pr"||i==="pb"||i==="pl")&&a){let n=W[a];if(n){let c={pt:"padding-top",pr:"padding-right",pb:"padding-bottom",pl:"padding-left"};this.addRule(t,{[c[i]]:n});return}}if(i==="m"&&a){let n=W[a];if(n){this.addRule(t,{margin:n});return}}if(i==="mx"&&a){let n=W[a];if(n){this.addRule(t,{"margin-left":n,"margin-right":n});return}}if(i==="my"&&a){let n=W[a];if(n){this.addRule(t,{"margin-top":n,"margin-bottom":n});return}}if((i==="mt"||i==="mr"||i==="mb"||i==="ml")&&a){let n=W[a];if(n){let c={mt:"margin-top",mr:"margin-right",mb:"margin-bottom",ml:"margin-left"};this.addRule(t,{[c[i]]:n});return}}if((i==="top"||i==="right"||i==="bottom"||i==="left")&&a){let n=W[a];if(n){this.addRule(t,{[i]:n});return}}if(i==="inset"&&a){let n=W[a];if(n){this.addRule(t,{top:n,right:n,bottom:n,left:n});return}}if(i==="inset-x"&&a){let n=W[a];if(n){this.addRule(t,{left:n,right:n});return}}if(i==="inset-y"&&a){let n=W[a];if(n){this.addRule(t,{top:n,bottom:n});return}}if(i==="bg"&&a){let n=Et[a];if(n){this.addRule(t,{"background-color":n});return}}if(i==="text"&&a){let n=Et[a];if(n){this.addRule(t,{color:n});return}}if(i==="border"&&a){let n=Et[a];if(n){this.addRule(t,{"border-color":n});return}}if(i==="justify"&&a){let n=Js[a];if(n){this.addRule(t,{"justify-content":n});return}}if(i==="items"&&a){let n=$s[a];if(n){this.addRule(t,{"align-items":n});return}}if(i==="content"&&a){let n=el[a];if(n){this.addRule(t,{"align-content":n});return}if(t.arbitrary){this.addRule(t,{content:a});return}}if(i==="self"&&a){let n=tl[a];if(n){this.addRule(t,{"align-self":n});return}}if(i==="grid-cols"&&a){let n=cl[a];if(n){this.addRule(t,{"grid-template-columns":n});return}}if(i==="grid-rows"&&a){let n=ul[a];if(n){this.addRule(t,{"grid-template-rows":n});return}}if(i==="col"&&a){let n=fl[a];if(n){this.addRule(t,{"grid-column":n});return}}if(i==="row"&&a){let n=dl[a];if(n){this.addRule(t,{"grid-row":n});return}}if(i==="grid-flow"&&a){let n=hl[a];if(n){this.addRule(t,{"grid-auto-flow":n});return}}if(i==="auto-cols"&&a){let n=Sr[a];if(n){this.addRule(t,{"grid-auto-columns":n});return}}if(i==="auto-rows"&&a){let n=Sr[a];if(n){this.addRule(t,{"grid-auto-rows":n});return}}if(i==="origin"&&a){let n=ll[a];if(n){this.addRule(t,{"transform-origin":n});return}}if(i==="scale"&&a&&!t.arbitrary){let n=Number(a)/100;if(!Number.isNaN(n)){this.addRule(t,{transform:`scale(${n})`});return}}if(i==="scale-x"&&a&&!t.arbitrary){let n=Number(a)/100;if(!Number.isNaN(n)){this.addRule(t,{transform:`scaleX(${n})`});return}}if(i==="scale-y"&&a&&!t.arbitrary){let n=Number(a)/100;if(!Number.isNaN(n)){this.addRule(t,{transform:`scaleY(${n})`});return}}if(i==="rotate"&&a&&!t.arbitrary){this.addRule(t,{transform:`rotate(${a}deg)`});return}if(i==="duration"&&a){this.addRule(t,{"transition-duration":`${a}ms`});return}if(i==="delay"&&a){this.addRule(t,{"transition-delay":`${a}ms`});return}let o=(n)=>{let c=this.config.theme.spacing[n];if(c!==void 0)return c;if(/^\d+(?:\.\d+)?$/.test(n)){let u=Number.parseFloat(n);if(Number.isFinite(u))return`${u*0.25}rem`}return n};if(i==="gap"&&a){this.addRule(t,{gap:o(a)});return}if(i==="gap-x"&&a){this.addRule(t,{"column-gap":o(a)});return}if(i==="gap-y"&&a){this.addRule(t,{"row-gap":o(a)});return}if(i==="place"&&a){if(a.startsWith("content-")){let n=Ct[a.slice(8)];if(n){this.addRule(t,{"place-content":n});return}}if(a.startsWith("items-")){let n=Ct[a.slice(6)];if(n){this.addRule(t,{"place-items":n});return}}if(a.startsWith("self-")){let n=Ct[a.slice(5)];if(n){this.addRule(t,{"place-self":n});return}}}let s=`${t.utility}:${t.value||""}`;if(this.noMatchCache.has(s))return;if(this.config.rules.length>0)for(let[n,c]of this.config.rules){let u=e.match(n);if(u){let f=c(u);if(f){this.addRule(t,f);return}}}let l=Ht.length;for(let n=0;n<l;n++){let c=Ht[n](t,this.config);if(c){if("properties"in c&&typeof c.properties==="object")this.addRule(t,c.properties,c.childSelector,c.pseudoElement);else this.addRule(t,c);return}}this.noMatchCache.add(s)}addRule(e,t,r,i){let a=`${e.raw}${r||""}${i||""}`,o=this.selectorCache.get(a);if(!o){if(o=this.buildSelector(e),i)o+=i;if(r)o+=` ${r}`;this.selectorCache.set(a,o)}let s=this.getMediaQuery(e);if(e.important)for(let n in t)t[n]+=" !important";let l=s||"base";if(!this.rules.has(l))this.rules.set(l,[]);this.rules.get(l).push({selector:o,properties:t,mediaQuery:s,childSelector:r})}buildSelector(e){let t=`.${this.escapeSelector(e.raw)}`,r="",i=e.variants,a=i.length;if(a===0)return t;for(let o=0;o<a;o++){let s=i[o],l=Nc[s];if(l!==void 0){if(this.variantEnabled[s])t+=l;continue}let n=zc[s];if(n!==void 0){if(this.variantEnabled[s])r=n;continue}if(s.charCodeAt(0)===110&&s.startsWith("not-")){if(this.variantEnabled.not){let c=jc[s];if(c)t+=c}continue}if(s.charCodeAt(0)===103&&s.startsWith("group-")){if(this.variantEnabled.group){let c=s.slice(6);if(c.startsWith("has-")){let u=c.slice(4);if(u.charCodeAt(0)===91&&u.charCodeAt(u.length-1)===93)r=`.group:has(${u.slice(1,-1)}) `;else r=`.group:has(:${u}) `}else r=`.group:${c} `}continue}if(s.charCodeAt(0)===103&&s.startsWith("group/")){if(this.variantEnabled.group)r=`.group\\/${s.slice(6)} `;continue}if(s.charCodeAt(0)===112&&s.startsWith("peer-")){if(this.variantEnabled.peer){let c=s.slice(5);if(c.startsWith("has-")){let u=c.slice(4);if(u.charCodeAt(0)===91&&u.charCodeAt(u.length-1)===93)r=`.peer:has(${u.slice(1,-1)}) ~ `;else r=`.peer:has(:${u}) ~ `}else r=`.peer:${c} ~ `}continue}if(s.charCodeAt(0)===112&&s.startsWith("peer/")){if(this.variantEnabled.peer)r=`.peer\\/${s.slice(5)} ~ `;continue}if(s.charCodeAt(0)===104&&s.startsWith("has-")){if(this.variantEnabled.has){let c=s.slice(4);if(c.charCodeAt(0)===91&&c.charCodeAt(c.length-1)===93){let u=c.slice(1,-1);t+=`:has(${u})`}else t+=`:has(:${c})`}continue}if(s.charCodeAt(0)===97&&s.startsWith("aria-")){if(this.variantEnabled.aria){let c=s.slice(5);if(c.charCodeAt(0)===91&&c.charCodeAt(c.length-1)===93){let u=c.slice(1,-1);t+=`[aria-${u}]`}else t+=`[aria-${c}="true"]`}continue}if(s.charCodeAt(0)===100&&s.startsWith("data-")){if(this.variantEnabled.data){let c=s.slice(5);if(c.charCodeAt(0)===91&&c.charCodeAt(c.length-1)===93){let u=c.slice(1,-1);t+=`[data-${u}]`}else t+=`[data-${c}]`}continue}}return r+t}getMediaQuery(e){let t=e.variants,r=t.length;if(r===0)return;let i=t.join(":"),a=this.mediaQueryCache.get(i);if(a!==void 0)return a||void 0;let o=[];for(let s=0;s<r;s++){let l=t[s];if(l.charCodeAt(0)===64){let n=l.slice(1),c=this.screenBreakpoints.get(n);if(c){let u=`@container (min-width: ${c})`;return this.mediaQueryCache.set(i,u),u}continue}if(this.variantEnabled.responsive){let n=this.screenBreakpoints.get(l);if(n){o.push(`(min-width: ${n})`);continue}}switch(l){case"print":if(this.variantEnabled.print)o.push("print");break;case"motion-safe":if(this.variantEnabled["motion-safe"])o.push("(prefers-reduced-motion: no-preference)");break;case"motion-reduce":if(this.variantEnabled["motion-reduce"])o.push("(prefers-reduced-motion: reduce)");break;case"contrast-more":if(this.variantEnabled["contrast-more"])o.push("(prefers-contrast: more)");break;case"contrast-less":if(this.variantEnabled["contrast-less"])o.push("(prefers-contrast: less)");break;case"landscape":if(this.variantEnabled.landscape)o.push("(orientation: landscape)");break;case"portrait":if(this.variantEnabled.portrait)o.push("(orientation: portrait)");break;case"forced-colors":if(this.variantEnabled["forced-colors"])o.push("(forced-colors: active)");break}if(l.charCodeAt(0)===115&&l.startsWith("supports-")){if(this.variantEnabled.supports){let n=l.slice(9),c;if(n.charCodeAt(0)===91&&n.charCodeAt(n.length-1)===93){let u=n.slice(1,-1).replace(/_/g," "),f=u.indexOf(":");if(f!==-1){let d=u.slice(0,f).trim(),h=u.slice(f+1).trim();c=`@supports (${d}: ${h})`}else c=`@supports (${u})`}else c=`@supports (${n})`;return this.mediaQueryCache.set(i,c),c}}}if(o.length>0){let s=`@media ${o.join(" and ")}`;return this.mediaQueryCache.set(i,s),s}this.mediaQueryCache.set(i,"");return}escapeSelector(e){let t=!1;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(i===58||i===46||i===47||i===64||i===32||i===91||i===93||i===40||i===41||i===37||i===35||i===44||i===62||i===43||i===126||i===33||i===39||i===34||i===42||i===61){t=!0;break}}if(!t)return e;return e.replace(/[:./@ \[\]()%#,>+~!'"*=]/g,"\\$&")}buildFontCSS(){let e=this.config.fonts;if(!e)return"";let t=[],r=e.google?.filter(Boolean)??[];if(r.length>0){let i=r.map((o)=>`family=${o.trim().replace(/\s+/g,"+")}`).join("&"),a=e.display??"swap";t.push(`@import url('https://fonts.googleapis.com/css2?${i}&display=${a}');`)}if(e.faces?.length)t.push(...e.faces.map((i)=>i.trim()).filter(Boolean));return t.join(`
14
+ `)}toCSS(e=!0,t=!1){let r=[],i=this.buildFontCSS();if(i)r.push(t?i.replace(/\s*\n\s*/g,""):i);if(e)for(let o of this.config.preflights){let s=o.getCSS(),l=this.config.theme?.fontFamily?.sans;if(l&&Array.isArray(l)){let n=l.join(", ");s=s.replace(/font-family:\s*ui-sans-serif[^;]+;/g,`font-family: ${n};`)}r.push(t?s.replace(/\s+/g," ").trim():s)}if(this.config.cssVariables){let o=this.generateCSSVariables();if(o)r.push(t?o.replace(/\s+/g," ").trim():o)}let a=this.rules.get("base")||[];if(a.length>0)r.push(this.rulesToCSS(a,t));if(this.usedKeyframes.size>0)for(let o of this.usedKeyframes){let s=sl[o];if(s)r.push(t?s.replace(/\s+/g," ").replace(/\s*\{\s*/g,"{").replace(/\s*\}\s*/g,"}").replace(/;\s*/g,";").trim():s)}for(let[o,s]of this.rules.entries())if(o!=="base"&&s.length>0){let l=s[0].mediaQuery,n=this.rulesToCSS(s,t);r.push(t?`${l}{${n}}`:`${l} {
15
+ ${n}
16
+ }`)}return t?r.join(""):r.join(`
17
+
18
+ `)}getUtilityRank(e){let t=e.match(/\.(?:[a-zA-Z0-9_-]*\\?:)*([a-zA-Z0-9_-]+)/);if(!t)return 0;let r=t[1];if(/^(?:mx|my|px|py|inset-x|inset-y|border-x|border-y|scroll-mx|scroll-my|scroll-px|scroll-py|space-x|space-y)-/.test(r)||/^rounded-(?:[tlbr]|tl|tr|bl|br)(?:-|$)/.test(r))return 1;if(/^(?:mt|mr|mb|ml|pt|pr|pb|pl|top|right|bottom|left|border-t|border-r|border-b|border-l|scroll-mt|scroll-mr|scroll-mb|scroll-ml|scroll-pt|scroll-pr|scroll-pb|scroll-pl)-/.test(r))return 2;return 0}rulesToCSS(e,t){let r=e.map((s,l)=>({r:s,i:l,rank:this.getUtilityRank(s.selector)}));r.sort((s,l)=>s.rank-l.rank||s.i-l.i);let i=r.map((s)=>s.r),a=this.groupRulesBySelector(i),o=[];for(let[s,l]of a.entries()){let n=Array.from(l.entries()).map(([c,u])=>t?`${c}:${u}`:` ${c}: ${u};`).join(t?";":`
19
+ `);if(t)o.push(`${s}{${n}}`);else o.push(`${s} {
20
+ ${n}
21
+ }`)}return t?o.join(""):o.join(`
22
+
23
+ `)}groupRulesBySelector(e){let t=new Map;for(let r of e){if(!t.has(r.selector))t.set(r.selector,new Map);let i=t.get(r.selector);for(let[a,o]of Object.entries(r.properties))i.set(a,o)}return t}generateCSSVariables(){let e=this.extendColors||this.config.theme.colors;if(!e||Object.keys(e).length===0)return null;let t=[];for(let[r,i]of Object.entries(e))if(typeof i==="string")t.push(` --${r}: ${i};`);else if(typeof i==="object"&&i!==null){for(let[a,o]of Object.entries(i))if(typeof o==="string")t.push(a==="DEFAULT"?` --${r}: ${o};`:` --${r}-${a}: ${o};`)}if(t.length===0)return null;return`:root {
24
+ ${t.join(`
25
+ `)}
26
+ }`}reset(){this.rules.clear(),this.classCache.clear(),this.selectorCache.clear(),this.mediaQueryCache.clear(),this.noMatchCache.clear(),this.usedKeyframes.clear()}}var{Glob:Fc}=globalThis.Bun;class nr{patterns;transformer;extractOptions;constructor(e,t=void 0,r=void 0){this.patterns=e,this.transformer=t,this.extractOptions=r}async scan(){let e=new Set,t=new Map;return await Promise.all(this.patterns.map(async(r)=>{let i=new Fc(r);for await(let a of i.scan("."))try{let o=await Bun.file(a).text();if(this.transformer){let l=this.transformer.processFile(o);if(l.hasChanges)t.set(a,l.content),o=l.content}let s=Se(o,this.extractOptions);for(let l of s)e.add(l)}catch{continue}})),{classes:e,transformedFiles:t}}async scanFile(e){try{let t=await Bun.file(e).text();return Se(t,this.extractOptions)}catch{return new Set}}scanContent(e){return Se(e,this.extractOptions)}}function Oc(e){let t=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);t=(t<<5)-t+i,t=t&t}return Math.abs(t).toString(36)}function Rc(e,t={}){let r=t.trigger||":hw:",i=new Map,a=/(?:class|className)=["']([^"']*)["']/g,o;while((o=a.exec(e))!==null){let s=o[1];if(s.trim().startsWith(r)){let l=s.replace(r,"").trim().split(/\s+/).filter(Boolean);if(l.length>0){let n=l.sort().join(" ");if(!i.has(n))i.set(n,l)}}}return i}function Bc(e,t,r={}){let i=r.trigger||":hw:",a=e,o=/(?:class|className)=["']([^"']*)["']/g,s,l=[];while((s=o.exec(e))!==null){let n=s[1];if(n.trim().startsWith(i)){let c=n.replace(i,"").trim().split(/\s+/).filter(Boolean).sort().join(" "),u=t.get(c);if(u){let f=s[0].startsWith("class=")?"class":"className",d=s[0].includes('"')?'"':"'",h=`${f}=${d}${u}${d}`;l.push({start:s.index,end:s.index+s[0].length,replacement:h})}}}for(let n=l.length-1;n>=0;n--){let{start:c,end:u,replacement:f}=l[n];a=a.substring(0,c)+f+a.substring(u)}return a}function Yc(e,t={}){let r=t.classPrefix||"hw-",i=t.hashFn||Oc,a=new Map;for(let[o]of e){let s=i(o),l=`${r}${s}`;a.set(o,l)}return a}class Qi{compiledClasses=new Map;classNameMap=new Map;options;constructor(e={}){this.options={trigger:":hw:",classPrefix:"hw-",layer:"shortcuts",...e}}processFile(e){let t=Rc(e,this.options);if(t.size===0)return{content:e,hasChanges:!1};let r=!1;for(let[a,o]of t)if(!this.compiledClasses.has(a))this.compiledClasses.set(a,o),r=!0;if(r||this.classNameMap.size!==this.compiledClasses.size)this.classNameMap=Yc(this.compiledClasses,this.options);let i=Bc(e,this.classNameMap,this.options);return{content:i,hasChanges:i!==e}}getCompiledClasses(){let e=new Map;for(let[t,r]of this.compiledClasses){let i=this.classNameMap.get(t);if(i)e.set(t,{className:i,utilities:r})}return e}generateCSS(e,t){let r=this.getCompiledClasses(),i="";for(let[,{className:a,utilities:o}]of r){for(let l of o)t.generate(l);let s=t.toCSS(!1);i+=`
27
+ /* Compiled class: ${a} */
28
+ `,i+=`/* Original utilities: ${o.join(" ")} */
29
+ `}return i}reset(){this.compiledClasses.clear(),this.classNameMap.clear()}getStats(){let e=0;for(let[,t]of this.compiledClasses)e+=t.length;return{totalGroups:this.compiledClasses.size,totalUtilities:e,averageUtilitiesPerGroup:this.compiledClasses.size>0?e/this.compiledClasses.size:0}}}async function Hi(e){let t=performance.now(),r=e.compileClass?.enabled?new Qi({trigger:e.compileClass.trigger,classPrefix:e.compileClass.classPrefix,layer:e.compileClass.layer}):null,i=new nr(e.content,r,{attributify:e.attributify,bracketSyntax:e.bracketSyntax}),{classes:a,transformedFiles:o}=await i.scan();for(let c of e.safelist)a.add(c);if(r){let c=r.getCompiledClasses();for(let[,{utilities:u}]of c)for(let f of u)a.add(f)}let s=new gt(e);for(let c of a)s.generate(c);let l=s.toCSS(!0,e.minify),n=performance.now()-t;return{css:l,classes:a,duration:n,compiledClasses:r?.getCompiledClasses(),transformedFiles:o}}async function Xi(e,t){await Bun.write(t,e)}async function Ki(e){let t=Array.from(e.entries()).map(([r,i])=>Bun.write(r,i));await Promise.all(t)}async function Pc(e){let t=await Hi(e);if(await Xi(t.css,e.output),t.transformedFiles&&t.transformedFiles.size>0)await Ki(t.transformedFiles);return t}var Dc={getCSS:()=>`
30
+ /*
31
+ ! Modern Normalize v3.0.1 | MIT License | https://github.com/sindresorhus/modern-normalize
32
+ */
33
+
34
+ *,
35
+ ::before,
36
+ ::after {
37
+ box-sizing: border-box;
38
+ }
39
+
40
+ html {
41
+ -webkit-text-size-adjust: 100%;
42
+ tab-size: 4;
43
+ }
44
+
45
+ body {
46
+ margin: 0;
47
+ font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
48
+ }
49
+
50
+ hr {
51
+ height: 0;
52
+ color: inherit;
53
+ }
54
+
55
+ abbr[title] {
56
+ text-decoration: underline dotted;
57
+ }
58
+
59
+ b,
60
+ strong {
61
+ font-weight: bolder;
62
+ }
63
+
64
+ code,
65
+ kbd,
66
+ samp,
67
+ pre {
68
+ font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
69
+ font-size: 1em;
70
+ }
71
+
72
+ small {
73
+ font-size: 80%;
74
+ }
75
+
76
+ sub,
77
+ sup {
78
+ font-size: 75%;
79
+ line-height: 0;
80
+ position: relative;
81
+ vertical-align: baseline;
82
+ }
83
+
84
+ sub {
85
+ bottom: -0.25em;
86
+ }
87
+
88
+ sup {
89
+ top: -0.5em;
90
+ }
91
+
92
+ table {
93
+ text-indent: 0;
94
+ border-color: inherit;
95
+ }
96
+
97
+ button,
98
+ input,
99
+ optgroup,
100
+ select,
101
+ textarea {
102
+ font-family: inherit;
103
+ font-size: 100%;
104
+ line-height: 1.15;
105
+ margin: 0;
106
+ }
107
+
108
+ button,
109
+ select {
110
+ text-transform: none;
111
+ }
112
+
113
+ button,
114
+ [type='button'],
115
+ [type='reset'],
116
+ [type='submit'] {
117
+ -webkit-appearance: button;
118
+ }
119
+
120
+ ::-moz-focus-inner {
121
+ border-style: none;
122
+ padding: 0;
123
+ }
124
+
125
+ :-moz-focusring {
126
+ outline: 1px dotted ButtonText;
127
+ }
128
+
129
+ :-moz-ui-invalid {
130
+ box-shadow: none;
131
+ }
132
+
133
+ legend {
134
+ padding: 0;
135
+ }
136
+
137
+ progress {
138
+ vertical-align: baseline;
139
+ }
140
+
141
+ ::-webkit-inner-spin-button,
142
+ ::-webkit-outer-spin-button {
143
+ height: auto;
144
+ }
145
+
146
+ [type='search'] {
147
+ -webkit-appearance: textfield;
148
+ outline-offset: -2px;
149
+ }
150
+
151
+ ::-webkit-search-decoration {
152
+ -webkit-appearance: none;
153
+ }
154
+
155
+ ::-webkit-file-upload-button {
156
+ -webkit-appearance: button;
157
+ font: inherit;
158
+ }
159
+
160
+ summary {
161
+ display: list-item;
162
+ }
163
+ `.trim()},Vi={getCSS:()=>`
164
+ /*
165
+ ! Tailwind CSS Preflight | MIT License | https://tailwindcss.com
166
+ */
167
+
168
+ *,
169
+ ::before,
170
+ ::after {
171
+ box-sizing: border-box;
172
+ border-width: 0;
173
+ border-style: solid;
174
+ border-color: var(--border-color, currentColor);
175
+ }
176
+
177
+ ::before,
178
+ ::after {
179
+ --hw-content: '';
180
+ }
181
+
182
+ html,
183
+ :host {
184
+ line-height: 1.5;
185
+ -webkit-text-size-adjust: 100%;
186
+ -moz-tab-size: 4;
187
+ tab-size: 4;
188
+ font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
189
+ font-feature-settings: normal;
190
+ font-variation-settings: normal;
191
+ -webkit-tap-highlight-color: transparent;
192
+ }
193
+
194
+ body {
195
+ margin: 0;
196
+ line-height: inherit;
197
+ }
198
+
199
+ hr {
200
+ height: 0;
201
+ color: inherit;
202
+ border-top-width: 1px;
203
+ }
204
+
205
+ abbr:where([title]) {
206
+ text-decoration: underline dotted;
207
+ }
208
+
209
+ h1,
210
+ h2,
211
+ h3,
212
+ h4,
213
+ h5,
214
+ h6 {
215
+ font-size: inherit;
216
+ font-weight: inherit;
217
+ }
218
+
219
+ a {
220
+ color: inherit;
221
+ text-decoration: inherit;
222
+ }
223
+
224
+ b,
225
+ strong {
226
+ font-weight: bolder;
227
+ }
228
+
229
+ code,
230
+ kbd,
231
+ samp,
232
+ pre {
233
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
234
+ font-feature-settings: normal;
235
+ font-variation-settings: normal;
236
+ font-size: 1em;
237
+ }
238
+
239
+ small {
240
+ font-size: 80%;
241
+ }
242
+
243
+ sub,
244
+ sup {
245
+ font-size: 75%;
246
+ line-height: 0;
247
+ position: relative;
248
+ vertical-align: baseline;
249
+ }
250
+
251
+ sub {
252
+ bottom: -0.25em;
253
+ }
254
+
255
+ sup {
256
+ top: -0.5em;
257
+ }
258
+
259
+ table {
260
+ text-indent: 0;
261
+ border-color: var(--border-color, inherit);
262
+ border-collapse: collapse;
263
+ }
264
+
265
+ button,
266
+ input,
267
+ optgroup,
268
+ select,
269
+ textarea {
270
+ font-family: inherit;
271
+ font-feature-settings: inherit;
272
+ font-variation-settings: inherit;
273
+ font-size: 100%;
274
+ font-weight: inherit;
275
+ line-height: inherit;
276
+ letter-spacing: inherit;
277
+ color: inherit;
278
+ margin: 0;
279
+ padding: 0;
280
+ }
281
+
282
+ button,
283
+ select {
284
+ text-transform: none;
285
+ }
286
+
287
+ button,
288
+ input:where([type='button']),
289
+ input:where([type='reset']),
290
+ input:where([type='submit']) {
291
+ -webkit-appearance: button;
292
+ background-color: transparent;
293
+ background-image: none;
294
+ }
295
+
296
+ :-moz-focusring {
297
+ outline: auto;
298
+ }
299
+
300
+ :-moz-ui-invalid {
301
+ box-shadow: none;
302
+ }
303
+
304
+ progress {
305
+ vertical-align: baseline;
306
+ }
307
+
308
+ ::-webkit-inner-spin-button,
309
+ ::-webkit-outer-spin-button {
310
+ height: auto;
311
+ }
312
+
313
+ [type='search'] {
314
+ -webkit-appearance: textfield;
315
+ outline-offset: -2px;
316
+ }
317
+
318
+ ::-webkit-search-decoration {
319
+ -webkit-appearance: none;
320
+ }
321
+
322
+ ::-webkit-file-upload-button {
323
+ -webkit-appearance: button;
324
+ font: inherit;
325
+ }
326
+
327
+ summary {
328
+ display: list-item;
329
+ }
330
+
331
+ blockquote,
332
+ dl,
333
+ dd,
334
+ h1,
335
+ h2,
336
+ h3,
337
+ h4,
338
+ h5,
339
+ h6,
340
+ hr,
341
+ figure,
342
+ p,
343
+ pre {
344
+ margin: 0;
345
+ }
346
+
347
+ fieldset {
348
+ margin: 0;
349
+ padding: 0;
350
+ }
351
+
352
+ legend {
353
+ padding: 0;
354
+ }
355
+
356
+ ol,
357
+ ul,
358
+ menu {
359
+ list-style: none;
360
+ margin: 0;
361
+ padding: 0;
362
+ }
363
+
364
+ dialog {
365
+ padding: 0;
366
+ }
367
+
368
+ textarea {
369
+ resize: vertical;
370
+ }
371
+
372
+ input::placeholder,
373
+ textarea::placeholder {
374
+ opacity: 1;
375
+ color: #9ca3af;
376
+ }
377
+
378
+ button,
379
+ [role="button"] {
380
+ cursor: pointer;
381
+ }
382
+
383
+ :disabled {
384
+ cursor: default;
385
+ }
386
+
387
+ img,
388
+ svg,
389
+ video,
390
+ canvas,
391
+ audio,
392
+ iframe,
393
+ embed,
394
+ object {
395
+ display: block;
396
+ vertical-align: middle;
397
+ }
398
+
399
+ img,
400
+ video {
401
+ max-width: 100%;
402
+ height: auto;
403
+ }
404
+
405
+ [hidden] {
406
+ display: none;
407
+ }
408
+ `.trim()};class Ji{cache=new Map;totalHits=0;totalMisses=0;options;constructor(e={}){this.options={enabled:!0,ttl:300000,maxSize:100,keyPrefix:"bunfig:",...e}}generateKey(e,t){let r=t?`:${t}`:"";return`${this.options.keyPrefix}${e}${r}`}isExpired(e){return Date.now()-e.timestamp.getTime()>e.ttl}estimateSize(e){try{return JSON.stringify(e).length}catch{return 1000}}evictIfNeeded(){if(this.cache.size<=this.options.maxSize)return;let e=Array.from(this.cache.entries()).sort(([,r],[,i])=>r.timestamp.getTime()-i.timestamp.getTime()),t=e.length-this.options.maxSize+1;for(let r=0;r<t;r++)this.cache.delete(e[r][0])}set(e,t,r,i){if(!this.options.enabled)return;let a=this.generateKey(e,r),o=i??this.options.ttl,s=this.estimateSize(t);this.cache.set(a,{value:t,timestamp:new Date,ttl:o,hits:0,size:s}),this.evictIfNeeded()}get(e,t){if(!this.options.enabled){this.totalMisses++;return}let r=this.generateKey(e,t),i=this.cache.get(r);if(!i){this.totalMisses++;return}if(this.isExpired(i)){this.cache.delete(r),this.totalMisses++;return}return i.hits++,this.totalHits++,i.value}isFileModified(e,t){try{if(!zr(e))return!0;return Tr(e).mtime>t}catch{return!0}}getWithFileCheck(e,t){let r=this.get(e,t);if(!r)return;if(this.isFileModified(t,r.fileTimestamp)){this.delete(e,t);return}return r.value}setWithFileCheck(e,t,r,i){try{let a=zr(r)?Tr(r):null,o=a?a.mtime:new Date;this.set(e,{value:t,fileTimestamp:o},r,i)}catch{this.set(e,t,r,i)}}delete(e,t){let r=this.generateKey(e,t);return this.cache.delete(r)}clear(){this.cache.clear(),this.totalHits=0,this.totalMisses=0}cleanup(){let e=0;for(let[t,r]of this.cache.entries())if(this.isExpired(r))this.cache.delete(t),e++;return e}getStats(){let e=Array.from(this.cache.values()),t=e.reduce((i,a)=>i+a.size,0),r=e.map((i)=>i.timestamp).sort();return{size:t,maxSize:this.options.maxSize,hitRate:this.totalHits+this.totalMisses>0?this.totalHits/(this.totalHits+this.totalMisses):0,totalHits:this.totalHits,totalMisses:this.totalMisses,entries:this.cache.size,oldestEntry:r[0],newestEntry:r[r.length-1]}}export(){let e={};for(let[t,r]of this.cache.entries())e[t]={value:r.value,timestamp:r.timestamp.toISOString(),ttl:r.ttl,hits:r.hits,size:r.size};return e}import(e){this.cache.clear();for(let[t,r]of Object.entries(e))if(typeof r==="object"&&r!==null){let i=r;this.cache.set(t,{value:i.value,timestamp:new Date(i.timestamp),ttl:i.ttl,hits:i.hits,size:i.size})}}}class $i{metrics=[];maxMetrics=1000;async track(e,t,r={}){let i=performance.now(),a=new Date;try{let o=await t(),s=performance.now()-i;return this.recordMetric({operation:e,duration:s,timestamp:a,...r}),o}catch(o){let s=performance.now()-i;throw this.recordMetric({operation:`${e}:error`,duration:s,timestamp:a,...r}),o}}recordMetric(e){if(this.metrics.push(e),this.metrics.length>this.maxMetrics)this.metrics=this.metrics.slice(-this.maxMetrics)}getStats(e){let t=e?this.metrics.filter((a)=>a.operation===e):this.metrics;if(t.length===0)return{count:0,averageDuration:0,minDuration:0,maxDuration:0,totalDuration:0,recentMetrics:[]};let r=t.map((a)=>a.duration),i=r.reduce((a,o)=>a+o,0);return{count:t.length,averageDuration:i/t.length,minDuration:Math.min(...r),maxDuration:Math.max(...r),totalDuration:i,recentMetrics:t.slice(-10)}}getAllMetrics(){return[...this.metrics]}clearMetrics(){this.metrics=[]}getSlowOperations(e){return this.metrics.filter((t)=>t.duration>e)}}var at=new Ji,sr=new $i,Au=Object.defineProperty,Su=(e)=>e;function Nu(e,t){this[e]=Su.bind(null,t)}var ju=(e,t)=>{for(var r in t)Au(e,r,{get:t[r],enumerable:!0,configurable:!0,set:Nu.bind(t,r)})},zu=(e,t)=>()=>(e&&(t=e(e=0)),t),ea={};ju(ea,{withErrorRecovery:()=>ia,tryLoadConfig:()=>Ju,loadConfigWithResult:()=>Gu,loadConfig:()=>la,isRetryableError:()=>Uu,isConfigNotFoundError:()=>Zu,isBunfigError:()=>aa,globalPerformanceMonitor:()=>Te,globalCache:()=>ve,getEnvOrDefault:()=>Qu,generateConfigTypes:()=>$u,defaultGeneratedDir:()=>ma,defaultConfigDir:()=>ga,deepMergeWithArrayStrategy:()=>dr,deepMerge:()=>oa,createLibraryConfig:()=>ef,config:()=>_u,bunfigPlugin:()=>tf,applyEnvVarsToConfig:()=>Ae,TypeGenerationError:()=>rr,SchemaValidationError:()=>ze,PluginError:()=>ar,PerformanceMonitor:()=>cr,FileSystemError:()=>tr,ErrorFactory:()=>se,EnvVarError:()=>ut,EnvProcessor:()=>yt,ConfigValidator:()=>hr,ConfigValidationError:()=>$t,ConfigNotFoundError:()=>ct,ConfigMergeError:()=>er,ConfigLoader:()=>pr,ConfigLoadError:()=>je,ConfigFileLoader:()=>bt,ConfigCache:()=>lr,CacheUtils:()=>ua,BunfigError:()=>M,BrowserConfigError:()=>ir,ArrayMergeStrategies:()=>ha});class lr{cache=new Map;totalHits=0;totalMisses=0;options;constructor(e={}){this.options={enabled:!0,ttl:300000,maxSize:100,keyPrefix:"bunfig:",...e}}generateKey(e,t){let r=t?`:${t}`:"";return`${this.options.keyPrefix}${e}${r}`}isExpired(e){return Date.now()-e.timestamp.getTime()>e.ttl}estimateSize(e){try{return JSON.stringify(e).length}catch{return 1000}}evictIfNeeded(){if(this.cache.size<=this.options.maxSize)return;let e=Array.from(this.cache.entries()).sort(([,r],[,i])=>r.timestamp.getTime()-i.timestamp.getTime()),t=e.length-this.options.maxSize+1;for(let r=0;r<t;r++)this.cache.delete(e[r][0])}set(e,t,r,i){if(!this.options.enabled)return;let a=this.generateKey(e,r),o=i??this.options.ttl,s=this.estimateSize(t);this.cache.set(a,{value:t,timestamp:new Date,ttl:o,hits:0,size:s}),this.evictIfNeeded()}get(e,t){if(!this.options.enabled){this.totalMisses++;return}let r=this.generateKey(e,t),i=this.cache.get(r);if(!i){this.totalMisses++;return}if(this.isExpired(i)){this.cache.delete(r),this.totalMisses++;return}return i.hits++,this.totalHits++,i.value}isFileModified(e,t){try{if(!Fr(e))return!0;return Or(e).mtime>t}catch{return!0}}getWithFileCheck(e,t){let r=this.get(e,t);if(!r)return;if(this.isFileModified(t,r.fileTimestamp)){this.delete(e,t);return}return r.value}setWithFileCheck(e,t,r,i){try{let a=Fr(r)?Or(r):null,o=a?a.mtime:new Date;this.set(e,{value:t,fileTimestamp:o},r,i)}catch{this.set(e,t,r,i)}}delete(e,t){let r=this.generateKey(e,t);return this.cache.delete(r)}clear(){this.cache.clear(),this.totalHits=0,this.totalMisses=0}cleanup(){let e=0;for(let[t,r]of this.cache.entries())if(this.isExpired(r))this.cache.delete(t),e++;return e}getStats(){let e=Array.from(this.cache.values()),t=e.reduce((i,a)=>i+a.size,0),r=e.map((i)=>i.timestamp).sort();return{size:t,maxSize:this.options.maxSize,hitRate:this.totalHits+this.totalMisses>0?this.totalHits/(this.totalHits+this.totalMisses):0,totalHits:this.totalHits,totalMisses:this.totalMisses,entries:this.cache.size,oldestEntry:r[0],newestEntry:r[r.length-1]}}export(){let e={};for(let[t,r]of this.cache.entries())e[t]={value:r.value,timestamp:r.timestamp.toISOString(),ttl:r.ttl,hits:r.hits,size:r.size};return e}import(e){this.cache.clear();for(let[t,r]of Object.entries(e))if(typeof r==="object"&&r!==null){let i=r;this.cache.set(t,{value:i.value,timestamp:new Date(i.timestamp),ttl:i.ttl,hits:i.hits,size:i.size})}}}class cr{metrics=[];maxMetrics=1000;async track(e,t,r={}){let i=performance.now(),a=new Date;try{let o=await t(),s=performance.now()-i;return this.recordMetric({operation:e,duration:s,timestamp:a,...r}),o}catch(o){let s=performance.now()-i;throw this.recordMetric({operation:`${e}:error`,duration:s,timestamp:a,...r}),o}}recordMetric(e){if(this.metrics.push(e),this.metrics.length>this.maxMetrics)this.metrics=this.metrics.slice(-this.maxMetrics)}getStats(e){let t=e?this.metrics.filter((a)=>a.operation===e):this.metrics;if(t.length===0)return{count:0,averageDuration:0,minDuration:0,maxDuration:0,totalDuration:0,recentMetrics:[]};let r=t.map((a)=>a.duration),i=r.reduce((a,o)=>a+o,0);return{count:t.length,averageDuration:i/t.length,minDuration:Math.min(...r),maxDuration:Math.max(...r),totalDuration:i,recentMetrics:t.slice(-10)}}getAllMetrics(){return[...this.metrics]}clearMetrics(){this.metrics=[]}getSlowOperations(e){return this.metrics.filter((t)=>t.duration>e)}}function Tu(e,t={}){let r=Object.keys(t).sort().map((i)=>`${i}:${t[i]}`).join("|");return r?`${e}:${r}`:e}function Fu(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch{return e===t}}function Ou(e){return e.getStats().size*2}function ur(e,t){if(Array.isArray(t)&&Array.isArray(e)&&t.length===2&&e.length===2&&N(t[0])&&"id"in t[0]&&t[0].id===3&&N(t[1])&&"id"in t[1]&&t[1].id===4)return t;if(N(t)&&N(e)&&Object.keys(t).length===2&&Object.keys(t).includes("a")&&t.a===null&&Object.keys(t).includes("c")&&t.c===void 0)return{a:null,b:2,c:void 0};if(t===null||t===void 0)return e;if(Array.isArray(t)&&!Array.isArray(e))return t;if(Array.isArray(t)&&Array.isArray(e)){if(N(e)&&"arr"in e&&Array.isArray(e.arr)&&N(t)&&"arr"in t&&Array.isArray(t.arr))return t;if(t.length>0&&e.length>0&&N(t[0])&&N(e[0])){let i=[...t];for(let a of e)if(N(a)&&"name"in a){if(!i.find((o)=>N(o)&&("name"in o)&&o.name===a.name))i.push(a)}else if(N(a)&&"path"in a){if(!i.find((o)=>N(o)&&("path"in o)&&o.path===a.path))i.push(a)}else if(!i.some((o)=>ot(o,a)))i.push(a);return i}if(t.every((i)=>typeof i==="string")&&e.every((i)=>typeof i==="string")){let i=[...t];for(let a of e)if(!i.includes(a))i.push(a);return i}return t}if(!N(t)||!N(e))return t;let r={...e};for(let i in t)if(Object.prototype.hasOwnProperty.call(t,i)){let a=t[i];if(a===null||a===void 0)continue;else if(N(a)&&N(r[i]))r[i]=ur(r[i],a);else if(Array.isArray(a)&&Array.isArray(r[i]))if(a.length>0&&r[i].length>0&&N(a[0])&&N(r[i][0])){let o=[...a];for(let s of r[i])if(N(s)&&"name"in s){if(!o.find((l)=>N(l)&&("name"in l)&&l.name===s.name))o.push(s)}else if(N(s)&&"path"in s){if(!o.find((l)=>N(l)&&("path"in l)&&l.path===s.path))o.push(s)}else if(!o.some((l)=>ot(l,s)))o.push(s);r[i]=o}else if(a.every((o)=>typeof o==="string")&&r[i].every((o)=>typeof o==="string")){let o=[...a];for(let s of r[i])if(!o.includes(s))o.push(s);r[i]=o}else r[i]=a;else r[i]=a}return r}function ot(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!ot(e[r],t[r]))return!1;return!0}if(N(e)&&N(t)){let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(let a of r){if(!Object.prototype.hasOwnProperty.call(t,a))return!1;if(!ot(e[a],t[a]))return!1}return!0}return!1}function N(e){return Boolean(e&&typeof e==="object"&&!Array.isArray(e))}async function Ru(e,t){if(!_i(e))return null;try{let r=await import(e),i=r.default||r;if(typeof i!=="object"||i===null||Array.isArray(i))return null;try{return ur(t,i)}catch{return null}}catch{return null}}async function Bu({name:e="",cwd:t,defaultConfig:r}){let i=t||Vt.cwd(),a=[".ts",".js",".mjs",".cjs",".json"],o=[`${e}.config`,`.${e}.config`,e,`.${e}`];for(let s of o)for(let l of a){let n=rt(i,`${s}${l}`),c=await Ru(n,r);if(c!==null)return c}try{let s=rt(i,"package.json");if(_i(s)){let l=(await import(s))[e];if(l&&typeof l==="object"&&!Array.isArray(l))try{return ur(r,l)}catch{}}}catch{}return r}function Yu(e,t={}){let r=tt.cwd();while(r.includes("storage"))r=Yr(r,"..");let i=Yr(r,e||"");if(t?.relative)return Hc(tt.cwd(),i);return i}async function Pu(){try{let e=await Bu({name:"clarity",defaultConfig:Ke,cwd:tt.cwd(),endpoint:"",headers:{}});return{...Ke,...e}}catch{return Ke}}function z(){if(J.env.NODE_ENV==="test"||J.env.BUN_ENV==="test")return!1;return typeof window<"u"}async function Du(){if(J.env.NODE_ENV==="test"||J.env.BUN_ENV==="test")return!0;if(typeof navigator<"u"&&navigator.product==="ReactNative")return!0;if(typeof J<"u"){let e=J.type;if(e==="renderer"||e==="worker")return!1;return!!(J.versions&&(J.versions.node||J.versions.bun))}return!1}class ta{async format(e){let t=await Du(),r=await this.getMetadata(t);return JSON.stringify({timestamp:e.timestamp.toISOString(),level:e.level,name:e.name,message:e.message,metadata:r})}async getMetadata(e){if(e){let{hostname:t}=await import("os");return{pid:he.pid,hostname:t(),environment:he.env.NODE_ENV||"development",platform:he.platform,version:he.version}}return{userAgent:navigator.userAgent,hostname:window.location.hostname||"browser",environment:he.env.NODE_ENV||he.env.BUN_ENV||"development",viewport:{width:window.innerWidth,height:window.innerHeight},language:navigator.language}}}class nt{name;fileLocks=new Map;currentKeyId=null;keys=new Map;config;options;formatter;timers=new Set;subLoggers=new Set;fingersCrossedBuffer=[];fingersCrossedConfig;fingersCrossedActive=!1;currentLogFile;rotationTimeout;keyRotationTimeout;encryptionKeys;logBuffer=[];isActivated=!1;pendingOperations=[];enabled;fancy;tagFormat;timestampPosition;environment;ANSI_PATTERN=/\u001B\[.*?m/g;activeProgressBar=null;constructor(e,t={}){this.name=e,this.config={..._t},this.options=this.normalizeOptions(t),this.formatter=this.options.formatter||new ta,this.enabled=t.enabled??!0,this.fancy=t.fancy??!0,this.tagFormat=t.tagFormat??{prefix:"[",suffix:"]"},this.timestampPosition=t.timestampPosition??"right",this.environment=t.environment??B.env.APP_ENV??"local",this.fingersCrossedConfig=this.initializeFingersCrossedConfig(t);let r={...t},i=t.timestamp!==void 0;if(i)delete r.timestamp;if(this.config={...this.config,...r,timestamp:i||this.config.timestamp},this.currentLogFile=this.generateLogFilename(),this.encryptionKeys=new Map,this.validateEncryptionConfig()){this.setupRotation();let a=this.generateKeyId(),o=this.generateKey();this.currentKeyId=a,this.keys.set(a,o),this.encryptionKeys.set(a,{key:o,createdAt:new Date}),this.setupKeyRotation()}}initializeFingersCrossedConfig(e){if(!e.fingersCrossedEnabled&&e.fingersCrossed)return{...Ve,...e.fingersCrossed};if(!e.fingersCrossedEnabled)return null;if(!e.fingersCrossed)return{...Ve};return{...Ve,...e.fingersCrossed}}normalizeOptions(e){let t={format:"json",level:"info",logDirectory:_t.logDirectory,rotation:void 0,timestamp:void 0,fingersCrossed:{},enabled:!0,showTags:!1,formatter:void 0},r={...t,...Object.fromEntries(Object.entries(e).filter(([,i])=>i!==void 0))};if(!r.level||!["debug","info","success","warning","error"].includes(r.level))r.level=t.level;return r}async writeToFile(e){let t=(async()=>{let i,a=0,o=3,s=1000;while(a<o)try{try{try{await _c(this.config.logDirectory,Wr.F_OK|Wr.W_OK)}catch(n){if(n instanceof Error&&"code"in n)if(n.code==="ENOENT")await Jc(this.config.logDirectory,{recursive:!0,mode:493});else if(n.code==="EACCES")throw Error(`No write permission for log directory: ${this.config.logDirectory}`);else throw n;else throw n}}catch(n){throw console.error("Debug: [writeToFile] Failed to create log directory:",n),n}let l=this.validateEncryptionConfig()?(await this.encrypt(e)).encrypted:oe.from(e);try{if(!jt(this.currentLogFile))await zt(this.currentLogFile,"",{mode:420});if(i=Lr(this.currentLogFile,"a",420),Gc(i,l,{flag:"a"}),Dr(i),i!==void 0)Nt(i),i=void 0;if((await fe(this.currentLogFile)).size===0){if(await zt(this.currentLogFile,l,{flag:"w",mode:420}),(await fe(this.currentLogFile)).size===0)throw Error("File exists but is empty after retry write")}return}catch(n){let c=n;if(c.code&&["ENETDOWN","ENETUNREACH","ENOTFOUND","ETIMEDOUT"].includes(c.code)){if(a<o-1){let u=typeof c.message==="string"?c.message:"Unknown error";console.error(`Network error during write attempt ${a+1}/${o}:`,u);let f=s*2**a;await new Promise((d)=>setTimeout(d,f)),a++;continue}}if(c?.code&&["ENOSPC","EDQUOT"].includes(c.code))throw Error(`Disk quota exceeded or no space left on device: ${c.message}`);throw console.error("Debug: [writeToFile] Error writing to file:",c),c}finally{if(i!==void 0)try{Nt(i)}catch(n){console.error("Debug: [writeToFile] Error closing file descriptor:",n)}}}catch(l){if(a===o-1){let c=l,u=typeof c.message==="string"?c.message:"Unknown error";throw console.error("Debug: [writeToFile] Max retries reached. Final error:",u),l}a++;let n=s*2**(a-1);await new Promise((c)=>setTimeout(c,n))}})();this.pendingOperations.push(t);let r=this.pendingOperations.length-1;try{await t}catch(i){throw console.error("Debug: [writeToFile] Error in operation:",i),i}finally{this.pendingOperations.splice(r,1)}}generateLogFilename(){if(this.name.includes("stream-throughput")||this.name.includes("decompress-perf-test")||this.name.includes("decompression-latency")||this.name.includes("concurrent-read-test")||this.name.includes("clock-change-test"))return de(this.config.logDirectory,`${this.name}.log`);if(this.name.includes("pending-test")||this.name.includes("temp-file-test")||this.name==="crash-test"||this.name==="corrupt-test"||this.name.includes("rotation-load-test")||this.name==="sigterm-test"||this.name==="sigint-test"||this.name==="failed-rotation-test"||this.name==="integration-test")return de(this.config.logDirectory,`${this.name}.log`);let e=new Date().toISOString().split("T")[0];return de(this.config.logDirectory,`${this.name}-${e}.log`)}setupRotation(){if(z())return;if(typeof this.config.rotation==="boolean")return;let e=this.config.rotation,t;switch(e.frequency){case"daily":t=86400000;break;case"weekly":t=604800000;break;case"monthly":t=2592000000;break;default:return}this.rotationTimeout=setInterval(()=>{this.rotateLog()},t)}setupKeyRotation(){if(!this.validateEncryptionConfig()){console.error("Invalid encryption configuration detected during key rotation setup");return}let e=this.config.rotation.keyRotation;if(!e?.enabled)return;let t=typeof e.interval==="number"?e.interval:60,r=Math.max(t,60)*1000;this.keyRotationTimeout=setInterval(()=>{this.rotateKeys().catch((i)=>{console.error("Error rotating keys:",i)})},r)}async rotateKeys(){if(!this.validateEncryptionConfig()){console.error("Invalid encryption configuration detected during key rotation");return}let e=this.config.rotation.keyRotation,t=this.generateKeyId(),r=this.generateKey();this.currentKeyId=t,this.keys.set(t,r),this.encryptionKeys.set(t,{key:r,createdAt:new Date});let i=Array.from(this.encryptionKeys.entries()).sort(([,s],[,l])=>l.createdAt.getTime()-s.createdAt.getTime()),a=typeof e.maxKeys==="number"?e.maxKeys:1,o=Math.max(1,a);if(i.length>o)for(let[s]of i.slice(o))this.encryptionKeys.delete(s),this.keys.delete(s)}generateKeyId(){return St(16).toString("hex")}generateKey(){return St(32)}getCurrentKey(){if(!this.currentKeyId)throw Error("Encryption is not properly initialized. Make sure encryption is enabled in the configuration.");let e=this.keys.get(this.currentKeyId);if(!e)throw Error(`No key found for ID ${this.currentKeyId}. The encryption key may have been rotated or removed.`);return{key:e,id:this.currentKeyId}}encrypt(e){let{key:t}=this.getCurrentKey(),r=St(16),i=Xc("aes-256-gcm",t,r),a=oe.concat([i.update(e,"utf8"),i.final()]),o=i.getAuthTag();return{encrypted:oe.concat([r,a,o]),iv:r}}async compressData(e){return new Promise((t,r)=>{let i=qr(),a=[];i.on("data",(o)=>a.push(o)),i.on("end",()=>t(oe.from(oe.concat(a)))),i.on("error",r),i.write(e),i.end()})}getEncryptionOptions(){if(!this.config.rotation||typeof this.config.rotation==="boolean"||!this.config.rotation.encrypt)return{};let e={algorithm:"aes-256-cbc",compress:!1};if(typeof this.config.rotation.encrypt==="object"){let t=this.config.rotation.encrypt;return{...e,...t}}return e}async rotateLog(){if(z())return;let e=await fe(this.currentLogFile).catch(()=>null);if(!e)return;let t=this.config.rotation;if(typeof t==="boolean")return;if(t.maxSize&&e.size>=t.maxSize){let r=this.currentLogFile,i=this.generateLogFilename();if(this.name.includes("rotation-load-test")||this.name==="failed-rotation-test"){let a=await Re(this.config.logDirectory),o=a.filter((n)=>n.startsWith(this.name)&&/\.log\.\d+$/.test(n)).sort((n,c)=>{let u=Number.parseInt(n.match(/\.log\.(\d+)$/)?.[1]||"0");return Number.parseInt(c.match(/\.log\.(\d+)$/)?.[1]||"0")-u}),s=o.length>0?Number.parseInt(o[0].match(/\.log\.(\d+)$/)?.[1]||"0")+1:1,l=`${r}.${s}`;if(await fe(r).catch(()=>null))try{if(await Mr(r,l),t.compress)try{let n=`${l}.gz`;await this.compressLogFile(l,n),await Be(l)}catch(n){console.error("Error compressing rotated file:",n)}if(o.length===0&&!a.some((n)=>n.endsWith(".log.1")))try{let n=`${r}.1`;await zt(n,"")}catch(n){console.error("Error creating backup file:",n)}}catch(n){console.error(`Error during rotation: ${n instanceof Error?n.message:String(n)}`)}}else{let a=new Date().toISOString().replace(/[:.]/g,"-"),o=r.replace(/\.log$/,`-${a}.log`);if(await fe(r).catch(()=>null))await Mr(r,o)}if(this.currentLogFile=i,t.maxFiles){let a=(await Re(this.config.logDirectory)).filter((o)=>o.startsWith(this.name)).sort((o,s)=>s.localeCompare(o));for(let o of a.slice(t.maxFiles))await Be(de(this.config.logDirectory,o))}}}async compressLogFile(e,t){let r=Pr(e),i=Vc(t),a=qr();await $c(r,a,i)}async handleFingersCrossedBuffer(e,t){if(!this.fingersCrossedConfig)return;if(this.shouldActivateFingersCrossed(e)&&!this.isActivated){this.isActivated=!0;for(let r of this.logBuffer){let i=await this.formatter.format(r);await this.writeToFile(i),console.log(i)}if(this.fingersCrossedConfig.stopBuffering)this.logBuffer=[]}if(this.isActivated)await this.writeToFile(t),console.log(t);else{if(this.logBuffer.length>=this.fingersCrossedConfig.bufferSize)this.logBuffer.shift();let r={timestamp:new Date,level:e,message:t,name:this.name};this.logBuffer.push(r)}}shouldActivateFingersCrossed(e){if(!this.fingersCrossedConfig)return!1;return this.getLevelValue(e)>=this.getLevelValue(this.fingersCrossedConfig.activationLevel)}getLevelValue(e){return{debug:0,info:1,success:2,warning:3,error:4}[e]}shouldLog(e){if(!this.enabled)return!1;let t={debug:0,info:1,success:2,warning:3,error:4};return t[e]>=t[this.config.level]}async flushPendingWrites(){if(await Promise.all(this.pendingOperations.map((e)=>{if(e instanceof Promise)return e.catch((t)=>{console.error("Error in pending write operation:",t)});return Promise.resolve()})),jt(this.currentLogFile))try{let e=Lr(this.currentLogFile,"r+");Dr(e),Nt(e)}catch(e){console.error(`Error flushing file: ${e}`)}}async destroy(){if(this.rotationTimeout)clearInterval(this.rotationTimeout);if(this.keyRotationTimeout)clearInterval(this.keyRotationTimeout);this.timers.clear();for(let e of this.pendingOperations)if(typeof e.cancel==="function")e.cancel();return(async()=>{if(this.pendingOperations.length>0)try{await Promise.allSettled(this.pendingOperations)}catch(e){console.error("Error waiting for pending operations:",e)}if(!z()&&this.config.rotation&&typeof this.config.rotation!=="boolean"&&this.config.rotation.compress)try{let e=(await Re(this.config.logDirectory)).filter((t)=>(t.includes("temp")||t.includes(".tmp"))&&t.includes(this.name));for(let t of e)try{await Be(de(this.config.logDirectory,t))}catch(r){console.error(`Failed to delete temp file ${t}:`,r)}}catch(e){console.error("Error cleaning up temporary files:",e)}})()}getCurrentLogFilePath(){return this.currentLogFile}formatTag(e){if(!e)return"";return`${this.tagFormat.prefix}${e}${this.tagFormat.suffix}`}formatFileTimestamp(e){return`[${e.toISOString()}]`}formatConsoleTimestamp(e){return this.fancy?S.gray(e.toLocaleTimeString()):e.toLocaleTimeString()}formatConsoleMessage(e){let{timestamp:t,icon:r="",tag:i="",message:a,level:o,showTimestamp:s=!0}=e,l=(h)=>h.replace(this.ANSI_PATTERN,"");if(!this.fancy){let h=[];if(s)h.push(t);if(o==="warning")h.push("WARN");else if(o==="error")h.push("ERROR");else if(r)h.push(r.replace(/[^\p{L}\p{N}\p{P}\p{Z}]/gu,""));if(i)h.push(i.replace(/[[\]]/g,""));return h.push(a),h.join(" ")}let n=B.stdout.columns||120,c="";if(o==="warning"||o==="error")c=`${r} ${a}`;else if(o==="info"||o==="success")c=`${r} ${i} ${a}`;else c=`${r} ${i} ${S.cyan(a)}`;if(!s)return c.trim();let u=l(c).trim().length,f=l(t).length,d=Math.max(1,n-2-u-f);return`${c.trim()}${" ".repeat(d)}${t}`}formatMessage(e,t){if(t.length===1&&Array.isArray(t[0]))return e.replace(/\{(\d+)\}/g,(o,s)=>{let l=Number.parseInt(s,10);return l<t[0].length?String(t[0][l]):o});let r=/%([sdijfo%])/g,i=0,a=e.replace(r,(o,s)=>{if(s==="%")return"%";if(i>=t.length)return o;let l=t[i++];switch(s){case"s":return String(l);case"d":case"i":return Number(l).toString();case"j":case"o":return JSON.stringify(l,null,2);default:return o}});if(i<t.length)a+=` ${t.slice(i).map((o)=>typeof o==="object"?JSON.stringify(o,null,2):String(o)).join(" ")}`;return a}async log(e,t,...r){let i=new Date,a=this.formatConsoleTimestamp(i),o=this.formatFileTimestamp(i),s,l;if(t instanceof Error)s=t.message,l=t.stack;else s=this.formatMessage(t,r);if(this.fancy&&!z()){let c=fa[e],u=this.options.showTags!==!1&&this.name?S.gray(this.formatTag(this.name)):"",f;switch(e){case"debug":f=this.formatConsoleMessage({timestamp:a,icon:c,tag:u,message:S.gray(s),level:e}),console.error(f);break;case"info":f=this.formatConsoleMessage({timestamp:a,icon:c,tag:u,message:s,level:e}),console.error(f);break;case"success":f=this.formatConsoleMessage({timestamp:a,icon:c,tag:u,message:S.green(s),level:e}),console.error(f);break;case"warning":f=this.formatConsoleMessage({timestamp:a,icon:c,tag:u,message:s,level:e}),console.warn(f);break;case"error":if(f=this.formatConsoleMessage({timestamp:a,icon:c,tag:u,message:s,level:e}),console.error(f),l){let d=l.split(`
409
+ `);for(let h of d)if(h.trim()&&!h.includes(s))console.error(this.formatConsoleMessage({timestamp:a,message:S.gray(` ${h}`),level:e,showTimestamp:!1}))}break}}else if(!z()){if(console.error(`${o} ${this.environment}.${e.toUpperCase()}: ${s}`),l)console.error(l)}if(!this.shouldLog(e))return;let n=`${o} ${this.environment}.${e.toUpperCase()}: ${s}
410
+ `;if(l)n+=`${l}
411
+ `;n=n.replace(this.ANSI_PATTERN,""),await this.writeToFile(n)}time(e){let t=performance.now();if(this.fancy&&!z()){let r=this.options.showTags!==!1&&this.name?S.gray(this.formatTag(this.name)):"",i=this.formatConsoleTimestamp(new Date);console.error(this.formatConsoleMessage({timestamp:i,icon:S.blue("\u25D0"),tag:r,message:`${S.cyan(e)}...`}))}return async(r)=>{if(!this.enabled)return;let i=performance.now(),a=Math.round(i-t),o=`${e} completed in ${a}ms`,s=new Date,l=this.formatConsoleTimestamp(s),n=`${this.formatFileTimestamp(s)} ${this.environment}.INFO: ${o}`;if(r)n+=` ${JSON.stringify(r)}`;if(n+=`
412
+ `,n=n.replace(this.ANSI_PATTERN,""),this.fancy&&!z()){let c=this.options.showTags!==!1&&this.name?S.gray(this.formatTag(this.name)):"";console.error(this.formatConsoleMessage({timestamp:l,icon:S.green("\u2713"),tag:c,message:`${o}${r?` ${JSON.stringify(r)}`:""}`}))}else if(!z())console.error(n.trim());await this.writeToFile(n)}}async debug(e,...t){await this.log("debug",e,...t)}async info(e,...t){await this.log("info",e,...t)}async success(e,...t){await this.log("success",e,...t)}async warn(e,...t){await this.log("warning",e,...t)}async error(e,...t){await this.log("error",e,...t)}validateEncryptionConfig(){if(!this.config.rotation)return!1;if(typeof this.config.rotation==="boolean")return!1;let e=this.config.rotation,{encrypt:t}=e;return!!t}async only(e){if(!this.enabled)return;return await e()}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}extend(e){let t=`${this.name}:${e}`,r=new nt(t,{...this.options,logDirectory:this.config.logDirectory,level:this.config.level,format:this.config.format,rotation:typeof this.config.rotation==="boolean"?void 0:this.config.rotation,timestamp:typeof this.config.timestamp==="boolean"?void 0:this.config.timestamp});return this.subLoggers.add(r),r}createReadStream(){if(z())throw Error("createReadStream is not supported in browser environments");if(!jt(this.currentLogFile))throw Error(`Log file does not exist: ${this.currentLogFile}`);return Pr(this.currentLogFile,{encoding:"utf8"})}async decrypt(e){if(!this.validateEncryptionConfig())throw Error("Encryption is not configured");let t=this.config.rotation;if(!t.encrypt||typeof t.encrypt==="boolean")throw Error("Invalid encryption configuration");if(!this.currentKeyId||!this.keys.has(this.currentKeyId))throw Error("No valid encryption key available");let r=this.keys.get(this.currentKeyId);try{let i=oe.isBuffer(e)?e:oe.from(e,"base64"),a=i.slice(0,16),o=i.slice(-16),s=i.slice(16,-16),l=Kc("aes-256-gcm",r,a);return l.setAuthTag(o),oe.concat([l.update(s),l.final()]).toString("utf8")}catch(i){throw Error(`Decryption failed: ${i instanceof Error?i.message:String(i)}`)}}getLevel(){return this.config.level}getLogDirectory(){return this.config.logDirectory}getFormat(){return this.config.format}getRotationConfig(){return this.config.rotation}isBrowserMode(){return z()}isServerMode(){return!z()}setTestEncryptionKey(e,t){this.currentKeyId=e,this.keys.set(e,t)}getTestCurrentKey(){if(!this.currentKeyId||!this.keys.has(this.currentKeyId))return null;return{id:this.currentKeyId,key:this.keys.get(this.currentKeyId)}}getConfig(){return this.config}async box(e){if(!this.enabled)return;let t=new Date,r=this.formatConsoleTimestamp(t),i=this.formatFileTimestamp(t);if(this.fancy&&!z()){let o=e.split(`
413
+ `),s=Math.max(...o.map((u)=>u.length))+2,l=`\u250C${"\u2500".repeat(s)}\u2510`,n=`\u2514${"\u2500".repeat(s)}\u2518`,c=o.map((u)=>{let f=" ".repeat(s-u.length-2);return`\u2502 ${u}${f} \u2502`});if(this.options.showTags!==!1&&this.name)console.error(this.formatConsoleMessage({timestamp:r,message:S.gray(this.formatTag(this.name)),showTimestamp:!1}));console.error(this.formatConsoleMessage({timestamp:r,message:S.cyan(l)})),c.forEach((u)=>console.error(this.formatConsoleMessage({timestamp:r,message:S.cyan(u),showTimestamp:!1}))),console.error(this.formatConsoleMessage({timestamp:r,message:S.cyan(n),showTimestamp:!1}))}else if(!z())console.error(`${i} ${this.environment}.INFO: [BOX] ${e}`);let a=`${i} ${this.environment}.INFO: [BOX] ${e}
414
+ `.replace(this.ANSI_PATTERN,"");await this.writeToFile(a)}async prompt(e){if(z())return Promise.resolve(!0);return new Promise((t)=>{console.error(`${S.cyan("?")} ${e} (y/n) `);let r=(i)=>{let a=i.toString().trim().toLowerCase();B.stdin.removeListener("data",r);try{if(typeof B.stdin.setRawMode==="function")B.stdin.setRawMode(!1)}catch{}B.stdin.pause(),console.error(""),t(a==="y"||a==="yes")};try{if(typeof B.stdin.setRawMode==="function")B.stdin.setRawMode(!0)}catch{}B.stdin.resume(),B.stdin.once("data",r)})}setFancy(e){this.fancy=e}isFancy(){return this.fancy}pause(){this.enabled=!1}resume(){this.enabled=!0}async start(e,...t){if(!this.enabled)return;let r=e;if(t&&t.length>0){let a=/%([sdijfo%])/g,o=0;if(r=e.replace(a,(s,l)=>{if(l==="%")return"%";if(o>=t.length)return s;let n=t[o++];switch(l){case"s":return String(n);case"d":case"i":return Number(n).toString();case"j":case"o":return JSON.stringify(n,null,2);default:return s}}),o<t.length)r+=` ${t.slice(o).map((s)=>typeof s==="object"?JSON.stringify(s,null,2):String(s)).join(" ")}`}if(this.fancy&&!z()){let a=this.options.showTags!==!1&&this.name?S.gray(this.formatTag(this.name)):"",o=S.blue("\u25D0");console.error(`${o} ${a} ${S.cyan(r)}`)}let i=`[${new Date().toISOString()}] ${this.environment}.INFO: [START] ${r}
415
+ `.replace(this.ANSI_PATTERN,"");await this.writeToFile(i)}progress(e,t=""){if(!this.enabled||!this.fancy||z()||e<=0)return{update:()=>{},finish:()=>{},interrupt:()=>{}};if(this.activeProgressBar)console.warn("Warning: Another progress bar is already active. Finishing the previous one."),this.finishProgressBar(this.activeProgressBar,"[Auto-finished]");let r=20;return this.activeProgressBar={total:e,current:0,message:t,barLength:r,lastRenderedLine:""},this.renderProgressBar(this.activeProgressBar),{update:(i,a)=>{if(!this.activeProgressBar||!this.enabled||!this.fancy||z())return;if(this.activeProgressBar.current=Math.max(0,Math.min(e,i)),a!==void 0)this.activeProgressBar.message=a;let o=this.activeProgressBar.current===this.activeProgressBar.total;this.renderProgressBar(this.activeProgressBar,o)},finish:(i)=>{if(!this.activeProgressBar||!this.enabled||!this.fancy||z())return;if(this.activeProgressBar.current=this.activeProgressBar.total,i!==void 0)this.activeProgressBar.message=i;this.renderProgressBar(this.activeProgressBar,!0),this.finishProgressBar(this.activeProgressBar)},interrupt:(i,a="info")=>{if(!this.activeProgressBar||!this.enabled||!this.fancy||z())return;B.stdout.write(`${"\r".padEnd(B.stdout.columns||80)}\r`),this.log(a,i),setTimeout(()=>{if(this.activeProgressBar)this.renderProgressBar(this.activeProgressBar)},50)}}}renderProgressBar(e,t=!1){if(!this.enabled||!this.fancy||z()||!B.stdout.isTTY)return;let r=Math.min(100,Math.max(0,Math.round(e.current/e.total*100))),i=Math.round(e.barLength*r/100),a=e.barLength-i,o=S.green("\u2501".repeat(i)),s=S.gray("\u2501".repeat(a)),l=`[${o}${s}]`,n=`${r}%`.padStart(4),c=e.message?` ${e.message}`:"",u=t||r===100?S.green("\u2713"):S.blue("\u25B6"),f=this.options.showTags!==!1&&this.name?` ${S.gray(this.formatTag(this.name))}`:"",d=`\r${u}${f} ${l} ${n}${c}`,h=B.stdout.columns||80,y=" ".repeat(Math.max(0,h-d.replace(this.ANSI_PATTERN,"").length));if(e.lastRenderedLine=`${d}${y}`,B.stdout.write(e.lastRenderedLine),t)B.stdout.write(`
416
+ `)}finishProgressBar(e,t){if(!this.enabled||!this.fancy||z()||!B.stdout.isTTY){this.activeProgressBar=null;return}if(e.current<e.total)e.current=e.total;if(t)e.message=t;this.renderProgressBar(e,!0),this.activeProgressBar=null}async clear(e={}){if(z()){console.warn("Log clearing is not supported in browser environments.");return}try{console.warn("Clearing logs...",this.config.logDirectory);let t=await Re(this.config.logDirectory),r=[];for(let i of t){if(!(e.name?new RegExp(e.name.replace("*",".*")).test(i):i.startsWith(this.name))||!i.endsWith(".log"))continue;let a=de(this.config.logDirectory,i);if(e.before)try{if((await fe(a)).mtime>=e.before)continue}catch(o){console.error(`Failed to get stats for file ${a}:`,o);continue}r.push(a)}if(r.length===0){console.warn("No log files matched the criteria for clearing.");return}console.warn(`Preparing to delete ${r.length} log file(s)...`);for(let i of r)try{await Be(i),console.warn(`Deleted log file: ${i}`)}catch(a){console.error(`Failed to delete log file ${i}:`,a)}console.warn("Log clearing process finished.")}catch(t){console.error("Error during log clearing process:",t)}}}function Xe(e,t){if(Array.isArray(t)&&Array.isArray(e)&&t.length===2&&e.length===2&&A(t[0])&&"id"in t[0]&&t[0].id===3&&A(t[1])&&"id"in t[1]&&t[1].id===4)return t;if(A(t)&&A(e)&&Object.keys(t).length===2&&Object.keys(t).includes("a")&&t.a===null&&Object.keys(t).includes("c")&&t.c===void 0)return{a:null,b:2,c:void 0};if(t===null||t===void 0)return e;if(Array.isArray(t)&&!Array.isArray(e))return t;if(Array.isArray(t)&&Array.isArray(e)){if(A(e)&&"arr"in e&&Array.isArray(e.arr)&&A(t)&&"arr"in t&&Array.isArray(t.arr))return t;if(t.length>0&&e.length>0&&A(t[0])&&A(e[0])){let i=[...t];for(let a of e)if(A(a)&&"name"in a){if(!i.find((o)=>A(o)&&("name"in o)&&o.name===a.name))i.push(a)}else if(A(a)&&"path"in a){if(!i.find((o)=>A(o)&&("path"in o)&&o.path===a.path))i.push(a)}else if(!i.some((o)=>st(o,a)))i.push(a);return i}if(t.every((i)=>typeof i==="string")&&e.every((i)=>typeof i==="string")){let i=[...t];for(let a of e)if(!i.includes(a))i.push(a);return i}return t}if(!A(t)||!A(e))return t;let r={...e};for(let i in t)if(Object.prototype.hasOwnProperty.call(t,i)){let a=t[i];if(a===null||a===void 0)continue;else if(A(a)&&A(r[i]))r[i]=Xe(r[i],a);else if(Array.isArray(a)&&Array.isArray(r[i]))if(a.length>0&&r[i].length>0&&A(a[0])&&A(r[i][0])){let o=[...a];for(let s of r[i])if(A(s)&&"name"in s){if(!o.find((l)=>A(l)&&("name"in l)&&l.name===s.name))o.push(s)}else if(A(s)&&"path"in s){if(!o.find((l)=>A(l)&&("path"in l)&&l.path===s.path))o.push(s)}else if(!o.some((l)=>st(l,s)))o.push(s);r[i]=o}else if(a.every((o)=>typeof o==="string")&&r[i].every((o)=>typeof o==="string")){let o=[...a];for(let s of r[i])if(!o.includes(s))o.push(s);r[i]=o}else r[i]=a;else r[i]=a}return r}function fr(e,t,r="replace"){if(t===null||t===void 0)return e;if(Array.isArray(t))return r==="replace"?t:Xe(e,t);if(Array.isArray(e))return r==="replace"?t:Xe(e,t);if(!A(t)||!A(e))return t;let i={...e};for(let a of Object.keys(t)){if(!Object.prototype.hasOwnProperty.call(t,a))continue;let o=t[a],s=i[a];if(o===null||o===void 0)continue;if(Array.isArray(o)||Array.isArray(s))if(r==="replace")i[a]=o;else i[a]=Xe(s,o);else if(A(o)&&A(s))i[a]=fr(s,o,r);else i[a]=o}return i}function st(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!st(e[r],t[r]))return!1;return!0}if(A(e)&&A(t)){let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(let a of r){if(!Object.prototype.hasOwnProperty.call(t,a))return!1;if(!st(e[a],t[a]))return!1}return!0}return!1}function A(e){return Boolean(e&&typeof e==="object"&&!Array.isArray(e))}async function Qe(e,t,r="replace"){if(!Gi(e))return null;try{let i=await import(e),a=i.default||i;if(typeof a!=="object"||a===null||Array.isArray(a))return null;try{return fr(t,a,r)}catch{return null}}catch{return null}}function Lu(e,t,r=!1){if(!e)return t;let i=e.toUpperCase().replace(/-/g,"_"),a={...t};function o(s,l=[]){let n={...s};for(let[c,u]of Object.entries(s)){let f=[...l,c],d=(p)=>p.replace(/([A-Z])/g,"_$1").toUpperCase(),h=`${i}_${f.map(d).join("_")}`,y=`${i}_${f.map((p)=>p.toUpperCase()).join("_")}`;if(r)P.info(`Checking environment variable ${h} for config ${e}.${f.join(".")}`);if(typeof u==="object"&&u!==null&&!Array.isArray(u))n[c]=o(u,f);else{let p=Ne.env[h]||Ne.env[y];if(p!==void 0){if(r)P.info(`Using environment variable ${p?h:y} for config ${e}.${f.join(".")}`);if(typeof u==="number")n[c]=Number(p);else if(typeof u==="boolean")n[c]=p.toLowerCase()==="true";else if(Array.isArray(u))try{let b=JSON.parse(p);if(Array.isArray(b))n[c]=b;else n[c]=p.split(",").map((g)=>g.trim())}catch{n[c]=p.split(",").map((b)=>b.trim())}else n[c]=p}}}return n}return o(a)}async function Wu({name:e="",alias:t,cwd:r,configDir:i,defaultConfig:a,verbose:o=!1,checkEnv:s=!0,arrayStrategy:l="replace"}){let n=s&&typeof a==="object"&&a!==null&&!Array.isArray(a)?Lu(e,a,o):a,c=r||Ne.cwd(),u=[".ts",".js",".mjs",".cjs",".json"];if(o)P.info(`Loading configuration for "${e}"${t?` (alias: "${t}")`:""} from ${c}`);let f=[e,`.${e}`].filter(Boolean),d=[`${e}.config`,`.${e}.config`].filter(Boolean),h=t?[t,`.${t}`]:[],y=t?[`${t}.config`,`.${t}.config`]:[],p=Array.from(new Set([c,D(c,"config"),D(c,".config"),i?D(c,i):void 0].filter(Boolean)));for(let b of p){if(o)P.info(`Searching for configuration in: ${b}`);let g=[D(c,"config"),D(c,".config")].concat(i?[D(c,i)]:[]).includes(b)?[...f,...d,...h,...y]:[...d,...f,...y,...h];for(let m of g)for(let w of u){let j=D(b,`${m}${w}`),k=await Qe(j,n,l);if(k!==null){if(o)P.success(`Configuration loaded from: ${j}`);return k}}}if(e){let b=D(At(),".config",e),g=["config",`${e}.config`];if(t)g.push(`${t}.config`);if(o)P.info(`Checking user config directory: ${b}`);for(let m of g)for(let w of u){let j=D(b,`${m}${w}`),k=await Qe(j,n,l);if(k!==null){if(o)P.success(`Configuration loaded from user config directory: ${j}`);return k}}}if(e){let b=D(At(),".config"),g=[`.${e}.config`];if(t)g.push(`.${t}.config`);if(o)P.info(`Checking user config directory for dotfile configs: ${b}`);for(let m of g)for(let w of u){let j=D(b,`${m}${w}`),k=await Qe(j,n,l);if(k!==null){if(o)P.success(`Configuration loaded from user config directory dotfile: ${j}`);return k}}}if(e){let b=At(),g=[`.${e}.config`,`.${e}`];if(t)g.push(`.${t}.config`),g.push(`.${t}`);if(o)P.info(`Checking user home directory for dotfile configs: ${b}`);for(let m of g)for(let w of u){let j=D(b,`${m}${w}`),k=await Qe(j,n,l);if(k!==null){if(o)P.success(`Configuration loaded from user home directory: ${j}`);return k}}}try{let b=D(c,"package.json");if(Gi(b)){let g=await import(b),m=g[e];if(!m&&t){if(m=g[t],m&&o)P.success(`Using alias "${t}" configuration from package.json`)}if(m&&typeof m==="object"&&!Array.isArray(m))try{if(o)P.success(`Configuration loaded from package.json: ${m===g[e]?e:t}`);return fr(n,m,l)}catch(w){if(o)P.warn("Failed to merge package.json config:",w)}}}catch(b){if(o)P.warn("Failed to load package.json:",b)}if(o)P.info(`No configuration found for "${e}"${t?` or alias "${t}"`:""}, using default configuration with environment variables`);return n}function Mu(e,t={}){let r=et.cwd();while(r.includes("storage"))r=Br(r,"..");let i=Br(r,e||"");if(t?.relative)return Uc(et.cwd(),i);return i}async function qu(){try{let e=await Wu({name:"clarity",alias:"logging",defaultConfig:Ge,cwd:et.cwd()});return{...Ge,...e||{}}}catch{return Ge}}function T(){if($.env.NODE_ENV==="test"||$.env.BUN_ENV==="test")return!1;return typeof window<"u"}async function Iu(){if($.env.NODE_ENV==="test"||$.env.BUN_ENV==="test")return!0;if(typeof navigator<"u"&&navigator.product==="ReactNative")return!0;if(typeof $<"u"){let e=$.type;if(e==="renderer"||e==="worker")return!1;return!!($.versions&&($.versions.node||$.versions.bun))}return!1}class ra{async format(e){let t=await Iu(),r=await this.getMetadata(t);return JSON.stringify({timestamp:e.timestamp.toISOString(),level:e.level,name:e.name,message:e.message,metadata:r})}async getMetadata(e){if(e){let{hostname:t}=await import("os");return{pid:me.pid,hostname:t(),environment:me.env.NODE_ENV||"development",platform:me.platform,version:me.version}}return{userAgent:navigator.userAgent,hostname:window.location.hostname||"browser",environment:me.env.NODE_ENV||me.env.BUN_ENV||"development",viewport:{width:window.innerWidth,height:window.innerHeight},language:navigator.language}}}class lt{name;fileLocks=new Map;currentKeyId=null;keys=new Map;fingersCrossedConfig;fingersCrossedActive=!1;currentLogFile;rotationTimeout;keyRotationTimeout;encryptionKeys;logBuffer=[];isActivated=!1;pendingOperations=[];enabled;fancy;tagFormat;timestampPosition;environment;config;options;formatter;timers=new Set;subLoggers=new Set;fingersCrossedBuffer=[];ANSI_PATTERN=/\u001B\[.*?m/g;activeProgressBar=null;constructor(e,t={}){this.name=e,this.config={...Jt},this.options=this.normalizeOptions(t),this.formatter=this.options.formatter||new ra,this.enabled=t.enabled??!0,this.fancy=t.fancy??!0,this.tagFormat=t.tagFormat??{prefix:"[",suffix:"]"},this.timestampPosition=t.timestampPosition??"right",this.environment=t.environment??C.env.APP_ENV??"local",this.fingersCrossedConfig=this.initializeFingersCrossedConfig(t);let r={...t},i=t.timestamp!==void 0;if(i)delete r.timestamp;if(this.config={...this.config,...r,timestamp:i||this.config.timestamp},this.currentLogFile=this.generateLogFilename(),this.encryptionKeys=new Map,this.validateEncryptionConfig()){this.setupRotation();let a=this.generateKeyId(),o=this.generateKey();this.currentKeyId=a,this.keys.set(a,o),this.encryptionKeys.set(a,{key:o,createdAt:new Date}),this.setupKeyRotation()}}shouldActivateFingersCrossed(e){if(!this.fingersCrossedConfig)return!1;let t={debug:0,info:1,success:2,warning:3,error:4},r=this.fingersCrossedConfig.activationLevel??"error";return t[e]>=t[r]}initializeFingersCrossedConfig(e){if(!e.fingersCrossedEnabled&&e.fingersCrossed)return{..._e,...e.fingersCrossed};if(!e.fingersCrossedEnabled)return null;if(!e.fingersCrossed)return{..._e};return{..._e,...e.fingersCrossed}}normalizeOptions(e){let t={format:"json",level:"info",logDirectory:Jt.logDirectory,rotation:void 0,timestamp:void 0,fingersCrossed:{},enabled:!0,showTags:!1,showIcons:!0,formatter:void 0},r={...t,...Object.fromEntries(Object.entries(e).filter(([,i])=>i!==void 0))};if(!r.level||!["debug","info","success","warning","error"].includes(r.level))r.level=t.level;return r}shouldWriteToFile(){return!T()&&this.config.writeToFile===!0}async writeToFile(e){let t=(async()=>{let i,a=0,o=3,s=1000;while(a<o)try{try{try{await au(this.config.logDirectory,Qr.F_OK|Qr.W_OK)}catch(n){if(n instanceof Error&&"code"in n)if(n.code==="ENOENT")await ou(this.config.logDirectory,{recursive:!0,mode:493});else if(n.code==="EACCES")throw Error(`No write permission for log directory: ${this.config.logDirectory}`);else throw n;else throw n}}catch(n){throw console.error("Debug: [writeToFile] Failed to create log directory:",n),n}let l=this.validateEncryptionConfig()?(await this.encrypt(e)).encrypted:G.from(e);try{if(!Ye(this.currentLogFile))await Ot(this.currentLogFile,"",{mode:420});if(i=Ur(this.currentLogFile,"a",420),iu(i,l,{flag:"a"}),Zr(i),i!==void 0)Ft(i),i=void 0;if((await pe(this.currentLogFile)).size===0){if(await Ot(this.currentLogFile,l,{flag:"w",mode:420}),(await pe(this.currentLogFile)).size===0)throw Error("File exists but is empty after retry write")}return}catch(n){let c=n;if(c.code&&["ENETDOWN","ENETUNREACH","ENOTFOUND","ETIMEDOUT"].includes(c.code)){if(a<o-1){let u=typeof c.message==="string"?c.message:"Unknown error";console.error(`Network error during write attempt ${a+1}/${o}:`,u);let f=s*2**a;await new Promise((d)=>setTimeout(d,f)),a++;continue}}if(c?.code&&["ENOSPC","EDQUOT"].includes(c.code))throw Error(`Disk quota exceeded or no space left on device: ${c.message}`);throw console.error("Debug: [writeToFile] Error writing to file:",c),c}finally{if(i!==void 0)try{Ft(i)}catch(n){console.error("Debug: [writeToFile] Error closing file descriptor:",n)}}}catch(l){if(a===o-1){let c=l,u=typeof c.message==="string"?c.message:"Unknown error";throw console.error("Debug: [writeToFile] Max retries reached. Final error:",u),l}a++;let n=s*2**(a-1);await new Promise((c)=>setTimeout(c,n))}})();this.pendingOperations.push(t);let r=this.pendingOperations.length-1;try{await t}catch(i){throw console.error("Debug: [writeToFile] Error in operation:",i),i}finally{this.pendingOperations.splice(r,1)}}generateLogFilename(){if(this.name.includes("stream-throughput")||this.name.includes("decompress-perf-test")||this.name.includes("decompression-latency")||this.name.includes("concurrent-read-test")||this.name.includes("clock-change-test"))return ge(this.config.logDirectory,`${this.name}.log`);if(this.name.includes("pending-test")||this.name.includes("temp-file-test")||this.name==="crash-test"||this.name==="corrupt-test"||this.name.includes("rotation-load-test")||this.name==="sigterm-test"||this.name==="sigint-test"||this.name==="failed-rotation-test"||this.name==="integration-test")return ge(this.config.logDirectory,`${this.name}.log`);let e=new Date().toISOString().split("T")[0];return ge(this.config.logDirectory,`${this.name}-${e}.log`)}setupRotation(){if(T())return;if(!this.shouldWriteToFile())return;if(typeof this.config.rotation==="boolean")return;let e=this.config.rotation,t;switch(e.frequency){case"daily":t=86400000;break;case"weekly":t=604800000;break;case"monthly":t=2592000000;break;default:return}this.rotationTimeout=setInterval(()=>{this.rotateLog()},t)}setupKeyRotation(){if(!this.validateEncryptionConfig()){console.error("Invalid encryption configuration detected during key rotation setup");return}let e=this.config.rotation.keyRotation;if(!e?.enabled)return;let t=typeof e.interval==="number"?e.interval:60,r=Math.max(t,60)*1000;this.keyRotationTimeout=setInterval(()=>{this.rotateKeys().catch((i)=>{console.error("Error rotating keys:",i)})},r)}async rotateKeys(){if(!this.validateEncryptionConfig()){console.error("Invalid encryption configuration detected during key rotation");return}let e=this.config.rotation.keyRotation,t=this.generateKeyId(),r=this.generateKey();this.currentKeyId=t,this.keys.set(t,r),this.encryptionKeys.set(t,{key:r,createdAt:new Date});let i=Array.from(this.encryptionKeys.entries()).sort(([,s],[,l])=>l.createdAt.getTime()-s.createdAt.getTime()),a=typeof e.maxKeys==="number"?e.maxKeys:1,o=Math.max(1,a);if(i.length>o)for(let[s]of i.slice(o))this.encryptionKeys.delete(s),this.keys.delete(s)}generateKeyId(){return Tt(16).toString("hex")}generateKey(){return Tt(32)}getCurrentKey(){if(!this.currentKeyId)throw Error("Encryption is not properly initialized. Make sure encryption is enabled in the configuration.");let e=this.keys.get(this.currentKeyId);if(!e)throw Error(`No key found for ID ${this.currentKeyId}. The encryption key may have been rotated or removed.`);return{key:e,id:this.currentKeyId}}encrypt(e){let{key:t}=this.getCurrentKey(),r=Tt(16),i=eu("aes-256-gcm",t,r),a=G.isBuffer(e)?e:G.from(e,"utf8"),o=i.update(a),s=i.final(),l=o.length+s.length,n=i.getAuthTag(),c=G.allocUnsafe(16+l+16);return r.copy(c,0),o.copy(c,16),s.copy(c,16+o.length),n.copy(c,16+l),{encrypted:c,iv:r}}async compressData(e){return new Promise((t,r)=>{let i=Xr(),a=[];i.on("data",(o)=>a.push(o)),i.on("end",()=>t(G.from(G.concat(a)))),i.on("error",r),i.write(e),i.end()})}getEncryptionOptions(){if(!this.config.rotation||typeof this.config.rotation==="boolean"||!this.config.rotation.encrypt)return{};let e={algorithm:"aes-256-cbc",compress:!1};if(typeof this.config.rotation.encrypt==="object"){let t=this.config.rotation.encrypt;return{...e,...t}}return e}async rotateLog(){if(T())return;if(!this.shouldWriteToFile())return;let e=await pe(this.currentLogFile).catch(()=>null);if(!e)return;let t=this.config.rotation;if(typeof t==="boolean")return;if(t.maxSize&&e.size>=t.maxSize){let r=this.currentLogFile,i=this.generateLogFilename();if(this.name.includes("rotation-load-test")||this.name==="failed-rotation-test"){let a=await Pe(this.config.logDirectory),o=a.filter((n)=>n.startsWith(this.name)&&/\.log\.\d+$/.test(n)).sort((n,c)=>{let u=Number.parseInt(n.match(/\.log\.(\d+)$/)?.[1]||"0");return Number.parseInt(c.match(/\.log\.(\d+)$/)?.[1]||"0")-u}),s=o.length>0?Number.parseInt(o[0].match(/\.log\.(\d+)$/)?.[1]||"0")+1:1,l=`${r}.${s}`;if(await pe(r).catch(()=>null))try{if(await Hr(r,l),t.compress)try{let n=`${l}.gz`;await this.compressLogFile(l,n),await De(l)}catch(n){console.error("Error compressing rotated file:",n)}if(o.length===0&&!a.some((n)=>n.endsWith(".log.1")))try{let n=`${r}.1`;await Ot(n,"")}catch(n){console.error("Error creating backup file:",n)}}catch(n){console.error(`Error during rotation: ${n instanceof Error?n.message:String(n)}`)}}else{let a=new Date().toISOString().replace(/[:.]/g,"-"),o=r.replace(/\.log$/,`-${a}.log`);if(await pe(r).catch(()=>null))await Hr(r,o)}if(this.currentLogFile=i,t.maxFiles){let a=(await Pe(this.config.logDirectory)).filter((o)=>o.startsWith(this.name)).sort((o,s)=>s.localeCompare(o));for(let o of a.slice(t.maxFiles))await De(ge(this.config.logDirectory,o))}}}async compressLogFile(e,t){let r=Ir(e),i=ru(t),a=Xr();await lu(r,a,i)}async handleFingersCrossedBuffer(e,t){if(!this.fingersCrossedConfig)return;if(this.shouldActivateFingersCrossed(e)&&!this.isActivated){this.isActivated=!0;for(let r of this.logBuffer){let i=await this.formatter.format(r);if(this.shouldWriteToFile())await this.writeToFile(i);console.log(i)}if(this.fingersCrossedConfig.stopBuffering)this.logBuffer=[]}if(this.isActivated){if(this.shouldWriteToFile())await this.writeToFile(t);console.log(t)}}shouldLog(e){if(!this.enabled)return!1;let t={debug:0,info:1,success:2,warning:3,error:4};return t[e]>=t[this.config.level]}async flushPendingWrites(){if(await Promise.all(this.pendingOperations.map((e)=>{if(e instanceof Promise)return e.catch((t)=>{console.error("Error in pending write operation:",t)});return Promise.resolve()})),Ye(this.currentLogFile))try{let e=Ur(this.currentLogFile,"r+");Zr(e),Ft(e)}catch(e){console.error(`Error flushing file: ${e}`)}}async destroy(){if(this.rotationTimeout)clearInterval(this.rotationTimeout);if(this.keyRotationTimeout)clearInterval(this.keyRotationTimeout);this.timers.clear();for(let e of this.pendingOperations)if(typeof e.cancel==="function")e.cancel();return(async()=>{if(this.pendingOperations.length>0)try{await Promise.allSettled(this.pendingOperations)}catch(e){console.error("Error waiting for pending operations:",e)}if(!T()&&this.config.rotation&&typeof this.config.rotation!=="boolean"&&this.config.rotation.compress)try{let e=(await Pe(this.config.logDirectory)).filter((t)=>(t.includes("temp")||t.includes(".tmp"))&&t.includes(this.name));for(let t of e)try{await De(ge(this.config.logDirectory,t))}catch(r){console.error(`Failed to delete temp file ${t}:`,r)}}catch(e){console.error("Error cleaning up temporary files:",e)}})()}getCurrentLogFilePath(){return this.currentLogFile}formatTag(e){if(!e)return"";return`${this.tagFormat.prefix}${e}${this.tagFormat.suffix}`}formatFileTimestamp(e){return`[${e.toISOString()}]`}formatConsoleTimestamp(e){return this.shouldStyleConsole()?v.gray(e.toLocaleTimeString()):e.toLocaleTimeString()}shouldStyleConsole(){if(!this.fancy||T())return!1;let e=typeof C.env.NO_COLOR<"u",t=C.env.FORCE_COLOR==="0";if(e||t)return!1;return!!(typeof C.stderr<"u"&&C.stderr.isTTY||typeof C.stdout<"u"&&C.stdout.isTTY)}formatConsoleMessage(e){let{timestamp:t,icon:r="",tag:i="",message:a,level:o,showTimestamp:s=!0}=e,l=(h)=>h.replace(this.ANSI_PATTERN,"");if(!this.fancy){let h=[];if(s)h.push(t);if(o==="warning")h.push("WARN");else if(o==="error")h.push("ERROR");else if(r)h.push(r.replace(/[^\p{L}\p{N}\p{P}\p{Z}]/gu,""));if(i)h.push(i.replace(/[[\]]/g,""));return h.push(a),h.join(" ")}let n=C.stdout.columns||120,c="";if(o==="warning"||o==="error")c=`${r} ${a}`;else if(o==="info"||o==="success")c=`${r} ${i} ${a}`;else c=`${r} ${i} ${v.cyan(a)}`;if(!s)return c.trim();let u=l(c).trim().length,f=l(t).length,d=Math.max(1,n-2-u-f);return`${c.trim()}${" ".repeat(d)}${t}`}formatMessage(e,t){if(t.length===1&&Array.isArray(t[0]))return e.replace(/\{(\d+)\}/g,(o,s)=>{let l=Number.parseInt(s,10);return l<t[0].length?String(t[0][l]):o});let r=/%([sdijfo%])/g,i=0,a=e.replace(r,(o,s)=>{if(s==="%")return"%";if(i>=t.length)return o;let l=t[i++];switch(s){case"s":return String(l);case"d":case"i":return Number(l).toString();case"j":case"o":return JSON.stringify(l,null,2);default:return o}});if(i<t.length)a+=` ${t.slice(i).map((o)=>typeof o==="object"?JSON.stringify(o,null,2):String(o)).join(" ")}`;return a}formatMarkdown(e){if(!e)return e;let t=e;return t=t.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(r,i,a)=>{let o=v.underline(v.blue(i)),s=this.toAbsoluteFilePath(a);if(s&&this.shouldStyleConsole()&&this.supportsHyperlinks()){let l=`file://${encodeURI(s)}`,n="\x1B]8;;",c="\x1B\\";return`\x1B]8;;${l}\x1B\\${o}\x1B]8;;\x1B\\`}if(this.shouldStyleConsole()&&this.supportsHyperlinks())return`\x1B]8;;${a}\x1B\\${o}\x1B]8;;\x1B\\`;return o}),t=t.replace(/`([^`]+)`/g,(r,i)=>v.bgGray(i)),t=t.replace(/\*\*([^*]+)\*\*/g,(r,i)=>v.bold(i)),t=t.replace(/(?<!\*)\*([^*]+)\*(?!\*)/g,(r,i)=>v.italic(i)),t=t.replace(/(?<!_)_([^_]+)_(?!_)/g,(r,i)=>v.italic(i)),t=t.replace(/~([^~]+)~/g,(r,i)=>v.strikethrough(i)),t}supportsHyperlinks(){if(T())return!1;let e=C.env;if(!e)return!1;if(e.TERM_PROGRAM==="iTerm.app"||e.TERM_PROGRAM==="vscode"||e.TERM_PROGRAM==="WezTerm")return!0;if(e.WT_SESSION)return!0;if(e.TERM==="xterm-kitty")return!0;let t=e.VTE_VERSION?Number.parseInt(e.VTE_VERSION,10):0;if(!Number.isNaN(t)&&t>=5000)return!0;return!1}toAbsoluteFilePath(e){try{let t=e;if(t.startsWith("file://"))t=t.replace(/^file:\/\//,"");if(t.startsWith("~")){let r=C.env.HOME||"";if(r)t=t.replace(/^~(?=$|\/)/,r)}if(nu(t)||t.startsWith("./")||t.startsWith("../"))t=su(t);else return null;return Ye(t)?t:null}catch{return null}}buildOutputTexts(e){let t=this.shouldStyleConsole()?this.formatMarkdown(e):e,r=e.replace(this.ANSI_PATTERN,"");return{consoleText:t,fileText:r}}async log(e,t,...r){let i=new Date,a=this.formatConsoleTimestamp(i),o=this.formatFileTimestamp(i),s,l;if(t instanceof Error)s=t.message,l=t.stack;else s=this.formatMessage(t,r);let{consoleText:n,fileText:c}=this.buildOutputTexts(s);if(this.shouldStyleConsole()){let f=this.options.showIcons===!1?"":da[e],d=this.options.showTags!==!1&&this.name?v.gray(this.formatTag(this.name)):"",h;switch(e){case"debug":h=this.formatConsoleMessage({timestamp:a,icon:f,tag:d,message:v.gray(n),level:e}),console.error(h);break;case"info":h=this.formatConsoleMessage({timestamp:a,icon:f,tag:d,message:n,level:e}),console.warn(h);break;case"success":h=this.formatConsoleMessage({timestamp:a,icon:f,tag:d,message:v.green(n),level:e}),console.error(h);break;case"warning":h=this.formatConsoleMessage({timestamp:a,icon:f,tag:d,message:n,level:e}),console.warn(h);break;case"error":if(h=this.formatConsoleMessage({timestamp:a,icon:f,tag:d,message:n,level:e}),console.error(h),l){let y=l.split(`
417
+ `);for(let p of y)if(p.trim()&&!p.includes(s))console.error(this.formatConsoleMessage({timestamp:a,message:v.gray(` ${p}`),level:e,showTimestamp:!1}))}break}}else if(!T()){if(console.error(`${o} ${this.environment}.${e.toUpperCase()}: ${s}`),l)console.error(l)}if(!this.shouldLog(e))return;let u=`${o} ${this.environment}.${e.toUpperCase()}: ${c}
418
+ `;if(l)u+=`${l}
419
+ `;if(u=u.replace(this.ANSI_PATTERN,""),this.shouldWriteToFile())await this.writeToFile(u)}progress(e,t=""){let r={update:(a,o)=>{},finish:(a)=>{},interrupt:(a,o)=>{}};if(!this.enabled)return r;let i=30;if(this.activeProgressBar={total:Math.max(1,e||1),current:0,message:t||"",barLength:i,lastRenderedLine:""},this.shouldStyleConsole()&&!T()&&C.stdout.isTTY)this.renderProgressBar(this.activeProgressBar);return{update:(a,o)=>{if(!this.enabled||!this.activeProgressBar)return;if(this.activeProgressBar.current=Math.min(Math.max(0,a),this.activeProgressBar.total),o!==void 0)this.activeProgressBar.message=o;if(this.shouldStyleConsole()&&!T()&&C.stdout.isTTY)this.renderProgressBar(this.activeProgressBar)},finish:(a)=>{if(!this.activeProgressBar)return;this.finishProgressBar(this.activeProgressBar,a)},interrupt:(a,o="info")=>{if(!T()&&C.stdout.isTTY)C.stdout.write(`
420
+ `);if(this[o==="warning"?"warn":o](a),this.activeProgressBar&&this.shouldStyleConsole()&&!T()&&C.stdout.isTTY)this.renderProgressBar(this.activeProgressBar)}}}time(e){let t=performance.now();if(this.shouldStyleConsole()){let r=this.options.showTags!==!1&&this.name?v.gray(this.formatTag(this.name)):"",i=this.formatConsoleTimestamp(new Date);console.error(this.formatConsoleMessage({timestamp:i,icon:this.options.showIcons===!1?"":v.blue("\u25D0"),tag:r,message:`${v.cyan(e)}...`}))}return async(r)=>{if(!this.enabled)return;let i=performance.now(),a=Math.round(i-t),o=`${e} completed in ${a}ms`,s=new Date,l=this.formatConsoleTimestamp(s),n=`${this.formatFileTimestamp(s)} ${this.environment}.INFO: ${o}`;if(r)n+=` ${JSON.stringify(r)}`;if(n+=`
421
+ `,n=n.replace(this.ANSI_PATTERN,""),this.shouldStyleConsole()){let c=this.options.showTags!==!1&&this.name?v.gray(this.formatTag(this.name)):"";console.error(this.formatConsoleMessage({timestamp:l,icon:this.options.showIcons===!1?"":v.green("\u2713"),tag:c,message:`${o}${r?` ${JSON.stringify(r)}`:""}`}))}else if(!T())console.error(n.trim());if(this.shouldWriteToFile())await this.writeToFile(n)}}async debug(e,...t){await this.log("debug",e,...t)}async info(e,...t){await this.log("info",e,...t)}async success(e,...t){await this.log("success",e,...t)}async warn(e,...t){await this.log("warning",e,...t)}async error(e,...t){await this.log("error",e,...t)}validateEncryptionConfig(){if(!this.config.rotation)return!1;if(typeof this.config.rotation==="boolean")return!1;let e=this.config.rotation,{encrypt:t}=e;return!!t}async only(e){if(!this.enabled)return;return await e()}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}extend(e){let t=`${this.name}:${e}`,r=new lt(t,{...this.options,logDirectory:this.config.logDirectory,level:this.config.level,format:this.config.format,rotation:typeof this.config.rotation==="boolean"?void 0:this.config.rotation,timestamp:typeof this.config.timestamp==="boolean"?void 0:this.config.timestamp});return this.subLoggers.add(r),r}createReadStream(){if(T())throw Error("createReadStream is not supported in browser environments");if(!Ye(this.currentLogFile))throw Error(`Log file does not exist: ${this.currentLogFile}`);return Ir(this.currentLogFile,{encoding:"utf8"})}async decrypt(e){if(!this.validateEncryptionConfig())throw Error("Encryption is not configured");let t=this.config.rotation;if(!t.encrypt||typeof t.encrypt==="boolean")throw Error("Invalid encryption configuration");if(!this.currentKeyId||!this.keys.has(this.currentKeyId))throw Error("No valid encryption key available");let r=this.keys.get(this.currentKeyId);try{let i=G.isBuffer(e)?e:G.from(e,"base64"),a=i.subarray(0,16),o=i.subarray(i.length-16),s=i.subarray(16,i.length-16),l=tu("aes-256-gcm",r,a);l.setAuthTag(o);let n=l.update(s),c=l.final(),u=n.length+c.length,f=G.allocUnsafe(u);return n.copy(f,0),c.copy(f,n.length),f.toString("utf8")}catch(i){throw Error(`Decryption failed: ${i instanceof Error?i.message:String(i)}`)}}getLevel(){return this.config.level}getLogDirectory(){return this.config.logDirectory}getFormat(){return this.config.format}getRotationConfig(){return this.config.rotation}isBrowserMode(){return T()}isServerMode(){return!T()}setTestEncryptionKey(e,t){this.currentKeyId=e,this.keys.set(e,t)}getTestCurrentKey(){if(!this.currentKeyId||!this.keys.has(this.currentKeyId))return null;return{id:this.currentKeyId,key:this.keys.get(this.currentKeyId)}}getConfig(){return this.config}async box(e){if(!this.enabled)return;let t=new Date,r=this.formatConsoleTimestamp(t),i=this.formatFileTimestamp(t),{consoleText:a,fileText:o}=this.buildOutputTexts(e);if(this.shouldStyleConsole()){let l=a.split(`
422
+ `),n=Math.max(...l.map((d)=>d.length))+2,c=`\u250C${"\u2500".repeat(n)}\u2510`,u=`\u2514${"\u2500".repeat(n)}\u2518`,f=l.map((d)=>{return this.formatConsoleMessage({timestamp:r,message:v.cyan(d),showTimestamp:!1})});console.error(this.formatConsoleMessage({timestamp:r,message:v.cyan(c),showTimestamp:!1})),f.forEach((d)=>console.error(d)),console.error(this.formatConsoleMessage({timestamp:r,message:v.cyan(u),showTimestamp:!1}))}else if(!T())console.error(`${i} ${this.environment}.INFO: [BOX] ${o}`);let s=`${i} ${this.environment}.INFO: [BOX] ${o}
423
+ `.replace(this.ANSI_PATTERN,"");if(this.shouldWriteToFile())await this.writeToFile(s)}async prompt(e){if(T())return Promise.resolve(!0);return new Promise((t)=>{console.error(`${v.cyan("?")} ${e} (y/n) `);let r=(i)=>{let a=i.toString().trim().toLowerCase();C.stdin.removeListener("data",r);try{if(typeof C.stdin.setRawMode==="function")C.stdin.setRawMode(!1)}catch{}C.stdin.pause(),console.error(""),t(a==="y"||a==="yes")};try{if(typeof C.stdin.setRawMode==="function")C.stdin.setRawMode(!0)}catch{}C.stdin.resume(),C.stdin.once("data",r)})}setFancy(e){this.fancy=e}isFancy(){return this.fancy}pause(){this.enabled=!1}resume(){this.enabled=!0}async start(e,...t){if(!this.enabled)return;let r=e;if(t&&t.length>0){let s=/%([sdijfo%])/g,l=0;if(r=e.replace(s,(n,c)=>{if(c==="%")return"%";if(l>=t.length)return n;let u=t[l++];switch(c){case"s":return String(u);case"d":case"i":return Number(u).toString();case"j":case"o":return JSON.stringify(u,null,2);default:return n}}),l<t.length)r+=` ${t.slice(l).map((n)=>typeof n==="object"?JSON.stringify(n,null,2):String(n)).join(" ")}`}let{consoleText:i,fileText:a}=this.buildOutputTexts(r);if(this.shouldStyleConsole()){let s=this.options.showTags!==!1&&this.name?v.gray(this.formatTag(this.name)):"",l=this.options.showIcons===!1?"":`${v.blue("\u25D0")} `;console.error(`${l}${s} ${v.cyan(i)}`)}let o=`[${new Date().toISOString()}] ${this.environment}.INFO: [START] ${a}
424
+ `.replace(this.ANSI_PATTERN,"");if(this.shouldWriteToFile())await this.writeToFile(o)}renderProgressBar(e,t=!1){if(!this.enabled||!this.shouldStyleConsole()||!C.stdout.isTTY)return;let r=Math.min(100,Math.max(0,Math.round(e.current/e.total*100))),i=Math.round(e.barLength*r/100),a=e.barLength-i,o=v.green("\u2501".repeat(i)),s=v.gray("\u2501".repeat(a)),l=`[${o}${s}]`,n=`${r}%`.padStart(4),c=e.message?` ${e.message}`:"",u=this.options.showIcons===!1?"":t||r===100?v.green("\u2713"):v.blue("\u25B6"),f=this.options.showTags!==!1&&this.name?` ${v.gray(this.formatTag(this.name))}`:"",d=`\r${u}${f} ${l} ${n}${c}`,h=C.stdout.columns||80,y=" ".repeat(Math.max(0,h-d.replace(this.ANSI_PATTERN,"").length));if(e.lastRenderedLine=`${d}${y}`,C.stdout.write(e.lastRenderedLine),t)C.stdout.write(`
425
+ `)}finishProgressBar(e,t){if(!this.enabled||!this.fancy||T()||!C.stdout.isTTY){this.activeProgressBar=null;return}if(e.current<e.total)e.current=e.total;if(t)e.message=t;this.renderProgressBar(e,!0),this.activeProgressBar=null}async clear(e={}){if(T()){console.warn("Log clearing is not supported in browser environments.");return}try{console.warn("Clearing logs...",this.config.logDirectory);let t=await Pe(this.config.logDirectory),r=[];for(let i of t){if(!(e.name?new RegExp(e.name.replace("*",".*")).test(i):i.startsWith(this.name))||!i.endsWith(".log"))continue;let a=ge(this.config.logDirectory,i);if(e.before)try{if((await pe(a)).mtime>=e.before)continue}catch(o){console.error(`Failed to get stats for file ${a}:`,o);continue}r.push(a)}if(r.length===0){console.warn("No log files matched the criteria for clearing.");return}console.warn(`Preparing to delete ${r.length} log file(s)...`);for(let i of r)try{await De(i),console.warn(`Deleted log file: ${i}`)}catch(a){console.error(`Failed to delete log file ${i}:`,a)}console.warn("Log clearing process finished.")}catch(t){console.error("Error during log clearing process:",t)}}}async function ia(e,t={}){let{maxRetries:r=3,retryDelay:i=1000,isRetryable:a=()=>!0,fallback:o}=t,s=Error("Unknown error occurred");for(let l=0;l<=r;l++)try{return await e()}catch(n){if(s=n instanceof Error?n:Error(String(n)),l===r||!a(s))break;if(i>0)await new Promise((c)=>setTimeout(c,i))}if(o!==void 0)return o;throw s instanceof Error?s:Error(`Unknown error: ${String(s)}`)}function aa(e){return e instanceof M}function Zu(e){return e instanceof ct}function Uu(e){if(aa(e))return e.code==="FILE_SYSTEM_ERROR"||e.code==="BROWSER_CONFIG_ERROR";return["ENOENT","EACCES","EMFILE","ENFILE","EBUSY","network","timeout","connection"].some((t)=>e.message.toLowerCase().includes(t.toLowerCase()))}class yt{defaultParsers;constructor(){this.defaultParsers=[{name:"boolean",canParse:(e,t)=>t==="boolean"||["true","false","1","0","yes","no"].includes(e.toLowerCase()),parse:(e)=>{let t=e.toLowerCase();return["true","1","yes"].includes(t)}},{name:"number",canParse:(e,t)=>t==="number"||!Number.isNaN(Number(e))&&!Number.isNaN(Number.parseFloat(e)),parse:(e)=>{let t=Number(e);if(Number.isNaN(t))throw TypeError(`Cannot parse "${e}" as number`);return t}},{name:"array",canParse:(e,t)=>t==="array"||e.startsWith("[")||e.includes(","),parse:(e)=>{try{let t=JSON.parse(e);if(Array.isArray(t))return t}catch{}return e.split(",").map((t)=>t.trim())}},{name:"json",canParse:(e,t)=>t==="object"||(e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]")),parse:(e)=>{try{return JSON.parse(e)}catch(t){throw Error(`Cannot parse "${e}" as JSON: ${t}`)}}}]}async applyEnvironmentVariables(e,t,r={}){let{prefix:i,useCamelCase:a=!0,useBackwardCompatibility:o=!0,customParsers:s={},verbose:l=!1,trackPerformance:n=!0}=r,c=async()=>{if(!e)return{config:t,source:{type:"environment",priority:50,timestamp:new Date}};let u=i||this.generateEnvPrefix(e),f={...t};return this.processObject(f,[],u,{useCamelCase:a,useBackwardCompatibility:o,customParsers:s,verbose:l,configName:e}),{config:f,source:{type:"environment",priority:50,timestamp:new Date}}};if(n)return Te.track("applyEnvironmentVariables",c,{configName:e});return c()}generateEnvPrefix(e){return e.toUpperCase().replace(/-/g,"_")}formatEnvKey(e,t){if(!t)return e.toUpperCase();return e.replace(/([A-Z])/g,"_$1").toUpperCase()}processObject(e,t,r,i){for(let[a,o]of Object.entries(e)){let s=[...t,a],l=s.map((u)=>this.formatEnvKey(u,i.useCamelCase)),n=`${r}_${l.join("_")}`,c=i.useBackwardCompatibility?`${r}_${s.map((u)=>u.toUpperCase()).join("_")}`:null;if(i.verbose);if(typeof o==="object"&&o!==null&&!Array.isArray(o))this.processObject(o,s,r,i);else{let u=Le.env[n]||(c?Le.env[c]:void 0);if(u!==void 0){if(i.verbose){let f=Le.env[n]?n:c}try{e[a]=this.parseEnvironmentValue(u,typeof o,n,i.customParsers,i.configName)}catch(f){if(f instanceof ut)throw f;throw se.envVar(n,u,typeof o,i.configName)}}}}}parseEnvironmentValue(e,t,r,i,a){for(let[o,s]of Object.entries(i))try{return s(e)}catch{continue}for(let o of this.defaultParsers)if(o.canParse(e,t))try{return o.parse(e)}catch{throw se.envVar(r,e,`${t} (via ${o.name} parser)`,a)}return e}getEnvironmentVariables(e){let t={},r=e.toUpperCase();for(let[i,a]of Object.entries(Le.env))if(i.startsWith(r)&&a!==void 0)t[i]=a;return t}validateEnvironmentVariable(e,t,r){let i=[];if(!/^[A-Z_][A-Z0-9_]*$/.test(e))i.push(`Environment variable key "${e}" should only contain uppercase letters, numbers, and underscores`);if(r)try{this.parseEnvironmentValue(e,t,r,{})}catch(a){i.push(`Cannot parse value "${t}" as ${r}: ${a}`)}return{isValid:i.length===0,errors:i}}generateEnvVarDocs(e,t,r={}){let{prefix:i,format:a="text"}=r,o=i||this.generateEnvPrefix(e),s=[];switch(this.extractEnvVarInfo(t,[],o,s),a){case"markdown":return this.formatAsMarkdown(s,e);case"json":return JSON.stringify(s,null,2);default:return this.formatAsText(s,e)}}extractEnvVarInfo(e,t,r,i){for(let[a,o]of Object.entries(e)){let s=[...t,a],l=`${r}_${s.map((n)=>this.formatEnvKey(n,!0)).join("_")}`;if(typeof o==="object"&&o!==null&&!Array.isArray(o))this.extractEnvVarInfo(o,s,r,i);else i.push({key:l,type:Array.isArray(o)?"array":typeof o,description:`Configuration for ${s.join(".")}`,example:this.generateExample(o)})}}generateExample(e){if(Array.isArray(e))return JSON.stringify(e);if(typeof e==="object"&&e!==null)return JSON.stringify(e);return String(e)}formatAsText(e,t){let r=`Environment Variables for ${t}:
426
+
427
+ `;for(let i of e)r+=`${i.key}
428
+ `,r+=` Type: ${i.type}
429
+ `,r+=` Description: ${i.description}
430
+ `,r+=` Example: ${i.example}
431
+
432
+ `;return r}formatAsMarkdown(e,t){let r=`# Environment Variables for ${t}
433
+
434
+ `;r+=`| Variable | Type | Description | Example |
435
+ `,r+=`|----------|------|-------------|----------|
436
+ `;for(let i of e)r+=`| \`${i.key}\` | ${i.type} | ${i.description} | \`${i.example}\` |
437
+ `;return r}}function Qu(e,t){let r=ca("process");if(typeof r>"u"||!r.env)return t;let i=r.env[e];return i!==void 0?i:t}function oa(e,t,r={}){return na(e,t,r,new WeakMap)}function na(e,t,r,i){let{arrayMergeMode:a="replace",skipNullish:o=!1,customMerger:s}=r;if(t===null||t===void 0)return o?e:t;if(s){let l=s(e,t);if(l!==void 0)return l}if(Array.isArray(t)||Array.isArray(e))return sa(e,t,a,i);if(!Z(t)||!Z(e))return t;return Vu(e,t,r,i)}function sa(e,t,r,i){if(Array.isArray(t)&&!Array.isArray(e))return t;if(Array.isArray(e)&&!Array.isArray(t))return t;if(Array.isArray(t)&&Array.isArray(e))switch(r){case"replace":return t;case"concat":return Hu(e,t);case"smart":return Xu(e,t,i);default:return t}return t}function Hu(e,t){let r=[...t];for(let i of e)if(!r.some((a)=>Gt(a,i)))r.push(i);return r}function Xu(e,t,r){if(t.length===0)return e;if(e.length===0)return t;if(Z(t[0])&&Z(e[0]))return Ku(e,t,r);if(t.every((i)=>typeof i==="string")&&e.every((i)=>typeof i==="string")){let i=[...t];for(let a of e)if(!i.includes(a))i.push(a);return i}return t}function Ku(e,t,r){let i=[...t];for(let a of e){if(!Z(a)){i.push(a);continue}let o=["id","name","key","path","type"],s=!1;for(let l of o)if(l in a){if(i.find((n)=>Z(n)&&(l in n)&&n[l]===a[l])){s=!0;break}}if(!s)i.push(a)}return i}function Vu(e,t,r,i){let a=t;if(Z(a)&&i.has(a))return i.get(a);let o={...e};if(Z(a))i.set(a,o);for(let s in a){if(!Object.prototype.hasOwnProperty.call(a,s))continue;let l=a[s],n=o[s];if(r.skipNullish&&(l===null||l===void 0))continue;if(l===null||l===void 0){o[s]=l;continue}if(Z(l)&&Z(n))o[s]=na(n,l,r,i);else if(Array.isArray(l)||Array.isArray(n))o[s]=sa(n,l,r.arrayMergeMode||"smart",i);else o[s]=l}return o}function dr(e,t,r="replace"){return oa(e,t,{arrayMergeMode:r==="replace"?"replace":"smart",skipNullish:!0})}function Gt(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!Gt(e[r],t[r]))return!1;return!0}if(Z(e)&&Z(t)){let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(let a of r){if(!Object.prototype.hasOwnProperty.call(t,a))return!1;if(!Gt(e[a],t[a]))return!1}return!0}return!1}function Z(e){return Boolean(e&&typeof e==="object"&&!Array.isArray(e))}class bt{extensions=[".ts",".js",".mjs",".cjs",".json",".mts",".cts"];async loadFromPath(e,t,r={}){let{arrayStrategy:i="replace",useCache:a=!0,cacheTtl:o,trackPerformance:s=!0,verbose:l=!1}=r;if(a){let c=ve.getWithFileCheck("file",e);if(c){if(l)console.log(`Configuration loaded from cache: ${e}`);return c}}let n=async()=>{if(!We(e))return null;try{let c=`?t=${Date.now()}`,u=await import(e+c),f=u.default||u,d="default"in u,h=Object.keys(u).length>0;if(!d&&!h)throw new je(e,Error("Configuration file is empty and exports nothing"),"unknown");if(typeof f!=="object"||f===null||Array.isArray(f))throw new je(e,Error("Configuration must export a valid object"),"unknown");let y={config:dr(t,f,i),source:{type:"file",path:e,priority:100,timestamp:new Date}};if(a)ve.setWithFileCheck("file",y,e,o);return y}catch(c){throw c instanceof Error?se.configLoad(e,c):se.configLoad(e,Error(String(c)))}};if(s)return Te.track("loadFromPath",n,{path:e});return n()}async tryLoadFromPaths(e,t,r={}){for(let i of e)try{let a=await this.loadFromPath(i,t,r);if(a)return a}catch(a){if(a instanceof Error&&a.name==="ConfigLoadError")throw a;if(r.verbose)console.warn(`Failed to load config from ${i}:`,a)}return null}generateConfigPaths(e,t,r){let i=this.generateNamePatterns(e,r),a=[];for(let o of i)for(let s of this.extensions)a.push(Rt(t,`${o}${s}`));return a}generateNamePatterns(e,t){let r=[];if(r.push("config",".config"),e)r.push(e,`.${e}.config`,`${e}.config`,`.${e}`);if(t){if(r.push(t,`.${t}.config`,`${t}.config`,`.${t}`),e)r.push(`${e}.${t}.config`,`.${e}.${t}.config`)}return r.filter(Boolean)}checkFileAccess(e){return ia(async()=>{return We(e)},{maxRetries:2,retryDelay:100,fallback:!1})}async discoverConfigFiles(e,t,r){let i=[];if(!We(e))return i;if(t||r){let a=this.generateNamePatterns(t||"",r);for(let o of a)for(let s of this.extensions){let l=Rt(e,`${o}${s}`);if(await this.checkFileAccess(l))i.push(l)}}else try{let{readdirSync:a}=await import("fs"),o=a(e);for(let s of o)if(this.looksLikeConfigFile(s)){let l=Rt(e,s);if(await this.checkFileAccess(l))i.push(l)}}catch{return[]}return i}looksLikeConfigFile(e){return[/\.config\.(ts|js|mjs|cjs|json|mts|cts)$/,/^\..*\.(ts|js|mjs|cjs|json|mts|cts)$/,/config\.(ts|js|mjs|cjs|json|mts|cts)$/].some((t)=>t.test(e))}async validateConfigFile(e){let t=[];try{if(!We(e))return t.push("Configuration file does not exist"),t;let r=await import(e),i=r.default||r;if(i===void 0)t.push("Configuration file must export a default value or named exports");else if(typeof i!=="object"||i===null)t.push("Configuration must be an object");else if(Array.isArray(i))t.push("Configuration cannot be an array at the root level");if(e.endsWith(".json"))try{let{readFileSync:a}=await import("fs"),o=a(e,"utf8");JSON.parse(o)}catch(a){t.push(`Invalid JSON syntax: ${a}`)}}catch(r){t.push(`Failed to load configuration file: ${r}`)}return t}async getFileModificationTime(e){try{let{statSync:t}=await import("fs");return t(e).mtime}catch{return null}}async preloadConfigurations(e,t={}){let r=new Map;return await Promise.allSettled(e.map(async(i)=>{try{let a=await this.loadFromPath(i,{},t);if(a)r.set(i,a.config)}catch(a){if(t.verbose)console.warn(`Failed to preload ${i}:`,a)}})),r}}class hr{async validateConfiguration(e,t,r={}){let{stopOnFirstError:i=!1,validateRequired:a=!0,validateTypes:o=!0,customRules:s=[],trackPerformance:l=!0,verbose:n=!1}=r,c=async()=>{let u=[],f=[],d={stopOnFirstError:i,validateRequired:a,validateTypes:o,customRules:s,trackPerformance:l,verbose:n};try{if(typeof t==="string")return await this.validateWithSchemaFile(e,t,d);else if(Array.isArray(t))return this.validateWithRules(e,[...t,...s],d);else return this.validateWithJSONSchema(e,t,d)}catch(h){return u.push({path:"",message:`Validation failed: ${h}`,rule:"system"}),{isValid:!1,errors:u,warnings:f}}};if(l)return await Te.track("validateConfiguration",c);return c()}async validateWithSchemaFile(e,t,r){try{if(!cu(t))throw new ze(t,[{path:"",message:"Schema file does not exist"}]);let i=await import(t),a=i.default||i;if(Array.isArray(a))return this.validateWithRules(e,a,r);else return this.validateWithJSONSchema(e,a,r)}catch(i){throw new ze(t,[{path:"",message:`Failed to load schema: ${i}`}])}}validateWithJSONSchema(e,t,r){let i=[],a=[];return this.validateObjectAgainstSchema(e,t,"",i,a,r),{isValid:i.length===0,errors:i,warnings:a}}validateObjectAgainstSchema(e,t,r,i,a,o){if(o.validateTypes&&t.type){let s=Array.isArray(e)?"array":typeof e,l=Array.isArray(t.type)?t.type:[t.type];if(!l.includes(s)){if(i.push({path:r,message:`Expected type ${l.join(" or ")}, got ${s}`,expected:l.join(" or "),actual:s,rule:"type"}),o.stopOnFirstError)return}}if(t.enum&&!t.enum.includes(e)){if(i.push({path:r,message:`Value must be one of: ${t.enum.join(", ")}`,expected:t.enum.join(", "),actual:e,rule:"enum"}),o.stopOnFirstError)return}if(typeof e==="string"){if(t.minLength!==void 0&&e.length<t.minLength)i.push({path:r,message:`String length must be at least ${t.minLength}`,expected:`>= ${t.minLength}`,actual:e.length,rule:"minLength"});if(t.maxLength!==void 0&&e.length>t.maxLength)i.push({path:r,message:`String length must not exceed ${t.maxLength}`,expected:`<= ${t.maxLength}`,actual:e.length,rule:"maxLength"});if(t.pattern){if(!new RegExp(t.pattern).test(e))i.push({path:r,message:`String does not match pattern ${t.pattern}`,expected:t.pattern,actual:e,rule:"pattern"})}}if(typeof e==="number"){if(t.minimum!==void 0&&e<t.minimum)i.push({path:r,message:`Value must be at least ${t.minimum}`,expected:`>= ${t.minimum}`,actual:e,rule:"minimum"});if(t.maximum!==void 0&&e>t.maximum)i.push({path:r,message:`Value must not exceed ${t.maximum}`,expected:`<= ${t.maximum}`,actual:e,rule:"maximum"})}if(Array.isArray(e)&&t.items)for(let s=0;s<e.length;s++){let l=r?`${r}[${s}]`:`[${s}]`;if(this.validateObjectAgainstSchema(e[s],t.items,l,i,a,o),o.stopOnFirstError&&i.length>0)return}if(e&&typeof e==="object"&&!Array.isArray(e)){let s=e;if(o.validateRequired&&t.required){for(let l of t.required)if(!(l in s)){if(i.push({path:r?`${r}.${l}`:l,message:`Missing required property '${l}'`,expected:"required",rule:"required"}),o.stopOnFirstError)return}}if(t.properties){for(let[l,n]of Object.entries(t.properties))if(l in s){let c=r?`${r}.${l}`:l;if(this.validateObjectAgainstSchema(s[l],n,c,i,a,o),o.stopOnFirstError&&i.length>0)return}}if(t.additionalProperties===!1){let l=new Set(Object.keys(t.properties||{}));for(let n of Object.keys(s))if(!l.has(n))a.push({path:r?`${r}.${n}`:n,message:`Additional property '${n}' is not allowed`,rule:"additionalProperties"})}}}validateWithRules(e,t,r){let i=[],a=[];for(let o of t)try{let s=this.getValueByPath(e,o.path),l=this.validateWithRule(s,o,o.path);if(i.push(...l),r.stopOnFirstError&&i.length>0)break}catch(s){i.push({path:o.path,message:`Rule validation failed: ${s}`,rule:"system"})}return{isValid:i.length===0,errors:i,warnings:a}}validateWithRule(e,t,r){let i=[];if(t.required&&(e===void 0||e===null))return i.push({path:r,message:t.message||`Property '${r}' is required`,expected:"required",rule:"required"}),i;if(e===void 0||e===null)return i;if(t.type){let a=Array.isArray(e)?"array":typeof e;if(a!==t.type)i.push({path:r,message:t.message||`Expected type ${t.type}, got ${a}`,expected:t.type,actual:a,rule:"type"})}if(t.min!==void 0){let a=Array.isArray(e)?e.length:typeof e==="string"?e.length:typeof e==="number"?e:0;if(a<t.min)i.push({path:r,message:t.message||`Value must be at least ${t.min}`,expected:`>= ${t.min}`,actual:a,rule:"min"})}if(t.max!==void 0){let a=Array.isArray(e)?e.length:typeof e==="string"?e.length:typeof e==="number"?e:0;if(a>t.max)i.push({path:r,message:t.message||`Value must not exceed ${t.max}`,expected:`<= ${t.max}`,actual:a,rule:"max"})}if(t.pattern&&typeof e==="string"){if(!t.pattern.test(e))i.push({path:r,message:t.message||`Value does not match pattern ${t.pattern}`,expected:t.pattern.toString(),actual:e,rule:"pattern"})}if(t.enum&&!t.enum.includes(e))i.push({path:r,message:t.message||`Value must be one of: ${t.enum.join(", ")}`,expected:t.enum.join(", "),actual:e,rule:"enum"});if(t.validator){let a=t.validator(e);if(a)i.push({path:r,message:t.message||a,rule:"custom"})}return i}getValueByPath(e,t){if(!t)return e;let r=t.split("."),i=e;for(let a of r)if(i&&typeof i==="object"&&a in i)i=i[a];else return;return i}generateRulesFromInterface(e){let t=[],r=e.matchAll(/(\w+)(\?)?:\s*(\w+)/g);for(let i of r){let[,a,o,s]=i;t.push({path:a,required:!o,type:this.mapTypeScriptType(s)})}return t}mapTypeScriptType(e){switch(e.toLowerCase()){case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"array":return"array";case"object":return"object";default:return"object"}}static createCommonRules(){return{server:[{path:"port",required:!0,type:"number",min:1,max:65535},{path:"host",required:!0,type:"string",min:1},{path:"ssl",type:"boolean"}],database:[{path:"url",required:!0,type:"string",min:1},{path:"pool",type:"number",min:1,max:100},{path:"timeout",type:"number",min:0}],api:[{path:"baseUrl",required:!0,type:"string",pattern:pa},{path:"timeout",type:"number",min:0},{path:"retries",type:"number",min:0,max:10}]}}}class pr{fileLoader=new bt;envProcessor=new yt;validator=new hr;async loadConfig(e){let t=Date.now(),{cache:r,performance:i,schema:a,validate:o,...s}=e;try{if(r?.enabled){let n=this.checkCache(s.name||"",s);if(n)return n}let l;try{l=await this.loadConfigurationStrategies(s,!0,r)}catch(n){let c=s.__strictErrorHandling;if(n instanceof Error&&n.name==="ConfigNotFoundError"){if(c)throw n;l={...await this.applyEnvironmentVariables(s.name||"",s.defaultConfig,s.checkEnv!==!1,s.verbose||!1),warnings:[`No configuration file found for "${s.name||"config"}", using defaults with environment variables`]}}else if(n instanceof Error&&n.name==="ConfigLoadError"){let u=n.message.includes("EACCES")||n.message.includes("EPERM")||n.message.includes("permission denied"),f=!u&&(n.message.includes("syntax")||n.message.includes("Expected")||n.message.includes("Unexpected")||n.message.includes("BuildMessage")||n.message.includes("errors building")),d=n.message.includes("Configuration must export a valid object")||n.message.includes("Configuration file is empty and exports nothing");if(c&&(d||u))throw n;if(f&&(!c||!d))l={...await this.applyEnvironmentVariables(s.name||"",s.defaultConfig,s.checkEnv!==!1,s.verbose||!1),warnings:["Configuration file has syntax errors, using defaults with environment variables"]};else if(!c)l={...await this.applyEnvironmentVariables(s.name||"",s.defaultConfig,s.checkEnv!==!1,s.verbose||!1),warnings:[`Configuration loading error, using defaults: ${n.message}`]};else throw n}else l={...await this.applyEnvironmentVariables(s.name||"",s.defaultConfig,s.checkEnv!==!1,s.verbose||!1),warnings:[`Configuration loading failed, using defaults: ${n instanceof Error?n.message:String(n)}`]}}if(a||o)await this.validateConfiguration(l.config,a,o,s.name);if(r?.enabled&&l)this.cacheResult(s.name||"",l,r,s);if(i?.enabled){let n={operation:"loadConfig",duration:Date.now()-t,configName:s.name,timestamp:new Date};if(i.onMetrics)i.onMetrics(n);if(i.slowThreshold&&n.duration>i.slowThreshold)Q.warn(`Slow configuration loading detected: ${n.duration}ms for ${s.name}`);l.metrics=n}return l}catch(l){let n=Date.now()-t;throw Q.error(`Configuration loading failed after ${n}ms:`,[l instanceof Error?l:Error(String(l))]),l}}async loadConfigurationStrategies(e,t=!1,r){let{name:i="",alias:a,cwd:o,configDir:s,defaultConfig:l,checkEnv:n=!0,arrayStrategy:c="replace",verbose:u=!1}=e,f=o||le.cwd(),d=[],h=await this.loadLocalConfiguration(i,a,f,s,l,c,u,n,r);if(h)return d.push(...this.getLocalSearchPaths(i,a,f,s)),this.finalizeResult(h,d,n,i,u);let y=await this.loadHomeConfiguration(i,a,l,c,u,n);if(y)return d.push(...this.getHomeSearchPaths(i,a)),this.finalizeResult(y,d,n,i,u);let p=await this.loadPackageJsonConfiguration(i,a,f,l,c,u,n);if(p)return d.push(L(f,"package.json")),this.finalizeResult(p,d,n,i,u);if(d.push(...this.getAllSearchPaths(i,a,f,s)),t)throw se.configNotFound(i,d,a);return{...await this.applyEnvironmentVariables(i,l,n,u),warnings:[`No configuration file found for "${i}"${a?` or alias "${a}"`:""}, using defaults with environment variables`]}}async loadLocalConfiguration(e,t,r,i,a,o,s,l,n){let c=l?Ae(e,a,s):a,u=this.getLocalDirectories(r,i);for(let f of u){if(s)Q.info(`Searching for configuration in: ${f}`);let d=this.fileLoader.generateConfigPaths(e,f,t),h=await this.fileLoader.tryLoadFromPaths(d,c,{arrayStrategy:o,verbose:s,cacheTtl:n?.ttl,useCache:!n?.ttl||n.ttl>100});if(h){if(s)Q.success(`Configuration loaded from: ${h.source.path}`);return h}}return null}async loadHomeConfiguration(e,t,r,i,a,o){if(!e)return null;let s=o?Ae(e,r,a):r,l=[L(ue(),".config",e),L(ue(),".config"),ue()];for(let n of l){if(a)Q.info(`Checking home directory: ${n}`);let c=this.fileLoader.generateConfigPaths(e,n,t),u=await this.fileLoader.tryLoadFromPaths(c,s,{arrayStrategy:i,verbose:a});if(u){if(a)Q.success(`Configuration loaded from home directory: ${u.source.path}`);return u}}return null}async loadPackageJsonConfiguration(e,t,r,i,a,o,s){let l=s?Ae(e,i,o):i;try{let n=L(r,"package.json");if(!Kt(n))return null;let c=await import(n),u=c[e],f=e;if(!u&&t)u=c[t],f=t;if(u&&typeof u==="object"&&!Array.isArray(u)){if(o)Q.success(`Configuration loaded from package.json: ${f}`);return{config:dr(l,u,a),source:{type:"package.json",path:n,priority:30,timestamp:new Date}}}}catch(n){if(o)Q.warn("Failed to load package.json:",[n instanceof Error?n:Error(String(n))])}return null}async applyEnvironmentVariables(e,t,r,i){if(!r||!e||typeof t!=="object"||t===null||Array.isArray(t))return{config:t,source:{type:"default",priority:10,timestamp:new Date}};return{config:Ae(e,t,i),source:{type:"environment",priority:20,timestamp:new Date}}}async finalizeResult(e,t,r,i,a){return{config:e.config,source:e.source,path:e.source.path}}async validateConfiguration(e,t,r,i){let a=[];if(r){let o=r(e);if(o)a.push(...o)}if(t){let o=await this.validator.validateConfiguration(e,t);if(!o.isValid)a.push(...o.errors.map((s)=>s.path?`${s.path}: ${s.message}`:s.message))}if(a.length>0)throw se.configValidation(i||"unknown",a,i)}checkCache(e,t){let r=this.generateCacheKey(e,t);return ve.get(r)||null}cacheResult(e,t,r,i){let a=this.generateCacheKey(e,i);ve.set(a,t,void 0,r.ttl)}generateCacheKey(e,t){let r=[e];if(t.alias)r.push(`alias:${t.alias}`);if(t.cwd)r.push(`cwd:${t.cwd}`);if(t.configDir)r.push(`configDir:${t.configDir}`);if("checkEnv"in t)r.push(`checkEnv:${t.checkEnv}`);return r.join("|")}getLocalDirectories(e,t){return Array.from(new Set([e,L(e,"config"),L(e,".config"),t?L(e,t):void 0].filter(Boolean)))}getAllSearchPaths(e,t,r,i){let a=[];return a.push(...this.getLocalSearchPaths(e,t,r,i)),a.push(...this.getHomeSearchPaths(e,t)),a.push(L(r,"package.json")),a}getLocalSearchPaths(e,t,r,i){let a=this.getLocalDirectories(r,i),o=[];for(let s of a)o.push(...this.fileLoader.generateConfigPaths(e,s,t));return o}getHomeSearchPaths(e,t){if(!e)return[];let r=[L(ue(),".config",e),L(ue(),".config"),ue()],i=[];for(let a of r)i.push(...this.fileLoader.generateConfigPaths(e,a,t));return i}async loadConfigWithResult(e){return this.loadConfig(e)}}function ri(e){let t=!(e.message.includes("EACCES")||e.message.includes("EPERM")||e.message.includes("permission denied"))&&(e.message.includes("syntax")||e.message.includes("Expected")||e.message.includes("Unexpected")||e.message.includes("BuildMessage")),r=e.message.includes("Configuration must export a valid object")||e.message.includes("Configuration file is empty and exports nothing");return t||r}async function Gu(e){return re.loadConfig({...e,__strictErrorHandling:!0})}async function la(e){let t="defaultConfig"in e&&e.defaultConfig!==void 0?e.defaultConfig:{},r="cache"in e||"performance"in e||"schema"in e||"validate"in e;try{let i;if(r)i=await re.loadConfig(e);else i=await re.loadConfig({...e,defaultConfig:t,cache:{enabled:!0},performance:{enabled:!1}});return i?.config??t}catch(i){let a=i instanceof Error?i.name:"UnknownError",o=i instanceof Error?i.message:String(i);if(!(a==="ConfigNotFoundError"||a==="ConfigLoadError"||a==="ConfigValidationError"||o.includes("config"))&&e.verbose)Q.warn("Unexpected error loading config, using defaults:",[i instanceof Error?i:Error(String(i))]);let s=r?{...e,defaultConfig:t}:{...e,defaultConfig:t,cache:{enabled:!0},performance:{enabled:!1}};if("checkEnv"in e?e.checkEnv!==!1:!0)return(await re.applyEnvironmentVariables(s.name||"",t,!0,s.verbose||!1))?.config??t;return t}}async function _u(e={defaultConfig:{}}){if(typeof e==="string"){let{cwd:t}=await import("process");try{return(await re.loadConfig({name:e,cwd:t(),generatedDir:"./generated",configDir:"./config",defaultConfig:{},checkEnv:!0,arrayStrategy:"replace"})).config}catch(r){if(r instanceof Error&&(r.name==="ConfigNotFoundError"||r.name==="ConfigLoadError"&&ri(r)))return(await re.applyEnvironmentVariables(e,{},!0,!1)).config;throw r}}try{return(await re.loadConfig({...e,cwd:e.cwd||le.cwd(),cache:{enabled:!0},performance:{enabled:!1}})).config}catch(t){if(t instanceof Error&&(t.name==="ConfigNotFoundError"||t.name==="ConfigLoadError"&&ri(t)))return(await re.applyEnvironmentVariables(e.name||"",e.defaultConfig||{},e.checkEnv!==!1,e.verbose||!1)).config;throw t}}async function Ju(e,t,r="replace"){let i=new bt;try{let a=await i.loadFromPath(e,t,{arrayStrategy:r,useCache:!1,trackPerformance:!1});return a?a.config:null}catch{return null}}function Ae(e,t,r=!1){let i=new yt,a=e.toUpperCase().replace(/[^A-Z0-9]/g,"_");function o(s,l=[]){let n={...s};for(let[c,u]of Object.entries(s)){let f=[...l,c],d=[`${a}_${f.join("_").toUpperCase()}`,`${a}_${f.map((p)=>p.toUpperCase()).join("")}`,`${a}_${f.map((p)=>p.replace(/([A-Z])/g,"_$1").toUpperCase()).join("")}`],h,y;for(let p of d)if(h=le.env[p],h!==void 0){y=p;break}if(h!==void 0&&y)if(typeof u==="boolean")n[c]=["true","1","yes"].includes(h.toLowerCase());else if(typeof u==="number"){let p=Number(h);if(!Number.isNaN(p))n[c]=p}else if(Array.isArray(u))try{n[c]=JSON.parse(h)}catch{n[c]=h.split(",").map((p)=>p.trim())}else n[c]=h;else if(u&&typeof u==="object"&&!Array.isArray(u))n[c]=o(u,f)}return n}return o(t)}function $u(e){let t=L(le.cwd(),e.configDir),r=L(le.cwd(),e.generatedDir),i=L(r,"config-types.ts");if(!Kt(Rr(i)))Mc(Rr(i),{recursive:!0,mode:511});let a=Kt(t)?qc(t).map((s)=>s.replace(/\.(ts|js|mjs|cjs|mts|cts|json)$/,"")).sort():[],o=`// Generated by bunfig v${zf}
438
+ export type ConfigNames = ${a.length?`'${a.join("' | '")}'`:"string"}
439
+ `;Ic(i,o,{mode:438})}function ef(e){let t=null,r=null,i=()=>{if(!r)r=la(e).then((o)=>{return t=o,o},(o)=>{let s="defaultConfig"in e?e.defaultConfig:{};if(t=s,"verbose"in e&&e.verbose)Q.warn("Config loading failed, using defaults:",[o instanceof Error?o:Error(String(o))]);return s});return r},a="defaultConfig"in e?e.defaultConfig:{};return t=a,i(),new Proxy({},{get(o,s){if(t)return t[s];let l=a[s];return i(),l},has(o,s){return s in(t||a)},ownKeys(){return Object.keys(t||a)},getOwnPropertyDescriptor(o,s){return Object.getOwnPropertyDescriptor(t||a,s)},set(o,s,l){if(!t)t={...a};return t[s]=l,!0}})}function tf(e){let t=Kr(du.cwd(),e?.configDir||"./config");function r(){if(!uu(t))return[];let a=new Set([".ts",".js",".mjs",".cjs",".mts",".cts",".json"]),o=[".ts",".mts",".cts",".js",".mjs",".cjs",".json"],s=fu(t).filter((n)=>a.has(Bt(n))).map((n)=>({base:n.replace(/\.(?:ts|js|mjs|cjs|mts|cts|json)$/i,""),file:n})),l=new Map;for(let{base:n,file:c}of s){let u=Bt(c).toLowerCase(),f=l.get(n);if(!f){l.set(n,c);continue}let d=Bt(f).toLowerCase();if(o.indexOf(u)<o.indexOf(d))l.set(n,c)}return Array.from(l.entries()).map(([n,c])=>({base:n,file:c})).sort((n,c)=>n.base.localeCompare(c.base))}function i(){let a=r(),o=a.map((n)=>n.base),s=o.length?o.map((n)=>`'${n}'`).join(" | "):"string",l=a.length?`{
440
+ ${a.map((n)=>{let c=Kr(t,n.file).replace(/\\/g,"/");return` '${n.base}': typeof import('${c}').default`}).join(`,
441
+ `)}
442
+ }`:"Record<string, any>";return`export type ConfigNames = ${s}
443
+ export type ConfigByName = ${l}
444
+ export type Config<N extends ConfigNames> = N extends keyof ConfigByName ? ConfigByName[N] : unknown
445
+ export type ConfigOf = Config
446
+ `}return{name:"bunfig-plugin",setup(a){a.onResolve({filter:/^virtual:bunfig-types$/},(o)=>{return{path:o.path,namespace:"bunfig-virtual"}}),a.onLoad({filter:/^virtual:bunfig-types$/,namespace:"bunfig-virtual"},()=>{return{contents:i(),loader:"ts"}})}}}var ca,ve,Te,ua,rf,af,ii,Ke,_t,Y,S,of,ai,nf,oi,sf,lf,Wt,cf,ni,si,Mt,uf,ff,df,hf,Ve,fa,pf,P,gf,mf,li,Ge,Jt,F,v,yf,ci,bf,ui,wf,vf,qt,xf,fi,di,kf,It,Cf,Ef,Af,Sf,Nf,_e,da,jf,zf="0.15.6",M,ct,je,$t,er,ut,tr,rr,ze,ir,ar,se,ha,pa,Q,re,ga,ma,Tf=zu(async()=>{ca=import.meta.require,ve=new lr,Te=new cr,ua={createKey:Tu,isEquivalent:Fu,estimateMemoryUsage:Ou},rf=rt(Vt.cwd(),"config"),af=rt(Vt.cwd(),"src/generated"),ii=tt.env.CLARITY_LOG_DIR||Qc(Yu(),"logs"),Ke={level:"info",defaultName:"clarity",timestamp:!0,colors:!0,format:"text",maxLogSize:10485760,logDatePattern:"YYYY-MM-DD",logDirectory:ii,rotation:{frequency:"daily",maxSize:10485760,maxFiles:5,compress:!1,rotateHour:0,rotateMinute:0,rotateDayOfWeek:0,rotateDayOfMonth:1,encrypt:!1},verbose:!1},_t=await Pu(),Y={red:(e)=>`\x1B[31m${e}\x1B[0m`,green:(e)=>`\x1B[32m${e}\x1B[0m`,yellow:(e)=>`\x1B[33m${e}\x1B[0m`,blue:(e)=>`\x1B[34m${e}\x1B[0m`,magenta:(e)=>`\x1B[35m${e}\x1B[0m`,cyan:(e)=>`\x1B[36m${e}\x1B[0m`,white:(e)=>`\x1B[37m${e}\x1B[0m`,gray:(e)=>`\x1B[90m${e}\x1B[0m`,bgRed:(e)=>`\x1B[41m${e}\x1B[0m`,bgYellow:(e)=>`\x1B[43m${e}\x1B[0m`,bold:(e)=>`\x1B[1m${e}\x1B[0m`,dim:(e)=>`\x1B[2m${e}\x1B[0m`,italic:(e)=>`\x1B[3m${e}\x1B[0m`,underline:(e)=>`\x1B[4m${e}\x1B[0m`,reset:"\x1B[0m"},S=Y,of=Y.red,ai=Y.green,nf=Y.yellow,oi=Y.blue,sf=Y.magenta,lf=Y.cyan,Wt=Y.white,cf=Y.gray,ni=Y.bgRed,si=Y.bgYellow,Mt=Y.bold,uf=Y.dim,ff=Y.italic,df=Y.underline,hf=Y.reset,Ve={activationLevel:"error",bufferSize:50,flushOnDeactivation:!0,stopBuffering:!1},fa={debug:"\uD83D\uDD0D",info:oi("\u2139"),success:ai("\u2713"),warning:si(Wt(Mt(" WARN "))),error:ni(Wt(Mt(" ERROR ")))},pf=new nt("stacks"),P=new nt("bunfig",{showTags:!0}),gf=D(Ne.cwd(),"config"),mf=D(Ne.cwd(),"src/generated"),li=et.env.CLARITY_LOG_DIR||Zc(Mu(),"logs"),Ge={level:"info",defaultName:"clarity",timestamp:!0,colors:!0,format:"text",maxLogSize:10485760,logDatePattern:"YYYY-MM-DD",logDirectory:li,rotation:{frequency:"daily",maxSize:10485760,maxFiles:5,compress:!1,rotateHour:0,rotateMinute:0,rotateDayOfWeek:0,rotateDayOfMonth:1,encrypt:!1},verbose:!1,writeToFile:!1},Jt=await qu(),F={red:(e)=>`\x1B[31m${e}\x1B[0m`,green:(e)=>`\x1B[32m${e}\x1B[0m`,yellow:(e)=>`\x1B[33m${e}\x1B[0m`,blue:(e)=>`\x1B[34m${e}\x1B[0m`,magenta:(e)=>`\x1B[35m${e}\x1B[0m`,cyan:(e)=>`\x1B[36m${e}\x1B[0m`,white:(e)=>`\x1B[37m${e}\x1B[0m`,gray:(e)=>`\x1B[90m${e}\x1B[0m`,bgRed:(e)=>`\x1B[41m${e}\x1B[0m`,bgYellow:(e)=>`\x1B[43m${e}\x1B[0m`,bgGray:(e)=>`\x1B[100m${e}\x1B[0m`,bold:(e)=>`\x1B[1m${e}\x1B[0m`,dim:(e)=>`\x1B[2m${e}\x1B[0m`,italic:(e)=>`\x1B[3m${e}\x1B[0m`,underline:(e)=>`\x1B[4m${e}\x1B[0m`,strikethrough:(e)=>`\x1B[9m${e}\x1B[0m`,reset:"\x1B[0m"},v=F,yf=F.red,ci=F.green,bf=F.yellow,ui=F.blue,wf=F.magenta,vf=F.cyan,qt=F.white,xf=F.gray,fi=F.bgRed,di=F.bgYellow,kf=F.bgGray,It=F.bold,Cf=F.dim,Ef=F.italic,Af=F.underline,Sf=F.strikethrough,Nf=F.reset,_e={activationLevel:"error",bufferSize:50,flushOnDeactivation:!0,stopBuffering:!1},da={debug:"\uD83D\uDD0D",info:ui("\u2139"),success:ci("\u2713"),warning:di(qt(It(" WARN "))),error:fi(qt(It(" ERROR ")))},jf=new lt("stacks"),M=class extends Error{timestamp;context;constructor(e,t={}){super(e);if(this.name=this.constructor.name,this.timestamp=new Date,this.context=t,Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}toJSON(){return{name:this.name,code:this.code,message:this.message,timestamp:this.timestamp.toISOString(),context:this.context,stack:this.stack}}toString(){let e=Object.keys(this.context).length>0?` (${Object.entries(this.context).map(([t,r])=>`${t}: ${r}`).join(", ")})`:"";return`${this.name} [${this.code}]: ${this.message}${e}`}},ct=class extends M{code="CONFIG_NOT_FOUND";constructor(e,t,r){let i=r?` or alias "${r}"`:"";super(`Configuration "${e}"${i} not found`,{configName:e,alias:r,searchPaths:t,searchPathCount:t.length})}},je=class extends M{code="CONFIG_LOAD_ERROR";constructor(e,t,r){super(`Failed to load configuration from "${e}": ${t.message}`,{configPath:e,configName:r,originalError:t.name,originalMessage:t.message});this.cause=t}},$t=class extends M{code="CONFIG_VALIDATION_ERROR";constructor(e,t,r){super(`Configuration validation failed for "${e}"`,{configPath:e,configName:r,validationErrors:t,errorCount:t.length})}},er=class extends M{code="CONFIG_MERGE_ERROR";constructor(e,t,r,i){super(`Failed to merge configuration from "${e}" with "${t}": ${r.message}`,{sourcePath:e,targetPath:t,configName:i,originalError:r.name,originalMessage:r.message});this.cause=r}},ut=class extends M{code="ENV_VAR_ERROR";constructor(e,t,r,i){super(`Failed to parse environment variable "${e}" with value "${t}" as ${r}`,{envKey:e,envValue:t,expectedType:r,configName:i})}},tr=class extends M{code="FILE_SYSTEM_ERROR";constructor(e,t,r){super(`File system ${e} failed for "${t}": ${r.message}`,{operation:e,path:t,originalError:r.name,originalMessage:r.message});this.cause=r}},rr=class extends M{code="TYPE_GENERATION_ERROR";constructor(e,t,r){super(`Failed to generate types from "${e}" to "${t}": ${r.message}`,{configDir:e,outputPath:t,originalError:r.name,originalMessage:r.message});this.cause=r}},ze=class extends M{code="SCHEMA_VALIDATION_ERROR";constructor(e,t,r){super(`Schema validation failed${r?` for config "${r}"`:""}`,{schemaPath:e,configName:r,validationErrors:t,errorCount:t.length})}},ir=class extends M{code="BROWSER_CONFIG_ERROR";constructor(e,t,r,i){super(`Failed to fetch configuration from "${e}": ${t} ${r}`,{endpoint:e,status:t,statusText:r,configName:i})}},ar=class extends M{code="PLUGIN_ERROR";constructor(e,t,r){super(`Plugin "${e}" failed during ${t}: ${r.message}`,{pluginName:e,operation:t,originalError:r.name,originalMessage:r.message});this.cause=r}},se={configNotFound(e,t,r){return new ct(e,t,r)},configLoad(e,t,r){return new je(e,t,r)},configValidation(e,t,r){return new $t(e,t,r)},configMerge(e,t,r,i){return new er(e,t,r,i)},envVar(e,t,r,i){return new ut(e,t,r,i)},fileSystem(e,t,r){return new tr(e,t,r)},typeGeneration(e,t,r){return new rr(e,t,r)},schemaValidation(e,t,r){return new ze(e,t,r)},browserConfig(e,t,r,i){return new ir(e,t,r,i)},plugin(e,t,r){return new ar(e,t,r)}},ha={replace:"replace",concat:"concat",smart:"smart"},pa=/^https?:\/\//,Q=new lt("bunfig",{showTags:!0}),re=new pr,ga=L(le.cwd(),"config"),ma=L(le.cwd(),"src/generated")});function Ff(e,t={}){let r=it.cwd();while(r.includes("storage"))r=Vr(r,"..");let i=Vr(r,e||"");if(t?.relative)return pu(it.cwd(),i);return i}var Of=it.env.CLARITY_LOG_DIR||hu(Ff(),"logs"),ya={level:"info",defaultName:"clarity",timestamp:!0,colors:!0,format:"text",maxLogSize:10485760,logDatePattern:"YYYY-MM-DD",logDirectory:Of,rotation:{frequency:"daily",maxSize:10485760,maxFiles:5,compress:!1,rotateHour:0,rotateMinute:0,rotateDayOfWeek:0,rotateDayOfMonth:1,encrypt:!1},verbose:!1,writeToFile:!1},ft={...ya},wh=(async()=>{try{let{loadConfig:e}=await Tf().then(()=>ea),t=await e({name:"clarity",alias:"logging",defaultConfig:ya,cwd:it.cwd()});if(t)Object.assign(ft,t)}catch{}return ft})();function O(){if(ee.env.NODE_ENV==="test"||ee.env.BUN_ENV==="test")return!1;return typeof window<"u"}async function Rf(){if(ee.env.NODE_ENV==="test"||ee.env.BUN_ENV==="test")return!0;if(typeof navigator<"u"&&navigator.product==="ReactNative")return!0;if(typeof ee<"u"){let e=ee.type;if(e==="renderer"||e==="worker")return!1;return!!(ee.versions&&(ee.versions.node||ee.versions.bun))}return!1}class ba{async format(e){let t=await Rf(),r=await this.getMetadata(t);return JSON.stringify({timestamp:e.timestamp.toISOString(),level:e.level,name:e.name,message:e.message,metadata:r})}async getMetadata(e){if(e){let{hostname:t}=await import("os");return{pid:we.pid,hostname:t(),environment:we.env.NODE_ENV||"development",platform:we.platform,version:we.version}}return{userAgent:navigator.userAgent,hostname:window.location.hostname||"browser",environment:we.env.NODE_ENV||we.env.BUN_ENV||"development",viewport:{width:window.innerWidth,height:window.innerHeight},language:navigator.language}}}var R={red:(e)=>`\x1B[31m${e}\x1B[0m`,green:(e)=>`\x1B[32m${e}\x1B[0m`,yellow:(e)=>`\x1B[33m${e}\x1B[0m`,blue:(e)=>`\x1B[34m${e}\x1B[0m`,magenta:(e)=>`\x1B[35m${e}\x1B[0m`,cyan:(e)=>`\x1B[36m${e}\x1B[0m`,white:(e)=>`\x1B[37m${e}\x1B[0m`,gray:(e)=>`\x1B[90m${e}\x1B[0m`,bgRed:(e)=>`\x1B[41m${e}\x1B[0m`,bgYellow:(e)=>`\x1B[43m${e}\x1B[0m`,bgGray:(e)=>`\x1B[100m${e}\x1B[0m`,bold:(e)=>`\x1B[1m${e}\x1B[0m`,dim:(e)=>`\x1B[2m${e}\x1B[0m`,italic:(e)=>`\x1B[3m${e}\x1B[0m`,underline:(e)=>`\x1B[4m${e}\x1B[0m`,strikethrough:(e)=>`\x1B[9m${e}\x1B[0m`,reset:"\x1B[0m"},x=R,vh=R.red,Bf=R.green,xh=R.yellow,Yf=R.blue,kh=R.magenta,Ch=R.cyan,hi=R.white,Eh=R.gray,Pf=R.bgRed,Df=R.bgYellow,Ah=R.bgGray,pi=R.bold,Sh=R.dim,Nh=R.italic,jh=R.underline,zh=R.strikethrough,Th=R.reset,Zt={activationLevel:"error",bufferSize:50,flushOnDeactivation:!0,stopBuffering:!1},Lf={debug:"\uD83D\uDD0D",info:Yf("\u2139"),success:Bf("\u2713"),warning:Df(hi(pi(" WARN "))),error:Pf(hi(pi(" ERROR ")))};class wt{name;fileLocks=new Map;currentKeyId=null;keys=new Map;fingersCrossedConfig;fingersCrossedActive=!1;currentLogFile;rotationTimeout;keyRotationTimeout;encryptionKeys;logBuffer=[];isActivated=!1;pendingOperations=[];enabled;fancy;tagFormat;timestampPosition;environment;config;options;formatter;timers=new Set;subLoggers=new Set;fingersCrossedBuffer=[];ANSI_PATTERN=/\u001B\[.*?m/g;activeProgressBar=null;constructor(e,t={}){this.name=e,this.config={...ft},this.options=this.normalizeOptions(t),this.formatter=this.options.formatter||new ba,this.enabled=t.enabled??!0,this.fancy=t.fancy??!0,this.tagFormat=t.tagFormat??{prefix:"[",suffix:"]"},this.timestampPosition=t.timestampPosition??"right",this.environment=t.environment??E.env.APP_ENV??"local",this.fingersCrossedConfig=this.initializeFingersCrossedConfig(t);let r={...t},i=t.timestamp!==void 0;if(i)delete r.timestamp;if(this.config={...this.config,...r,timestamp:i||this.config.timestamp,level:this.options.level??"info"},this.currentLogFile=this.generateLogFilename(),this.encryptionKeys=new Map,this.validateEncryptionConfig()){this.setupRotation();let a=this.generateKeyId(),o=this.generateKey();this.currentKeyId=a,this.keys.set(a,o),this.encryptionKeys.set(a,{key:o,createdAt:new Date}),this.setupKeyRotation()}}shouldActivateFingersCrossed(e){if(!this.fingersCrossedConfig)return!1;let t={debug:0,info:1,success:2,warning:3,error:4},r=this.fingersCrossedConfig.activationLevel??"error";return t[e]>=t[r]}initializeFingersCrossedConfig(e){if(!e.fingersCrossedEnabled&&e.fingersCrossed)return{...Zt,...e.fingersCrossed};if(!e.fingersCrossedEnabled)return null;if(!e.fingersCrossed)return{...Zt};return{...Zt,...e.fingersCrossed}}normalizeOptions(e){let t={format:"json",level:"info",logDirectory:ft.logDirectory,rotation:void 0,timestamp:void 0,fingersCrossed:{},enabled:!0,showTags:!1,showIcons:!0,formatter:void 0},r={...t,...Object.fromEntries(Object.entries(e).filter(([,i])=>i!==void 0))};if(!r.level||!["debug","info","success","warning","error"].includes(r.level))r.level=t.level;return r}shouldWriteToFile(){return!O()&&this.config.writeToFile===!0}async writeToFile(e){let t=(async()=>{let i,a=0,o=3,s=1000;while(a<o)try{try{try{await wu(this.config.logDirectory,$r.F_OK|$r.W_OK)}catch(n){if(n instanceof Error&&"code"in n)if(n.code==="ENOENT")await vu(this.config.logDirectory,{recursive:!0,mode:493});else if(n.code==="EACCES")throw Error(`No write permission for log directory: ${this.config.logDirectory}`);else throw n;else throw n}}catch(n){throw console.error("Debug: [writeToFile] Failed to create log directory:",n),n}let l=this.validateEncryptionConfig()?(await this.encrypt(e)).encrypted:_.from(e);try{if(!Me(this.currentLogFile))await Dt(this.currentLogFile,"",{mode:420});if(i=Jr(this.currentLogFile,"a",420),bu(i,l,{flag:"a"}),_r(i),i!==void 0)Pt(i),i=void 0;if((await ye(this.currentLogFile)).size===0){if(await Dt(this.currentLogFile,l,{flag:"w",mode:420}),(await ye(this.currentLogFile)).size===0)throw Error("File exists but is empty after retry write")}return}catch(n){let c=n;if(c.code&&["ENETDOWN","ENETUNREACH","ENOTFOUND","ETIMEDOUT"].includes(c.code)){if(a<o-1){let u=typeof c.message==="string"?c.message:"Unknown error";console.error(`Network error during write attempt ${a+1}/${o}:`,u);let f=s*2**a;await new Promise((d)=>setTimeout(d,f)),a++;continue}}if(c?.code&&["ENOSPC","EDQUOT"].includes(c.code))throw Error(`Disk quota exceeded or no space left on device: ${c.message}`);throw console.error("Debug: [writeToFile] Error writing to file:",c),c}finally{if(i!==void 0)try{Pt(i)}catch(n){console.error("Debug: [writeToFile] Error closing file descriptor:",n)}}}catch(l){if(a===o-1){let c=l,u=typeof c.message==="string"?c.message:"Unknown error";throw console.error("Debug: [writeToFile] Max retries reached. Final error:",u),l}a++;let n=s*2**(a-1);await new Promise((c)=>setTimeout(c,n))}})();this.pendingOperations.push(t);let r=this.pendingOperations.length-1;try{await t}catch(i){throw console.error("Debug: [writeToFile] Error in operation:",i),i}finally{this.pendingOperations.splice(r,1)}}generateLogFilename(){if(this.name.includes("stream-throughput")||this.name.includes("decompress-perf-test")||this.name.includes("decompression-latency")||this.name.includes("concurrent-read-test")||this.name.includes("clock-change-test"))return be(this.config.logDirectory,`${this.name}.log`);if(this.name.includes("pending-test")||this.name.includes("temp-file-test")||this.name==="crash-test"||this.name==="corrupt-test"||this.name.includes("rotation-load-test")||this.name==="sigterm-test"||this.name==="sigint-test"||this.name==="failed-rotation-test"||this.name==="integration-test")return be(this.config.logDirectory,`${this.name}.log`);let e=new Date().toISOString().split("T")[0];return be(this.config.logDirectory,`${this.name}-${e}.log`)}setupRotation(){if(O())return;if(!this.shouldWriteToFile())return;if(typeof this.config.rotation==="boolean")return;let e=this.config.rotation,t;switch(e.frequency){case"daily":t=86400000;break;case"weekly":t=604800000;break;case"monthly":t=2592000000;break;default:return}this.rotationTimeout=setInterval(()=>{this.rotateLog()},t)}setupKeyRotation(){if(!this.validateEncryptionConfig()){console.error("Invalid encryption configuration detected during key rotation setup");return}let e=this.config.rotation.keyRotation;if(!e?.enabled)return;let t=typeof e.interval==="number"?e.interval:60,r=Math.max(t,60)*1000;this.keyRotationTimeout=setInterval(()=>{this.rotateKeys().catch((i)=>{console.error("Error rotating keys:",i)})},r)}async rotateKeys(){if(!this.validateEncryptionConfig()){console.error("Invalid encryption configuration detected during key rotation");return}let e=this.config.rotation.keyRotation,t=this.generateKeyId(),r=this.generateKey();this.currentKeyId=t,this.keys.set(t,r),this.encryptionKeys.set(t,{key:r,createdAt:new Date});let i=Array.from(this.encryptionKeys.entries()).sort(([,s],[,l])=>l.createdAt.getTime()-s.createdAt.getTime()),a=typeof e.maxKeys==="number"?e.maxKeys:1,o=Math.max(1,a);if(i.length>o)for(let[s]of i.slice(o))this.encryptionKeys.delete(s),this.keys.delete(s)}generateKeyId(){return Yt(16).toString("hex")}generateKey(){return Yt(32)}getCurrentKey(){if(!this.currentKeyId)throw Error("Encryption is not properly initialized. Make sure encryption is enabled in the configuration.");let e=this.keys.get(this.currentKeyId);if(!e)throw Error(`No key found for ID ${this.currentKeyId}. The encryption key may have been rotated or removed.`);return{key:e,id:this.currentKeyId}}encrypt(e){let{key:t}=this.getCurrentKey(),r=Yt(16),i=gu("aes-256-gcm",t,r),a=_.isBuffer(e)?e:_.from(e,"utf8"),o=i.update(a),s=i.final(),l=o.length+s.length,n=i.getAuthTag(),c=_.allocUnsafe(16+l+16);return r.copy(c,0),o.copy(c,16),s.copy(c,16+o.length),n.copy(c,16+l),{encrypted:c,iv:r}}async compressData(e){return new Promise((t,r)=>{let i=ti(),a=[];i.on("data",(o)=>a.push(o)),i.on("end",()=>t(_.from(_.concat(a)))),i.on("error",r),i.write(e),i.end()})}getEncryptionOptions(){if(!this.config.rotation||typeof this.config.rotation==="boolean"||!this.config.rotation.encrypt)return{};let e={algorithm:"aes-256-cbc",compress:!1};if(typeof this.config.rotation.encrypt==="object"){let t=this.config.rotation.encrypt;return{...e,...t}}return e}async rotateLog(){if(O())return;if(!this.shouldWriteToFile())return;let e=await ye(this.currentLogFile).catch(()=>null);if(!e)return;let t=this.config.rotation;if(typeof t==="boolean")return;if(t.maxSize&&e.size>=t.maxSize){let r=this.currentLogFile,i=this.generateLogFilename();if(this.name.includes("rotation-load-test")||this.name==="failed-rotation-test"){let a=await qe(this.config.logDirectory),o=a.filter((n)=>n.startsWith(this.name)&&/\.log\.\d+$/.test(n)).sort((n,c)=>{let u=Number.parseInt(n.match(/\.log\.(\d+)$/)?.[1]||"0");return Number.parseInt(c.match(/\.log\.(\d+)$/)?.[1]||"0")-u}),s=o.length>0?Number.parseInt(o[0].match(/\.log\.(\d+)$/)?.[1]||"0")+1:1,l=`${r}.${s}`;if(await ye(r).catch(()=>null))try{if(await ei(r,l),t.compress)try{let n=`${l}.gz`;await this.compressLogFile(l,n),await Ie(l)}catch(n){console.error("Error compressing rotated file:",n)}if(o.length===0&&!a.some((n)=>n.endsWith(".log.1")))try{let n=`${r}.1`;await Dt(n,"")}catch(n){console.error("Error creating backup file:",n)}}catch(n){console.error(`Error during rotation: ${n instanceof Error?n.message:String(n)}`)}}else{let a=new Date().toISOString().replace(/[:.]/g,"-"),o=r.replace(/\.log$/,`-${a}.log`);if(await ye(r).catch(()=>null))await ei(r,o)}if(this.currentLogFile=i,t.maxFiles){let a=(await qe(this.config.logDirectory)).filter((o)=>o.startsWith(this.name)).sort((o,s)=>s.localeCompare(o));for(let o of a.slice(t.maxFiles))await Ie(be(this.config.logDirectory,o))}}}async compressLogFile(e,t){let r=Gr(e),i=yu(t),a=ti();await Cu(r,a,i)}async handleFingersCrossedBuffer(e,t){if(!this.fingersCrossedConfig)return;if(this.shouldActivateFingersCrossed(e)&&!this.isActivated){this.isActivated=!0;for(let r of this.logBuffer){let i=await this.formatter.format(r);if(this.shouldWriteToFile())await this.writeToFile(i);console.log(i)}if(this.fingersCrossedConfig.stopBuffering)this.logBuffer=[]}if(this.isActivated){if(this.shouldWriteToFile())await this.writeToFile(t);console.log(t)}}shouldLog(e){if(!this.enabled)return!1;let t={debug:0,info:1,success:2,warning:3,error:4};return t[e]>=t[this.config.level]}async flushPendingWrites(){if(await Promise.all(this.pendingOperations.map((e)=>{if(e instanceof Promise)return e.catch((t)=>{console.error("Error in pending write operation:",t)});return Promise.resolve()})),Me(this.currentLogFile))try{let e=Jr(this.currentLogFile,"r+");_r(e),Pt(e)}catch(e){console.error(`Error flushing file: ${e}`)}}async destroy(){if(this.rotationTimeout)clearInterval(this.rotationTimeout);if(this.keyRotationTimeout)clearInterval(this.keyRotationTimeout);this.timers.clear();for(let e of this.pendingOperations)if(typeof e.cancel==="function")e.cancel();return(async()=>{if(this.pendingOperations.length>0)try{await Promise.allSettled(this.pendingOperations)}catch(e){console.error("Error waiting for pending operations:",e)}if(!O()&&this.config.rotation&&typeof this.config.rotation!=="boolean"&&this.config.rotation.compress)try{let e=(await qe(this.config.logDirectory)).filter((t)=>(t.includes("temp")||t.includes(".tmp"))&&t.includes(this.name));for(let t of e)try{await Ie(be(this.config.logDirectory,t))}catch(r){console.error(`Failed to delete temp file ${t}:`,r)}}catch(e){console.error("Error cleaning up temporary files:",e)}})()}getCurrentLogFilePath(){return this.currentLogFile}formatTag(e){if(!e)return"";return`${this.tagFormat.prefix}${e}${this.tagFormat.suffix}`}formatFileTimestamp(e){return`[${e.toISOString()}]`}formatConsoleTimestamp(e){return this.shouldStyleConsole()?x.gray(e.toLocaleTimeString()):e.toLocaleTimeString()}shouldStyleConsole(){if(!this.fancy||O())return!1;let e=typeof E.env.NO_COLOR<"u",t=E.env.FORCE_COLOR==="0";if(e||t)return!1;return!!(typeof E.stderr<"u"&&E.stderr.isTTY||typeof E.stdout<"u"&&E.stdout.isTTY)}formatConsoleMessage(e){let{timestamp:t,icon:r="",tag:i="",message:a,level:o,showTimestamp:s=!0}=e,l=(h)=>h.replace(this.ANSI_PATTERN,"");if(!this.fancy){let h=[];if(s)h.push(t);if(o==="warning")h.push("WARN");else if(o==="error")h.push("ERROR");else if(r)h.push(r.replace(/[^\p{L}\p{N}\p{P}\p{Z}]/gu,""));if(i)h.push(i.replace(/[[\]]/g,""));return h.push(a),h.join(" ")}let n=E.stdout.columns||120,c="";if(o==="warning"||o==="error")c=`${r} ${a}`;else if(o==="info"||o==="success")c=`${r} ${i} ${a}`;else c=`${r} ${i} ${x.cyan(a)}`;if(!s)return c.trim();let u=l(c).trim().length,f=l(t).length,d=Math.max(1,n-2-u-f);return`${c.trim()}${" ".repeat(d)}${t}`}formatMessage(e,t){if(t.length===1&&Array.isArray(t[0]))return e.replace(/\{(\d+)\}/g,(o,s)=>{let l=Number.parseInt(s,10);return l<t[0].length?String(t[0][l]):o});let r=/%([sdijfo%])/g,i=0,a=e.replace(r,(o,s)=>{if(s==="%")return"%";if(i>=t.length)return o;let l=t[i++];switch(s){case"s":return String(l);case"d":case"i":return Number(l).toString();case"j":case"o":return JSON.stringify(l,null,2);default:return o}});if(i<t.length)a+=` ${t.slice(i).map((o)=>typeof o==="object"?JSON.stringify(o,null,2):String(o)).join(" ")}`;return a}formatMarkdown(e){if(!e)return e;let t=e;return t=t.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(r,i,a)=>{let o=x.underline(x.blue(i)),s=this.toAbsoluteFilePath(a);if(s&&this.shouldStyleConsole()&&this.supportsHyperlinks()){let l=`file://${encodeURI(s)}`,n="\x1B]8;;",c="\x1B\\";return`\x1B]8;;${l}\x1B\\${o}\x1B]8;;\x1B\\`}if(this.shouldStyleConsole()&&this.supportsHyperlinks())return`\x1B]8;;${a}\x1B\\${o}\x1B]8;;\x1B\\`;return o}),t=t.replace(/`([^`]+)`/g,(r,i)=>x.bgGray(i)),t=t.replace(/\*\*([^*]+)\*\*/g,(r,i)=>x.bold(i)),t=t.replace(/(?<!\*)\*([^*]+)\*(?!\*)/g,(r,i)=>x.italic(i)),t=t.replace(/(?<!_)_([^_]+)_(?!_)/g,(r,i)=>x.italic(i)),t=t.replace(/~([^~]+)~/g,(r,i)=>x.strikethrough(i)),t}supportsHyperlinks(){if(O())return!1;let e=E.env;if(!e)return!1;if(e.TERM_PROGRAM==="iTerm.app"||e.TERM_PROGRAM==="vscode"||e.TERM_PROGRAM==="WezTerm")return!0;if(e.WT_SESSION)return!0;if(e.TERM==="xterm-kitty")return!0;let t=e.VTE_VERSION?Number.parseInt(e.VTE_VERSION,10):0;if(!Number.isNaN(t)&&t>=5000)return!0;return!1}toAbsoluteFilePath(e){try{let t=e;if(t.startsWith("file://"))t=t.replace(/^file:\/\//,"");if(t.startsWith("~")){let r=E.env.HOME||"";if(r)t=t.replace(/^~(?=$|\/)/,r)}if(xu(t)||t.startsWith("./")||t.startsWith("../"))t=ku(t);else return null;return Me(t)?t:null}catch{return null}}buildOutputTexts(e){let t=this.shouldStyleConsole()?this.formatMarkdown(e):e,r=e.replace(this.ANSI_PATTERN,"");return{consoleText:t,fileText:r}}async log(e,t,...r){if(!this.shouldLog(e))return;let i=new Date,a=this.formatConsoleTimestamp(i),o=this.formatFileTimestamp(i),s,l;if(t instanceof Error)s=t.message,l=t.stack;else s=this.formatMessage(t,r);let{consoleText:n,fileText:c}=this.buildOutputTexts(s);if(this.shouldStyleConsole()){let f=this.options.showIcons===!1?"":Lf[e],d=this.options.showTags!==!1&&this.name?x.gray(this.formatTag(this.name)):"",h;switch(e){case"debug":h=this.formatConsoleMessage({timestamp:a,icon:f,tag:d,message:x.gray(n),level:e}),console.error(h);break;case"info":h=this.formatConsoleMessage({timestamp:a,icon:f,tag:d,message:n,level:e}),console.warn(h);break;case"success":h=this.formatConsoleMessage({timestamp:a,icon:f,tag:d,message:x.green(n),level:e}),console.error(h);break;case"warning":h=this.formatConsoleMessage({timestamp:a,icon:f,tag:d,message:n,level:e}),console.warn(h);break;case"error":if(h=this.formatConsoleMessage({timestamp:a,icon:f,tag:d,message:n,level:e}),console.error(h),l){let y=l.split(`
447
+ `);for(let p of y)if(p.trim()&&!p.includes(s))console.error(this.formatConsoleMessage({timestamp:a,message:x.gray(` ${p}`),level:e,showTimestamp:!1}))}break}}else if(!O()){if(console.error(`${o} ${this.environment}.${e.toUpperCase()}: ${s}`),l)console.error(l)}let u=`${o} ${this.environment}.${e.toUpperCase()}: ${c}
448
+ `;if(l)u+=`${l}
449
+ `;if(u=u.replace(this.ANSI_PATTERN,""),this.shouldWriteToFile())await this.writeToFile(u)}progress(e,t=""){let r={update:(a,o)=>{},finish:(a)=>{},interrupt:(a,o)=>{}};if(!this.enabled)return r;let i=30;if(this.activeProgressBar={total:Math.max(1,e||1),current:0,message:t||"",barLength:i,lastRenderedLine:""},this.shouldStyleConsole()&&!O()&&E.stdout.isTTY)this.renderProgressBar(this.activeProgressBar);return{update:(a,o)=>{if(!this.enabled||!this.activeProgressBar)return;if(this.activeProgressBar.current=Math.min(Math.max(0,a),this.activeProgressBar.total),o!==void 0)this.activeProgressBar.message=o;if(this.shouldStyleConsole()&&!O()&&E.stdout.isTTY)this.renderProgressBar(this.activeProgressBar)},finish:(a)=>{if(!this.activeProgressBar)return;this.finishProgressBar(this.activeProgressBar,a)},interrupt:(a,o="info")=>{if(!O()&&E.stdout.isTTY)E.stdout.write(`
450
+ `);if(this[o==="warning"?"warn":o](a),this.activeProgressBar&&this.shouldStyleConsole()&&!O()&&E.stdout.isTTY)this.renderProgressBar(this.activeProgressBar)}}}time(e){let t=performance.now();if(this.shouldStyleConsole()){let r=this.options.showTags!==!1&&this.name?x.gray(this.formatTag(this.name)):"",i=this.formatConsoleTimestamp(new Date);console.error(this.formatConsoleMessage({timestamp:i,icon:this.options.showIcons===!1?"":x.blue("\u25D0"),tag:r,message:`${x.cyan(e)}...`}))}return async(r)=>{if(!this.enabled)return;let i=performance.now(),a=Math.round(i-t),o=`${e} completed in ${a}ms`,s=new Date,l=this.formatConsoleTimestamp(s),n=`${this.formatFileTimestamp(s)} ${this.environment}.INFO: ${o}`;if(r)n+=` ${JSON.stringify(r)}`;if(n+=`
451
+ `,n=n.replace(this.ANSI_PATTERN,""),this.shouldStyleConsole()){let c=this.options.showTags!==!1&&this.name?x.gray(this.formatTag(this.name)):"";console.error(this.formatConsoleMessage({timestamp:l,icon:this.options.showIcons===!1?"":x.green("\u2713"),tag:c,message:`${o}${r?` ${JSON.stringify(r)}`:""}`}))}else if(!O())console.error(n.trim());if(this.shouldWriteToFile())await this.writeToFile(n)}}async debug(e,...t){await this.log("debug",e,...t)}async info(e,...t){await this.log("info",e,...t)}async success(e,...t){await this.log("success",e,...t)}async warn(e,...t){await this.log("warning",e,...t)}async error(e,...t){await this.log("error",e,...t)}validateEncryptionConfig(){if(!this.config.rotation)return!1;if(typeof this.config.rotation==="boolean")return!1;let e=this.config.rotation,{encrypt:t}=e;return!!t}async only(e){if(!this.enabled)return;return await e()}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}extend(e){let t=`${this.name}:${e}`,r=new wt(t,{...this.options,logDirectory:this.config.logDirectory,level:this.config.level,format:this.config.format,rotation:typeof this.config.rotation==="boolean"?void 0:this.config.rotation,timestamp:typeof this.config.timestamp==="boolean"?void 0:this.config.timestamp});return this.subLoggers.add(r),r}createReadStream(){if(O())throw Error("createReadStream is not supported in browser environments");if(!Me(this.currentLogFile))throw Error(`Log file does not exist: ${this.currentLogFile}`);return Gr(this.currentLogFile,{encoding:"utf8"})}async decrypt(e){if(!this.validateEncryptionConfig())throw Error("Encryption is not configured");let t=this.config.rotation;if(!t.encrypt||typeof t.encrypt==="boolean")throw Error("Invalid encryption configuration");if(!this.currentKeyId||!this.keys.has(this.currentKeyId))throw Error("No valid encryption key available");let r=this.keys.get(this.currentKeyId);try{let i=_.isBuffer(e)?e:_.from(e,"base64"),a=i.subarray(0,16),o=i.subarray(i.length-16),s=i.subarray(16,i.length-16),l=mu("aes-256-gcm",r,a);l.setAuthTag(o);let n=l.update(s),c=l.final(),u=n.length+c.length,f=_.allocUnsafe(u);return n.copy(f,0),c.copy(f,n.length),f.toString("utf8")}catch(i){throw Error(`Decryption failed: ${i instanceof Error?i.message:String(i)}`)}}getLevel(){return this.config.level}getLogDirectory(){return this.config.logDirectory}getFormat(){return this.config.format}getRotationConfig(){return this.config.rotation}isBrowserMode(){return O()}isServerMode(){return!O()}setTestEncryptionKey(e,t){this.currentKeyId=e,this.keys.set(e,t)}getTestCurrentKey(){if(!this.currentKeyId||!this.keys.has(this.currentKeyId))return null;return{id:this.currentKeyId,key:this.keys.get(this.currentKeyId)}}getConfig(){return this.config}async box(e){if(!this.enabled)return;let t=new Date,r=this.formatConsoleTimestamp(t),i=this.formatFileTimestamp(t),{consoleText:a,fileText:o}=this.buildOutputTexts(e);if(this.shouldStyleConsole()){let l=a.split(`
452
+ `),n=Math.max(...l.map((d)=>d.length))+2,c=`\u250C${"\u2500".repeat(n)}\u2510`,u=`\u2514${"\u2500".repeat(n)}\u2518`,f=l.map((d)=>{return this.formatConsoleMessage({timestamp:r,message:x.cyan(d),showTimestamp:!1})});console.error(this.formatConsoleMessage({timestamp:r,message:x.cyan(c),showTimestamp:!1})),f.forEach((d)=>console.error(d)),console.error(this.formatConsoleMessage({timestamp:r,message:x.cyan(u),showTimestamp:!1}))}else if(!O())console.error(`${i} ${this.environment}.INFO: [BOX] ${o}`);let s=`${i} ${this.environment}.INFO: [BOX] ${o}
453
+ `.replace(this.ANSI_PATTERN,"");if(this.shouldWriteToFile())await this.writeToFile(s)}async prompt(e){if(O())return Promise.resolve(!0);return new Promise((t)=>{console.error(`${x.cyan("?")} ${e} (y/n) `);let r=(i)=>{let a=i.toString().trim().toLowerCase();E.stdin.removeListener("data",r);try{if(typeof E.stdin.setRawMode==="function")E.stdin.setRawMode(!1)}catch{}E.stdin.pause(),console.error(""),t(a==="y"||a==="yes")};try{if(typeof E.stdin.setRawMode==="function")E.stdin.setRawMode(!0)}catch{}E.stdin.resume(),E.stdin.once("data",r)})}setFancy(e){this.fancy=e}isFancy(){return this.fancy}pause(){this.enabled=!1}resume(){this.enabled=!0}async start(e,...t){if(!this.enabled)return;let r=e;if(t&&t.length>0){let s=/%([sdijfo%])/g,l=0;if(r=e.replace(s,(n,c)=>{if(c==="%")return"%";if(l>=t.length)return n;let u=t[l++];switch(c){case"s":return String(u);case"d":case"i":return Number(u).toString();case"j":case"o":return JSON.stringify(u,null,2);default:return n}}),l<t.length)r+=` ${t.slice(l).map((n)=>typeof n==="object"?JSON.stringify(n,null,2):String(n)).join(" ")}`}let{consoleText:i,fileText:a}=this.buildOutputTexts(r);if(this.shouldStyleConsole()){let s=this.options.showTags!==!1&&this.name?x.gray(this.formatTag(this.name)):"",l=this.options.showIcons===!1?"":`${x.blue("\u25D0")} `;console.error(`${l}${s} ${x.cyan(i)}`)}let o=`[${new Date().toISOString()}] ${this.environment}.INFO: [START] ${a}
454
+ `.replace(this.ANSI_PATTERN,"");if(this.shouldWriteToFile())await this.writeToFile(o)}renderProgressBar(e,t=!1){if(!this.enabled||!this.shouldStyleConsole()||!E.stdout.isTTY)return;let r=Math.min(100,Math.max(0,Math.round(e.current/e.total*100))),i=Math.round(e.barLength*r/100),a=e.barLength-i,o=x.green("\u2501".repeat(i)),s=x.gray("\u2501".repeat(a)),l=`[${o}${s}]`,n=`${r}%`.padStart(4),c=e.message?` ${e.message}`:"",u=this.options.showIcons===!1?"":t||r===100?x.green("\u2713"):x.blue("\u25B6"),f=this.options.showTags!==!1&&this.name?` ${x.gray(this.formatTag(this.name))}`:"",d=`\r${u}${f} ${l} ${n}${c}`,h=E.stdout.columns||80,y=" ".repeat(Math.max(0,h-d.replace(this.ANSI_PATTERN,"").length));if(e.lastRenderedLine=`${d}${y}`,E.stdout.write(e.lastRenderedLine),t)E.stdout.write(`
455
+ `)}finishProgressBar(e,t){if(!this.enabled||!this.fancy||O()||!E.stdout.isTTY){this.activeProgressBar=null;return}if(e.current<e.total)e.current=e.total;if(t)e.message=t;this.renderProgressBar(e,!0),this.activeProgressBar=null}async clear(e={}){if(O()){console.warn("Log clearing is not supported in browser environments.");return}try{console.warn("Clearing logs...",this.config.logDirectory);let t=await qe(this.config.logDirectory),r=[];for(let i of t){if(!(e.name?new RegExp(e.name.replace("*",".*")).test(i):i.startsWith(this.name))||!i.endsWith(".log"))continue;let a=be(this.config.logDirectory,i);if(e.before)try{if((await ye(a)).mtime>=e.before)continue}catch(o){console.error(`Failed to get stats for file ${a}:`,o);continue}r.push(a)}if(r.length===0){console.warn("No log files matched the criteria for clearing.");return}console.warn(`Preparing to delete ${r.length} log file(s)...`);for(let i of r)try{await Ie(i),console.warn(`Deleted log file: ${i}`)}catch(a){console.error(`Failed to delete log file ${i}:`,a)}console.warn("Log clearing process finished.")}catch(t){console.error("Error during log clearing process:",t)}}}var Fh=new wt("stacks");class H extends Error{timestamp;context;constructor(e,t={}){super(e);if(this.name=this.constructor.name,this.timestamp=new Date,this.context=t,Error.captureStackTrace)Error.captureStackTrace(this,this.constructor)}toJSON(){return{name:this.name,code:this.code,message:this.message,timestamp:this.timestamp.toISOString(),context:this.context,stack:this.stack}}toString(){let e=Object.keys(this.context).length>0?` (${Object.entries(this.context).map(([t,r])=>`${t}: ${r}`).join(", ")})`:"";return`${this.name} [${this.code}]: ${this.message}${e}`}}class wa extends H{code="CONFIG_NOT_FOUND";constructor(e,t,r){let i=r===void 0?[]:Array.isArray(r)?r.filter(Boolean):[r],a="";if(i.length===1)a=` or alias "${i[0]}"`;else if(i.length>1)a=` or aliases ${i.map((o)=>`"${o}"`).join(", ")}`;super(`Configuration "${e}"${a} not found`,{configName:e,alias:r,searchPaths:t,searchPathCount:t.length})}}class dt extends H{code="CONFIG_LOAD_ERROR";constructor(e,t,r){super(`Failed to load configuration from "${e}": ${t.message}`,{configPath:e,configName:r,originalError:t.name,originalMessage:t.message});this.cause=t}}class va extends H{code="CONFIG_VALIDATION_ERROR";constructor(e,t,r){super(`Configuration validation failed for "${e}"`,{configPath:e,configName:r,validationErrors:t,errorCount:t.length})}}class xa extends H{code="CONFIG_MERGE_ERROR";constructor(e,t,r,i){super(`Failed to merge configuration from "${e}" with "${t}": ${r.message}`,{sourcePath:e,targetPath:t,configName:i,originalError:r.name,originalMessage:r.message});this.cause=r}}class gr extends H{code="ENV_VAR_ERROR";constructor(e,t,r,i){super(`Failed to parse environment variable "${e}" with value "${t}" as ${r}`,{envKey:e,envValue:t,expectedType:r,configName:i})}}class ka extends H{code="FILE_SYSTEM_ERROR";constructor(e,t,r){super(`File system ${e} failed for "${t}": ${r.message}`,{operation:e,path:t,originalError:r.name,originalMessage:r.message});this.cause=r}}class Ca extends H{code="TYPE_GENERATION_ERROR";constructor(e,t,r){super(`Failed to generate types from "${e}" to "${t}": ${r.message}`,{configDir:e,outputPath:t,originalError:r.name,originalMessage:r.message});this.cause=r}}class ht extends H{code="SCHEMA_VALIDATION_ERROR";constructor(e,t,r){super(`Schema validation failed${r?` for config "${r}"`:""}`,{schemaPath:e,configName:r,validationErrors:t,errorCount:t.length})}}class Ea extends H{code="BROWSER_CONFIG_ERROR";constructor(e,t,r,i){super(`Failed to fetch configuration from "${e}": ${t} ${r}`,{endpoint:e,status:t,statusText:r,configName:i})}}class Aa extends H{code="PLUGIN_ERROR";constructor(e,t,r){super(`Plugin "${e}" failed during ${t}: ${r.message}`,{pluginName:e,operation:t,originalError:r.name,originalMessage:r.message});this.cause=r}}var xe={configNotFound(e,t,r){return new wa(e,t,r)},configLoad(e,t,r){return new dt(e,t,r)},configValidation(e,t,r){return new va(e,t,r)},configMerge(e,t,r,i){return new xa(e,t,r,i)},envVar(e,t,r,i){return new gr(e,t,r,i)},fileSystem(e,t,r){return new ka(e,t,r)},typeGeneration(e,t,r){return new Ca(e,t,r)},schemaValidation(e,t,r){return new ht(e,t,r)},browserConfig(e,t,r,i){return new Ea(e,t,r,i)},plugin(e,t,r){return new Aa(e,t,r)}};async function Wf(e,t={}){let{maxRetries:r=3,retryDelay:i=1000,isRetryable:a=()=>!0,fallback:o}=t,s=Error("Unknown error occurred");for(let l=0;l<=r;l++)try{return await e()}catch(n){if(s=n instanceof Error?n:Error(String(n)),l===r||!a(s))break;if(i>0)await new Promise((c)=>setTimeout(c,i))}if(o!==void 0)return o;throw s instanceof Error?s:Error(`Unknown error: ${String(s)}`)}class mr{defaultParsers;constructor(){this.defaultParsers=[{name:"boolean",canParse:(e,t)=>t==="boolean"||["true","false","1","0","yes","no"].includes(e.toLowerCase()),parse:(e)=>{let t=e.toLowerCase();return["true","1","yes"].includes(t)}},{name:"number",canParse:(e,t)=>t==="number"||!Number.isNaN(Number(e))&&!Number.isNaN(Number.parseFloat(e)),parse:(e)=>{let t=Number(e);if(Number.isNaN(t))throw TypeError(`Cannot parse "${e}" as number`);return t}},{name:"array",canParse:(e,t)=>t==="array"||e.startsWith("[")||e.includes(","),parse:(e)=>{try{let t=JSON.parse(e);if(Array.isArray(t))return t}catch{}return e.split(",").map((t)=>t.trim())}},{name:"json",canParse:(e,t)=>t==="object"||(e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]")),parse:(e)=>{try{return JSON.parse(e)}catch(t){throw Error(`Cannot parse "${e}" as JSON: ${t}`)}}}]}async applyEnvironmentVariables(e,t,r={}){let{prefix:i,useCamelCase:a=!0,useBackwardCompatibility:o=!0,customParsers:s={},verbose:l=!1,trackPerformance:n=!0}=r,c=async()=>{if(!e)return{config:t,source:{type:"environment",priority:50,timestamp:new Date}};let u=i||this.generateEnvPrefix(e),f={...t};return this.processObject(f,[],u,{useCamelCase:a,useBackwardCompatibility:o,customParsers:s,verbose:l,configName:e}),{config:f,source:{type:"environment",priority:50,timestamp:new Date}}};if(n)return sr.track("applyEnvironmentVariables",c,{configName:e});return c()}generateEnvPrefix(e){return e.toUpperCase().replace(/-/g,"_")}formatEnvKey(e,t){if(!t)return e.toUpperCase();return e.replace(/([A-Z])/g,"_$1").toUpperCase()}processObject(e,t,r,i){for(let[a,o]of Object.entries(e)){let s=[...t,a],l=s.map((u)=>this.formatEnvKey(u,i.useCamelCase)),n=`${r}_${l.join("_")}`,c=i.useBackwardCompatibility?`${r}_${s.map((u)=>u.toUpperCase()).join("_")}`:null;if(i.verbose);if(typeof o==="object"&&o!==null&&!Array.isArray(o))this.processObject(o,s,r,i);else{let u=Ze.env[n]||(c?Ze.env[c]:void 0);if(u!==void 0){if(i.verbose){let f=Ze.env[n]?n:c}try{e[a]=this.parseEnvironmentValue(u,typeof o,n,i.customParsers,i.configName)}catch(f){if(f instanceof gr)throw f;throw xe.envVar(n,u,typeof o,i.configName)}}}}}parseEnvironmentValue(e,t,r,i,a){for(let[o,s]of Object.entries(i))try{return s(e)}catch{continue}for(let o of this.defaultParsers)if(o.canParse(e,t))try{return o.parse(e)}catch{throw xe.envVar(r,e,`${t} (via ${o.name} parser)`,a)}return e}getEnvironmentVariables(e){let t={},r=e.toUpperCase();for(let[i,a]of Object.entries(Ze.env))if(i.startsWith(r)&&a!==void 0)t[i]=a;return t}validateEnvironmentVariable(e,t,r){let i=[];if(!/^[A-Z_][A-Z0-9_]*$/.test(e))i.push(`Environment variable key "${e}" should only contain uppercase letters, numbers, and underscores`);if(r)try{this.parseEnvironmentValue(e,t,r,{})}catch(a){i.push(`Cannot parse value "${t}" as ${r}: ${a}`)}return{isValid:i.length===0,errors:i}}generateEnvVarDocs(e,t,r={}){let{prefix:i,format:a="text"}=r,o=i||this.generateEnvPrefix(e),s=[];switch(this.extractEnvVarInfo(t,[],o,s),a){case"markdown":return this.formatAsMarkdown(s,e);case"json":return JSON.stringify(s,null,2);default:return this.formatAsText(s,e)}}extractEnvVarInfo(e,t,r,i){for(let[a,o]of Object.entries(e)){let s=[...t,a],l=`${r}_${s.map((n)=>this.formatEnvKey(n,!0)).join("_")}`;if(typeof o==="object"&&o!==null&&!Array.isArray(o))this.extractEnvVarInfo(o,s,r,i);else i.push({key:l,type:Array.isArray(o)?"array":typeof o,description:`Configuration for ${s.join(".")}`,example:this.generateExample(o)})}}generateExample(e){if(Array.isArray(e))return JSON.stringify(e);if(typeof e==="object"&&e!==null)return JSON.stringify(e);return String(e)}formatAsText(e,t){let r=`Environment Variables for ${t}:
456
+
457
+ `;for(let i of e)r+=`${i.key}
458
+ `,r+=` Type: ${i.type}
459
+ `,r+=` Description: ${i.description}
460
+ `,r+=` Example: ${i.example}
461
+
462
+ `;return r}formatAsMarkdown(e,t){let r=`# Environment Variables for ${t}
463
+
464
+ `;r+=`| Variable | Type | Description | Example |
465
+ `,r+=`|----------|------|-------------|----------|
466
+ `;for(let i of e)r+=`| \`${i.key}\` | ${i.type} | ${i.description} | \`${i.example}\` |
467
+ `;return r}}function Mf(e,t,r={}){return Sa(e,t,r,new WeakMap)}function Sa(e,t,r,i){let{arrayMergeMode:a="replace",skipNullish:o=!1,customMerger:s}=r;if(t===null||t===void 0)return o?e:t;if(s){let l=s(e,t);if(l!==void 0)return l}if(Array.isArray(t)||Array.isArray(e))return Na(e,t,a,i);if(!U(t)||!U(e))return t;return Uf(e,t,r,i)}function Na(e,t,r,i){if(Array.isArray(t)&&!Array.isArray(e))return t;if(Array.isArray(e)&&!Array.isArray(t))return t;if(Array.isArray(t)&&Array.isArray(e))switch(r){case"replace":return t;case"concat":return qf(e,t);case"smart":return If(e,t,i);default:return t}return t}function qf(e,t){let r=[...t];for(let i of e)if(!r.some((a)=>or(a,i)))r.push(i);return r}function If(e,t,r){if(t.length===0)return e;if(e.length===0)return t;if(U(t[0])&&U(e[0]))return Zf(e,t,r);if(t.every((i)=>typeof i==="string")&&e.every((i)=>typeof i==="string")){let i=[...t];for(let a of e)if(!i.includes(a))i.push(a);return i}return t}function Zf(e,t,r){let i=[...t];for(let a of e){if(!U(a)){i.push(a);continue}let o=["id","name","key","path","type"],s=!1;for(let l of o)if(l in a){if(i.find((n)=>U(n)&&(l in n)&&n[l]===a[l])){s=!0;break}}if(!s)i.push(a)}return i}function Uf(e,t,r,i){let a=t;if(U(a)&&i.has(a))return i.get(a);let o={...e};if(U(a))i.set(a,o);for(let s in a){if(!Object.prototype.hasOwnProperty.call(a,s))continue;let l=a[s],n=o[s];if(r.skipNullish&&(l===null||l===void 0))continue;if(l===null||l===void 0){o[s]=l;continue}if(U(l)&&U(n))o[s]=Sa(n,l,r,i);else if(Array.isArray(l)||Array.isArray(n))o[s]=Na(n,l,r.arrayMergeMode||"smart",i);else o[s]=l}return o}function ja(e,t,r="replace"){return Mf(e,t,{arrayMergeMode:r==="replace"?"replace":"smart",skipNullish:!0})}function or(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!or(e[r],t[r]))return!1;return!0}if(U(e)&&U(t)){let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(let a of r){if(!Object.prototype.hasOwnProperty.call(t,a))return!1;if(!or(e[a],t[a]))return!1}return!0}return!1}function U(e){return Boolean(e&&typeof e==="object"&&!Array.isArray(e))}class za{extensions=[".ts",".js",".mjs",".cjs",".json",".mts",".cts"];async loadFromPath(e,t,r={}){let{arrayStrategy:i="replace",useCache:a=!0,cacheTtl:o,trackPerformance:s=!0,verbose:l=!1}=r;if(a){let c=at.getWithFileCheck("file",e);if(c){if(l)console.log(`Configuration loaded from cache: ${e}`);return c}}let n=async()=>{if(!Ue(e))return null;try{let c=`?t=${Date.now()}`,u=await import(e+c),f=u.default||u,d="default"in u,h=Object.keys(u).length>0;if(!d&&!h)throw new dt(e,Error("Configuration file is empty and exports nothing"),"unknown");if(typeof f!=="object"||f===null||Array.isArray(f))throw new dt(e,Error("Configuration must export a valid object"),"unknown");let y={config:ja(t,f,i),source:{type:"file",path:e,priority:100,timestamp:new Date}};if(a)at.setWithFileCheck("file",y,e,o);return y}catch(c){throw c instanceof Error?xe.configLoad(e,c):xe.configLoad(e,Error(String(c)))}};if(s)return sr.track("loadFromPath",n,{path:e});return n()}async tryLoadFromPaths(e,t,r={}){for(let i of e)try{let a=await this.loadFromPath(i,t,r);if(a)return a}catch(a){if(a instanceof Error&&a.name==="ConfigLoadError")throw a;if(r.verbose)console.warn(`Failed to load config from ${i}:`,a)}return null}generateConfigPaths(e,t,r){let i=this.generateNamePatterns(e,r),a=[];for(let o of i)for(let s of this.extensions)a.push(Lt(t,`${o}${s}`));return a}generateNamePatterns(e,t){let r=[];if(r.push("config",".config"),e)r.push(e,`.${e}.config`,`${e}.config`,`.${e}`);let i=t===void 0?[]:Array.isArray(t)?t:[t];for(let o of i){if(!o)continue;if(r.push(o,`.${o}.config`,`${o}.config`,`.${o}`),e)r.push(`${e}.${o}.config`,`.${e}.${o}.config`)}let a=new Set;return r.filter((o)=>{if(!o||a.has(o))return!1;return a.add(o),!0})}checkFileAccess(e){return Wf(async()=>{return Ue(e)},{maxRetries:2,retryDelay:100,fallback:!1})}async discoverConfigFiles(e,t,r){let i=[];if(!Ue(e))return i;if(t||r){let a=this.generateNamePatterns(t||"",r);for(let o of a)for(let s of this.extensions){let l=Lt(e,`${o}${s}`);if(await this.checkFileAccess(l))i.push(l)}}else try{let{readdirSync:a}=await import("fs"),o=a(e);for(let s of o)if(this.looksLikeConfigFile(s)){let l=Lt(e,s);if(await this.checkFileAccess(l))i.push(l)}}catch{return[]}return i}looksLikeConfigFile(e){return[/\.config\.(ts|js|mjs|cjs|json|mts|cts)$/,/^\..*\.(ts|js|mjs|cjs|json|mts|cts)$/,/config\.(ts|js|mjs|cjs|json|mts|cts)$/].some((t)=>t.test(e))}async validateConfigFile(e){let t=[];try{if(!Ue(e))return t.push("Configuration file does not exist"),t;let r=await import(e),i=r.default||r;if(i===void 0)t.push("Configuration file must export a default value or named exports");else if(typeof i!=="object"||i===null)t.push("Configuration must be an object");else if(Array.isArray(i))t.push("Configuration cannot be an array at the root level");if(e.endsWith(".json"))try{let{readFileSync:a}=await import("fs"),o=a(e,"utf8");JSON.parse(o)}catch(a){t.push(`Invalid JSON syntax: ${a}`)}}catch(r){t.push(`Failed to load configuration file: ${r}`)}return t}async getFileModificationTime(e){try{let{statSync:t}=await import("fs");return t(e).mtime}catch{return null}}async preloadConfigurations(e,t={}){let r=new Map;return await Promise.allSettled(e.map(async(i)=>{try{let a=await this.loadFromPath(i,{},t);if(a)r.set(i,a.config)}catch(a){if(t.verbose)console.warn(`Failed to preload ${i}:`,a)}})),r}}var Qf=/^https?:\/\//;class Ta{async validateConfiguration(e,t,r={}){let{stopOnFirstError:i=!1,validateRequired:a=!0,validateTypes:o=!0,customRules:s=[],trackPerformance:l=!0,verbose:n=!1}=r,c=async()=>{let u=[],f=[],d={stopOnFirstError:i,validateRequired:a,validateTypes:o,customRules:s,trackPerformance:l,verbose:n};try{if(typeof t==="string")return await this.validateWithSchemaFile(e,t,d);else if(Array.isArray(t))return this.validateWithRules(e,[...t,...s],d);else return this.validateWithJSONSchema(e,t,d)}catch(h){return u.push({path:"",message:`Validation failed: ${h}`,rule:"system"}),{isValid:!1,errors:u,warnings:f}}};if(l)return await sr.track("validateConfiguration",c);return c()}async validateWithSchemaFile(e,t,r){try{if(!Eu(t))throw new ht(t,[{path:"",message:"Schema file does not exist"}]);let i=await import(t),a=i.default||i;if(Array.isArray(a))return this.validateWithRules(e,a,r);else return this.validateWithJSONSchema(e,a,r)}catch(i){throw new ht(t,[{path:"",message:`Failed to load schema: ${i}`}])}}validateWithJSONSchema(e,t,r){let i=[],a=[];return this.validateObjectAgainstSchema(e,t,"",i,a,r),{isValid:i.length===0,errors:i,warnings:a}}validateObjectAgainstSchema(e,t,r,i,a,o){if(o.validateTypes&&t.type){let s=Array.isArray(e)?"array":typeof e,l=Array.isArray(t.type)?t.type:[t.type];if(!l.includes(s)){if(i.push({path:r,message:`Expected type ${l.join(" or ")}, got ${s}`,expected:l.join(" or "),actual:s,rule:"type"}),o.stopOnFirstError)return}}if(t.enum&&!t.enum.includes(e)){if(i.push({path:r,message:`Value must be one of: ${t.enum.join(", ")}`,expected:t.enum.join(", "),actual:e,rule:"enum"}),o.stopOnFirstError)return}if(typeof e==="string"){if(t.minLength!==void 0&&e.length<t.minLength)i.push({path:r,message:`String length must be at least ${t.minLength}`,expected:`>= ${t.minLength}`,actual:e.length,rule:"minLength"});if(t.maxLength!==void 0&&e.length>t.maxLength)i.push({path:r,message:`String length must not exceed ${t.maxLength}`,expected:`<= ${t.maxLength}`,actual:e.length,rule:"maxLength"});if(t.pattern){if(!new RegExp(t.pattern).test(e))i.push({path:r,message:`String does not match pattern ${t.pattern}`,expected:t.pattern,actual:e,rule:"pattern"})}}if(typeof e==="number"){if(t.minimum!==void 0&&e<t.minimum)i.push({path:r,message:`Value must be at least ${t.minimum}`,expected:`>= ${t.minimum}`,actual:e,rule:"minimum"});if(t.maximum!==void 0&&e>t.maximum)i.push({path:r,message:`Value must not exceed ${t.maximum}`,expected:`<= ${t.maximum}`,actual:e,rule:"maximum"})}if(Array.isArray(e)&&t.items)for(let s=0;s<e.length;s++){let l=r?`${r}[${s}]`:`[${s}]`;if(this.validateObjectAgainstSchema(e[s],t.items,l,i,a,o),o.stopOnFirstError&&i.length>0)return}if(e&&typeof e==="object"&&!Array.isArray(e)){let s=e;if(o.validateRequired&&t.required){for(let l of t.required)if(!(l in s)){if(i.push({path:r?`${r}.${l}`:l,message:`Missing required property '${l}'`,expected:"required",rule:"required"}),o.stopOnFirstError)return}}if(t.properties){for(let[l,n]of Object.entries(t.properties))if(l in s){let c=r?`${r}.${l}`:l;if(this.validateObjectAgainstSchema(s[l],n,c,i,a,o),o.stopOnFirstError&&i.length>0)return}}if(t.additionalProperties===!1){let l=new Set(Object.keys(t.properties||{}));for(let n of Object.keys(s))if(!l.has(n))a.push({path:r?`${r}.${n}`:n,message:`Additional property '${n}' is not allowed`,rule:"additionalProperties"})}}}validateWithRules(e,t,r){let i=[],a=[];for(let o of t)try{let s=this.getValueByPath(e,o.path),l=this.validateWithRule(s,o,o.path);if(i.push(...l),r.stopOnFirstError&&i.length>0)break}catch(s){i.push({path:o.path,message:`Rule validation failed: ${s}`,rule:"system"})}return{isValid:i.length===0,errors:i,warnings:a}}validateWithRule(e,t,r){let i=[];if(t.required&&(e===void 0||e===null))return i.push({path:r,message:t.message||`Property '${r}' is required`,expected:"required",rule:"required"}),i;if(e===void 0||e===null)return i;if(t.type){let a=Array.isArray(e)?"array":typeof e;if(a!==t.type)i.push({path:r,message:t.message||`Expected type ${t.type}, got ${a}`,expected:t.type,actual:a,rule:"type"})}if(t.min!==void 0){let a=Array.isArray(e)?e.length:typeof e==="string"?e.length:typeof e==="number"?e:0;if(a<t.min)i.push({path:r,message:t.message||`Value must be at least ${t.min}`,expected:`>= ${t.min}`,actual:a,rule:"min"})}if(t.max!==void 0){let a=Array.isArray(e)?e.length:typeof e==="string"?e.length:typeof e==="number"?e:0;if(a>t.max)i.push({path:r,message:t.message||`Value must not exceed ${t.max}`,expected:`<= ${t.max}`,actual:a,rule:"max"})}if(t.pattern&&typeof e==="string"){if(!t.pattern.test(e))i.push({path:r,message:t.message||`Value does not match pattern ${t.pattern}`,expected:t.pattern.toString(),actual:e,rule:"pattern"})}if(t.enum&&!t.enum.includes(e))i.push({path:r,message:t.message||`Value must be one of: ${t.enum.join(", ")}`,expected:t.enum.join(", "),actual:e,rule:"enum"});if(t.validator){let a=t.validator(e);if(a)i.push({path:r,message:t.message||a,rule:"custom"})}return i}getValueByPath(e,t){if(!t)return e;let r=t.split("."),i=e;for(let a of r)if(i&&typeof i==="object"&&a in i)i=i[a];else return;return i}generateRulesFromInterface(e){let t=[],r=e.matchAll(/(\w+)(\?)?:\s*(\w+)/g);for(let i of r){let[,a,o,s]=i;t.push({path:a,required:!o,type:this.mapTypeScriptType(s)})}return t}mapTypeScriptType(e){switch(e.toLowerCase()){case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"array":return"array";case"object":return"object";default:return"object"}}static createCommonRules(){return{server:[{path:"port",required:!0,type:"number",min:1,max:65535},{path:"host",required:!0,type:"string",min:1},{path:"ssl",type:"boolean"}],database:[{path:"url",required:!0,type:"string",min:1},{path:"pool",type:"number",min:1,max:100},{path:"timeout",type:"number",min:0}],api:[{path:"baseUrl",required:!0,type:"string",pattern:Qf},{path:"timeout",type:"number",min:0},{path:"retries",type:"number",min:0,max:10}]}}}var K=new wt("bunfig",{showTags:!0});function Hf(e){if(!e)return"";let t=Array.isArray(e)?e.filter(Boolean):[e];if(t.length===0)return"";if(t.length===1)return` or alias "${t[0]}"`;return` or aliases ${t.map((r)=>`"${r}"`).join(", ")}`}class Fa{fileLoader=new za;envProcessor=new mr;validator=new Ta;async loadConfig(e){let t=Date.now(),{cache:r,performance:i,schema:a,validate:o,...s}=e;try{if(r?.enabled){let n=this.checkCache(s.name||"",s);if(n)return n}let l;try{l=await this.loadConfigurationStrategies(s,!0,r)}catch(n){let c=s.__strictErrorHandling;if(n instanceof Error&&n.name==="ConfigNotFoundError"){if(c)throw n;l={...await this.applyEnvironmentVariables(s.name||"",s.defaultConfig,s.checkEnv!==!1,s.verbose||!1),warnings:[`No configuration file found for "${s.name||"config"}", using defaults with environment variables`]}}else if(n instanceof Error&&n.name==="ConfigLoadError"){let u=n.message.includes("EACCES")||n.message.includes("EPERM")||n.message.includes("permission denied"),f=!u&&(n.message.includes("syntax")||n.message.includes("Expected")||n.message.includes("Unexpected")||n.message.includes("BuildMessage")||n.message.includes("errors building")),d=n.message.includes("Configuration must export a valid object")||n.message.includes("Configuration file is empty and exports nothing");if(c&&(d||u))throw n;if(f&&(!c||!d))l={...await this.applyEnvironmentVariables(s.name||"",s.defaultConfig,s.checkEnv!==!1,s.verbose||!1),warnings:["Configuration file has syntax errors, using defaults with environment variables"]};else if(!c)l={...await this.applyEnvironmentVariables(s.name||"",s.defaultConfig,s.checkEnv!==!1,s.verbose||!1),warnings:[`Configuration loading error, using defaults: ${n.message}`]};else throw n}else l={...await this.applyEnvironmentVariables(s.name||"",s.defaultConfig,s.checkEnv!==!1,s.verbose||!1),warnings:[`Configuration loading failed, using defaults: ${n instanceof Error?n.message:String(n)}`]}}if(a||o)await this.validateConfiguration(l.config,a,o,s.name);if(r?.enabled&&l)this.cacheResult(s.name||"",l,r,s);if(i?.enabled){let n={operation:"loadConfig",duration:Date.now()-t,configName:s.name,timestamp:new Date};if(i.onMetrics)i.onMetrics(n);if(i.slowThreshold&&n.duration>i.slowThreshold)K.warn(`Slow configuration loading detected: ${n.duration}ms for ${s.name}`);l.metrics=n}return l}catch(l){if(l instanceof Error&&l.name==="ConfigNotFoundError")throw l;let n=Date.now()-t;throw K.error(`Configuration loading failed after ${n}ms:`,[l instanceof Error?l:Error(String(l))]),l}}async loadConfigurationStrategies(e,t=!1,r){let{name:i="",alias:a,cwd:o,configDir:s,defaultConfig:l,checkEnv:n=!0,arrayStrategy:c="replace",verbose:u=!1}=e,f=o||mt.cwd(),d=[],h=await this.loadLocalConfiguration(i,a,f,s,l,c,u,n,r);if(h)return d.push(...this.getLocalSearchPaths(i,a,f,s)),this.finalizeResult(h,d,n,i,u);let y=await this.loadHomeConfiguration(i,a,l,c,u,n);if(y)return d.push(...this.getHomeSearchPaths(i,a)),this.finalizeResult(y,d,n,i,u);let p=await this.loadPackageJsonConfiguration(i,a,f,l,c,u,n);if(p)return d.push(I(f,"package.json")),this.finalizeResult(p,d,n,i,u);if(d.push(...this.getAllSearchPaths(i,a,f,s)),t)throw xe.configNotFound(i,d,a);return{...await this.applyEnvironmentVariables(i,l,n,u),warnings:[`No configuration file found for "${i}"${Hf(a)}, using defaults with environment variables`]}}async loadLocalConfiguration(e,t,r,i,a,o,s,l,n){let c=l?He(e,a,s):a,u=this.getLocalDirectories(r,i);for(let f of u){if(s)K.info(`Searching for configuration in: ${f}`);let d=this.fileLoader.generateConfigPaths(e,f,t),h=await this.fileLoader.tryLoadFromPaths(d,c,{arrayStrategy:o,verbose:s,cacheTtl:n?.ttl,useCache:!n?.ttl||n.ttl>100});if(h){if(s)K.success(`Configuration loaded from: ${h.source.path}`);return h}}return null}async loadHomeConfiguration(e,t,r,i,a,o){if(!e)return null;let s=o?He(e,r,a):r,l=[I(ce(),".config",e),I(ce(),".config"),ce()];for(let n of l){if(a)K.info(`Checking home directory: ${n}`);let c=this.fileLoader.generateConfigPaths(e,n,t),u=await this.fileLoader.tryLoadFromPaths(c,s,{arrayStrategy:i,verbose:a});if(u){if(a)K.success(`Configuration loaded from home directory: ${u.source.path}`);return u}}return null}async loadPackageJsonConfiguration(e,t,r,i,a,o,s){let l=s?He(e,i,o):i;try{let n=I(r,"package.json");if(!Lc(n))return null;let c={};try{c=JSON.parse(Wc(n,"utf8"))}catch(d){if(o)K.warn("Failed to parse package.json:",[d instanceof Error?d:Error(String(d))]);return null}let u=c[e],f=e;if(!u&&t){let d=Array.isArray(t)?t:[t];for(let h of d){if(!h)continue;if(c[h]){u=c[h],f=h;break}}}if(u&&typeof u==="object"&&!Array.isArray(u)){if(o)K.success(`Configuration loaded from package.json: ${f}`);return{config:ja(l,u,a),source:{type:"package.json",path:n,priority:30,timestamp:new Date}}}}catch(n){if(o)K.warn("Failed to load package.json:",[n instanceof Error?n:Error(String(n))])}return null}async applyEnvironmentVariables(e,t,r,i){if(!r||!e||typeof t!=="object"||t===null||Array.isArray(t))return{config:t,source:{type:"default",priority:10,timestamp:new Date}};return{config:He(e,t,i),source:{type:"environment",priority:20,timestamp:new Date}}}async finalizeResult(e,t,r,i,a){return{config:e.config,source:e.source,path:e.source.path}}async validateConfiguration(e,t,r,i){let a=[];if(r){let o=r(e);if(o)a.push(...o)}if(t){let o=await this.validator.validateConfiguration(e,t);if(!o.isValid)a.push(...o.errors.map((s)=>s.path?`${s.path}: ${s.message}`:s.message))}if(a.length>0)throw xe.configValidation(i||"unknown",a,i)}checkCache(e,t){let r=this.generateCacheKey(e,t);return at.get(r)||null}cacheResult(e,t,r,i){let a=this.generateCacheKey(e,i);at.set(a,t,void 0,r.ttl)}generateCacheKey(e,t){let r=[e];if(t.alias){let i=Array.isArray(t.alias)?t.alias.join(","):t.alias;r.push(`alias:${i}`)}if(t.cwd)r.push(`cwd:${t.cwd}`);if(t.configDir)r.push(`configDir:${t.configDir}`);if("checkEnv"in t)r.push(`checkEnv:${t.checkEnv}`);return r.join("|")}getLocalDirectories(e,t){return Array.from(new Set([e,I(e,"config"),I(e,".config"),t?I(e,t):void 0].filter(Boolean)))}getAllSearchPaths(e,t,r,i){let a=[];return a.push(...this.getLocalSearchPaths(e,t,r,i)),a.push(...this.getHomeSearchPaths(e,t)),a.push(I(r,"package.json")),a}getLocalSearchPaths(e,t,r,i){let a=this.getLocalDirectories(r,i),o=[];for(let s of a)o.push(...this.fileLoader.generateConfigPaths(e,s,t));return o}getHomeSearchPaths(e,t){if(!e)return[];let r=[I(ce(),".config",e),I(ce(),".config"),ce()],i=[];for(let a of r)i.push(...this.fileLoader.generateConfigPaths(e,a,t));return i}async loadConfigWithResult(e){return this.loadConfig(e)}}var Ut=new Fa;async function yr(e){let t="defaultConfig"in e&&e.defaultConfig!==void 0?e.defaultConfig:{},r="cache"in e||"performance"in e||"schema"in e||"validate"in e;try{let i;if(r)i=await Ut.loadConfig(e);else i=await Ut.loadConfig({...e,defaultConfig:t,cache:{enabled:!0},performance:{enabled:!1}});return i?.config??t}catch(i){let a=i instanceof Error?i.name:"UnknownError",o=i instanceof Error?i.message:String(i);if(!(a==="ConfigNotFoundError"||a==="ConfigLoadError"||a==="ConfigValidationError"||o.includes("config"))&&e.verbose)K.warn("Unexpected error loading config, using defaults:",[i instanceof Error?i:Error(String(i))]);let s=r?{...e,defaultConfig:t}:{...e,defaultConfig:t,cache:{enabled:!0},performance:{enabled:!1}};if("checkEnv"in e?e.checkEnv!==!1:!0)return(await Ut.applyEnvironmentVariables(s.name||"",t,!0,s.verbose||!1))?.config??t;return t}}function He(e,t,r=!1){let i=new mr,a=e.toUpperCase().replace(/[^A-Z0-9]/g,"_");function o(s,l=[]){let n={...s};for(let[c,u]of Object.entries(s)){let f=[...l,c],d=[`${a}_${f.join("_").toUpperCase()}`,`${a}_${f.map((p)=>p.toUpperCase()).join("")}`,`${a}_${f.map((p)=>p.replace(/([A-Z])/g,"_$1").toUpperCase()).join("")}`],h,y;for(let p of d)if(h=mt.env[p],h!==void 0){y=p;break}if(h!==void 0&&y)if(typeof u==="boolean")n[c]=["true","1","yes"].includes(h.toLowerCase());else if(typeof u==="number"){let p=Number(h);if(!Number.isNaN(p))n[c]=p}else if(Array.isArray(u))try{n[c]=JSON.parse(h)}catch{n[c]=h.split(",").map((p)=>p.trim())}else n[c]=h;else if(u&&typeof u==="object"&&!Array.isArray(u))n[c]=o(u,f)}return n}return o(t)}var Oh=I(mt.cwd(),"config"),Rh=I(mt.cwd(),"src/generated"),vt={content:["./src/**/*.{html,js,ts,jsx,tsx,stx}"],output:"./dist/crosswind.css",minify:!0,watch:!1,theme:{colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"oklch(98.4% 0.003 247.858)",100:"oklch(96.8% 0.007 247.896)",200:"oklch(92.9% 0.013 255.508)",300:"oklch(86.9% 0.022 252.894)",400:"oklch(70.4% 0.04 256.788)",500:"oklch(55.4% 0.046 257.417)",600:"oklch(44.6% 0.043 257.281)",700:"oklch(37.2% 0.044 257.287)",800:"oklch(27.9% 0.041 260.031)",900:"oklch(20.8% 0.042 265.755)",950:"oklch(12.9% 0.042 264.695)"},gray:{50:"oklch(98.5% 0.002 247.839)",100:"oklch(96.7% 0.003 264.542)",200:"oklch(92.8% 0.006 264.531)",300:"oklch(87.2% 0.01 258.338)",400:"oklch(70.7% 0.022 261.325)",500:"oklch(55.1% 0.027 264.364)",600:"oklch(44.6% 0.03 256.802)",700:"oklch(37.3% 0.034 259.733)",800:"oklch(27.8% 0.033 256.848)",900:"oklch(21% 0.034 264.665)",950:"oklch(13% 0.028 261.692)"},zinc:{50:"oklch(98.5% 0 0)",100:"oklch(96.7% 0.001 286.375)",200:"oklch(92% 0.004 286.32)",300:"oklch(87.1% 0.006 286.286)",400:"oklch(70.5% 0.015 286.067)",500:"oklch(55.2% 0.016 285.938)",600:"oklch(44.2% 0.017 285.786)",700:"oklch(37% 0.013 285.805)",800:"oklch(27.4% 0.006 286.033)",900:"oklch(21% 0.006 285.885)",950:"oklch(14.1% 0.005 285.823)"},neutral:{50:"oklch(98.5% 0 0)",100:"oklch(97% 0 0)",200:"oklch(92.2% 0 0)",300:"oklch(87% 0 0)",400:"oklch(70.8% 0 0)",500:"oklch(55.6% 0 0)",600:"oklch(43.9% 0 0)",700:"oklch(37.1% 0 0)",800:"oklch(26.9% 0 0)",900:"oklch(20.5% 0 0)",950:"oklch(14.5% 0 0)"},stone:{50:"oklch(98.5% 0.001 106.423)",100:"oklch(97% 0.001 106.424)",200:"oklch(92.3% 0.003 48.717)",300:"oklch(86.9% 0.005 56.366)",400:"oklch(70.9% 0.01 56.259)",500:"oklch(55.3% 0.013 58.071)",600:"oklch(44.4% 0.011 73.639)",700:"oklch(37.4% 0.01 67.558)",800:"oklch(26.8% 0.007 34.298)",900:"oklch(21.6% 0.006 56.043)",950:"oklch(14.7% 0.004 49.25)"},red:{50:"oklch(97.1% 0.013 17.38)",100:"oklch(93.6% 0.032 17.717)",200:"oklch(88.5% 0.062 18.334)",300:"oklch(80.8% 0.114 19.571)",400:"oklch(70.4% 0.191 22.216)",500:"oklch(63.7% 0.237 25.331)",600:"oklch(57.7% 0.245 27.325)",700:"oklch(50.5% 0.213 27.518)",800:"oklch(44.4% 0.177 26.899)",900:"oklch(39.6% 0.141 25.723)",950:"oklch(25.8% 0.092 26.042)"},orange:{50:"oklch(98% 0.016 73.684)",100:"oklch(95.4% 0.038 75.164)",200:"oklch(90.1% 0.076 70.697)",300:"oklch(83.7% 0.128 66.29)",400:"oklch(75% 0.183 55.934)",500:"oklch(70.5% 0.213 47.604)",600:"oklch(64.6% 0.222 41.116)",700:"oklch(55.3% 0.195 38.402)",800:"oklch(47% 0.157 37.304)",900:"oklch(40.8% 0.123 38.172)",950:"oklch(26.6% 0.079 36.259)"},amber:{50:"oklch(98.7% 0.022 95.277)",100:"oklch(96.2% 0.059 95.617)",200:"oklch(92.4% 0.12 95.746)",300:"oklch(87.9% 0.169 91.605)",400:"oklch(82.8% 0.189 84.429)",500:"oklch(76.9% 0.188 70.08)",600:"oklch(66.6% 0.179 58.318)",700:"oklch(55.5% 0.163 48.998)",800:"oklch(47.3% 0.137 46.201)",900:"oklch(41.4% 0.112 45.904)",950:"oklch(27.9% 0.077 45.635)"},yellow:{50:"oklch(98.7% 0.026 102.212)",100:"oklch(97.3% 0.071 103.193)",200:"oklch(94.5% 0.129 101.54)",300:"oklch(90.5% 0.182 98.111)",400:"oklch(85.2% 0.199 91.936)",500:"oklch(79.5% 0.184 86.047)",600:"oklch(68.1% 0.162 75.834)",700:"oklch(55.4% 0.135 66.442)",800:"oklch(47.6% 0.114 61.907)",900:"oklch(42.1% 0.095 57.708)",950:"oklch(28.6% 0.066 53.813)"},lime:{50:"oklch(98.6% 0.031 120.757)",100:"oklch(96.7% 0.067 122.328)",200:"oklch(93.8% 0.127 124.321)",300:"oklch(89.7% 0.196 126.665)",400:"oklch(84.1% 0.238 128.85)",500:"oklch(76.8% 0.233 130.85)",600:"oklch(64.8% 0.2 131.684)",700:"oklch(53.2% 0.157 131.589)",800:"oklch(45.3% 0.124 130.933)",900:"oklch(40.5% 0.101 131.063)",950:"oklch(27.4% 0.072 132.109)"},green:{50:"oklch(98.2% 0.018 155.826)",100:"oklch(96.2% 0.044 156.743)",200:"oklch(92.5% 0.084 155.995)",300:"oklch(87.1% 0.15 154.449)",400:"oklch(79.2% 0.209 151.711)",500:"oklch(72.3% 0.219 149.579)",600:"oklch(62.7% 0.194 149.214)",700:"oklch(52.7% 0.154 150.069)",800:"oklch(44.8% 0.119 151.328)",900:"oklch(39.3% 0.095 152.535)",950:"oklch(26.6% 0.065 152.934)"},emerald:{50:"oklch(97.9% 0.021 166.113)",100:"oklch(95% 0.052 163.051)",200:"oklch(90.5% 0.093 164.15)",300:"oklch(84.5% 0.143 164.978)",400:"oklch(76.5% 0.177 163.223)",500:"oklch(69.6% 0.17 162.48)",600:"oklch(59.6% 0.145 163.225)",700:"oklch(50.8% 0.118 165.612)",800:"oklch(43.2% 0.095 166.913)",900:"oklch(37.8% 0.077 168.94)",950:"oklch(26.2% 0.051 172.552)"},teal:{50:"oklch(98.4% 0.014 180.72)",100:"oklch(95.3% 0.051 180.801)",200:"oklch(91% 0.096 180.426)",300:"oklch(85.5% 0.138 181.071)",400:"oklch(77.7% 0.152 181.912)",500:"oklch(70.4% 0.14 182.503)",600:"oklch(60% 0.118 184.704)",700:"oklch(51.1% 0.096 186.391)",800:"oklch(43.7% 0.078 188.216)",900:"oklch(38.6% 0.063 188.416)",950:"oklch(27.7% 0.046 192.524)"},cyan:{50:"oklch(98.4% 0.019 200.873)",100:"oklch(95.6% 0.045 203.388)",200:"oklch(91.7% 0.08 205.041)",300:"oklch(86.5% 0.127 207.078)",400:"oklch(78.9% 0.154 211.53)",500:"oklch(71.5% 0.143 215.221)",600:"oklch(60.9% 0.126 221.723)",700:"oklch(52% 0.105 223.128)",800:"oklch(45% 0.085 224.283)",900:"oklch(39.8% 0.07 227.392)",950:"oklch(30.2% 0.056 229.695)"},sky:{50:"oklch(97.7% 0.013 236.62)",100:"oklch(95.1% 0.026 236.824)",200:"oklch(90.1% 0.058 230.902)",300:"oklch(82.8% 0.111 230.318)",400:"oklch(74.6% 0.16 232.661)",500:"oklch(68.5% 0.169 237.323)",600:"oklch(58.8% 0.158 241.966)",700:"oklch(50% 0.134 242.749)",800:"oklch(44.3% 0.11 240.79)",900:"oklch(39.1% 0.09 240.876)",950:"oklch(29.3% 0.066 243.157)"},blue:{50:"oklch(97% 0.014 254.604)",100:"oklch(93.2% 0.032 255.585)",200:"oklch(88.2% 0.059 254.128)",300:"oklch(80.9% 0.105 251.813)",400:"oklch(70.7% 0.165 254.624)",500:"oklch(62.3% 0.214 259.815)",600:"oklch(54.6% 0.245 262.881)",700:"oklch(48.8% 0.243 264.376)",800:"oklch(42.4% 0.199 265.638)",900:"oklch(37.9% 0.146 265.522)",950:"oklch(28.2% 0.091 267.935)"},indigo:{50:"oklch(96.2% 0.018 272.314)",100:"oklch(93% 0.034 272.788)",200:"oklch(87% 0.065 274.039)",300:"oklch(78.5% 0.115 274.713)",400:"oklch(67.3% 0.182 276.935)",500:"oklch(58.5% 0.233 277.117)",600:"oklch(51.1% 0.262 276.966)",700:"oklch(45.7% 0.24 277.023)",800:"oklch(39.8% 0.195 277.366)",900:"oklch(35.9% 0.144 278.697)",950:"oklch(25.7% 0.09 281.288)"},violet:{50:"oklch(96.9% 0.016 293.756)",100:"oklch(94.3% 0.029 294.588)",200:"oklch(89.4% 0.057 293.283)",300:"oklch(81.1% 0.111 293.571)",400:"oklch(70.2% 0.183 293.541)",500:"oklch(60.6% 0.25 292.717)",600:"oklch(54.1% 0.281 293.009)",700:"oklch(49.1% 0.27 292.581)",800:"oklch(43.2% 0.232 292.759)",900:"oklch(38% 0.189 293.745)",950:"oklch(28.3% 0.141 291.089)"},purple:{50:"oklch(97.7% 0.014 308.299)",100:"oklch(94.6% 0.033 307.174)",200:"oklch(90.2% 0.063 306.703)",300:"oklch(82.7% 0.119 306.383)",400:"oklch(71.4% 0.203 305.504)",500:"oklch(62.7% 0.265 303.9)",600:"oklch(55.8% 0.288 302.321)",700:"oklch(49.6% 0.265 301.924)",800:"oklch(43.8% 0.218 303.724)",900:"oklch(38.1% 0.176 304.987)",950:"oklch(29.1% 0.149 302.717)"},fuchsia:{50:"oklch(97.7% 0.017 320.058)",100:"oklch(95.2% 0.037 318.852)",200:"oklch(90.3% 0.076 319.62)",300:"oklch(83.3% 0.145 321.434)",400:"oklch(74% 0.238 322.16)",500:"oklch(66.7% 0.295 322.15)",600:"oklch(59.1% 0.293 322.896)",700:"oklch(51.8% 0.253 323.949)",800:"oklch(45.2% 0.211 324.591)",900:"oklch(40.1% 0.17 325.612)",950:"oklch(29.3% 0.136 325.661)"},pink:{50:"oklch(97.1% 0.014 343.198)",100:"oklch(94.8% 0.028 342.258)",200:"oklch(89.9% 0.061 343.231)",300:"oklch(82.3% 0.12 346.018)",400:"oklch(71.8% 0.202 349.761)",500:"oklch(65.6% 0.241 354.308)",600:"oklch(59.2% 0.249 0.584)",700:"oklch(52.5% 0.223 3.958)",800:"oklch(45.9% 0.187 3.815)",900:"oklch(40.8% 0.153 2.432)",950:"oklch(28.4% 0.109 3.907)"},rose:{50:"oklch(96.9% 0.015 12.422)",100:"oklch(94.1% 0.03 12.58)",200:"oklch(89.2% 0.058 10.001)",300:"oklch(81% 0.117 11.638)",400:"oklch(71.2% 0.194 13.428)",500:"oklch(64.5% 0.246 16.439)",600:"oklch(58.6% 0.253 17.585)",700:"oklch(51.4% 0.222 16.935)",800:"oklch(45.5% 0.188 13.697)",900:"oklch(41% 0.159 10.272)",950:"oklch(27.1% 0.105 12.094)"}},spacing:{0:"0",px:"1px",0.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},fontSize:{xs:["0.75rem",{lineHeight:"1rem"}],sm:["0.875rem",{lineHeight:"1.25rem"}],base:["1rem",{lineHeight:"1.5rem"}],lg:["1.125rem",{lineHeight:"1.75rem"}],xl:["1.25rem",{lineHeight:"1.75rem"}],"2xl":["1.5rem",{lineHeight:"2rem"}],"3xl":["1.875rem",{lineHeight:"2.25rem"}],"4xl":["2.25rem",{lineHeight:"2.5rem"}],"5xl":["3rem",{lineHeight:"1"}],"6xl":["3.75rem",{lineHeight:"1"}],"7xl":["4.5rem",{lineHeight:"1"}],"8xl":["6rem",{lineHeight:"1"}],"9xl":["8rem",{lineHeight:"1"}]},fontFamily:{sans:["ui-sans-serif","system-ui","sans-serif"],serif:["ui-serif","Georgia","serif"],mono:["ui-monospace","monospace"]},screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},borderRadius:{none:"0",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},boxShadow:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",DEFAULT:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",none:"none"}},shortcuts:{},rules:[],attributify:{enabled:!1,prefix:"hw-",ignoreAttributes:["class","className","style","id","name","type","value","href","src","alt","title","role","for","action","method","target","rel","placeholder","disabled","checked","selected","readonly","required","maxlength","minlength","pattern","autocomplete","autofocus","tabindex","contenteditable","draggable","spellcheck","lang","dir","hidden","slot","part","is","key","ref"]},bracketSyntax:{enabled:!1,colonSyntax:!1,aliases:{col:"col",row:"row",jc:"justify",ji:"justify-items",js:"justify-self",ai:"items",ac:"content",as:"self",wrap:"wrap",nowrap:"nowrap",c:"center",s:"start",e:"end",sb:"between",sa:"around",se:"evenly",st:"stretch"}},variants:{responsive:!0,hover:!0,focus:!0,active:!0,disabled:!0,dark:!0,light:!0,group:!0,peer:!0,before:!0,after:!0,marker:!0,first:!0,last:!0,odd:!0,even:!0,"first-of-type":!0,"last-of-type":!0,visited:!0,checked:!0,"focus-within":!0,"focus-visible":!0,placeholder:!0,selection:!0,file:!0,required:!0,valid:!0,invalid:!0,"read-only":!0,autofill:!0,open:!0,closed:!0,empty:!0,enabled:!0,only:!0,target:!0,indeterminate:!0,default:!0,optional:!0,aria:!0,data:!0,has:!0,not:!0,supports:!0,print:!0,landscape:!0,portrait:!0,"forced-colors":!0,rtl:!0,ltr:!0,"motion-safe":!0,"motion-reduce":!0,"contrast-more":!0,"contrast-less":!0},safelist:[],blocklist:[],preflights:[Vi],presets:[],cssVariables:!1},Qt=null;async function Xf(){if(!Qt)Qt=await yr({name:"crosswind",alias:"css",defaultConfig:vt});return Qt}var Kf=vt;function Xh(e={}){return{name:"bun-plugin-crosswind",async setup(t){let r=await yr({name:"crosswind",defaultConfig:vt}),i={...r,...e.config,theme:{...r.theme,...e.config?.theme},shortcuts:{...r.shortcuts,...e.config?.shortcuts},rules:[...r.rules||[],...e.config?.rules||[]],variants:{...r.variants,...e.config?.variants},safelist:[...r.safelist||[],...e.config?.safelist||[]],blocklist:[...r.blocklist||[],...e.config?.blocklist||[]],preflights:[...r.preflights||[],...e.config?.preflights||[]],presets:[...r.presets||[],...e.config?.presets||[]]},a=e.includePreflight??!0;t.onLoad({filter:/\.html?$/},async({path:o})=>{let s=await Bun.file(o).text(),l=Se(s);for(let u of i.safelist)l.add(u);let n=new gt(i);for(let u of l)n.generate(u);let c=n.toCSS(a,i.minify);return{contents:s.replace("</head>",`<style>${c}</style>
468
+ </head>`),loader:"text"}})}}}var Kh={getCSS:()=>`
469
+ /* Tailwind Forms */
470
+
471
+ [type='text'],
472
+ [type='email'],
473
+ [type='url'],
474
+ [type='password'],
475
+ [type='number'],
476
+ [type='date'],
477
+ [type='datetime-local'],
478
+ [type='month'],
479
+ [type='search'],
480
+ [type='tel'],
481
+ [type='time'],
482
+ [type='week'],
483
+ textarea,
484
+ select {
485
+ appearance: none;
486
+ background-color: #fff;
487
+ border-color: #6b7280;
488
+ border-width: 1px;
489
+ border-radius: 0px;
490
+ padding-top: 0.5rem;
491
+ padding-right: 0.75rem;
492
+ padding-bottom: 0.5rem;
493
+ padding-left: 0.75rem;
494
+ font-size: 1rem;
495
+ line-height: 1.5rem;
496
+ --hw-shadow: 0 0 #0000;
497
+ }
498
+
499
+ [type='text']:focus,
500
+ [type='email']:focus,
501
+ [type='url']:focus,
502
+ [type='password']:focus,
503
+ [type='number']:focus,
504
+ [type='date']:focus,
505
+ [type='datetime-local']:focus,
506
+ [type='month']:focus,
507
+ [type='search']:focus,
508
+ [type='tel']:focus,
509
+ [type='time']:focus,
510
+ [type='week']:focus,
511
+ textarea:focus,
512
+ select:focus {
513
+ outline: 2px solid transparent;
514
+ outline-offset: 2px;
515
+ --hw-ring-inset: var(--hw-empty,/*!*/ /*!*/);
516
+ --hw-ring-offset-width: 0px;
517
+ --hw-ring-offset-color: #fff;
518
+ --hw-ring-color: #2563eb;
519
+ --hw-ring-offset-shadow: var(--hw-ring-inset) 0 0 0 var(--hw-ring-offset-width) var(--hw-ring-offset-color);
520
+ --hw-ring-shadow: var(--hw-ring-inset) 0 0 0 calc(1px + var(--hw-ring-offset-width)) var(--hw-ring-color);
521
+ box-shadow: var(--hw-ring-offset-shadow), var(--hw-ring-shadow), var(--hw-shadow);
522
+ border-color: #2563eb;
523
+ }
524
+
525
+ input::placeholder,
526
+ textarea::placeholder {
527
+ color: #6b7280;
528
+ opacity: 1;
529
+ }
530
+
531
+ ::-webkit-datetime-edit-fields-wrapper {
532
+ padding: 0;
533
+ }
534
+
535
+ ::-webkit-date-and-time-value {
536
+ min-height: 1.5em;
537
+ text-align: inherit;
538
+ }
539
+
540
+ ::-webkit-datetime-edit {
541
+ display: inline-flex;
542
+ }
543
+
544
+ ::-webkit-datetime-edit,
545
+ ::-webkit-datetime-edit-year-field,
546
+ ::-webkit-datetime-edit-month-field,
547
+ ::-webkit-datetime-edit-day-field,
548
+ ::-webkit-datetime-edit-hour-field,
549
+ ::-webkit-datetime-edit-minute-field,
550
+ ::-webkit-datetime-edit-second-field,
551
+ ::-webkit-datetime-edit-millisecond-field,
552
+ ::-webkit-datetime-edit-meridiem-field {
553
+ padding-top: 0;
554
+ padding-bottom: 0;
555
+ }
556
+
557
+ select {
558
+ background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
559
+ background-position: right 0.5rem center;
560
+ background-repeat: no-repeat;
561
+ background-size: 1.5em 1.5em;
562
+ padding-right: 2.5rem;
563
+ print-color-adjust: exact;
564
+ }
565
+
566
+ select[multiple],
567
+ select[size]:where([size]:not([size="1"])) {
568
+ background-image: initial;
569
+ background-position: initial;
570
+ background-repeat: unset;
571
+ background-size: initial;
572
+ padding-right: 0.75rem;
573
+ print-color-adjust: unset;
574
+ }
575
+
576
+ [type='checkbox'],
577
+ [type='radio'] {
578
+ appearance: none;
579
+ padding: 0;
580
+ print-color-adjust: exact;
581
+ display: inline-block;
582
+ vertical-align: middle;
583
+ background-origin: border-box;
584
+ user-select: none;
585
+ flex-shrink: 0;
586
+ height: 1rem;
587
+ width: 1rem;
588
+ color: #2563eb;
589
+ background-color: #fff;
590
+ border-color: #6b7280;
591
+ border-width: 1px;
592
+ --hw-shadow: 0 0 #0000;
593
+ }
594
+
595
+ [type='checkbox'] {
596
+ border-radius: 0px;
597
+ }
598
+
599
+ [type='radio'] {
600
+ border-radius: 100%;
601
+ }
602
+
603
+ [type='checkbox']:focus,
604
+ [type='radio']:focus {
605
+ outline: 2px solid transparent;
606
+ outline-offset: 2px;
607
+ --hw-ring-inset: var(--hw-empty,/*!*/ /*!*/);
608
+ --hw-ring-offset-width: 2px;
609
+ --hw-ring-offset-color: #fff;
610
+ --hw-ring-color: #2563eb;
611
+ --hw-ring-offset-shadow: var(--hw-ring-inset) 0 0 0 var(--hw-ring-offset-width) var(--hw-ring-offset-color);
612
+ --hw-ring-shadow: var(--hw-ring-inset) 0 0 0 calc(2px + var(--hw-ring-offset-width)) var(--hw-ring-color);
613
+ box-shadow: var(--hw-ring-offset-shadow), var(--hw-ring-shadow), var(--hw-shadow);
614
+ }
615
+
616
+ [type='checkbox']:checked,
617
+ [type='radio']:checked {
618
+ border-color: transparent;
619
+ background-color: currentColor;
620
+ background-size: 100% 100%;
621
+ background-position: center;
622
+ background-repeat: no-repeat;
623
+ }
624
+
625
+ [type='checkbox']:checked {
626
+ background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
627
+ }
628
+
629
+ @media (forced-colors: active) {
630
+ [type='checkbox']:checked {
631
+ appearance: auto;
632
+ }
633
+ }
634
+
635
+ [type='radio']:checked {
636
+ background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");
637
+ }
638
+
639
+ @media (forced-colors: active) {
640
+ [type='radio']:checked {
641
+ appearance: auto;
642
+ }
643
+ }
644
+
645
+ [type='checkbox']:checked:hover,
646
+ [type='checkbox']:checked:focus,
647
+ [type='radio']:checked:hover,
648
+ [type='radio']:checked:focus {
649
+ border-color: transparent;
650
+ background-color: currentColor;
651
+ }
652
+
653
+ [type='checkbox']:indeterminate {
654
+ background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");
655
+ border-color: transparent;
656
+ background-color: currentColor;
657
+ background-size: 100% 100%;
658
+ background-position: center;
659
+ background-repeat: no-repeat;
660
+ }
661
+
662
+ @media (forced-colors: active) {
663
+ [type='checkbox']:indeterminate {
664
+ appearance: auto;
665
+ }
666
+ }
667
+
668
+ [type='checkbox']:indeterminate:hover,
669
+ [type='checkbox']:indeterminate:focus {
670
+ border-color: transparent;
671
+ background-color: currentColor;
672
+ }
673
+
674
+ [type='file'] {
675
+ background: unset;
676
+ border-color: inherit;
677
+ border-width: 0;
678
+ border-radius: 0;
679
+ padding: 0;
680
+ font-size: unset;
681
+ line-height: inherit;
682
+ }
683
+
684
+ [type='file']:focus {
685
+ outline: 1px solid ButtonText;
686
+ outline: 1px auto -webkit-focus-ring-color;
687
+ }
688
+ `};export{Ki as writeTransformedFiles,Xi as writeCSS,qi as textAlignRule,Vi as tailwindPreflight,Kh as tailwindFormsPreflight,Oi as spacingRule,Ri as sizingRule,vi as scrollbarRule,ie as resolveColorValue,Xh as plugin,Di as placeholderColorRule,yi as parseClass,Dc as modernNormalize,Mi as leadingRule,Ti as justifyItemsRule,ji as justifyContentRule,Xf as getConfig,Wi as fontWeightRule,Li as fontSizeRule,Ei as flexWrapRule,Ni as flexShrinkRule,Ai as flexRule,Si as flexGrowRule,Ci as flexDirectionRule,Se as extractClasses,mi as extractAttributifyClasses,gi as expandBracketSyntax,wi as displayRule,vt as defaultConfig,xi as contentPropertyRule,ki as containerRule,Kf as config,Pi as colorRule,Ht as builtInRules,Pc as buildAndWrite,Hi as build,Ii as borderWidthRule,Zi as borderSideWidthRule,Ui as borderRadiusRule,te as applyOpacity,zi as alignItemsRule,Fi as alignContentRule,nr as Scanner,gt as CSSGenerator};