@salty-css/webpack 0.0.1-alpha.133 → 0.0.1-alpha.135

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.
@@ -0,0 +1,28 @@
1
+ "use strict";const ue=require("esbuild"),pe=require("child_process"),l=require("path"),u=require("fs"),U=require("fs/promises"),z=require("winston");var J=typeof document<"u"?document.currentScript:null;function de(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const X=de(ue),G=e=>String.fromCharCode(e+(e>25?39:97)),ge=(e,t)=>{let s="",n;for(n=Math.abs(e);n>52;n=n/52|0)s=G(n%52)+s;return s=G(n%52)+s,s.length<t?s=s.padStart(t,"a"):s.length>t&&(s=s.slice(-t)),s},ye=(e,t)=>{let s=t.length;for(;s;)e=e*33^t.charCodeAt(--s);return e},q=(e,t=5)=>{const s=ye(5381,JSON.stringify(e))>>>0;return ge(s,t)};function E(e){return e?typeof e!="string"?E(String(e)):e.replace(/[\s.]/g,"-").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,(t,s)=>(s>0?"-":"")+t.toLowerCase()):""}const me=(e,t)=>{if(typeof e!="string")return{result:e};if(!t)return{result:e};const s=[];return Object.values(t).forEach(n=>{const{pattern:i,transform:r}=n;e=e.replace(i,f=>{const{value:y,css:a}=r(f);return a&&s.push(a),y})}),{result:e,additionalCss:s}},Y=e=>typeof e!="string"?{result:e}:/\{[^{}]+\}/g.test(e)?{result:e.replace(/\{([^{}]+)\}/g,(...n)=>`var(--${E(n[1].replaceAll(".","-"))})`)}:{result:e},_=(e,t,s)=>{if(!e)return"";const n=[],i=Object.entries(e).reduce((f,[y,a])=>{const o=y.trim();if(typeof a=="function"&&(a=a()),typeof a=="object"){if(!a)return f;if(o==="variants")return Object.entries(a).forEach(([c,g])=>{g&&Object.entries(g).forEach(([x,w])=>{if(!w)return;const T=`${t}.${c}-${x}`,k=_(w,T);n.push(k)})}),f;if(o==="defaultVariants")return f;if(o==="compoundVariants")return a.forEach(c=>{const{css:g,...x}=c,w=Object.entries(x).reduce((k,[p,S])=>`${k}.${p}-${S}`,t),T=_(g,w);n.push(T)}),f;if(o.startsWith("@")){const c=_(a,t),g=`${o} {
2
+ ${c.replace(`
3
+ `,`
4
+ `)}
5
+ }`;return n.push(g),f}const d=y.includes("&")?o.replace("&",t):o.startsWith(":")?`${t}${o}`:`${t} ${o}`,b=_(a,d);return n.push(b),f}const m=o.startsWith("-")?o:E(o),F=(d,b=";")=>f=`${f}${d}${b}`,$=d=>F(`${m}:${d}`);if(typeof a=="number")return $(a);if(typeof a!="string")if("toString"in a)a=a.toString();else return f;const{modifiers:h}={},N=function*(){yield Y(a),yield me(a,h)}();for(const{result:d,additionalCss:b=[]}of N)a=d,b.forEach(c=>{const g=_(c,"");F(g,"")});return $(a)},"");return i?t?[`${t} { ${i} }`,...n].join(`
6
+ `):i:n.join(`
7
+ `)},Q=(e,t=[])=>{if(!e)return"";const s=[],n={};if(Object.entries(e).forEach(([i,r])=>{if(typeof r=="object"){if(!r)return;const f=i.trim(),y=Q(r,[...t,f]);s.push(y)}else n[i]=r}),Object.keys(n).length){const i=t.map(E).join("-"),r=_(n,`.${i}`);s.push(r)}return s.join(`
8
+ `)},he=e=>Object.entries(e).reduce((t,[s,n])=>(typeof n=="object"&&(t[s]=v(n).map(i=>`"${i}"`).join(" | ")),t),{}),v=(e,t="",s=new Set)=>e?(Object.entries(e).forEach(([n,i])=>{const r=t?`${t}.${n}`:n;return typeof i=="object"?v(i,r,s):s.add(t)}),[...s]):[],ee=e=>{if(!e||e==="/")throw new Error("Could not find package.json file");const t=l.join(e,"package.json");return u.existsSync(t)?t:ee(l.join(e,".."))},be=async e=>{const t=ee(e);return await U.readFile(t,"utf-8").then(JSON.parse).catch(()=>{})},Se=async e=>{const t=await be(e);if(t)return t.type};let V;const te=async e=>{if(V)return V;const t=await Se(e);return t==="module"?V="esm":(t==="commonjs"||(typeof document>"u"?require("url").pathToFileURL(__filename).href:J&&J.tagName.toUpperCase()==="SCRIPT"&&J.src||new URL("index-1gsL9S8s.cjs",document.baseURI).href).endsWith(".cjs"))&&(V="cjs"),V||"esm"},W=z.createLogger({level:"debug",format:z.format.combine(z.format.colorize(),z.format.cli()),transports:[new z.transports.Console({})]});function se(e){return e?typeof e!="string"?se(String(e)):e.replace(/[\s-]/g,".").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,(t,s)=>(s>0?".":"")+t.toLowerCase()):""}const $e={"*, *::before, *::after":{boxSizing:"border-box"},"*":{margin:0},html:{lineHeight:1.15,textSizeAdjust:"100%",WebkitFontSmoothing:"antialiased"},"img, picture, video, canvas, svg":{display:"block",maxWidth:"100%"},"p, h1, h2, h3, h4, h5, h6":{overflowWrap:"break-word"},p:{textWrap:"pretty"},"h1, h2, h3, h4, h5, h6":{textWrap:"balance"},a:{color:"currentColor"},button:{lineHeight:"1em",color:"currentColor"},"input, optgroup, select, textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"1.15em"}},Z={externalModules:[]},ne=e=>{if(Z.externalModules.length>0)return Z.externalModules;const t=l.join(e,"salty.config.ts"),n=u.readFileSync(t,"utf8").match(/externalModules:\s?\[(.*)\]/);if(!n)return[];const i=n[1].split(",").map(r=>r.replace(/['"`]/g,"").trim());return Z.externalModules=i,i},I=e=>l.join(e,"./saltygen"),oe=["salty","css","styles","styled"],re=(e=[])=>new RegExp(`\\.(${[...oe,...e].join("|")})\\.`),H=(e,t=[])=>re(t).test(e),je=async e=>{const t=I(e),s=l.join(e,"salty.config.ts"),n=l.join(t,"salty.config.js"),i=await te(e),r=ne(e);await X.build({entryPoints:[s],minify:!0,treeShaking:!0,bundle:!0,outfile:n,format:i,external:r});const f=Date.now(),{config:y}=await import(`${n}?t=${f}`);return y},we=async e=>{const t=await je(e),s=new Set,n=(p,S=[])=>p?Object.entries(p).flatMap(([P,j])=>{if(!j)return;if(typeof j=="object")return n(j,[...S,P]);const R=se(P),A=E(P),M=[...S,R].join(".");s.add(`"${M}"`);const D=[...S.map(E),A].join("-"),{result:O}=Y(j);return`--${D}: ${O};`}):[],i=p=>p?Object.entries(p).flatMap(([S,P])=>{const j=n(P);return S==="base"?j.join(""):`${S} { ${j.join("")} }`}):[],r=p=>p?Object.entries(p).flatMap(([S,P])=>Object.entries(P).flatMap(([j,R])=>{const A=n(R,[S]),M=`.${S}-${j}, [data-${S}="${j}"]`,D=A.join("");return`${M} { ${D} }`})):[],f=n(t.variables),y=i(t.responsiveVariables),a=r(t.conditionalVariables),o=I(e),m=l.join(o,"css/_variables.css"),F=`:root { ${f.join("")} ${y.join("")} } ${a.join("")}`;u.writeFileSync(m,F);const $=l.join(o,"css/_global.css"),h=_(t.global,"");u.writeFileSync($,`@layer global { ${h} }`);const C=l.join(o,"css/_reset.css"),d=t.reset==="none"?{}:typeof t.reset=="object"?t.reset:$e,b=_(d,"");u.writeFileSync(C,`@layer reset { ${b} }`);const c=l.join(o,"css/_templates.css"),g=Q(t.templates),x=he(t.templates);u.writeFileSync(c,g);const w=l.join(o,"types/css-tokens.d.ts"),k=`
9
+ // Variable types
10
+ type VariableTokens = ${[...s].join("|")};
11
+ type PropertyValueToken = \`{\${VariableTokens}}\`;
12
+
13
+ // Template types
14
+ type TemplateTokens = {
15
+ ${Object.entries(x).map(([p,S])=>`${p}?: ${S}`).join(`
16
+ `)}
17
+ }
18
+ `;u.writeFileSync(w,k)},B=async(e,t,s)=>{const n=q(t),i=l.join(s,"./temp");u.existsSync(i)||u.mkdirSync(i);const r=l.parse(t);let f=u.readFileSync(t,"utf8");f=f.replace(/styled\(([^"'`{,]+),/g,($,h)=>{if(/^['"`]/.test(h))return $;const N=new RegExp(`import\\s?\\{[^{}]*${h}[^{}]*\\}\\s?from\\s?([^{};]+);`);if(!N.test(f))return $;const b=N.exec(f);if(b){const c=b.at(1);if(oe.some(x=>c==null?void 0:c.includes(x)))return $}return"styled('div',"});const y=l.join(s,"js",n+".js"),a=ne(e),o=await te(e);await X.build({stdin:{contents:f,sourcefile:r.base,resolveDir:r.dir,loader:"tsx"},minify:!1,treeShaking:!0,bundle:!0,outfile:y,format:o,target:["node20"],keepNames:!0,external:a,packages:"external"});const m=Date.now();return await import(`${y}?t=${m}`)},K=async e=>{const t=I(e),s=l.join(t,"salty.config.js"),n=Date.now(),{config:i}=await import(`${s}?t=${n}`);return i},ie=()=>{try{return process.env.NODE_ENV==="production"}catch{return!1}},Fe=async(e,t=ie())=>{try{const s=Date.now();t?W.info("Generating CSS in production mode! 🔥"):W.info("Generating CSS in development mode! 🚀");const n=[],i=[],r=I(e),f=l.join(r,"index.css");(()=>{u.existsSync(r)&&pe.execSync("rm -rf "+r),u.mkdirSync(r),u.mkdirSync(l.join(r,"css")),u.mkdirSync(l.join(r,"types"))})(),await we(e);const a=await K(e);async function o(c,g){const x=["node_modules","saltygen"],w=u.statSync(c);if(w.isDirectory()){const T=u.readdirSync(c);if(x.some(p=>c.includes(p)))return;await Promise.all(T.map(p=>o(l.join(c,p),l.join(g,p))))}else if(w.isFile()&&H(c)){const k=await B(e,c,r),p=[];Object.entries(k).forEach(([M,D])=>{if(D.isKeyframes&&D.css){const L=`a_${D.animationName}.css`,le=`css/${L}`,fe=l.join(r,le);n.push(L),u.writeFileSync(fe,D.css);return}if(!D.generator)return;const O=D.generator._withBuildContext({name:M,config:a,prod:t});i[O.priority]||(i[O.priority]=[]),i[O.priority].push(O.cssFileName),p.push(O.cssFileName);const ce=`css/${O.cssFileName}`,ae=l.join(r,ce);u.writeFileSync(ae,O.css)});const S=p.map(M=>`@import url('./${M}');`).join(`
19
+ `),P=q(c,6),j=l.parse(c),R=E(j.name),A=l.join(r,`css/f_${R}-${P}.css`);u.writeFileSync(A,S)}}await o(e,r);const m=n.map(c=>`@import url('./css/${c}');`).join(`
20
+ `);let C=`@layer reset, global, l0, l1, l2, l3, l4, l5, l6, l7, l8;
21
+
22
+ ${["_variables.css","_reset.css","_global.css","_templates.css"].filter(c=>{try{return u.readFileSync(l.join(r,"css",c),"utf8").length>0}catch{return!1}}).map(c=>`@import url('./css/${c}');`).join(`
23
+ `)}
24
+ ${m}`;if(a.importStrategy!=="component"){const c=i.reduce((g,x,w)=>{const T=x.reduce((k,p)=>k+`@import url('./css/${p}') layer(l${w});`,"");return`${g}
25
+ ${T}`},"");C+=c}u.writeFileSync(f,C);const d=Date.now()-s,b=d<200?"🔥":d<500?"🚀":d<1e3?"🎉":d<2e3?"🚗":d<5e3?"🤔":"🥴";W.info(`Generated CSS in ${d}ms! ${b}`)}catch(s){console.error(s)}},xe=async(e,t)=>{try{const s=[],n=l.join(e,"./saltygen"),i=l.join(n,"index.css");if(H(t)){const f=await K(e),y=await B(e,t,n);Object.entries(y).forEach(([$,h])=>{if(h.isKeyframes&&h.css){const c=`css/${`a_${h.animationName}.css`}`,g=l.join(n,c);u.writeFileSync(g,h.css);return}if(!h.generator)return;const C=h.generator._withBuildContext({name:$,config:f}),N=`css/${C.cssFileName}`,d=l.join(n,N);s.push(C.cssFileName),u.writeFileSync(d,C.css)});const a=u.readFileSync(i,"utf8").split(`
26
+ `),o=s.map($=>`@import url('../saltygen/css/${$}');`),F=[...new Set([...a,...o])].join(`
27
+ `);u.writeFileSync(i,F)}}catch(s){console.error(s)}},Ce=async(e,t,s=ie())=>{try{const n=l.join(e,"./saltygen");if(H(t)){const r=u.readFileSync(t,"utf8");r.replace(/^(?!export\s)const\s.*/gm,m=>`export ${m}`)!==r&&await U.writeFile(t,r);const y=await K(e),a=await B(e,t,n);let o=r;if(Object.entries(a).forEach(([m,F])=>{var P;if(F.isKeyframes||!F.generator)return;const $=F.generator._withBuildContext({name:m,config:y,prod:s}),h=new RegExp(`\\s${m}[=\\s]+[^()]+styled\\(([^,]+),`,"g").exec(r);if(!h)return console.error("Could not find the original declaration");const C=(P=h.at(1))==null?void 0:P.trim(),N=new RegExp(`\\s${m}[=\\s]+styled\\(`,"g").exec(o);if(!N)return console.error("Could not find the original declaration");const{index:d}=N;let b=!1;const c=setTimeout(()=>b=!0,5e3);let g=0,x=!1,w=0;for(;!x&&!b;){const j=o[d+g];j==="("&&w++,j===")"&&w--,w===0&&j===")"&&(x=!0),g>o.length&&(b=!0),g++}if(!b)clearTimeout(c);else throw new Error("Failed to find the end of the styled call and timed out");const T=d+g,k=o.slice(d,T),p=o,S=` ${m} = styled(${C}, "${$.classNames}", ${JSON.stringify($.props)});`;o=o.replace(k,S),p===o&&console.error("Minimize file failed to change content",{name:m,tagName:C})}),y.importStrategy==="component"){const m=q(t,6),F=l.parse(t);o=`import '../../saltygen/css/${`f_${E(F.name)}-${m}.css`}';
28
+ ${o}`}return o=o.replace("{ styled }","{ styledClient as styled }"),o=o.replace("@salty-css/react/styled","@salty-css/react/styled-client"),o}}catch(n){console.error("Error in minimizeFile:",n)}};exports.generateCss=Fe;exports.generateFile=xe;exports.minimizeFile=Ce;exports.saltyFileRegExp=re;
@@ -0,0 +1,413 @@
1
+ import * as Q from "esbuild";
2
+ import { execSync as ut } from "child_process";
3
+ import { join as f, parse as B } from "path";
4
+ import { existsSync as K, writeFileSync as N, readFileSync as J, mkdirSync as W, statSync as dt, readdirSync as gt } from "fs";
5
+ import { readFile as mt, writeFile as yt } from "fs/promises";
6
+ import { createLogger as ht, format as I, transports as $t } from "winston";
7
+ const Y = (t) => String.fromCharCode(t + (t > 25 ? 39 : 97)), bt = (t, e) => {
8
+ let s = "", n;
9
+ for (n = Math.abs(t); n > 52; n = n / 52 | 0) s = Y(n % 52) + s;
10
+ return s = Y(n % 52) + s, s.length < e ? s = s.padStart(e, "a") : s.length > e && (s = s.slice(-e)), s;
11
+ }, St = (t, e) => {
12
+ let s = e.length;
13
+ for (; s; ) t = t * 33 ^ e.charCodeAt(--s);
14
+ return t;
15
+ }, G = (t, e = 5) => {
16
+ const s = St(5381, JSON.stringify(t)) >>> 0;
17
+ return bt(s, e);
18
+ };
19
+ function V(t) {
20
+ return t ? typeof t != "string" ? V(String(t)) : t.replace(/[\s.]/g, "-").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g, (e, s) => (s > 0 ? "-" : "") + e.toLowerCase()) : "";
21
+ }
22
+ const jt = (t, e) => {
23
+ if (typeof t != "string") return { result: t };
24
+ if (!e) return { result: t };
25
+ const s = [];
26
+ return Object.values(e).forEach((n) => {
27
+ const { pattern: i, transform: r } = n;
28
+ t = t.replace(i, (l) => {
29
+ const { value: g, css: a } = r(l);
30
+ return a && s.push(a), g;
31
+ });
32
+ }), { result: t, additionalCss: s };
33
+ }, v = (t) => typeof t != "string" ? { result: t } : /\{[^{}]+\}/g.test(t) ? { result: t.replace(/\{([^{}]+)\}/g, (...n) => `var(--${V(n[1].replaceAll(".", "-"))})`) } : { result: t }, O = (t, e, s) => {
34
+ if (!t) return "";
35
+ const n = [], i = Object.entries(t).reduce((l, [g, a]) => {
36
+ const o = g.trim();
37
+ if (typeof a == "function" && (a = a()), typeof a == "object") {
38
+ if (!a) return l;
39
+ if (o === "variants")
40
+ return Object.entries(a).forEach(([c, d]) => {
41
+ d && Object.entries(d).forEach(([x, j]) => {
42
+ if (!j) return;
43
+ const T = `${e}.${c}-${x}`, C = O(j, T);
44
+ n.push(C);
45
+ });
46
+ }), l;
47
+ if (o === "defaultVariants")
48
+ return l;
49
+ if (o === "compoundVariants")
50
+ return a.forEach((c) => {
51
+ const { css: d, ...x } = c, j = Object.entries(x).reduce((C, [p, $]) => `${C}.${p}-${$}`, e), T = O(d, j);
52
+ n.push(T);
53
+ }), l;
54
+ if (o.startsWith("@")) {
55
+ const c = O(a, e), d = `${o} {
56
+ ${c.replace(`
57
+ `, `
58
+ `)}
59
+ }`;
60
+ return n.push(d), l;
61
+ }
62
+ const u = g.includes("&") ? o.replace("&", e) : o.startsWith(":") ? `${e}${o}` : `${e} ${o}`, h = O(a, u);
63
+ return n.push(h), l;
64
+ }
65
+ const m = o.startsWith("-") ? o : V(o), w = (u, h = ";") => l = `${l}${u}${h}`, b = (u) => w(`${m}:${u}`);
66
+ if (typeof a == "number") return b(a);
67
+ if (typeof a != "string")
68
+ if ("toString" in a) a = a.toString();
69
+ else return l;
70
+ const { modifiers: y } = {}, P = function* () {
71
+ yield v(a), yield jt(a, y);
72
+ }();
73
+ for (const { result: u, additionalCss: h = [] } of P)
74
+ a = u, h.forEach((c) => {
75
+ const d = O(c, "");
76
+ w(d, "");
77
+ });
78
+ return b(a);
79
+ }, "");
80
+ return i ? e ? [`${e} { ${i} }`, ...n].join(`
81
+ `) : i : n.join(`
82
+ `);
83
+ }, tt = (t, e = []) => {
84
+ if (!t) return "";
85
+ const s = [], n = {};
86
+ if (Object.entries(t).forEach(([i, r]) => {
87
+ if (typeof r == "object") {
88
+ if (!r) return;
89
+ const l = i.trim(), g = tt(r, [...e, l]);
90
+ s.push(g);
91
+ } else
92
+ n[i] = r;
93
+ }), Object.keys(n).length) {
94
+ const i = e.map(V).join("-"), r = O(n, `.${i}`);
95
+ s.push(r);
96
+ }
97
+ return s.join(`
98
+ `);
99
+ }, wt = (t) => Object.entries(t).reduce((e, [s, n]) => (typeof n == "object" && (e[s] = et(n).map((i) => `"${i}"`).join(" | ")), e), {}), et = (t, e = "", s = /* @__PURE__ */ new Set()) => t ? (Object.entries(t).forEach(([n, i]) => {
100
+ const r = e ? `${e}.${n}` : n;
101
+ return typeof i == "object" ? et(i, r, s) : s.add(e);
102
+ }), [...s]) : [], st = (t) => {
103
+ if (!t || t === "/") throw new Error("Could not find package.json file");
104
+ const e = f(t, "package.json");
105
+ return K(e) ? e : st(f(t, ".."));
106
+ }, xt = async (t) => {
107
+ const e = st(t);
108
+ return await mt(e, "utf-8").then(JSON.parse).catch(() => {
109
+ });
110
+ }, Ft = async (t) => {
111
+ const e = await xt(t);
112
+ if (e)
113
+ return e.type;
114
+ };
115
+ let _;
116
+ const nt = async (t) => {
117
+ if (_) return _;
118
+ const e = await Ft(t);
119
+ return e === "module" ? _ = "esm" : (e === "commonjs" || import.meta.url.endsWith(".cjs")) && (_ = "cjs"), _ || "esm";
120
+ }, Z = ht({
121
+ level: "debug",
122
+ format: I.combine(I.colorize(), I.cli()),
123
+ transports: [new $t.Console({})]
124
+ });
125
+ function ot(t) {
126
+ return t ? typeof t != "string" ? ot(String(t)) : t.replace(/[\s-]/g, ".").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g, (e, s) => (s > 0 ? "." : "") + e.toLowerCase()) : "";
127
+ }
128
+ const Ct = {
129
+ /** Set box model to border-box */
130
+ "*, *::before, *::after": {
131
+ boxSizing: "border-box"
132
+ },
133
+ /** Remove default margin and padding */
134
+ "*": {
135
+ margin: 0
136
+ },
137
+ /** Remove adjust font properties */
138
+ html: {
139
+ lineHeight: 1.15,
140
+ textSizeAdjust: "100%",
141
+ WebkitFontSmoothing: "antialiased"
142
+ },
143
+ /** Make media elements responsive */
144
+ "img, picture, video, canvas, svg": {
145
+ display: "block",
146
+ maxWidth: "100%"
147
+ },
148
+ /** Avoid overflow of text */
149
+ "p, h1, h2, h3, h4, h5, h6": {
150
+ overflowWrap: "break-word"
151
+ },
152
+ /** Improve text wrapping */
153
+ p: {
154
+ textWrap: "pretty"
155
+ },
156
+ "h1, h2, h3, h4, h5, h6": {
157
+ textWrap: "balance"
158
+ },
159
+ /** Improve link color */
160
+ a: {
161
+ color: "currentColor"
162
+ },
163
+ /** Improve button line height */
164
+ button: {
165
+ lineHeight: "1em",
166
+ color: "currentColor"
167
+ },
168
+ /** Improve form elements */
169
+ "input, optgroup, select, textarea": {
170
+ fontFamily: "inherit",
171
+ fontSize: "100%",
172
+ lineHeight: "1.15em"
173
+ }
174
+ }, H = {
175
+ externalModules: []
176
+ }, rt = (t) => {
177
+ if (H.externalModules.length > 0) return H.externalModules;
178
+ const e = f(t, "salty.config.ts"), n = J(e, "utf8").match(/externalModules:\s?\[(.*)\]/);
179
+ if (!n) return [];
180
+ const i = n[1].split(",").map((r) => r.replace(/['"`]/g, "").trim());
181
+ return H.externalModules = i, i;
182
+ }, z = (t) => f(t, "./saltygen"), it = ["salty", "css", "styles", "styled"], kt = (t = []) => new RegExp(`\\.(${[...it, ...t].join("|")})\\.`), L = (t, e = []) => kt(e).test(t), Nt = async (t) => {
183
+ const e = z(t), s = f(t, "salty.config.ts"), n = f(e, "salty.config.js"), i = await nt(t), r = rt(t);
184
+ await Q.build({
185
+ entryPoints: [s],
186
+ minify: !0,
187
+ treeShaking: !0,
188
+ bundle: !0,
189
+ outfile: n,
190
+ format: i,
191
+ external: r
192
+ });
193
+ const l = Date.now(), { config: g } = await import(`${n}?t=${l}`);
194
+ return g;
195
+ }, Pt = async (t) => {
196
+ const e = await Nt(t), s = /* @__PURE__ */ new Set(), n = (p, $ = []) => p ? Object.entries(p).flatMap(([k, S]) => {
197
+ if (!S) return;
198
+ if (typeof S == "object") return n(S, [...$, k]);
199
+ const A = ot(k), R = V(k), M = [...$, A].join(".");
200
+ s.add(`"${M}"`);
201
+ const D = [...$.map(V), R].join("-"), { result: E } = v(S);
202
+ return `--${D}: ${E};`;
203
+ }) : [], i = (p) => p ? Object.entries(p).flatMap(([$, k]) => {
204
+ const S = n(k);
205
+ return $ === "base" ? S.join("") : `${$} { ${S.join("")} }`;
206
+ }) : [], r = (p) => p ? Object.entries(p).flatMap(([$, k]) => Object.entries(k).flatMap(([S, A]) => {
207
+ const R = n(A, [$]), M = `.${$}-${S}, [data-${$}="${S}"]`, D = R.join("");
208
+ return `${M} { ${D} }`;
209
+ })) : [], l = n(e.variables), g = i(e.responsiveVariables), a = r(e.conditionalVariables), o = z(t), m = f(o, "css/_variables.css"), w = `:root { ${l.join("")} ${g.join("")} } ${a.join("")}`;
210
+ N(m, w);
211
+ const b = f(o, "css/_global.css"), y = O(e.global, "");
212
+ N(b, `@layer global { ${y} }`);
213
+ const F = f(o, "css/_reset.css"), u = e.reset === "none" ? {} : typeof e.reset == "object" ? e.reset : Ct, h = O(u, "");
214
+ N(F, `@layer reset { ${h} }`);
215
+ const c = f(o, "css/_templates.css"), d = tt(e.templates), x = wt(e.templates);
216
+ N(c, d);
217
+ const j = f(o, "types/css-tokens.d.ts"), C = `
218
+ // Variable types
219
+ type VariableTokens = ${[...s].join("|")};
220
+ type PropertyValueToken = \`{\${VariableTokens}}\`;
221
+
222
+ // Template types
223
+ type TemplateTokens = {
224
+ ${Object.entries(x).map(([p, $]) => `${p}?: ${$}`).join(`
225
+ `)}
226
+ }
227
+ `;
228
+ N(j, C);
229
+ }, q = async (t, e, s) => {
230
+ const n = G(e), i = f(s, "./temp");
231
+ K(i) || W(i);
232
+ const r = B(e);
233
+ let l = J(e, "utf8");
234
+ l = l.replace(/styled\(([^"'`{,]+),/g, (b, y) => {
235
+ if (/^['"`]/.test(y)) return b;
236
+ const P = new RegExp(`import\\s?\\{[^{}]*${y}[^{}]*\\}\\s?from\\s?([^{};]+);`);
237
+ if (!P.test(l)) return b;
238
+ const h = P.exec(l);
239
+ if (h) {
240
+ const c = h.at(1);
241
+ if (it.some((x) => c == null ? void 0 : c.includes(x))) return b;
242
+ }
243
+ return "styled('div',";
244
+ });
245
+ const g = f(s, "js", n + ".js"), a = rt(t), o = await nt(t);
246
+ await Q.build({
247
+ stdin: {
248
+ contents: l,
249
+ sourcefile: r.base,
250
+ resolveDir: r.dir,
251
+ loader: "tsx"
252
+ },
253
+ minify: !1,
254
+ treeShaking: !0,
255
+ bundle: !0,
256
+ outfile: g,
257
+ format: o,
258
+ target: ["node20"],
259
+ keepNames: !0,
260
+ external: a,
261
+ packages: "external"
262
+ });
263
+ const m = Date.now();
264
+ return await import(`${g}?t=${m}`);
265
+ }, U = async (t) => {
266
+ const e = z(t), s = f(e, "salty.config.js"), n = Date.now(), { config: i } = await import(`${s}?t=${n}`);
267
+ return i;
268
+ }, ct = () => {
269
+ try {
270
+ return process.env.NODE_ENV === "production";
271
+ } catch {
272
+ return !1;
273
+ }
274
+ }, Mt = async (t, e = ct()) => {
275
+ try {
276
+ const s = Date.now();
277
+ e ? Z.info("Generating CSS in production mode! 🔥") : Z.info("Generating CSS in development mode! 🚀");
278
+ const n = [], i = [], r = z(t), l = f(r, "index.css");
279
+ (() => {
280
+ K(r) && ut("rm -rf " + r), W(r), W(f(r, "css")), W(f(r, "types"));
281
+ })(), await Pt(t);
282
+ const a = await U(t);
283
+ async function o(c, d) {
284
+ const x = ["node_modules", "saltygen"], j = dt(c);
285
+ if (j.isDirectory()) {
286
+ const T = gt(c);
287
+ if (x.some((p) => c.includes(p))) return;
288
+ await Promise.all(T.map((p) => o(f(c, p), f(d, p))));
289
+ } else if (j.isFile() && L(c)) {
290
+ const C = await q(t, c, r), p = [];
291
+ Object.entries(C).forEach(([M, D]) => {
292
+ if (D.isKeyframes && D.css) {
293
+ const X = `a_${D.animationName}.css`, ft = `css/${X}`, pt = f(r, ft);
294
+ n.push(X), N(pt, D.css);
295
+ return;
296
+ }
297
+ if (!D.generator) return;
298
+ const E = D.generator._withBuildContext({
299
+ name: M,
300
+ config: a,
301
+ prod: e
302
+ });
303
+ i[E.priority] || (i[E.priority] = []), i[E.priority].push(E.cssFileName), p.push(E.cssFileName);
304
+ const at = `css/${E.cssFileName}`, lt = f(r, at);
305
+ N(lt, E.css);
306
+ });
307
+ const $ = p.map((M) => `@import url('./${M}');`).join(`
308
+ `), k = G(c, 6), S = B(c), A = V(S.name), R = f(r, `css/f_${A}-${k}.css`);
309
+ N(R, $);
310
+ }
311
+ }
312
+ await o(t, r);
313
+ const m = n.map((c) => `@import url('./css/${c}');`).join(`
314
+ `);
315
+ let F = `@layer reset, global, l0, l1, l2, l3, l4, l5, l6, l7, l8;
316
+
317
+ ${["_variables.css", "_reset.css", "_global.css", "_templates.css"].filter((c) => {
318
+ try {
319
+ return J(f(r, "css", c), "utf8").length > 0;
320
+ } catch {
321
+ return !1;
322
+ }
323
+ }).map((c) => `@import url('./css/${c}');`).join(`
324
+ `)}
325
+ ${m}`;
326
+ if (a.importStrategy !== "component") {
327
+ const c = i.reduce((d, x, j) => {
328
+ const T = x.reduce((C, p) => C + `@import url('./css/${p}') layer(l${j});`, "");
329
+ return `${d}
330
+ ${T}`;
331
+ }, "");
332
+ F += c;
333
+ }
334
+ N(l, F);
335
+ const u = Date.now() - s, h = u < 200 ? "🔥" : u < 500 ? "🚀" : u < 1e3 ? "🎉" : u < 2e3 ? "🚗" : u < 5e3 ? "🤔" : "🥴";
336
+ Z.info(`Generated CSS in ${u}ms! ${h}`);
337
+ } catch (s) {
338
+ console.error(s);
339
+ }
340
+ }, _t = async (t, e) => {
341
+ try {
342
+ const s = [], n = f(t, "./saltygen"), i = f(n, "index.css");
343
+ if (L(e)) {
344
+ const l = await U(t), g = await q(t, e, n);
345
+ Object.entries(g).forEach(([b, y]) => {
346
+ if (y.isKeyframes && y.css) {
347
+ const c = `css/${`a_${y.animationName}.css`}`, d = f(n, c);
348
+ N(d, y.css);
349
+ return;
350
+ }
351
+ if (!y.generator) return;
352
+ const F = y.generator._withBuildContext({
353
+ name: b,
354
+ config: l
355
+ }), P = `css/${F.cssFileName}`, u = f(n, P);
356
+ s.push(F.cssFileName), N(u, F.css);
357
+ });
358
+ const a = J(i, "utf8").split(`
359
+ `), o = s.map((b) => `@import url('../saltygen/css/${b}');`), w = [.../* @__PURE__ */ new Set([...a, ...o])].join(`
360
+ `);
361
+ N(i, w);
362
+ }
363
+ } catch (s) {
364
+ console.error(s);
365
+ }
366
+ }, At = async (t, e, s = ct()) => {
367
+ try {
368
+ const n = f(t, "./saltygen");
369
+ if (L(e)) {
370
+ const r = J(e, "utf8");
371
+ r.replace(/^(?!export\s)const\s.*/gm, (m) => `export ${m}`) !== r && await yt(e, r);
372
+ const g = await U(t), a = await q(t, e, n);
373
+ let o = r;
374
+ if (Object.entries(a).forEach(([m, w]) => {
375
+ var k;
376
+ if (w.isKeyframes || !w.generator) return;
377
+ const b = w.generator._withBuildContext({
378
+ name: m,
379
+ config: g,
380
+ prod: s
381
+ }), y = new RegExp(`\\s${m}[=\\s]+[^()]+styled\\(([^,]+),`, "g").exec(r);
382
+ if (!y) return console.error("Could not find the original declaration");
383
+ const F = (k = y.at(1)) == null ? void 0 : k.trim(), P = new RegExp(`\\s${m}[=\\s]+styled\\(`, "g").exec(o);
384
+ if (!P) return console.error("Could not find the original declaration");
385
+ const { index: u } = P;
386
+ let h = !1;
387
+ const c = setTimeout(() => h = !0, 5e3);
388
+ let d = 0, x = !1, j = 0;
389
+ for (; !x && !h; ) {
390
+ const S = o[u + d];
391
+ S === "(" && j++, S === ")" && j--, j === 0 && S === ")" && (x = !0), d > o.length && (h = !0), d++;
392
+ }
393
+ if (!h) clearTimeout(c);
394
+ else throw new Error("Failed to find the end of the styled call and timed out");
395
+ const T = u + d, C = o.slice(u, T), p = o, $ = ` ${m} = styled(${F}, "${b.classNames}", ${JSON.stringify(b.props)});`;
396
+ o = o.replace(C, $), p === o && console.error("Minimize file failed to change content", { name: m, tagName: F });
397
+ }), g.importStrategy === "component") {
398
+ const m = G(e, 6), w = B(e);
399
+ o = `import '../../saltygen/css/${`f_${V(w.name)}-${m}.css`}';
400
+ ${o}`;
401
+ }
402
+ return o = o.replace("{ styled }", "{ styledClient as styled }"), o = o.replace("@salty-css/react/styled", "@salty-css/react/styled-client"), o;
403
+ }
404
+ } catch (n) {
405
+ console.error("Error in minimizeFile:", n);
406
+ }
407
+ };
408
+ export {
409
+ _t as a,
410
+ Mt as g,
411
+ At as m,
412
+ kt as s
413
+ };
package/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("path"),u=require("./index-B__mWF2q.cjs"),r=(e,s,o=!1,n=!1)=>{var a,l,t;(l=(a=e.module)==null?void 0:a.rules)==null||l.push({test:u.saltyFileRegExp(),use:[{loader:p.resolve(__dirname,n?"./loader.cjs":"./loader.js"),options:{dir:s}}]}),o||(t=e.plugins)==null||t.push({apply:i=>{i.hooks.afterPlugins.tap({name:"generateCss"},async()=>{await u.generateCss(s)})}})};exports.default=r;exports.saltyPlugin=r;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("path"),u=require("./index-1gsL9S8s.cjs"),r=(e,s,o=!1,n=!1)=>{var a,l,t;(l=(a=e.module)==null?void 0:a.rules)==null||l.push({test:u.saltyFileRegExp(),use:[{loader:p.resolve(__dirname,n?"./loader.cjs":"./loader.js"),options:{dir:s}}]}),o||(t=e.plugins)==null||t.push({apply:i=>{i.hooks.afterPlugins.tap({name:"generateCss"},async()=>{await u.generateCss(s)})}})};exports.default=r;exports.saltyPlugin=r;
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { resolve as n } from "path";
2
- import { s as u, g as i } from "./index-DbupcYa1.js";
2
+ import { s as u, g as i } from "./index-cNXYz3Jt.js";
3
3
  const g = (s, e, o = !1, r = !1) => {
4
4
  var a, l, t;
5
5
  (l = (a = s.module) == null ? void 0 : a.rules) == null || l.push({
package/loader.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const i=require("./index-B__mWF2q.cjs");async function n(){const{dir:e}=this.getOptions(),{resourcePath:t}=this;return await i.generateFile(e,t),await i.minimizeFile(e,t)}module.exports=n;
1
+ "use strict";const i=require("./index-1gsL9S8s.cjs");async function n(){const{dir:e}=this.getOptions(),{resourcePath:t}=this;return await i.generateFile(e,t),await i.minimizeFile(e,t)}module.exports=n;
package/loader.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as e, m as i } from "./index-DbupcYa1.js";
1
+ import { a as e, m as i } from "./index-cNXYz3Jt.js";
2
2
  async function s() {
3
3
  const { dir: t } = this.getOptions(), { resourcePath: a } = this;
4
4
  return await e(t, a), await i(t, a);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salty-css/webpack",
3
- "version": "0.0.1-alpha.133",
3
+ "version": "0.0.1-alpha.135",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "typings": "./dist/index.d.ts",
@@ -34,7 +34,7 @@
34
34
  }
35
35
  },
36
36
  "dependencies": {
37
- "@salty-css/core": "^0.0.1-alpha.133",
37
+ "@salty-css/core": "^0.0.1-alpha.135",
38
38
  "webpack": ">=5.x"
39
39
  }
40
40
  }
@@ -1,28 +0,0 @@
1
- "use strict";const fe=require("esbuild"),ue=require("child_process"),c=require("path"),u=require("fs"),U=require("fs/promises"),z=require("winston");var W=typeof document<"u"?document.currentScript:null;function pe(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const X=pe(fe),G=e=>String.fromCharCode(e+(e>25?39:97)),de=(e,t)=>{let s="",n;for(n=Math.abs(e);n>52;n=n/52|0)s=G(n%52)+s;return s=G(n%52)+s,s.length<t?s=s.padStart(t,"a"):s.length>t&&(s=s.slice(-t)),s},ge=(e,t)=>{let s=t.length;for(;s;)e=e*33^t.charCodeAt(--s);return e},I=(e,t=5)=>{const s=ge(5381,JSON.stringify(e))>>>0;return de(s,t)};function _(e){return e?typeof e!="string"?_(String(e)):e.replace(/[\s.]/g,"-").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,(t,s)=>(s>0?"-":"")+t.toLowerCase()):""}const ye=(e,t)=>{if(typeof e!="string")return{result:e};if(!t)return{result:e};const s=[];return Object.values(t).forEach(n=>{const{pattern:i,transform:r}=n;e=e.replace(i,g=>{const{value:f,css:h}=r(g);return h&&s.push(h),f})}),{result:e,additionalCss:s}},Y=e=>typeof e!="string"?{result:e}:/\{[^{}]+\}/g.test(e)?{result:e.replace(/\{([^{}]+)\}/g,(...n)=>`var(--${_(n[1].replaceAll(".","-"))})`)}:{result:e},O=(e,t,s,n)=>{if(!e)return"";const i=[],r=Object.entries(e).reduce((f,[h,o])=>{const a=h.trim();if(typeof o=="function"&&(o=o()),typeof o=="object"){if(!o)return f;if(a==="variants")return Object.entries(o).forEach(([d,$])=>{$&&Object.entries($).forEach(([k,P])=>{if(!P)return;const N=`${t}.${d}-${k}`,p=O(P,N);i.push(p)})}),f;if(a==="defaultVariants")return f;if(a==="compoundVariants")return o.forEach(d=>{const{css:$,...k}=d,P=Object.entries(k).reduce((p,[y,w])=>`${p}.${y}-${w}`,t),N=O($,P);i.push(N)}),f;if(a.startsWith("@")){const d=O(o,t),$=`${a} {
2
- ${d.replace(`
3
- `,`
4
- `)}
5
- }`;return i.push($),f}const m=h.includes("&")?a.replace("&",t):a.startsWith(":")?`${t}${a}`:`${t} ${a}`,l=O(o,m);return i.push(l),f}const F=a.startsWith("-")?a:_(a),x=(m,l=";")=>f=`${f}${m}${l}`,b=m=>x(`${F}:${m}`);if(typeof o=="number")return b(o);if(typeof o!="string")if("toString"in o)o=o.toString();else return f;const{modifiers:C}={},j=function*(){yield Y(o),yield ye(o,C)}();for(const{result:m,additionalCss:l=[]}of j)o=m,l.forEach(d=>{const $=O(d,"");x($,"")});return b(o)},"");if(!r)return i.join(`
6
- `);if(!t)return r;let g="";return g=`${t} { ${r} }`,[g,...i].join(`
7
- `)},Q=(e,t=[])=>{if(!e)return"";const s=[],n={};if(Object.entries(e).forEach(([i,r])=>{if(typeof r=="object"){if(!r)return;const g=i.trim(),f=Q(r,[...t,g]);s.push(f)}else n[i]=r}),Object.keys(n).length){const i=t.map(_).join("-"),r=O(n,`.${i}`);s.push(r)}return s.join(`
8
- `)},me=e=>Object.entries(e).reduce((t,[s,n])=>(typeof n=="object"&&(t[s]=v(n).map(i=>`"${i}"`).join(" | ")),t),{}),v=(e,t="",s=new Set)=>e?(Object.entries(e).forEach(([n,i])=>{const r=t?`${t}.${n}`:n;return typeof i=="object"?v(i,r,s):s.add(t)}),[...s]):[],ee=e=>{if(!e||e==="/")throw new Error("Could not find package.json file");const t=c.join(e,"package.json");return u.existsSync(t)?t:ee(c.join(e,".."))},he=async e=>{const t=ee(e);return await U.readFile(t,"utf-8").then(JSON.parse).catch(()=>{})},be=async e=>{const t=await he(e);if(t)return t.type};let V;const te=async e=>{if(V)return V;const t=await be(e);return t==="module"?V="esm":(t==="commonjs"||(typeof document>"u"?require("url").pathToFileURL(__filename).href:W&&W.tagName.toUpperCase()==="SCRIPT"&&W.src||new URL("index-B__mWF2q.cjs",document.baseURI).href).endsWith(".cjs"))&&(V="cjs"),V||"esm"},Z=z.createLogger({level:"debug",format:z.format.combine(z.format.colorize(),z.format.cli()),transports:[new z.transports.Console({})]});function se(e){return e?typeof e!="string"?se(String(e)):e.replace(/[\s-]/g,".").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,(t,s)=>(s>0?".":"")+t.toLowerCase()):""}const je={"*, *::before, *::after":{boxSizing:"border-box"},"*":{margin:0},html:{lineHeight:1.15,textSizeAdjust:"100%",WebkitFontSmoothing:"antialiased"},"img, picture, video, canvas, svg":{display:"block",maxWidth:"100%"},"p, h1, h2, h3, h4, h5, h6":{overflowWrap:"break-word"},p:{textWrap:"pretty"},"h1, h2, h3, h4, h5, h6":{textWrap:"balance"},a:{color:"currentColor"},button:{lineHeight:"1em",color:"currentColor"},"input, optgroup, select, textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"1.15em"}},q={externalModules:[]},ne=e=>{if(q.externalModules.length>0)return q.externalModules;const t=c.join(e,"salty.config.ts"),n=u.readFileSync(t,"utf8").match(/externalModules:\s?\[(.*)\]/);if(!n)return[];const i=n[1].split(",").map(r=>r.replace(/['"`]/g,"").trim());return q.externalModules=i,i},J=e=>c.join(e,"./saltygen"),Se=["salty","css","styles","styled"],oe=(e=[])=>new RegExp(`\\.(${[...Se,...e].join("|")})\\.`),H=(e,t=[])=>oe(t).test(e),$e=async e=>{const t=J(e),s=c.join(e,"salty.config.ts"),n=c.join(t,"salty.config.js"),i=await te(e),r=ne(e);await X.build({entryPoints:[s],minify:!0,treeShaking:!0,bundle:!0,outfile:n,format:i,external:r});const g=Date.now(),{config:f}=await import(`${n}?t=${g}`);return f},we=async e=>{const t=await $e(e),s=new Set,n=(p,y=[])=>p?Object.entries(p).flatMap(([w,S])=>{if(!S)return;if(typeof S=="object")return n(S,[...y,w]);const A=se(w),R=_(w),M=[...y,A].join(".");s.add(`"${M}"`);const T=[...y.map(_),R].join("-"),{result:D}=Y(S);return`--${T}: ${D};`}):[],i=p=>p?Object.entries(p).flatMap(([y,w])=>{const S=n(w);return y==="base"?S.join(""):`${y} { ${S.join("")} }`}):[],r=p=>p?Object.entries(p).flatMap(([y,w])=>Object.entries(w).flatMap(([S,A])=>{const R=n(A,[y]),M=`.${y}-${S}, [data-${y}="${S}"]`,T=R.join("");return`${M} { ${T} }`})):[],g=n(t.variables),f=i(t.responsiveVariables),h=r(t.conditionalVariables),o=J(e),a=c.join(o,"css/_variables.css"),F=`:root { ${g.join("")} ${f.join("")} } ${h.join("")}`;u.writeFileSync(a,F);const x=c.join(o,"css/_global.css"),b=O(t.global,"");u.writeFileSync(x,`@layer global { ${b} }`);const C=c.join(o,"css/_reset.css"),j=t.reset==="none"?{}:typeof t.reset=="object"?t.reset:je,m=O(j,"");u.writeFileSync(C,`@layer reset { ${m} }`);const l=c.join(o,"css/_templates.css"),d=Q(t.templates),$=me(t.templates);u.writeFileSync(l,d);const k=c.join(o,"types/css-tokens.d.ts"),N=`
9
- // Variable types
10
- type VariableTokens = ${[...s].join("|")};
11
- type PropertyValueToken = \`{\${VariableTokens}}\`;
12
-
13
- // Template types
14
- type TemplateTokens = {
15
- ${Object.entries($).map(([p,y])=>`${p}?: ${y}`).join(`
16
- `)}
17
- }
18
- `;u.writeFileSync(k,N)},B=async(e,t,s)=>{const n=I(t),i=c.join(s,"./temp");u.existsSync(i)||u.mkdirSync(i);const r=c.parse(t);let g=u.readFileSync(t,"utf8");g=g.replace(/styled\([^"'`{,]+,/g,"styled('div',");const f=c.join(s,"js",n+".js"),h=ne(e),o=await te(e);await X.build({stdin:{contents:g,sourcefile:r.base,resolveDir:r.dir,loader:"tsx"},minify:!1,treeShaking:!0,bundle:!0,outfile:f,format:o,target:["node20"],keepNames:!0,external:h,packages:"external"});const a=Date.now();return await import(`${f}?t=${a}`)},K=async e=>{const t=J(e),s=c.join(t,"salty.config.js"),n=Date.now(),{config:i}=await import(`${s}?t=${n}`);return i},re=()=>{try{return process.env.NODE_ENV==="production"}catch{return!1}},Fe=async(e,t=re())=>{try{const s=Date.now();t?Z.info("Generating CSS in production mode! 🔥"):Z.info("Generating CSS in development mode! 🚀");const n=[],i=[],r=J(e),g=c.join(r,"index.css");(()=>{u.existsSync(r)&&ue.execSync("rm -rf "+r),u.mkdirSync(r),u.mkdirSync(c.join(r,"css")),u.mkdirSync(c.join(r,"types"))})(),await we(e);const h=await K(e);async function o(l,d){const $=["node_modules","saltygen"],k=u.statSync(l);if(k.isDirectory()){const P=u.readdirSync(l);if($.some(p=>l.includes(p)))return;await Promise.all(P.map(p=>o(c.join(l,p),c.join(d,p))))}else if(k.isFile()&&H(l)){const N=await B(e,l,r),p=[];Object.entries(N).forEach(([M,T])=>{if(T.isKeyframes&&T.css){const L=`a_${T.animationName}.css`,ae=`css/${L}`,le=c.join(r,ae);n.push(L),u.writeFileSync(le,T.css);return}if(!T.generator)return;const D=T.generator._withBuildContext({name:M,config:h,prod:t});i[D.priority]||(i[D.priority]=[]),i[D.priority].push(D.cssFileName),p.push(D.cssFileName);const ie=`css/${D.cssFileName}`,ce=c.join(r,ie);u.writeFileSync(ce,D.css)});const y=p.map(M=>`@import url('./${M}');`).join(`
19
- `),w=I(l,6),S=c.parse(l),A=_(S.name),R=c.join(r,`css/f_${A}-${w}.css`);u.writeFileSync(R,y)}}await o(e,r);const a=n.map(l=>`@import url('./css/${l}');`).join(`
20
- `);let C=`@layer reset, global, l0, l1, l2, l3, l4, l5, l6, l7, l8;
21
-
22
- ${["_variables.css","_reset.css","_global.css","_templates.css"].filter(l=>{try{return u.readFileSync(c.join(r,"css",l),"utf8").length>0}catch{return!1}}).map(l=>`@import url('./css/${l}');`).join(`
23
- `)}
24
- ${a}`;if(h.importStrategy!=="component"){const l=i.flat().map(d=>`@import url('./css/${d}');`).join(`
25
- `);C+=l}u.writeFileSync(g,C);const j=Date.now()-s,m=j<200?"🔥":j<500?"🚀":j<1e3?"🎉":j<2e3?"🚗":j<5e3?"🤔":"🥴";Z.info(`Generated CSS in ${j}ms! ${m}`)}catch(s){console.error(s)}},xe=async(e,t)=>{try{const s=[],n=c.join(e,"./saltygen"),i=c.join(n,"index.css");if(H(t)){const g=await K(e),f=await B(e,t,n);Object.entries(f).forEach(([x,b])=>{if(b.isKeyframes&&b.css){const l=`css/${`a_${b.animationName}.css`}`,d=c.join(n,l);u.writeFileSync(d,b.css);return}if(!b.generator)return;const C=b.generator._withBuildContext({name:x,config:g}),E=`css/${C.cssFileName}`,j=c.join(n,E);s.push(C.cssFileName),u.writeFileSync(j,C.css)});const h=u.readFileSync(i,"utf8").split(`
26
- `),o=s.map(x=>`@import url('../saltygen/css/${x}');`),F=[...new Set([...h,...o])].join(`
27
- `);u.writeFileSync(i,F)}}catch(s){console.error(s)}},Ce=async(e,t,s=re())=>{try{const n=c.join(e,"./saltygen");if(H(t)){const r=u.readFileSync(t,"utf8");r.replace(/^(?!export\s)const\s.*/gm,a=>`export ${a}`)!==r&&await U.writeFile(t,r);const f=await K(e),h=await B(e,t,n);let o=r;if(Object.entries(h).forEach(([a,F])=>{var w;if(F.isKeyframes||!F.generator)return;const x=F.generator._withBuildContext({name:a,config:f,prod:s}),b=new RegExp(`\\s${a}[=\\s]+[^()]+styled\\(([^,]+),`,"g").exec(r);if(!b)return console.error("Could not find the original declaration");const C=(w=b.at(1))==null?void 0:w.trim(),E=new RegExp(`\\s${a}[=\\s]+styled\\(`,"g").exec(o);if(!E)return console.error("Could not find the original declaration");const{index:j}=E;let m=!1;const l=setTimeout(()=>m=!0,5e3);let d=0,$=!1,k=0;for(;!$&&!m;){const S=o[j+d];S==="("&&k++,S===")"&&k--,k===0&&S===")"&&($=!0),d>o.length&&(m=!0),d++}if(!m)clearTimeout(l);else throw new Error("Failed to find the end of the styled call and timed out");const P=j+d,N=o.slice(j,P),p=o,y=` ${a} = styled(${C}, "${x.classNames}", ${JSON.stringify(x.props)});`;o=o.replace(N,y),p===o&&console.error("Minimize file failed to change content",{name:a,tagName:C})}),f.importStrategy==="component"){const a=I(t,6),F=c.parse(t);o=`import '../../saltygen/css/${`f_${_(F.name)}-${a}.css`}';
28
- ${o}`}return o=o.replace("{ styled }","{ styledClient as styled }"),o=o.replace("@salty-css/react/styled","@salty-css/react/styled-client"),o}}catch(n){console.error("Error in minimizeFile:",n)}};exports.generateCss=Fe;exports.generateFile=xe;exports.minimizeFile=Ce;exports.saltyFileRegExp=oe;
package/index-DbupcYa1.js DELETED
@@ -1,403 +0,0 @@
1
- import * as Q from "esbuild";
2
- import { execSync as pt } from "child_process";
3
- import { join as l, parse as I } from "path";
4
- import { existsSync as K, writeFileSync as k, readFileSync as W, mkdirSync as z, statSync as ut, readdirSync as dt } from "fs";
5
- import { readFile as gt, writeFile as mt } from "fs/promises";
6
- import { createLogger as yt, format as Z, transports as ht } from "winston";
7
- const Y = (t) => String.fromCharCode(t + (t > 25 ? 39 : 97)), $t = (t, e) => {
8
- let s = "", n;
9
- for (n = Math.abs(t); n > 52; n = n / 52 | 0) s = Y(n % 52) + s;
10
- return s = Y(n % 52) + s, s.length < e ? s = s.padStart(e, "a") : s.length > e && (s = s.slice(-e)), s;
11
- }, bt = (t, e) => {
12
- let s = e.length;
13
- for (; s; ) t = t * 33 ^ e.charCodeAt(--s);
14
- return t;
15
- }, G = (t, e = 5) => {
16
- const s = bt(5381, JSON.stringify(t)) >>> 0;
17
- return $t(s, e);
18
- };
19
- function O(t) {
20
- return t ? typeof t != "string" ? O(String(t)) : t.replace(/[\s.]/g, "-").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g, (e, s) => (s > 0 ? "-" : "") + e.toLowerCase()) : "";
21
- }
22
- const St = (t, e) => {
23
- if (typeof t != "string") return { result: t };
24
- if (!e) return { result: t };
25
- const s = [];
26
- return Object.values(e).forEach((n) => {
27
- const { pattern: i, transform: r } = n;
28
- t = t.replace(i, (d) => {
29
- const { value: f, css: y } = r(d);
30
- return y && s.push(y), f;
31
- });
32
- }), { result: t, additionalCss: s };
33
- }, v = (t) => typeof t != "string" ? { result: t } : /\{[^{}]+\}/g.test(t) ? { result: t.replace(/\{([^{}]+)\}/g, (...n) => `var(--${O(n[1].replaceAll(".", "-"))})`) } : { result: t }, E = (t, e, s, n) => {
34
- if (!t) return "";
35
- const i = [], r = Object.entries(t).reduce((f, [y, o]) => {
36
- const c = y.trim();
37
- if (typeof o == "function" && (o = o()), typeof o == "object") {
38
- if (!o) return f;
39
- if (c === "variants")
40
- return Object.entries(o).forEach(([u, S]) => {
41
- S && Object.entries(S).forEach(([C, P]) => {
42
- if (!P) return;
43
- const N = `${e}.${u}-${C}`, p = E(P, N);
44
- i.push(p);
45
- });
46
- }), f;
47
- if (c === "defaultVariants")
48
- return f;
49
- if (c === "compoundVariants")
50
- return o.forEach((u) => {
51
- const { css: S, ...C } = u, P = Object.entries(C).reduce((p, [g, j]) => `${p}.${g}-${j}`, e), N = E(S, P);
52
- i.push(N);
53
- }), f;
54
- if (c.startsWith("@")) {
55
- const u = E(o, e), S = `${c} {
56
- ${u.replace(`
57
- `, `
58
- `)}
59
- }`;
60
- return i.push(S), f;
61
- }
62
- const m = y.includes("&") ? c.replace("&", e) : c.startsWith(":") ? `${e}${c}` : `${e} ${c}`, a = E(o, m);
63
- return i.push(a), f;
64
- }
65
- const w = c.startsWith("-") ? c : O(c), F = (m, a = ";") => f = `${f}${m}${a}`, h = (m) => F(`${w}:${m}`);
66
- if (typeof o == "number") return h(o);
67
- if (typeof o != "string")
68
- if ("toString" in o) o = o.toString();
69
- else return f;
70
- const { modifiers: x } = {}, $ = function* () {
71
- yield v(o), yield St(o, x);
72
- }();
73
- for (const { result: m, additionalCss: a = [] } of $)
74
- o = m, a.forEach((u) => {
75
- const S = E(u, "");
76
- F(S, "");
77
- });
78
- return h(o);
79
- }, "");
80
- if (!r) return i.join(`
81
- `);
82
- if (!e) return r;
83
- let d = "";
84
- return d = `${e} { ${r} }`, [d, ...i].join(`
85
- `);
86
- }, tt = (t, e = []) => {
87
- if (!t) return "";
88
- const s = [], n = {};
89
- if (Object.entries(t).forEach(([i, r]) => {
90
- if (typeof r == "object") {
91
- if (!r) return;
92
- const d = i.trim(), f = tt(r, [...e, d]);
93
- s.push(f);
94
- } else
95
- n[i] = r;
96
- }), Object.keys(n).length) {
97
- const i = e.map(O).join("-"), r = E(n, `.${i}`);
98
- s.push(r);
99
- }
100
- return s.join(`
101
- `);
102
- }, jt = (t) => Object.entries(t).reduce((e, [s, n]) => (typeof n == "object" && (e[s] = et(n).map((i) => `"${i}"`).join(" | ")), e), {}), et = (t, e = "", s = /* @__PURE__ */ new Set()) => t ? (Object.entries(t).forEach(([n, i]) => {
103
- const r = e ? `${e}.${n}` : n;
104
- return typeof i == "object" ? et(i, r, s) : s.add(e);
105
- }), [...s]) : [], st = (t) => {
106
- if (!t || t === "/") throw new Error("Could not find package.json file");
107
- const e = l(t, "package.json");
108
- return K(e) ? e : st(l(t, ".."));
109
- }, wt = async (t) => {
110
- const e = st(t);
111
- return await gt(e, "utf-8").then(JSON.parse).catch(() => {
112
- });
113
- }, Ft = async (t) => {
114
- const e = await wt(t);
115
- if (e)
116
- return e.type;
117
- };
118
- let _;
119
- const nt = async (t) => {
120
- if (_) return _;
121
- const e = await Ft(t);
122
- return e === "module" ? _ = "esm" : (e === "commonjs" || import.meta.url.endsWith(".cjs")) && (_ = "cjs"), _ || "esm";
123
- }, H = yt({
124
- level: "debug",
125
- format: Z.combine(Z.colorize(), Z.cli()),
126
- transports: [new ht.Console({})]
127
- });
128
- function ot(t) {
129
- return t ? typeof t != "string" ? ot(String(t)) : t.replace(/[\s-]/g, ".").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g, (e, s) => (s > 0 ? "." : "") + e.toLowerCase()) : "";
130
- }
131
- const xt = {
132
- /** Set box model to border-box */
133
- "*, *::before, *::after": {
134
- boxSizing: "border-box"
135
- },
136
- /** Remove default margin and padding */
137
- "*": {
138
- margin: 0
139
- },
140
- /** Remove adjust font properties */
141
- html: {
142
- lineHeight: 1.15,
143
- textSizeAdjust: "100%",
144
- WebkitFontSmoothing: "antialiased"
145
- },
146
- /** Make media elements responsive */
147
- "img, picture, video, canvas, svg": {
148
- display: "block",
149
- maxWidth: "100%"
150
- },
151
- /** Avoid overflow of text */
152
- "p, h1, h2, h3, h4, h5, h6": {
153
- overflowWrap: "break-word"
154
- },
155
- /** Improve text wrapping */
156
- p: {
157
- textWrap: "pretty"
158
- },
159
- "h1, h2, h3, h4, h5, h6": {
160
- textWrap: "balance"
161
- },
162
- /** Improve link color */
163
- a: {
164
- color: "currentColor"
165
- },
166
- /** Improve button line height */
167
- button: {
168
- lineHeight: "1em",
169
- color: "currentColor"
170
- },
171
- /** Improve form elements */
172
- "input, optgroup, select, textarea": {
173
- fontFamily: "inherit",
174
- fontSize: "100%",
175
- lineHeight: "1.15em"
176
- }
177
- }, B = {
178
- externalModules: []
179
- }, rt = (t) => {
180
- if (B.externalModules.length > 0) return B.externalModules;
181
- const e = l(t, "salty.config.ts"), n = W(e, "utf8").match(/externalModules:\s?\[(.*)\]/);
182
- if (!n) return [];
183
- const i = n[1].split(",").map((r) => r.replace(/['"`]/g, "").trim());
184
- return B.externalModules = i, i;
185
- }, R = (t) => l(t, "./saltygen"), Ct = ["salty", "css", "styles", "styled"], kt = (t = []) => new RegExp(`\\.(${[...Ct, ...t].join("|")})\\.`), L = (t, e = []) => kt(e).test(t), Pt = async (t) => {
186
- const e = R(t), s = l(t, "salty.config.ts"), n = l(e, "salty.config.js"), i = await nt(t), r = rt(t);
187
- await Q.build({
188
- entryPoints: [s],
189
- minify: !0,
190
- treeShaking: !0,
191
- bundle: !0,
192
- outfile: n,
193
- format: i,
194
- external: r
195
- });
196
- const d = Date.now(), { config: f } = await import(`${n}?t=${d}`);
197
- return f;
198
- }, Nt = async (t) => {
199
- const e = await Pt(t), s = /* @__PURE__ */ new Set(), n = (p, g = []) => p ? Object.entries(p).flatMap(([j, b]) => {
200
- if (!b) return;
201
- if (typeof b == "object") return n(b, [...g, j]);
202
- const A = ot(j), J = O(j), M = [...g, A].join(".");
203
- s.add(`"${M}"`);
204
- const T = [...g.map(O), J].join("-"), { result: D } = v(b);
205
- return `--${T}: ${D};`;
206
- }) : [], i = (p) => p ? Object.entries(p).flatMap(([g, j]) => {
207
- const b = n(j);
208
- return g === "base" ? b.join("") : `${g} { ${b.join("")} }`;
209
- }) : [], r = (p) => p ? Object.entries(p).flatMap(([g, j]) => Object.entries(j).flatMap(([b, A]) => {
210
- const J = n(A, [g]), M = `.${g}-${b}, [data-${g}="${b}"]`, T = J.join("");
211
- return `${M} { ${T} }`;
212
- })) : [], d = n(e.variables), f = i(e.responsiveVariables), y = r(e.conditionalVariables), o = R(t), c = l(o, "css/_variables.css"), w = `:root { ${d.join("")} ${f.join("")} } ${y.join("")}`;
213
- k(c, w);
214
- const F = l(o, "css/_global.css"), h = E(e.global, "");
215
- k(F, `@layer global { ${h} }`);
216
- const x = l(o, "css/_reset.css"), $ = e.reset === "none" ? {} : typeof e.reset == "object" ? e.reset : xt, m = E($, "");
217
- k(x, `@layer reset { ${m} }`);
218
- const a = l(o, "css/_templates.css"), u = tt(e.templates), S = jt(e.templates);
219
- k(a, u);
220
- const C = l(o, "types/css-tokens.d.ts"), N = `
221
- // Variable types
222
- type VariableTokens = ${[...s].join("|")};
223
- type PropertyValueToken = \`{\${VariableTokens}}\`;
224
-
225
- // Template types
226
- type TemplateTokens = {
227
- ${Object.entries(S).map(([p, g]) => `${p}?: ${g}`).join(`
228
- `)}
229
- }
230
- `;
231
- k(C, N);
232
- }, q = async (t, e, s) => {
233
- const n = G(e), i = l(s, "./temp");
234
- K(i) || z(i);
235
- const r = I(e);
236
- let d = W(e, "utf8");
237
- d = d.replace(/styled\([^"'`{,]+,/g, "styled('div',");
238
- const f = l(s, "js", n + ".js"), y = rt(t), o = await nt(t);
239
- await Q.build({
240
- stdin: {
241
- contents: d,
242
- sourcefile: r.base,
243
- resolveDir: r.dir,
244
- loader: "tsx"
245
- },
246
- minify: !1,
247
- treeShaking: !0,
248
- bundle: !0,
249
- outfile: f,
250
- format: o,
251
- target: ["node20"],
252
- keepNames: !0,
253
- external: y,
254
- packages: "external"
255
- });
256
- const c = Date.now();
257
- return await import(`${f}?t=${c}`);
258
- }, U = async (t) => {
259
- const e = R(t), s = l(e, "salty.config.js"), n = Date.now(), { config: i } = await import(`${s}?t=${n}`);
260
- return i;
261
- }, it = () => {
262
- try {
263
- return process.env.NODE_ENV === "production";
264
- } catch {
265
- return !1;
266
- }
267
- }, Mt = async (t, e = it()) => {
268
- try {
269
- const s = Date.now();
270
- e ? H.info("Generating CSS in production mode! 🔥") : H.info("Generating CSS in development mode! 🚀");
271
- const n = [], i = [], r = R(t), d = l(r, "index.css");
272
- (() => {
273
- K(r) && pt("rm -rf " + r), z(r), z(l(r, "css")), z(l(r, "types"));
274
- })(), await Nt(t);
275
- const y = await U(t);
276
- async function o(a, u) {
277
- const S = ["node_modules", "saltygen"], C = ut(a);
278
- if (C.isDirectory()) {
279
- const P = dt(a);
280
- if (S.some((p) => a.includes(p))) return;
281
- await Promise.all(P.map((p) => o(l(a, p), l(u, p))));
282
- } else if (C.isFile() && L(a)) {
283
- const N = await q(t, a, r), p = [];
284
- Object.entries(N).forEach(([M, T]) => {
285
- if (T.isKeyframes && T.css) {
286
- const X = `a_${T.animationName}.css`, lt = `css/${X}`, ft = l(r, lt);
287
- n.push(X), k(ft, T.css);
288
- return;
289
- }
290
- if (!T.generator) return;
291
- const D = T.generator._withBuildContext({
292
- name: M,
293
- config: y,
294
- prod: e
295
- });
296
- i[D.priority] || (i[D.priority] = []), i[D.priority].push(D.cssFileName), p.push(D.cssFileName);
297
- const ct = `css/${D.cssFileName}`, at = l(r, ct);
298
- k(at, D.css);
299
- });
300
- const g = p.map((M) => `@import url('./${M}');`).join(`
301
- `), j = G(a, 6), b = I(a), A = O(b.name), J = l(r, `css/f_${A}-${j}.css`);
302
- k(J, g);
303
- }
304
- }
305
- await o(t, r);
306
- const c = n.map((a) => `@import url('./css/${a}');`).join(`
307
- `);
308
- let x = `@layer reset, global, l0, l1, l2, l3, l4, l5, l6, l7, l8;
309
-
310
- ${["_variables.css", "_reset.css", "_global.css", "_templates.css"].filter((a) => {
311
- try {
312
- return W(l(r, "css", a), "utf8").length > 0;
313
- } catch {
314
- return !1;
315
- }
316
- }).map((a) => `@import url('./css/${a}');`).join(`
317
- `)}
318
- ${c}`;
319
- if (y.importStrategy !== "component") {
320
- const a = i.flat().map((u) => `@import url('./css/${u}');`).join(`
321
- `);
322
- x += a;
323
- }
324
- k(d, x);
325
- const $ = Date.now() - s, m = $ < 200 ? "🔥" : $ < 500 ? "🚀" : $ < 1e3 ? "🎉" : $ < 2e3 ? "🚗" : $ < 5e3 ? "🤔" : "🥴";
326
- H.info(`Generated CSS in ${$}ms! ${m}`);
327
- } catch (s) {
328
- console.error(s);
329
- }
330
- }, _t = async (t, e) => {
331
- try {
332
- const s = [], n = l(t, "./saltygen"), i = l(n, "index.css");
333
- if (L(e)) {
334
- const d = await U(t), f = await q(t, e, n);
335
- Object.entries(f).forEach(([F, h]) => {
336
- if (h.isKeyframes && h.css) {
337
- const a = `css/${`a_${h.animationName}.css`}`, u = l(n, a);
338
- k(u, h.css);
339
- return;
340
- }
341
- if (!h.generator) return;
342
- const x = h.generator._withBuildContext({
343
- name: F,
344
- config: d
345
- }), V = `css/${x.cssFileName}`, $ = l(n, V);
346
- s.push(x.cssFileName), k($, x.css);
347
- });
348
- const y = W(i, "utf8").split(`
349
- `), o = s.map((F) => `@import url('../saltygen/css/${F}');`), w = [.../* @__PURE__ */ new Set([...y, ...o])].join(`
350
- `);
351
- k(i, w);
352
- }
353
- } catch (s) {
354
- console.error(s);
355
- }
356
- }, At = async (t, e, s = it()) => {
357
- try {
358
- const n = l(t, "./saltygen");
359
- if (L(e)) {
360
- const r = W(e, "utf8");
361
- r.replace(/^(?!export\s)const\s.*/gm, (c) => `export ${c}`) !== r && await mt(e, r);
362
- const f = await U(t), y = await q(t, e, n);
363
- let o = r;
364
- if (Object.entries(y).forEach(([c, w]) => {
365
- var j;
366
- if (w.isKeyframes || !w.generator) return;
367
- const F = w.generator._withBuildContext({
368
- name: c,
369
- config: f,
370
- prod: s
371
- }), h = new RegExp(`\\s${c}[=\\s]+[^()]+styled\\(([^,]+),`, "g").exec(r);
372
- if (!h) return console.error("Could not find the original declaration");
373
- const x = (j = h.at(1)) == null ? void 0 : j.trim(), V = new RegExp(`\\s${c}[=\\s]+styled\\(`, "g").exec(o);
374
- if (!V) return console.error("Could not find the original declaration");
375
- const { index: $ } = V;
376
- let m = !1;
377
- const a = setTimeout(() => m = !0, 5e3);
378
- let u = 0, S = !1, C = 0;
379
- for (; !S && !m; ) {
380
- const b = o[$ + u];
381
- b === "(" && C++, b === ")" && C--, C === 0 && b === ")" && (S = !0), u > o.length && (m = !0), u++;
382
- }
383
- if (!m) clearTimeout(a);
384
- else throw new Error("Failed to find the end of the styled call and timed out");
385
- const P = $ + u, N = o.slice($, P), p = o, g = ` ${c} = styled(${x}, "${F.classNames}", ${JSON.stringify(F.props)});`;
386
- o = o.replace(N, g), p === o && console.error("Minimize file failed to change content", { name: c, tagName: x });
387
- }), f.importStrategy === "component") {
388
- const c = G(e, 6), w = I(e);
389
- o = `import '../../saltygen/css/${`f_${O(w.name)}-${c}.css`}';
390
- ${o}`;
391
- }
392
- return o = o.replace("{ styled }", "{ styledClient as styled }"), o = o.replace("@salty-css/react/styled", "@salty-css/react/styled-client"), o;
393
- }
394
- } catch (n) {
395
- console.error("Error in minimizeFile:", n);
396
- }
397
- };
398
- export {
399
- _t as a,
400
- Mt as g,
401
- At as m,
402
- kt as s
403
- };