tailwind-styled-v4 5.0.37 → 5.0.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/dist/analyzer.js +213 -161
  2. package/dist/analyzer.js.map +1 -1
  3. package/dist/analyzer.mjs +121 -83
  4. package/dist/analyzer.mjs.map +1 -1
  5. package/dist/animate.js +131 -87
  6. package/dist/animate.js.map +1 -1
  7. package/dist/animate.mjs +31 -15
  8. package/dist/animate.mjs.map +1 -1
  9. package/dist/atomic.js +107 -67
  10. package/dist/atomic.js.map +1 -1
  11. package/dist/atomic.mjs +47 -14
  12. package/dist/atomic.mjs.map +1 -1
  13. package/dist/cli.js +601 -428
  14. package/dist/cli.js.map +1 -1
  15. package/dist/cli.mjs +504 -313
  16. package/dist/cli.mjs.map +1 -1
  17. package/dist/compiler.js +833 -508
  18. package/dist/compiler.js.map +1 -1
  19. package/dist/compiler.mjs +298 -30
  20. package/dist/compiler.mjs.map +1 -1
  21. package/dist/dashboard.js +72 -41
  22. package/dist/dashboard.js.map +1 -1
  23. package/dist/dashboard.mjs +12 -6
  24. package/dist/dashboard.mjs.map +1 -1
  25. package/dist/devtools.js +335 -289
  26. package/dist/devtools.js.map +1 -1
  27. package/dist/devtools.mjs +28 -11
  28. package/dist/devtools.mjs.map +1 -1
  29. package/dist/engine.js +719 -506
  30. package/dist/engine.js.map +1 -1
  31. package/dist/engine.mjs +520 -318
  32. package/dist/engine.mjs.map +1 -1
  33. package/dist/index.d.mts +145 -319
  34. package/dist/index.d.ts +145 -319
  35. package/dist/index.js +1337 -7442
  36. package/dist/index.js.map +1 -1
  37. package/dist/index.mjs +1275 -7386
  38. package/dist/index.mjs.map +1 -1
  39. package/dist/next.js +327 -242
  40. package/dist/next.js.map +1 -1
  41. package/dist/next.mjs +272 -184
  42. package/dist/next.mjs.map +1 -1
  43. package/dist/plugin-api.js +94 -49
  44. package/dist/plugin-api.js.map +1 -1
  45. package/dist/plugin-api.mjs +26 -6
  46. package/dist/plugin-api.mjs.map +1 -1
  47. package/dist/plugin-registry.js +68 -40
  48. package/dist/plugin-registry.js.map +1 -1
  49. package/dist/plugin-registry.mjs +14 -10
  50. package/dist/plugin-registry.mjs.map +1 -1
  51. package/dist/plugin.js +102 -53
  52. package/dist/plugin.js.map +1 -1
  53. package/dist/plugin.mjs +30 -6
  54. package/dist/plugin.mjs.map +1 -1
  55. package/dist/preset.js +48 -15
  56. package/dist/preset.js.map +1 -1
  57. package/dist/preset.mjs +13 -5
  58. package/dist/preset.mjs.map +1 -1
  59. package/dist/rspack.js +108 -53
  60. package/dist/rspack.js.map +1 -1
  61. package/dist/rspack.mjs +50 -18
  62. package/dist/rspack.mjs.map +1 -1
  63. package/dist/runtime-css.js +63 -24
  64. package/dist/runtime-css.js.map +1 -1
  65. package/dist/runtime-css.mjs +15 -7
  66. package/dist/runtime-css.mjs.map +1 -1
  67. package/dist/runtime.js +98 -44
  68. package/dist/runtime.js.map +1 -1
  69. package/dist/runtime.mjs +31 -8
  70. package/dist/runtime.mjs.map +1 -1
  71. package/dist/scanner.js +164 -120
  72. package/dist/scanner.js.map +1 -1
  73. package/dist/scanner.mjs +70 -40
  74. package/dist/scanner.mjs.map +1 -1
  75. package/dist/shared.d.mts +0 -12
  76. package/dist/shared.d.ts +0 -12
  77. package/dist/shared.js +481 -299
  78. package/dist/shared.js.map +1 -1
  79. package/dist/shared.mjs +304 -133
  80. package/dist/shared.mjs.map +1 -1
  81. package/dist/storybook-addon.js +40 -10
  82. package/dist/storybook-addon.js.map +1 -1
  83. package/dist/storybook-addon.mjs +8 -3
  84. package/dist/storybook-addon.mjs.map +1 -1
  85. package/dist/svelte.js +95 -64
  86. package/dist/svelte.js.map +1 -1
  87. package/dist/svelte.mjs +37 -14
  88. package/dist/svelte.mjs.map +1 -1
  89. package/dist/syntax.js +69 -37
  90. package/dist/syntax.js.map +1 -1
  91. package/dist/syntax.mjs +8 -7
  92. package/dist/syntax.mjs.map +1 -1
  93. package/dist/testing.js +56 -18
  94. package/dist/testing.js.map +1 -1
  95. package/dist/testing.mjs +16 -3
  96. package/dist/testing.mjs.map +1 -1
  97. package/dist/theme.js +133 -74
  98. package/dist/theme.js.map +1 -1
  99. package/dist/theme.mjs +45 -14
  100. package/dist/theme.mjs.map +1 -1
  101. package/dist/turbopackLoader.js +156 -115
  102. package/dist/turbopackLoader.js.map +1 -1
  103. package/dist/turbopackLoader.mjs +135 -82
  104. package/dist/turbopackLoader.mjs.map +1 -1
  105. package/dist/tw.js +584 -423
  106. package/dist/tw.js.map +1 -1
  107. package/dist/tw.mjs +498 -311
  108. package/dist/tw.mjs.map +1 -1
  109. package/dist/vite.js +599 -450
  110. package/dist/vite.js.map +1 -1
  111. package/dist/vite.mjs +484 -332
  112. package/dist/vite.mjs.map +1 -1
  113. package/dist/vue.js +102 -70
  114. package/dist/vue.js.map +1 -1
  115. package/dist/vue.mjs +39 -15
  116. package/dist/vue.mjs.map +1 -1
  117. package/dist/webpackLoader.js +112 -77
  118. package/dist/webpackLoader.js.map +1 -1
  119. package/dist/webpackLoader.mjs +52 -18
  120. package/dist/webpackLoader.mjs.map +1 -1
  121. package/native/tailwind-styled-native.linux-x64-gnu.node +0 -0
  122. package/native/tailwind-styled-native.node +0 -0
  123. package/package.json +3 -1
