@salty-css/core 0.0.1-alpha.201 → 0.0.1-alpha.202

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,492 @@
1
+ import * as mt from "esbuild";
2
+ import { execSync as Nt } from "child_process";
3
+ import { d as W, t as I } from "./dash-case-DBThphLm.js";
4
+ import { join as i, parse as Y } from "path";
5
+ import { existsSync as it, writeFileSync as j, mkdirSync as v, readFileSync as D, statSync as Pt, readdirSync as kt } from "fs";
6
+ import { readFile as gt, writeFile as Dt } from "fs/promises";
7
+ import { p as at, a as _t } from "./parse-styles-CbYzTfwr.js";
8
+ import { createLogger as Tt, format as ot, transports as Et } from "winston";
9
+ import { mergeStyles as z, mergeFactories as Ot } from "./css/merge.js";
10
+ const yt = async (t, e = []) => {
11
+ if (!t) return "";
12
+ const s = [], o = {};
13
+ if (Object.entries(t).forEach(async ([n, a]) => {
14
+ if (typeof a == "function") return console.log("Function found", n);
15
+ if (typeof a == "object") {
16
+ if (!a) return;
17
+ const l = n.trim(), u = await yt(a, [...e, l]);
18
+ s.push(u);
19
+ } else
20
+ o[n] = a;
21
+ }), Object.keys(o).length) {
22
+ const n = e.map(W).join("-"), a = await at(o, `.${n}`);
23
+ s.push(a);
24
+ }
25
+ return s.join(`
26
+ `);
27
+ }, Vt = (t) => t ? Object.entries(t).reduce((e, [s, o]) => (typeof o == "object" && (e[s] = ht(o).map((n) => `"${n}"`).join(" | ")), e), {}) : {}, ht = (t, e = "", s = /* @__PURE__ */ new Set()) => t ? (Object.entries(t).forEach(([o, n]) => {
28
+ const a = e ? `${e}.${o}` : o;
29
+ return typeof n == "object" ? ht(n, a, s) : s.add(e);
30
+ }), [...s]) : [], bt = (t) => {
31
+ if (!t || t === "/") throw new Error("Could not find package.json file");
32
+ const e = i(t, "package.json");
33
+ return it(e) ? e : bt(i(t, ".."));
34
+ }, Mt = async (t) => {
35
+ const e = bt(t);
36
+ return await gt(e, "utf-8").then(JSON.parse).catch(() => {
37
+ });
38
+ }, Rt = async (t) => {
39
+ const e = await Mt(t);
40
+ if (e)
41
+ return e.type;
42
+ };
43
+ let J;
44
+ const $t = async (t) => {
45
+ if (J) return J;
46
+ const e = await Rt(t);
47
+ return e === "module" ? J = "esm" : (e === "commonjs" || import.meta.url.endsWith(".cjs")) && (J = "cjs"), J || "esm";
48
+ }, X = Tt({
49
+ level: "debug",
50
+ format: ot.combine(ot.colorize(), ot.cli()),
51
+ transports: [new Et.Console({})]
52
+ }), Ut = (t) => {
53
+ X.error(t);
54
+ };
55
+ function wt(t) {
56
+ return t ? typeof t != "string" ? wt(String(t)) : t.replace(/[\s-]/g, ".").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g, (e, s) => (s > 0 ? "." : "") + e.toLowerCase()) : "";
57
+ }
58
+ const Jt = {
59
+ /** Set box model to border-box */
60
+ "*, *::before, *::after": {
61
+ boxSizing: "border-box"
62
+ },
63
+ /** Remove default margin and padding */
64
+ "*": {
65
+ margin: 0
66
+ },
67
+ /** Remove adjust font properties */
68
+ html: {
69
+ lineHeight: 1.15,
70
+ textSizeAdjust: "100%",
71
+ WebkitFontSmoothing: "antialiased"
72
+ },
73
+ /** Make media elements responsive */
74
+ "img, picture, video, canvas, svg": {
75
+ display: "block",
76
+ maxWidth: "100%"
77
+ },
78
+ /** Avoid overflow of text */
79
+ "p, h1, h2, h3, h4, h5, h6": {
80
+ overflowWrap: "break-word"
81
+ },
82
+ /** Improve text wrapping */
83
+ p: {
84
+ textWrap: "pretty"
85
+ },
86
+ "h1, h2, h3, h4, h5, h6": {
87
+ textWrap: "balance"
88
+ },
89
+ /** Improve link color */
90
+ a: {
91
+ color: "currentColor"
92
+ },
93
+ /** Improve button line height */
94
+ button: {
95
+ lineHeight: "1em",
96
+ color: "currentColor"
97
+ },
98
+ /** Improve form elements */
99
+ "input, optgroup, select, textarea": {
100
+ fontFamily: "inherit",
101
+ fontSize: "100%",
102
+ lineHeight: "1.15em"
103
+ }
104
+ }, V = {
105
+ externalModules: [],
106
+ rcFile: void 0,
107
+ destDir: void 0
108
+ }, St = (t) => {
109
+ if (V.externalModules.length > 0) return V.externalModules;
110
+ const s = D(t, "utf8").match(/externalModules:\s?\[(.*)\]/);
111
+ if (!s) return [];
112
+ const o = s[1].split(",").map((n) => n.replace(/['"`]/g, "").trim());
113
+ return V.externalModules = o, o;
114
+ }, M = async (t) => {
115
+ if (V.destDir) return V.destDir;
116
+ const e = await ct(t), s = i(t, (e == null ? void 0 : e.saltygenDir) || "saltygen");
117
+ return V.destDir = s, s;
118
+ }, Ct = ["salty", "css", "styles", "styled"], vt = (t = []) => new RegExp(`\\.(${[...Ct, ...t].join("|")})\\.`), rt = (t, e = []) => vt(e).test(t), Ft = async (t) => {
119
+ if (V.rcFile) return V.rcFile;
120
+ if (t === "/") throw new Error("Could not find .saltyrc.json file");
121
+ const e = i(t, ".saltyrc.json"), s = await gt(e, "utf-8").then(JSON.parse).catch(() => {
122
+ });
123
+ return s ? (V.rcFile = s, s) : Ft(i(t, ".."));
124
+ }, ct = async (t) => {
125
+ var o, n;
126
+ const e = await Ft(t), s = (o = e.projects) == null ? void 0 : o.find((a) => t.endsWith(a.dir || ""));
127
+ return s || ((n = e.projects) == null ? void 0 : n.find((a) => a.dir === e.defaultProject));
128
+ }, zt = async (t) => {
129
+ const e = await ct(t), s = await M(t), o = i(t, (e == null ? void 0 : e.configDir) || "", "salty.config.ts"), n = i(s, "salty.config.js"), a = await $t(t), l = St(o);
130
+ await mt.build({
131
+ entryPoints: [o],
132
+ minify: !0,
133
+ treeShaking: !0,
134
+ bundle: !0,
135
+ outfile: n,
136
+ format: a,
137
+ external: l
138
+ });
139
+ const u = Date.now(), { config: d } = await import(`${n}?t=${u}`);
140
+ return d;
141
+ }, Wt = async (t, e) => {
142
+ var ft, ut;
143
+ const s = await M(t), o = {
144
+ mediaQueries: [],
145
+ globalStyles: [],
146
+ variables: [],
147
+ templates: []
148
+ };
149
+ await Promise.all(
150
+ [...e].map(async (y) => {
151
+ const { contents: w, outputFilePath: O } = await tt(t, y, s);
152
+ Object.entries(w).forEach(([x, P]) => {
153
+ P.isMedia ? o.mediaQueries.push([x, P]) : P.isGlobalDefine ? o.globalStyles.push(P) : P.isDefineVariables ? o.variables.push(P) : P.isDefineTemplates && o.templates.push(P._setPath(O));
154
+ });
155
+ })
156
+ );
157
+ const n = await zt(t), a = { ...n }, l = /* @__PURE__ */ new Set(), u = (y, w = []) => y ? Object.entries(y).flatMap(([O, x]) => {
158
+ if (!x) return;
159
+ if (typeof x == "object") return u(x, [...w, O]);
160
+ const P = wt(O), st = W(O), nt = [...w, P].join(".");
161
+ l.add(`"${nt}"`);
162
+ const U = [...w.map(W), st].join("-"), pt = _t(x);
163
+ return pt ? `--${U}: ${pt.transformed};` : `--${U}: ${x};`;
164
+ }) : [], d = (y) => y ? Object.entries(y).flatMap(([w, O]) => {
165
+ const x = u(O);
166
+ return w === "base" ? x.join("") : `${w} { ${x.join("")} }`;
167
+ }) : [], f = (y) => y ? Object.entries(y).flatMap(([w, O]) => Object.entries(O).flatMap(([x, P]) => {
168
+ const st = u(P, [w]), nt = `.${w}-${x}, [data-${w}="${x}"]`, U = st.join("");
169
+ return `${nt} { ${U} }`;
170
+ })) : [], m = (y) => ({ ...y, responsive: void 0, conditional: void 0 }), g = (y) => o.variables.map((w) => y === "static" ? m(w._current) : w._current[y]), p = z(m(n.variables), g("static")), S = u(p), h = z((ft = n.variables) == null ? void 0 : ft.responsive, g("responsive")), T = d(h), k = z((ut = n.variables) == null ? void 0 : ut.conditional, g("conditional")), _ = f(k), R = i(s, "css/_variables.css"), E = `:root { ${S.join("")} ${T.join("")} } ${_.join("")}`;
171
+ j(R, E), a.staticVariables = p;
172
+ const B = i(s, "css/_global.css"), N = z(n.global, o.globalStyles), G = await at(N, "");
173
+ j(B, `@layer global { ${G} }`);
174
+ const r = i(s, "css/_reset.css"), $ = n.reset === "none" ? {} : typeof n.reset == "object" ? n.reset : Jt, c = await at($, "");
175
+ j(r, `@layer reset { ${c} }`);
176
+ const C = i(s, "css/_templates.css"), F = z(n.templates, o.templates), H = await yt(F), K = Vt(F);
177
+ j(C, H), a.templates = F;
178
+ const A = Ot(o.templates);
179
+ a.templatePaths = Object.fromEntries(
180
+ Object.entries(A).map(([y, w]) => [y, w._path || "nope"])
181
+ );
182
+ const { mediaQueries: L } = o;
183
+ a.mediaQueries = Object.fromEntries(L.map(([y, w]) => [`@${y}`, w]));
184
+ const Q = L.map(([y]) => `'@${y}'`).join(" | "), et = i(s, "types/css-tokens.d.ts"), q = `
185
+ // Variable types
186
+ type VariableTokens = ${[...l].join("|")};
187
+ type PropertyValueToken = \`{\${VariableTokens}}\`;
188
+
189
+ // Template types
190
+ type TemplateTokens = {
191
+ ${Object.entries(K).map(([y, w]) => `${y}?: ${w}`).join(`
192
+ `)}
193
+ }
194
+
195
+ // Media query types
196
+ type MediaQueryKeys = ${Q || "''"};
197
+ `;
198
+ j(et, q);
199
+ const xt = i(s, "cache/config-cache.json");
200
+ j(xt, JSON.stringify(a, null, 2));
201
+ }, dt = (t) => t.replace(/styled\(([^"'`{,]+),/g, (e, s) => {
202
+ if (/^['"`]/.test(s)) return e;
203
+ const n = new RegExp(`import[^;]*${s}[,\\s{][^;]*from\\s?([^{};]+);`);
204
+ if (!n.test(t)) return e;
205
+ const l = n.exec(t);
206
+ if (l) {
207
+ const u = l.at(1);
208
+ if (Ct.some((f) => u == null ? void 0 : u.includes(f))) return e;
209
+ }
210
+ return "styled('div',";
211
+ }), It = (t, e) => {
212
+ try {
213
+ const s = D(i(e, "saltygen/cache/config-cache.json"), "utf8");
214
+ return s ? `globalThis.saltyConfig = ${s};
215
+
216
+ ${t}` : `globalThis.saltyConfig = {};
217
+
218
+ ${t}`;
219
+ } catch {
220
+ return t;
221
+ }
222
+ }, tt = async (t, e, s) => {
223
+ const o = I(e), n = i(s, "./temp");
224
+ it(n) || v(n);
225
+ const a = Y(e);
226
+ let l = D(e, "utf8");
227
+ l = dt(l), l = It(l, t);
228
+ const u = i(s, "js", o + ".js"), d = await ct(t), f = i(t, (d == null ? void 0 : d.configDir) || "", "salty.config.ts"), m = St(f), g = await $t(t);
229
+ await mt.build({
230
+ stdin: {
231
+ contents: l,
232
+ sourcefile: a.base,
233
+ resolveDir: a.dir,
234
+ loader: "tsx"
235
+ },
236
+ minify: !1,
237
+ treeShaking: !0,
238
+ bundle: !0,
239
+ outfile: u,
240
+ format: g,
241
+ target: ["node20"],
242
+ keepNames: !0,
243
+ external: m,
244
+ packages: "external",
245
+ plugins: [
246
+ {
247
+ name: "test",
248
+ setup: (h) => {
249
+ h.onLoad({ filter: /.*\.css|salty|styles|styled\.ts/ }, (T) => {
250
+ const k = D(T.path, "utf8");
251
+ return { contents: dt(k), loader: "ts" };
252
+ });
253
+ }
254
+ }
255
+ ]
256
+ });
257
+ const p = Date.now();
258
+ return { contents: await import(`${u}?t=${p}`), outputFilePath: u };
259
+ }, Bt = async (t) => {
260
+ const e = await M(t), s = i(e, "cache/config-cache.json"), o = D(s, "utf8");
261
+ if (!o) throw new Error("Could not find config cache file");
262
+ return JSON.parse(o);
263
+ }, lt = async (t) => {
264
+ const e = await Bt(t), s = await M(t), o = i(s, "salty.config.js"), n = Date.now(), { config: a } = await import(`${o}?t=${n}`);
265
+ return z(a, e);
266
+ }, jt = () => {
267
+ try {
268
+ return process.env.NODE_ENV === "production";
269
+ } catch {
270
+ return !1;
271
+ }
272
+ }, Xt = async (t, e = jt(), s = !0) => {
273
+ try {
274
+ const o = Date.now();
275
+ e ? X.info("Generating CSS in production mode! 🔥") : X.info("Generating CSS in development mode! 🚀");
276
+ const n = [], a = [], l = await M(t), u = i(l, "index.css");
277
+ s && (() => {
278
+ it(l) && Nt("rm -rf " + l), v(l, { recursive: !0 }), v(i(l, "css")), v(i(l, "types")), v(i(l, "js")), v(i(l, "cache"));
279
+ })();
280
+ const f = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set();
281
+ async function g(r) {
282
+ const b = ["node_modules", "saltygen"], $ = Pt(r);
283
+ if ($.isDirectory()) {
284
+ const c = kt(r);
285
+ if (b.some((F) => r.includes(F))) return;
286
+ await Promise.all(c.map((F) => g(i(r, F))));
287
+ } else if ($.isFile() && rt(r)) {
288
+ f.add(r);
289
+ const C = D(r, "utf8");
290
+ /define[\w\d]+\(/.test(C) && m.add(r);
291
+ }
292
+ }
293
+ await g(t), await Wt(t, m);
294
+ const p = {
295
+ keyframes: [],
296
+ components: [],
297
+ classNames: []
298
+ };
299
+ await Promise.all(
300
+ [...f].map(async (r) => {
301
+ const { contents: b } = await tt(t, r, l);
302
+ Object.entries(b).forEach(([$, c]) => {
303
+ c.isKeyframes ? p.keyframes.push({
304
+ value: c,
305
+ src: r,
306
+ name: $
307
+ }) : c.isClassName ? p.classNames.push({
308
+ ...c,
309
+ src: r,
310
+ name: $
311
+ }) : c.generator && p.components.push({
312
+ ...c,
313
+ src: r,
314
+ name: $
315
+ });
316
+ });
317
+ })
318
+ );
319
+ const S = await lt(t);
320
+ for (const r of p.keyframes) {
321
+ const { value: b } = r, $ = `a_${b.animationName}.css`, c = `css/${$}`, C = i(l, c);
322
+ n.push($), j(C, b.css);
323
+ }
324
+ const h = {};
325
+ for (const r of p.components) {
326
+ const { src: b, name: $ } = r, c = r.generator._withBuildContext({
327
+ callerName: $,
328
+ isProduction: e,
329
+ config: S
330
+ });
331
+ a[c.priority] || (a[c.priority] = []), a[c.priority].push(c.cssFileName);
332
+ const C = `css/${c.cssFileName}`, F = i(l, C);
333
+ j(F, await c.css), S.importStrategy === "component" && (h[b] ? h[b].push(c.cssFileName) : h[b] = [c.cssFileName]);
334
+ }
335
+ for (const r of p.classNames) {
336
+ const { src: b, name: $ } = r, c = r.generator._withBuildContext({
337
+ callerName: $,
338
+ isProduction: e,
339
+ config: S
340
+ });
341
+ a[0].push(c.cssFileName);
342
+ const C = `css/${c.cssFileName}`, F = i(l, C);
343
+ j(F, await c.css), S.importStrategy === "component" && (h[b] ? h[b].push(c.cssFileName) : h[b] = [c.cssFileName]);
344
+ }
345
+ S.importStrategy === "component" && Object.entries(h).forEach(([r, b]) => {
346
+ const $ = b.map((K) => `@import url('./${K}');`).join(`
347
+ `), c = I(r, 6), C = Y(r), F = W(C.name), H = i(l, `css/f_${F}-${c}.css`);
348
+ j(H, $);
349
+ });
350
+ const T = n.map((r) => `@import url('./css/${r}');`).join(`
351
+ `);
352
+ let E = `@layer reset, global, l0, l1, l2, l3, l4, l5, l6, l7, l8;
353
+
354
+ ${["_variables.css", "_reset.css", "_global.css", "_templates.css"].filter((r) => {
355
+ try {
356
+ return D(i(l, "css", r), "utf8").length > 0;
357
+ } catch {
358
+ return !1;
359
+ }
360
+ }).map((r) => `@import url('./css/${r}');`).join(`
361
+ `)}
362
+ ${T}`;
363
+ if (S.importStrategy !== "component") {
364
+ const r = a.reduce((b, $, c) => {
365
+ const C = $.reduce((A, L) => {
366
+ var q;
367
+ const Q = i(l, "css", L), et = D(Q, "utf8"), Z = ((q = /.*-([^-]+)-\d+.css/.exec(L)) == null ? void 0 : q.at(1)) || I(Q, 6);
368
+ return A.includes(Z) ? A : `${A}
369
+ /*start:${Z}*/
370
+ ${et}
371
+ /*end:${Z}*/
372
+ `;
373
+ }, ""), F = `l_${c}.css`, H = i(l, "css", F), K = `@layer l${c} { ${C}
374
+ }`;
375
+ return j(H, K), `${b}
376
+ @import url('./css/${F}');`;
377
+ }, "");
378
+ E += r;
379
+ }
380
+ j(u, E);
381
+ const N = Date.now() - o, G = N < 200 ? "🔥" : N < 500 ? "🚀" : N < 1e3 ? "🎉" : N < 2e3 ? "🚗" : N < 5e3 ? "🤔" : "🥴";
382
+ X.info(`Generated CSS in ${N}ms! ${G}`);
383
+ } catch (o) {
384
+ console.error(o);
385
+ }
386
+ }, Yt = async (t, e) => {
387
+ try {
388
+ const s = await M(t);
389
+ if (rt(e)) {
390
+ const n = [], a = await lt(t), { contents: l } = await tt(t, e, s);
391
+ for (const [u, d] of Object.entries(l)) {
392
+ if (d.isKeyframes && d.css) {
393
+ const S = `css/${`a_${d.animationName}.css`}`, h = i(s, S);
394
+ j(h, await d.css);
395
+ return;
396
+ }
397
+ if (d.isClassName) {
398
+ const p = d.factory._withBuildContext({
399
+ name: u
400
+ });
401
+ n[0].push(p.cssFileName);
402
+ const S = `css/${p.cssFileName}`, h = i(s, S);
403
+ j(h, await p.css);
404
+ }
405
+ if (!d.generator) return;
406
+ const f = d.generator._withBuildContext({
407
+ name: u,
408
+ config: a
409
+ }), m = `css/${f.cssFileName}`, g = i(s, m);
410
+ j(g, await f.css), n[f.priority] || (n[f.priority] = []), n[f.priority].push(f.cssFileName);
411
+ }
412
+ if (a.importStrategy !== "component")
413
+ n.forEach((u, d) => {
414
+ const f = `l_${d}.css`, m = i(s, "css", f);
415
+ let g = D(m, "utf8");
416
+ u.forEach((p) => {
417
+ var k;
418
+ const S = i(s, "css", p), h = ((k = /.*-([^-]+)-\d+.css/.exec(p)) == null ? void 0 : k.at(1)) || I(S, 6);
419
+ if (!g.includes(h)) {
420
+ const _ = D(S, "utf8"), R = `/*start:${h}*/
421
+ ${_}
422
+ /*end:${h}*/
423
+ `;
424
+ g = `${g.replace(/\}$/, "")}
425
+ ${R}
426
+ }`;
427
+ }
428
+ }), j(m, g);
429
+ });
430
+ else {
431
+ const u = n.flat().map((p) => `@import url('./${p}');`).join(`
432
+ `), d = I(e, 6), f = Y(e), m = W(f.name), g = i(s, `css/f_${m}-${d}.css`);
433
+ j(g, u);
434
+ }
435
+ }
436
+ } catch (s) {
437
+ console.error(s);
438
+ }
439
+ }, te = async (t, e, s = jt()) => {
440
+ try {
441
+ const o = await M(t);
442
+ if (rt(e)) {
443
+ const a = D(e, "utf8");
444
+ a.replace(/^(?!export\s)const\s.*/gm, (m) => `export ${m}`) !== a && await Dt(e, a);
445
+ const u = await lt(t), { contents: d } = await tt(t, e, o);
446
+ let f = a;
447
+ if (Object.entries(d).forEach(([m, g]) => {
448
+ var c;
449
+ if (g.isKeyframes || !g.generator) return;
450
+ const p = g.generator._withBuildContext({
451
+ name: m,
452
+ config: u,
453
+ prod: s
454
+ }), S = new RegExp(`\\s${m}[=\\s]+[^()]+styled\\(([^,]+),`, "g").exec(a);
455
+ if (!S) return console.error("Could not find the original declaration");
456
+ const h = (c = S.at(1)) == null ? void 0 : c.trim(), T = new RegExp(`\\s${m}[=\\s]+styled\\(`, "g").exec(f);
457
+ if (!T) return console.error("Could not find the original declaration");
458
+ const { index: k } = T;
459
+ let _ = !1;
460
+ const R = setTimeout(() => _ = !0, 5e3);
461
+ let E = 0, B = !1, N = 0;
462
+ for (; !B && !_; ) {
463
+ const C = f[k + E];
464
+ C === "(" && N++, C === ")" && N--, N === 0 && C === ")" && (B = !0), E > f.length && (_ = !0), E++;
465
+ }
466
+ if (!_) clearTimeout(R);
467
+ else throw new Error("Failed to find the end of the styled call and timed out");
468
+ const G = k + E, r = f.slice(k, G), b = f, $ = ` ${m} = styled(${h}, "${p.classNames}", ${JSON.stringify(p.clientProps)});`;
469
+ f = f.replace(r, $), b === f && console.error("Minimize file failed to change content", { name: m, tagName: h });
470
+ }), u.importStrategy === "component") {
471
+ const m = I(e, 6), g = Y(e);
472
+ f = `import '../../saltygen/css/${`f_${W(g.name)}-${m}.css`}';
473
+ ${f}`;
474
+ }
475
+ return f = f.replace("{ styled }", "{ styledClient as styled }"), f = f.replace("@salty-css/react/styled", "@salty-css/react/styled-client"), f;
476
+ }
477
+ } catch (o) {
478
+ console.error("Error in minimizeFile:", o);
479
+ }
480
+ };
481
+ export {
482
+ Ut as a,
483
+ vt as b,
484
+ Wt as c,
485
+ tt as d,
486
+ Yt as e,
487
+ Xt as g,
488
+ rt as i,
489
+ X as l,
490
+ te as m,
491
+ Ct as s
492
+ };
@@ -0,0 +1,38 @@
1
+ "use strict";const Ce=require("esbuild"),xe=require("child_process"),k=require("./dash-case-BJEkFEGQ.cjs"),r=require("path"),a=require("fs"),oe=require("fs/promises"),X=require("./parse-styles-DhDStS4F.cjs"),B=require("winston"),V=require("./css/merge.cjs");var ne=typeof document<"u"?document.currentScript:null;function Ne(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 ue=Ne(Ce),pe=async(e,t=[])=>{if(!e)return"";const s=[],n={};if(Object.entries(e).forEach(async([o,i])=>{if(typeof i=="function")return console.log("Function found",o);if(typeof i=="object"){if(!i)return;const f=o.trim(),u=await pe(i,[...t,f]);s.push(u)}else n[o]=i}),Object.keys(n).length){const o=t.map(k.dashCase).join("-"),i=await X.parseAndJoinStyles(n,`.${o}`);s.push(i)}return s.join(`
2
+ `)},Pe=e=>e?Object.entries(e).reduce((t,[s,n])=>(typeof n=="object"&&(t[s]=ye(n).map(o=>`"${o}"`).join(" | ")),t),{}):{},ye=(e,t="",s=new Set)=>e?(Object.entries(e).forEach(([n,o])=>{const i=t?`${t}.${n}`:n;return typeof o=="object"?ye(o,i,s):s.add(t)}),[...s]):[],me=e=>{if(!e||e==="/")throw new Error("Could not find package.json file");const t=r.join(e,"package.json");return a.existsSync(t)?t:me(r.join(e,".."))},ke=async e=>{const t=me(e);return await oe.readFile(t,"utf-8").then(JSON.parse).catch(()=>{})},De=async e=>{const t=await ke(e);if(t)return t.type};let v;const ge=async e=>{if(v)return v;const t=await De(e);return t==="module"?v="esm":(t==="commonjs"||(typeof document>"u"?require("url").pathToFileURL(__filename).href:ne&&ne.tagName.toUpperCase()==="SCRIPT"&&ne.src||new URL("index-CTYuOIyS.cjs",document.baseURI).href).endsWith(".cjs"))&&(v="cjs"),v||"esm"},G=B.createLogger({level:"debug",format:B.format.combine(B.format.colorize(),B.format.cli()),transports:[new B.transports.Console({})]}),_e=e=>{G.error(e)};function he(e){return e?typeof e!="string"?he(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 Te={"*, *::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"}},R={externalModules:[],rcFile:void 0,destDir:void 0},Se=e=>{if(R.externalModules.length>0)return R.externalModules;const s=a.readFileSync(e,"utf8").match(/externalModules:\s?\[(.*)\]/);if(!s)return[];const n=s[1].split(",").map(o=>o.replace(/['"`]/g,"").trim());return R.externalModules=n,n},M=async e=>{if(R.destDir)return R.destDir;const t=await re(e),s=r.join(e,(t==null?void 0:t.saltygenDir)||"saltygen");return R.destDir=s,s},ie=["salty","css","styles","styled"],we=(e=[])=>new RegExp(`\\.(${[...ie,...e].join("|")})\\.`),Y=(e,t=[])=>we(t).test(e),je=async e=>{if(R.rcFile)return R.rcFile;if(e==="/")throw new Error("Could not find .saltyrc.json file");const t=r.join(e,".saltyrc.json"),s=await oe.readFile(t,"utf-8").then(JSON.parse).catch(()=>{});return s?(R.rcFile=s,s):je(r.join(e,".."))},re=async e=>{var n,o;const t=await je(e),s=(n=t.projects)==null?void 0:n.find(i=>e.endsWith(i.dir||""));return s||((o=t.projects)==null?void 0:o.find(i=>i.dir===t.defaultProject))},Ee=async e=>{const t=await re(e),s=await M(e),n=r.join(e,(t==null?void 0:t.configDir)||"","salty.config.ts"),o=r.join(s,"salty.config.js"),i=await ge(e),f=Se(n);await ue.build({entryPoints:[n],minify:!0,treeShaking:!0,bundle:!0,outfile:o,format:i,external:f});const u=Date.now(),{config:y}=await import(`${o}?t=${u}`);return y},be=async(e,t)=>{var ce,le;const s=await M(e),n={mediaQueries:[],globalStyles:[],variables:[],templates:[]};await Promise.all([...t].map(async h=>{const{contents:b,outputFilePath:O}=await K(e,h,s);Object.entries(b).forEach(([x,P])=>{P.isMedia?n.mediaQueries.push([x,P]):P.isGlobalDefine?n.globalStyles.push(P):P.isDefineVariables?n.variables.push(P):P.isDefineTemplates&&n.templates.push(P._setPath(O))})}));const o=await Ee(e),i={...o},f=new Set,u=(h,b=[])=>h?Object.entries(h).flatMap(([O,x])=>{if(!x)return;if(typeof x=="object")return u(x,[...b,O]);const P=he(O),te=k.dashCase(O),se=[...b,P].join(".");f.add(`"${se}"`);const U=[...b.map(k.dashCase),te].join("-"),fe=X.parseVariableTokens(x);return fe?`--${U}: ${fe.transformed};`:`--${U}: ${x};`}):[],y=h=>h?Object.entries(h).flatMap(([b,O])=>{const x=u(O);return b==="base"?x.join(""):`${b} { ${x.join("")} }`}):[],d=h=>h?Object.entries(h).flatMap(([b,O])=>Object.entries(O).flatMap(([x,P])=>{const te=u(P,[b]),se=`.${b}-${x}, [data-${b}="${x}"]`,U=te.join("");return`${se} { ${U} }`})):[],m=h=>({...h,responsive:void 0,conditional:void 0}),g=h=>n.variables.map(b=>h==="static"?m(b._current):b._current[h]),p=V.mergeStyles(m(o.variables),g("static")),F=u(p),S=V.mergeStyles((ce=o.variables)==null?void 0:ce.responsive,g("responsive")),T=y(S),D=V.mergeStyles((le=o.variables)==null?void 0:le.conditional,g("conditional")),_=d(D),J=r.join(s,"css/_variables.css"),E=`:root { ${F.join("")} ${T.join("")} } ${_.join("")}`;a.writeFileSync(J,E),i.staticVariables=p;const z=r.join(s,"css/_global.css"),N=V.mergeStyles(o.global,n.globalStyles),H=await X.parseAndJoinStyles(N,"");a.writeFileSync(z,`@layer global { ${H} }`);const c=r.join(s,"css/_reset.css"),j=o.reset==="none"?{}:typeof o.reset=="object"?o.reset:Te,l=await X.parseAndJoinStyles(j,"");a.writeFileSync(c,`@layer reset { ${l} }`);const $=r.join(s,"css/_templates.css"),C=V.mergeStyles(o.templates,n.templates),q=await pe(C),I=Pe(C);a.writeFileSync($,q),i.templates=C;const W=V.mergeFactories(n.templates);i.templatePaths=Object.fromEntries(Object.entries(W).map(([h,b])=>[h,b._path||"nope"]));const{mediaQueries:A}=n;i.mediaQueries=Object.fromEntries(A.map(([h,b])=>[`@${h}`,b]));const L=A.map(([h])=>`'@${h}'`).join(" | "),ee=r.join(s,"types/css-tokens.d.ts"),Z=`
3
+ // Variable types
4
+ type VariableTokens = ${[...f].join("|")};
5
+ type PropertyValueToken = \`{\${VariableTokens}}\`;
6
+
7
+ // Template types
8
+ type TemplateTokens = {
9
+ ${Object.entries(I).map(([h,b])=>`${h}?: ${b}`).join(`
10
+ `)}
11
+ }
12
+
13
+ // Media query types
14
+ type MediaQueryKeys = ${L||"''"};
15
+ `;a.writeFileSync(ee,Z);const $e=r.join(s,"cache/config-cache.json");a.writeFileSync($e,JSON.stringify(i,null,2))},de=e=>e.replace(/styled\(([^"'`{,]+),/g,(t,s)=>{if(/^['"`]/.test(s))return t;const o=new RegExp(`import[^;]*${s}[,\\s{][^;]*from\\s?([^{};]+);`);if(!o.test(e))return t;const f=o.exec(e);if(f){const u=f.at(1);if(ie.some(d=>u==null?void 0:u.includes(d)))return t}return"styled('div',"}),Oe=(e,t)=>{try{const s=a.readFileSync(r.join(t,"saltygen/cache/config-cache.json"),"utf8");return s?`globalThis.saltyConfig = ${s};
16
+
17
+ ${e}`:`globalThis.saltyConfig = {};
18
+
19
+ ${e}`}catch{return e}},K=async(e,t,s)=>{const n=k.toHash(t),o=r.join(s,"./temp");a.existsSync(o)||a.mkdirSync(o);const i=r.parse(t);let f=a.readFileSync(t,"utf8");f=de(f),f=Oe(f,e);const u=r.join(s,"js",n+".js"),y=await re(e),d=r.join(e,(y==null?void 0:y.configDir)||"","salty.config.ts"),m=Se(d),g=await ge(e);await ue.build({stdin:{contents:f,sourcefile:i.base,resolveDir:i.dir,loader:"tsx"},minify:!1,treeShaking:!0,bundle:!0,outfile:u,format:g,target:["node20"],keepNames:!0,external:m,packages:"external",plugins:[{name:"test",setup:S=>{S.onLoad({filter:/.*\.css|salty|styles|styled\.ts/},T=>{const D=a.readFileSync(T.path,"utf8");return{contents:de(D),loader:"ts"}})}}]});const p=Date.now();return{contents:await import(`${u}?t=${p}`),outputFilePath:u}},Re=async e=>{const t=await M(e),s=r.join(t,"cache/config-cache.json"),n=a.readFileSync(s,"utf8");if(!n)throw new Error("Could not find config cache file");return JSON.parse(n)},ae=async e=>{const t=await Re(e),s=await M(e),n=r.join(s,"salty.config.js"),o=Date.now(),{config:i}=await import(`${n}?t=${o}`);return V.mergeStyles(i,t)},Fe=()=>{try{return process.env.NODE_ENV==="production"}catch{return!1}},Ve=async(e,t=Fe(),s=!0)=>{try{const n=Date.now();t?G.info("Generating CSS in production mode! 🔥"):G.info("Generating CSS in development mode! 🚀");const o=[],i=[],f=await M(e),u=r.join(f,"index.css");s&&(()=>{a.existsSync(f)&&xe.execSync("rm -rf "+f),a.mkdirSync(f,{recursive:!0}),a.mkdirSync(r.join(f,"css")),a.mkdirSync(r.join(f,"types")),a.mkdirSync(r.join(f,"js")),a.mkdirSync(r.join(f,"cache"))})();const d=new Set,m=new Set;async function g(c){const w=["node_modules","saltygen"],j=a.statSync(c);if(j.isDirectory()){const l=a.readdirSync(c);if(w.some(C=>c.includes(C)))return;await Promise.all(l.map(C=>g(r.join(c,C))))}else if(j.isFile()&&Y(c)){d.add(c);const $=a.readFileSync(c,"utf8");/define[\w\d]+\(/.test($)&&m.add(c)}}await g(e),await be(e,m);const p={keyframes:[],components:[],classNames:[]};await Promise.all([...d].map(async c=>{const{contents:w}=await K(e,c,f);Object.entries(w).forEach(([j,l])=>{l.isKeyframes?p.keyframes.push({value:l,src:c,name:j}):l.isClassName?p.classNames.push({...l,src:c,name:j}):l.generator&&p.components.push({...l,src:c,name:j})})}));const F=await ae(e);for(const c of p.keyframes){const{value:w}=c,j=`a_${w.animationName}.css`,l=`css/${j}`,$=r.join(f,l);o.push(j),a.writeFileSync($,w.css)}const S={};for(const c of p.components){const{src:w,name:j}=c,l=c.generator._withBuildContext({callerName:j,isProduction:t,config:F});i[l.priority]||(i[l.priority]=[]),i[l.priority].push(l.cssFileName);const $=`css/${l.cssFileName}`,C=r.join(f,$);a.writeFileSync(C,await l.css),F.importStrategy==="component"&&(S[w]?S[w].push(l.cssFileName):S[w]=[l.cssFileName])}for(const c of p.classNames){const{src:w,name:j}=c,l=c.generator._withBuildContext({callerName:j,isProduction:t,config:F});i[0].push(l.cssFileName);const $=`css/${l.cssFileName}`,C=r.join(f,$);a.writeFileSync(C,await l.css),F.importStrategy==="component"&&(S[w]?S[w].push(l.cssFileName):S[w]=[l.cssFileName])}F.importStrategy==="component"&&Object.entries(S).forEach(([c,w])=>{const j=w.map(I=>`@import url('./${I}');`).join(`
20
+ `),l=k.toHash(c,6),$=r.parse(c),C=k.dashCase($.name),q=r.join(f,`css/f_${C}-${l}.css`);a.writeFileSync(q,j)});const T=o.map(c=>`@import url('./css/${c}');`).join(`
21
+ `);let E=`@layer reset, global, l0, l1, l2, l3, l4, l5, l6, l7, l8;
22
+
23
+ ${["_variables.css","_reset.css","_global.css","_templates.css"].filter(c=>{try{return a.readFileSync(r.join(f,"css",c),"utf8").length>0}catch{return!1}}).map(c=>`@import url('./css/${c}');`).join(`
24
+ `)}
25
+ ${T}`;if(F.importStrategy!=="component"){const c=i.reduce((w,j,l)=>{const $=j.reduce((W,A)=>{var Z;const L=r.join(f,"css",A),ee=a.readFileSync(L,"utf8"),Q=((Z=/.*-([^-]+)-\d+.css/.exec(A))==null?void 0:Z.at(1))||k.toHash(L,6);return W.includes(Q)?W:`${W}
26
+ /*start:${Q}*/
27
+ ${ee}
28
+ /*end:${Q}*/
29
+ `},""),C=`l_${l}.css`,q=r.join(f,"css",C),I=`@layer l${l} { ${$}
30
+ }`;return a.writeFileSync(q,I),`${w}
31
+ @import url('./css/${C}');`},"");E+=c}a.writeFileSync(u,E);const N=Date.now()-n,H=N<200?"🔥":N<500?"🚀":N<1e3?"🎉":N<2e3?"🚗":N<5e3?"🤔":"🥴";G.info(`Generated CSS in ${N}ms! ${H}`)}catch(n){console.error(n)}},Me=async(e,t)=>{try{const s=await M(e);if(Y(t)){const o=[],i=await ae(e),{contents:f}=await K(e,t,s);for(const[u,y]of Object.entries(f)){if(y.isKeyframes&&y.css){const F=`css/${`a_${y.animationName}.css`}`,S=r.join(s,F);a.writeFileSync(S,await y.css);return}if(y.isClassName){const p=y.factory._withBuildContext({name:u});o[0].push(p.cssFileName);const F=`css/${p.cssFileName}`,S=r.join(s,F);a.writeFileSync(S,await p.css)}if(!y.generator)return;const d=y.generator._withBuildContext({name:u,config:i}),m=`css/${d.cssFileName}`,g=r.join(s,m);a.writeFileSync(g,await d.css),o[d.priority]||(o[d.priority]=[]),o[d.priority].push(d.cssFileName)}if(i.importStrategy!=="component")o.forEach((u,y)=>{const d=`l_${y}.css`,m=r.join(s,"css",d);let g=a.readFileSync(m,"utf8");u.forEach(p=>{var D;const F=r.join(s,"css",p),S=((D=/.*-([^-]+)-\d+.css/.exec(p))==null?void 0:D.at(1))||k.toHash(F,6);if(!g.includes(S)){const _=a.readFileSync(F,"utf8"),J=`/*start:${S}*/
32
+ ${_}
33
+ /*end:${S}*/
34
+ `;g=`${g.replace(/\}$/,"")}
35
+ ${J}
36
+ }`}}),a.writeFileSync(m,g)});else{const u=o.flat().map(p=>`@import url('./${p}');`).join(`
37
+ `),y=k.toHash(t,6),d=r.parse(t),m=k.dashCase(d.name),g=r.join(s,`css/f_${m}-${y}.css`);a.writeFileSync(g,u)}}}catch(s){console.error(s)}},Je=async(e,t,s=Fe())=>{try{const n=await M(e);if(Y(t)){const i=a.readFileSync(t,"utf8");i.replace(/^(?!export\s)const\s.*/gm,m=>`export ${m}`)!==i&&await oe.writeFile(t,i);const u=await ae(e),{contents:y}=await K(e,t,n);let d=i;if(Object.entries(y).forEach(([m,g])=>{var l;if(g.isKeyframes||!g.generator)return;const p=g.generator._withBuildContext({name:m,config:u,prod:s}),F=new RegExp(`\\s${m}[=\\s]+[^()]+styled\\(([^,]+),`,"g").exec(i);if(!F)return console.error("Could not find the original declaration");const S=(l=F.at(1))==null?void 0:l.trim(),T=new RegExp(`\\s${m}[=\\s]+styled\\(`,"g").exec(d);if(!T)return console.error("Could not find the original declaration");const{index:D}=T;let _=!1;const J=setTimeout(()=>_=!0,5e3);let E=0,z=!1,N=0;for(;!z&&!_;){const $=d[D+E];$==="("&&N++,$===")"&&N--,N===0&&$===")"&&(z=!0),E>d.length&&(_=!0),E++}if(!_)clearTimeout(J);else throw new Error("Failed to find the end of the styled call and timed out");const H=D+E,c=d.slice(D,H),w=d,j=` ${m} = styled(${S}, "${p.classNames}", ${JSON.stringify(p.clientProps)});`;d=d.replace(c,j),w===d&&console.error("Minimize file failed to change content",{name:m,tagName:S})}),u.importStrategy==="component"){const m=k.toHash(t,6),g=r.parse(t);d=`import '../../saltygen/css/${`f_${k.dashCase(g.name)}-${m}.css`}';
38
+ ${d}`}return d=d.replace("{ styled }","{ styledClient as styled }"),d=d.replace("@salty-css/react/styled","@salty-css/react/styled-client"),d}}catch(n){console.error("Error in minimizeFile:",n)}};exports.compileSaltyFile=K;exports.generateConfigStyles=be;exports.generateCss=Ve;exports.generateFile=Me;exports.isSaltyFile=Y;exports.logError=_e;exports.logger=G;exports.minimizeFile=Je;exports.saltyFileExtensions=ie;exports.saltyFileRegExp=we;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salty-css/core",
3
- "version": "0.0.1-alpha.201",
3
+ "version": "0.0.1-alpha.202",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "typings": "./dist/index.d.ts",
@@ -0,0 +1,118 @@
1
+ import { d as C } from "./dash-case-DBThphLm.js";
2
+ const A = (r) => (e) => {
3
+ if (typeof e != "string" || !r) return;
4
+ let t = e;
5
+ const o = [];
6
+ return Object.values(r).forEach((a) => {
7
+ const { pattern: w, transform: j } = a;
8
+ t = t.replace(w, (P) => {
9
+ const { value: T, css: u } = j(P);
10
+ return u && o.push(u), T;
11
+ });
12
+ }), { transformed: t, additionalCss: o };
13
+ }, k = (r) => (e) => typeof e != "string" || !/\{[^{}]+\}/g.test(e) ? void 0 : { transformed: e.replace(/\{([^{}]+)\}/g, (...a) => `var(--${C(a[1].replaceAll(".", "-"))})`) }, F = k(), M = [
14
+ "top",
15
+ "right",
16
+ "bottom",
17
+ "left",
18
+ "min-width",
19
+ /.*width.*/,
20
+ /^[^line]*height.*/,
21
+ // Exclude line-height
22
+ /padding.*/,
23
+ /margin.*/,
24
+ /border.*/,
25
+ /inset.*/,
26
+ /.*radius.*/,
27
+ /.*spacing.*/,
28
+ /.*gap.*/,
29
+ /.*indent.*/,
30
+ /.*offset.*/,
31
+ /.*size.*/,
32
+ /.*thickness.*/,
33
+ /.*font-size.*/
34
+ ], Q = (r, e, t) => {
35
+ if (M.some((a) => typeof a == "string" ? a === r : a.test(r))) {
36
+ const a = (t == null ? void 0 : t.defaultUnit) || "px";
37
+ return `${e}${a}`;
38
+ }
39
+ return `${e}`;
40
+ }, S = ["Webkit", "Moz", "ms", "O"], _ = (r) => r.startsWith("-") ? r : S.some((e) => r.startsWith(e)) ? `-${C(r)}` : C(r), $ = async (r, e = "", t) => {
41
+ if (!r) throw new Error("No styles provided to parseStyles function!");
42
+ const o = /* @__PURE__ */ new Set(), w = Object.entries(r).map(async ([y, s]) => {
43
+ var b;
44
+ const n = y.trim(), h = _(n), c = (d, f = ";") => `${h}:${d}${f}`;
45
+ if (typeof s == "function" && (s = s({ scope: e, config: t })), s instanceof Promise && (s = await s), t != null && t.templates && t.templates[n]) {
46
+ const f = s.split(".").reduce((i, p) => i[p], t.templates[n]);
47
+ if (f) {
48
+ const [i] = await $(f, "");
49
+ return i;
50
+ }
51
+ console.warn(`Template "${n}" with path of "${s}" was not found in config!`);
52
+ return;
53
+ }
54
+ if (typeof s == "object") {
55
+ if (!s) return;
56
+ if (s.isColor) return c(s.toString());
57
+ if (n === "defaultVariants") return;
58
+ if (n === "variants") {
59
+ const i = Object.entries(s);
60
+ for (const [p, m] of i) {
61
+ if (!m) return;
62
+ const x = Object.entries(m);
63
+ for (const [V, l] of x) {
64
+ if (!l) return;
65
+ const O = `${e}.${p}-${V}`;
66
+ (await $(l, O, t)).forEach((U) => o.add(U));
67
+ }
68
+ }
69
+ return;
70
+ }
71
+ if (n === "compoundVariants") {
72
+ for (const i of s) {
73
+ const { css: p, ...m } = i, x = Object.entries(m).reduce((l, [O, W]) => `${l}.${O}-${W}`, e);
74
+ (await $(p, x, t)).forEach((l) => o.add(l));
75
+ }
76
+ return;
77
+ }
78
+ if (n.startsWith("@")) {
79
+ const i = ((b = t == null ? void 0 : t.mediaQueries) == null ? void 0 : b[n]) || n, p = await N(s, e, t), m = `${i} { ${p} }`;
80
+ o.add(m);
81
+ return;
82
+ }
83
+ const d = y.includes("&") ? n.replace("&", e) : n.startsWith(":") ? `${e}${n}` : `${e} ${n}`;
84
+ (await $(s, d, t)).forEach((i) => o.add(i));
85
+ return;
86
+ }
87
+ if (typeof s == "number") {
88
+ const d = Q(h, s, t);
89
+ return c(d);
90
+ }
91
+ if (typeof s != "string")
92
+ if ("toString" in s) s = s.toString();
93
+ else throw new Error(`Invalid value type for property ${h}`);
94
+ return c(s);
95
+ }), { modifiers: j } = t || {}, P = [k(), A(j)], u = (await Promise.all(w).then((y) => Promise.all(
96
+ y.map((s) => P.reduce(async (n, h) => {
97
+ const c = await n;
98
+ if (!c) return c;
99
+ const E = await h(c);
100
+ if (!E) return c;
101
+ const { transformed: b, additionalCss: d } = E;
102
+ let f = "";
103
+ if (d)
104
+ for (const i of d)
105
+ f += await N(i, "");
106
+ return `${f}${b}`;
107
+ }, Promise.resolve(s)))
108
+ ))).join(`
109
+ `);
110
+ if (!u.trim()) return o;
111
+ const z = e ? `${e} { ${u} }` : u;
112
+ return o.add(z), o;
113
+ }, N = async (r, e, t) => [...await $(r, e, t)].join(`
114
+ `);
115
+ export {
116
+ F as a,
117
+ N as p
118
+ };