@styleframe/cli 2.4.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  })(this, (function(citty, consola, promises$1, sysPath, promises, require$$2, magicast, helpers, path, license, require$$1, require$$0, require$$3, require$$4, require$$5, require$$7, require$$8, require$$9, require$$10, require$$11, require$$12) {
4
4
  "use strict";
5
5
  var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;
6
- const version = "2.4.0";
6
+ const version = "3.0.0";
7
7
  const description = "A command-line interface for styleframe.";
8
8
  const main = citty.defineCommand({
9
9
  meta: {
@@ -12,9 +12,9 @@
12
12
  description
13
13
  },
14
14
  subCommands: {
15
- init: () => Promise.resolve().then(() => init$1).then((m2) => m2.default),
16
- build: () => Promise.resolve().then(() => build$1).then((m2) => m2.default),
17
- figma: () => Promise.resolve().then(() => index$1).then((m2) => m2.default)
15
+ init: () => Promise.resolve().then(() => init$1).then((m) => m.default),
16
+ build: () => Promise.resolve().then(() => build$1).then((m) => m.default),
17
+ figma: () => Promise.resolve().then(() => index$1).then((m) => m.default)
18
18
  }
19
19
  });
20
20
  function run() {
@@ -29,6 +29,48 @@
29
29
  return false;
30
30
  }
31
31
  }
32
+ function parseJsonc(text) {
33
+ let result = "";
34
+ let i = 0;
35
+ let inString = false;
36
+ while (i < text.length) {
37
+ const char = text[i];
38
+ const next = text[i + 1];
39
+ if (inString) {
40
+ if (char === "\\" && i + 1 < text.length) {
41
+ result += char + next;
42
+ i += 2;
43
+ continue;
44
+ }
45
+ if (char === '"') {
46
+ inString = false;
47
+ }
48
+ result += char;
49
+ i++;
50
+ } else {
51
+ if (char === '"') {
52
+ inString = true;
53
+ result += char;
54
+ i++;
55
+ } else if (char === "/" && next === "/") {
56
+ while (i < text.length && text[i] !== "\n") {
57
+ i++;
58
+ }
59
+ } else if (char === "/" && next === "*") {
60
+ i += 2;
61
+ while (i < text.length && !(text[i] === "*" && text[i + 1] === "/")) {
62
+ i++;
63
+ }
64
+ i += 2;
65
+ } else {
66
+ result += char;
67
+ i++;
68
+ }
69
+ }
70
+ }
71
+ result = result.replace(/,(\s*[}\]])/g, "$1");
72
+ return JSON.parse(result);
73
+ }
32
74
  const HOMEPAGE_URL = "https://styleframe.dev";
33
75
  const DOCS_URL = `${HOMEPAGE_URL}/docs`;
34
76
  const DOCS_MANUAL_INSTALLATION_VITE_URL = `${DOCS_URL}/getting-started/installation/manual/vite`;
@@ -82,6 +124,23 @@ s.variable("color--primary", "blue");
82
124
 
83
125
  export default s;
84
126
  `;
127
+ const styleframeIncludes = [
128
+ "styleframe.config.ts",
129
+ "*.styleframe.ts",
130
+ ".styleframe/**/*.d.ts"
131
+ ];
132
+ const tsconfigTemplate = {
133
+ compilerOptions: {
134
+ target: "ES2022",
135
+ module: "ESNext",
136
+ moduleResolution: "bundler",
137
+ strict: true,
138
+ noEmit: true,
139
+ skipLibCheck: true,
140
+ esModuleInterop: true
141
+ },
142
+ include: styleframeIncludes
143
+ };
85
144
  async function initializeConfigFile(cwd) {
86
145
  const styleframeConfigPath = sysPath.join(cwd, "styleframe.config.ts");
87
146
  if (await fileExists(styleframeConfigPath)) {
@@ -93,6 +152,34 @@ export default s;
93
152
  consola.success(`Created "styleframe.config.ts".`);
94
153
  }
95
154
  }
155
+ async function initializeTsConfig(cwd) {
156
+ const tsconfigPath = sysPath.join(cwd, "tsconfig.json");
157
+ if (await fileExists(tsconfigPath)) {
158
+ const existingConfig = parseJsonc(
159
+ await promises$1.readFile(tsconfigPath, "utf8")
160
+ );
161
+ if (!existingConfig.include) {
162
+ existingConfig.include = [];
163
+ }
164
+ const includes = existingConfig.include;
165
+ const added = [];
166
+ for (const pattern of styleframeIncludes) {
167
+ if (!includes.includes(pattern)) {
168
+ includes.push(pattern);
169
+ added.push(pattern);
170
+ }
171
+ }
172
+ if (added.length > 0) {
173
+ await promises$1.writeFile(tsconfigPath, JSON.stringify(existingConfig, null, " "));
174
+ consola.success(
175
+ `Added ${added.map((p2) => `"${p2}"`).join(", ")} to tsconfig.json includes.`
176
+ );
177
+ }
178
+ } else {
179
+ await promises$1.writeFile(tsconfigPath, JSON.stringify(tsconfigTemplate, null, " "));
180
+ consola.success(`Created "tsconfig.json".`);
181
+ }
182
+ }
96
183
  async function addPackageJsonDependencies(cwd) {
97
184
  const packageJsonPath = sysPath.join(cwd, "package.json");
98
185
  if (await fileExists(packageJsonPath)) {
@@ -148,6 +235,7 @@ export default s;
148
235
  const { cwd } = args;
149
236
  consola.info("Initializing...");
150
237
  await initializeConfigFile(cwd);
238
+ await initializeTsConfig(cwd);
151
239
  await addPackageJsonDependencies(cwd);
152
240
  await initializeFrameworkFile(cwd);
153
241
  }
@@ -157,7 +245,8 @@ export default s;
157
245
  addPackageJsonDependencies,
158
246
  default: init,
159
247
  initializeConfigFile,
160
- initializeFrameworkFile
248
+ initializeFrameworkFile,
249
+ initializeTsConfig
161
250
  }, Symbol.toStringTag, { value: "Module" }));
162
251
  function getDefaultExportFromCjs(x2) {
163
252
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
@@ -217,7 +306,7 @@ export default s;
217
306
  function kw(e4, t3) {
218
307
  return void 0 === t3 && (t3 = {}), t3.keyword = e4, d2[e4] = new acorn_TokenType(e4, t3);
219
308
  }
220
- var f2 = { num: new acorn_TokenType("num", u), regexp: new acorn_TokenType("regexp", u), string: new acorn_TokenType("string", u), name: new acorn_TokenType("name", u), privateId: new acorn_TokenType("privateId", u), eof: new acorn_TokenType("eof"), bracketL: new acorn_TokenType("[", { beforeExpr: true, startsExpr: true }), bracketR: new acorn_TokenType("]"), braceL: new acorn_TokenType("{", { beforeExpr: true, startsExpr: true }), braceR: new acorn_TokenType("}"), parenL: new acorn_TokenType("(", { beforeExpr: true, startsExpr: true }), parenR: new acorn_TokenType(")"), comma: new acorn_TokenType(",", l), semi: new acorn_TokenType(";", l), colon: new acorn_TokenType(":", l), dot: new acorn_TokenType("."), question: new acorn_TokenType("?", l), questionDot: new acorn_TokenType("?."), arrow: new acorn_TokenType("=>", l), template: new acorn_TokenType("template"), invalidTemplate: new acorn_TokenType("invalidTemplate"), ellipsis: new acorn_TokenType("...", l), backQuote: new acorn_TokenType("`", u), dollarBraceL: new acorn_TokenType("${", { beforeExpr: true, startsExpr: true }), eq: new acorn_TokenType("=", { beforeExpr: true, isAssign: true }), assign: new acorn_TokenType("_=", { beforeExpr: true, isAssign: true }), incDec: new acorn_TokenType("++/--", { prefix: true, postfix: true, startsExpr: true }), prefix: new acorn_TokenType("!/~", { beforeExpr: true, prefix: true, startsExpr: true }), logicalOR: binop("||", 1), logicalAND: binop("&&", 2), bitwiseOR: binop("|", 3), bitwiseXOR: binop("^", 4), bitwiseAND: binop("&", 5), equality: binop("==/!=/===/!==", 6), relational: binop("</>/<=/>=", 7), bitShift: binop("<</>>/>>>", 8), plusMin: new acorn_TokenType("+/-", { beforeExpr: true, binop: 9, prefix: true, startsExpr: true }), modulo: binop("%", 10), star: binop("*", 10), slash: binop("/", 10), starstar: new acorn_TokenType("**", { beforeExpr: true }), coalesce: binop("??", 1), _break: kw("break"), _case: kw("case", l), _catch: kw("catch"), _continue: kw("continue"), _debugger: kw("debugger"), _default: kw("default", l), _do: kw("do", { isLoop: true, beforeExpr: true }), _else: kw("else", l), _finally: kw("finally"), _for: kw("for", { isLoop: true }), _function: kw("function", u), _if: kw("if"), _return: kw("return", l), _switch: kw("switch"), _throw: kw("throw", l), _try: kw("try"), _var: kw("var"), _const: kw("const"), _while: kw("while", { isLoop: true }), _with: kw("with"), _new: kw("new", { beforeExpr: true, startsExpr: true }), _this: kw("this", u), _super: kw("super", u), _class: kw("class", u), _extends: kw("extends", l), _export: kw("export"), _import: kw("import", u), _null: kw("null", u), _true: kw("true", u), _false: kw("false", u), _in: kw("in", { beforeExpr: true, binop: 7 }), _instanceof: kw("instanceof", { beforeExpr: true, binop: 7 }), _typeof: kw("typeof", { beforeExpr: true, prefix: true, startsExpr: true }), _void: kw("void", { beforeExpr: true, prefix: true, startsExpr: true }), _delete: kw("delete", { beforeExpr: true, prefix: true, startsExpr: true }) }, m2 = /\r\n?|\n|\u2028|\u2029/, g2 = new RegExp(m2.source, "g");
309
+ var f2 = { num: new acorn_TokenType("num", u), regexp: new acorn_TokenType("regexp", u), string: new acorn_TokenType("string", u), name: new acorn_TokenType("name", u), privateId: new acorn_TokenType("privateId", u), eof: new acorn_TokenType("eof"), bracketL: new acorn_TokenType("[", { beforeExpr: true, startsExpr: true }), bracketR: new acorn_TokenType("]"), braceL: new acorn_TokenType("{", { beforeExpr: true, startsExpr: true }), braceR: new acorn_TokenType("}"), parenL: new acorn_TokenType("(", { beforeExpr: true, startsExpr: true }), parenR: new acorn_TokenType(")"), comma: new acorn_TokenType(",", l), semi: new acorn_TokenType(";", l), colon: new acorn_TokenType(":", l), dot: new acorn_TokenType("."), question: new acorn_TokenType("?", l), questionDot: new acorn_TokenType("?."), arrow: new acorn_TokenType("=>", l), template: new acorn_TokenType("template"), invalidTemplate: new acorn_TokenType("invalidTemplate"), ellipsis: new acorn_TokenType("...", l), backQuote: new acorn_TokenType("`", u), dollarBraceL: new acorn_TokenType("${", { beforeExpr: true, startsExpr: true }), eq: new acorn_TokenType("=", { beforeExpr: true, isAssign: true }), assign: new acorn_TokenType("_=", { beforeExpr: true, isAssign: true }), incDec: new acorn_TokenType("++/--", { prefix: true, postfix: true, startsExpr: true }), prefix: new acorn_TokenType("!/~", { beforeExpr: true, prefix: true, startsExpr: true }), logicalOR: binop("||", 1), logicalAND: binop("&&", 2), bitwiseOR: binop("|", 3), bitwiseXOR: binop("^", 4), bitwiseAND: binop("&", 5), equality: binop("==/!=/===/!==", 6), relational: binop("</>/<=/>=", 7), bitShift: binop("<</>>/>>>", 8), plusMin: new acorn_TokenType("+/-", { beforeExpr: true, binop: 9, prefix: true, startsExpr: true }), modulo: binop("%", 10), star: binop("*", 10), slash: binop("/", 10), starstar: new acorn_TokenType("**", { beforeExpr: true }), coalesce: binop("??", 1), _break: kw("break"), _case: kw("case", l), _catch: kw("catch"), _continue: kw("continue"), _debugger: kw("debugger"), _default: kw("default", l), _do: kw("do", { isLoop: true, beforeExpr: true }), _else: kw("else", l), _finally: kw("finally"), _for: kw("for", { isLoop: true }), _function: kw("function", u), _if: kw("if"), _return: kw("return", l), _switch: kw("switch"), _throw: kw("throw", l), _try: kw("try"), _var: kw("var"), _const: kw("const"), _while: kw("while", { isLoop: true }), _with: kw("with"), _new: kw("new", { beforeExpr: true, startsExpr: true }), _this: kw("this", u), _super: kw("super", u), _class: kw("class", u), _extends: kw("extends", l), _export: kw("export"), _import: kw("import", u), _null: kw("null", u), _true: kw("true", u), _false: kw("false", u), _in: kw("in", { beforeExpr: true, binop: 7 }), _instanceof: kw("instanceof", { beforeExpr: true, binop: 7 }), _typeof: kw("typeof", { beforeExpr: true, prefix: true, startsExpr: true }), _void: kw("void", { beforeExpr: true, prefix: true, startsExpr: true }), _delete: kw("delete", { beforeExpr: true, prefix: true, startsExpr: true }) }, m = /\r\n?|\n|\u2028|\u2029/, g = new RegExp(m.source, "g");
221
310
  function isNewLine(e4) {
222
311
  return 10 === e4 || 13 === e4 || 8232 === e4 || 8233 === e4;
223
312
  }
@@ -229,8 +318,8 @@ export default s;
229
318
  }
230
319
  return -1;
231
320
  }