package/dist/engine.js CHANGED
@@ -1,48 +1,12 @@
1
- 'use strict';
2
-
3
- var zod = require('zod');
4
- var module$1 = require('module');
5
- var fs3 = require('fs');
6
- var path9 = require('path');
7
- var crypto = require('crypto');
8
- var url = require('url');
9
- var worker_threads = require('worker_threads');
10
- var os = require('os');
11
- require('perf_hooks');
12
-
13
- var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
14
- function _interopNamespace(e) {
15
- if (e && e.__esModule) return e;
16
- var n = Object.create(null);
17
- if (e) {
18
- Object.keys(e).forEach(function (k) {
19
- if (k !== 'default') {
20
- var d = Object.getOwnPropertyDescriptor(e, k);
21
- Object.defineProperty(n, k, d.get ? d : {
22
- enumerable: true,
23
- get: function () { return e[k]; }
24
- });
25
- }
26
- });
27
- }
28
- n.default = e;
29
- return Object.freeze(n);
30
- }
31
-
32
- var fs3__namespace = /*#__PURE__*/_interopNamespace(fs3);
33
- var path9__namespace = /*#__PURE__*/_interopNamespace(path9);
34
-
1
+ const __importMetaUrl = typeof __filename !== "undefined" ? require("node:url").pathToFileURL(__filename).href : "file://unknown";
35
2
  /* tailwind-styled-v4 v5.0.4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
3
+ "use strict";
4
+ var __create = Object.create;
36
5
  var __defProp = Object.defineProperty;
37
6
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
38
7
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
39
9
  var __hasOwnProp = Object.prototype.hasOwnProperty;
40
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
41
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
42
- }) : x)(function(x) {
43
- if (typeof require !== "undefined") return require.apply(this, arguments);
44
- throw Error('Dynamic require of "' + x + '" is not supported');
45
- });
46
10
  var __esm = (fn, res) => function __init() {
47
11
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
48
12
  };
@@ -58,6 +22,14 @@ var __copyProps = (to, from, except, desc) => {
58
22
  }
59
23
  return to;
60
24
  };
25
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
26
+ // If the importer is in node compatibility mode or this is not an ESM
27
+ // file that has been converted to a CommonJS file using a Babel-
28
+ // compatible transform (i.e. "__esModule" has not been set), then set
29
+ // "default" to the CommonJS "module.exports" for node compatibility.
30
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
31
+ mod
32
+ ));
61
33
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
62
34
 
63
35
  // packages/domain/shared/src/trace.ts
@@ -152,6 +124,7 @@ function getPipelinePercentages(metrics) {
152
124
  }
153
125
  var init_trace = __esm({
154
126
  "packages/domain/shared/src/trace.ts"() {
127
+ "use strict";
155
128
  }
156
129
  });
157
130
 
@@ -166,6 +139,7 @@ function formatErrorCode(code) {
166
139
  var ERROR_CODES, ERROR_SUGGESTIONS;
167
140
  var init_error_codes = __esm({
168
141
  "packages/domain/shared/src/error-codes.ts"() {
142
+ "use strict";
169
143
  ERROR_CODES = {
170
144
  // E0xx — Native binding
171
145
  NATIVE_NOT_FOUND: "E001",
@@ -207,8 +181,8 @@ var init_error_codes = __esm({
207
181
  // packages/domain/shared/src/compatibility.ts
208
182
  function detectTailwind() {
209
183
  try {
210
- const pkgPath = __require.resolve("tailwindcss/package.json");
211
- const { version } = __require(pkgPath);
184
+ const pkgPath = require.resolve("tailwindcss/package.json");
185
+ const { version } = require(pkgPath);
212
186
  const major = Number.parseInt(version.split(".")[0], 10);
213
187
  return { version, major, supported: major >= 4, path: pkgPath };
214
188
  } catch {
@@ -232,8 +206,11 @@ function isTailwindV4() {
232
206
  }
233
207
  var init_compatibility = __esm({
234
208
  "packages/domain/shared/src/compatibility.ts"() {
209
+ "use strict";
235
210
  }
236
211
  });
212
+
213
+ // packages/domain/shared/src/native-schemas.ts
237
214
  function safeParseNative(schema, data, fallback) {
238
215
  const result = schema.safeParse(data);
239
216
  return result.success ? result.data : fallback;
@@ -249,67 +226,69 @@ function parseNative(schema, data, context) {
249
226
  }
250
227
  return result.data;
251
228
  }
252
- var NativeScanFileSchema, NativeScanResultSchema, NativeClassUsageSchema, NativeAnalyzerReportSchema, NativeTransformResultSchema, NativeCssCompileResultSchema, NativeWatchResultSchema, NativeCacheEntrySchema, NativeCacheReadResultSchema;
229
+ var import_zod, NativeScanFileSchema, NativeScanResultSchema, NativeClassUsageSchema, NativeAnalyzerReportSchema, NativeTransformResultSchema, NativeCssCompileResultSchema, NativeWatchEventSchema, NativeWatchResultSchema, NativeCacheEntrySchema, NativeCacheReadResultSchema;
253
230
  var init_native_schemas = __esm({
254
231
  "packages/domain/shared/src/native-schemas.ts"() {
255
- NativeScanFileSchema = zod.z.object({
256
- file: zod.z.string().min(1, "file path cannot be empty"),
257
- classes: zod.z.array(zod.z.string()),
258
- hash: zod.z.string().optional()
232
+ "use strict";
233
+ import_zod = require("zod");
234
+ NativeScanFileSchema = import_zod.z.object({
235
+ file: import_zod.z.string().min(1, "file path cannot be empty"),
236
+ classes: import_zod.z.array(import_zod.z.string()),
237
+ hash: import_zod.z.string().optional()
259
238
  });
260
- NativeScanResultSchema = zod.z.object({
261
- files: zod.z.array(NativeScanFileSchema),
262
- totalFiles: zod.z.number().int().nonnegative(),
263
- uniqueClasses: zod.z.array(zod.z.string())
239
+ NativeScanResultSchema = import_zod.z.object({
240
+ files: import_zod.z.array(NativeScanFileSchema),
241
+ totalFiles: import_zod.z.number().int().nonnegative(),
242
+ uniqueClasses: import_zod.z.array(import_zod.z.string())
264
243
  });
265
- NativeClassUsageSchema = zod.z.object({
266
- name: zod.z.string(),
267
- count: zod.z.number().int().nonnegative(),
268
- files: zod.z.array(zod.z.string()).optional()
244
+ NativeClassUsageSchema = import_zod.z.object({
245
+ name: import_zod.z.string(),
246
+ count: import_zod.z.number().int().nonnegative(),
247
+ files: import_zod.z.array(import_zod.z.string()).optional()
269
248
  });
270
- NativeAnalyzerReportSchema = zod.z.object({
271
- root: zod.z.string(),
272
- topClasses: zod.z.array(NativeClassUsageSchema).optional(),
273
- safelist: zod.z.array(zod.z.string()).optional(),
274
- css: zod.z.string().optional(),
275
- conflicts: zod.z.array(zod.z.unknown()).optional(),
276
- unusedClasses: zod.z.array(zod.z.string()).optional(),
277
- durationMs: zod.z.number().nonnegative().optional()
249
+ NativeAnalyzerReportSchema = import_zod.z.object({
250
+ root: import_zod.z.string(),
251
+ topClasses: import_zod.z.array(NativeClassUsageSchema).optional(),
252
+ safelist: import_zod.z.array(import_zod.z.string()).optional(),
253
+ css: import_zod.z.string().optional(),
254
+ conflicts: import_zod.z.array(import_zod.z.unknown()).optional(),
255
+ unusedClasses: import_zod.z.array(import_zod.z.string()).optional(),
256
+ durationMs: import_zod.z.number().nonnegative().optional()
278
257
  });
279
- NativeTransformResultSchema = zod.z.object({
280
- code: zod.z.string(),
281
- classes: zod.z.array(zod.z.string()),
282
- changed: zod.z.boolean(),
283
- rsc: zod.z.object({
284
- isServer: zod.z.boolean(),
285
- needsClientDirective: zod.z.boolean(),
286
- clientReasons: zod.z.array(zod.z.string())
258
+ NativeTransformResultSchema = import_zod.z.object({
259
+ code: import_zod.z.string(),
260
+ classes: import_zod.z.array(import_zod.z.string()),
261
+ changed: import_zod.z.boolean(),
262
+ rsc: import_zod.z.object({
263
+ isServer: import_zod.z.boolean(),
264
+ needsClientDirective: import_zod.z.boolean(),
265
+ clientReasons: import_zod.z.array(import_zod.z.string())
287
266
  }).optional()
288
267
  });
289
- NativeCssCompileResultSchema = zod.z.object({
290
- css: zod.z.string(),
291
- resolvedClasses: zod.z.array(zod.z.string()),
292
- unresolvedClasses: zod.z.array(zod.z.string()).optional()
268
+ NativeCssCompileResultSchema = import_zod.z.object({
269
+ css: import_zod.z.string(),
270
+ resolvedClasses: import_zod.z.array(import_zod.z.string()),
271
+ unresolvedClasses: import_zod.z.array(import_zod.z.string()).optional()
293
272
  });
294
- zod.z.object({
295
- type: zod.z.enum(["change", "unlink", "create"]),
296
- path: zod.z.string()
273
+ NativeWatchEventSchema = import_zod.z.object({
274
+ type: import_zod.z.enum(["change", "unlink", "create"]),
275
+ path: import_zod.z.string()
297
276
  });
298
- NativeWatchResultSchema = zod.z.object({
299
- status: zod.z.enum(["ok", "error"]),
300
- handleId: zod.z.string().optional(),
301
- error: zod.z.string().optional()
277
+ NativeWatchResultSchema = import_zod.z.object({
278
+ status: import_zod.z.enum(["ok", "error"]),
279
+ handleId: import_zod.z.string().optional(),
280
+ error: import_zod.z.string().optional()
302
281
  });
303
- NativeCacheEntrySchema = zod.z.object({
304
- file: zod.z.string(),
305
- hash: zod.z.string(),
306
- classes: zod.z.array(zod.z.string()),
307
- timestamp: zod.z.number(),
308
- size: zod.z.number().optional()
282
+ NativeCacheEntrySchema = import_zod.z.object({
283
+ file: import_zod.z.string(),
284
+ hash: import_zod.z.string(),
285
+ classes: import_zod.z.array(import_zod.z.string()),
286
+ timestamp: import_zod.z.number(),
287
+ size: import_zod.z.number().optional()
309
288
  });
310
- NativeCacheReadResultSchema = zod.z.object({
311
- entries: zod.z.array(NativeCacheEntrySchema),
312
- version: zod.z.string().optional()
289
+ NativeCacheReadResultSchema = import_zod.z.object({
290
+ entries: import_zod.z.array(NativeCacheEntrySchema),
291
+ version: import_zod.z.string().optional()
313
292
  });
314
293
  }
315
294
  });
@@ -319,7 +298,7 @@ function getNodeModuleRef() {
319
298
  if (isBrowser) return null;
320
299
  if (nodeModuleRef !== null) return nodeModuleRef;
321
300
  try {
322
- const test = typeof __require === "function" ? __require("module") : null;
301
+ const test = typeof require === "function" ? require("module") : null;
323
302
  nodeModuleRef = test;
324
303
  return test;
325
304
  } catch {
@@ -327,48 +306,78 @@ function getNodeModuleRef() {
327
306
  return null;
328
307
  }
329
308
  }
309
+ function getCurrentFileUrl() {
310
+ if (__importMetaUrl) {
311
+ return __importMetaUrl;
312
+ }
313
+ if (typeof __filename !== "undefined") {
314
+ return `file://${__filename.replace(/\\/g, "/")}`;
315
+ }
316
+ return "file://unknown";
317
+ }
330
318
  function getNodePath() {
331
319
  if (isBrowser) throw new Error("node:path not available in browser");
332
- const nodeRequire = getNodeModuleRef();
333
- if (!nodeRequire) throw new Error("require not available");
334
- if (!_nodePath) _nodePath = nodeRequire.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href)))("node:path");
320
+ if (!_nodePath) {
321
+ if (typeof require === "function") {
322
+ _nodePath = require("path");
323
+ } else {
324
+ const nodeRequire = getNodeModuleRef();
325
+ if (!nodeRequire) throw new Error("require not available");
326
+ _nodePath = nodeRequire.createRequire(getCurrentFileUrl())("node:path");
327
+ }
328
+ }
335
329
  return _nodePath;
336
330
  }
337
331
  function getNodeUrl() {
338
332
  if (isBrowser) throw new Error("node:url not available in browser");
339
- const nodeRequire = getNodeModuleRef();
340
- if (!nodeRequire) throw new Error("require not available");
341
- if (!_nodeUrl) _nodeUrl = nodeRequire.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href)))("node:url");
333
+ if (!_nodeUrl) {
334
+ if (typeof require === "function") {
335
+ _nodeUrl = require("url");
336
+ } else {
337
+ const nodeRequire = getNodeModuleRef();
338
+ if (!nodeRequire) throw new Error("require not available");
339
+ _nodeUrl = nodeRequire.createRequire(getCurrentFileUrl())("node:url");
340
+ }
341
+ }
342
342
  return _nodeUrl;
343
343
  }
344
344
  function getNodeFs() {
345
345
  if (isBrowser) throw new Error("node:fs not available in browser");
346
- const nodeRequire = getNodeModuleRef();
347
- if (!nodeRequire) throw new Error("require not available");
348
- if (!_nodeFs) _nodeFs = nodeRequire.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href)))("node:fs");
346
+ if (!_nodeFs) {
347
+ if (typeof require === "function") {
348
+ _nodeFs = require("fs");
349
+ } else {
350
+ const nodeRequire = getNodeModuleRef();
351
+ if (!nodeRequire) throw new Error("require not available");
352
+ _nodeFs = nodeRequire.createRequire(getCurrentFileUrl())("node:fs");
353
+ }
354
+ }
349
355
  return _nodeFs;
350
356
  }
351
357
  function createEsmRequire(importMetaUrl) {
352
358
  if (isBrowser) throw new Error("require not available in browser");
359
+ if (typeof require === "function") return require;
353
360
  const nodeRequire = getNodeModuleRef();
354
361
  if (!nodeRequire) throw new Error("require not available");
355
362
  return nodeRequire.createRequire(importMetaUrl);
356
363
  }
357
364
  function getDirname(importMetaUrl) {
358
365
  if (isBrowser) return "";
366
+ if (typeof __dirname !== "undefined") return __dirname;
359
367
  const nodePath = getNodePath();
360
368
  const nodeUrl = getNodeUrl();
361
369
  return nodePath.dirname(nodeUrl.fileURLToPath(importMetaUrl));
362
370
  }
363
371
  function getFilename(importMetaUrl) {
364
372
  if (isBrowser) return "";
373
+ if (typeof __filename !== "undefined") return __filename;
365
374
  return getNodeUrl().fileURLToPath(importMetaUrl);
366
375
  }
367
376
  function resolveFromRoot(...segments) {
368
377
  if (isBrowser) return segments.join("/");
369
378
  const nodePath = getNodePath();
370
379
  const nodeFs = getNodeFs();
371
- let dir = getDirname((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href)));
380
+ let dir = typeof __dirname !== "undefined" ? __dirname : getDirname(getCurrentFileUrl());
372
381
  for (let i = 0; i < 10; i++) {
373
382
  const pkgPath = nodePath.join(dir, "package.json");
374
383
  try {
@@ -397,6 +406,7 @@ function resolveNativeNodePath(importMetaUrl, ...relativeSegments) {
397
406
  var isBrowser, nodeModuleRef, _nodePath, _nodeUrl, _nodeFs;
398
407
  var init_esmHelpers = __esm({
399
408
  "packages/domain/shared/src/esmHelpers.ts"() {
409
+ "use strict";
400
410
  isBrowser = typeof window !== "undefined" || typeof document !== "undefined";
401
411
  nodeModuleRef = null;
402
412
  _nodePath = null;
@@ -447,6 +457,7 @@ function createBuildTimer() {
447
457
  var RING_BUFFER_SIZE, TelemetryCollector, _globalCollector;
448
458
  var init_telemetry = __esm({
449
459
  "packages/domain/shared/src/telemetry.ts"() {
460
+ "use strict";
450
461
  RING_BUFFER_SIZE = 100;
451
462
  TelemetryCollector = class {
452
463
  data = [];
@@ -513,6 +524,8 @@ var init_telemetry = __esm({
513
524
  _globalCollector = null;
514
525
  }
515
526
  });
527
+
528
+ // packages/domain/shared/src/configSchemas.ts
516
529
  function parseJsonWithSchema(jsonString, schema, sourceName) {
517
530
  let parsed;
518
531
  try {
@@ -531,8 +544,8 @@ ${issues}`);
531
544
  return result.data;
532
545
  }
533
546
  function parseJsonFileWithSchema(filePath, schema) {
534
- const { readFileSync } = __require("fs");
535
- const { basename } = __require("path");
547
+ const { readFileSync } = require("fs");
548
+ const { basename } = require("path");
536
549
  let content;
537
550
  try {
538
551
  content = readFileSync(filePath, "utf-8");
@@ -543,70 +556,72 @@ function parseJsonFileWithSchema(filePath, schema) {
543
556
  }
544
557
  return parseJsonWithSchema(content, schema, basename(filePath));
545
558
  }
546
- var ScanCacheClassEntrySchema, ScanCacheSchema, TailwindContentItemSchema, TailwindConfigSchema, RegistryPluginEntrySchema, RegistryFileSchema, PackageJsonSchema;
559
+ var import_zod2, ScanCacheClassEntrySchema, ScanCacheSchema, TailwindContentItemSchema, TailwindConfigSchema, RegistryPluginEntrySchema, RegistryFileSchema, PackageJsonSchema;
547
560
  var init_configSchemas = __esm({
548
561
  "packages/domain/shared/src/configSchemas.ts"() {
549
- ScanCacheClassEntrySchema = zod.z.object({
550
- name: zod.z.string().min(1),
551
- usedIn: zod.z.array(zod.z.string()),
552
- risk: zod.z.enum(["low", "medium", "high"]).default("low"),
553
- bundleContribution: zod.z.number().nonnegative().default(0),
554
- variants: zod.z.array(zod.z.string()).default([])
562
+ "use strict";
563
+ import_zod2 = require("zod");
564
+ ScanCacheClassEntrySchema = import_zod2.z.object({
565
+ name: import_zod2.z.string().min(1),
566
+ usedIn: import_zod2.z.array(import_zod2.z.string()),
567
+ risk: import_zod2.z.enum(["low", "medium", "high"]).default("low"),
568
+ bundleContribution: import_zod2.z.number().nonnegative().default(0),
569
+ variants: import_zod2.z.array(import_zod2.z.string()).default([])
555
570
  });
556
- ScanCacheSchema = zod.z.object({
557
- version: zod.z.string().default("1"),
558
- generatedAt: zod.z.string(),
559
- root: zod.z.string(),
560
- classNames: zod.z.array(ScanCacheClassEntrySchema),
561
- totalFiles: zod.z.number().int().nonnegative(),
562
- uniqueCount: zod.z.number().int().nonnegative()
571
+ ScanCacheSchema = import_zod2.z.object({
572
+ version: import_zod2.z.string().default("1"),
573
+ generatedAt: import_zod2.z.string(),
574
+ root: import_zod2.z.string(),
575
+ classNames: import_zod2.z.array(ScanCacheClassEntrySchema),
576
+ totalFiles: import_zod2.z.number().int().nonnegative(),
577
+ uniqueCount: import_zod2.z.number().int().nonnegative()
563
578
  });
564
- TailwindContentItemSchema = zod.z.union([
565
- zod.z.string(),
566
- zod.z.object({
567
- raw: zod.z.string(),
568
- extension: zod.z.string().optional()
579
+ TailwindContentItemSchema = import_zod2.z.union([
580
+ import_zod2.z.string(),
581
+ import_zod2.z.object({
582
+ raw: import_zod2.z.string(),
583
+ extension: import_zod2.z.string().optional()
569
584
  }),
570
- zod.z.object({
571
- files: zod.z.array(zod.z.string()),
572
- transform: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
585
+ import_zod2.z.object({
586
+ files: import_zod2.z.array(import_zod2.z.string()),
587
+ transform: import_zod2.z.record(import_zod2.z.string(), import_zod2.z.unknown()).optional()
573
588
  })
574
589
  ]);
575
- TailwindConfigSchema = zod.z.object({
576
- content: zod.z.array(TailwindContentItemSchema).optional(),
577
- theme: zod.z.record(zod.z.string(), zod.z.unknown()).optional(),
578
- plugins: zod.z.array(zod.z.unknown()).optional(),
579
- darkMode: zod.z.union([zod.z.literal("class"), zod.z.literal("media"), zod.z.literal(false)]).optional(),
580
- prefix: zod.z.string().optional(),
581
- safelist: zod.z.array(zod.z.union([zod.z.string(), zod.z.object({ pattern: zod.z.instanceof(RegExp) })])).optional(),
582
- blocklist: zod.z.array(zod.z.string()).optional()
590
+ TailwindConfigSchema = import_zod2.z.object({
591
+ content: import_zod2.z.array(TailwindContentItemSchema).optional(),
592
+ theme: import_zod2.z.record(import_zod2.z.string(), import_zod2.z.unknown()).optional(),
593
+ plugins: import_zod2.z.array(import_zod2.z.unknown()).optional(),
594
+ darkMode: import_zod2.z.union([import_zod2.z.literal("class"), import_zod2.z.literal("media"), import_zod2.z.literal(false)]).optional(),
595
+ prefix: import_zod2.z.string().optional(),
596
+ safelist: import_zod2.z.array(import_zod2.z.union([import_zod2.z.string(), import_zod2.z.object({ pattern: import_zod2.z.instanceof(RegExp) })])).optional(),
597
+ blocklist: import_zod2.z.array(import_zod2.z.string()).optional()
583
598
  }).passthrough();
584
- RegistryPluginEntrySchema = zod.z.object({
585
- name: zod.z.string().min(1),
586
- description: zod.z.string(),
587
- version: zod.z.string(),
588
- tags: zod.z.array(zod.z.string()).default([]),
589
- official: zod.z.boolean().default(false),
590
- docs: zod.z.string().url().optional(),
591
- install: zod.z.string().optional(),
592
- integrity: zod.z.string().optional()
599
+ RegistryPluginEntrySchema = import_zod2.z.object({
600
+ name: import_zod2.z.string().min(1),
601
+ description: import_zod2.z.string(),
602
+ version: import_zod2.z.string(),
603
+ tags: import_zod2.z.array(import_zod2.z.string()).default([]),
604
+ official: import_zod2.z.boolean().default(false),
605
+ docs: import_zod2.z.string().url().optional(),
606
+ install: import_zod2.z.string().optional(),
607
+ integrity: import_zod2.z.string().optional()
593
608
  });
594
- RegistryFileSchema = zod.z.object({
595
- version: zod.z.string(),
596
- official: zod.z.array(RegistryPluginEntrySchema).default([]),
597
- community: zod.z.array(RegistryPluginEntrySchema).default([])
609
+ RegistryFileSchema = import_zod2.z.object({
610
+ version: import_zod2.z.string(),
611
+ official: import_zod2.z.array(RegistryPluginEntrySchema).default([]),
612
+ community: import_zod2.z.array(RegistryPluginEntrySchema).default([])
598
613
  });
599
- PackageJsonSchema = zod.z.object({
600
- name: zod.z.string(),
601
- version: zod.z.string(),
602
- scripts: zod.z.record(zod.z.string(), zod.z.string()).optional(),
603
- dependencies: zod.z.record(zod.z.string(), zod.z.string()).optional(),
604
- devDependencies: zod.z.record(zod.z.string(), zod.z.string()).optional(),
605
- peerDependencies: zod.z.record(zod.z.string(), zod.z.string()).optional(),
606
- main: zod.z.string().optional(),
607
- module: zod.z.string().optional(),
608
- exports: zod.z.unknown().optional(),
609
- type: zod.z.enum(["module", "commonjs"]).optional()
614
+ PackageJsonSchema = import_zod2.z.object({
615
+ name: import_zod2.z.string(),
616
+ version: import_zod2.z.string(),
617
+ scripts: import_zod2.z.record(import_zod2.z.string(), import_zod2.z.string()).optional(),
618
+ dependencies: import_zod2.z.record(import_zod2.z.string(), import_zod2.z.string()).optional(),
619
+ devDependencies: import_zod2.z.record(import_zod2.z.string(), import_zod2.z.string()).optional(),
620
+ peerDependencies: import_zod2.z.record(import_zod2.z.string(), import_zod2.z.string()).optional(),
621
+ main: import_zod2.z.string().optional(),
622
+ module: import_zod2.z.string().optional(),
623
+ exports: import_zod2.z.unknown().optional(),
624
+ type: import_zod2.z.enum(["module", "commonjs"]).optional()
610
625
  }).passthrough();
611
626
  }
612
627
  });
@@ -616,8 +631,8 @@ function getDirnameFromUrl(importMetaUrl) {
616
631
  if (!importMetaUrl) return "";
617
632
  if (isBrowser2) return "";
618
633
  try {
619
- const nodeUrl = __require(NODE_URL);
620
- const nodePath = __require(NODE_PATH);
634
+ const nodeUrl = require(NODE_URL);
635
+ const nodePath = require(NODE_PATH);
621
636
  return nodePath.dirname(nodeUrl.fileURLToPath(importMetaUrl));
622
637
  } catch {
623
638
  if (importMetaUrl.startsWith("file://")) {
@@ -631,7 +646,7 @@ function getDirnameFromUrl(importMetaUrl) {
631
646
  function resolvePath(...segments) {
632
647
  if (isBrowser2) return segments.join("/").replace(/\/+/g, "/");
633
648
  try {
634
- const nodePath = __require(NODE_PATH);
649
+ const nodePath = require(NODE_PATH);
635
650
  return nodePath.resolve(...segments);
636
651
  } catch {
637
652
  return segments.join("/").replace(/\/+/g, "/");
@@ -640,7 +655,7 @@ function resolvePath(...segments) {
640
655
  function existsSync(path16) {
641
656
  if (isBrowser2) return false;
642
657
  try {
643
- const nodeFs = __require(NODE_FS);
658
+ const nodeFs = require(NODE_FS);
644
659
  return nodeFs.existsSync(path16);
645
660
  } catch {
646
661
  return false;
@@ -694,6 +709,7 @@ function resolveLoaderPath(loaderBasename, importMetaUrl) {
694
709
  var isBrowser2, NODE_URL, NODE_FS, NODE_PATH;
695
710
  var init_workerResolver = __esm({
696
711
  "packages/domain/shared/src/workerResolver.ts"() {
712
+ "use strict";
697
713
  isBrowser2 = typeof window !== "undefined" || typeof document !== "undefined";
698
714
  NODE_URL = typeof window === "undefined" || typeof document === "undefined" ? "node:url" : null;
699
715
  NODE_FS = typeof window === "undefined" || typeof document === "undefined" ? "node:fs" : null;
@@ -843,13 +859,13 @@ function generateClassRenameCodemod(renames, opts = {}) {
843
859
  }
844
860
  return lines.join("\n");
845
861
  }
846
- function generateBarrelFile(exports$1, dir, opts = {}) {
862
+ function generateBarrelFile(exports2, dir, opts = {}) {
847
863
  const { includeTypes = true } = opts;
848
864
  const lines = [];
849
865
  lines.push(`// Auto-generated barrel file for ${dir}`);
850
866
  lines.push(`// Run: npx tsx scripts/generate-barrel.ts to regenerate`);
851
867
  lines.push(``);
852
- for (const name of exports$1) {
868
+ for (const name of exports2) {
853
869
  lines.push(`export { default as ${name}, type ${name}Props } from "./${name}"`);
854
870
  if (includeTypes) {
855
871
  lines.push(`export type * from "./${name}"`);
@@ -859,8 +875,11 @@ function generateBarrelFile(exports$1, dir, opts = {}) {
859
875
  }
860
876
  var init_codegen = __esm({
861
877
  "packages/domain/shared/src/codegen.ts"() {
878
+ "use strict";
862
879
  }
863
880
  });
881
+
882
+ // packages/domain/shared/src/native-resolution.ts
864
883
  function platformKey() {
865
884
  if (isBrowser3) return "browser";
866
885
  return `${process.platform}-${process.arch}`;
@@ -876,7 +895,7 @@ function resolveNativeBinary(runtimeDir) {
876
895
  }
877
896
  const envPath = process.env.TW_NATIVE_PATH?.trim();
878
897
  if (envPath) {
879
- if (fs3__namespace.existsSync(envPath)) {
898
+ if (fs.existsSync(envPath)) {
880
899
  return { path: envPath, source: "env", platform, tried };
881
900
  }
882
901
  tried.push(`env:${envPath} (not found)`);
@@ -885,7 +904,7 @@ function resolveNativeBinary(runtimeDir) {
885
904
  for (const pkg of prebuiltPkgs) {
886
905
  try {
887
906
  const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
888
- if (fs3__namespace.existsSync(candidate)) {
907
+ if (fs.existsSync(candidate)) {
889
908
  return { path: candidate, source: "prebuilt", platform, tried };
890
909
  }
891
910
  tried.push(`prebuilt:${pkg} (resolved but missing)`);
@@ -896,13 +915,13 @@ function resolveNativeBinary(runtimeDir) {
896
915
  const napiPlatform = platform === "linux-x64" ? "linux-x64-gnu" : platform === "linux-arm64" ? "linux-arm64-gnu" : platform;
897
916
  const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser"];
898
917
  if (runtimeDir) {
899
- for (const depth of ["..", path9__namespace.join("..", ".."), path9__namespace.join("..", "..", "..")]) {
900
- const pkgRoot = path9__namespace.resolve(runtimeDir, depth);
918
+ for (const depth of ["..", path.join("..", ".."), path.join("..", "..", "..")]) {
919
+ const pkgRoot = path.resolve(runtimeDir, depth);
901
920
  for (const bin of BINARY_NAMES_SELF) {
902
921
  for (const suffix of ["", `.${platform}`, `.${napiPlatform}`]) {
903
- const candidate = path9__namespace.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
922
+ const candidate = path.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
904
923
  tried.push(`self-bundled:${candidate}`);
905
- if (fs3__namespace.existsSync(candidate)) {
924
+ if (fs.existsSync(candidate)) {
906
925
  return { path: candidate, source: "prebuilt", platform, tried };
907
926
  }
908
927
  }
@@ -914,29 +933,29 @@ function resolveNativeBinary(runtimeDir) {
914
933
  const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
915
934
  const localCandidates = [];
916
935
  for (const bin of BINARY_NAMES) {
917
- localCandidates.push(path9__namespace.resolve(base, `${bin}.node`));
918
- localCandidates.push(path9__namespace.resolve(base, "..", `${bin}.node`));
919
- localCandidates.push(path9__namespace.resolve(base, `${bin}.${platform}.node`));
920
- localCandidates.push(path9__namespace.resolve(base, `${bin}.${napiPlatform}.node`));
936
+ localCandidates.push(path.resolve(base, `${bin}.node`));
937
+ localCandidates.push(path.resolve(base, "..", `${bin}.node`));
938
+ localCandidates.push(path.resolve(base, `${bin}.${platform}.node`));
939
+ localCandidates.push(path.resolve(base, `${bin}.${napiPlatform}.node`));
921
940
  }
922
941
  for (const startDir of [cwd, base]) {
923
942
  let dir = startDir;
924
943
  for (let i = 0; i < 6; i++) {
925
- const nativeDir = path9__namespace.resolve(dir, "native");
944
+ const nativeDir = path.resolve(dir, "native");
926
945
  for (const bin of BINARY_NAMES) {
927
- localCandidates.push(path9__namespace.resolve(nativeDir, `${bin}.node`));
928
- localCandidates.push(path9__namespace.resolve(nativeDir, `${bin}.${platform}.node`));
929
- localCandidates.push(path9__namespace.resolve(nativeDir, `${bin}.${napiPlatform}.node`));
930
- localCandidates.push(path9__namespace.resolve(nativeDir, "target", "release", `${bin}.node`));
946
+ localCandidates.push(path.resolve(nativeDir, `${bin}.node`));
947
+ localCandidates.push(path.resolve(nativeDir, `${bin}.${platform}.node`));
948
+ localCandidates.push(path.resolve(nativeDir, `${bin}.${napiPlatform}.node`));
949
+ localCandidates.push(path.resolve(nativeDir, "target", "release", `${bin}.node`));
931
950
  }
932
- const parent = path9__namespace.resolve(dir, "..");
951
+ const parent = path.resolve(dir, "..");
933
952
  if (parent === dir) break;
934
953
  dir = parent;
935
954
  }
936
955
  }
937
956
  for (const candidate of localCandidates) {
938
957
  tried.push(`local:${candidate}`);
939
- if (fs3__namespace.existsSync(candidate)) {
958
+ if (fs.existsSync(candidate)) {
940
959
  return { path: candidate, source: "local", platform, tried };
941
960
  }
942
961
  }
@@ -956,11 +975,17 @@ function formatNativeNotFoundError(result) {
956
975
  ];
957
976
  return lines.join("\n");
958
977
  }
959
- var isBrowser3, _require, PLATFORM_MAP;
978
+ var import_node_module, fs, path, isBrowser3, _require, PLATFORM_MAP;
960
979
  var init_native_resolution = __esm({
961
980
  "packages/domain/shared/src/native-resolution.ts"() {
981
+ "use strict";
982
+ import_node_module = require("module");
983
+ fs = __toESM(require("fs"));
984
+ path = __toESM(require("path"));
962
985
  isBrowser3 = typeof window !== "undefined" || typeof document !== "undefined";
963
- _require = typeof __require !== "undefined" ? __require : module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href)));
986
+ _require = (0, import_node_module.createRequire)(
987
+ typeof require !== "undefined" ? typeof __filename !== "undefined" ? `file://${__filename}` : "file://unknown" : __importMetaUrl
988
+ );
964
989
  PLATFORM_MAP = {
965
990
  "linux-x64": ["@tailwind-styled/native-linux-x64-gnu", "@tailwind-styled/native-linux-x64"],
966
991
  "linux-arm64": ["@tailwind-styled/native-linux-arm64-gnu", "@tailwind-styled/native-linux-arm64"],
@@ -1006,6 +1031,7 @@ function createObservabilityClient(opts = {}) {
1006
1031
  }
1007
1032
  var init_observability = __esm({
1008
1033
  "packages/domain/shared/src/observability.ts"() {
1034
+ "use strict";
1009
1035
  }
1010
1036
  });
1011
1037
 
@@ -1013,8 +1039,9 @@ var init_observability = __esm({
1013
1039
  var _loadNative, log, NATIVE_UNAVAILABLE_MESSAGE, nativeBridge, bridgeLoadAttempted, bridgeLoadError, isValidNativeBridge, getNativeBridge, adaptNativeResult;
1014
1040
  var init_nativeBridge = __esm({
1015
1041
  "packages/domain/compiler/src/nativeBridge.ts"() {
1042
+ "use strict";
1016
1043
  init_src2();
1017
- _loadNative = (path16) => __require(path16);
1044
+ _loadNative = (path16) => require(path16);
1018
1045
  log = (...args) => {
1019
1046
  if (process.env.DEBUG?.includes("compiler:native")) {
1020
1047
  console.log("[compiler:native]", ...args);
@@ -1040,7 +1067,7 @@ var init_nativeBridge = __esm({
1040
1067
  }
1041
1068
  bridgeLoadAttempted = true;
1042
1069
  try {
1043
- const runtimeDir = resolveRuntimeDir(void 0, (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href)));
1070
+ const runtimeDir = resolveRuntimeDir(void 0, __importMetaUrl);
1044
1071
  const result = resolveNativeBinary(runtimeDir);
1045
1072
  if (result.path && result.path.endsWith(".node")) {
1046
1073
  try {
@@ -1152,6 +1179,7 @@ function resetCacheStats() {
1152
1179
  }
1153
1180
  var init_cssGeneratorNative = __esm({
1154
1181
  "packages/domain/compiler/src/compiler/cssGeneratorNative.ts"() {
1182
+ "use strict";
1155
1183
  init_nativeBridge();
1156
1184
  }
1157
1185
  });
@@ -1224,6 +1252,7 @@ function atomicRegistrySize() {
1224
1252
  }
1225
1253
  var init_compilationNative = __esm({
1226
1254
  "packages/domain/compiler/src/compiler/compilationNative.ts"() {
1255
+ "use strict";
1227
1256
  init_nativeBridge();
1228
1257
  }
1229
1258
  });
@@ -1367,6 +1396,7 @@ function twMergeRaw(classLists) {
1367
1396
  }
1368
1397
  var init_cssCompilationNative = __esm({
1369
1398
  "packages/domain/compiler/src/compiler/cssCompilationNative.ts"() {
1399
+ "use strict";
1370
1400
  init_nativeBridge();
1371
1401
  }
1372
1402
  });
@@ -1466,6 +1496,7 @@ function idRegistryImport(importedData) {
1466
1496
  }
1467
1497
  var init_idRegistryNative = __esm({
1468
1498
  "packages/domain/compiler/src/compiler/idRegistryNative.ts"() {
1499
+ "use strict";
1469
1500
  init_nativeBridge();
1470
1501
  }
1471
1502
  });
@@ -1607,9 +1638,12 @@ function scanFilesBatchNative(filesJson) {
1607
1638
  }
1608
1639
  var init_streamingNative = __esm({
1609
1640
  "packages/domain/compiler/src/compiler/streamingNative.ts"() {
1641
+ "use strict";
1610
1642
  init_nativeBridge();
1611
1643
  }
1612
1644
  });
1645
+
1646
+ // packages/domain/compiler/src/tailwindEngine.ts
1613
1647
  function loadTailwindEngine() {
1614
1648
  if (_twEngine) return _twEngine;
1615
1649
  if (_twEngineError) throw _twEngineError;
@@ -1629,10 +1663,10 @@ async function generateRawCss(classes, cssEntryContent, root) {
1629
1663
  if (classes.length === 0) return "";
1630
1664
  const tw = loadTailwindEngine();
1631
1665
  const input = cssEntryContent ?? "@import 'tailwindcss';";
1632
- const { readFileSync, existsSync: existsSync3 } = await import('fs');
1633
- const { dirname, resolve: resolve2 } = await import('path');
1666
+ const { readFileSync, existsSync: existsSync3 } = await import("fs");
1667
+ const { dirname, resolve: resolve2 } = await import("path");
1634
1668
  const projectRoot = root ?? process.cwd();
1635
- const req = module$1.createRequire(resolve2(projectRoot, "package.json"));
1669
+ const req = (0, import_node_module2.createRequire)(resolve2(projectRoot, "package.json"));
1636
1670
  const loadStylesheet = async (id, base) => {
1637
1671
  try {
1638
1672
  const cssId = id === "tailwindcss" ? "tailwindcss/index.css" : id === "tailwindcss/preflight" ? "tailwindcss/preflight.css" : id === "tailwindcss/utilities" ? "tailwindcss/utilities.css" : id === "tailwindcss/theme" ? "tailwindcss/theme.css" : id;
@@ -1652,10 +1686,16 @@ async function generateRawCss(classes, cssEntryContent, root) {
1652
1686
  const compiler = await Promise.resolve(tw.compile(input, { loadStylesheet }));
1653
1687
  return compiler.build(classes);
1654
1688
  }
1655
- var require2, _twEngine, _twEngineError;
1689
+ var import_node_module2, import_meta, require2, MAX_CACHE_MEMORY, _twEngine, _twEngineError;
1656
1690
  var init_tailwindEngine = __esm({
1657
1691
  "packages/domain/compiler/src/tailwindEngine.ts"() {
1658
- require2 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href)));
1692
+ "use strict";
1693
+ import_node_module2 = require("module");
1694
+ import_meta = {};
1695
+ require2 = (0, import_node_module2.createRequire)(
1696
+ typeof __filename !== "undefined" ? `file://${__filename}` : typeof import_meta !== "undefined" && __importMetaUrl ? __importMetaUrl : "file://unknown"
1697
+ );
1698
+ MAX_CACHE_MEMORY = 256 * 1024;
1659
1699
  _twEngine = null;
1660
1700
  _twEngineError = null;
1661
1701
  }
@@ -1836,24 +1876,31 @@ function processTailwindCssWithTargets(css, targets) {
1836
1876
  }
1837
1877
  return result.css;
1838
1878
  }
1839
- var _cssCache, _cacheHits, _cacheMisses, MAX_CACHE_SIZE;
1879
+ var import_node_module3, import_meta2, require3, _cssCache, _cacheHits, _cacheMisses, MAX_CACHE_SIZE, MAX_CACHE_MEMORY2;
1840
1880
  var init_tailwindEngine2 = __esm({
1841
1881
  "packages/domain/compiler/src/compiler/tailwindEngine.ts"() {
1882
+ "use strict";
1883
+ import_node_module3 = require("module");
1842
1884
  init_nativeBridge();
1843
1885
  init_cssGeneratorNative();
1844
1886
  init_cssCompilationNative();
1845
1887
  init_tailwindEngine();
1846
- module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href)));
1888
+ import_meta2 = {};
1889
+ require3 = (0, import_node_module3.createRequire)(
1890
+ typeof __filename !== "undefined" ? `file://${__filename}` : typeof import_meta2 !== "undefined" && __importMetaUrl ? __importMetaUrl : "file://unknown"
1891
+ );
1847
1892
  _cssCache = /* @__PURE__ */ new Map();