232
- var x2 = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, v2 = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, y = Object.prototype, _ = y.hasOwnProperty, E2 = y.toString, b = Object.hasOwn || function(e4, t3) {
233
- return _.call(e4, t3);
321
+ var x2 = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, v2 = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, y = Object.prototype, _2 = y.hasOwnProperty, E2 = y.toString, b = Object.hasOwn || function(e4, t3) {
322
+ return _2.call(e4, t3);
234
323
  }, S2 = Array.isArray || function(e4) {
235
324
  return "[object Array]" === E2.call(e4);
236
325
  }, k2 = /* @__PURE__ */ Object.create(null);
@@ -282,7 +371,7 @@ export default s;
282
371
  var s2 = "";
283
372
  true !== e4.allowReserved && (s2 = n[e4.ecmaVersion >= 6 ? 6 : 5 === e4.ecmaVersion ? 5 : 3], "module" === e4.sourceType && (s2 += " await")), this.reservedWords = wordsRegexp(s2);
284
373
  var r2 = (s2 ? s2 + " " : "") + n.strict;
285
- this.reservedWordsStrict = wordsRegexp(r2), this.reservedWordsStrictBind = wordsRegexp(r2 + " " + n.strictBind), this.input = String(t3), this.containsEsc = false, i2 ? (this.pos = i2, this.lineStart = this.input.lastIndexOf("\n", i2 - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(m2).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = f2.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = true, this.inModule = "module" === e4.sourceType, this.strict = this.inModule || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = false, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = /* @__PURE__ */ Object.create(null), 0 === this.pos && e4.allowHashBang && "#!" === this.input.slice(0, 2) && this.skipLineComment(2), this.scopeStack = [], this.enterScope(1), this.regexpState = null, this.privateNameStack = [];
374
+ this.reservedWordsStrict = wordsRegexp(r2), this.reservedWordsStrictBind = wordsRegexp(r2 + " " + n.strictBind), this.input = String(t3), this.containsEsc = false, i2 ? (this.pos = i2, this.lineStart = this.input.lastIndexOf("\n", i2 - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(m).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = f2.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = true, this.inModule = "module" === e4.sourceType, this.strict = this.inModule || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = false, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = /* @__PURE__ */ Object.create(null), 0 === this.pos && e4.allowHashBang && "#!" === this.input.slice(0, 2) && this.skipLineComment(2), this.scopeStack = [], this.enterScope(1), this.regexpState = null, this.privateNameStack = [];
286
375
  }, T2 = { inFunction: { configurable: true }, inGenerator: { configurable: true }, inAsync: { configurable: true }, canAwait: { configurable: true }, allowSuper: { configurable: true }, allowDirectSuper: { configurable: true }, treatFunctionsAsVar: { configurable: true }, allowNewDotTarget: { configurable: true }, inClassStaticBlock: { configurable: true } };
287
376
  acorn_Parser.prototype.parse = function() {
288
377
  var e4 = this.options.program || this.startNode();
@@ -336,7 +425,7 @@ export default s;
336
425
  if ("use strict" === (t3[1] || t3[2])) {
337
426
  v2.lastIndex = e4 + t3[0].length;
338
427
  var i2 = v2.exec(this.input), s2 = i2.index + i2[0].length, r2 = this.input.charAt(s2);
339
- return ";" === r2 || "}" === r2 || m2.test(i2[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(r2) || "!" === r2 && "=" === this.input.charAt(s2 + 1));
428
+ return ";" === r2 || "}" === r2 || m.test(i2[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(r2) || "!" === r2 && "=" === this.input.charAt(s2 + 1));
340
429
  }
341
430
  e4 += t3[0].length, v2.lastIndex = e4, e4 += v2.exec(this.input)[0].length, ";" === this.input[e4] && e4++;
342
431
  }
@@ -349,7 +438,7 @@ export default s;
349
438
  }, A2.expectContextual = function(e4) {
350
439
  this.eatContextual(e4) || this.unexpected();
351
440
  }, A2.canInsertSemicolon = function() {
352
- return this.type === f2.eof || this.type === f2.braceR || m2.test(this.input.slice(this.lastTokEnd, this.start));
441
+ return this.type === f2.eof || this.type === f2.braceR || m.test(this.input.slice(this.lastTokEnd, this.start));
353
442
  }, A2.insertSemicolon = function() {
354
443
  if (this.canInsertSemicolon()) return this.options.onInsertedSemicolon && this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc), true;
355
444
  }, A2.semicolon = function() {
@@ -412,18 +501,18 @@ export default s;
412
501
  if (this.options.ecmaVersion < 8 || !this.isContextual("async")) return false;
413
502
  v2.lastIndex = this.pos;
414
503
  var e4, t3 = v2.exec(this.input), i2 = this.pos + t3[0].length;
415
- return !(m2.test(this.input.slice(this.pos, i2)) || "function" !== this.input.slice(i2, i2 + 8) || i2 + 8 !== this.input.length && (isIdentifierChar(e4 = this.input.charCodeAt(i2 + 8)) || e4 > 55295 && e4 < 56320));
504
+ return !(m.test(this.input.slice(this.pos, i2)) || "function" !== this.input.slice(i2, i2 + 8) || i2 + 8 !== this.input.length && (isIdentifierChar(e4 = this.input.charCodeAt(i2 + 8)) || e4 > 55295 && e4 < 56320));
416
505
  }, L2.isUsingKeyword = function(e4, t3) {
417
506
  if (this.options.ecmaVersion < 17 || !this.isContextual(e4 ? "await" : "using")) return false;
418
507
  v2.lastIndex = this.pos;
419
508
  var i2 = v2.exec(this.input), s2 = this.pos + i2[0].length;
420
- if (m2.test(this.input.slice(this.pos, s2))) return false;
509
+ if (m.test(this.input.slice(this.pos, s2))) return false;
421
510
  if (e4) {
422
511
  var r2, n2 = s2 + 5;
423
512
  if ("using" !== this.input.slice(s2, n2) || n2 === this.input.length || isIdentifierChar(r2 = this.input.charCodeAt(n2)) || r2 > 55295 && r2 < 56320) return false;
424
513
  v2.lastIndex = n2;
425
514
  var a2 = v2.exec(this.input);
426
- if (a2 && m2.test(this.input.slice(n2, n2 + a2[0].length))) return false;
515
+ if (a2 && m.test(this.input.slice(n2, n2 + a2[0].length))) return false;
427
516
  }
428
517
  if (t3) {
429
518
  var o2, h3 = s2 + 2;
@@ -535,7 +624,7 @@ export default s;
535
624
  } else t3 || this.unexpected(), t3.consequent.push(this.parseStatement(null));
536
625
  return this.exitScope(), t3 && this.finishNode(t3, "SwitchCase"), this.next(), this.labels.pop(), this.finishNode(e4, "SwitchStatement");
537
626
  }, L2.parseThrowStatement = function(e4) {
538
- return this.next(), m2.test(this.input.slice(this.lastTokEnd, this.start)) && this.raise(this.lastTokEnd, "Illegal newline after throw"), e4.argument = this.parseExpression(), this.semicolon(), this.finishNode(e4, "ThrowStatement");
627
+ return this.next(), m.test(this.input.slice(this.lastTokEnd, this.start)) && this.raise(this.lastTokEnd, "Illegal newline after throw"), e4.argument = this.parseExpression(), this.semicolon(), this.finishNode(e4, "ThrowStatement");
539
628
  };
540
629
  var V2 = [];
541
630
  L2.parseCatchClauseParam = function() {
@@ -920,7 +1009,7 @@ export default s;
920
1009
  return this.context[this.context.length - 1];
921
1010
  }, B2.braceIsBlock = function(e4) {
922
1011
  var t3 = this.curContext();
923
- return t3 === F2.f_expr || t3 === F2.f_stat || (e4 !== f2.colon || t3 !== F2.b_stat && t3 !== F2.b_expr ? e4 === f2._return || e4 === f2.name && this.exprAllowed ? m2.test(this.input.slice(this.lastTokEnd, this.start)) : e4 === f2._else || e4 === f2.semi || e4 === f2.eof || e4 === f2.parenR || e4 === f2.arrow || (e4 === f2.braceL ? t3 === F2.b_stat : e4 !== f2._var && e4 !== f2._const && e4 !== f2.name && !this.exprAllowed) : !t3.isExpr);
1012
+ return t3 === F2.f_expr || t3 === F2.f_stat || (e4 !== f2.colon || t3 !== F2.b_stat && t3 !== F2.b_expr ? e4 === f2._return || e4 === f2.name && this.exprAllowed ? m.test(this.input.slice(this.lastTokEnd, this.start)) : e4 === f2._else || e4 === f2.semi || e4 === f2.eof || e4 === f2.parenR || e4 === f2.arrow || (e4 === f2.braceL ? t3 === F2.b_stat : e4 !== f2._var && e4 !== f2._const && e4 !== f2.name && !this.exprAllowed) : !t3.isExpr);
924
1013
  }, B2.inGeneratorContext = function() {
925
1014
  for (var e4 = this.context.length - 1; e4 >= 1; e4--) {
926
1015
  var t3 = this.context[e4];
@@ -946,7 +1035,7 @@ export default s;
946
1035
  this.context.push(t3 ? F2.p_stat : F2.p_expr), this.exprAllowed = true;
947
1036
  }, f2.incDec.updateContext = function() {
948
1037
  }, f2._function.updateContext = f2._class.updateContext = function(e4) {
949
- !e4.beforeExpr || e4 === f2._else || e4 === f2.semi && this.curContext() !== F2.p_stat || e4 === f2._return && m2.test(this.input.slice(this.lastTokEnd, this.start)) || (e4 === f2.colon || e4 === f2.braceL) && this.curContext() === F2.b_stat ? this.context.push(F2.f_stat) : this.context.push(F2.f_expr), this.exprAllowed = false;
1038
+ !e4.beforeExpr || e4 === f2._else || e4 === f2.semi && this.curContext() !== F2.p_stat || e4 === f2._return && m.test(this.input.slice(this.lastTokEnd, this.start)) || (e4 === f2.colon || e4 === f2.braceL) && this.curContext() === F2.b_stat ? this.context.push(F2.f_stat) : this.context.push(F2.f_expr), this.exprAllowed = false;
950
1039
  }, f2.colon.updateContext = function() {
951
1040
  "function" === this.curContext().token && this.context.pop(), this.exprAllowed = true;
952
1041
  }, f2.backQuote.updateContext = function() {
@@ -1082,13 +1171,13 @@ export default s;
1082
1171
  var p3 = this.startNodeAt(t3, i2);
1083
1172
  p3.object = e4, c3 ? (p3.property = this.parseExpression(), this.expect(f2.bracketR)) : this.type === f2.privateId && "Super" !== e4.type ? p3.property = this.parsePrivateIdent() : p3.property = this.parseIdent("never" !== this.options.allowReserved), p3.computed = !!c3, o2 && (p3.optional = h3), e4 = this.finishNode(p3, "MemberExpression");
1084
1173
  } else if (!s2 && this.eat(f2.parenL)) {
1085
- var l2 = new acorn_DestructuringErrors(), u2 = this.yieldPos, d3 = this.awaitPos, m3 = this.awaitIdentPos;
1174
+ var l2 = new acorn_DestructuringErrors(), u2 = this.yieldPos, d3 = this.awaitPos, m2 = this.awaitIdentPos;
1086
1175
  this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
1087
- var g3 = this.parseExprList(f2.parenR, this.options.ecmaVersion >= 8, false, l2);
1088
- if (r2 && !h3 && this.shouldParseAsyncArrow()) return this.checkPatternErrors(l2, false), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = u2, this.awaitPos = d3, this.awaitIdentPos = m3, this.parseSubscriptAsyncArrow(t3, i2, g3, a2);
1089
- this.checkExpressionErrors(l2, true), this.yieldPos = u2 || this.yieldPos, this.awaitPos = d3 || this.awaitPos, this.awaitIdentPos = m3 || this.awaitIdentPos;
1176
+ var g2 = this.parseExprList(f2.parenR, this.options.ecmaVersion >= 8, false, l2);
1177
+ if (r2 && !h3 && this.shouldParseAsyncArrow()) return this.checkPatternErrors(l2, false), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = u2, this.awaitPos = d3, this.awaitIdentPos = m2, this.parseSubscriptAsyncArrow(t3, i2, g2, a2);
1178
+ this.checkExpressionErrors(l2, true), this.yieldPos = u2 || this.yieldPos, this.awaitPos = d3 || this.awaitPos, this.awaitIdentPos = m2 || this.awaitIdentPos;
1090
1179
  var x3 = this.startNodeAt(t3, i2);
1091
- x3.callee = e4, x3.arguments = g3, o2 && (x3.optional = h3), e4 = this.finishNode(x3, "CallExpression");
1180
+ x3.callee = e4, x3.arguments = g2, o2 && (x3.optional = h3), e4 = this.finishNode(x3, "CallExpression");
1092
1181
  } else if (this.type === f2.backQuote) {
1093
1182
  (h3 || n2) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
1094
1183
  var v3 = this.startNodeAt(t3, i2);
@@ -1175,7 +1264,7 @@ export default s;
1175
1264
  var i2, s2 = this.start, r2 = this.startLoc, n2 = this.options.ecmaVersion >= 8;
1176
1265
  if (this.options.ecmaVersion >= 6) {
1177
1266
  this.next();
1178
- var a2, o2 = this.start, h3 = this.startLoc, c3 = [], p3 = true, l2 = false, u2 = new acorn_DestructuringErrors(), d3 = this.yieldPos, m3 = this.awaitPos;
1267
+ var a2, o2 = this.start, h3 = this.startLoc, c3 = [], p3 = true, l2 = false, u2 = new acorn_DestructuringErrors(), d3 = this.yieldPos, m2 = this.awaitPos;
1179
1268
  for (this.yieldPos = 0, this.awaitPos = 0; this.type !== f2.parenR; ) {
1180
1269
  if (p3 ? p3 = false : this.expect(f2.comma), n2 && this.afterTrailingComma(f2.parenR, true)) {
1181
1270
  l2 = true;
@@ -1187,9 +1276,9 @@ export default s;
1187
1276
  }
1188
1277
  c3.push(this.parseMaybeAssign(false, u2, this.parseParenItem));
1189
1278
  }
1190
- var g3 = this.lastTokEnd, x3 = this.lastTokEndLoc;
1191
- if (this.expect(f2.parenR), e4 && this.shouldParseArrow(c3) && this.eat(f2.arrow)) return this.checkPatternErrors(u2, false), this.checkYieldAwaitInDefaultParams(), this.yieldPos = d3, this.awaitPos = m3, this.parseParenArrowList(s2, r2, c3, t3);
1192
- c3.length && !l2 || this.unexpected(this.lastTokStart), a2 && this.unexpected(a2), this.checkExpressionErrors(u2, true), this.yieldPos = d3 || this.yieldPos, this.awaitPos = m3 || this.awaitPos, c3.length > 1 ? ((i2 = this.startNodeAt(o2, h3)).expressions = c3, this.finishNodeAt(i2, "SequenceExpression", g3, x3)) : i2 = c3[0];
1279
+ var g2 = this.lastTokEnd, x3 = this.lastTokEndLoc;
1280
+ if (this.expect(f2.parenR), e4 && this.shouldParseArrow(c3) && this.eat(f2.arrow)) return this.checkPatternErrors(u2, false), this.checkYieldAwaitInDefaultParams(), this.yieldPos = d3, this.awaitPos = m2, this.parseParenArrowList(s2, r2, c3, t3);
1281
+ c3.length && !l2 || this.unexpected(this.lastTokStart), a2 && this.unexpected(a2), this.checkExpressionErrors(u2, true), this.yieldPos = d3 || this.yieldPos, this.awaitPos = m2 || this.awaitPos, c3.length > 1 ? ((i2 = this.startNodeAt(o2, h3)).expressions = c3, this.finishNodeAt(i2, "SequenceExpression", g2, x3)) : i2 = c3[0];
1193
1282
  } else i2 = this.parseParenExpression();
1194
1283
  if (this.options.preserveParens) {
1195
1284
  var v3 = this.startNodeAt(s2, r2);
@@ -1226,7 +1315,7 @@ export default s;
1226
1315
  for (i2.quasis = [s2]; !s2.tail; ) this.type === f2.eof && this.raise(this.pos, "Unterminated template literal"), this.expect(f2.dollarBraceL), i2.expressions.push(this.parseExpression()), this.expect(f2.braceR), i2.quasis.push(s2 = this.parseTemplateElement({ isTagged: t3 }));
1227
1316
  return this.next(), this.finishNode(i2, "TemplateLiteral");
1228
1317
  }, $2.isAsyncProp = function(e4) {
1229
- return !e4.computed && "Identifier" === e4.key.type && "async" === e4.key.name && (this.type === f2.name || this.type === f2.num || this.type === f2.string || this.type === f2.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === f2.star) && !m2.test(this.input.slice(this.lastTokEnd, this.start));
1318
+ return !e4.computed && "Identifier" === e4.key.type && "async" === e4.key.name && (this.type === f2.name || this.type === f2.num || this.type === f2.string || this.type === f2.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === f2.star) && !m.test(this.input.slice(this.lastTokEnd, this.start));
1230
1319
  }, $2.parseObj = function(e4, t3) {
1231
1320
  var i2 = this.startNode(), s2 = true, r2 = {};
1232
1321
  for (i2.properties = [], this.next(); !this.eat(f2.braceR); ) {
@@ -1959,7 +2048,7 @@ export default s;
1959
2048
  return 61 === this.input.charCodeAt(this.pos + 1) ? this.finishOp(f2.assign, 2) : this.finishOp(f2.bitwiseXOR, 1);
1960
2049
  }, ce2.readToken_plus_min = function(e4) {
1961
2050
  var t3 = this.input.charCodeAt(this.pos + 1);
1962
- return t3 === e4 ? 45 !== t3 || this.inModule || 62 !== this.input.charCodeAt(this.pos + 2) || 0 !== this.lastTokEnd && !m2.test(this.input.slice(this.lastTokEnd, this.pos)) ? this.finishOp(f2.incDec, 2) : (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : 61 === t3 ? this.finishOp(f2.assign, 2) : this.finishOp(f2.plusMin, 1);
2051
+ return t3 === e4 ? 45 !== t3 || this.inModule || 62 !== this.input.charCodeAt(this.pos + 2) || 0 !== this.lastTokEnd && !m.test(this.input.slice(this.lastTokEnd, this.pos)) ? this.finishOp(f2.incDec, 2) : (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : 61 === t3 ? this.finishOp(f2.assign, 2) : this.finishOp(f2.plusMin, 1);
1963
2052
  }, ce2.readToken_lt_gt = function(e4) {
1964
2053
  var t3 = this.input.charCodeAt(this.pos + 1), i2 = 1;
1965
2054
  return t3 === e4 ? (i2 = 62 === e4 && 62 === this.input.charCodeAt(this.pos + 2) ? 3 : 2, 61 === this.input.charCodeAt(this.pos + i2) ? this.finishOp(f2.assign, i2 + 1) : this.finishOp(f2.bitShift, i2)) : 33 !== t3 || 60 !== e4 || this.inModule || 45 !== this.input.charCodeAt(this.pos + 2) || 45 !== this.input.charCodeAt(this.pos + 3) ? (61 === t3 && (i2 = 2), this.finishOp(f2.relational, i2)) : (this.skipLineComment(4), this.skipSpace(), this.nextToken());
@@ -2065,7 +2154,7 @@ export default s;
2065
2154
  for (var e4, t3, i2 = this.pos; ; ) {
2066
2155
  this.pos >= this.input.length && this.raise(i2, "Unterminated regular expression");
2067
2156
  var s2 = this.input.charAt(this.pos);
2068
- if (m2.test(s2) && this.raise(i2, "Unterminated regular expression"), e4) e4 = false;
2157
+ if (m.test(s2) && this.raise(i2, "Unterminated regular expression"), e4) e4 = false;
2069
2158
  else {
2070
2159
  if ("[" === s2) t3 = true;
2071
2160
  else if ("]" === s2 && t3) t3 = false;
@@ -2239,7 +2328,7 @@ export default s;
2239
2328
  var e4 = this.readWord1(), t3 = f2.name;
2240
2329
  return this.keywords.test(e4) && (t3 = d2[e4]), this.finishToken(t3, e4);
2241
2330
  };
2242
- acorn_Parser.acorn = { Parser: acorn_Parser, version: "8.15.0", defaultOptions: I2, Position: acorn_Position, SourceLocation: acorn_SourceLocation, getLineInfo, Node: acorn_Node, TokenType: acorn_TokenType, tokTypes: f2, keywordTypes: d2, TokContext: acorn_TokContext, tokContexts: F2, isIdentifierChar, isIdentifierStart, Token: acorn_Token, isNewLine, lineBreak: m2, lineBreakG: g2, nonASCIIwhitespace: x2 };
2331
+ acorn_Parser.acorn = { Parser: acorn_Parser, version: "8.15.0", defaultOptions: I2, Position: acorn_Position, SourceLocation: acorn_SourceLocation, getLineInfo, Node: acorn_Node, TokenType: acorn_TokenType, tokTypes: f2, keywordTypes: d2, TokContext: acorn_TokContext, tokContexts: F2, isIdentifierChar, isIdentifierStart, Token: acorn_Token, isNewLine, lineBreak: m, lineBreakG: g, nonASCIIwhitespace: x2 };
2243
2332
  const le2 = require$$1, ue2 = require$$2;
2244
2333
  const fe2 = /^\.?\//;
2245
2334
  function withTrailingSlash(e4 = "", t3) {
@@ -2260,7 +2349,7 @@ export default s;
2260
2349
  function pathe_M_eThtNZ_normalizeWindowsPath(e4 = "") {
2261
2350
  return e4 ? e4.replace(/\\/g, "/").replace(me2, (e5) => e5.toUpperCase()) : e4;
2262
2351
  }
2263
- const ge2 = /^[/\\]{2}/, xe = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, ve2 = /^[A-Za-z]:$/, ye2 = /.(\.[^./]+|\.)$/, pathe_M_eThtNZ_normalize = function(e4) {
2352
+ const ge2 = /^[/\\]{2}/, xe2 = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, ve2 = /^[A-Za-z]:$/, ye2 = /.(\.[^./]+|\.)$/, pathe_M_eThtNZ_normalize = function(e4) {
2264
2353
  if (0 === e4.length) return ".";
2265
2354
  const t3 = (e4 = pathe_M_eThtNZ_normalizeWindowsPath(e4)).match(ge2), i2 = isAbsolute(e4), s2 = "/" === e4[e4.length - 1];
2266
2355
  return 0 === (e4 = normalizeString(e4, !i2)).length ? i2 ? "/" : s2 ? "./" : "." : (s2 && (e4 += "/"), ve2.test(e4) && (e4 += "/"), t3 ? i2 ? `//${e4}` : `//./${e4}` : i2 && !isAbsolute(e4) ? `/${e4}` : e4);
@@ -2313,7 +2402,7 @@ export default s;
2313
2402
  return i2;
2314
2403
  }
2315
2404
  const isAbsolute = function(e4) {
2316
- return xe.test(e4);
2405
+ return xe2.test(e4);
2317
2406
  }, extname = function(e4) {
2318
2407
  if (".." === e4) return "";
2319
2408
  const t3 = ye2.exec(pathe_M_eThtNZ_normalizeWindowsPath(e4));
@@ -2332,11 +2421,11 @@ export default s;
2332
2421
  }
2333
2422
  }
2334
2423
  return s2;
2335
- }, _e2 = require$$3, Ee2 = require$$4, be2 = require$$5, Se2 = path, ke = require$$7, we2 = require$$8, Ie = new Set(le2.builtinModules);
2424
+ }, _e2 = require$$3, Ee2 = require$$4, be2 = require$$5, Se2 = path, ke2 = require$$7, we2 = require$$8, Ie2 = new Set(le2.builtinModules);
2336
2425
  function normalizeSlash(e4) {
2337
2426
  return e4.replace(/\\/g, "/");
2338
2427
  }
2339
- const Ce2 = {}.hasOwnProperty, Re2 = /^([A-Z][a-z\d]*)+$/, Pe = /* @__PURE__ */ new Set(["string", "function", "number", "object", "Function", "Object", "boolean", "bigint", "symbol"]), Te2 = {};
2428
+ const Ce2 = {}.hasOwnProperty, Re2 = /^([A-Z][a-z\d]*)+$/, Pe2 = /* @__PURE__ */ new Set(["string", "function", "number", "object", "Function", "Object", "boolean", "bigint", "symbol"]), Te2 = {};
2340
2429
  function formatList(e4, t3 = "and") {
2341
2430
  return e4.length < 3 ? e4.join(` ${t3} `) : `${e4.slice(0, -1).join(", ")}, ${t3} ${e4[e4.length - 1]}`;
2342
2431
  }
@@ -2366,7 +2455,7 @@ export default s;
2366
2455
  }
2367
2456
  function isErrorStackTraceLimitWritable() {
2368
2457
  try {
2369
- if (ke.startupSnapshot.isBuildingSnapshot()) return false;
2458
+ if (ke2.startupSnapshot.isBuildingSnapshot()) return false;
2370
2459
  } catch {
2371
2460
  }
2372
2461
  const e4 = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
@@ -2382,7 +2471,7 @@ export default s;
2382
2471
  }
2383
2472
  s2 += "must be ";
2384
2473
  const r2 = [], n2 = [], a2 = [];
2385
- for (const e5 of t3) Ee2("string" == typeof e5, "All expected entries have to be of type string"), Pe.has(e5) ? r2.push(e5.toLowerCase()) : null === Re2.exec(e5) ? (Ee2("object" !== e5, 'The value "object" should be written as "Object"'), a2.push(e5)) : n2.push(e5);
2474
+ for (const e5 of t3) Ee2("string" == typeof e5, "All expected entries have to be of type string"), Pe2.has(e5) ? r2.push(e5.toLowerCase()) : null === Re2.exec(e5) ? (Ee2("object" !== e5, 'The value "object" should be written as "Object"'), a2.push(e5)) : n2.push(e5);
2386
2475
  if (n2.length > 0) {
2387
2476
  const e5 = r2.indexOf("object");
2388
2477
  -1 !== e5 && (r2.slice(e5, 1), n2.push("Object"));
@@ -2410,9 +2499,9 @@ export default s;
2410
2499
  const t3 = isErrorStackTraceLimitWritable();
2411
2500
  return t3 && (Ne2 = Error.stackTraceLimit, Error.stackTraceLimit = Number.POSITIVE_INFINITY), Error.captureStackTrace(e4), t3 && (Error.stackTraceLimit = Ne2), e4;
2412
2501
  });
2413
- const Oe2 = {}.hasOwnProperty, { ERR_INVALID_PACKAGE_CONFIG: De } = Te2, Ve = /* @__PURE__ */ new Map();
2502
+ const Oe2 = {}.hasOwnProperty, { ERR_INVALID_PACKAGE_CONFIG: De2 } = Te2, Ve2 = /* @__PURE__ */ new Map();
2414
2503
  function read(e4, { base: t3, specifier: i2 }) {
2415
- const s2 = Ve.get(e4);
2504
+ const s2 = Ve2.get(e4);
2416
2505
  if (s2) return s2;
2417
2506
  let r2;
2418
2507
  try {
@@ -2427,12 +2516,12 @@ export default s;
2427
2516
  try {
2428
2517
  s3 = JSON.parse(r2);
2429
2518
  } catch (s4) {
2430
- const r3 = s4, n3 = new De(e4, (t3 ? `"${i2}" from ` : "") + (0, _e2.fileURLToPath)(t3 || i2), r3.message);
2519
+ const r3 = s4, n3 = new De2(e4, (t3 ? `"${i2}" from ` : "") + (0, _e2.fileURLToPath)(t3 || i2), r3.message);
2431
2520
  throw n3.cause = r3, n3;
2432
2521
  }
2433
2522
  n2.exists = true, Oe2.call(s3, "name") && "string" == typeof s3.name && (n2.name = s3.name), Oe2.call(s3, "main") && "string" == typeof s3.main && (n2.main = s3.main), Oe2.call(s3, "exports") && (n2.exports = s3.exports), Oe2.call(s3, "imports") && (n2.imports = s3.imports), !Oe2.call(s3, "type") || "commonjs" !== s3.type && "module" !== s3.type || (n2.type = s3.type);
2434
2523
  }
2435
- return Ve.set(e4, n2), n2;
2524
+ return Ve2.set(e4, n2), n2;
2436
2525
  }
2437
2526
  function getPackageScopeConfig(e4) {
2438
2527
  let t3 = new URL("package.json", e4);
@@ -2449,7 +2538,7 @@ export default s;
2449
2538
  return getPackageScopeConfig(e4).type;
2450
2539
  }
2451
2540
  const { ERR_UNKNOWN_FILE_EXTENSION: Ue } = Te2, Me = {}.hasOwnProperty, je2 = { __proto__: null, ".cjs": "commonjs", ".js": "module", ".json": "json", ".mjs": "module" };
2452
- const Fe = { __proto__: null, "data:": function(e4) {
2541
+ const Fe2 = { __proto__: null, "data:": function(e4) {
2453
2542
  const { 1: t3 } = /^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(e4.pathname) || [null, null, null];
2454
2543
  return (function(e5) {
2455
2544
  return e5 && /\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(e5) ? "module" : "application/json" === e5 ? "json" : null;
@@ -2491,7 +2580,7 @@ export default s;
2491
2580
  if (be2.noDeprecation) return;
2492
2581
  const r2 = (function(e5, t4) {
2493
2582
  const i3 = e5.protocol;
2494
- return Me.call(Fe, i3) && Fe[i3](e5, t4, true) || null;
2583
+ return Me.call(Fe2, i3) && Fe2[i3](e5, t4, true) || null;
2495
2584
  })(e4, { parentURL: i2.href });
2496
2585
  if ("module" !== r2) return;
2497
2586
  const n2 = (0, _e2.fileURLToPath)(e4.href), a2 = (0, _e2.fileURLToPath)(new _e2.URL(".", t3)), o2 = (0, _e2.fileURLToPath)(i2);
@@ -2789,14 +2878,14 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
2789
2878
  e4 = fileURLToPath(e4);
2790
2879
  }
2791
2880
  if (/(?:node|data|http|https):/.test(e4)) return e4;
2792
- if (Ie.has(e4)) return "node:" + e4;
2881
+ if (Ie2.has(e4)) return "node:" + e4;
2793
2882
  if (e4.startsWith("file://") && (e4 = fileURLToPath(e4)), isAbsolute(e4)) try {
2794
2883
  if ((0, ue2.statSync)(e4).isFile()) return pathToFileURL(e4);
2795
2884
  } catch (e5) {
2796
2885
  if ("ENOENT" !== e5?.code) throw e5;
2797
2886
  }
2798
2887
  const i2 = t3.conditions ? new Set(t3.conditions) : rt, s2 = (Array.isArray(t3.url) ? t3.url : [t3.url]).filter(Boolean).map((e5) => new URL((function(e6) {
2799
- return "string" != typeof e6 && (e6 = e6.toString()), /(?:node|data|http|https|file):/.test(e6) ? e6 : Ie.has(e6) ? "node:" + e6 : "file://" + encodeURI(normalizeSlash(e6));
2888
+ return "string" != typeof e6 && (e6 = e6.toString()), /(?:node|data|http|https|file):/.test(e6) ? e6 : Ie2.has(e6) ? "node:" + e6 : "file://" + encodeURI(normalizeSlash(e6));
2800
2889
  })(e5.toString())));
2801
2890
  0 === s2.length && s2.push(new URL(pathToFileURL(process.cwd())));
2802
2891
  const r2 = [...s2];
@@ -3109,21 +3198,21 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
3109
3198
  const d3 = createJiti2(r2, e4.opts, { parentModule: u2, parentCache: a2, nativeImport: e4.nativeImport, onError: e4.onError, createRequire: e4.createRequire }, true);
3110
3199
  let f3;
3111
3200
  u2.require = d3, u2.path = pathe_M_eThtNZ_dirname(r2), u2.paths = le2.Module._nodeModulePaths(u2.path), a2[r2] = u2, e4.opts.moduleCache && (e4.nativeRequire.cache[r2] = u2);
3112
- const m3 = (function(e5, t4) {
3201
+ const m2 = (function(e5, t4) {
3113
3202
  return `(${t4?.async ? "async " : ""}function (exports, require, module, __filename, __dirname, jitiImport, jitiESMResolve) { ${e5}
3114
3203
  });`;
3115
3204
  })(t3, { async: i2.async });
3116
3205
  try {
3117
- f3 = Kt().runInThisContext(m3, { filename: r2, lineOffset: 0, displayErrors: false });
3206
+ f3 = Kt().runInThisContext(m2, { filename: r2, lineOffset: 0, displayErrors: false });
3118
3207
  } catch (t4) {
3119
3208
  "SyntaxError" === t4.name && i2.async && e4.nativeImport ? (debug(e4, "[esm]", "[import]", "[fallback]", r2), f3 = (function(e5, t5) {
3120
3209
  const i3 = `data:text/javascript;base64,${Buffer.from(`export default ${e5}`).toString("base64")}`;
3121
3210
  return (...e6) => t5(i3).then((t6) => t6.default(...e6));
3122
- })(m3, e4.nativeImport)) : (e4.opts.moduleCache && delete e4.nativeRequire.cache[r2], e4.onError(t4));
3211
+ })(m2, e4.nativeImport)) : (e4.opts.moduleCache && delete e4.nativeRequire.cache[r2], e4.onError(t4));
3123
3212
  }
3124
- let g3;
3213
+ let g2;
3125
3214
  try {
3126
- g3 = f3(u2.exports, u2.require, u2, u2.filename, pathe_M_eThtNZ_dirname(u2.filename), d3.import, d3.esmResolve);
3215
+ g2 = f3(u2.exports, u2.require, u2, u2.filename, pathe_M_eThtNZ_dirname(u2.filename), d3.import, d3.esmResolve);
3127
3216
  } catch (t4) {
3128
3217
  e4.opts.moduleCache && delete e4.nativeRequire.cache[r2], e4.onError(t4);
3129
3218
  }
@@ -3136,7 +3225,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
3136
3225
  u2.loaded = true;
3137
3226
  return jitiInteropDefault(e4, u2.exports);
3138
3227
  }
3139
- return i2.async ? Promise.resolve(g3).then(next) : next();
3228
+ return i2.async ? Promise.resolve(g2).then(next) : next();
3140
3229
  }
3141
3230
  const Jt = "win32" === (0, e3.platform)();
3142
3231
  function createJiti2(e4, t3 = {}, i2, s2 = false) {
@@ -3190,193 +3279,193 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
3190
3279
  createRequire: require$$1.createRequire
3191
3280
  });
3192
3281
  }
3193
- const F$1 = ["charset", "import", "namespace"], L$1 = ["layer"], D = ({ name: e2 }) => `[data-theme="${e2}"]`, x$1 = ({
3282
+ const P$1 = ["charset", "import", "namespace"], U = ["layer"], k$2 = ({ name: e2 }) => `[data-theme="${e2}"]`, M$1 = ({
3194
3283
  name: e2,
3195
3284
  value: t,
3196
3285
  modifiers: r
3197
- }) => `._${[...r, e2, ...t === "default" ? [] : [t]].filter(Boolean).join("\\:").replace(/[[\].#()%,]/g, "\\$&")}`, w = ({ name: e2 }) => e2.replace(/^\.+|\.+$/g, "").replace(/\.+/g, "--");
3198
- function I$1(e2, t) {
3286
+ }) => `._${[...r, e2, ...t === "default" ? [] : [t]].filter(Boolean).join("\\:").replace(/[[\].#()%,]/g, "\\$&")}`, O = ({ name: e2 }) => e2.replace(/^\.+|\.+$/g, "").replace(/\.+/g, "--");
3287
+ function V$1(e2, t) {
3199
3288
  return `@${e2}${t ? " " : ""}${t}`;
3200
3289
  }
3201
- const U$1 = /\d/, P$1 = ["-", "_", "/", "."];
3202
- function M$1(e2 = "") {
3203
- if (!U$1.test(e2))
3290
+ const K$1 = /\d/, q = ["-", "_", "/", "."];
3291
+ function z$1(e2 = "") {
3292
+ if (!K$1.test(e2))
3204
3293
  return e2 !== e2.toLowerCase();
3205
3294
  }
3206
- function N(e2, t) {
3207
- const r = P$1, n = [];
3295
+ function _$1(e2, t) {
3296
+ const r = q, o = [];
3208
3297
  if (!e2 || typeof e2 != "string")
3209
- return n;
3210
- let o = "", s, u;
3298
+ return o;
3299
+ let n = "", s, u;
3211
3300
  for (const a of e2) {
3212
3301
  const c2 = r.includes(a);
3213
3302
  if (c2 === true) {
3214
- n.push(o), o = "", s = void 0;
3303
+ o.push(n), n = "", s = void 0;
3215
3304
  continue;
3216
3305
  }
3217
- const i = M$1(a);
3306
+ const i = z$1(a);
3218
3307
  if (u === false) {
3219
3308
  if (s === false && i === true) {
3220
- n.push(o), o = a, s = i;
3309
+ o.push(n), n = a, s = i;
3221
3310
  continue;
3222
3311
  }
3223
- if (s === true && i === false && o.length > 1) {
3224
- const f2 = o.at(-1);
3225
- n.push(o.slice(0, Math.max(0, o.length - 1))), o = f2 + a, s = i;
3312
+ if (s === true && i === false && n.length > 1) {
3313
+ const f2 = n.at(-1);
3314
+ o.push(n.slice(0, Math.max(0, n.length - 1))), n = f2 + a, s = i;
3226
3315
  continue;
3227
3316
  }
3228
3317
  }
3229
- o += a, s = i, u = c2;
3318
+ n += a, s = i, u = c2;
3230
3319
  }
3231
- return n.push(o), n;
3320
+ return o.push(n), o;
3232
3321
  }
3233
- function k$1$1(e2) {
3322
+ function H(e2) {
3234
3323
  return e2 ? e2[0].toUpperCase() + e2.slice(1) : "";
3235
3324
  }
3236
- function V(e2) {
3325
+ function Q$1(e2) {
3237
3326
  return e2 ? e2[0].toLowerCase() + e2.slice(1) : "";
3238
3327
  }
3239
- function K$1(e2, t) {
3240
- return e2 ? (Array.isArray(e2) ? e2 : N(e2)).map((r) => k$1$1(r)).join("") : "";
3328
+ function J$1(e2, t) {
3329
+ return e2 ? (Array.isArray(e2) ? e2 : _$1(e2)).map((r) => H(r)).join("") : "";
3241
3330
  }
3242
- function q$1(e2, t) {
3243
- return V(K$1(e2 || ""));
3331
+ function Z$1(e2, t) {
3332
+ return Q$1(J$1(e2 || ""));
3244
3333
  }
3245
- function z$1(e2, t) {
3246
- return e2 ? (Array.isArray(e2) ? e2 : N(e2)).map((r) => r.toLowerCase()).join("-") : "";
3334
+ function W(e2, t) {
3335
+ return e2 ? (Array.isArray(e2) ? e2 : _$1(e2)).map((r) => r.toLowerCase()).join("-") : "";
3247
3336
  }
3248
- function H(e2) {
3337
+ function G$1(e2) {
3249
3338
  return ` ${e2}`;
3250
3339
  }
3251
- function Q$1(e2) {
3340
+ function Y$1(e2) {
3252
3341
  return e2.split(`
3253
- `).map((t) => H(t)).join(`
3342
+ `).map((t) => G$1(t)).join(`
3254
3343
  `);
3255
3344
  }
3256
- function J$1(e2) {
3345
+ function x$1(e2) {
3257
3346
  return e2 === e2.toUpperCase();
3258
3347
  }
3259
- function Z$1(e2) {
3260
- return q$1(e2);
3348
+ function T$1(e2) {
3349
+ return Z$1(e2);
3261
3350
  }
3262
- function W$1(e2) {
3263
- return z$1(e2);
3351
+ function X$1(e2) {
3352
+ return W(e2);
3264
3353
  }
3265
- function G$1(e2) {
3266
- return W$1(e2);
3354
+ function ee$1(e2) {
3355
+ return X$1(e2);
3267
3356
  }
3268
- function O(e2, t) {
3269
- return `${e2.startsWith("--") ? e2 : G$1(e2)}: ${t};`;
3357
+ function B(e2, t) {
3358
+ return `${e2.startsWith("--") ? e2 : ee$1(e2)}: ${t};`;
3270
3359
  }
3271
- function Y$1(e2) {
3360
+ function te$1(e2) {
3272
3361
  return `{${e2.length > 0 ? `
3273
- ` : ""}${e2.map((t) => `${Q$1(`${t}`)}
3362
+ ` : ""}${e2.map((t) => `${Y$1(`${t}`)}
3274
3363
  `).join("")}}`;
3275
3364
  }
3276
- function B(e2) {
3365
+ function E$1(e2) {
3277
3366
  return `--${(e2.startsWith("--") ? e2.slice(2) : e2).replace(/[^a-zA-Z0-9_\-\u0080-\uFFFF]/g, "-") || "unknown-variable"}`;
3278
3367
  }
3279
- function X$1(e2, t) {
3280
- return O(B(e2), t);
3368
+ function re$1(e2, t) {
3369
+ return B(E$1(e2), t);
3281
3370
  }
3282
- function ee$1(e2, t) {
3283
- return `var(${B(e2)}${t ? `, ${t}` : ""})`;
3371
+ function ne$1(e2, t) {
3372
+ return `var(${E$1(e2)}${t ? `, ${t}` : ""})`;
3284
3373
  }
3285
- function R$1(e2, t) {
3286
- return `${e2} ${Y$1(t)}`;
3374
+ function w(e2, t) {
3375
+ return `${e2} ${te$1(t)}`;
3287
3376
  }
3288
- function te$1(e2) {
3289
- return function(r, n) {
3290
- return Object.entries(r).map(([o, s]) => O(o, e2(s, n)));
3377
+ function oe(e2) {
3378
+ return function(r, o) {
3379
+ return Object.entries(r).map(([n, s]) => B(n, e2(s, o)));
3291
3380
  };
3292
3381
  }
3293
- function E$1(e2) {
3294
- return function(r, n) {
3295
- const s = (n.variables?.name ?? w)({ name: r.name });
3296
- return X$1(s, e2(r.value, n));
3382
+ function F$1(e2) {
3383
+ return function(r, o) {
3384
+ const s = (o.variables?.name ?? O)({ name: r.name });
3385
+ return re$1(s, e2(r.value, o));
3297
3386
  };
3298
3387
  }
3299
3388
  function S$1(e2) {
3300
- const t = E$1(e2), r = te$1(e2);
3301
- return function(o, s, u) {
3302
- const { variables: a, declarations: c2, children: i } = s, f2 = o === ":root", l = (a ?? []).map(
3303
- (A2) => t(A2, u)
3304
- ), m2 = r(
3389
+ const t = F$1(e2), r = oe(e2);
3390
+ return function(n, s, u) {
3391
+ const { variables: a, declarations: c2, children: i } = s, f2 = n === ":root", l = (a ?? []).map(
3392
+ (g) => t(g, u)
3393
+ ), m = r(
3305
3394
  c2 ?? {},
3306
3395
  u
3307
3396
  ), y = (i ?? []).map(
3308
- (A2) => e2(A2, u)
3309
- ), p2 = l.length > 0, b = m2.length > 0, C22 = y.length > 0;
3310
- return f2 ? `${p2 || b ? R$1(o, [
3397
+ (g) => e2(g, u)
3398
+ ), p2 = l.length > 0, b = m.length > 0, j2 = y.length > 0;
3399
+ return f2 ? `${p2 || b ? w(n, [
3311
3400
  ...l,
3312
3401
  ...p2 && b ? [""] : [],
3313
- ...m2
3314
- ]) : ""}${C22 && (p2 || b) ? `
3402
+ ...m
3403
+ ]) : ""}${j2 && (p2 || b) ? `
3315
3404
 
3316
3405
  ` : ""}${y.join(`
3317
3406
 
3318
- `)}` : R$1(o, [
3407
+ `)}` : w(n, [
3319
3408
  ...l,
3320
- ...p2 && (C22 || b) ? [""] : [],
3321
- ...m2,
3322
- ...b && C22 ? [""] : [],
3409
+ ...p2 && (j2 || b) ? [""] : [],
3410
+ ...m,
3411
+ ...b && j2 ? [""] : [],
3323
3412
  ...y.flatMap(
3324
- (A2, _) => _ === y.length - 1 ? [A2] : [A2, ""]
3413
+ (g, I2) => I2 === y.length - 1 ? [g] : [g, ""]
3325
3414
  )
3326
3415
  ]);
3327
3416
  };
3328
3417
  }
3329
- function re$1(e2) {
3418
+ function ce(e2) {
3330
3419
  const t = S$1(e2);
3331
- return function(n, o) {
3332
- const s = F$1.includes(n.identifier), u = L$1.includes(
3333
- n.identifier
3334
- ), a = Object.keys(n.declarations).length > 0, c2 = n.variables.length > 0, i = n.children.length > 0, f2 = I$1(n.identifier, n.rule);
3335
- return s || u && !(a || c2 || i) ? `${f2};` : t(f2, n, o);
3420
+ return function(o, n) {
3421
+ const s = P$1.includes(o.identifier), u = U.includes(
3422
+ o.identifier
3423
+ ), a = Object.keys(o.declarations).length > 0, c2 = o.variables.length > 0, i = o.children.length > 0, f2 = V$1(o.identifier, o.rule);
3424
+ return s || u && !(a || c2 || i) ? `${f2};` : t(f2, o, n);
3336
3425
  };
3337
3426
  }
3338
- function ne$1(e2) {
3339
- return function(r, n) {
3340
- return r.value.map((o) => e2(o, n)).join("").trim();
3427
+ function ue$1(e2) {
3428
+ return function(r, o) {
3429
+ return r.value.map((n) => e2(n, o)).join("").trim();
3341
3430
  };
3342
3431
  }
3343
- function oe(e2) {
3432
+ function se$1(e2) {
3344
3433
  return typeof e2 == "object" && e2 !== null;
3345
3434
  }
3346
- function h(e2, t) {
3347
- return oe(e2) && "type" in e2 && e2.type === t;
3435
+ function h$1(e2, t) {
3436
+ return se$1(e2) && "type" in e2 && e2.type === t;
3348
3437
  }
3349
- function ce$1(e2) {
3350
- return h(e2, "variable");
3438
+ function ie$1(e2) {
3439
+ return h$1(e2, "variable");
3351
3440
  }
3352
- function ue$1(e2) {
3353
- return h(e2, "reference");
3441
+ function ae$1(e2) {
3442
+ return h$1(e2, "reference");
3354
3443
  }
3355
- function v$1(e2) {
3356
- return h(e2, "selector");
3444
+ function C$1(e2) {
3445
+ return h$1(e2, "selector");
3357
3446
  }
3358
- function ie(e2) {
3359
- return h(e2, "at-rule");
3447
+ function le$1(e2) {
3448
+ return h$1(e2, "at-rule");
3360
3449
  }
3361
- function se(e2) {
3362
- return h(e2, "utility");
3450
+ function fe(e2) {
3451
+ return h$1(e2, "utility");
3363
3452
  }
3364
- function ae$1(e2) {
3365
- return h(e2, "css");
3453
+ function me$1(e2) {
3454
+ return h$1(e2, "css");
3366
3455
  }
3367
- function le$1(e2) {
3368
- return h(e2, "theme");
3456
+ function pe$1(e2) {
3457
+ return h$1(e2, "theme");
3369
3458
  }
3370
- function T$1(e2) {
3371
- return h(e2, "root");
3459
+ function N(e2) {
3460
+ return h$1(e2, "root");
3372
3461
  }
3373
- function fe$1(e2) {
3374
- return h(e2, "recipe");
3462
+ function D$1(e2) {
3463
+ return h$1(e2, "recipe");
3375
3464
  }
3376
- function me$1(e2) {
3465
+ function L$1(e2) {
3377
3466
  return e2.charAt(0).toUpperCase() + e2.slice(1);
3378
3467
  }
3379
- function g(e2) {
3468
+ function A$1(e2) {
3380
3469
  if (e2 instanceof Buffer)
3381
3470
  return Buffer.from(e2);
3382
3471
  const t = e2.constructor;
@@ -3386,78 +3475,78 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
3386
3475
  e2.byteLength / e2.BYTES_PER_ELEMENT || 1
3387
3476
  );
3388
3477
  }
3389
- function pe$1(e2) {
3478
+ function ye$1(e2) {
3390
3479
  if (e2 = e2 || {}, e2.circular)
3391
- return ye$1(e2);
3480
+ return de$1(e2);
3392
3481
  const t = /* @__PURE__ */ new Map();
3393
3482
  if (t.set(Date, (u) => new Date(u)), t.set(
3394
3483
  Map,
3395
- (u, a) => new Map(n(Array.from(u), a))
3484
+ (u, a) => new Map(o(Array.from(u), a))
3396
3485
  ), t.set(
3397
3486
  Set,
3398
- (u, a) => new Set(n(Array.from(u), a))
3487
+ (u, a) => new Set(o(Array.from(u), a))
3399
3488
  ), e2.constructorHandlers)
3400
3489
  for (const u of e2.constructorHandlers)
3401
3490
  t.set(u[0], u[1]);
3402
3491
  let r;
3403
- return e2.proto ? s : o;
3404
- function n(u, a) {
3492
+ return e2.proto ? s : n;
3493
+ function o(u, a) {
3405
3494
  const c2 = Object.keys(u), i = Array.from({ length: c2.length });
3406
3495
  for (let f2 = 0; f2 < c2.length; f2++) {
3407
- const l = c2[f2], m2 = u[l];
3408
- typeof m2 != "object" || m2 === null ? i[l] = m2 : m2.constructor !== Object && (r = t.get(m2.constructor)) ? i[l] = r(m2, a) : ArrayBuffer.isView(m2) ? i[l] = g(m2) : i[l] = a(m2);
3496
+ const l = c2[f2], m = u[l];
3497
+ typeof m != "object" || m === null ? i[l] = m : m.constructor !== Object && (r = t.get(m.constructor)) ? i[l] = r(m, a) : ArrayBuffer.isView(m) ? i[l] = A$1(m) : i[l] = a(m);
3409
3498
  }
3410
3499
  return i;
3411
3500
  }
3412
- function o(u) {
3501
+ function n(u) {
3413
3502
  if (typeof u != "object" || u === null) return u;
3414
- if (Array.isArray(u)) return n(u, o);
3503
+ if (Array.isArray(u)) return o(u, n);
3415
3504
  if (u.constructor !== Object && (r = t.get(u.constructor)))
3416
- return r(u, o);
3505
+ return r(u, n);
3417
3506
  const a = {};
3418
3507
  for (const c2 in u) {
3419
3508
  if (Object.hasOwnProperty.call(u, c2) === false) continue;
3420
3509
  const i = u[c2];
3421
- typeof i != "object" || i === null ? a[c2] = i : i.constructor !== Object && (r = t.get(i.constructor)) ? a[c2] = r(i, o) : ArrayBuffer.isView(i) ? a[c2] = g(i) : a[c2] = o(i);
3510
+ typeof i != "object" || i === null ? a[c2] = i : i.constructor !== Object && (r = t.get(i.constructor)) ? a[c2] = r(i, n) : ArrayBuffer.isView(i) ? a[c2] = A$1(i) : a[c2] = n(i);
3422
3511
  }
3423
3512
  return a;
3424
3513
  }
3425
3514
  function s(u) {
3426
3515
  if (typeof u != "object" || u === null) return u;
3427
- if (Array.isArray(u)) return n(u, s);
3516
+ if (Array.isArray(u)) return o(u, s);
3428
3517
  if (u.constructor !== Object && (r = t.get(u.constructor)))
3429
3518
  return r(u, s);
3430
3519
  const a = {};
3431
3520
  for (const c2 in u) {
3432
3521
  const i = u[c2];
3433
- typeof i != "object" || i === null ? a[c2] = i : i.constructor !== Object && (r = t.get(i.constructor)) ? a[c2] = r(i, s) : ArrayBuffer.isView(i) ? a[c2] = g(i) : a[c2] = s(i);
3522
+ typeof i != "object" || i === null ? a[c2] = i : i.constructor !== Object && (r = t.get(i.constructor)) ? a[c2] = r(i, s) : ArrayBuffer.isView(i) ? a[c2] = A$1(i) : a[c2] = s(i);
3434
3523
  }
3435
3524
  return a;
3436
3525
  }
3437
3526
  }
3438
- function ye$1(e2) {
3439
- const t = [], r = [], n = /* @__PURE__ */ new Map();
3440
- if (n.set(Date, (c2) => new Date(c2)), n.set(
3527
+ function de$1(e2) {
3528
+ const t = [], r = [], o = /* @__PURE__ */ new Map();
3529
+ if (o.set(Date, (c2) => new Date(c2)), o.set(
3441
3530
  Map,
3442
3531
  (c2, i) => new Map(s(Array.from(c2), i))
3443
- ), n.set(
3532
+ ), o.set(
3444
3533
  Set,
3445
3534
  (c2, i) => new Set(s(Array.from(c2), i))
3446
3535
  ), e2.constructorHandlers)
3447
3536
  for (const c2 of e2.constructorHandlers)
3448
- n.set(c2[0], c2[1]);
3449
- let o;
3537
+ o.set(c2[0], c2[1]);
3538
+ let n;
3450
3539
  return e2.proto ? a : u;
3451
3540
  function s(c2, i) {
3452
3541
  const f2 = Object.keys(c2), l = Array.from({ length: f2.length });
3453
- for (let m2 = 0; m2 < f2.length; m2++) {
3454
- const y = f2[m2], p2 = c2[y];
3542
+ for (let m = 0; m < f2.length; m++) {
3543
+ const y = f2[m], p2 = c2[y];
3455
3544
  if (typeof p2 != "object" || p2 === null)
3456
3545
  l[y] = p2;
3457
- else if (p2.constructor !== Object && (o = n.get(p2.constructor)))
3458
- l[y] = o(p2, i);
3546
+ else if (p2.constructor !== Object && (n = o.get(p2.constructor)))
3547
+ l[y] = n(p2, i);
3459
3548
  else if (ArrayBuffer.isView(p2))
3460
- l[y] = g(p2);
3549
+ l[y] = A$1(p2);
3461
3550
  else {
3462
3551
  const b = t.indexOf(p2);
3463
3552
  b !== -1 ? l[y] = r[b] : l[y] = i(p2);
@@ -3468,8 +3557,8 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
3468
3557
  function u(c2) {
3469
3558
  if (typeof c2 != "object" || c2 === null) return c2;
3470
3559
  if (Array.isArray(c2)) return s(c2, u);
3471
- if (c2.constructor !== Object && (o = n.get(c2.constructor)))
3472
- return o(c2, u);
3560
+ if (c2.constructor !== Object && (n = o.get(c2.constructor)))
3561
+ return n(c2, u);
3473
3562
  const i = {};
3474
3563
  t.push(c2), r.push(i);
3475
3564
  for (const f2 in c2) {
@@ -3477,13 +3566,13 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
3477
3566
  const l = c2[f2];
3478
3567
  if (typeof l != "object" || l === null)
3479
3568
  i[f2] = l;
3480
- else if (l.constructor !== Object && (o = n.get(l.constructor)))
3481
- i[f2] = o(l, u);
3569
+ else if (l.constructor !== Object && (n = o.get(l.constructor)))
3570
+ i[f2] = n(l, u);
3482
3571
  else if (ArrayBuffer.isView(l))
3483
- i[f2] = g(l);
3572
+ i[f2] = A$1(l);
3484
3573
  else {
3485
- const m2 = t.indexOf(l);
3486
- m2 !== -1 ? i[f2] = r[m2] : i[f2] = u(l);
3574
+ const m = t.indexOf(l);
3575
+ m !== -1 ? i[f2] = r[m] : i[f2] = u(l);
3487
3576
  }
3488
3577
  }
3489
3578
  return t.pop(), r.pop(), i;
@@ -3491,47 +3580,47 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
3491
3580
  function a(c2) {
3492
3581
  if (typeof c2 != "object" || c2 === null) return c2;
3493
3582
  if (Array.isArray(c2)) return s(c2, a);
3494
- if (c2.constructor !== Object && (o = n.get(c2.constructor)))
3495
- return o(c2, a);
3583
+ if (c2.constructor !== Object && (n = o.get(c2.constructor)))
3584
+ return n(c2, a);
3496
3585
  const i = {};
3497
3586
  t.push(c2), r.push(i);
3498
3587
  for (const f2 in c2) {
3499
3588
  const l = c2[f2];
3500
3589
  if (typeof l != "object" || l === null)
3501
3590
  i[f2] = l;
3502
- else if (l.constructor !== Object && (o = n.get(l.constructor)))
3503
- i[f2] = o(l, a);
3591
+ else if (l.constructor !== Object && (n = o.get(l.constructor)))
3592
+ i[f2] = n(l, a);
3504
3593
  else if (ArrayBuffer.isView(l))
3505
- i[f2] = g(l);
3594
+ i[f2] = A$1(l);
3506
3595
  else {
3507
- const m2 = t.indexOf(l);
3508
- m2 !== -1 ? i[f2] = r[m2] : i[f2] = a(l);
3596
+ const m = t.indexOf(l);
3597
+ m !== -1 ? i[f2] = r[m] : i[f2] = a(l);
3509
3598
  }
3510
3599
  }
3511
3600
  return t.pop(), r.pop(), i;
3512
3601
  }
3513
3602
  }
3514
- pe$1();
3515
- function de$1(e2) {
3516
- return function(r, n) {
3603
+ ye$1();
3604
+ function he$1(e2) {
3605
+ return function(r, o) {
3517
3606
  return r != null ? `${r}` : "";
3518
3607
  };
3519
3608
  }
3520
- function he(e2) {
3521
- return function(r, n) {
3522
- const s = (n.variables?.name ?? w)({ name: r.name });
3523
- return ee$1(
3609
+ function be$1(e2) {
3610
+ return function(r, o) {
3611
+ const s = (o.variables?.name ?? O)({ name: r.name });
3612
+ return ne$1(
3524
3613
  s,
3525
- r.fallback ? e2(r.fallback, n) : void 0
3614
+ r.fallback ? e2(r.fallback, o) : void 0
3526
3615
  );
3527
3616
  };
3528
3617
  }
3529
- function be(e2) {
3618
+ function ge$1(e2) {
3530
3619
  const t = S$1(e2);
3531
- return function(n, o) {
3532
- return n.themes.reduce(
3533
- (s, u) => (s.push(e2(u, o)), s),
3534
- [t(":root", n, o)]
3620
+ return function(o, n) {
3621
+ return o.themes.reduce(
3622
+ (s, u) => (s.push(e2(u, n)), s),
3623
+ [t(":root", o, n)]
3535
3624
  // Default theme (root)
3536
3625
  ).join(`
3537
3626
 
@@ -3540,108 +3629,108 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
3540
3629
  }
3541
3630
  function Ae$1(e2) {
3542
3631
  const t = S$1(e2);
3543
- return function(n, o) {
3544
- return t(n.query, n, o);
3632
+ return function(o, n) {
3633
+ return t(o.query, o, n);
3545
3634
  };
3546
3635
  }
3547
- function ge$1(e2) {
3636
+ function Se(e2) {
3548
3637
  const t = S$1(e2);
3549
- return function(n, o) {
3550
- const u = (o.themes?.selector ?? D)({ name: n.name });
3551
- return t(u, n, o);
3638
+ return function(o, n) {
3639
+ const u = (n.themes?.selector ?? k$2)({ name: o.name });
3640
+ return t(u, o, n);
3552
3641
  };
3553
3642
  }
3554
- function Se(e2) {
3643
+ function Ce(e2) {
3555
3644
  const t = S$1(e2);
3556
- return function(n, o) {
3557
- const s = [], a = (o.utilities?.selector ?? x$1)({
3558
- name: n.name,
3559
- value: n.value,
3560
- modifiers: n.modifiers
3645
+ return function(o, n) {
3646
+ const s = [], a = (n.utilities?.selector ?? M$1)({
3647
+ name: o.name,
3648
+ value: o.value,
3649
+ modifiers: o.modifiers
3561
3650
  });
3562
- return s.push(t(a, n, o)), s.join(`
3651
+ return s.push(t(a, o, n)), s.join(`
3563
3652
 
3564
3653
  `);
3565
3654
  };
3566
3655
  }
3567
3656
  function d(e2, t) {
3568
- const r = be(d), n = Ae$1(d), o = Se(d), s = re$1(d), u = ge$1(d), a = E$1(d), c2 = he(d), i = ne$1(d), f2 = de$1();
3657
+ const r = ge$1(d), o = Ae$1(d), n = Ce(d), s = ce(d), u = Se(d), a = F$1(d), c2 = be$1(d), i = ue$1(d), f2 = he$1();
3569
3658
  switch (true) {
3570
- case v$1(e2):
3571
- return n(e2, t);
3572
- case se(e2):
3659
+ case C$1(e2):
3573
3660
  return o(e2, t);
3574
- case ie(e2):
3661
+ case fe(e2):
3662
+ return n(e2, t);
3663
+ case le$1(e2):
3575
3664
  return s(e2, t);
3576
- case T$1(e2):
3665
+ case N(e2):
3577
3666
  return r(e2, t);
3578
- case le$1(e2):
3667
+ case pe$1(e2):
3579
3668
  return u(e2, t);
3580
- case ce$1(e2):
3669
+ case ie$1(e2):
3581
3670
  return a(e2, t);
3582
- case ue$1(e2):
3583
- return c2(e2, t);
3584
3671
  case ae$1(e2):
3672
+ return c2(e2, t);
3673
+ case me$1(e2):
3585
3674
  return i(e2, t);
3586
3675
  default:
3587
3676
  return f2(e2, t);
3588
3677
  }
3589
3678
  }
3590
- function Ce(e2) {
3591
- return function(r, n) {
3592
- let o = r._exportName;
3593
- o || (o = Z$1(r.name), r.name[0] && J$1(r.name[0]) && (o = me$1(o)));
3594
- const s = `${o}Recipe`, u = r._runtime ?? {};
3679
+ function je(e2) {
3680
+ return function(r, o) {
3681
+ let n = r._exportName;
3682
+ n || (n = T$1(r.name), r.name[0] && x$1(r.name[0]) && (n = L$1(n)));
3683
+ const s = `${n}Recipe`, u = r._runtime ?? {};
3595
3684
  return `const ${s} = ${JSON.stringify(
3596
3685
  u,
3597
3686
  null,
3598
3687
  4
3599
3688
  )} as const satisfies RecipeRuntime;
3600
3689
 
3601
- export const ${o} = createRecipe("${r.name}", ${s});
3690
+ export const ${n} = createRecipe("${r.name}", ${s});
3602
3691
  `;
3603
3692
  };
3604
3693
  }
3605
- function je(e2) {
3694
+ function ve(e2) {
3606
3695
  return e2.filter(
3607
- (t) => v$1(t) && !!t._exportName
3696
+ (t) => C$1(t) && !!t._exportName
3608
3697
  );
3609
3698
  }
3610
- function ve(e2) {
3611
- return function(r, n) {
3612
- const o = je(r.children), s = r.recipes.length > 0, u = o.length > 0;
3699
+ function Re(e2) {
3700
+ return function(r, o) {
3701
+ const n = ve(r.children), s = r.recipes.length > 0, u = n.length > 0;
3613
3702
  if (!s && !u)
3614
3703
  return "";
3615
3704
  const a = [];
3616
3705
  return s && (a.push(`import { createRecipe } from '@styleframe/runtime';
3617
3706
  import type { RecipeRuntime } from '@styleframe/runtime';
3618
- `), a.push(e2(r.recipes, n))), u && a.push(e2(o, n)), a.join(`
3707
+ `), a.push(e2(r.recipes, o))), u && a.push(e2(n, o)), a.join(`
3619
3708
  `);
3620
3709
  };
3621
3710
  }
3622
- function Re$1(e2) {
3623
- return function(r, n) {
3711
+ function $e(e2) {
3712
+ return function(r, o) {
3624
3713
  return r._exportName ? `export const ${r._exportName} = ${JSON.stringify(r.query)};
3625
3714
  ` : "";
3626
3715
  };
3627
3716
  }
3628
- function j$1(e2, t) {
3629
- const r = ve(j$1), n = Ce(), o = Re$1();
3717
+ function R$1(e2, t) {
3718
+ const r = Re(R$1), o = je(), n = $e();
3630
3719
  switch (true) {
3631
3720
  case Array.isArray(e2):
3632
- return e2.map((s) => j$1(s, t)).join(`
3721
+ return e2.map((s) => R$1(s, t)).join(`
3633
3722
  `);
3634
- case T$1(e2):
3723
+ case N(e2):
3635
3724
  return r(e2, t);
3636
- case fe$1(e2):
3637
- return n(e2, t);
3638
- case v$1(e2):
3725
+ case D$1(e2):
3639
3726
  return o(e2, t);
3727
+ case C$1(e2):
3728
+ return n(e2, t);
3640
3729
  default:
3641
3730
  return "";
3642
3731
  }
3643
3732
  }
3644
- const $e = `-----BEGIN PUBLIC KEY-----
3733
+ const Ne = `-----BEGIN PUBLIC KEY-----
3645
3734
  MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs7zAFssgxOMPeo80iig4
3646
3735
  qSSshgNOLnW1gd4tPUrsezndaUrAKlsAys6XD8kuF+bBEIR0uFNSgKlqINLjWM1n
3647
3736
  BiTUzCctodyRaq6/tyFSoPLD35iblkwtfxKPM42lAJZsyTu9qoBr8MJyXmhDLuqA
@@ -3649,9 +3738,9 @@ dQ8di7mQHz+mCy96jQR4lFSDfHMgl27qaAh5VboTBRxgZliN8D5Fl590QkS94wAj
3649
3738
  hC7NbH+hPcGc/qIaZSjZfyZeBIZS74qJkrzjEA7/pukROD8UQUrQ512HHZ6XlgMn
3650
3739
  4bWT2K9CpWbbhsKFTecCHuxlmPkFJNMuvAb/LdP08BSnpntlyAJcQeBrna2qBen+
3651
3740
  GwIDAQAB
3652
- -----END PUBLIC KEY-----`, we = "__licenseRequired", Ne = "__licenseValidated";
3653
- async function Oe(e2) {
3654
- const t = e2.replace(/-----BEGIN PUBLIC KEY-----/, "").replace(/-----END PUBLIC KEY-----/, "").replace(/\s/g, ""), r = Uint8Array.from(atob(t), (n) => n.charCodeAt(0));
3741
+ -----END PUBLIC KEY-----`, we = "__licenseRequired", Oe = "__licenseValidated";
3742
+ async function _e(e2) {
3743
+ const t = e2.replace(/-----BEGIN PUBLIC KEY-----/, "").replace(/-----END PUBLIC KEY-----/, "").replace(/\s/g, ""), r = Uint8Array.from(atob(t), (o) => o.charCodeAt(0));
3655
3744
  return await crypto.subtle.importKey(
3656
3745
  "spki",
3657
3746
  r,
@@ -3663,18 +3752,18 @@ GwIDAQAB
3663
3752
  ["verify"]
3664
3753
  );
3665
3754
  }
3666
- async function Be({
3755
+ async function xe({
3667
3756
  payload: e2,
3668
3757
  signature: t
3669
3758
  }) {
3670
- const r = new TextEncoder().encode(e2), n = Uint8Array.from(
3759
+ const r = new TextEncoder().encode(e2), o = Uint8Array.from(
3671
3760
  atob(t),
3672
3761
  (s) => s.charCodeAt(0)
3673
- ), o = await Oe($e);
3762
+ ), n = await _e(Ne);
3674
3763
  if (!await crypto.subtle.verify(
3675
3764
  { name: "RSASSA-PKCS1-v1_5" },
3676
- o,
3677
3765
  n,
3766
+ o,
3678
3767
  r
3679
3768
  ))
3680
3769
  throw new Error(
@@ -3682,13 +3771,13 @@ GwIDAQAB
3682
3771
  );
3683
3772
  return JSON.parse(e2);
3684
3773
  }
3685
- function Ee(e2) {
3774
+ function Te(e2) {
3686
3775
  return Object.prototype.hasOwnProperty.call(e2, we);
3687
3776
  }
3688
- async function Te(e2) {
3777
+ async function Be(e2) {
3689
3778
  const t = Object.getOwnPropertyDescriptor(
3690
3779
  e2,
3691
- Ne
3780
+ Oe
3692
3781
  );
3693
3782
  if (!t?.value)
3694
3783
  return {
@@ -3706,7 +3795,7 @@ GwIDAQAB
3706
3795
  valid: false
3707
3796
  };
3708
3797
  try {
3709
- return await Be(
3798
+ return await xe(
3710
3799
  r
3711
3800
  );
3712
3801
  } catch {
@@ -3718,7 +3807,81 @@ GwIDAQAB
3718
3807
  };
3719
3808
  }
3720
3809
  }
3721
- function _e(e2) {
3810
+ function Ee(e2) {
3811
+ const t = e2?.variants;
3812
+ if (!t || Object.keys(t).length === 0)
3813
+ return "Record<string, never>";
3814
+ const r = [];
3815
+ for (const [o, n] of Object.entries(t)) {
3816
+ if (!n) continue;
3817
+ const s = Object.keys(n);
3818
+ if (s.length > 0) {
3819
+ const u = s.map((a) => `"${a}"`).join(" | ");
3820
+ r.push(`${o}?: ${u}`);
3821
+ }
3822
+ }
3823
+ return r.length === 0 ? "Record<string, never>" : `{ ${r.join("; ")} }`;
3824
+ }
3825
+ function Fe$1(e2) {
3826
+ return function(r, o) {
3827
+ let n = r._exportName;
3828
+ n || (n = T$1(r.name), r.name[0] && x$1(r.name[0]) && (n = L$1(n)));
3829
+ const s = Ee(r._runtime);
3830
+ return ` export const ${n}: (props?: ${s}) => string;`;
3831
+ };
3832
+ }
3833
+ function De(e2) {
3834
+ return e2.filter(
3835
+ (t) => C$1(t) && !!t._exportName
3836
+ );
3837
+ }
3838
+ function Le(e2) {
3839
+ return function(r, o) {
3840
+ const n = De(r.children), s = r.recipes.length > 0, u = n.length > 0, a = [
3841
+ "// Auto-generated by @styleframe/plugin - DO NOT EDIT",
3842
+ "",
3843
+ 'declare module "virtual:styleframe" {',
3844
+ ' import type { Styleframe } from "@styleframe/core";',
3845
+ "",
3846
+ " /** Returns the global styleframe instance from styleframe.config.ts */",
3847
+ " export function styleframe(): Styleframe;"
3848
+ ];
3849
+ if (s) {
3850
+ a.push("");
3851
+ const c2 = r.recipes.map((i) => e2(i, o)).filter(Boolean);
3852
+ a.push(...c2);
3853
+ }
3854
+ if (u) {
3855
+ a.push("");
3856
+ const c2 = n.map((i) => e2(i, o)).filter(Boolean);
3857
+ a.push(...c2);
3858
+ }
3859
+ return a.push("}"), a.push(""), a.push('declare module "virtual:styleframe.css" {'), a.push(" const css: string;"), a.push(" export default css;"), a.push("}"), a.push(""), a.join(`
3860
+ `);
3861
+ };
3862
+ }
3863
+ function Ie(e2) {
3864
+ return function(r, o) {
3865
+ return r._exportName ? ` export const ${r._exportName}: string;` : "";
3866
+ };
3867
+ }
3868
+ function $(e2, t) {
3869
+ const r = Le($), o = Fe$1(), n = Ie();
3870
+ switch (true) {
3871
+ case Array.isArray(e2):
3872
+ return e2.map((s) => $(s, t)).join(`
3873
+ `);
3874
+ case N(e2):
3875
+ return r(e2, t);
3876
+ case D$1(e2):
3877
+ return o(e2, t);
3878
+ case C$1(e2):
3879
+ return n(e2, t);
3880
+ default:
3881
+ return "";
3882
+ }
3883
+ }
3884
+ function Pe(e2) {
3722
3885
  const t = Math.floor(Math.random() * 100);
3723
3886
  e2.root.children.push({
3724
3887
  type: "selector",
@@ -3742,36 +3905,43 @@ GwIDAQAB
3742
3905
  }
3743
3906
  });
3744
3907
  }
3745
- function $(e2, t = "") {
3908
+ function v$1(e2, t = "") {
3746
3909
  return {
3747
3910
  name: e2,
3748
3911
  content: t
3749
3912
  };
3750
3913
  }
3751
- async function Le(e2, {
3914
+ async function ke$1(e2, {
3752
3915
  type: t = "all",
3753
- consumers: r = { css: d, ts: j$1 }
3916
+ consumers: r = { css: d, ts: R$1, dts: $ }
3754
3917
  } = {}) {
3755
- const n = { files: [] }, o = e2.options;
3756
- if (Ee(e2)) {
3757
- const s = await Te(e2);
3758
- (!s.valid || s.instanceId !== e2.id) && _e(e2);
3918
+ const o = { files: [] }, n = e2.options;
3919
+ if (Te(e2)) {
3920
+ const s = await Be(e2);
3921
+ (!s.valid || s.instanceId !== e2.id) && Pe(e2);
3759
3922
  }
3760
3923
  if (t === "all" || t === "css") {
3761
- const s = $(
3924
+ const s = v$1(
3762
3925
  "index.css",
3763
- r.css(e2.root, o)
3926
+ r.css(e2.root, n)
3764
3927
  );
3765
- n.files.push(s);
3928
+ o.files.push(s);
3766
3929
  }
3767
3930
  if (t === "all" || t === "ts") {
3768
- const s = $(
3931
+ const s = v$1(
3769
3932
  "index.ts",
3770
- r.ts(e2.root, o)
3933
+ r.ts(e2.root, n)
3771
3934
  );
3772
- n.files.push(s);
3935
+ o.files.push(s);
3773
3936
  }
3774
- return n;
3937
+ if (t === "dts") {
3938
+ const s = v$1(
3939
+ "index.d.ts",
3940
+ r.dts(e2.root, n)
3941
+ );
3942
+ o.files.push(s);
3943
+ }
3944
+ return o;
3775
3945
  }
3776
3946
  async function directoryExists(path2) {
3777
3947
  try {
@@ -3787,7 +3957,7 @@ GwIDAQAB
3787
3957
  environment: process.env.NODE_ENV || "development",
3788
3958
  isBuild: true
3789
3959
  });
3790
- const output = await Le(instance, transpiler);
3960
+ const output = await ke$1(instance, transpiler);
3791
3961
  const outputDirExists = await directoryExists(outputDir);
3792
3962
  if (clean && outputDirExists) {
3793
3963
  await promises.rm(outputDir, { recursive: true });
@@ -3802,90 +3972,109 @@ GwIDAQAB
3802
3972
  await promises.writeFile(filePath, file.content);
3803
3973
  }
3804
3974
  }
3805
- function K(e2) {
3975
+ function C(e2) {
3806
3976
  return typeof e2 == "object" && e2 !== null;
3807
3977
  }
3808
- function m(e2, r) {
3809
- return K(e2) && "type" in e2 && e2.type === r;
3978
+ function h(e2, r) {
3979
+ return C(e2) && "type" in e2 && e2.type === r;
3810
3980
  }
3811
- function L(e2) {
3812
- return m(e2, "variable");
3981
+ function G(e2) {
3982
+ return h(e2, "variable");
3813
3983
  }
3814
- function A(e2) {
3815
- return m(e2, "reference");
3984
+ function j(e2) {
3985
+ return h(e2, "reference");
3816
3986
  }
3817
- function ge(e2) {
3818
- return m(e2, "selector");
3987
+ function Ae(e2) {
3988
+ return h(e2, "selector");
3819
3989
  }
3820
- function q(e2) {
3821
- return m(e2, "modifier");
3990
+ function I(e2) {
3991
+ return h(e2, "modifier");
3822
3992
  }
3823
- function E(e2) {
3824
- return m(e2, "css");
3993
+ function T(e2) {
3994
+ return h(e2, "css");
3825
3995
  }
3826
- function Ae(e2) {
3827
- return m(e2, "recipe");
3996
+ function V(e2) {
3997
+ return h(e2, "root");
3828
3998
  }
3829
- function G(e2) {
3999
+ function ke(e2) {
4000
+ return h(e2, "recipe");
4001
+ }
4002
+ function z(e2) {
3830
4003
  return typeof e2 == "string" || typeof e2 == "number" || typeof e2 == "boolean" || e2 === null;
3831
4004
  }
3832
- function U(e2) {
3833
- return G(e2) || A(e2) || E(e2) || Array.isArray(e2) && e2.every(U);
4005
+ function D(e2) {
4006
+ return z(e2) || j(e2) || T(e2) || Array.isArray(e2) && e2.every(D);
3834
4007
  }
3835
- function I(e2) {
3836
- return K(e2) && "children" in e2 && "declarations" in e2 && "variables" in e2;
3837
- }
3838
- function z(e2 = (r) => r) {
3839
- return (r) => {
3840
- let n = r, t;
3841
- if (typeof n == "string" && n[0] === "@") {
3842
- const i = n.slice(1);
3843
- t = e2(i), n = {
4008
+ function Y(e2) {
4009
+ return C(e2) && "children" in e2 && "declarations" in e2 && "variables" in e2;
4010
+ }
4011
+ function Ve(e2) {
4012
+ return C(e2) && "id" in e2 && "root" in e2 && "variable" in e2 && "selector" in e2 && "recipe" in e2 && typeof e2.id == "string" && V(e2.root);
4013
+ }
4014
+ function P(e2) {
4015
+ const r = typeof e2 == "function" ? { replacer: e2 } : e2 ?? {}, { replacer: n = (c2) => c2, namespace: t } = r, i = Array.isArray(t) ? t : t ? [t] : [];
4016
+ return (c2) => {
4017
+ let s = c2, a;
4018
+ if (typeof s == "string" && s[0] === "@") {
4019
+ const o = s.slice(1), f2 = i.find(
4020
+ (y) => o === y || o.startsWith(`${y}.`)
4021
+ );
4022
+ let l, u;
4023
+ f2 ? (l = o, u = o.startsWith(`${f2}.`) ? o.slice(f2.length + 1) : o) : i.length > 0 ? (l = `${i[0]}.${o}`, u = o) : (l = o, u = o), a = n(u), s = {
3844
4024
  type: "reference",
3845
- name: i
4025
+ name: l
3846
4026
  };
3847
- } else A(n) ? t = e2(n.name) : t = `[${r}]`;
4027
+ } else if (j(s)) {
4028
+ let o = s.name;
4029
+ for (const f2 of i)
4030
+ if (o.startsWith(`${f2}.`)) {
4031
+ o = o.slice(f2.length + 1);
4032
+ break;
4033
+ }
4034
+ a = n(o);
4035
+ } else
4036
+ a = `[${c2}]`;
3848
4037
  return {
3849
- [t]: n
4038
+ [a]: s
3850
4039
  };
3851
4040
  };
3852
4041
  }
3853
- function W(e2, r) {
4042
+ function Z(e2, r) {
3854
4043
  return function(t, ...i) {
3855
4044
  return {
3856
4045
  type: "css",
3857
- value: t.reduce((o, u, s) => (o.push(u), s < i.length && o.push(i[s]), o), [])
4046
+ value: t.reduce((s, a, o) => (s.push(a), o < i.length && s.push(i[o]), s), [])
3858
4047
  };
3859
4048
  };
3860
4049
  }
3861
- function S(e2, r) {
4050
+ function K(e2, r) {
3862
4051
  return function(t, i, c2) {
3863
- const o = {
4052
+ const s = {
3864
4053
  type: "at-rule",
3865
4054
  identifier: t,
3866
4055
  rule: i,
3867
4056
  declarations: {},
3868
4057
  variables: [],
3869
4058
  children: []
3870
- }, u = v(o, r);
3871
- return typeof c2 == "function" ? o.declarations = c2(u) ?? {} : c2 && (o.declarations = c2), k$2(o.declarations, u), e2.children.push(o), o;
4059
+ }, a = v(s, r);
4060
+ return typeof c2 == "function" ? s.declarations = c2(a) ?? {} : c2 && (s.declarations = c2), R(s.declarations, a), e2.children.push(s), s;
3872
4061
  };
3873
4062
  }
3874
- function Y(e2, r) {
3875
- const n = S(e2, r);
4063
+ function J(e2, r) {
4064
+ const n = K(e2, r);
3876
4065
  return function(i, c2) {
3877
4066
  return n("media", i, c2);
3878
4067
  };
3879
4068
  }
3880
- function Z(e2, r) {
3881
- const n = S(e2, r);
4069
+ function Q(e2, r) {
4070
+ const n = K(e2, r);
3882
4071
  return function(i, c2) {
3883
4072
  return n("keyframes", i, c2);
3884
4073
  };
3885
4074
  }
3886
- function J(e2, r) {
4075
+ function X(e2, r) {
3887
4076
  return function(t, i) {
3888
- return L(t) ? {
4077
+ return G(t) ? {
3889
4078
  type: "reference",
3890
4079
  name: t.name,
3891
4080
  fallback: i
@@ -3896,7 +4085,7 @@ GwIDAQAB
3896
4085
  };
3897
4086
  };
3898
4087
  }
3899
- function Q(e2, r) {
4088
+ function ee(e2, r) {
3900
4089
  return function(t, i) {
3901
4090
  const c2 = {
3902
4091
  type: "selector",
@@ -3904,56 +4093,60 @@ GwIDAQAB
3904
4093
  declarations: {},
3905
4094
  variables: [],
3906
4095
  children: []
3907
- }, o = v(c2, r);
3908
- return typeof i == "function" ? c2.declarations = i(o) ?? {} : I(i) ? (c2.variables = i.variables, c2.declarations = i.declarations, c2.children = i.children) : c2.declarations = i, k$2(c2.declarations, o), e2.children.push(c2), c2;
4096
+ }, s = v(c2, r);
4097
+ return typeof i == "function" ? c2.declarations = i(s) ?? {} : Y(i) ? (c2.variables = i.variables, c2.declarations = i.declarations, c2.children = i.children) : c2.declarations = i, R(c2.declarations, s), e2.children.push(c2), c2;
3909
4098
  };
3910
4099
  }
3911
- function X(e2, r) {
4100
+ function te(e2, r) {
3912
4101
  return function(t, i, c2 = {
3913
4102
  default: false
3914
4103
  }) {
3915
- const o = typeof t == "string" ? t : t.name, u = e2.variables.find(
3916
- (f2) => f2.name === o
4104
+ const s = typeof t == "string" ? t : t.name, a = e2.variables.find(
4105
+ (f2) => f2.name === s
3917
4106
  );
3918
- if (c2.default && u)
3919
- return u;
3920
- if (u)
3921
- return u.value = i, u;
3922
- const s = {
4107
+ if (c2.default && a)
4108
+ return a;
4109
+ if (a)
4110
+ return a.value = i, a;
4111
+ const o = {
3923
4112
  type: "variable",
3924
- name: o,
4113
+ name: s,
3925
4114
  value: i
3926
4115
  };
3927
- return e2.variables.push(s), s;
4116
+ return e2.variables.push(o), o;
3928
4117
  };
3929
4118
  }
3930
4119
  function v(e2, r) {
3931
- const n = X(e2), t = Q(e2, r), i = S(e2, r), c2 = Z(r, r), o = Y(e2, r), u = J(), s = W();
4120
+ const n = te(e2), t = ee(e2, r), i = K(e2, r), c2 = Q(r, r), s = J(e2, r), a = X(), o = Z();
3932
4121
  return {
3933
4122
  variable: n,
3934
4123
  selector: t,
3935
4124
  keyframes: c2,
3936
4125
  atRule: i,
3937
- media: o,
3938
- ref: u,
3939
- css: s
4126
+ media: s,
4127
+ ref: a,
4128
+ css: o
3940
4129
  };
3941
4130
  }
3942
- function k$2(e2, r) {
4131
+ function R(e2, r) {
3943
4132
  for (const n in e2)
3944
4133
  if (n.startsWith("@")) {
3945
4134
  const t = e2[n];
3946
- if (typeof t == "object" && t !== null && !U(t)) {
4135
+ if (typeof t == "object" && t !== null && !D(t)) {
3947
4136
  const i = n.replace(/^@(\w+).*/, "$1"), c2 = n.replace(`@${i}`, "").trim();
3948
4137
  r.atRule(i, c2, t), delete e2[n];
3949
4138
  }
3950
- } else if (/^[.&:]/.test(n)) {
4139
+ } else if (/^[.&:]/.test(n) || /^\d+%$/.test(n) || n === "from" || n === "to") {
3951
4140
  const t = e2[n];
3952
4141
  typeof t == "object" && (r.selector(n, t), delete e2[n]);
3953
4142
  }
4143
+ for (const n in e2) {
4144
+ const t = e2[n];
4145
+ typeof t == "string" && t[0] === "@" && (e2[n] = r.ref(t.slice(1)));
4146
+ }
3954
4147
  return e2;
3955
4148
  }
3956
- function j(e2) {
4149
+ function A(e2) {
3957
4150
  if (e2 instanceof Buffer)
3958
4151
  return Buffer.from(e2);
3959
4152
  const r = e2.constructor;
@@ -3963,133 +4156,133 @@ GwIDAQAB
3963
4156
  e2.byteLength / e2.BYTES_PER_ELEMENT || 1
3964
4157
  );
3965
4158
  }
3966
- function ee(e2) {
4159
+ function ne(e2) {
3967
4160
  if (e2 = e2 || {}, e2.circular)
3968
- return te(e2);
4161
+ return re(e2);
3969
4162
  const r = /* @__PURE__ */ new Map();
3970
- if (r.set(Date, (o) => new Date(o)), r.set(
4163
+ if (r.set(Date, (s) => new Date(s)), r.set(
3971
4164
  Map,
3972
- (o, u) => new Map(t(Array.from(o), u))
4165
+ (s, a) => new Map(t(Array.from(s), a))
3973
4166
  ), r.set(
3974
4167
  Set,
3975
- (o, u) => new Set(t(Array.from(o), u))
4168
+ (s, a) => new Set(t(Array.from(s), a))
3976
4169
  ), e2.constructorHandlers)
3977
- for (const o of e2.constructorHandlers)
3978
- r.set(o[0], o[1]);
4170
+ for (const s of e2.constructorHandlers)
4171
+ r.set(s[0], s[1]);
3979
4172
  let n;
3980
4173
  return e2.proto ? c2 : i;
3981
- function t(o, u) {
3982
- const s = Object.keys(o), f2 = Array.from({ length: s.length });
3983
- for (let l = 0; l < s.length; l++) {
3984
- const a = s[l], y = o[a];
3985
- typeof y != "object" || y === null ? f2[a] = y : y.constructor !== Object && (n = r.get(y.constructor)) ? f2[a] = n(y, u) : ArrayBuffer.isView(y) ? f2[a] = j(y) : f2[a] = u(y);
4174
+ function t(s, a) {
4175
+ const o = Object.keys(s), f2 = Array.from({ length: o.length });
4176
+ for (let l = 0; l < o.length; l++) {
4177
+ const u = o[l], y = s[u];
4178
+ typeof y != "object" || y === null ? f2[u] = y : y.constructor !== Object && (n = r.get(y.constructor)) ? f2[u] = n(y, a) : ArrayBuffer.isView(y) ? f2[u] = A(y) : f2[u] = a(y);
3986
4179
  }
3987
4180
  return f2;
3988
4181
  }
3989
- function i(o) {
3990
- if (typeof o != "object" || o === null) return o;
3991
- if (Array.isArray(o)) return t(o, i);
3992
- if (o.constructor !== Object && (n = r.get(o.constructor)))
3993
- return n(o, i);
3994
- const u = {};
3995
- for (const s in o) {
3996
- if (Object.hasOwnProperty.call(o, s) === false) continue;
3997
- const f2 = o[s];
3998
- typeof f2 != "object" || f2 === null ? u[s] = f2 : f2.constructor !== Object && (n = r.get(f2.constructor)) ? u[s] = n(f2, i) : ArrayBuffer.isView(f2) ? u[s] = j(f2) : u[s] = i(f2);
4182
+ function i(s) {
4183
+ if (typeof s != "object" || s === null) return s;
4184
+ if (Array.isArray(s)) return t(s, i);
4185
+ if (s.constructor !== Object && (n = r.get(s.constructor)))
4186
+ return n(s, i);
4187
+ const a = {};
4188
+ for (const o in s) {
4189
+ if (Object.hasOwnProperty.call(s, o) === false) continue;
4190
+ const f2 = s[o];
4191
+ typeof f2 != "object" || f2 === null ? a[o] = f2 : f2.constructor !== Object && (n = r.get(f2.constructor)) ? a[o] = n(f2, i) : ArrayBuffer.isView(f2) ? a[o] = A(f2) : a[o] = i(f2);
3999
4192
  }
4000
- return u;
4193
+ return a;
4001
4194
  }
4002
- function c2(o) {
4003
- if (typeof o != "object" || o === null) return o;
4004
- if (Array.isArray(o)) return t(o, c2);
4005
- if (o.constructor !== Object && (n = r.get(o.constructor)))
4006
- return n(o, c2);
4007
- const u = {};
4008
- for (const s in o) {
4009
- const f2 = o[s];
4010
- typeof f2 != "object" || f2 === null ? u[s] = f2 : f2.constructor !== Object && (n = r.get(f2.constructor)) ? u[s] = n(f2, c2) : ArrayBuffer.isView(f2) ? u[s] = j(f2) : u[s] = c2(f2);
4195
+ function c2(s) {
4196
+ if (typeof s != "object" || s === null) return s;
4197
+ if (Array.isArray(s)) return t(s, c2);
4198
+ if (s.constructor !== Object && (n = r.get(s.constructor)))
4199
+ return n(s, c2);
4200
+ const a = {};
4201
+ for (const o in s) {
4202
+ const f2 = s[o];
4203
+ typeof f2 != "object" || f2 === null ? a[o] = f2 : f2.constructor !== Object && (n = r.get(f2.constructor)) ? a[o] = n(f2, c2) : ArrayBuffer.isView(f2) ? a[o] = A(f2) : a[o] = c2(f2);
4011
4204
  }
4012
- return u;
4205
+ return a;
4013
4206
  }
4014
4207
  }
4015
- function te(e2) {
4208
+ function re(e2) {
4016
4209
  const r = [], n = [], t = /* @__PURE__ */ new Map();
4017
- if (t.set(Date, (s) => new Date(s)), t.set(
4210
+ if (t.set(Date, (o) => new Date(o)), t.set(
4018
4211
  Map,
4019
- (s, f2) => new Map(c2(Array.from(s), f2))
4212
+ (o, f2) => new Map(c2(Array.from(o), f2))
4020
4213
  ), t.set(
4021
4214
  Set,
4022
- (s, f2) => new Set(c2(Array.from(s), f2))
4215
+ (o, f2) => new Set(c2(Array.from(o), f2))
4023
4216
  ), e2.constructorHandlers)
4024
- for (const s of e2.constructorHandlers)
4025
- t.set(s[0], s[1]);
4217
+ for (const o of e2.constructorHandlers)
4218
+ t.set(o[0], o[1]);
4026
4219
  let i;
4027
- return e2.proto ? u : o;
4028
- function c2(s, f2) {
4029
- const l = Object.keys(s), a = Array.from({ length: l.length });
4220
+ return e2.proto ? a : s;
4221
+ function c2(o, f2) {
4222
+ const l = Object.keys(o), u = Array.from({ length: l.length });
4030
4223
  for (let y = 0; y < l.length; y++) {
4031
- const p2 = l[y], d2 = s[p2];
4224
+ const p2 = l[y], d2 = o[p2];
4032
4225
  if (typeof d2 != "object" || d2 === null)
4033
- a[p2] = d2;
4226
+ u[p2] = d2;
4034
4227
  else if (d2.constructor !== Object && (i = t.get(d2.constructor)))
4035
- a[p2] = i(d2, f2);
4228
+ u[p2] = i(d2, f2);
4036
4229
  else if (ArrayBuffer.isView(d2))
4037
- a[p2] = j(d2);
4230
+ u[p2] = A(d2);
4038
4231
  else {
4039
- const h2 = r.indexOf(d2);
4040
- h2 !== -1 ? a[p2] = n[h2] : a[p2] = f2(d2);
4232
+ const w2 = r.indexOf(d2);
4233
+ w2 !== -1 ? u[p2] = n[w2] : u[p2] = f2(d2);
4041
4234
  }
4042
4235
  }
4043
- return a;
4236
+ return u;
4044
4237
  }
4045
- function o(s) {
4046
- if (typeof s != "object" || s === null) return s;
4047
- if (Array.isArray(s)) return c2(s, o);
4048
- if (s.constructor !== Object && (i = t.get(s.constructor)))
4049
- return i(s, o);
4238
+ function s(o) {
4239
+ if (typeof o != "object" || o === null) return o;
4240
+ if (Array.isArray(o)) return c2(o, s);
4241
+ if (o.constructor !== Object && (i = t.get(o.constructor)))
4242
+ return i(o, s);
4050
4243
  const f2 = {};
4051
- r.push(s), n.push(f2);
4052
- for (const l in s) {
4053
- if (Object.hasOwnProperty.call(s, l) === false) continue;
4054
- const a = s[l];
4055
- if (typeof a != "object" || a === null)
4056
- f2[l] = a;
4057
- else if (a.constructor !== Object && (i = t.get(a.constructor)))
4058
- f2[l] = i(a, o);
4059
- else if (ArrayBuffer.isView(a))
4060
- f2[l] = j(a);
4244
+ r.push(o), n.push(f2);
4245
+ for (const l in o) {
4246
+ if (Object.hasOwnProperty.call(o, l) === false) continue;
4247
+ const u = o[l];
4248
+ if (typeof u != "object" || u === null)
4249
+ f2[l] = u;
4250
+ else if (u.constructor !== Object && (i = t.get(u.constructor)))
4251
+ f2[l] = i(u, s);
4252
+ else if (ArrayBuffer.isView(u))
4253
+ f2[l] = A(u);
4061
4254
  else {
4062
- const y = r.indexOf(a);
4063
- y !== -1 ? f2[l] = n[y] : f2[l] = o(a);
4255
+ const y = r.indexOf(u);
4256
+ y !== -1 ? f2[l] = n[y] : f2[l] = s(u);
4064
4257
  }
4065
4258
  }
4066
4259
  return r.pop(), n.pop(), f2;
4067
4260
  }
4068
- function u(s) {
4069
- if (typeof s != "object" || s === null) return s;
4070
- if (Array.isArray(s)) return c2(s, u);
4071
- if (s.constructor !== Object && (i = t.get(s.constructor)))
4072
- return i(s, u);
4261
+ function a(o) {
4262
+ if (typeof o != "object" || o === null) return o;
4263
+ if (Array.isArray(o)) return c2(o, a);
4264
+ if (o.constructor !== Object && (i = t.get(o.constructor)))
4265
+ return i(o, a);
4073
4266
  const f2 = {};
4074
- r.push(s), n.push(f2);
4075
- for (const l in s) {
4076
- const a = s[l];
4077
- if (typeof a != "object" || a === null)
4078
- f2[l] = a;
4079
- else if (a.constructor !== Object && (i = t.get(a.constructor)))
4080
- f2[l] = i(a, u);
4081
- else if (ArrayBuffer.isView(a))
4082
- f2[l] = j(a);
4267
+ r.push(o), n.push(f2);
4268
+ for (const l in o) {
4269
+ const u = o[l];
4270
+ if (typeof u != "object" || u === null)
4271
+ f2[l] = u;
4272
+ else if (u.constructor !== Object && (i = t.get(u.constructor)))
4273
+ f2[l] = i(u, a);
4274
+ else if (ArrayBuffer.isView(u))
4275
+ f2[l] = A(u);
4083
4276
  else {
4084
- const y = r.indexOf(a);
4085
- y !== -1 ? f2[l] = n[y] : f2[l] = u(a);
4277
+ const y = r.indexOf(u);
4278
+ y !== -1 ? f2[l] = n[y] : f2[l] = a(u);
4086
4279
  }
4087
4280
  }
4088
4281
  return r.pop(), n.pop(), f2;
4089
4282
  }
4090
4283
  }
4091
- const R = ee();
4092
- function ne(e2, r = 8) {
4284
+ const F = ne();
4285
+ function ie(e2, r = 8) {
4093
4286
  const n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
4094
4287
  let t = "";
4095
4288
  for (let i = 0; i < r; i++) {
@@ -4098,7 +4291,7 @@ GwIDAQAB
4098
4291
  }
4099
4292
  return e2 ? `${e2}${t}` : t;
4100
4293
  }
4101
- function re(e2, r) {
4294
+ function se(e2, r) {
4102
4295
  const n = e2.modifiers.find(
4103
4296
  (t) => t.key.includes(r)
4104
4297
  );
@@ -4106,23 +4299,23 @@ GwIDAQAB
4106
4299
  throw new Error(`Modifier "${r}" not found`);
4107
4300
  return n;
4108
4301
  }
4109
- function ce(e2) {
4302
+ function ae(e2) {
4110
4303
  const r = [];
4111
4304
  function n(t, i) {
4112
4305
  i.length > 0 && r.push([...i].sort());
4113
4306
  for (let c2 = t; c2 < e2.length; c2++) {
4114
- const o = e2[c2];
4115
- if (o)
4116
- if (o.length === 1 && o[0])
4117
- n(c2 + 1, [...i, o[0]]);
4307
+ const s = e2[c2];
4308
+ if (s)
4309
+ if (s.length === 1 && s[0])
4310
+ n(c2 + 1, [...i, s[0]]);
4118
4311
  else
4119
- for (const u of o)
4120
- n(c2 + 1, [...i, u]);
4312
+ for (const a of s)
4313
+ n(c2 + 1, [...i, a]);
4121
4314
  }
4122
4315
  }
4123
4316
  return n(0, []), r.sort((t, i) => t.length !== i.length ? t.length - i.length : t.join(",").localeCompare(i.join(",")));
4124
4317
  }
4125
- function fe(e2, r, n) {
4318
+ function ue(e2, r, n) {
4126
4319
  const t = {
4127
4320
  ...e2,
4128
4321
  modifiers: [...n.keys()]
@@ -4130,13 +4323,13 @@ GwIDAQAB
4130
4323
  for (const c2 of n.values())
4131
4324
  c2.factory({
4132
4325
  ...i,
4133
- declarations: R(t.declarations),
4134
- variables: R(t.variables),
4135
- children: R(t.children)
4136
- }), k$2(t.declarations, i);
4326
+ declarations: F(t.declarations),
4327
+ variables: F(t.variables),
4328
+ children: F(t.children)
4329
+ }), R(t.declarations, i);
4137
4330
  return t;
4138
4331
  }
4139
- function ue(e2, r) {
4332
+ function le(e2, r) {
4140
4333
  return function(t, i) {
4141
4334
  const c2 = {
4142
4335
  type: "modifier",
@@ -4146,7 +4339,7 @@ GwIDAQAB
4146
4339
  return r.modifiers.push(c2), c2;
4147
4340
  };
4148
4341
  }
4149
- function ae() {
4342
+ function ye() {
4150
4343
  return {
4151
4344
  type: "root",
4152
4345
  declarations: {},
@@ -4158,30 +4351,84 @@ GwIDAQAB
4158
4351
  themes: []
4159
4352
  };
4160
4353
  }
4161
- function le(e2, r) {
4354
+ function de(e2, r) {
4355
+ const n = P({ namespace: e2 });
4356
+ return (t) => {
4357
+ if (typeof t == "string" && t[0] === "@") {
4358
+ const i = t.slice(1), c2 = e2.find(
4359
+ (s) => i === s || i.startsWith(`${s}.`)
4360
+ );
4361
+ if (c2) {
4362
+ const s = i.slice(c2.length + 1) || i;
4363
+ if (r.variables.some((a) => a.name === i))
4364
+ return {
4365
+ [s]: {
4366
+ type: "reference",
4367
+ name: i
4368
+ }
4369
+ };
4370
+ } else
4371
+ for (const s of e2) {
4372
+ const a = `${s}.${i}`;
4373
+ if (r.variables.some((o) => o.name === a))
4374
+ return {
4375
+ [i]: {
4376
+ type: "reference",
4377
+ name: a
4378
+ }
4379
+ };
4380
+ }
4381
+ return n(t);
4382
+ }
4383
+ return n(t);
4384
+ };
4385
+ }
4386
+ function me(e2, r) {
4162
4387
  return function(t, i, c2 = {}) {
4163
- const o = {
4388
+ const s = {
4164
4389
  type: "utility",
4165
4390
  name: t,
4166
4391
  factory: i,
4167
4392
  values: [],
4168
- autogenerate: c2.autogenerate ?? z(),
4169
- create: (u, s = []) => {
4170
- let f2 = u;
4171
- if (Array.isArray(u)) {
4393
+ autogenerate: c2.autogenerate ?? (Array.isArray(c2.namespace) ? de(c2.namespace, r) : P(
4394
+ c2.namespace ? { namespace: c2.namespace } : void 0
4395
+ )),
4396
+ namespace: c2.namespace,
4397
+ create: (a, o = []) => {
4398
+ let f2 = a;
4399
+ if (Array.isArray(a)) {
4172
4400
  f2 = {};
4173
- for (const l of u) {
4174
- const a = o.autogenerate(l);
4401
+ for (const l of a) {
4402
+ const u = s.autogenerate(l);
4175
4403
  f2 = {
4176
4404
  ...f2,
4177
- ...a
4405
+ ...u
4178
4406
  };
4179
4407
  }
4180
4408
  }
4181
- for (const [l, a] of Object.entries(f2)) {
4182
- const y = o.values.find(
4183
- (h2) => h2.key === l && h2.modifiers.length === 0
4184
- ), p2 = {
4409
+ for (const [l, u] of Object.entries(f2)) {
4410
+ let y = u;
4411
+ if (s.namespace && j(u))
4412
+ if (r.variables.some((g) => g.name === u.name))
4413
+ y = u;
4414
+ else {
4415
+ const g = Array.isArray(s.namespace) ? s.namespace : [s.namespace];
4416
+ let $2 = false;
4417
+ for (const O2 of g) {
4418
+ const m = `${O2}.${l}`;
4419
+ if (m !== u.name && r.variables.some((b) => b.name === m)) {
4420
+ y = {
4421
+ type: "reference",
4422
+ name: m
4423
+ }, $2 = true;
4424
+ break;
4425
+ }
4426
+ }
4427
+ $2 || (y = l);
4428
+ }
4429
+ const p2 = s.values.find(
4430
+ (g) => g.key === l && g.modifiers.length === 0
4431
+ ), d2 = {
4185
4432
  type: "utility",
4186
4433
  name: t,
4187
4434
  value: l,
@@ -4189,200 +4436,246 @@ GwIDAQAB
4189
4436
  variables: [],
4190
4437
  children: [],
4191
4438
  modifiers: []
4192
- }, d2 = v(
4193
- p2,
4439
+ }, w2 = v(
4440
+ d2,
4194
4441
  r
4195
4442
  );
4196
- if (p2.declarations = i({
4197
- ...d2,
4198
- value: a
4199
- }) ?? {}, k$2(p2.declarations, d2), y || (o.values.push({
4443
+ if (d2.declarations = i({
4444
+ ...w2,
4445
+ value: y
4446
+ }) ?? {}, R(d2.declarations, w2), p2 || (s.values.push({
4200
4447
  key: l,
4201
- value: a,
4448
+ value: y,
4202
4449
  modifiers: []
4203
- }), e2.children.push(p2)), s && s.length > 0) {
4204
- const h2 = s.map((g2) => g2.key), H2 = ce(h2).filter((g2) => !o.values.find(
4205
- (b) => b.key === l && b.modifiers.length === g2.length && b.modifiers.every((w2) => g2.includes(w2))
4206
- )).reduce((g2, b) => {
4207
- const w2 = /* @__PURE__ */ new Map();
4208
- for (const $2 of b) {
4209
- const V2 = s.find(
4210
- (N2) => N2.key.includes($2)
4450
+ }), e2.children.push(d2)), o && o.length > 0) {
4451
+ const g = o.map((m) => m.key), O2 = ae(g).filter((m) => !s.values.find(
4452
+ (b) => b.key === l && b.modifiers.length === m.length && b.modifiers.every((k2) => m.includes(k2))
4453
+ )).reduce((m, b) => {
4454
+ const k2 = /* @__PURE__ */ new Map();
4455
+ for (const U2 of b) {
4456
+ const M22 = o.find(
4457
+ (q2) => q2.key.includes(U2)
4211
4458
  );
4212
- V2 && q(V2) && w2.set($2, V2);
4459
+ M22 && I(M22) && k2.set(U2, M22);
4213
4460
  }
4214
- return o.values.push({
4461
+ return s.values.push({
4215
4462
  key: l,
4216
- value: a,
4463
+ value: y,
4217
4464
  modifiers: b
4218
- }), g2.push(fe(p2, r, w2)), g2;
4465
+ }), m.push(ue(d2, r, k2)), m;
4219
4466
  }, []);
4220
- e2.children.push(...H2);
4467
+ e2.children.push(...O2);
4221
4468
  }
4222
4469
  }
4223
4470
  }
4224
4471
  };
4225
- return r.utilities.push(o), o.create;
4472
+ return r.utilities.push(s), s.create;
4226
4473
  };
4227
4474
  }
4228
- function ye(e2, r) {
4475
+ function pe(e2, r) {
4229
4476
  return function(t, i) {
4230
- const c2 = r.themes.find((s) => s.name === t), o = c2 ?? {
4477
+ const c2 = r.themes.find((o) => o.name === t), s = c2 ?? {
4231
4478
  type: "theme",
4232
4479
  name: t,
4233
4480
  declarations: {},
4234
4481
  variables: [],
4235
4482
  children: []
4236
4483
  };
4237
- c2 || r.themes.push(o);
4238
- const u = v(o, r);
4239
- return i && i(u), o;
4484
+ c2 || r.themes.push(s);
4485
+ const a = v(s, r);
4486
+ return i && i(a), s;
4240
4487
  };
4241
4488
  }
4242
- function de(e2, r) {
4489
+ function he(e2, r) {
4243
4490
  return function(t) {
4244
4491
  const i = {
4245
4492
  type: "recipe",
4246
4493
  ...t
4247
4494
  };
4248
- return i._runtime = pe(i, r), me(i, r), r.recipes.push(i), i;
4495
+ return i._runtime = ge(i, r), be(i, r), r.recipes.push(i), i;
4249
4496
  };
4250
4497
  }
4251
- function C(e2, r) {
4498
+ function _(e2, r) {
4252
4499
  const n = e2.autogenerate(r);
4253
4500
  return Object.keys(n)[0] ?? "default";
4254
4501
  }
4255
- function F(e2, r) {
4502
+ function x(e2, r) {
4256
4503
  const n = {};
4257
4504
  for (const [t, i] of Object.entries(e2))
4258
- if (P(i)) {
4505
+ if (L(i)) {
4259
4506
  const c2 = {};
4260
- for (const [o, u] of Object.entries(i)) {
4261
- const s = T(r, o);
4262
- s ? c2[o] = C(
4263
- s,
4264
- u
4507
+ for (const [s, a] of Object.entries(i)) {
4508
+ const o = S(r, s);
4509
+ o ? c2[s] = _(
4510
+ o,
4511
+ a
4265
4512
  ) : console.warn(
4266
- `[styleframe] Utility "${o}" not found in registry. Skipping runtime generation for this declaration.`
4513
+ `[styleframe] Utility "${s}" not found in registry. Skipping runtime generation for this declaration.`
4267
4514
  );
4268
4515
  }
4269
4516
  n[t] = c2;
4270
4517
  } else if (typeof i == "boolean")
4271
4518
  n[t] = i;
4272
4519
  else {
4273
- const c2 = T(r, t);
4274
- c2 ? n[t] = C(c2, i) : console.warn(
4520
+ const c2 = S(r, t);
4521
+ c2 ? n[t] = _(c2, i) : console.warn(
4275
4522
  `[styleframe] Utility "${t}" not found in registry. Skipping runtime generation for this declaration.`
4276
4523
  );
4277
4524
  }
4278
4525
  return n;
4279
4526
  }
4280
- function pe(e2, r) {
4527
+ function ge(e2, r) {
4281
4528
  const n = {};
4282
- if (e2.base && (n.base = F(e2.base, r)), e2.variants) {
4529
+ if (e2.base && (n.base = x(e2.base, r)), e2.variants) {
4283
4530
  const t = {};
4284
4531
  for (const [i, c2] of Object.entries(e2.variants)) {
4285
- const o = {};
4286
- for (const [u, s] of Object.entries(
4532
+ const s = {};
4533
+ for (const [a, o] of Object.entries(
4287
4534
  c2
4288
4535
  ))
4289
- s == null ? o[u] = null : o[u] = F(
4290
- s,
4536
+ o == null ? s[a] = null : s[a] = x(
4537
+ o,
4291
4538
  r
4292
4539
  );
4293
- t[i] = o;
4540
+ t[i] = s;
4294
4541
  }
4295
4542
  n.variants = t;
4296
4543
  }
4297
4544
  return e2.defaultVariants && (n.defaultVariants = { ...e2.defaultVariants }), e2.compoundVariants && (n.compoundVariants = e2.compoundVariants.map((t) => ({
4298
4545
  match: { ...t.match },
4299
- css: F(t.css, r)
4546
+ css: x(t.css, r)
4300
4547
  }))), n;
4301
4548
  }
4302
- function P(e2) {
4303
- return !A(e2) && typeof e2 == "object" && e2 !== null;
4549
+ function L(e2) {
4550
+ return !j(e2) && typeof e2 == "object" && e2 !== null;
4304
4551
  }
4305
- function x(e2, r) {
4552
+ function E(e2, r) {
4306
4553
  const n = (t, i, c2) => {
4307
- let o = r.get(t);
4308
- o || (o = [], r.set(t, o)), o.push({ value: i, modifiers: c2 });
4554
+ let s = r.get(t);
4555
+ s || (s = [], r.set(t, s)), s.push({ value: i, modifiers: c2 });
4309
4556
  };
4310
4557
  for (const [t, i] of Object.entries(e2))
4311
- if (P(i)) {
4558
+ if (L(i)) {
4312
4559
  const c2 = t.split(":");
4313
- for (const [o, u] of Object.entries(i))
4314
- n(o, u, c2);
4560
+ for (const [s, a] of Object.entries(i))
4561
+ n(s, a, c2);
4315
4562
  } else
4316
4563
  n(t, i, []);
4317
4564
  }
4318
- function T(e2, r) {
4565
+ function S(e2, r) {
4319
4566
  const n = e2.utilities.find((i) => i.name === r);
4320
4567
  if (n)
4321
4568
  return n;
4322
4569
  const t = r.replace(/[A-Z]/g, (i) => `-${i.toLowerCase()}`);
4323
4570
  return e2.utilities.find((i) => i.name === t);
4324
4571
  }
4325
- function me(e2, r) {
4572
+ function be(e2, r) {
4326
4573
  const n = /* @__PURE__ */ new Map();
4327
- if (e2.base && x(e2.base, n), e2.variants)
4574
+ if (e2.base && E(e2.base, n), e2.variants)
4328
4575
  for (const i of Object.values(e2.variants))
4329
4576
  for (const c2 of Object.values(i))
4330
- x(
4577
+ E(
4331
4578
  c2,
4332
4579
  n
4333
4580
  );
4334
4581
  if (e2.compoundVariants)
4335
4582
  for (const i of e2.compoundVariants)
4336
- i.css && x(i.css, n);
4583
+ i.css && E(i.css, n);
4337
4584
  const t = /* @__PURE__ */ new Map();
4338
4585
  for (const [i, c2] of n) {
4339
- const o = T(r, i);
4340
- if (!o) {
4586
+ const s = S(r, i);
4587
+ if (!s) {
4341
4588
  console.warn(
4342
4589
  `[styleframe] Utility "${i}" not found in registry. Skipping.`
4343
4590
  );
4344
4591
  continue;
4345
4592
  }
4346
- for (const u of c2) {
4347
- const s = [];
4348
- for (const f2 of u.modifiers) {
4593
+ for (const a of c2) {
4594
+ const o = [];
4595
+ for (const f2 of a.modifiers) {
4349
4596
  if (!t.has(f2))
4350
4597
  try {
4351
- t.set(f2, re(r, f2));
4598
+ t.set(f2, se(r, f2));
4352
4599
  } catch {
4353
4600
  console.warn(
4354
4601
  `[styleframe] Modifier "${f2}" not found in registry. Skipping modifier for utility "${i}".`
4355
4602
  ), t.set(f2, null);
4356
4603
  }
4357
4604
  const l = t.get(f2);
4358
- l && s.push(l);
4605
+ l && o.push(l);
4359
4606
  }
4360
- o.create(
4361
- [u.value],
4362
- s.length > 0 ? s : void 0
4607
+ s.create(
4608
+ [a.value],
4609
+ o.length > 0 ? o : void 0
4363
4610
  );
4364
4611
  }
4365
4612
  }
4366
4613
  }
4367
- function Re(e2) {
4368
- const r = ne("sf-"), n = ae(), t = { ...e2 }, i = le(n, n), c2 = ue(n, n), o = de(n, n), u = ye(n, n), { variable: s, selector: f2, atRule: l, keyframes: a, media: y, ref: p2, css: d2 } = v(n, n);
4614
+ function Fe(e2) {
4615
+ const r = ie("sf-"), n = ye(), t = { ...e2 }, i = me(n, n), c2 = le(n, n), s = he(n, n), a = pe(n, n), { variable: o, selector: f2, atRule: l, keyframes: u, media: y, ref: p2, css: d2 } = v(n, n);
4369
4616
  return {
4370
4617
  id: r,
4371
4618
  root: n,
4372
- variable: s,
4619
+ variable: o,
4373
4620
  selector: f2,
4374
4621
  utility: i,
4375
4622
  modifier: c2,
4376
- recipe: o,
4377
- theme: u,
4623
+ recipe: s,
4624
+ theme: a,
4378
4625
  atRule: l,
4379
- keyframes: a,
4626
+ keyframes: u,
4380
4627
  media: y,
4381
4628
  ref: p2,
4382
4629
  css: d2,
4383
4630
  options: t
4384
4631
  };
4385
4632
  }
4633
+ function createLoader(basePath, alias) {
4634
+ return createJiti(basePath, {
4635
+ fsCache: false,
4636
+ moduleCache: false,
4637
+ alias
4638
+ });
4639
+ }
4640
+ function trackExports(module2) {
4641
+ const exports2 = /* @__PURE__ */ new Map();
4642
+ for (const [name, value] of Object.entries(module2)) {
4643
+ if (name === "default") continue;
4644
+ let type = null;
4645
+ if (ke(value)) {
4646
+ type = "recipe";
4647
+ value._exportName = name;
4648
+ } else if (Ae(value)) {
4649
+ type = "selector";
4650
+ value._exportName = name;
4651
+ }
4652
+ if (type) {
4653
+ exports2.set(name, { name, type });
4654
+ }
4655
+ }
4656
+ return exports2;
4657
+ }
4658
+ async function loadModule(filePath, options = {}) {
4659
+ const { alias, validateInstance = true } = options;
4660
+ const jiti2 = createLoader(path.dirname(filePath), alias);
4661
+ const module2 = await jiti2.import(filePath);
4662
+ if (!module2.default) {
4663
+ throw new Error(
4664
+ `Missing default export in ${filePath}. Expected a Styleframe instance.`
4665
+ );
4666
+ }
4667
+ if (validateInstance && !Ve(module2.default)) {
4668
+ throw new Error(
4669
+ `Invalid default export in ${filePath}. Expected a Styleframe instance created with styleframe().`
4670
+ );
4671
+ }
4672
+ const exports2 = trackExports(module2);
4673
+ return {
4674
+ module: module2,
4675
+ instance: module2.default,
4676
+ exports: exports2
4677
+ };
4678
+ }
4386
4679
  const SUPPORTED_EXTENSIONS = [".ts", ".mts", ".cts", ".js", ".mjs", ".cjs"];
4387
4680
  function hasKnownExtension(filePath) {
4388
4681
  return SUPPORTED_EXTENSIONS.some((ext) => filePath.endsWith(ext));
@@ -4400,36 +4693,16 @@ GwIDAQAB
4400
4693
  }
4401
4694
  return void 0;
4402
4695
  }
4403
- function trackNamedExports(module2) {
4404
- for (const [exportName, exportValue] of Object.entries(module2)) {
4405
- if (exportName === "default") continue;
4406
- if (Ae(exportValue)) {
4407
- exportValue._exportName = exportName;
4408
- } else if (ge(exportValue)) {
4409
- exportValue._exportName = exportName;
4410
- }
4411
- }
4412
- }
4413
4696
  async function loadConfiguration({
4414
4697
  cwd = process.cwd(),
4415
4698
  entry = "styleframe.config"
4416
4699
  } = {}) {
4417
4700
  const resolvedPath = resolveConfigFile(cwd, entry);
4418
4701
  if (!resolvedPath) {
4419
- return Re();
4420
- }
4421
- const jiti2 = createJiti(path.dirname(resolvedPath), {
4422
- fsCache: false,
4423
- moduleCache: false
4424
- });
4425
- const module2 = await jiti2.import(resolvedPath);
4426
- if (!module2.default) {
4427
- throw new Error(
4428
- `Missing default export in ${resolvedPath}. Expected a Styleframe instance.`
4429
- );
4702
+ return Fe();
4430
4703
  }
4431
- trackNamedExports(module2);
4432
- return module2.default;
4704
+ const { instance } = await loadModule(resolvedPath);
4705
+ return instance;
4433
4706
  }
4434
4707
  const build = citty.defineCommand({
4435
4708
  meta: {
@@ -4483,8 +4756,8 @@ GwIDAQAB
4483
4756
  description: "Sync Styleframe variables with Figma"
4484
4757
  },
4485
4758
  subCommands: {
4486
- export: () => Promise.resolve().then(() => _export$1).then((m2) => m2.default),
4487
- import: () => Promise.resolve().then(() => _import$1).then((m2) => m2.default)
4759
+ export: () => Promise.resolve().then(() => _export$1).then((m) => m.default),
4760
+ import: () => Promise.resolve().then(() => _import$1).then((m) => m.default)
4488
4761
  }
4489
4762
  });
4490
4763
  const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
@@ -5100,15 +5373,15 @@ GwIDAQAB
5100
5373
  return void 0;
5101
5374
  }
5102
5375
  const res = { mode: "rgb" };
5103
- const [, r, g2, b, alpha] = parsed;
5104
- if (r.type === Tok.Hue || g2.type === Tok.Hue || b.type === Tok.Hue) {
5376
+ const [, r, g, b, alpha] = parsed;
5377
+ if (r.type === Tok.Hue || g.type === Tok.Hue || b.type === Tok.Hue) {
5105
5378
  return void 0;
5106
5379
  }
5107
5380
  if (r.type !== Tok.None) {
5108
5381
  res.r = r.type === Tok.Number ? r.value / 255 : r.value / 100;
5109
5382
  }
5110
- if (g2.type !== Tok.None) {
5111
- res.g = g2.type === Tok.Number ? g2.value / 255 : g2.value / 100;
5383
+ if (g.type !== Tok.None) {
5384
+ res.g = g.type === Tok.Number ? g.value / 255 : g.value / 100;
5112
5385
  }
5113
5386
  if (b.type !== Tok.None) {
5114
5387
  res.b = b.type === Tok.Number ? b.value / 255 : b.value / 100;
@@ -5187,13 +5460,13 @@ GwIDAQAB
5187
5460
  const linearize$2 = (v2 = 0) => Math.pow(Math.abs(v2), 563 / 256) * Math.sign(v2);
5188
5461
  const convertA98ToXyz65 = (a98) => {
5189
5462
  let r = linearize$2(a98.r);
5190
- let g2 = linearize$2(a98.g);
5463
+ let g = linearize$2(a98.g);
5191
5464
  let b = linearize$2(a98.b);
5192
5465
  let res = {
5193
5466
  mode: "xyz65",
5194
- x: 0.5766690429101305 * r + 0.1855582379065463 * g2 + 0.1882286462349947 * b,
5195
- y: 0.297344975250536 * r + 0.6273635662554661 * g2 + 0.0752914584939979 * b,
5196
- z: 0.0270313613864123 * r + 0.0706888525358272 * g2 + 0.9913375368376386 * b
5467
+ x: 0.5766690429101305 * r + 0.1855582379065463 * g + 0.1882286462349947 * b,
5468
+ y: 0.297344975250536 * r + 0.6273635662554661 * g + 0.0752914584939979 * b,
5469
+ z: 0.0270313613864123 * r + 0.0706888525358272 * g + 0.9913375368376386 * b
5197
5470
  };
5198
5471
  if (a98.alpha !== void 0) {
5199
5472
  res.alpha = a98.alpha;
@@ -5229,23 +5502,23 @@ GwIDAQAB
5229
5502
  }
5230
5503
  return (Math.sign(c2) || 1) * Math.pow((abs2 + 0.055) / 1.055, 2.4);
5231
5504
  };
5232
- const convertRgbToLrgb = ({ r, g: g2, b, alpha }) => {
5505
+ const convertRgbToLrgb = ({ r, g, b, alpha }) => {
5233
5506
  let res = {
5234
5507
  mode: "lrgb",
5235
5508
  r: fn$3(r),
5236
- g: fn$3(g2),
5509
+ g: fn$3(g),
5237
5510
  b: fn$3(b)
5238
5511
  };
5239
5512
  if (alpha !== void 0) res.alpha = alpha;
5240
5513
  return res;
5241
5514
  };
5242
5515
  const convertRgbToXyz65 = (rgb2) => {
5243
- let { r, g: g2, b, alpha } = convertRgbToLrgb(rgb2);
5516
+ let { r, g, b, alpha } = convertRgbToLrgb(rgb2);
5244
5517
  let res = {
5245
5518
  mode: "xyz65",
5246
- x: 0.4123907992659593 * r + 0.357584339383878 * g2 + 0.1804807884018343 * b,
5247
- y: 0.2126390058715102 * r + 0.715168678767756 * g2 + 0.0721923153607337 * b,
5248
- z: 0.0193308187155918 * r + 0.119194779794626 * g2 + 0.9505321522496607 * b
5519
+ x: 0.4123907992659593 * r + 0.357584339383878 * g + 0.1804807884018343 * b,
5520
+ y: 0.2126390058715102 * r + 0.715168678767756 * g + 0.0721923153607337 * b,
5521
+ z: 0.0193308187155918 * r + 0.119194779794626 * g + 0.9505321522496607 * b
5249
5522
  };
5250
5523
  if (alpha !== void 0) {
5251
5524
  res.alpha = alpha;
@@ -5259,11 +5532,11 @@ GwIDAQAB
5259
5532
  }
5260
5533
  return c2 * 12.92;
5261
5534
  };
5262
- const convertLrgbToRgb = ({ r, g: g2, b, alpha }, mode = "rgb") => {
5535
+ const convertLrgbToRgb = ({ r, g, b, alpha }, mode = "rgb") => {
5263
5536
  let res = {
5264
5537
  mode,
5265
5538
  r: fn$2(r),
5266
- g: fn$2(g2),
5539
+ g: fn$2(g),
5267
5540
  b: fn$2(b)
5268
5541
  };
5269
5542
  if (alpha !== void 0) res.alpha = alpha;
@@ -5324,13 +5597,13 @@ GwIDAQAB
5324
5597
  let DE = M[3] * M[4];
5325
5598
  let BE = M[1] * M[4];
5326
5599
  let BCAD = M[1] * M[2] - M[0] * M[3];
5327
- const convertRgbToCubehelix = ({ r, g: g2, b, alpha }) => {
5600
+ const convertRgbToCubehelix = ({ r, g, b, alpha }) => {
5328
5601
  if (r === void 0) r = 0;
5329
- if (g2 === void 0) g2 = 0;
5602
+ if (g === void 0) g = 0;
5330
5603
  if (b === void 0) b = 0;
5331
- let l = (BCAD * b + r * DE - g2 * BE) / (BCAD + DE - BE);
5604
+ let l = (BCAD * b + r * DE - g * BE) / (BCAD + DE - BE);
5332
5605
  let x2 = b - l;
5333
- let y = (M[4] * (g2 - l) - M[2] * x2) / M[3];
5606
+ let y = (M[4] * (g - l) - M[2] * x2) / M[3];
5334
5607
  let res = {
5335
5608
  mode: "cubehelix",
5336
5609
  l,
@@ -5675,18 +5948,18 @@ GwIDAQAB
5675
5948
  if (alpha !== void 0) res.alpha = alpha;
5676
5949
  return res;
5677
5950
  }
5678
- function convertRgbToHsi({ r, g: g2, b, alpha }) {
5951
+ function convertRgbToHsi({ r, g, b, alpha }) {
5679
5952
  if (r === void 0) r = 0;
5680
- if (g2 === void 0) g2 = 0;
5953
+ if (g === void 0) g = 0;
5681
5954
  if (b === void 0) b = 0;
5682
- let M3 = Math.max(r, g2, b), m2 = Math.min(r, g2, b);
5955
+ let M3 = Math.max(r, g, b), m = Math.min(r, g, b);
5683
5956
  let res = {
5684
5957
  mode: "hsi",
5685
- s: r + g2 + b === 0 ? 0 : 1 - 3 * m2 / (r + g2 + b),
5686
- i: (r + g2 + b) / 3
5958
+ s: r + g + b === 0 ? 0 : 1 - 3 * m / (r + g + b),
5959
+ i: (r + g + b) / 3
5687
5960
  };
5688
- if (M3 - m2 !== 0)
5689
- res.h = (M3 === r ? (g2 - b) / (M3 - m2) + (g2 < b) * 6 : M3 === g2 ? (b - r) / (M3 - m2) + 2 : (r - g2) / (M3 - m2) + 4) * 60;
5961
+ if (M3 - m !== 0)
5962
+ res.h = (M3 === r ? (g - b) / (M3 - m) + (g < b) * 6 : M3 === g ? (b - r) / (M3 - m) + 2 : (r - g) / (M3 - m) + 4) * 60;
5690
5963
  if (alpha !== void 0) res.alpha = alpha;
5691
5964
  return res;
5692
5965
  }
@@ -5751,18 +6024,18 @@ GwIDAQAB
5751
6024
  if (alpha !== void 0) res.alpha = alpha;
5752
6025
  return res;
5753
6026
  }
5754
- function convertRgbToHsl({ r, g: g2, b, alpha }) {
6027
+ function convertRgbToHsl({ r, g, b, alpha }) {
5755
6028
  if (r === void 0) r = 0;
5756
- if (g2 === void 0) g2 = 0;
6029
+ if (g === void 0) g = 0;
5757
6030
  if (b === void 0) b = 0;
5758
- let M3 = Math.max(r, g2, b), m2 = Math.min(r, g2, b);
6031
+ let M3 = Math.max(r, g, b), m = Math.min(r, g, b);
5759
6032
  let res = {
5760
6033
  mode: "hsl",
5761
- s: M3 === m2 ? 0 : (M3 - m2) / (1 - Math.abs(M3 + m2 - 1)),
5762
- l: 0.5 * (M3 + m2)
6034
+ s: M3 === m ? 0 : (M3 - m) / (1 - Math.abs(M3 + m - 1)),
6035
+ l: 0.5 * (M3 + m)
5763
6036
  };
5764
- if (M3 - m2 !== 0)
5765
- res.h = (M3 === r ? (g2 - b) / (M3 - m2) + (g2 < b) * 6 : M3 === g2 ? (b - r) / (M3 - m2) + 2 : (r - g2) / (M3 - m2) + 4) * 60;
6037
+ if (M3 - m !== 0)
6038
+ res.h = (M3 === r ? (g - b) / (M3 - m) + (g < b) * 6 : M3 === g ? (b - r) / (M3 - m) + 2 : (r - g) / (M3 - m) + 4) * 60;
5766
6039
  if (alpha !== void 0) res.alpha = alpha;
5767
6040
  return res;
5768
6041
  }
@@ -5898,18 +6171,18 @@ GwIDAQAB
5898
6171
  if (alpha !== void 0) res.alpha = alpha;
5899
6172
  return res;
5900
6173
  }
5901
- function convertRgbToHsv({ r, g: g2, b, alpha }) {
6174
+ function convertRgbToHsv({ r, g, b, alpha }) {
5902
6175
  if (r === void 0) r = 0;
5903
- if (g2 === void 0) g2 = 0;
6176
+ if (g === void 0) g = 0;
5904
6177
  if (b === void 0) b = 0;
5905
- let M3 = Math.max(r, g2, b), m2 = Math.min(r, g2, b);
6178
+ let M3 = Math.max(r, g, b), m = Math.min(r, g, b);
5906
6179
  let res = {
5907
6180
  mode: "hsv",
5908
- s: M3 === 0 ? 0 : 1 - m2 / M3,
6181
+ s: M3 === 0 ? 0 : 1 - m / M3,
5909
6182
  v: M3
5910
6183
  };
5911
- if (M3 - m2 !== 0)
5912
- res.h = (M3 === r ? (g2 - b) / (M3 - m2) + (g2 < b) * 6 : M3 === g2 ? (b - r) / (M3 - m2) + 2 : (r - g2) / (M3 - m2) + 4) * 60;
6184
+ if (M3 - m !== 0)
6185
+ res.h = (M3 === r ? (g - b) / (M3 - m) + (g < b) * 6 : M3 === g ? (b - r) / (M3 - m) + 2 : (r - g) / (M3 - m) + 4) * 60;
5913
6186
  if (alpha !== void 0) res.alpha = alpha;
5914
6187
  return res;
5915
6188
  }
@@ -6057,7 +6330,7 @@ GwIDAQAB
6057
6330
  const l = transferPqDecode(
6058
6331
  i + 0.008609037037932761 * t + 0.11102962500302593 * p2
6059
6332
  );
6060
- const m2 = transferPqDecode(
6333
+ const m = transferPqDecode(
6061
6334
  i - 0.00860903703793275 * t - 0.11102962500302599 * p2
6062
6335
  );
6063
6336
  const s = transferPqDecode(
@@ -6066,13 +6339,13 @@ GwIDAQAB
6066
6339
  const res = {
6067
6340
  mode: "xyz65",
6068
6341
  x: toRel(
6069
- 2.070152218389422 * l - 1.3263473389671556 * m2 + 0.2066510476294051 * s
6342
+ 2.070152218389422 * l - 1.3263473389671556 * m + 0.2066510476294051 * s
6070
6343
  ),
6071
6344
  y: toRel(
6072
- 0.3647385209748074 * l + 0.680566024947227 * m2 - 0.0453045459220346 * s
6345
+ 0.3647385209748074 * l + 0.680566024947227 * m - 0.0453045459220346 * s
6073
6346
  ),
6074
6347
  z: toRel(
6075
- -0.049747207535812 * l - 0.0492609666966138 * m2 + 1.1880659249923042 * s
6348
+ -0.049747207535812 * l - 0.0492609666966138 * m + 1.1880659249923042 * s
6076
6349
  )
6077
6350
  };
6078
6351
  if (alpha !== void 0) {
@@ -6088,15 +6361,15 @@ GwIDAQAB
6088
6361
  const l = transferPqEncode(
6089
6362
  0.3592832590121217 * absX + 0.6976051147779502 * absY - 0.0358915932320289 * absZ
6090
6363
  );
6091
- const m2 = transferPqEncode(
6364
+ const m = transferPqEncode(
6092
6365
  -0.1920808463704995 * absX + 1.1004767970374323 * absY + 0.0753748658519118 * absZ
6093
6366
  );
6094
6367
  const s = transferPqEncode(
6095
6368
  0.0070797844607477 * absX + 0.0748396662186366 * absY + 0.8433265453898765 * absZ
6096
6369
  );
6097
- const i = 0.5 * l + 0.5 * m2;
6098
- const t = 1.61376953125 * l - 3.323486328125 * m2 + 1.709716796875 * s;
6099
- const p2 = 4.378173828125 * l - 4.24560546875 * m2 - 0.132568359375 * s;
6370
+ const i = 0.5 * l + 0.5 * m;
6371
+ const t = 1.61376953125 * l - 3.323486328125 * m + 1.709716796875 * s;
6372
+ const p2 = 4.378173828125 * l - 4.24560546875 * m - 0.132568359375 * s;
6100
6373
  const res = { mode: "itp", i, t, p: p2 };
6101
6374
  if (alpha !== void 0) {
6102
6375
  res.alpha = alpha;
@@ -6143,14 +6416,14 @@ GwIDAQAB
6143
6416
  let xp = 1.15 * x2 - 0.15 * z2;
6144
6417
  let yp = 0.66 * y + 0.34 * x2;
6145
6418
  let l = jabPqEncode(0.41478972 * xp + 0.579999 * yp + 0.014648 * z2);
6146
- let m2 = jabPqEncode(-0.20151 * xp + 1.120649 * yp + 0.0531008 * z2);
6419
+ let m = jabPqEncode(-0.20151 * xp + 1.120649 * yp + 0.0531008 * z2);
6147
6420
  let s = jabPqEncode(-0.0166008 * xp + 0.2648 * yp + 0.6684799 * z2);
6148
- let i = (l + m2) / 2;
6421
+ let i = (l + m) / 2;
6149
6422
  let res = {
6150
6423
  mode: "jab",
6151
6424
  j: 0.44 * i / (1 - 0.56 * i) - d0$1,
6152
- a: 3.524 * l - 4.066708 * m2 + 0.542708 * s,
6153
- b: 0.199076 * l + 1.096799 * m2 - 1.295875 * s
6425
+ a: 3.524 * l - 4.066708 * m + 0.542708 * s,
6426
+ b: 0.199076 * l + 1.096799 * m - 1.295875 * s
6154
6427
  };
6155
6428
  if (alpha !== void 0) {
6156
6429
  res.alpha = alpha;
@@ -6171,17 +6444,17 @@ GwIDAQAB
6171
6444
  if (b === void 0) b = 0;
6172
6445
  let i = (j2 + d0) / (0.44 + 0.56 * (j2 + d0));
6173
6446
  let l = jabPqDecode(i + 0.13860504 * a + 0.058047316 * b);
6174
- let m2 = jabPqDecode(i - 0.13860504 * a - 0.058047316 * b);
6447
+ let m = jabPqDecode(i - 0.13860504 * a - 0.058047316 * b);
6175
6448
  let s = jabPqDecode(i - 0.096019242 * a - 0.8118919 * b);
6176
6449
  let res = {
6177
6450
  mode: "xyz65",
6178
6451
  x: rel(
6179
- 1.661373024652174 * l - 0.914523081304348 * m2 + 0.23136208173913045 * s
6452
+ 1.661373024652174 * l - 0.914523081304348 * m + 0.23136208173913045 * s
6180
6453
  ),
6181
6454
  y: rel(
6182
- -0.3250758611844533 * l + 1.571847026732543 * m2 - 0.21825383453227928 * s
6455
+ -0.3250758611844533 * l + 1.571847026732543 * m - 0.21825383453227928 * s
6183
6456
  ),
6184
- z: rel(-0.090982811 * l - 0.31272829 * m2 + 1.5227666 * s)
6457
+ z: rel(-0.090982811 * l - 0.31272829 * m + 1.5227666 * s)
6185
6458
  };
6186
6459
  if (alpha !== void 0) {
6187
6460
  res.alpha = alpha;
@@ -6317,12 +6590,12 @@ GwIDAQAB
6317
6590
  };
6318
6591
  const convertLabToRgb = (lab) => convertXyz50ToRgb(convertLabToXyz50(lab));
6319
6592
  const convertRgbToXyz50 = (rgb2) => {
6320
- let { r, g: g2, b, alpha } = convertRgbToLrgb(rgb2);
6593
+ let { r, g, b, alpha } = convertRgbToLrgb(rgb2);
6321
6594
  let res = {
6322
6595
  mode: "xyz50",
6323
- x: 0.436065742824811 * r + 0.3851514688337912 * g2 + 0.14307845442264197 * b,
6324
- y: 0.22249319175623702 * r + 0.7168870538238823 * g2 + 0.06061979053616537 * b,
6325
- z: 0.013923904500943465 * r + 0.09708128566574634 * g2 + 0.7140993584005155 * b
6596
+ x: 0.436065742824811 * r + 0.3851514688337912 * g + 0.14307845442264197 * b,
6597
+ y: 0.22249319175623702 * r + 0.7168870538238823 * g + 0.06061979053616537 * b,
6598
+ z: 0.013923904500943465 * r + 0.09708128566574634 * g + 0.7140993584005155 * b
6326
6599
  };
6327
6600
  if (alpha !== void 0) {
6328
6601
  res.alpha = alpha;
@@ -6664,18 +6937,18 @@ GwIDAQAB
6664
6937
  alpha: { use: interpolatorLinear, fixup: fixupAlpha }
6665
6938
  }
6666
6939
  };
6667
- const convertLrgbToOklab = ({ r, g: g2, b, alpha }) => {
6940
+ const convertLrgbToOklab = ({ r, g, b, alpha }) => {
6668
6941
  if (r === void 0) r = 0;
6669
- if (g2 === void 0) g2 = 0;
6942
+ if (g === void 0) g = 0;
6670
6943
  if (b === void 0) b = 0;
6671
6944
  let L2 = Math.cbrt(
6672
- 0.412221469470763 * r + 0.5363325372617348 * g2 + 0.0514459932675022 * b
6945
+ 0.412221469470763 * r + 0.5363325372617348 * g + 0.0514459932675022 * b
6673
6946
  );
6674
6947
  let M3 = Math.cbrt(
6675
- 0.2119034958178252 * r + 0.6806995506452344 * g2 + 0.1073969535369406 * b
6948
+ 0.2119034958178252 * r + 0.6806995506452344 * g + 0.1073969535369406 * b
6676
6949
  );
6677
6950
  let S2 = Math.cbrt(
6678
- 0.0883024591900564 * r + 0.2817188391361215 * g2 + 0.6299787016738222 * b
6951
+ 0.0883024591900564 * r + 0.2817188391361215 * g + 0.6299787016738222 * b
6679
6952
  );
6680
6953
  let res = {
6681
6954
  mode: "oklab",
@@ -6765,7 +7038,7 @@ GwIDAQAB
6765
7038
  let m_ = 1 + S2 * k_m;
6766
7039
  let s_ = 1 + S2 * k_s;
6767
7040
  let l = l_ * l_ * l_;
6768
- let m2 = m_ * m_ * m_;
7041
+ let m = m_ * m_ * m_;
6769
7042
  let s = s_ * s_ * s_;
6770
7043
  let l_dS = 3 * k_l * l_ * l_;
6771
7044
  let m_dS = 3 * k_m * m_ * m_;
@@ -6773,7 +7046,7 @@ GwIDAQAB
6773
7046
  let l_dS2 = 6 * k_l * k_l * l_;
6774
7047
  let m_dS2 = 6 * k_m * k_m * m_;
6775
7048
  let s_dS2 = 6 * k_s * k_s * s_;
6776
- let f2 = wl * l + wm * m2 + ws * s;
7049
+ let f2 = wl * l + wm * m + ws * s;
6777
7050
  let f1 = wl * l_dS + wm * m_dS + ws * s_dS;
6778
7051
  let f22 = wl * l_dS2 + wm * m_dS2 + ws * s_dS2;
6779
7052
  S2 = S2 - f2 * f1 / (f1 * f1 - 0.5 * f2 * f22);
@@ -6812,7 +7085,7 @@ GwIDAQAB
6812
7085
  let m_ = L2 + C4 * k_m;
6813
7086
  let s_ = L2 + C4 * k_s;
6814
7087
  let l = l_ * l_ * l_;
6815
- let m2 = m_ * m_ * m_;
7088
+ let m = m_ * m_ * m_;
6816
7089
  let s = s_ * s_ * s_;
6817
7090
  let ldt = 3 * l_dt * l_ * l_;
6818
7091
  let mdt = 3 * m_dt * m_ * m_;
@@ -6820,17 +7093,17 @@ GwIDAQAB
6820
7093
  let ldt2 = 6 * l_dt * l_dt * l_;
6821
7094
  let mdt2 = 6 * m_dt * m_dt * m_;
6822
7095
  let sdt2 = 6 * s_dt * s_dt * s_;
6823
- let r = 4.0767416621 * l - 3.3077115913 * m2 + 0.2309699292 * s - 1;
7096
+ let r = 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s - 1;
6824
7097
  let r1 = 4.0767416621 * ldt - 3.3077115913 * mdt + 0.2309699292 * sdt;
6825
7098
  let r2 = 4.0767416621 * ldt2 - 3.3077115913 * mdt2 + 0.2309699292 * sdt2;
6826
7099
  let u_r = r1 / (r1 * r1 - 0.5 * r * r2);
6827
7100
  let t_r = -r * u_r;
6828
- let g2 = -1.2684380046 * l + 2.6097574011 * m2 - 0.3413193965 * s - 1;
7101
+ let g = -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s - 1;
6829
7102
  let g1 = -1.2684380046 * ldt + 2.6097574011 * mdt - 0.3413193965 * sdt;
6830
- let g22 = -1.2684380046 * ldt2 + 2.6097574011 * mdt2 - 0.3413193965 * sdt2;
6831
- let u_g = g1 / (g1 * g1 - 0.5 * g2 * g22);
6832
- let t_g = -g2 * u_g;
6833
- let b2 = -0.0041960863 * l - 0.7034186147 * m2 + 1.707614701 * s - 1;
7103
+ let g2 = -1.2684380046 * ldt2 + 2.6097574011 * mdt2 - 0.3413193965 * sdt2;
7104
+ let u_g = g1 / (g1 * g1 - 0.5 * g * g2);
7105
+ let t_g = -g * u_g;
7106
+ let b2 = -0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s - 1;
6834
7107
  let b1 = -0.0041960863 * ldt - 0.7034186147 * mdt + 1.707614701 * sdt;
6835
7108
  let b22 = -0.0041960863 * ldt2 - 0.7034186147 * mdt2 + 1.707614701 * sdt2;
6836
7109
  let u_b = b1 / (b1 * b1 - 0.5 * b2 * b22);
@@ -7143,12 +7416,12 @@ GwIDAQAB
7143
7416
  }
7144
7417
  };
7145
7418
  const convertP3ToXyz65 = (rgb2) => {
7146
- let { r, g: g2, b, alpha } = convertRgbToLrgb(rgb2);
7419
+ let { r, g, b, alpha } = convertRgbToLrgb(rgb2);
7147
7420
  let res = {
7148
7421
  mode: "xyz65",
7149
- x: 0.486570948648216 * r + 0.265667693169093 * g2 + 0.1982172852343625 * b,
7150
- y: 0.2289745640697487 * r + 0.6917385218365062 * g2 + 0.079286914093745 * b,
7151
- z: 0 * r + 0.0451133818589026 * g2 + 1.043944368900976 * b
7422
+ x: 0.486570948648216 * r + 0.265667693169093 * g + 0.1982172852343625 * b,
7423
+ y: 0.2289745640697487 * r + 0.6917385218365062 * g + 0.079286914093745 * b,
7424
+ z: 0 * r + 0.0451133818589026 * g + 1.043944368900976 * b
7152
7425
  };
7153
7426
  if (alpha !== void 0) {
7154
7427
  res.alpha = alpha;
@@ -7221,13 +7494,13 @@ GwIDAQAB
7221
7494
  };
7222
7495
  const convertProphotoToXyz50 = (prophoto) => {
7223
7496
  let r = linearize$1(prophoto.r);
7224
- let g2 = linearize$1(prophoto.g);
7497
+ let g = linearize$1(prophoto.g);
7225
7498
  let b = linearize$1(prophoto.b);
7226
7499
  let res = {
7227
7500
  mode: "xyz50",
7228
- x: 0.7977666449006423 * r + 0.1351812974005331 * g2 + 0.0313477341283922 * b,
7229
- y: 0.2880748288194013 * r + 0.7118352342418731 * g2 + 899369387256e-16 * b,
7230
- z: 0 * r + 0 * g2 + 0.8251046025104602 * b
7501
+ x: 0.7977666449006423 * r + 0.1351812974005331 * g + 0.0313477341283922 * b,
7502
+ y: 0.2880748288194013 * r + 0.7118352342418731 * g + 899369387256e-16 * b,
7503
+ z: 0 * r + 0 * g + 0.8251046025104602 * b
7231
7504
  };
7232
7505
  if (prophoto.alpha !== void 0) {
7233
7506
  res.alpha = prophoto.alpha;
@@ -7289,13 +7562,13 @@ GwIDAQAB
7289
7562
  };
7290
7563
  const convertRec2020ToXyz65 = (rec2020) => {
7291
7564
  let r = linearize(rec2020.r);
7292
- let g2 = linearize(rec2020.g);
7565
+ let g = linearize(rec2020.g);
7293
7566
  let b = linearize(rec2020.b);
7294
7567
  let res = {
7295
7568
  mode: "xyz65",
7296
- x: 0.6369580483012911 * r + 0.1446169035862083 * g2 + 0.1688809751641721 * b,
7297
- y: 0.262700212011267 * r + 0.6779980715188708 * g2 + 0.059301716469862 * b,
7298
- z: 0 * r + 0.0280726930490874 * g2 + 1.0609850577107909 * b
7569
+ x: 0.6369580483012911 * r + 0.1446169035862083 * g + 0.1688809751641721 * b,
7570
+ y: 0.262700212011267 * r + 0.6779980715188708 * g + 0.059301716469862 * b,
7571
+ z: 0 * r + 0.0280726930490874 * g + 1.0609850577107909 * b
7299
7572
  };
7300
7573
  if (rec2020.alpha !== void 0) {
7301
7574
  res.alpha = rec2020.alpha;
@@ -7320,18 +7593,18 @@ GwIDAQAB
7320
7593
  const bias_cbrt = Math.cbrt(bias);
7321
7594
  const transfer$1 = (v2) => Math.cbrt(v2) - bias_cbrt;
7322
7595
  const convertRgbToXyb = (color) => {
7323
- const { r, g: g2, b, alpha } = convertRgbToLrgb(color);
7324
- const l = transfer$1(0.3 * r + 0.622 * g2 + 0.078 * b + bias);
7325
- const m2 = transfer$1(0.23 * r + 0.692 * g2 + 0.078 * b + bias);
7596
+ const { r, g, b, alpha } = convertRgbToLrgb(color);
7597
+ const l = transfer$1(0.3 * r + 0.622 * g + 0.078 * b + bias);
7598
+ const m = transfer$1(0.23 * r + 0.692 * g + 0.078 * b + bias);
7326
7599
  const s = transfer$1(
7327
- 0.2434226892454782 * r + 0.2047674442449682 * g2 + 0.5518098665095535 * b + bias
7600
+ 0.2434226892454782 * r + 0.2047674442449682 * g + 0.5518098665095535 * b + bias
7328
7601
  );
7329
7602
  const res = {
7330
7603
  mode: "xyb",
7331
- x: (l - m2) / 2,
7332
- y: (l + m2) / 2,
7604
+ x: (l - m) / 2,
7605
+ y: (l + m) / 2,
7333
7606
  /* Apply default chroma from luma (subtract Y from B) */
7334
- b: s - (l + m2) / 2
7607
+ b: s - (l + m) / 2
7335
7608
  };
7336
7609
  if (alpha !== void 0) res.alpha = alpha;
7337
7610
  return res;
@@ -7342,12 +7615,12 @@ GwIDAQAB
7342
7615
  if (y === void 0) y = 0;
7343
7616
  if (b === void 0) b = 0;
7344
7617
  const l = transfer(x2 + y) - bias;
7345
- const m2 = transfer(y - x2) - bias;
7618
+ const m = transfer(y - x2) - bias;
7346
7619
  const s = transfer(b + y) - bias;
7347
7620
  const res = convertLrgbToRgb({
7348
- r: 11.031566904639861 * l - 9.866943908131562 * m2 - 0.16462299650829934 * s,
7349
- g: -3.2541473810744237 * l + 4.418770377582723 * m2 - 0.16462299650829934 * s,
7350
- b: -3.6588512867136815 * l + 2.7129230459360922 * m2 + 1.9459282407775895 * s
7621
+ r: 11.031566904639861 * l - 9.866943908131562 * m - 0.16462299650829934 * s,
7622
+ g: -3.2541473810744237 * l + 4.418770377582723 * m - 0.16462299650829934 * s,
7623
+ b: -3.6588512867136815 * l + 2.7129230459360922 * m + 1.9459282407775895 * s
7351
7624
  });
7352
7625
  if (alpha !== void 0) res.alpha = alpha;
7353
7626
  return res;
@@ -7457,15 +7730,15 @@ GwIDAQAB
7457
7730
  alpha: { use: interpolatorLinear, fixup: fixupAlpha }
7458
7731
  }
7459
7732
  };
7460
- const convertRgbToYiq = ({ r, g: g2, b, alpha }) => {
7733
+ const convertRgbToYiq = ({ r, g, b, alpha }) => {
7461
7734
  if (r === void 0) r = 0;
7462
- if (g2 === void 0) g2 = 0;
7735
+ if (g === void 0) g = 0;
7463
7736
  if (b === void 0) b = 0;
7464
7737
  const res = {
7465
7738
  mode: "yiq",
7466
- y: 0.29889531 * r + 0.58662247 * g2 + 0.11448223 * b,
7467
- i: 0.59597799 * r - 0.2741761 * g2 - 0.32180189 * b,
7468
- q: 0.21147017 * r - 0.52261711 * g2 + 0.31114694 * b
7739
+ y: 0.29889531 * r + 0.58662247 * g + 0.11448223 * b,
7740
+ i: 0.59597799 * r - 0.2741761 * g - 0.32180189 * b,
7741
+ q: 0.21147017 * r - 0.52261711 * g + 0.31114694 * b
7469
7742
  };
7470
7743
  if (alpha !== void 0) res.alpha = alpha;
7471
7744
  return res;
@@ -7513,9 +7786,9 @@ GwIDAQAB
7513
7786
  return void 0;
7514
7787
  }
7515
7788
  let r = fixup(color.r);
7516
- let g2 = fixup(color.g);
7789
+ let g = fixup(color.g);
7517
7790
  let b = fixup(color.b);
7518
- return "#" + (1 << 24 | r << 16 | g2 << 8 | b).toString(16).slice(1);
7791
+ return "#" + (1 << 24 | r << 16 | g << 8 | b).toString(16).slice(1);
7519
7792
  };
7520
7793
  const serializeHex8 = (color) => {
7521
7794
  if (color === void 0) {
@@ -7693,7 +7966,7 @@ GwIDAQAB
7693
7966
  function parseVariables(data, options) {
7694
7967
  const { useRem = false, baseFontSize = 16, defaultModeName } = options;
7695
7968
  const defaultMode = defaultModeName || data.modes[0] || "Default";
7696
- const themeNames = data.modes.filter((m2) => m2 !== defaultMode);
7969
+ const themeNames = data.modes.filter((m) => m !== defaultMode);
7697
7970
  const nameMap = /* @__PURE__ */ new Map();
7698
7971
  for (const v2 of data.variables) nameMap.set(v2.name, figmaToStyleframeName(v2.name));
7699
7972
  const variables = [];
@@ -7939,7 +8212,7 @@ export default ${instanceName};
7939
8212
  modes: data.modes
7940
8213
  } };
7941
8214
  const defaultMode = data.modes[0] || "Default";
7942
- const themeModes = themeNames ? data.modes.filter((m2) => themeNames.includes(m2) && m2 !== defaultMode) : data.modes.slice(1);
8215
+ const themeModes = themeNames ? data.modes.filter((m) => themeNames.includes(m) && m !== defaultMode) : data.modes.slice(1);
7943
8216
  const modeOverrides = /* @__PURE__ */ new Map();
7944
8217
  for (const mode of themeModes) modeOverrides.set(mode, /* @__PURE__ */ new Map());
7945
8218
  for (const variable of data.variables) {