1848
1893
  _cacheHits = 0;
1849
1894
  _cacheMisses = 0;
1850
1895
  MAX_CACHE_SIZE = 100;
1896
+ MAX_CACHE_MEMORY2 = 256 * 1024;
1851
1897
  }
1852
1898
  });
1853
1899
 
1854
1900
  // packages/domain/compiler/src/compiler/index.ts
1855
1901
  var init_compiler = __esm({
1856
1902
  "packages/domain/compiler/src/compiler/index.ts"() {
1903
+ "use strict";
1857
1904
  init_cssGeneratorNative();
1858
1905
  init_compilationNative();
1859
1906
  init_cssCompilationNative();
@@ -1866,6 +1913,7 @@ var init_compiler = __esm({
1866
1913
  var parseClasses, parseClass, extractAllClasses, extractClassesFromSource, astExtractClasses, normalizeClasses, mergeClassesStatic, normalizeAndDedupClasses, extractComponentUsage, batchExtractClasses, checkAgainstSafelist, diffClassLists;
1867
1914
  var init_parser = __esm({
1868
1915
  "packages/domain/compiler/src/parser/index.ts"() {
1916
+ "use strict";
1869
1917
  init_nativeBridge();
1870
1918
  parseClasses = (raw) => {
1871
1919
  const native = getNativeBridge();
@@ -2044,6 +2092,7 @@ function resetMemoryStats() {
2044
2092
  }
2045
2093
  var init_analyzerNative = __esm({
2046
2094
  "packages/domain/compiler/src/analyzer/analyzerNative.ts"() {
2095
+ "use strict";
2047
2096
  init_nativeBridge();
2048
2097
  }
2049
2098
  });
@@ -2137,6 +2186,7 @@ function resolveSimpleVariants(configJson) {
2137
2186
  }
2138
2187
  var init_themeResolutionNative = __esm({
2139
2188
  "packages/domain/compiler/src/analyzer/themeResolutionNative.ts"() {
2189
+ "use strict";
2140
2190
  init_nativeBridge();
2141
2191
  }
2142
2192
  });
@@ -2184,6 +2234,7 @@ function generateSubComponentTypes(root, outputPath) {
2184
2234
  }
2185
2235
  var init_scannerNative = __esm({
2186
2236
  "packages/domain/compiler/src/analyzer/scannerNative.ts"() {
2237
+ "use strict";
2187
2238
  init_nativeBridge();
2188
2239
  }
2189
2240
  });
@@ -2191,6 +2242,7 @@ var init_scannerNative = __esm({
2191
2242
  // packages/domain/compiler/src/analyzer/index.ts
2192
2243
  var init_analyzer = __esm({
2193
2244
  "packages/domain/compiler/src/analyzer/index.ts"() {
2245
+ "use strict";
2194
2246
  init_analyzerNative();
2195
2247
  init_themeResolutionNative();
2196
2248
  init_scannerNative();
@@ -2379,6 +2431,7 @@ function resetResolverPoolStats() {
2379
2431
  }
2380
2432
  var init_cacheNative = __esm({
2381
2433
  "packages/domain/compiler/src/cache/cacheNative.ts"() {
2434
+ "use strict";
2382
2435
  init_nativeBridge();
2383
2436
  }
2384
2437
  });
@@ -2386,6 +2439,7 @@ var init_cacheNative = __esm({
2386
2439
  // packages/domain/compiler/src/cache/index.ts
2387
2440
  var init_cache = __esm({
2388
2441
  "packages/domain/compiler/src/cache/index.ts"() {
2442
+ "use strict";
2389
2443
  init_cacheNative();
2390
2444
  }
2391
2445
  });
@@ -2634,6 +2688,7 @@ function redisDiagnose() {
2634
2688
  }
2635
2689
  var init_redisNative = __esm({
2636
2690
  "packages/domain/compiler/src/redis/redisNative.ts"() {
2691
+ "use strict";
2637
2692
  init_nativeBridge();
2638
2693
  }
2639
2694
  });
@@ -2641,6 +2696,7 @@ var init_redisNative = __esm({
2641
2696
  // packages/domain/compiler/src/redis/index.ts
2642
2697
  var init_redis = __esm({
2643
2698
  "packages/domain/compiler/src/redis/index.ts"() {
2699
+ "use strict";
2644
2700
  init_redisNative();
2645
2701
  }
2646
2702
  });
@@ -2779,6 +2835,7 @@ function getCompilerDiagnostics() {
2779
2835
  }
2780
2836
  var init_watchSystemNative = __esm({
2781
2837
  "packages/domain/compiler/src/watch/watchSystemNative.ts"() {
2838
+ "use strict";
2782
2839
  init_nativeBridge();
2783
2840
  }
2784
2841
  });
@@ -2786,9 +2843,12 @@ var init_watchSystemNative = __esm({
2786
2843
  // packages/domain/compiler/src/watch/index.ts
2787
2844
  var init_watch = __esm({
2788
2845
  "packages/domain/compiler/src/watch/index.ts"() {
2846
+ "use strict";
2789
2847
  init_watchSystemNative();
2790
2848
  }
2791
2849
  });
2850
+
2851
+ // packages/domain/compiler/src/index.ts
2792
2852
  function _layoutClassesToCss(classes) {
2793
2853
  const native = getNativeBridge();
2794
2854
  if (!native?.layoutClassesToCss) {
@@ -2823,9 +2883,13 @@ function extractContainerCssFromSource(source) {
2823
2883
  }
2824
2884
  return rules.join("\n");
2825
2885
  }
2826
- var _require2, transformSource, hasTwUsage, isAlreadyTransformed, shouldProcess, compileCssFromClasses, buildStyleTag, generateCssForClasses, eliminateDeadCss, findDeadVariants, runElimination, scanProjectUsage, generateSafelist, loadSafelist, loadTailwindConfig, getContentPaths, _CONTAINER_BREAKPOINTS, runLoaderTransform, shouldSkipFile, fileToRoute, getAllRoutes, getRouteClasses, registerFileClasses, registerGlobalClasses, _incrementalEngineInstance, getIncrementalEngine, resetIncrementalEngine, IncrementalEngine, getBucketEngine, resetBucketEngine, classifyNode, detectConflicts, bucketSort, analyzeFile, analyzeVariantUsage, injectClientDirective, injectServerOnlyComment, analyzeClasses, extractTwStateConfigs, generateStaticStateCss, extractAndGenerateStateCss;
2886
+ var import_node_fs, import_node_path, import_node_module4, _require2, transformSource, hasTwUsage, isAlreadyTransformed, shouldProcess, compileCssFromClasses, buildStyleTag, generateCssForClasses, eliminateDeadCss, findDeadVariants, runElimination, scanProjectUsage, generateSafelist, loadSafelist, loadTailwindConfig, getContentPaths, _CONTAINER_BREAKPOINTS, runLoaderTransform, shouldSkipFile, fileToRoute, getAllRoutes, getRouteClasses, registerFileClasses, registerGlobalClasses, _incrementalEngineInstance, getIncrementalEngine, resetIncrementalEngine, IncrementalEngine, getBucketEngine, resetBucketEngine, classifyNode, detectConflicts, bucketSort, analyzeFile, analyzeVariantUsage, injectClientDirective, injectServerOnlyComment, analyzeClasses, extractTwStateConfigs, generateStaticStateCss, extractAndGenerateStateCss;
2827
2887
  var init_src = __esm({
2828
2888
  "packages/domain/compiler/src/index.ts"() {
2889
+ "use strict";
2890
+ import_node_fs = __toESM(require("fs"), 1);
2891
+ import_node_path = __toESM(require("path"), 1);
2892
+ import_node_module4 = require("module");
2829
2893
  init_nativeBridge();
2830
2894
  init_compiler();
2831
2895
  init_parser();
@@ -2833,7 +2897,9 @@ var init_src = __esm({
2833
2897
  init_cache();
2834
2898
  init_redis();
2835
2899
  init_watch();
2836
- _require2 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href)));
2900
+ _require2 = (0, import_node_module4.createRequire)(
2901
+ typeof require !== "undefined" ? typeof __filename !== "undefined" ? `file://${__filename}` : "file://unknown" : __importMetaUrl
2902
+ );
2837
2903
  transformSource = (source, opts) => {
2838
2904
  const native = getNativeBridge();
2839
2905
  if (!native?.transformSource) {
@@ -2925,7 +2991,7 @@ var init_src = __esm({
2925
2991
  };
2926
2992
  scanProjectUsage = (dirs, cwd) => {
2927
2993
  const { batchExtractClasses: batchExtractClasses2 } = _require2("./parser");
2928
- const files = dirs.map((dir) => path9__namespace.default.resolve(cwd, dir));
2994
+ const files = dirs.map((dir) => import_node_path.default.resolve(cwd, dir));
2929
2995
  const results = batchExtractClasses2(files) || [];
2930
2996
  const combined = {};
2931
2997
  for (const result of results) {
@@ -2942,13 +3008,13 @@ var init_src = __esm({
2942
3008
  const classes = scanProjectUsage(scanDirs, cwd || process.cwd());
2943
3009
  const allClasses = Object.keys(classes).sort();
2944
3010
  if (outputPath) {
2945
- fs3__namespace.default.writeFileSync(outputPath, JSON.stringify(allClasses, null, 2));
3011
+ import_node_fs.default.writeFileSync(outputPath, JSON.stringify(allClasses, null, 2));
2946
3012
  }
2947
3013
  return allClasses;
2948
3014
  };
2949
3015
  loadSafelist = (safelistPath) => {
2950
3016
  try {
2951
- const content = fs3__namespace.default.readFileSync(safelistPath, "utf-8");
3017
+ const content = import_node_fs.default.readFileSync(safelistPath, "utf-8");
2952
3018
  return JSON.parse(content);
2953
3019
  } catch {
2954
3020
  return [];
@@ -2962,9 +3028,9 @@ var init_src = __esm({
2962
3028
  "tailwind.config.cjs"
2963
3029
  ];
2964
3030
  for (const file of configFiles) {
2965
- const fullPath = path9__namespace.default.join(cwd, file);
2966
- if (fs3__namespace.default.existsSync(fullPath)) {
2967
- const mod = __require(fullPath);
3031
+ const fullPath = import_node_path.default.join(cwd, file);
3032
+ if (import_node_fs.default.existsSync(fullPath)) {
3033
+ const mod = require(fullPath);
2968
3034
  return mod.default || mod;
2969
3035
  }
2970
3036
  }
@@ -2973,9 +3039,9 @@ var init_src = __esm({
2973
3039
  getContentPaths = (cwd = process.cwd()) => {
2974
3040
  return {
2975
3041
  content: [
2976
- path9__namespace.default.join(cwd, "src/**/*.{js,ts,jsx,tsx}"),
2977
- path9__namespace.default.join(cwd, "app/**/*.{js,ts,jsx,tsx}"),
2978
- path9__namespace.default.join(cwd, "pages/**/*.{js,ts,jsx,tsx}")
3042
+ import_node_path.default.join(cwd, "src/**/*.{js,ts,jsx,tsx}"),
3043
+ import_node_path.default.join(cwd, "app/**/*.{js,ts,jsx,tsx}"),
3044
+ import_node_path.default.join(cwd, "pages/**/*.{js,ts,jsx,tsx}")
2979
3045
  ]
2980
3046
  };
2981
3047
  };
@@ -3389,6 +3455,7 @@ __export(internal_exports, {
3389
3455
  });
3390
3456
  var init_internal = __esm({
3391
3457
  "packages/domain/compiler/src/internal.ts"() {
3458
+ "use strict";
3392
3459
  init_src();
3393
3460
  init_tailwindEngine2();
3394
3461
  init_compiler();
@@ -3399,6 +3466,8 @@ var init_internal = __esm({
3399
3466
  init_watch();
3400
3467
  }
3401
3468
  });
3469
+
3470
+ // packages/domain/shared/src/staticStateExtractor.ts
3402
3471
  function getNative() {
3403
3472
  if (_native) return _native;
3404
3473
  try {
@@ -3428,17 +3497,17 @@ function getNative() {
3428
3497
  function* walkSourceFiles(dir) {
3429
3498
  let entries;
3430
3499
  try {
3431
- entries = fs3__namespace.default.readdirSync(dir, { withFileTypes: true });
3500
+ entries = import_node_fs2.default.readdirSync(dir, { withFileTypes: true });
3432
3501
  } catch {
3433
3502
  return;
3434
3503
  }
3435
3504
  for (const entry of entries) {
3436
- const fullPath = path9__namespace.default.join(dir, entry.name);
3505
+ const fullPath = import_node_path2.default.join(dir, entry.name);
3437
3506
  if (entry.isDirectory()) {
3438
3507
  if (IGNORE_PATTERNS.some((p) => entry.name === p || entry.name.startsWith(p))) continue;
3439
3508
  yield* walkSourceFiles(fullPath);
3440
3509
  } else if (entry.isFile()) {
3441
- const ext = path9__namespace.default.extname(entry.name);
3510
+ const ext = import_node_path2.default.extname(entry.name);
3442
3511
  if (SOURCE_EXTENSIONS.has(ext)) yield fullPath;
3443
3512
  }
3444
3513
  }
@@ -3502,7 +3571,7 @@ function extractStaticStateCss(srcDir, options = {}) {
3502
3571
  allConfigs.push(...configs);
3503
3572
  if (verbose) {
3504
3573
  process.stderr.write(
3505
- `[tw:static-state] ${path9__namespace.default.relative(srcDir, filePath)}: ${configs.length} komponen
3574
+ `[tw:static-state] ${import_node_path2.default.relative(srcDir, filePath)}: ${configs.length} komponen
3506
3575
  `
3507
3576
  );
3508
3577
  }
@@ -3513,7 +3582,7 @@ function extractStaticStateCss(srcDir, options = {}) {
3513
3582
  if (filesScanned >= maxFiles) break;
3514
3583
  let source;
3515
3584
  try {
3516
- source = fs3__namespace.default.readFileSync(filePath, "utf-8");
3585
+ source = import_node_fs2.default.readFileSync(filePath, "utf-8");
3517
3586
  } catch {
3518
3587
  continue;
3519
3588
  }
@@ -3526,7 +3595,7 @@ function extractStaticStateCss(srcDir, options = {}) {
3526
3595
  allConfigs.push(...configs);
3527
3596
  if (verbose) {
3528
3597
  process.stderr.write(
3529
- `[tw:static-state] ${path9__namespace.default.relative(srcDir, filePath)}: ${configs.length} komponen
3598
+ `[tw:static-state] ${import_node_path2.default.relative(srcDir, filePath)}: ${configs.length} komponen
3530
3599
  `
3531
3600
  );
3532
3601
  }
@@ -3620,12 +3689,12 @@ function appendStaticStateCssToSafelist(srcDir, safelistPath, options = {}) {
3620
3689
  resolvedCss: options.resolvedCss || ""
3621
3690
  // ← ensure always passed
3622
3691
  });
3623
- const twClassesDir = path9__namespace.default.join(path9__namespace.default.dirname(safelistPath), "tw-classes");
3624
- fs3__namespace.default.mkdirSync(twClassesDir, { recursive: true });
3625
- const stateFilePath = path9__namespace.default.join(twClassesDir, TW_STATE_STATIC_FILENAME);
3692
+ const twClassesDir = import_node_path2.default.join(import_node_path2.default.dirname(safelistPath), "tw-classes");
3693
+ import_node_fs2.default.mkdirSync(twClassesDir, { recursive: true });
3694
+ const stateFilePath = import_node_path2.default.join(twClassesDir, TW_STATE_STATIC_FILENAME);
3626
3695
  if (result.rulesGenerated === 0) {
3627
3696
  try {
3628
- fs3__namespace.default.writeFileSync(
3697
+ import_node_fs2.default.writeFileSync(
3629
3698
  stateFilePath,
3630
3699
  "/* tw-state-static.css \u2014 tidak ada state rules yang di-generate */\n",
3631
3700
  "utf-8"
@@ -3635,7 +3704,7 @@ function appendStaticStateCssToSafelist(srcDir, safelistPath, options = {}) {
3635
3704
  return `[tw:static-state] tidak ada state rules yang di-generate (${result.filesScanned} files di-scan)`;
3636
3705
  }
3637
3706
  try {
3638
- fs3__namespace.default.writeFileSync(stateFilePath, result.generatedCss, "utf-8");
3707
+ import_node_fs2.default.writeFileSync(stateFilePath, result.generatedCss, "utf-8");
3639
3708
  return [
3640
3709
  `[tw:static-state] ${result.rulesGenerated} static state rules di-generate`,
3641
3710
  ` \u2192 ${result.filesScanned} files scanned, ${result.filesWithStates} dengan states`,
@@ -3647,15 +3716,20 @@ function appendStaticStateCssToSafelist(srcDir, safelistPath, options = {}) {
3647
3716
  return `[tw:static-state] gagal tulis state CSS: ${msg}`;
3648
3717
  }
3649
3718
  }
3650
- var SOURCE_EXTENSIONS, IGNORE_PATTERNS, _native, TW_STATE_STATIC_FILENAME;
3719
+ var import_node_fs2, import_node_path2, SOURCE_EXTENSIONS, IGNORE_PATTERNS, _native, TW_STATE_STATIC_FILENAME;
3651
3720
  var init_staticStateExtractor = __esm({
3652
3721
  "packages/domain/shared/src/staticStateExtractor.ts"() {
3722
+ "use strict";
3723
+ import_node_fs2 = __toESM(require("fs"));
3724
+ import_node_path2 = __toESM(require("path"));
3653
3725
  SOURCE_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".jsx", ".mts", ".mjs"]);
3654
3726
  IGNORE_PATTERNS = ["node_modules", ".next", "dist", "build", ".git", "coverage", "__tests__"];
3655
3727
  _native = null;
3656
3728
  TW_STATE_STATIC_FILENAME = "_tw-state-static.css";
3657
3729
  }
3658
3730
  });
3731
+
3732
+ // packages/domain/shared/src/logger.ts
3659
3733
  function getEnvLevel() {
3660
3734
  const env = process.env.TWS_LOG_LEVEL?.toLowerCase();
3661
3735
  if (env && env in LEVELS) return env;
@@ -3665,8 +3739,8 @@ function setGlobalLogFile(filePath) {
3665
3739
  _globalLogFile = filePath;
3666
3740
  _logFileInitialized = false;
3667
3741
  try {
3668
- fs3__namespace.default.mkdirSync(path9__namespace.default.dirname(filePath), { recursive: true });
3669
- fs3__namespace.default.writeFileSync(
3742
+ import_node_fs3.default.mkdirSync(import_node_path3.default.dirname(filePath), { recursive: true });
3743
+ import_node_fs3.default.writeFileSync(
3670
3744
  filePath,
3671
3745
  `# tailwind-styled build log \u2014 ${(/* @__PURE__ */ new Date()).toISOString()}
3672
3746
  `,
@@ -3679,13 +3753,13 @@ function setGlobalLogFile(filePath) {
3679
3753
  function writeToFile(line) {
3680
3754
  if (!_globalLogFile || !_logFileInitialized) return;
3681
3755
  try {
3682
- fs3__namespace.default.appendFileSync(_globalLogFile, line);
3756
+ import_node_fs3.default.appendFileSync(_globalLogFile, line);
3683
3757
  } catch {
3684
3758
  }
3685
3759
  }
3686
3760
  function createLogger(prefix, level) {
3687
3761
  const loggerState = {
3688
- currentLevel: getEnvLevel(),
3762
+ currentLevel: level ?? getEnvLevel(),
3689
3763
  setLevel(l) {
3690
3764
  this.currentLevel = l;
3691
3765
  }
@@ -3706,13 +3780,16 @@ function createLogger(prefix, level) {
3706
3780
  setLogFile: (filePath) => setGlobalLogFile(filePath)
3707
3781
  };
3708
3782
  }
3709
- var LEVELS, _globalLogFile, _logFileInitialized;
3783
+ var import_node_fs3, import_node_path3, LEVELS, _globalLogFile, _logFileInitialized, logger;
3710
3784
  var init_logger = __esm({
3711
3785
  "packages/domain/shared/src/logger.ts"() {
3786
+ "use strict";
3787
+ import_node_fs3 = __toESM(require("fs"));
3788
+ import_node_path3 = __toESM(require("path"));
3712
3789
  LEVELS = { silent: 0, error: 1, warn: 2, info: 3, debug: 4 };
3713
3790
  _globalLogFile = null;
3714
3791
  _logFileInitialized = false;
3715
- createLogger("tailwind-styled");
3792
+ logger = createLogger("tailwind-styled");
3716
3793
  }
3717
3794
  });
3718
3795
 
@@ -3833,9 +3910,9 @@ function loadNativeBinding(options) {
3833
3910
  const { runtimeDir, candidates, isValid } = options;
3834
3911
  const loadErrors = [];
3835
3912
  for (const candidate of candidates) {
3836
- const candidatePath = path9__namespace.default.resolve(runtimeDir, candidate);
3913
+ const candidatePath = import_node_path4.default.resolve(runtimeDir, candidate);
3837
3914
  try {
3838
- if (!fs3__namespace.default.existsSync(candidatePath) && !fs3__namespace.default.existsSync(candidatePath + ".node")) {
3915
+ if (!import_node_fs4.default.existsSync(candidatePath) && !import_node_fs4.default.existsSync(candidatePath + ".node")) {
3839
3916
  continue;
3840
3917
  }
3841
3918
  const mod = requireNativeModule(candidatePath);
@@ -3867,9 +3944,9 @@ function resolveNativeBindingCandidates(options) {
3867
3944
  }
3868
3945
  }
3869
3946
  if (!includeDefaultCandidates) return candidates;
3870
- if (fs3__namespace.default.existsSync(runtimeDir)) {
3947
+ if (import_node_fs4.default.existsSync(runtimeDir)) {
3871
3948
  try {
3872
- for (const entry of fs3__namespace.default.readdirSync(runtimeDir)) {
3949
+ for (const entry of import_node_fs4.default.readdirSync(runtimeDir)) {
3873
3950
  if (entry.endsWith(".node")) candidates.push(entry);
3874
3951
  }
3875
3952
  } catch {
@@ -3878,28 +3955,28 @@ function resolveNativeBindingCandidates(options) {
3878
3955
  const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
3879
3956
  const napiPlatform = process.platform === "linux" && process.arch === "x64" ? "linux-x64-gnu" : process.platform === "linux" && process.arch === "arm64" ? "linux-arm64-gnu" : `${process.platform}-${process.arch}`;
3880
3957
  for (const bin of BINARY_NAMES) {
3881
- candidates.push(path9__namespace.default.resolve(runtimeDir, `${bin}.node`));
3882
- candidates.push(path9__namespace.default.resolve(runtimeDir, `${bin}.${napiPlatform}.node`));
3883
- candidates.push(path9__namespace.default.resolve(runtimeDir, "..", "native", `${bin}.node`));
3884
- candidates.push(path9__namespace.default.resolve(runtimeDir, "..", "native", `${bin}.${napiPlatform}.node`));
3885
- candidates.push(path9__namespace.default.resolve(process.cwd(), "native", `${bin}.node`));
3886
- candidates.push(path9__namespace.default.resolve(process.cwd(), "native", `${bin}.${napiPlatform}.node`));
3887
- candidates.push(path9__namespace.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.node`));
3888
- candidates.push(path9__namespace.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.${napiPlatform}.node`));
3889
- candidates.push(path9__namespace.default.resolve(runtimeDir, "..", "..", "..", "native", `${bin}.node`));
3958
+ candidates.push(import_node_path4.default.resolve(runtimeDir, `${bin}.node`));
3959
+ candidates.push(import_node_path4.default.resolve(runtimeDir, `${bin}.${napiPlatform}.node`));
3960
+ candidates.push(import_node_path4.default.resolve(runtimeDir, "..", "native", `${bin}.node`));
3961
+ candidates.push(import_node_path4.default.resolve(runtimeDir, "..", "native", `${bin}.${napiPlatform}.node`));
3962
+ candidates.push(import_node_path4.default.resolve(process.cwd(), "native", `${bin}.node`));
3963
+ candidates.push(import_node_path4.default.resolve(process.cwd(), "native", `${bin}.${napiPlatform}.node`));
3964
+ candidates.push(import_node_path4.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.node`));
3965
+ candidates.push(import_node_path4.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `${bin}.${napiPlatform}.node`));
3966
+ candidates.push(import_node_path4.default.resolve(runtimeDir, "..", "..", "..", "native", `${bin}.node`));
3890
3967
  }
3891
3968
  return Array.from(new Set(candidates));
3892
3969
  }
3893
3970
  function resolveRuntimeDir(dir, importMetaUrl) {
3894
- if (dir) return path9__namespace.default.resolve(dir);
3971
+ if (dir) return import_node_path4.default.resolve(dir);
3895
3972
  try {
3896
- return path9__namespace.default.dirname(url.fileURLToPath(importMetaUrl));
3973
+ return import_node_path4.default.dirname((0, import_node_url.fileURLToPath)(importMetaUrl));
3897
3974
  } catch {
3898
3975
  return process.cwd();
3899
3976
  }
3900
3977
  }
3901
3978
  function hashContent2(content, algorithm = "md5", length) {
3902
- const hash = crypto.createHash(algorithm).update(content).digest("hex");
3979
+ const hash = (0, import_node_crypto.createHash)(algorithm).update(content).digest("hex");
3903
3980
  return length ? hash.slice(0, length) : hash;
3904
3981
  }
3905
3982
  function formatErrorMessage(error) {
@@ -3907,9 +3984,15 @@ function formatErrorMessage(error) {
3907
3984
  if (error instanceof Error) return error.message;
3908
3985
  return String(error);
3909
3986
  }
3910
- var TwError, _require3, LRUCache;
3987
+ var import_node_crypto, import_node_fs4, import_node_path4, import_node_url, import_node_module5, TwError, _require3, LRUCache;
3911
3988
  var init_src2 = __esm({
3912
3989
  "packages/domain/shared/src/index.ts"() {
3990
+ "use strict";
3991
+ import_node_crypto = require("crypto");
3992
+ import_node_fs4 = __toESM(require("fs"));
3993
+ import_node_path4 = __toESM(require("path"));
3994
+ import_node_url = require("url");
3995
+ import_node_module5 = require("module");
3913
3996
  init_trace();
3914
3997
  init_error_codes();
3915
3998
  init_compatibility();
@@ -3975,7 +4058,9 @@ var init_src2 = __esm({
3975
4058
  return `[${this.source.toUpperCase()}:${this.code}] ${this.message}`;
3976
4059
  }
3977
4060
  };
3978
- _require3 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href)));
4061
+ _require3 = (0, import_node_module5.createRequire)(
4062
+ typeof __filename !== "undefined" ? `file://${__filename}` : __importMetaUrl ?? "file://unknown"
4063
+ );
3979
4064
  LRUCache = class {
3980
4065
  capacity;
3981
4066
  cache;
@@ -4053,8 +4138,8 @@ function getDirname2() {
4053
4138
  if (typeof __dirname !== "undefined") {
4054
4139
  return __dirname;
4055
4140
  }
4056
- if (typeof ({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href)) }) !== "undefined" && (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href))) {
4057
- return path9__namespace.default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href))));
4141
+ if (typeof import_meta3 !== "undefined" && __importMetaUrl) {
4142
+ return import_node_path5.default.dirname((0, import_node_url2.fileURLToPath)(__importMetaUrl));
4058
4143
  }
4059
4144
  return process.cwd();
4060
4145
  }
@@ -4259,13 +4344,17 @@ function hasNativeWatchBinding() {
4259
4344
  return false;
4260
4345
  }
4261
4346
  }
4262
- var log2, isValidScannerBinding, createScannerBridgeLoader, scannerBridgeLoader, scannerGetBinding, resetScannerBridgeCache;
4347
+ var import_node_path5, import_node_url2, import_meta3, log2, isValidScannerBinding, createScannerBridgeLoader, scannerBridgeLoader, scannerGetBinding, resetScannerBridgeCache;
4263
4348
  var init_native_bridge = __esm({
4264
4349
  "packages/domain/scanner/src/native-bridge.ts"() {
4350
+ "use strict";
4351
+ import_node_path5 = __toESM(require("path"), 1);
4352
+ import_node_url2 = require("url");
4265
4353
  init_src2();
4354
+ import_meta3 = {};
4266
4355
  log2 = createDebugLogger("scanner:native");
4267
- isValidScannerBinding = (module) => {
4268
- const candidate = module;
4356
+ isValidScannerBinding = (module2) => {
4357
+ const candidate = module2;
4269
4358
  return !!(candidate && (candidate.scanWorkspace || candidate.extractClassesFromSource || candidate.hashFileContent || candidate.cacheRead || candidate.cacheWrite));
4270
4359
  };
4271
4360
  createScannerBridgeLoader = () => {
@@ -4342,13 +4431,15 @@ var init_native_bridge = __esm({
4342
4431
  resetScannerBridgeCache = scannerBridgeLoader.reset;
4343
4432
  }
4344
4433
  });
4434
+
4435
+ // packages/domain/scanner/src/cache-native.ts
4345
4436
  function defaultCachePath(rootDir, cacheDir) {
4346
- const dir = cacheDir ? path9__namespace.default.resolve(rootDir, cacheDir) : path9__namespace.default.join(process.cwd(), ".cache", "tailwind-styled");
4347
- return path9__namespace.default.join(dir, "scanner-cache.json");
4437
+ const dir = cacheDir ? import_node_path6.default.resolve(rootDir, cacheDir) : import_node_path6.default.join(process.cwd(), ".cache", "tailwind-styled");
4438
+ return import_node_path6.default.join(dir, "scanner-cache.json");
4348
4439
  }
4349
4440
  function readCache(rootDir, cacheDir) {
4350
4441
  const cachePath = defaultCachePath(rootDir, cacheDir);
4351
- fs3__namespace.default.mkdirSync(path9__namespace.default.dirname(cachePath), { recursive: true });
4442
+ import_node_fs5.default.mkdirSync(import_node_path6.default.dirname(cachePath), { recursive: true });
4352
4443
  const result = cacheReadNative(cachePath);
4353
4444
  if (!result) return [];
4354
4445
  return result.entries.map((e) => ({
@@ -4363,7 +4454,7 @@ function readCache(rootDir, cacheDir) {
4363
4454
  }
4364
4455
  function writeCache(rootDir, entries, cacheDir) {
4365
4456
  const cachePath = defaultCachePath(rootDir, cacheDir);
4366
- fs3__namespace.default.mkdirSync(path9__namespace.default.dirname(cachePath), { recursive: true });
4457
+ import_node_fs5.default.mkdirSync(import_node_path6.default.dirname(cachePath), { recursive: true });
4367
4458
  const success = cacheWriteNative(cachePath, entries);
4368
4459
  if (!success) {
4369
4460
  throw new Error(
@@ -4382,11 +4473,18 @@ function filePriority(mtimeMs, size, cached, nowMs = Date.now()) {
4382
4473
  nowMs
4383
4474
  );
4384
4475
  }
4476
+ var import_node_fs5, import_node_path6, STALE_THRESHOLD_MS;
4385
4477
  var init_cache_native = __esm({
4386
4478
  "packages/domain/scanner/src/cache-native.ts"() {
4479
+ "use strict";
4480
+ import_node_fs5 = __toESM(require("fs"), 1);
4481
+ import_node_path6 = __toESM(require("path"), 1);
4387
4482
  init_native_bridge();
4483
+ STALE_THRESHOLD_MS = 7 * 24 * 60 * 60 * 1e3;
4388
4484
  }
4389
4485
  });
4486
+
4487
+ // packages/domain/scanner/src/parallel-scanner.ts
4390
4488
  function collectFiles2(rootDir, extensions, ignoreDirs) {
4391
4489
  const native = collectFilesNative(rootDir, extensions, ignoreDirs);
4392
4490
  if (native !== null) return native;
@@ -4404,7 +4502,7 @@ function mergeResults(batchResults) {
4404
4502
  }
4405
4503
  function runChunkInWorker(filePaths) {
4406
4504
  return new Promise((resolve2, reject) => {
4407
- const worker = new worker_threads.Worker(_workerFilename, {
4505
+ const worker = new import_node_worker_threads.Worker(_workerFilename, {
4408
4506
  workerData: { filePaths }
4409
4507
  });
4410
4508
  worker.once("message", (payload) => {
@@ -4424,10 +4522,10 @@ async function scanWorkspaceParallel(rootDir, options = {}) {
4424
4522
  const {
4425
4523
  extensions = DEFAULT_EXTENSIONS,
4426
4524
  ignoreDirs = DEFAULT_IGNORES,
4427
- maxWorkers = Math.max(1, os.availableParallelism() - 1),
4525
+ maxWorkers = Math.max(1, (0, import_node_os.availableParallelism)() - 1),
4428
4526
  chunkSize = DEFAULT_CHUNK_SIZE
4429
4527
  } = options;
4430
- const files = collectFiles2(path9__namespace.default.resolve(rootDir), extensions, ignoreDirs);
4528
+ const files = collectFiles2(import_node_path7.default.resolve(rootDir), extensions, ignoreDirs);
4431
4529
  if (files.length < PARALLEL_THRESHOLD) {
4432
4530
  return mergeResults(batchExtractClassesNative2(files));
4433
4531
  }
@@ -4443,33 +4541,42 @@ async function scanWorkspaceParallel(rootDir, options = {}) {
4443
4541
  }
4444
4542
  return mergeResults(allResults);
4445
4543
  }
4446
- var PARALLEL_THRESHOLD, DEFAULT_CHUNK_SIZE, _workerFilename;
4544
+ var import_node_worker_threads, import_node_path7, import_node_os, import_node_url3, PARALLEL_THRESHOLD, DEFAULT_CHUNK_SIZE, _workerFilename;
4447
4545
  var init_parallel_scanner = __esm({
4448
4546
  "packages/domain/scanner/src/parallel-scanner.ts"() {
4547
+ "use strict";
4548
+ import_node_worker_threads = require("worker_threads");
4549
+ import_node_path7 = __toESM(require("path"), 1);
4550
+ import_node_os = require("os");
4551
+ import_node_url3 = require("url");
4449
4552
  init_src3();
4450
4553
  init_native_bridge();
4451
4554
  PARALLEL_THRESHOLD = 50;
4452
4555
  DEFAULT_CHUNK_SIZE = 150;
4453
- if (!worker_threads.isMainThread && worker_threads.parentPort) {
4454
- const { filePaths } = worker_threads.workerData;
4556
+ if (!import_node_worker_threads.isMainThread && import_node_worker_threads.parentPort) {
4557
+ const { filePaths } = import_node_worker_threads.workerData;
4455
4558
  try {
4456
4559
  const results = batchExtractClassesNative2(filePaths);
4457
4560
  const msg = { ok: true, results };
4458
- worker_threads.parentPort.postMessage(msg);
4561
+ import_node_worker_threads.parentPort.postMessage(msg);
4459
4562
  } catch (error) {
4460
4563
  const msg = {
4461
4564
  ok: false,
4462
4565
  error: error instanceof Error ? error.message : String(error)
4463
4566
  };
4464
- worker_threads.parentPort.postMessage(msg);
4567
+ import_node_worker_threads.parentPort.postMessage(msg);
4465
4568
  }
4466
4569
  }
4467
- _workerFilename = typeof __filename !== "undefined" ? __filename : url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href)));
4570
+ _workerFilename = typeof __filename !== "undefined" ? __filename : (0, import_node_url3.fileURLToPath)(__importMetaUrl);
4468
4571
  }
4469
4572
  });
4470
- var formatIssuePath2, formatIssues, parseWithSchema, NonNegativeIntegerSchema, ScanWorkspaceOptionsSchema, ScanFileResultSchema, ScanWorkspaceResultSchema, ScannerWorkerSuccessMessageSchema, ScannerWorkerErrorMessageSchema, ScannerWorkerMessageSchema, parseScanWorkspaceOptions, parseScanWorkspaceResult, parseScannerWorkerMessage;
4573
+
4574
+ // packages/domain/scanner/src/schemas.ts
4575
+ var import_zod3, formatIssuePath2, formatIssues, parseWithSchema, NonNegativeIntegerSchema, ScanWorkspaceOptionsSchema, ScanFileResultSchema, ScanWorkspaceResultSchema, ScannerWorkerRequestSchema, ScannerWorkerSuccessMessageSchema, ScannerWorkerErrorMessageSchema, ScannerWorkerMessageSchema, parseScanWorkspaceOptions, parseScanWorkspaceResult, parseScannerWorkerMessage;
4471
4576
  var init_schemas = __esm({
4472
4577
  "packages/domain/scanner/src/schemas.ts"() {
4578
+ "use strict";
4579
+ import_zod3 = require("zod");
4473
4580
  init_src2();
4474
4581
  formatIssuePath2 = (path16) => path16.length > 0 ? path16.map(
4475
4582
  (segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
@@ -4489,40 +4596,40 @@ var init_schemas = __esm({
4489
4596
  parsed.error
4490
4597
  );
4491
4598
  };
4492
- NonNegativeIntegerSchema = zod.z.number().int().min(0);
4493
- ScanWorkspaceOptionsSchema = zod.z.object({
4494
- includeExtensions: zod.z.array(zod.z.string()).optional(),
4495
- ignoreDirectories: zod.z.array(zod.z.string()).optional(),
4496
- useCache: zod.z.boolean().optional(),
4497
- cacheDir: zod.z.string().min(1).optional(),
4498
- smartInvalidation: zod.z.boolean().optional()
4599
+ NonNegativeIntegerSchema = import_zod3.z.number().int().min(0);
4600
+ ScanWorkspaceOptionsSchema = import_zod3.z.object({
4601
+ includeExtensions: import_zod3.z.array(import_zod3.z.string()).optional(),
4602
+ ignoreDirectories: import_zod3.z.array(import_zod3.z.string()).optional(),
4603
+ useCache: import_zod3.z.boolean().optional(),
4604
+ cacheDir: import_zod3.z.string().min(1).optional(),
4605
+ smartInvalidation: import_zod3.z.boolean().optional()
4499
4606
  });
4500
- ScanFileResultSchema = zod.z.object({
4501
- file: zod.z.string(),
4502
- classes: zod.z.array(zod.z.string()),
4503
- hash: zod.z.string().optional()
4607
+ ScanFileResultSchema = import_zod3.z.object({
4608
+ file: import_zod3.z.string(),
4609
+ classes: import_zod3.z.array(import_zod3.z.string()),
4610
+ hash: import_zod3.z.string().optional()
4504
4611
  });
4505
- ScanWorkspaceResultSchema = zod.z.object({
4506
- files: zod.z.array(ScanFileResultSchema),
4612
+ ScanWorkspaceResultSchema = import_zod3.z.object({
4613
+ files: import_zod3.z.array(ScanFileResultSchema),
4507
4614
  totalFiles: NonNegativeIntegerSchema,
4508
- uniqueClasses: zod.z.array(zod.z.string())
4615
+ uniqueClasses: import_zod3.z.array(import_zod3.z.string())
4509
4616
  }).refine((value) => value.totalFiles === value.files.length, {
4510
4617
  message: "scan result totalFiles must match files.length",
4511
4618
  path: ["totalFiles"]
4512
4619
  });
4513
- zod.z.object({
4514
- rootDir: zod.z.string().min(1),
4620
+ ScannerWorkerRequestSchema = import_zod3.z.object({
4621
+ rootDir: import_zod3.z.string().min(1),
4515
4622
  options: ScanWorkspaceOptionsSchema.optional()
4516
4623
  });
4517
- ScannerWorkerSuccessMessageSchema = zod.z.object({
4518
- ok: zod.z.literal(true),
4624
+ ScannerWorkerSuccessMessageSchema = import_zod3.z.object({
4625
+ ok: import_zod3.z.literal(true),
4519
4626
  result: ScanWorkspaceResultSchema
4520
4627
  });
4521
- ScannerWorkerErrorMessageSchema = zod.z.object({
4522
- ok: zod.z.literal(false),
4523
- error: zod.z.string().optional()
4628
+ ScannerWorkerErrorMessageSchema = import_zod3.z.object({
4629
+ ok: import_zod3.z.literal(false),
4630
+ error: import_zod3.z.string().optional()
4524
4631
  });
4525
- ScannerWorkerMessageSchema = zod.z.union([
4632
+ ScannerWorkerMessageSchema = import_zod3.z.union([
4526
4633
  ScannerWorkerSuccessMessageSchema,
4527
4634
  ScannerWorkerErrorMessageSchema
4528
4635
  ]);
@@ -4552,8 +4659,8 @@ function getRuntimeDir() {
4552
4659
  if (typeof __dirname !== "undefined" && __dirname.length > 0) {
4553
4660
  return __dirname;
4554
4661
  }
4555
- if (typeof ({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href)) }) !== "undefined" && (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href))) {
4556
- return path9__namespace.default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href))));
4662
+ if (typeof import_meta4 !== "undefined" && __importMetaUrl) {
4663
+ return import_node_path8.default.dirname((0, import_node_url4.fileURLToPath)(__importMetaUrl));
4557
4664
  }
4558
4665
  return process.cwd();
4559
4666
  }
@@ -4562,18 +4669,18 @@ function resolveScannerWorkerModulePath() {
4562
4669
  if (typeof __dirname !== "undefined" && __dirname.length > 0) {
4563
4670
  return __dirname;
4564
4671
  }
4565
- if (typeof ({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href)) }) !== "undefined" && (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href))) {
4566
- return path9__namespace.default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href))));
4672
+ if (typeof import_meta4 !== "undefined" && __importMetaUrl) {
4673
+ return import_node_path8.default.dirname((0, import_node_url4.fileURLToPath)(__importMetaUrl));
4567
4674
  }
4568
4675
  return process.cwd();
4569
4676
  })();
4570
4677
  const candidates = [
4571
- path9__namespace.default.resolve(runtimeDir, "worker.cjs"),
4572
- path9__namespace.default.resolve(runtimeDir, "worker.js"),
4573
- path9__namespace.default.resolve(runtimeDir, "worker.ts")
4678
+ import_node_path8.default.resolve(runtimeDir, "worker.cjs"),
4679
+ import_node_path8.default.resolve(runtimeDir, "worker.js"),
4680
+ import_node_path8.default.resolve(runtimeDir, "worker.ts")
4574
4681
  ];
4575
4682
  for (const candidate of candidates) {
4576
- if (fs3__namespace.default.existsSync(candidate)) return candidate;
4683
+ if (import_node_fs6.default.existsSync(candidate)) return candidate;
4577
4684
  }
4578
4685
  return null;
4579
4686
  }
@@ -4585,7 +4692,7 @@ function scanWorkspaceInWorker(rootDir, options) {
4585
4692
  }
4586
4693
  return new Promise((resolve2, reject) => {
4587
4694
  const settleState = { settled: false };
4588
- const worker = new worker_threads.Worker(modulePath, { workerData: { rootDir, options: normalizedOptions } });
4695
+ const worker = new import_node_worker_threads2.Worker(modulePath, { workerData: { rootDir, options: normalizedOptions } });
4589
4696
  const timeout = setTimeout(() => {
4590
4697
  if (!settleState.settled) {
4591
4698
  settleState.settled = true;
@@ -4630,19 +4737,19 @@ function collectCandidates(rootDir, ignoreDirectories, extensionSet) {
4630
4737
  if (!currentDir) continue;
4631
4738
  const entries = (() => {
4632
4739
  try {
4633
- return fs3__namespace.default.readdirSync(currentDir, { withFileTypes: true });
4740
+ return import_node_fs6.default.readdirSync(currentDir, { withFileTypes: true });
4634
4741
  } catch {
4635
4742
  return [];
4636
4743
  }
4637
4744
  })();
4638
4745
  for (const entry of entries) {
4639
- const fullPath = path9__namespace.default.join(currentDir, entry.name);
4746
+ const fullPath = import_node_path8.default.join(currentDir, entry.name);
4640
4747
  if (entry.isDirectory()) {
4641
4748
  if (!ignoreDirectories.has(entry.name)) directories.push(fullPath);
4642
4749
  continue;
4643
4750
  }
4644
4751
  if (!entry.isFile()) continue;
4645
- if (!extensionSet.has(path9__namespace.default.extname(entry.name))) continue;
4752
+ if (!extensionSet.has(import_node_path8.default.extname(entry.name))) continue;
4646
4753
  candidates.push(fullPath);
4647
4754
  }
4648
4755
  }
@@ -4669,7 +4776,7 @@ function scanSource(source) {
4669
4776
  );
4670
4777
  }
4671
4778
  function isScannableFile2(filePath, includeExtensions = DEFAULT_EXTENSIONS) {
4672
- return includeExtensions.includes(path9__namespace.default.extname(filePath));
4779
+ return includeExtensions.includes(import_node_path8.default.extname(filePath));
4673
4780
  }
4674
4781
  function scanFile2(filePath) {
4675
4782
  const { scanFileNative: scanFileNative3 } = (init_native_bridge(), __toCommonJS(native_bridge_exports));
@@ -4689,7 +4796,7 @@ function scanWorkspace2(rootDir, options = {}) {
4689
4796
  const extensionSet = buildExtensionSet(includeExtensions);
4690
4797
  const ignoreDirectories = new Set(normalizedOptions.ignoreDirectories ?? DEFAULT_IGNORES);
4691
4798
  const useCache = normalizedOptions.useCache ?? true;
4692
- normalizedOptions.smartInvalidation ?? true;
4799
+ const _smartInvalidation = normalizedOptions.smartInvalidation ?? true;
4693
4800
  const files = [];
4694
4801
  const unique = /* @__PURE__ */ new Set();
4695
4802
  const candidates = collectCandidates(rootDir, ignoreDirectories, extensionSet);
@@ -4729,7 +4836,7 @@ function scanWorkspace2(rootDir, options = {}) {
4729
4836
  for (const filePath of candidates) {
4730
4837
  const stat = (() => {
4731
4838
  try {
4732
- return fs3__namespace.default.statSync(filePath);
4839
+ return import_node_fs6.default.statSync(filePath);
4733
4840
  } catch {
4734
4841
  return null;
4735
4842
  }
@@ -4755,7 +4862,7 @@ function scanWorkspace2(rootDir, options = {}) {
4755
4862
  for (const { filePath, stat, size, cached } of ranked) {
4756
4863
  const content = (() => {
4757
4864
  try {
4758
- return fs3__namespace.default.readFileSync(filePath, "utf8");
4865
+ return import_node_fs6.default.readFileSync(filePath, "utf8");
4759
4866
  } catch {
4760
4867
  return null;
4761
4868
  }
@@ -4836,9 +4943,15 @@ async function scanWorkspaceAsync(rootDir, options = {}) {
4836
4943
  return scanWorkspace2(rootDir, normalizedOptions);
4837
4944
  }
4838
4945
  }
4839
- var log3, SCAN_WORKER_TIMEOUT_MS, createNativeParserLoader, nativeParserLoader, DEFAULT_EXTENSIONS, DEFAULT_IGNORES;
4946
+ var import_node_fs6, import_node_module6, import_node_path8, import_node_url4, import_node_worker_threads2, import_meta4, log3, SCAN_WORKER_TIMEOUT_MS, createNativeParserLoader, nativeParserLoader, DEFAULT_EXTENSIONS, DEFAULT_IGNORES;
4840
4947
  var init_src3 = __esm({
4841
4948
  "packages/domain/scanner/src/index.ts"() {
4949
+ "use strict";
4950
+ import_node_fs6 = __toESM(require("fs"), 1);
4951
+ import_node_module6 = require("module");
4952
+ import_node_path8 = __toESM(require("path"), 1);
4953
+ import_node_url4 = require("url");
4954
+ import_node_worker_threads2 = require("worker_threads");
4842
4955
  init_src2();
4843
4956
  init_cache_native();
4844
4957
  init_native_bridge();
@@ -4846,6 +4959,7 @@ var init_src3 = __esm({
4846
4959
  init_schemas();
4847
4960
  init_schemas();
4848
4961
  init_native_bridge();
4962
+ import_meta4 = {};
4849
4963
  log3 = createLogger2("scanner");
4850
4964
  SCAN_WORKER_TIMEOUT_MS = 12e4;
4851
4965
  createNativeParserLoader = () => {
@@ -4859,7 +4973,7 @@ var init_src3 = __esm({
4859
4973
  const loadNativeParserBinding = () => {
4860
4974
  if (_state.binding !== void 0) return _state.binding;
4861
4975
  const runtimeDir = getRuntimeDir();
4862
- const req = module$1.createRequire(path9__namespace.default.join(runtimeDir, "noop.cjs"));
4976
+ const req = (0, import_node_module6.createRequire)(import_node_path8.default.join(runtimeDir, "noop.cjs"));
4863
4977
  const _platform = process.platform;
4864
4978
  const _arch = process.arch;
4865
4979
  const _platformArch = `${_platform}-${_arch}`;
@@ -4867,27 +4981,27 @@ var init_src3 = __esm({
4867
4981
  const candidates = [
4868
4982
  // ── binaryName baru: tailwind-styled-native (napi-rs naming) ──
4869
4983
  // cwd = repo root saat run dari root, atau package dir saat workspaces
4870
- path9__namespace.default.resolve(process.cwd(), "native", "tailwind-styled-native.node"),
4871
- path9__namespace.default.resolve(process.cwd(), "native", `tailwind-styled-native.${_platformArch}.node`),
4872
- path9__namespace.default.resolve(process.cwd(), "native", `tailwind-styled-native.${_platformArchGnu}.node`),
4984
+ import_node_path8.default.resolve(process.cwd(), "native", "tailwind-styled-native.node"),
4985
+ import_node_path8.default.resolve(process.cwd(), "native", `tailwind-styled-native.${_platformArch}.node`),
4986
+ import_node_path8.default.resolve(process.cwd(), "native", `tailwind-styled-native.${_platformArchGnu}.node`),
4873
4987
  // runtimeDir = dist/ → naik 1 level ke package root (npm install case)
4874
4988
  // e.g. node_modules/tailwind-styled-v4/dist/ → node_modules/tailwind-styled-v4/native/
4875
- path9__namespace.default.resolve(runtimeDir, "..", "native", "tailwind-styled-native.node"),
4876
- path9__namespace.default.resolve(runtimeDir, "..", "native", `tailwind-styled-native.${_platformArch}.node`),
4877
- path9__namespace.default.resolve(runtimeDir, "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
4989
+ import_node_path8.default.resolve(runtimeDir, "..", "native", "tailwind-styled-native.node"),
4990
+ import_node_path8.default.resolve(runtimeDir, "..", "native", `tailwind-styled-native.${_platformArch}.node`),
4991
+ import_node_path8.default.resolve(runtimeDir, "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
4878
4992
  // runtimeDir = dist/ → naik 4 level ke repo root (monorepo dev case)
4879
- path9__namespace.default.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind-styled-native.node"),
4880
- path9__namespace.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
4993
+ import_node_path8.default.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind-styled-native.node"),
4994
+ import_node_path8.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
4881
4995
  // 3 level fallback (jika package di-nest lebih dangkal)
4882
- path9__namespace.default.resolve(runtimeDir, "..", "..", "..", "native", "tailwind-styled-native.node"),
4883
- path9__namespace.default.resolve(runtimeDir, "..", "..", "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
4996
+ import_node_path8.default.resolve(runtimeDir, "..", "..", "..", "native", "tailwind-styled-native.node"),
4997
+ import_node_path8.default.resolve(runtimeDir, "..", "..", "..", "native", `tailwind-styled-native.${_platformArchGnu}.node`),
4884
4998
  // ── binaryName lama: tailwind_styled_parser (backward compat) ──
4885
- path9__namespace.default.resolve(process.cwd(), "native/tailwind_styled_parser.node"),
4886
- path9__namespace.default.resolve(process.cwd(), "native/build/Release/tailwind_styled_parser.node"),
4887
- path9__namespace.default.resolve(runtimeDir, "..", "native", "tailwind_styled_parser.node"),
4888
- path9__namespace.default.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind_styled_parser.node"),
4889
- path9__namespace.default.resolve(runtimeDir, "..", "..", "..", "native", "tailwind_styled_parser.node"),
4890
- path9__namespace.default.resolve(
4999
+ import_node_path8.default.resolve(process.cwd(), "native/tailwind_styled_parser.node"),
5000
+ import_node_path8.default.resolve(process.cwd(), "native/build/Release/tailwind_styled_parser.node"),
5001
+ import_node_path8.default.resolve(runtimeDir, "..", "native", "tailwind_styled_parser.node"),
5002
+ import_node_path8.default.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind_styled_parser.node"),
5003
+ import_node_path8.default.resolve(runtimeDir, "..", "..", "..", "native", "tailwind_styled_parser.node"),
5004
+ import_node_path8.default.resolve(
4891
5005
  runtimeDir,
4892
5006
  "..",
4893
5007
  "..",
@@ -4899,7 +5013,7 @@ var init_src3 = __esm({
4899
5013
  )
4900
5014
  ];
4901
5015
  for (const fullPath of candidates) {
4902
- if (!fs3__namespace.default.existsSync(fullPath)) continue;
5016
+ if (!import_node_fs6.default.existsSync(fullPath)) continue;
4903
5017
  try {
4904
5018
  const required = req(fullPath);
4905
5019
  if (required && (typeof required.extractClassesFromSource === "function" || typeof required.parseClasses === "function" || typeof required.parse_classes === "function")) {
@@ -4935,21 +5049,23 @@ var init_src3 = __esm({
4935
5049
  // packages/domain/engine/src/native-bridge.ts
4936
5050
  function getDirname3() {
4937
5051
  if (typeof __dirname !== "undefined") return __dirname;
4938
- if (typeof ({ url: (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href)) }) !== "undefined" && (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href))) {
4939
- return getDirname((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href)));
5052
+ if (typeof import_meta5 !== "undefined" && __importMetaUrl) {
5053
+ return getDirname(__importMetaUrl);
4940
5054
  }
4941
5055
  return process.cwd();
4942
5056
  }
4943
5057
  function getNativeEngineBinding() {
4944
5058
  return engineBindingLoader.get();
4945
5059
  }
4946
- var log4, isValidEngineBinding, createEngineBindingLoader, engineBindingLoader;
5060
+ var import_meta5, log4, isValidEngineBinding, createEngineBindingLoader, engineBindingLoader;
4947
5061
  var init_native_bridge2 = __esm({
4948
5062
  "packages/domain/engine/src/native-bridge.ts"() {
5063
+ "use strict";
4949
5064
  init_src2();
5065
+ import_meta5 = {};
4950
5066
  log4 = createDebugLogger("engine:native");
4951
- isValidEngineBinding = (module) => {
4952
- const candidate = module;
5067
+ isValidEngineBinding = (module2) => {
5068
+ const candidate = module2;
4953
5069
  return !!(candidate && (candidate.computeIncrementalDiff || candidate.processFileChange || candidate.hashFileContent));
4954
5070
  };
4955
5071
  createEngineBindingLoader = () => {
@@ -5066,11 +5182,12 @@ function createResolutionReason(causes, finalDecision) {
5066
5182
  finalDecision
5067
5183
  };
5068
5184
  }
5069
- exports.RuleId = void 0; exports.SelectorId = void 0; exports.VariantChainId = void 0; exports.PropertyId = void 0; exports.ValueId = void 0; exports.LayerId = void 0; exports.ConditionId = void 0; exports.CascadeResolutionId = void 0; exports.Origin = void 0; exports.Importance = void 0; exports.ConditionResult = void 0; exports.CascadeStage = void 0;
5185
+ var RuleId, SelectorId, VariantChainId, PropertyId, ValueId, LayerId, ConditionId, CascadeResolutionId, Origin, Importance, ConditionResult, CascadeStage;
5070
5186
  var init_ir = __esm({
5071
5187
  "packages/domain/engine/src/ir.ts"() {
5188
+ "use strict";
5072
5189
  init_native_bridge2();
5073
- exports.RuleId = class {
5190
+ RuleId = class {
5074
5191
  constructor(value) {
5075
5192
  this.value = value;
5076
5193
  }
@@ -5079,7 +5196,7 @@ var init_ir = __esm({
5079
5196
  return `R${this.value}`;
5080
5197
  }
5081
5198
  };
5082
- exports.SelectorId = class {
5199
+ SelectorId = class {
5083
5200
  constructor(value) {
5084
5201
  this.value = value;
5085
5202
  }
@@ -5088,7 +5205,7 @@ var init_ir = __esm({
5088
5205
  return `S${this.value}`;
5089
5206
  }
5090
5207
  };
5091
- exports.VariantChainId = class {
5208
+ VariantChainId = class {
5092
5209
  constructor(value) {
5093
5210
  this.value = value;
5094
5211
  }
@@ -5097,7 +5214,7 @@ var init_ir = __esm({
5097
5214
  return `V${this.value}`;
5098
5215
  }
5099
5216
  };
5100
- exports.PropertyId = class {
5217
+ PropertyId = class {
5101
5218
  constructor(value, name) {
5102
5219
  this.value = value;
5103
5220
  this.name = name;
@@ -5112,7 +5229,7 @@ var init_ir = __esm({
5112
5229
  return propertyIdToString2(this);
5113
5230
  }
5114
5231
  };
5115
- exports.ValueId = class {
5232
+ ValueId = class {
5116
5233
  constructor(value, name) {
5117
5234
  this.value = value;
5118
5235
  this.name = name;
@@ -5127,7 +5244,7 @@ var init_ir = __esm({
5127
5244
  return valueIdToString2(this);
5128
5245
  }
5129
5246
  };
5130
- exports.LayerId = class {
5247
+ LayerId = class {
5131
5248
  constructor(value) {
5132
5249
  this.value = value;
5133
5250
  }
@@ -5136,7 +5253,7 @@ var init_ir = __esm({
5136
5253
  return `L${this.value}`;
5137
5254
  }
5138
5255
  };
5139
- exports.ConditionId = class {
5256
+ ConditionId = class {
5140
5257
  constructor(value) {
5141
5258
  this.value = value;
5142
5259
  }
@@ -5145,7 +5262,7 @@ var init_ir = __esm({
5145
5262
  return `C${this.value}`;
5146
5263
  }
5147
5264
  };
5148
- exports.CascadeResolutionId = class {
5265
+ CascadeResolutionId = class {
5149
5266
  constructor(value) {
5150
5267
  this.value = value;
5151
5268
  }
@@ -5154,40 +5271,40 @@ var init_ir = __esm({
5154
5271
  return `R${this.value}`;
5155
5272
  }
5156
5273
  };
5157
- exports.Origin = /* @__PURE__ */ ((Origin2) => {
5274
+ Origin = /* @__PURE__ */ ((Origin2) => {
5158
5275
  Origin2[Origin2["UserAgent"] = 0] = "UserAgent";
5159
5276
  Origin2[Origin2["UserNormal"] = 1] = "UserNormal";
5160
5277
  Origin2[Origin2["AuthorNormal"] = 2] = "AuthorNormal";
5161
5278
  Origin2[Origin2["AuthorImportant"] = 3] = "AuthorImportant";
5162
5279
  Origin2[Origin2["UserImportant"] = 4] = "UserImportant";
5163
5280
  return Origin2;
5164
- })(exports.Origin || {});
5165
- exports.Importance = /* @__PURE__ */ ((Importance2) => {
5281
+ })(Origin || {});
5282
+ Importance = /* @__PURE__ */ ((Importance2) => {
5166
5283
  Importance2[Importance2["Normal"] = 0] = "Normal";
5167
5284
  Importance2[Importance2["Important"] = 1] = "Important";
5168
5285
  return Importance2;
5169
- })(exports.Importance || {});
5170
- exports.ConditionResult = /* @__PURE__ */ ((ConditionResult2) => {
5286
+ })(Importance || {});
5287
+ ConditionResult = /* @__PURE__ */ ((ConditionResult2) => {
5171
5288
  ConditionResult2[ConditionResult2["Active"] = 0] = "Active";
5172
5289
  ConditionResult2[ConditionResult2["Inactive"] = 1] = "Inactive";
5173
5290
  ConditionResult2[ConditionResult2["Unknown"] = 2] = "Unknown";
5174
5291
  return ConditionResult2;
5175
- })(exports.ConditionResult || {});
5176
- exports.CascadeStage = /* @__PURE__ */ ((CascadeStage2) => {
5292
+ })(ConditionResult || {});
5293
+ CascadeStage = /* @__PURE__ */ ((CascadeStage2) => {
5177
5294
  CascadeStage2[CascadeStage2["Origin"] = 0] = "Origin";
5178
5295
  CascadeStage2[CascadeStage2["Layer"] = 1] = "Layer";
5179
5296
  CascadeStage2[CascadeStage2["Importance"] = 2] = "Importance";
5180
5297
  CascadeStage2[CascadeStage2["Specificity"] = 3] = "Specificity";
5181
5298
  CascadeStage2[CascadeStage2["Order"] = 4] = "Order";
5182
5299
  return CascadeStage2;
5183
- })(exports.CascadeStage || {});
5300
+ })(CascadeStage || {});
5184
5301
  }
5185
5302
  });
5186
5303
 
5187
5304
  // packages/domain/engine/src/resolver.ts
5188
5305
  var resolver_exports = {};
5189
5306
  __export(resolver_exports, {
5190
- CascadeResolver: () => exports.CascadeResolver
5307
+ CascadeResolver: () => CascadeResolver
5191
5308
  });
5192
5309
  function toNativeInput(rule) {
5193
5310
  return {
@@ -5227,7 +5344,7 @@ function buildResolutionsMap(nativeResult, rules, styleGraph) {
5227
5344
  const existing = styleGraph.ruleConflicts.get(winner) ?? [];
5228
5345
  styleGraph.ruleConflicts.set(winner, [...existing, ...losers.filter((l) => !existing.some((e) => e.value === l.value))]);
5229
5346
  resolvedProperties.set(propertyId, {
5230
- id: new exports.CascadeResolutionId(res.id),
5347
+ id: new CascadeResolutionId(res.id),
5231
5348
  property: propertyId,
5232
5349
  winner,
5233
5350
  losers,
@@ -5237,12 +5354,13 @@ function buildResolutionsMap(nativeResult, rules, styleGraph) {
5237
5354
  }
5238
5355
  return resolvedProperties;
5239
5356
  }
5240
- exports.CascadeResolver = void 0;
5357
+ var CascadeResolver;
5241
5358
  var init_resolver = __esm({
5242
5359
  "packages/domain/engine/src/resolver.ts"() {
5360
+ "use strict";
5243
5361
  init_ir();
5244
5362
  init_native_bridge2();
5245
- exports.CascadeResolver = class {
5363
+ CascadeResolver = class {
5246
5364
  rules = /* @__PURE__ */ new Map();
5247
5365
  classRules = /* @__PURE__ */ new Map();
5248
5366
  styleGraph = { ruleConflicts: /* @__PURE__ */ new Map() };
@@ -5328,20 +5446,20 @@ function createIdGenerator() {
5328
5446
  insertionOrderCounter: 0
5329
5447
  };
5330
5448
  return {
5331
- generateRuleId: () => new exports.RuleId(state.ruleIdCounter++),
5332
- generateSelectorId: () => new exports.SelectorId(state.selectorIdCounter++),
5449
+ generateRuleId: () => new RuleId(state.ruleIdCounter++),
5450
+ generateSelectorId: () => new SelectorId(state.selectorIdCounter++),
5333
5451
  generatePropertyId: (name) => {
5334
- const id = new exports.PropertyId(state.propertyIdCounter++);
5452
+ const id = new PropertyId(state.propertyIdCounter++);
5335
5453
  registerPropertyName2(id, name);
5336
5454
  return id;
5337
5455
  },
5338
5456
  generateValueId: (name) => {
5339
- const id = new exports.ValueId(state.valueIdCounter++);
5457
+ const id = new ValueId(state.valueIdCounter++);
5340
5458
  registerValueName2(id, name);
5341
5459
  return id;
5342
5460
  },
5343
- generateLayerId: () => new exports.LayerId(state.layerIdCounter++),
5344
- generateConditionId: () => new exports.ConditionId(state.conditionIdCounter++),
5461
+ generateLayerId: () => new LayerId(state.layerIdCounter++),
5462
+ generateConditionId: () => new ConditionId(state.conditionIdCounter++),
5345
5463
  getNextInsertionOrder: () => state.insertionOrderCounter++,
5346
5464
  reset: () => {
5347
5465
  state.ruleIdCounter = 0;
@@ -5379,13 +5497,13 @@ function _parseCssToIrFast(assembled) {
5379
5497
  layerMap.clear();
5380
5498
  layerOrderMap.clear();
5381
5499
  for (const le of assembled.layers) {
5382
- const lid = new exports.LayerId(le.layerId);
5500
+ const lid = new LayerId(le.layerId);
5383
5501
  layerMap.set(le.name, lid);
5384
5502
  layerOrderMap.set(le.name, le.order);
5385
5503
  }
5386
5504
  const rules = assembled.rules.map((r) => {
5387
- const propertyId = new exports.PropertyId(r.propertyId);
5388
- const valueId = new exports.ValueId(r.valueId);
5505
+ const propertyId = new PropertyId(r.propertyId);
5506
+ const valueId = new ValueId(r.valueId);
5389
5507
  if (native?.registerPropertyName) {
5390
5508
  native.registerPropertyName(r.propertyId, r.propertyName);
5391
5509
  } else {
@@ -5397,17 +5515,17 @@ function _parseCssToIrFast(assembled) {
5397
5515
  registerValueName2(valueId, r.valueName);
5398
5516
  }
5399
5517
  return {
5400
- id: new exports.RuleId(r.ruleId),
5401
- selector: new exports.SelectorId(r.selectorId),
5402
- variantChain: new exports.VariantChainId(0),
5518
+ id: new RuleId(r.ruleId),
5519
+ selector: new SelectorId(r.selectorId),
5520
+ variantChain: new VariantChainId(0),
5403
5521
  property: propertyId,
5404
5522
  value: valueId,
5405
5523
  origin: r.origin,
5406
5524
  importance: r.importance,
5407
- layer: r.layerId >= 0 ? new exports.LayerId(r.layerId) : null,
5525
+ layer: r.layerId >= 0 ? new LayerId(r.layerId) : null,
5408
5526
  layerOrder: r.layerOrder,
5409
5527
  specificity: r.specificity,
5410
- condition: r.conditionId >= 0 ? new exports.ConditionId(r.conditionId) : null,
5528
+ condition: r.conditionId >= 0 ? new ConditionId(r.conditionId) : null,
5411
5529
  conditionResult: r.conditionResult,
5412
5530
  insertionOrder: r.insertionOrder,
5413
5531
  fingerprint: r.fingerprint,
@@ -5417,7 +5535,7 @@ function _parseCssToIrFast(assembled) {
5417
5535
  const classToRuleIds = new Map(
5418
5536
  assembled.classToRuleIds.map((m) => [
5419
5537
  m.className,
5420
- m.ruleIds.map((id) => new exports.RuleId(id))
5538
+ m.ruleIds.map((id) => new RuleId(id))
5421
5539
  ])
5422
5540
  );
5423
5541
  return { rules, classToRuleIds };
@@ -5434,7 +5552,7 @@ function _parseCssToIrFallback(css, prefix, native) {
5434
5552
  const parsed = native.parseCssRules(css);
5435
5553
  for (const r of parsed) {
5436
5554
  const className = prefix + r.className;
5437
- r.variants.length > 0;
5555
+ const hasVariants = r.variants.length > 0;
5438
5556
  const layerName = detectLayerFromClassName(className);
5439
5557
  const layer = layerName ? getOrCreateLayerId(layerName) : null;
5440
5558
  const layerOrder = layerName ? layerOrderMap.get(layerName) ?? 4 : 4;
@@ -5449,7 +5567,7 @@ function _parseCssToIrFallback(css, prefix, native) {
5449
5567
  const rule = {
5450
5568
  id: ruleId,
5451
5569
  selector: selectorId,
5452
- variantChain: new exports.VariantChainId(0),
5570
+ variantChain: new VariantChainId(0),
5453
5571
  property: propertyId,
5454
5572
  value: valueId,
5455
5573
  origin: 2 /* AuthorNormal */,
@@ -5473,6 +5591,7 @@ function _parseCssToIrFallback(css, prefix, native) {
5473
5591
  var _defaultIdGen, generateRuleId, generateSelectorId, generatePropertyId, generateValueId, generateLayerId, generateConditionId, getNextInsertionOrder, resetIdGenerator, layerMap, layerOrderMap, LAYER_ORDER;
5474
5592
  var init_cssToIr = __esm({
5475
5593
  "packages/domain/engine/src/cssToIr.ts"() {
5594
+ "use strict";
5476
5595
  init_native_bridge2();
5477
5596
  init_ir();
5478
5597
  _defaultIdGen = createIdGenerator();
@@ -5578,7 +5697,7 @@ function trace(className, resolver) {
5578
5697
  property,
5579
5698
  winner: winnerRule?.value.toString() ?? "",
5580
5699
  loser: loserRule.value.toString(),
5581
- stage: exports.CascadeStage[resolution.stage],
5700
+ stage: CascadeStage[resolution.stage],
5582
5701
  causes: resolution.reason.causes.map(formatCause)
5583
5702
  });
5584
5703
  }
@@ -5605,17 +5724,77 @@ function trace(className, resolver) {
5605
5724
  }
5606
5725
  var init_trace2 = __esm({
5607
5726
  "packages/domain/engine/src/trace.ts"() {
5727
+ "use strict";
5608
5728
  init_ir();
5609
5729
  }
5610
5730
  });
5611
5731
 
5732
+ // src/umbrella/engine.ts
5733
+ var engine_exports = {};
5734
+ __export(engine_exports, {
5735
+ BuildResultSchema: () => BuildResultSchema,
5736
+ BundleAnalyzer: () => BundleAnalyzer,
5737
+ CascadeResolutionId: () => CascadeResolutionId,
5738
+ CascadeResolver: () => CascadeResolver,
5739
+ CascadeStage: () => CascadeStage,
5740
+ ConditionId: () => ConditionId,
5741
+ ConditionResult: () => ConditionResult,
5742
+ EngineMetricsCollector: () => EngineMetricsCollector,
5743
+ EngineOptionsSchema: () => EngineOptionsSchema,
5744
+ EngineWatchOptionsSchema: () => EngineWatchOptionsSchema,
5745
+ ImpactTracker: () => ImpactTracker,
5746
+ Importance: () => Importance,
5747
+ LayerId: () => LayerId,
5748
+ Origin: () => Origin,
5749
+ PropertyId: () => PropertyId,
5750
+ ReverseLookup: () => ReverseLookup,
5751
+ RuleId: () => RuleId,
5752
+ SelectorId: () => SelectorId,
5753
+ ValueId: () => ValueId,
5754
+ VariantChainId: () => VariantChainId,
5755
+ analyzeWorkspace: () => analyzeWorkspace2,
5756
+ applyIncrementalChange: () => applyIncrementalChange,
5757
+ build: () => build,
5758
+ buildProvenanceChain: () => buildProvenanceChain,
5759
+ createEngine: () => createEngine,
5760
+ createFingerprint: () => createFingerprint2,
5761
+ createResolutionReason: () => createResolutionReason,
5762
+ generateSafelist: () => generateSafelist2,
5763
+ inspectClass: () => inspectClass,
5764
+ parseCssToIr: () => parseCssToIr,
5765
+ parseEngineOptions: () => parseEngineOptions,
5766
+ parseEngineWatchOptions: () => parseEngineWatchOptions,
5767
+ runAfterBuild: () => runAfterBuild,
5768
+ runAfterScan: () => runAfterScan,
5769
+ runAfterWatch: () => runAfterWatch,
5770
+ runBeforeBuild: () => runBeforeBuild,
5771
+ runBeforeScan: () => runBeforeScan,
5772
+ runBeforeWatch: () => runBeforeWatch,
5773
+ runOnError: () => runOnError,
5774
+ runTransformClasses: () => runTransformClasses,
5775
+ scanWorkspace: () => scanWorkspace3,
5776
+ trace: () => trace,
5777
+ traceClass: () => traceClass,
5778
+ traceClasses: () => traceClasses,
5779
+ watchWorkspaceLegacy: () => watchWorkspace,
5780
+ watchWorkspaceNative: () => watchWorkspace2
5781
+ });
5782
+ module.exports = __toCommonJS(engine_exports);
5783
+
5784
+ // packages/domain/engine/src/index.ts
5785
+ var import_node_fs11 = __toESM(require("fs"), 1);
5786
+ var import_node_path14 = __toESM(require("path"), 1);
5787
+ var import_node_url6 = require("url");
5788
+
5612
5789
  // packages/domain/analyzer/src/analyzeWorkspace.ts
5790
+ var import_node_path10 = __toESM(require("path"), 1);
5613
5791
  init_src3();
5614
5792
 
5615
5793
  // packages/domain/analyzer/src/binding.ts
5616
5794
  init_src2();
5617
5795
 
5618
5796
  // packages/domain/analyzer/src/utils.ts
5797
+ var import_node_fs7 = __toESM(require("fs"), 1);
5619
5798
  init_src2();
5620
5799
  var DEFAULT_TOP_LIMIT = 10;
5621
5800
  var DEFAULT_FREQUENT_THRESHOLD = 2;
@@ -5630,7 +5809,7 @@ function isRecord(value) {
5630
5809
  }
5631
5810
  async function pathExists(filePath) {
5632
5811
  try {
5633
- await fs3__namespace.default.promises.access(filePath, fs3__namespace.default.constants.F_OK);
5812
+ await import_node_fs7.default.promises.access(filePath, import_node_fs7.default.constants.F_OK);
5634
5813
  return true;
5635
5814
  } catch {
5636
5815
  return false;
@@ -5647,8 +5826,8 @@ function sanitizeFrequentThreshold(value) {
5647
5826
  }
5648
5827
 
5649
5828
  // packages/domain/analyzer/src/binding.ts
5650
- var isAnalyzerModule = (module) => {
5651
- const candidate = module;
5829
+ var isAnalyzerModule = (module2) => {
5830
+ const candidate = module2;
5652
5831
  return typeof candidate?.analyzeClasses === "function" || typeof candidate?.analyzeClassesWorkspace === "function";
5653
5832
  };
5654
5833
  var createAnalyzerBindingLoader = () => {
@@ -5658,7 +5837,7 @@ var createAnalyzerBindingLoader = () => {
5658
5837
  _state.bindingPromise = (async () => {
5659
5838
  const runtimeDir = resolveRuntimeDir(
5660
5839
  typeof __dirname === "string" ? __dirname : void 0,
5661
- (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href))
5840
+ __importMetaUrl
5662
5841
  );
5663
5842
  const candidates = resolveNativeBindingCandidates({
5664
5843
  runtimeDir,
@@ -5701,7 +5880,7 @@ async function requireNativeBinding() {
5701
5880
  if (binding?.analyzeClasses) return binding;
5702
5881
  const runtimeDir = resolveRuntimeDir(
5703
5882
  typeof __dirname === "string" ? __dirname : void 0,
5704
- (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href))
5883
+ __importMetaUrl
5705
5884
  );
5706
5885
  const candidates = resolveNativeBindingCandidates({
5707
5886
  runtimeDir,
@@ -5729,6 +5908,7 @@ async function requireNativeBinding() {
5729
5908
 
5730
5909
  // packages/domain/analyzer/src/schemas.ts
5731
5910
  init_src2();
5911
+ var import_zod4 = require("zod");
5732
5912
  var formatIssuePath3 = (path16) => path16.length > 0 ? path16.map(
5733
5913
  (segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
5734
5914
  ).join(".") : "<root>";
@@ -5752,81 +5932,86 @@ var parseWithSchema2 = (schema, data, label) => {
5752
5932
  parsed.error
5753
5933
  );
5754
5934
  };
5755
- var CountSchema = zod.z.number().int().min(0);
5756
- zod.z.object({
5757
- name: zod.z.string(),
5935
+ var CountSchema = import_zod4.z.number().int().min(0);
5936
+ var ClassUsageSchema = import_zod4.z.object({
5937
+ name: import_zod4.z.string(),
5758
5938
  count: CountSchema,
5759
- isUnused: zod.z.boolean().optional(),
5760
- isConflict: zod.z.boolean().optional()
5939
+ isUnused: import_zod4.z.boolean().optional(),
5940
+ isConflict: import_zod4.z.boolean().optional()
5761
5941
  });
5762
- zod.z.object({
5763
- className: zod.z.string(),
5764
- variants: zod.z.array(zod.z.string()),
5765
- classes: zod.z.array(zod.z.string()),
5766
- message: zod.z.string()
5942
+ var ClassConflictSchema = import_zod4.z.object({
5943
+ className: import_zod4.z.string(),
5944
+ variants: import_zod4.z.array(import_zod4.z.string()),
5945
+ classes: import_zod4.z.array(import_zod4.z.string()),
5946
+ message: import_zod4.z.string()
5767
5947
  });
5768
- var ClassCountSchema = zod.z.object({
5769
- name: zod.z.string(),
5948
+ var ClassCountSchema = import_zod4.z.object({
5949
+ name: import_zod4.z.string(),
5770
5950
  count: CountSchema
5771
5951
  });
5772
- var NativeReportSchema = zod.z.object({
5773
- root: zod.z.string(),
5952
+ var NativeReportSchema = import_zod4.z.object({
5953
+ root: import_zod4.z.string(),
5774
5954
  totalFiles: CountSchema,
5775
5955
  uniqueClassCount: CountSchema,
5776
5956
  totalClassOccurrences: CountSchema,
5777
- topClasses: zod.z.array(ClassCountSchema),
5778
- duplicateCandidates: zod.z.array(ClassCountSchema),
5779
- safelist: zod.z.array(zod.z.string())
5957
+ topClasses: import_zod4.z.array(ClassCountSchema),
5958
+ duplicateCandidates: import_zod4.z.array(ClassCountSchema),
5959
+ safelist: import_zod4.z.array(import_zod4.z.string())
5780
5960
  });
5781
- zod.z.object({
5782
- css: zod.z.string(),
5783
- resolvedClasses: zod.z.array(zod.z.string()),
5784
- unknownClasses: zod.z.array(zod.z.string()),
5961
+ var NativeCssCompileResultSchema2 = import_zod4.z.object({
5962
+ css: import_zod4.z.string(),
5963
+ resolvedClasses: import_zod4.z.array(import_zod4.z.string()),
5964
+ unknownClasses: import_zod4.z.array(import_zod4.z.string()),
5785
5965
  sizeBytes: CountSchema
5786
5966
  });
5787
- var AnalyzerClassStatsSchema = zod.z.object({
5788
- top: zod.z.number({
5967
+ var AnalyzerClassStatsSchema = import_zod4.z.object({
5968
+ top: import_zod4.z.number({
5789
5969
  error: "analyzeWorkspace options.classStats.top must be a number when provided."
5790
5970
  }).finite().optional(),
5791
- frequentThreshold: zod.z.number({
5971
+ frequentThreshold: import_zod4.z.number({
5792
5972
  error: "analyzeWorkspace options.classStats.frequentThreshold must be a number when provided."
5793
5973
  }).finite().optional()
5794
5974
  });
5795
- var AnalyzerSemanticOptionsSchema = zod.z.object({
5796
- tailwindConfigPath: zod.z.string({
5975
+ var AnalyzerSemanticOptionsSchema = import_zod4.z.object({
5976
+ tailwindConfigPath: import_zod4.z.string({
5797
5977
  error: "analyzeWorkspace options.semantic.tailwindConfigPath must be a non-empty string when provided."
5798
5978
  }).min(
5799
5979
  1,
5800
5980
  "analyzeWorkspace options.semantic.tailwindConfigPath must be a non-empty string when provided."
5801
5981
  ).optional()
5802
5982
  });
5803
- var AnalyzerOptionsSchema = zod.z.object({
5804
- scanner: zod.z.custom(
5983
+ var AnalyzerOptionsSchema = import_zod4.z.object({
5984
+ scanner: import_zod4.z.custom(
5805
5985
  (value) => isPlainObject(value),
5806
5986
  "analyzeWorkspace options.scanner must be an object when provided."
5807
5987
  ).optional(),
5808
5988
  classStats: AnalyzerClassStatsSchema.optional(),
5809
- semantic: zod.z.union([
5810
- zod.z.boolean({
5989
+ semantic: import_zod4.z.union([
5990
+ import_zod4.z.boolean({
5811
5991
  error: "analyzeWorkspace options.semantic must be a boolean or an object when provided."
5812
5992
  }),
5813
5993
  AnalyzerSemanticOptionsSchema
5814
5994
  ]).optional(),
5815
- includeClass: zod.z.custom(
5995
+ includeClass: import_zod4.z.custom(
5816
5996
  (value) => typeof value === "function",
5817
5997
  "analyzeWorkspace options.includeClass must be a function when provided."
5818
5998
  ).optional()
5819
5999
  });
5820
- zod.z.object({
5821
- prefix: zod.z.union([zod.z.string(), zod.z.null()], {
6000
+ var ClassToCssOptionsSchema = import_zod4.z.object({
6001
+ prefix: import_zod4.z.union([import_zod4.z.string(), import_zod4.z.null()], {
5822
6002
  error: "classToCss options.prefix must be a string or null when provided."
5823
6003
  }).optional(),
5824
- strict: zod.z.boolean({
6004
+ strict: import_zod4.z.boolean({
5825
6005
  error: "classToCss options.strict must be a boolean when provided."
5826
6006
  }).optional()
5827
6007
  });
5828
6008
  var parseAnalyzerOptions = (options) => parseWithSchema2(AnalyzerOptionsSchema, options ?? {}, "analyzeWorkspace options are invalid");
5829
6009
  var parseNativeReport = (report) => parseWithSchema2(NativeReportSchema, report, "Native analyzer report is invalid");
6010
+
6011
+ // packages/domain/analyzer/src/semantic.ts
6012
+ var import_node_fs8 = __toESM(require("fs"), 1);
6013
+ var import_node_path9 = __toESM(require("path"), 1);
6014
+ var import_node_url5 = require("url");
5830
6015
  var SUPPORTED_TAILWIND_CONFIG_EXTENSIONS = /* @__PURE__ */ new Set([".ts", ".js", ".cjs", ".mjs"]);
5831
6016
  var tailwindConfigCache = /* @__PURE__ */ new Map();
5832
6017
  var detectConflicts2 = async (usages) => {
@@ -5846,11 +6031,11 @@ var detectConflicts2 = async (usages) => {
5846
6031
  };
5847
6032
  };
5848
6033
  var isSupportedTailwindConfigPath = (configPath) => {
5849
- return SUPPORTED_TAILWIND_CONFIG_EXTENSIONS.has(path9__namespace.default.extname(configPath).toLowerCase());
6034
+ return SUPPORTED_TAILWIND_CONFIG_EXTENSIONS.has(import_node_path9.default.extname(configPath).toLowerCase());
5850
6035
  };
5851
6036
  var resolveTailwindConfigPath = async (root, explicitPath) => {
5852
6037
  if (explicitPath) {
5853
- const resolved = path9__namespace.default.resolve(root, explicitPath);
6038
+ const resolved = import_node_path9.default.resolve(root, explicitPath);
5854
6039
  if (!await pathExists(resolved)) return null;
5855
6040
  return resolved;
5856
6041
  }
@@ -5861,7 +6046,7 @@ var resolveTailwindConfigPath = async (root, explicitPath) => {
5861
6046
  "tailwind.config.mjs"
5862
6047
  ];
5863
6048
  for (const candidate of candidates) {
5864
- const fullPath = path9__namespace.default.resolve(root, candidate);
6049
+ const fullPath = import_node_path9.default.resolve(root, candidate);
5865
6050
  if (await pathExists(fullPath)) return fullPath;
5866
6051
  }
5867
6052
  return null;
@@ -5915,7 +6100,7 @@ var collectCustomUtilities = (config) => {
5915
6100
  return out;
5916
6101
  };
5917
6102
  var collectSafelistFromSource = async (configPath) => {
5918
- const source = await fs3__namespace.default.promises.readFile(configPath, "utf8");
6103
+ const source = await import_node_fs8.default.promises.readFile(configPath, "utf8");
5919
6104
  const { extractClassesNative: extractClassesNative2 } = await Promise.resolve().then(() => (init_src3(), src_exports2));
5920
6105
  const allTokens = extractClassesNative2(source);
5921
6106
  const hasSafelist = source.includes("safelist");
@@ -5942,7 +6127,7 @@ var loadTailwindConfig2 = async (root, semanticOption) => {
5942
6127
  customUtilities: /* @__PURE__ */ new Set()
5943
6128
  };
5944
6129
  }
5945
- const configStat = await fs3__namespace.default.promises.stat(configPath).catch(() => null);
6130
+ const configStat = await import_node_fs8.default.promises.stat(configPath).catch(() => null);
5946
6131
  if (configStat) {
5947
6132
  const cached = tailwindConfigCache.get(configPath);
5948
6133
  if (cached && cached.mtimeMs === configStat.mtimeMs && cached.size === configStat.size) {
@@ -5955,7 +6140,7 @@ var loadTailwindConfig2 = async (root, semanticOption) => {
5955
6140
  const result = await (async () => {
5956
6141
  try {
5957
6142
  const cacheBustToken = Math.trunc(configStat?.mtimeMs ?? Date.now());
5958
- const imported = await import(`${url.pathToFileURL(configPath).href}?tws_mtime=${cacheBustToken}`);
6143
+ const imported = await import(`${(0, import_node_url5.pathToFileURL)(configPath).href}?tws_mtime=${cacheBustToken}`);
5959
6144
  const candidate = imported.default ?? imported;
5960
6145
  if (isRecord(candidate)) {
5961
6146
  return { config: candidate, warning: void 0 };
@@ -6101,7 +6286,7 @@ async function buildDistribution(usages, native) {
6101
6286
  }
6102
6287
  async function analyzeWorkspace(root, options = {}) {
6103
6288
  const startedAtMs = Date.now();
6104
- const resolvedRoot = path9__namespace.default.resolve(root);
6289
+ const resolvedRoot = import_node_path10.default.resolve(root);
6105
6290
  const normalizedOptions = parseAnalyzerOptions(options);
6106
6291
  const scan = await (async () => {
6107
6292
  const scanStartedAtMs = Date.now();
@@ -6210,6 +6395,8 @@ init_src3();
6210
6395
  init_src2();
6211
6396
 
6212
6397
  // packages/domain/engine/src/incremental.ts
6398
+ var import_node_fs9 = __toESM(require("fs"), 1);
6399
+ var import_node_path11 = __toESM(require("path"), 1);
6213
6400
  init_src3();
6214
6401
  init_src2();
6215
6402
  init_native_bridge2();
@@ -6245,8 +6432,8 @@ function areClassSetsEqual(a, b) {
6245
6432
  function applyIncrementalChange(previous, filePath, type, scanner) {
6246
6433
  const includeExtensions = scanner?.includeExtensions ?? DEFAULT_EXTENSIONS2;
6247
6434
  if (!isScannableFile2(filePath, includeExtensions)) return previous;
6248
- const byFile = new Map(previous.files.map((f) => [path9__namespace.default.resolve(f.file), f]));
6249
- const normalizedPath = path9__namespace.default.resolve(filePath);
6435
+ const byFile = new Map(previous.files.map((f) => [import_node_path11.default.resolve(f.file), f]));
6436
+ const normalizedPath = import_node_path11.default.resolve(filePath);
6250
6437
  const native = getNativeEngineBinding();
6251
6438
  if (!native?.processFileChange) {
6252
6439
  throw new Error(
@@ -6262,7 +6449,7 @@ function applyIncrementalChange(previous, filePath, type, scanner) {
6262
6449
  }
6263
6450
  log5.debug(`native change ${normalizedPath}`);
6264
6451
  const scanned = scanFile2(normalizedPath);
6265
- const content = fs3__namespace.default.readFileSync(normalizedPath, "utf8");
6452
+ const content = import_node_fs9.default.readFileSync(normalizedPath, "utf8");
6266
6453
  const diff = native.processFileChange(normalizedPath, scanned.classes, content);
6267
6454
  const existing = byFile.get(normalizedPath);
6268
6455
  if (diff && existing) {
@@ -6607,13 +6794,17 @@ var EngineMetricsCollector = class {
6607
6794
  };
6608
6795
 
6609
6796
  // packages/domain/engine/src/metricsWriter.ts
6797
+ var import_node_fs10 = __toESM(require("fs"), 1);
6798
+ var import_node_path12 = __toESM(require("path"), 1);
6799
+ var import_node_perf_hooks = require("perf_hooks");
6610
6800
  init_src2();
6801
+ var _log = createLogger2("tw:metrics");
6611
6802
  var METRICS_FILE_NAME = "metrics.json";
6612
6803
  var CACHE_DIR = ".tw-cache";
6613
6804
  function writeMetrics(metrics, cwd = process.cwd()) {
6614
6805
  try {
6615
- const cacheDir = path9__namespace.default.join(cwd, CACHE_DIR);
6616
- fs3__namespace.default.mkdirSync(cacheDir, { recursive: true });
6806
+ const cacheDir = import_node_path12.default.join(cwd, CACHE_DIR);
6807
+ import_node_fs10.default.mkdirSync(cacheDir, { recursive: true });
6617
6808
  const mem = process.memoryUsage();
6618
6809
  const data = {
6619
6810
  ...metrics,
@@ -6624,7 +6815,7 @@ function writeMetrics(metrics, cwd = process.cwd()) {
6624
6815
  },
6625
6816
  generatedAt: (/* @__PURE__ */ new Date()).toISOString()
6626
6817
  };
6627
- fs3__namespace.default.writeFileSync(path9__namespace.default.join(cacheDir, METRICS_FILE_NAME), JSON.stringify(data, null, 2));
6818
+ import_node_fs10.default.writeFileSync(import_node_path12.default.join(cacheDir, METRICS_FILE_NAME), JSON.stringify(data, null, 2));
6628
6819
  } catch {
6629
6820
  }
6630
6821
  }
@@ -6676,6 +6867,9 @@ async function runAfterWatch(plugins, context) {
6676
6867
  await plugin.afterWatch?.(context);
6677
6868
  }
6678
6869
  }
6870
+
6871
+ // packages/domain/engine/src/schemas.ts
6872
+ var import_zod5 = require("zod");
6679
6873
  var formatIssues3 = (error) => error.issues.map((issue) => {
6680
6874
  const p = issue.path.length > 0 ? issue.path.join(".") : "<root>";
6681
6875
  return `${p}: ${issue.message}`;
@@ -6685,46 +6879,46 @@ var parseWithSchema3 = (schema, data, label) => {
6685
6879
  if (parsed.success) return parsed.data;
6686
6880
  throw new TypeError(`${label}: ${formatIssues3(parsed.error)}`);
6687
6881
  };
6688
- var EngineOptionsSchema = zod.z.object({
6689
- root: zod.z.string().optional(),
6690
- scanner: zod.z.object({
6691
- includeExtensions: zod.z.array(zod.z.string()).optional(),
6692
- ignoreDirectories: zod.z.array(zod.z.string()).optional(),
6693
- useCache: zod.z.boolean().optional(),
6694
- cacheDir: zod.z.string().min(1).optional(),
6695
- smartInvalidation: zod.z.boolean().optional()
6882
+ var EngineOptionsSchema = import_zod5.z.object({
6883
+ root: import_zod5.z.string().optional(),
6884
+ scanner: import_zod5.z.object({
6885
+ includeExtensions: import_zod5.z.array(import_zod5.z.string()).optional(),
6886
+ ignoreDirectories: import_zod5.z.array(import_zod5.z.string()).optional(),
6887
+ useCache: import_zod5.z.boolean().optional(),
6888
+ cacheDir: import_zod5.z.string().min(1).optional(),
6889
+ smartInvalidation: import_zod5.z.boolean().optional()
6696
6890
  }).optional(),
6697
- compileCss: zod.z.boolean().optional(),
6698
- tailwindConfigPath: zod.z.string().optional(),
6699
- analyze: zod.z.boolean().optional(),
6700
- plugins: zod.z.array(zod.z.custom()).optional()
6891
+ compileCss: import_zod5.z.boolean().optional(),
6892
+ tailwindConfigPath: import_zod5.z.string().optional(),
6893
+ analyze: import_zod5.z.boolean().optional(),
6894
+ plugins: import_zod5.z.array(import_zod5.z.custom()).optional()
6701
6895
  });
6702
- var EngineWatchOptionsSchema = zod.z.object({
6703
- debounceMs: zod.z.number().int().min(0).optional(),
6704
- maxEventsPerFlush: zod.z.number().int().min(1).optional(),
6705
- largeFileThreshold: zod.z.number().int().min(0).optional()
6896
+ var EngineWatchOptionsSchema = import_zod5.z.object({
6897
+ debounceMs: import_zod5.z.number().int().min(0).optional(),
6898
+ maxEventsPerFlush: import_zod5.z.number().int().min(1).optional(),
6899
+ largeFileThreshold: import_zod5.z.number().int().min(0).optional()
6706
6900
  });
6707
- var BuildResultSchema = zod.z.object({
6708
- scan: zod.z.object({
6709
- files: zod.z.array(
6710
- zod.z.object({ file: zod.z.string(), classes: zod.z.array(zod.z.string()), hash: zod.z.string().optional() })
6901
+ var BuildResultSchema = import_zod5.z.object({
6902
+ scan: import_zod5.z.object({
6903
+ files: import_zod5.z.array(
6904
+ import_zod5.z.object({ file: import_zod5.z.string(), classes: import_zod5.z.array(import_zod5.z.string()), hash: import_zod5.z.string().optional() })
6711
6905
  ),
6712
- totalFiles: zod.z.number().int().min(0),
6713
- uniqueClasses: zod.z.array(zod.z.string())
6906
+ totalFiles: import_zod5.z.number().int().min(0),
6907
+ uniqueClasses: import_zod5.z.array(import_zod5.z.string())
6714
6908
  }),
6715
- mergedClassList: zod.z.string(),
6716
- css: zod.z.string(),
6717
- analysis: zod.z.object({
6718
- unusedClasses: zod.z.array(zod.z.string()),
6719
- classConflicts: zod.z.array(
6720
- zod.z.object({
6721
- className: zod.z.string(),
6722
- files: zod.z.array(zod.z.string()),
6723
- classes: zod.z.array(zod.z.string()).optional(),
6724
- message: zod.z.string().optional()
6909
+ mergedClassList: import_zod5.z.string(),
6910
+ css: import_zod5.z.string(),
6911
+ analysis: import_zod5.z.object({
6912
+ unusedClasses: import_zod5.z.array(import_zod5.z.string()),
6913
+ classConflicts: import_zod5.z.array(
6914
+ import_zod5.z.object({
6915
+ className: import_zod5.z.string(),
6916
+ files: import_zod5.z.array(import_zod5.z.string()),
6917
+ classes: import_zod5.z.array(import_zod5.z.string()).optional(),
6918
+ message: import_zod5.z.string().optional()
6725
6919
  })
6726
6920
  ),
6727
- classUsage: zod.z.record(zod.z.string(), zod.z.number())
6921
+ classUsage: import_zod5.z.record(import_zod5.z.string(), import_zod5.z.number())
6728
6922
  }).optional()
6729
6923
  });
6730
6924
  var parseEngineOptions = (options) => parseWithSchema3(EngineOptionsSchema, options ?? {}, "engine options are invalid");
@@ -6738,7 +6932,7 @@ function getNativeWatcher() {
6738
6932
  const { resolveNativeBinary: resolveNativeBinary2 } = (init_src2(), __toCommonJS(src_exports));
6739
6933
  const { path: binPath } = resolveNativeBinary2(__dirname);
6740
6934
  if (binPath) {
6741
- _native2 = __require(binPath);
6935
+ _native2 = require(binPath);
6742
6936
  }
6743
6937
  } catch {
6744
6938
  _native2 = {};
@@ -6885,7 +7079,10 @@ init_resolver();
6885
7079
  init_cssToIr();
6886
7080
 
6887
7081
  // packages/domain/engine/src/watch-native.ts
7082
+ var import_node_module7 = require("module");
7083
+ var import_node_path13 = __toESM(require("path"), 1);
6888
7084
  init_src2();
7085
+ var import_meta6 = {};
6889
7086
  var watchBindingState = {
6890
7087
  binding: void 0
6891
7088
  };
@@ -6899,27 +7096,29 @@ var getBinding = () => {
6899
7096
  return watchBindingState.binding;
6900
7097
  }
6901
7098
  const runtimeDir = typeof __dirname === "string" ? __dirname : process.cwd();
6902
- const req = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('engine.js', document.baseURI).href)));
7099
+ const req = (0, import_node_module7.createRequire)(
7100
+ typeof __filename !== "undefined" ? `file://${__filename}` : typeof import_meta6 !== "undefined" && __importMetaUrl ? __importMetaUrl : "file://unknown"
7101
+ );
6903
7102
  const _pa = `${process.platform}-${process.arch}`;
6904
7103
  const _paGnu = _pa === "linux-x64" ? "linux-x64-gnu" : _pa === "linux-arm64" ? "linux-arm64-gnu" : _pa;
6905
7104
  const candidates = [
6906
7105
  // new binary name: tailwind-styled-native
6907
- path9__namespace.default.resolve(process.cwd(), "native", "tailwind-styled-native.node"),
6908
- path9__namespace.default.resolve(process.cwd(), "native", `tailwind-styled-native.${_pa}.node`),
7106
+ import_node_path13.default.resolve(process.cwd(), "native", "tailwind-styled-native.node"),
7107
+ import_node_path13.default.resolve(process.cwd(), "native", `tailwind-styled-native.${_pa}.node`),
6909
7108
  // npm install case: dist/../native/
6910
- path9__namespace.default.resolve(runtimeDir, "..", "native", "tailwind-styled-native.node"),
6911
- path9__namespace.default.resolve(runtimeDir, "..", "native", `tailwind-styled-native.${_pa}.node`),
6912
- path9__namespace.default.resolve(runtimeDir, "..", "native", `tailwind-styled-native.${_paGnu}.node`),
7109
+ import_node_path13.default.resolve(runtimeDir, "..", "native", "tailwind-styled-native.node"),
7110
+ import_node_path13.default.resolve(runtimeDir, "..", "native", `tailwind-styled-native.${_pa}.node`),
7111
+ import_node_path13.default.resolve(runtimeDir, "..", "native", `tailwind-styled-native.${_paGnu}.node`),
6913
7112
  // monorepo dev: 4-level up
6914
- path9__namespace.default.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind-styled-native.node"),
6915
- path9__namespace.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `tailwind-styled-native.${_paGnu}.node`),
7113
+ import_node_path13.default.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind-styled-native.node"),
7114
+ import_node_path13.default.resolve(runtimeDir, "..", "..", "..", "..", "native", `tailwind-styled-native.${_paGnu}.node`),
6916
7115
  // 3-level fallback
6917
- path9__namespace.default.resolve(runtimeDir, "..", "..", "..", "native", "tailwind-styled-native.node"),
7116
+ import_node_path13.default.resolve(runtimeDir, "..", "..", "..", "native", "tailwind-styled-native.node"),
6918
7117
  // backward compat: tailwind_styled_parser
6919
- path9__namespace.default.resolve(process.cwd(), "native", "tailwind_styled_parser.node"),
6920
- path9__namespace.default.resolve(runtimeDir, "..", "native", "tailwind_styled_parser.node"),
6921
- path9__namespace.default.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind_styled_parser.node"),
6922
- path9__namespace.default.resolve(runtimeDir, "..", "..", "..", "native", "tailwind_styled_parser.node")
7118
+ import_node_path13.default.resolve(process.cwd(), "native", "tailwind_styled_parser.node"),
7119
+ import_node_path13.default.resolve(runtimeDir, "..", "native", "tailwind_styled_parser.node"),
7120
+ import_node_path13.default.resolve(runtimeDir, "..", "..", "..", "..", "native", "tailwind_styled_parser.node"),
7121
+ import_node_path13.default.resolve(runtimeDir, "..", "..", "..", "native", "tailwind_styled_parser.node")
6923
7122
  ];
6924
7123
  for (const c of candidates) {
6925
7124
  try {
@@ -6940,7 +7139,7 @@ var log6 = createLogger2("engine:watch-native");
6940
7139
  function watchWorkspace2(rootDir, callback, options = {}) {
6941
7140
  const binding = getBinding();
6942
7141
  const pollMs = options.pollIntervalMs ?? 500;
6943
- const resolvedRoot = path9__namespace.default.resolve(rootDir);
7142
+ const resolvedRoot = import_node_path13.default.resolve(rootDir);
6944
7143
  const result = (() => {
6945
7144
  try {
6946
7145
  return binding.startWatch(resolvedRoot);
@@ -6977,7 +7176,7 @@ This package requires native Rust bindings.`
6977
7176
  const deduped = /* @__PURE__ */ new Set();
6978
7177
  const events = [];
6979
7178
  for (const e of raw) {
6980
- const absPath = path9__namespace.default.isAbsolute(e.path) ? path9__namespace.default.normalize(e.path) : path9__namespace.default.resolve(resolvedRoot, e.path);
7179
+ const absPath = import_node_path13.default.isAbsolute(e.path) ? import_node_path13.default.normalize(e.path) : import_node_path13.default.resolve(resolvedRoot, e.path);
6981
7180
  const kind = e.kind;
6982
7181
  const key = `${kind}:${absPath}`;
6983
7182
  if (deduped.has(key)) continue;
@@ -7017,11 +7216,11 @@ var configState = {
7017
7216
  var log7 = createLogger2("engine");
7018
7217
  async function loadTailwindConfigFromPath(root, tailwindConfigPath) {
7019
7218
  if (!tailwindConfigPath) return void 0;
7020
- const configPath = path9__namespace.default.resolve(root, tailwindConfigPath);
7021
- if (!fs3__namespace.default.existsSync(configPath)) {
7219
+ const configPath = import_node_path14.default.resolve(root, tailwindConfigPath);
7220
+ if (!import_node_fs11.default.existsSync(configPath)) {
7022
7221
  throw TwError.fromIo("CONFIG_NOT_FOUND", `tailwindConfigPath not found: ${configPath}`);
7023
7222
  }
7024
- const imported = await import(url.pathToFileURL(configPath).href);
7223
+ const imported = await import((0, import_node_url6.pathToFileURL)(configPath).href);
7025
7224
  const config = imported.default ?? imported;
7026
7225
  return config;
7027
7226
  }
@@ -7084,11 +7283,11 @@ async function buildFromScan(scan, root, options, tailwindConfig) {
7084
7283
  };
7085
7284
  }
7086
7285
  function countWorkspacePackages(root) {
7087
- const packagesDir = path9__namespace.default.join(root, "packages");
7088
- if (!fs3__namespace.default.existsSync(packagesDir)) return 0;
7286
+ const packagesDir = import_node_path14.default.join(root, "packages");
7287
+ if (!import_node_fs11.default.existsSync(packagesDir)) return 0;
7089
7288
  try {
7090
- return fs3__namespace.default.readdirSync(packagesDir, { withFileTypes: true }).filter(
7091
- (entry) => entry.isDirectory() && fs3__namespace.default.existsSync(path9__namespace.default.join(packagesDir, entry.name, "package.json"))
7289
+ return import_node_fs11.default.readdirSync(packagesDir, { withFileTypes: true }).filter(
7290
+ (entry) => entry.isDirectory() && import_node_fs11.default.existsSync(import_node_path14.default.join(packagesDir, entry.name, "package.json"))
7092
7291
  ).length;
7093
7292
  } catch (err) {
7094
7293
  log7.debug(`countWorkspacePackages: ${err instanceof Error ? err.message : String(err)}`);
@@ -7125,7 +7324,7 @@ function writeDashboardMetrics(root, mode, result, metrics) {
7125
7324
  async function createEngine(rawOptions = {}) {
7126
7325
  const options = parseEngineOptions(rawOptions);
7127
7326
  const root = options.root ?? process.cwd();
7128
- const resolvedRoot = path9__namespace.default.resolve(root);
7327
+ const resolvedRoot = import_node_path14.default.resolve(root);
7129
7328
  const plugins = rawOptions.plugins ?? [];
7130
7329
  const getTailwindConfig = async () => {
7131
7330
  if (configState.isLoaded()) return configState.getConfig();
@@ -7272,7 +7471,7 @@ async function createEngine(rawOptions = {}) {
7272
7471
  const shouldForceFullRescan = (event) => {
7273
7472
  if (event.type === "unlink") return false;
7274
7473
  try {
7275
- const stat = fs3__namespace.default.statSync(event.filePath);
7474
+ const stat = import_node_fs11.default.statSync(event.filePath);
7276
7475
  if (stat.size > largeFileThreshold) {
7277
7476
  metrics.markSkippedLargeFile();
7278
7477
  return true;
@@ -7390,14 +7589,14 @@ async function createEngine(rawOptions = {}) {
7390
7589
  };
7391
7590
  }
7392
7591
  async function scanWorkspace3(opts = {}) {
7393
- const root = path9__namespace.default.resolve(opts.root ?? process.cwd());
7592
+ const root = import_node_path14.default.resolve(opts.root ?? process.cwd());
7394
7593
  return scanWorkspaceAsync(root, {
7395
7594
  includeExtensions: opts.extensions,
7396
7595
  ignoreDirectories: opts.ignoreDirectories
7397
7596
  });
7398
7597
  }
7399
7598
  async function analyzeWorkspace2(opts = {}) {
7400
- const root = path9__namespace.default.resolve(opts.root ?? process.cwd());
7599
+ const root = import_node_path14.default.resolve(opts.root ?? process.cwd());
7401
7600
  return analyzeWorkspace(root, {
7402
7601
  classStats: { top: opts.top ?? 20 }
7403
7602
  });
@@ -7469,39 +7668,53 @@ async function inspectClass(className, scanResult, css = "") {
7469
7668
  bundleBytes: impact.bundleSizeBytes
7470
7669
  };
7471
7670
  }
7472
-
7473
- exports.BuildResultSchema = BuildResultSchema;
7474
- exports.BundleAnalyzer = BundleAnalyzer;
7475
- exports.EngineMetricsCollector = EngineMetricsCollector;
7476
- exports.EngineOptionsSchema = EngineOptionsSchema;
7477
- exports.EngineWatchOptionsSchema = EngineWatchOptionsSchema;
7478
- exports.ImpactTracker = ImpactTracker;
7479
- exports.ReverseLookup = ReverseLookup;
7480
- exports.analyzeWorkspace = analyzeWorkspace2;
7481
- exports.applyIncrementalChange = applyIncrementalChange;
7482
- exports.build = build;
7483
- exports.buildProvenanceChain = buildProvenanceChain;
7484
- exports.createEngine = createEngine;
7485
- exports.createFingerprint = createFingerprint2;
7486
- exports.createResolutionReason = createResolutionReason;
7487
- exports.generateSafelist = generateSafelist2;
7488
- exports.inspectClass = inspectClass;
7489
- exports.parseCssToIr = parseCssToIr;
7490
- exports.parseEngineOptions = parseEngineOptions;
7491
- exports.parseEngineWatchOptions = parseEngineWatchOptions;
7492
- exports.runAfterBuild = runAfterBuild;
7493
- exports.runAfterScan = runAfterScan;
7494
- exports.runAfterWatch = runAfterWatch;
7495
- exports.runBeforeBuild = runBeforeBuild;
7496
- exports.runBeforeScan = runBeforeScan;
7497
- exports.runBeforeWatch = runBeforeWatch;
7498
- exports.runOnError = runOnError;
7499
- exports.runTransformClasses = runTransformClasses;
7500
- exports.scanWorkspace = scanWorkspace3;
7501
- exports.trace = trace;
7502
- exports.traceClass = traceClass;
7503
- exports.traceClasses = traceClasses;
7504
- exports.watchWorkspaceLegacy = watchWorkspace;
7505
- exports.watchWorkspaceNative = watchWorkspace2;
7506
- //# sourceMappingURL=engine.js.map
7671
+ // Annotate the CommonJS export names for ESM import in node:
7672
+ 0 && (module.exports = {
7673
+ BuildResultSchema,
7674
+ BundleAnalyzer,
7675
+ CascadeResolutionId,
7676
+ CascadeResolver,
7677
+ CascadeStage,
7678
+ ConditionId,
7679
+ ConditionResult,
7680
+ EngineMetricsCollector,
7681
+ EngineOptionsSchema,
7682
+ EngineWatchOptionsSchema,
7683
+ ImpactTracker,
7684
+ Importance,
7685
+ LayerId,
7686
+ Origin,
7687
+ PropertyId,
7688
+ ReverseLookup,
7689
+ RuleId,
7690
+ SelectorId,
7691
+ ValueId,
7692
+ VariantChainId,
7693
+ analyzeWorkspace,
7694
+ applyIncrementalChange,
7695
+ build,
7696
+ buildProvenanceChain,
7697
+ createEngine,
7698
+ createFingerprint,
7699
+ createResolutionReason,
7700
+ generateSafelist,
7701
+ inspectClass,
7702
+ parseCssToIr,
7703
+ parseEngineOptions,
7704
+ parseEngineWatchOptions,
7705
+ runAfterBuild,
7706
+ runAfterScan,
7707
+ runAfterWatch,
7708
+ runBeforeBuild,
7709
+ runBeforeScan,
7710
+ runBeforeWatch,
7711
+ runOnError,
7712
+ runTransformClasses,
7713
+ scanWorkspace,
7714
+ trace,
7715
+ traceClass,
7716
+ traceClasses,
7717
+ watchWorkspaceLegacy,
7718
+ watchWorkspaceNative
7719
+ });
7507
7720
  //# sourceMappingURL=engine.js.map