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/vue.js CHANGED
@@ -1,45 +1,38 @@
1
- 'use strict';
2
-
3
- var module$1 = require('module');
4
- var fs = require('fs');
5
- var path = require('path');
6
- require('crypto');
7
- var url = require('url');
8
- var vue = require('vue');
9
-
10
- var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
11
- function _interopNamespace(e) {
12
- if (e && e.__esModule) return e;
13
- var n = Object.create(null);
14
- if (e) {
15
- Object.keys(e).forEach(function (k) {
16
- if (k !== 'default') {
17
- var d = Object.getOwnPropertyDescriptor(e, k);
18
- Object.defineProperty(n, k, d.get ? d : {
19
- enumerable: true,
20
- get: function () { return e[k]; }
21
- });
22
- }
23
- });
24
- }
25
- n.default = e;
26
- return Object.freeze(n);
27
- }
28
-
29
- var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
30
- var path__namespace = /*#__PURE__*/_interopNamespace(path);
31
-
1
+ const __importMetaUrl = typeof __filename !== "undefined" ? require("node:url").pathToFileURL(__filename).href : "file://unknown";
32
2
  /* tailwind-styled-v4 v5.0.4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
3
+ "use strict";
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
33
7
  var __getOwnPropNames = Object.getOwnPropertyNames;
34
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
35
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
36
- }) : x)(function(x) {
37
- if (typeof require !== "undefined") return require.apply(this, arguments);
38
- throw Error('Dynamic require of "' + x + '" is not supported');
39
- });
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
40
10
  var __esm = (fn, res) => function __init() {
41
11
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
42
12
  };
13
+ var __export = (target, all) => {
14
+ for (var name in all)
15
+ __defProp(target, name, { get: all[name], enumerable: true });
16
+ };
17
+ var __copyProps = (to, from, except, desc) => {
18
+ if (from && typeof from === "object" || typeof from === "function") {
19
+ for (let key of __getOwnPropNames(from))
20
+ if (!__hasOwnProp.call(to, key) && key !== except)
21
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
22
+ }
23
+ return to;
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
+ ));
33
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
34
+
35
+ // packages/domain/shared/src/native-resolution.ts
43
36
  function platformKey() {
44
37
  if (isBrowser) return "browser";
45
38
  return `${process.platform}-${process.arch}`;
@@ -55,7 +48,7 @@ function resolveNativeBinary(runtimeDir) {
55
48
  }
56
49
  const envPath = process.env.TW_NATIVE_PATH?.trim();
57
50
  if (envPath) {
58
- if (fs__namespace.existsSync(envPath)) {
51
+ if (fs.existsSync(envPath)) {
59
52
  return { path: envPath, source: "env", platform, tried };
60
53
  }
61
54
  tried.push(`env:${envPath} (not found)`);
@@ -64,7 +57,7 @@ function resolveNativeBinary(runtimeDir) {
64
57
  for (const pkg of prebuiltPkgs) {
65
58
  try {
66
59
  const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`);
67
- if (fs__namespace.existsSync(candidate)) {
60
+ if (fs.existsSync(candidate)) {
68
61
  return { path: candidate, source: "prebuilt", platform, tried };
69
62
  }
70
63
  tried.push(`prebuilt:${pkg} (resolved but missing)`);
@@ -75,13 +68,13 @@ function resolveNativeBinary(runtimeDir) {
75
68
  const napiPlatform = platform === "linux-x64" ? "linux-x64-gnu" : platform === "linux-arm64" ? "linux-arm64-gnu" : platform;
76
69
  const BINARY_NAMES_SELF = ["tailwind-styled-native", "tailwind_styled_parser"];
77
70
  if (runtimeDir) {
78
- for (const depth of ["..", path__namespace.join("..", ".."), path__namespace.join("..", "..", "..")]) {
79
- const pkgRoot = path__namespace.resolve(runtimeDir, depth);
71
+ for (const depth of ["..", path.join("..", ".."), path.join("..", "..", "..")]) {
72
+ const pkgRoot = path.resolve(runtimeDir, depth);
80
73
  for (const bin of BINARY_NAMES_SELF) {
81
74
  for (const suffix of ["", `.${platform}`, `.${napiPlatform}`]) {
82
- const candidate = path__namespace.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
75
+ const candidate = path.resolve(pkgRoot, "native", `${bin}${suffix}.node`);
83
76
  tried.push(`self-bundled:${candidate}`);
84
- if (fs__namespace.existsSync(candidate)) {
77
+ if (fs.existsSync(candidate)) {
85
78
  return { path: candidate, source: "prebuilt", platform, tried };
86
79
  }
87
80
  }
@@ -93,39 +86,45 @@ function resolveNativeBinary(runtimeDir) {
93
86
  const BINARY_NAMES = ["tailwind-styled-native", "tailwind_styled_parser"];
94
87
  const localCandidates = [];
95
88
  for (const bin of BINARY_NAMES) {
96
- localCandidates.push(path__namespace.resolve(base, `${bin}.node`));
97
- localCandidates.push(path__namespace.resolve(base, "..", `${bin}.node`));
98
- localCandidates.push(path__namespace.resolve(base, `${bin}.${platform}.node`));
99
- localCandidates.push(path__namespace.resolve(base, `${bin}.${napiPlatform}.node`));
89
+ localCandidates.push(path.resolve(base, `${bin}.node`));
90
+ localCandidates.push(path.resolve(base, "..", `${bin}.node`));
91
+ localCandidates.push(path.resolve(base, `${bin}.${platform}.node`));
92
+ localCandidates.push(path.resolve(base, `${bin}.${napiPlatform}.node`));
100
93
  }
101
94
  for (const startDir of [cwd, base]) {
102
95
  let dir = startDir;
103
96
  for (let i = 0; i < 6; i++) {
104
- const nativeDir = path__namespace.resolve(dir, "native");
97
+ const nativeDir = path.resolve(dir, "native");
105
98
  for (const bin of BINARY_NAMES) {
106
- localCandidates.push(path__namespace.resolve(nativeDir, `${bin}.node`));
107
- localCandidates.push(path__namespace.resolve(nativeDir, `${bin}.${platform}.node`));
108
- localCandidates.push(path__namespace.resolve(nativeDir, `${bin}.${napiPlatform}.node`));
109
- localCandidates.push(path__namespace.resolve(nativeDir, "target", "release", `${bin}.node`));
99
+ localCandidates.push(path.resolve(nativeDir, `${bin}.node`));
100
+ localCandidates.push(path.resolve(nativeDir, `${bin}.${platform}.node`));
101
+ localCandidates.push(path.resolve(nativeDir, `${bin}.${napiPlatform}.node`));
102
+ localCandidates.push(path.resolve(nativeDir, "target", "release", `${bin}.node`));
110
103
  }
111
- const parent = path__namespace.resolve(dir, "..");
104
+ const parent = path.resolve(dir, "..");
112
105
  if (parent === dir) break;
113
106
  dir = parent;
114
107
  }
115
108
  }
116
109
  for (const candidate of localCandidates) {
117
110
  tried.push(`local:${candidate}`);
118
- if (fs__namespace.existsSync(candidate)) {
111
+ if (fs.existsSync(candidate)) {
119
112
  return { path: candidate, source: "local", platform, tried };
120
113
  }
121
114
  }
122
115
  return { path: null, source: "not-found", platform, tried };
123
116
  }
124
- var isBrowser, _require, PLATFORM_MAP;
117
+ var import_node_module, fs, path, isBrowser, _require, PLATFORM_MAP;
125
118
  var init_native_resolution = __esm({
126
119
  "packages/domain/shared/src/native-resolution.ts"() {
120
+ "use strict";
121
+ import_node_module = require("module");
122
+ fs = __toESM(require("fs"));
123
+ path = __toESM(require("path"));
127
124
  isBrowser = typeof window !== "undefined" || typeof document !== "undefined";
128
- _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('vue.js', document.baseURI).href)));
125
+ _require = (0, import_node_module.createRequire)(
126
+ typeof require !== "undefined" ? typeof __filename !== "undefined" ? `file://${__filename}` : "file://unknown" : __importMetaUrl
127
+ );
129
128
  PLATFORM_MAP = {
130
129
  "linux-x64": ["@tailwind-styled/native-linux-x64-gnu", "@tailwind-styled/native-linux-x64"],
131
130
  "linux-arm64": ["@tailwind-styled/native-linux-arm64-gnu", "@tailwind-styled/native-linux-arm64"],
@@ -136,18 +135,45 @@ var init_native_resolution = __esm({
136
135
  };
137
136
  }
138
137
  });
138
+
139
+ // packages/domain/shared/src/index.ts
140
+ var import_node_crypto, import_node_fs, import_node_path, import_node_url, import_node_module2, _require2;
139
141
  var init_src = __esm({
140
142
  "packages/domain/shared/src/index.ts"() {
143
+ "use strict";
144
+ import_node_crypto = require("crypto");
145
+ import_node_fs = __toESM(require("fs"));
146
+ import_node_path = __toESM(require("path"));
147
+ import_node_url = require("url");
148
+ import_node_module2 = require("module");
141
149
  init_native_resolution();
142
- module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('vue.js', document.baseURI).href)));
150
+ _require2 = (0, import_node_module2.createRequire)(
151
+ typeof __filename !== "undefined" ? `file://${__filename}` : __importMetaUrl ?? "file://unknown"
152
+ );
143
153
  }
144
154
  });
145
155
 
156
+ // src/umbrella/vue.ts
157
+ var vue_exports = {};
158
+ __export(vue_exports, {
159
+ TailwindStyledPlugin: () => TailwindStyledPlugin,
160
+ cv: () => cv2,
161
+ extend: () => extend,
162
+ tw: () => tw
163
+ });
164
+ module.exports = __toCommonJS(vue_exports);
165
+
146
166
  // packages/domain/core/src/native.ts
167
+ var import_node_module3 = require("module");
168
+ var import_node_path2 = require("path");
169
+ var import_node_url2 = require("url");
147
170
  init_src();
171
+ var import_meta = {};
148
172
  var isBrowser2 = typeof window !== "undefined" || typeof document !== "undefined";
149
173
  var NATIVE_UNAVAILABLE_MESSAGE = "[tailwind-styled/core] Native binding is required but not available.\nPlease ensure you have run: npm run build:rust";
150
- var _nodeRequire = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('vue.js', document.baseURI).href)));
174
+ var _nodeRequire = (0, import_node_module3.createRequire)(
175
+ typeof __filename !== "undefined" ? `file://${__filename}` : typeof import_meta !== "undefined" && __importMetaUrl ? __importMetaUrl : "file://unknown"
176
+ );
151
177
  var _loadNative = (path3) => _nodeRequire(path3);
152
178
  var nativeBinding = null;
153
179
  var bindingLoadAttempted = false;
@@ -161,7 +187,9 @@ var getBinding = () => {
161
187
  }
162
188
  bindingLoadAttempted = true;
163
189
  try {
164
- const runtimeDir = isBrowser2 ? "" : path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('vue.js', document.baseURI).href))));
190
+ const runtimeDir = isBrowser2 ? "" : (0, import_node_path2.dirname)(
191
+ typeof __filename !== "undefined" ? __filename : typeof import_meta !== "undefined" && __importMetaUrl ? (0, import_node_url2.fileURLToPath)(__importMetaUrl) : process.cwd()
192
+ );
165
193
  const result = isBrowser2 ? { path: null, source: "not-found", platform: "browser", tried: [] } : resolveNativeBinary(runtimeDir);
166
194
  if (result.path && result.path.endsWith(".node")) {
167
195
  const mod = _loadNative(result.path);
@@ -196,6 +224,9 @@ function createTwMerge(_options = {}) {
196
224
  };
197
225
  }
198
226
  var twMerge = createTwMerge();
227
+
228
+ // packages/presentation/vue/src/index.ts
229
+ var import_vue = require("vue");
199
230
  var isVariantValue = (value) => typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value === void 0;
200
231
  var toVariantProps = (input) => {
201
232
  const props = {};
@@ -235,12 +266,12 @@ function tw(tag, config = {}) {
235
266
  propsDefinition[key] = { type: null, default: void 0 };
236
267
  }
237
268
  propsDefinition.class = { type: null, default: void 0 };
238
- return vue.defineComponent({
269
+ return (0, import_vue.defineComponent)({
239
270
  name: `TwStyled${String(tag).charAt(0).toUpperCase() + String(tag).slice(1)}`,
240
271
  inheritAttrs: false,
241
272
  props: propsDefinition,
242
273
  setup(props, { attrs, slots }) {
243
- const className = vue.computed(() => {
274
+ const className = (0, import_vue.computed)(() => {
244
275
  const variantProps = toVariantProps(props);
245
276
  const attrProps = toVariantProps(attrs);
246
277
  const mergedProps = { ...defaultVariants, ...variantProps, ...attrProps };
@@ -261,7 +292,7 @@ function tw(tag, config = {}) {
261
292
  filteredAttrs[key] = attrs[key];
262
293
  }
263
294
  }
264
- return vue.h(tag, { ...filteredAttrs, class: className.value }, slots.default?.());
295
+ return (0, import_vue.h)(tag, { ...filteredAttrs, class: className.value }, slots.default?.());
265
296
  };
266
297
  }
267
298
  });
@@ -276,12 +307,12 @@ function cv2(config) {
276
307
  };
277
308
  }
278
309
  function extend(component, extraClasses) {
279
- return vue.defineComponent({
310
+ return (0, import_vue.defineComponent)({
280
311
  name: `Extended${("name" in component ? component.name : void 0) ?? "Component"}`,
281
312
  inheritAttrs: false,
282
313
  props: { class: { type: null, default: void 0 } },
283
314
  setup(props, { attrs, slots }) {
284
- return () => vue.h(
315
+ return () => (0, import_vue.h)(
285
316
  component,
286
317
  {
287
318
  ...attrs,
@@ -300,10 +331,11 @@ var TailwindStyledPlugin = {
300
331
  app.provide("cv", cv2);
301
332
  }
302
333
  };
303
-
304
- exports.TailwindStyledPlugin = TailwindStyledPlugin;
305
- exports.cv = cv2;
306
- exports.extend = extend;
307
- exports.tw = tw;
308
- //# sourceMappingURL=vue.js.map
334
+ // Annotate the CommonJS export names for ESM import in node:
335
+ 0 && (module.exports = {
336
+ TailwindStyledPlugin,
337
+ cv,
338
+ extend,
339
+ tw
340
+ });
309
341
  //# sourceMappingURL=vue.js.map
package/dist/vue.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../packages/domain/shared/src/native-resolution.ts","../packages/domain/shared/src/index.ts","../packages/domain/core/src/native.ts","../packages/domain/core/src/merge.ts","../packages/presentation/vue/src/index.ts"],"names":["fs","path","createRequire","isBrowser","dirname","fileURLToPath","twMerge","defineComponent","computed","h","cv"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,SAAS,WAAA,GAAsB;AAC7B,EAAA,IAAI,WAAW,OAAO,SAAA;AACtB,EAAA,OAAO,CAAA,EAAG,OAAA,CAAQ,QAAQ,CAAA,CAAA,EAAI,QAAQ,IAAI,CAAA,CAAA;AAC5C;AAaO,SAAS,oBAAoB,UAAA,EAA6C;AAC/E,EAAA,MAAM,WAAW,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AAiB,GAAA,GAAM,EAAA;AAClC,IAAA,GAAA,CAAI,MAAA,CAAO,iBAAiB,GAAA,GAAMC,GAAAA;AAClC,IAAA,GAAA,CAAI,OAAA,CAAQ,MAAM,EAAE,CAAA;AACpB,IAAA,GAAA,CAAI,OAAA,CAAQ,MAAMA,GAAE,CAAA;AAAA,EACtB;AACF","file":"vue.js","sourcesContent":["/**\n * Prebuilt binary resolution untuk native NAPI bindings.\n * QA #1: Resolve native binary dari prebuilt packages atau local build.\n *\n * Prioritas:\n * 1. TW_NATIVE_PATH env var (explicit override)\n * 2. Prebuilt binary dari platform-specific npm package\n * 3. Local build dari source (developer mode)\n */\n\nimport { createRequire } from \"node:module\"\nimport * as fs from \"node:fs\"\nimport * as path from \"node:path\"\n\nconst isBrowser = typeof window !== \"undefined\" || typeof document !== \"undefined\"\n\n// ESM-safe require — works in both ESM and CJS contexts\nconst _require = typeof require !== \"undefined\" ? require : createRequire(import.meta.url)\n\nexport interface NativeResolutionResult {\n path: string | null\n source: \"env\" | \"prebuilt\" | \"local\" | \"not-found\"\n platform: string\n tried: string[]\n}\n\n/** Platform key → prebuilt npm package name */\nconst PLATFORM_MAP: Record<string, string[]> = {\n \"linux-x64\": [\"@tailwind-styled/native-linux-x64-gnu\", \"@tailwind-styled/native-linux-x64\"],\n \"linux-arm64\": [\"@tailwind-styled/native-linux-arm64-gnu\", \"@tailwind-styled/native-linux-arm64\"],\n \"darwin-x64\": [\"@tailwind-styled/native-darwin-x64\"],\n \"darwin-arm64\": [\"@tailwind-styled/native-darwin-arm64\"],\n \"win32-x64\": [\"@tailwind-styled/native-win32-x64-msvc\", \"@tailwind-styled/native-win32-x64\"],\n \"win32-arm64\": [\"@tailwind-styled/native-win32-arm64-msvc\", \"@tailwind-styled/native-win32-arm64\"],\n}\n\nfunction platformKey(): string {\n if (isBrowser) return \"browser\"\n return `${process.platform}-${process.arch}`\n}\n\n/**\n * Resolve native binary path dari semua sumber yang tersedia.\n *\n * @example\n * const result = resolveNativeBinary()\n * if (result.path) {\n * const binding = require(result.path)\n * } else {\n * throw new Error(\"Native binding not found — run npm run build:rust\")\n * }\n */\nexport function resolveNativeBinary(runtimeDir?: string): NativeResolutionResult {\n const platform = platformKey()\n const tried: string[] = []\n\n if (isBrowser) {\n return { path: null, source: \"not-found\", platform, tried: [\"not available in browser\"] }\n }\n\n // 0. Disabled flag — always short-circuit before any I/O\n // TWS_NO_NATIVE adalah nama canonical; TWS_DISABLE_NATIVE diterima untuk backward compat\n if (process.env.TWS_NO_NATIVE === \"1\" || process.env.TWS_DISABLE_NATIVE === \"1\") {\n return { path: null, source: \"not-found\", platform, tried: [] }\n }\n\n // 1. Env var override\n const envPath = process.env.TW_NATIVE_PATH?.trim()\n if (envPath) {\n if (fs.existsSync(envPath)) {\n return { path: envPath, source: \"env\", platform, tried }\n }\n tried.push(`env:${envPath} (not found)`)\n }\n\n // 2. Prebuilt binary dari platform-specific npm package\n const prebuiltPkgs = PLATFORM_MAP[platform] ?? []\n for (const pkg of prebuiltPkgs) {\n try {\n const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`)\n if (fs.existsSync(candidate)) {\n return { path: candidate, source: \"prebuilt\", platform, tried }\n }\n tried.push(`prebuilt:${pkg} (resolved but missing)`)\n } catch {\n tried.push(`prebuilt:${pkg} (not installed)`)\n }\n }\n\n // 2b. .node file bundled inside this package itself (via \"files\": [\"native/*.node\"])\n // Covers the case where user installs tailwind-styled-v4 directly from npm\n // and the .node file lands at node_modules/tailwind-styled-v4/native/*.node\n const napiPlatform = platform === \"linux-x64\" ? \"linux-x64-gnu\"\n : platform === \"linux-arm64\" ? \"linux-arm64-gnu\"\n : platform\n const BINARY_NAMES_SELF = [\"tailwind-styled-native\", \"tailwind_styled_parser\"]\n if (runtimeDir) {\n // runtimeDir is typically dist/ — go up to package root, then into native/\n for (const depth of [\"..\", path.join(\"..\", \"..\"), path.join(\"..\", \"..\", \"..\")]) {\n const pkgRoot = path.resolve(runtimeDir, depth)\n for (const bin of BINARY_NAMES_SELF) {\n for (const suffix of [\"\", `.${platform}`, `.${napiPlatform}`]) {\n const candidate = path.resolve(pkgRoot, \"native\", `${bin}${suffix}.node`)\n tried.push(`self-bundled:${candidate}`)\n if (fs.existsSync(candidate)) {\n return { path: candidate, source: \"prebuilt\", platform, tried }\n }\n }\n }\n }\n }\n\n // 3. Local build candidates\n const cwd = process.cwd()\n const base = runtimeDir ?? cwd\n // napi-rs naming: platform key may have -gnu suffix on Linux (already computed above)\n\n // Both possible binary names:\n // - \"tailwind_styled_parser\" (old hardcoded name in resolvers)\n // - \"tailwind-styled-native\" (actual binaryName in native/package.json)\n const BINARY_NAMES = [\"tailwind-styled-native\", \"tailwind_styled_parser\"]\n\n const localCandidates: string[] = []\n\n for (const bin of BINARY_NAMES) {\n localCandidates.push(path.resolve(base, `${bin}.node`))\n localCandidates.push(path.resolve(base, \"..\", `${bin}.node`))\n localCandidates.push(path.resolve(base, `${bin}.${platform}.node`))\n localCandidates.push(path.resolve(base, `${bin}.${napiPlatform}.node`))\n }\n\n // Walk up from cwd AND base to find repo root native/ dir\n // Needed when npm workspaces sets cwd to the package subdir\n for (const startDir of [cwd, base]) {\n let dir = startDir\n for (let i = 0; i < 6; i++) {\n const nativeDir = path.resolve(dir, \"native\")\n for (const bin of BINARY_NAMES) {\n localCandidates.push(path.resolve(nativeDir, `${bin}.node`))\n localCandidates.push(path.resolve(nativeDir, `${bin}.${platform}.node`))\n localCandidates.push(path.resolve(nativeDir, `${bin}.${napiPlatform}.node`))\n localCandidates.push(path.resolve(nativeDir, \"target\", \"release\", `${bin}.node`))\n }\n const parent = path.resolve(dir, \"..\")\n if (parent === dir) break\n dir = parent\n }\n }\n\n for (const candidate of localCandidates) {\n tried.push(`local:${candidate}`)\n if (fs.existsSync(candidate)) {\n return { path: candidate, source: \"local\", platform, tried }\n }\n }\n\n return { path: null, source: \"not-found\", platform, tried }\n}\n\n/**\n * Format human-readable error untuk \"binary not found\".\n */\nexport function formatNativeNotFoundError(result: NativeResolutionResult): string {\n const lines = [\n `[tailwind-styled] Native binding not found for ${result.platform}`,\n ``,\n `Tried:`,\n ...result.tried.map(t => ` - ${t}`),\n ``,\n `Solutions:`,\n ` 1. Build locally: npm run build:rust`,\n ` 2. Install prebuilt: npm install @tailwind-styled/native-${result.platform}`,\n ` 3. Override path: TW_NATIVE_PATH=/path/to/parser.node`,\n ]\n return lines.join(\"\\n\")\n}","import { createHash } from \"node:crypto\"\nimport fs from \"node:fs\"\nimport path from \"node:path\"\nimport { fileURLToPath } from \"node:url\"\nimport { createRequire } from \"node:module\"\n\n// Native-only: Node.js is always available. No browser fallback.\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Types\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type TokenMap = Record<string, string>\n\nexport type VariantValue = string | number | boolean | undefined\n\nexport type VariantProps = Record<string, VariantValue>\n\nexport type HtmlTagName = keyof HTMLElementTagNameMap\n\nexport type CompoundCondition = Record<string, string | number | boolean>\n\nexport type VariantMatrix = Record<string, Array<string | number | boolean>>\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Logging\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface Logger {\n warn(...args: unknown[]): void\n debug(...args: unknown[]): void\n error(...args: unknown[]): void\n log(...args: unknown[]): void\n}\n\nexport function createLogger(namespace: string): Logger {\n const prefix = `[${namespace}]`\n return {\n warn(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n debug(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n error(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n log(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n }\n}\n\nexport function createDebugLogger(namespace: string, label?: string): (msg: string) => void {\n const prefix = label ? `[${namespace}:${label}]` : `[${namespace}]`\n return (msg: string) => {\n if (process.env.DEBUG?.includes(namespace) || process.env.TW_DEBUG) {\n console.debug(prefix, msg)\n }\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error handling\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type ErrorSource = \"rust\" | \"validation\" | \"compile\" | \"io\" | \"config\" | \"unknown\"\n\ntype ZodLikeIssue = {\n path?: readonly PropertyKey[]\n message?: string\n}\n\nfunction formatIssuePath(path?: readonly PropertyKey[]): string {\n if (!path || path.length === 0) return \"(root)\"\n return path\n .map((segment) =>\n typeof segment === \"symbol\" ? segment.description ?? segment.toString() : String(segment)\n )\n .join(\".\")\n}\n\nexport class TwError extends Error {\n /** @deprecated Gunakan source */\n public readonly domain: string\n public readonly source: ErrorSource\n public readonly code: string\n public readonly originalCause?: unknown\n\n constructor(domainOrSource: string, code: string, message: string, cause?: unknown) {\n super(message)\n this.name = \"TwError\"\n this.domain = domainOrSource\n this.source = domainOrSource as ErrorSource\n this.code = code\n this.originalCause = cause\n if (Error.captureStackTrace) Error.captureStackTrace(this, TwError)\n }\n\n static fromIo(code: string, message: string): TwError {\n return new TwError(\"io\", code, message)\n }\n\n static fromCompile(code: string, message: string): TwError {\n return new TwError(\"compile\", code, message)\n }\n\n static fromRust(err: { code?: string; message?: string } | Error | unknown): TwError {\n if (err instanceof TwError) return err\n if (err instanceof Error) return new TwError(\"rust\", \"RUST_ERROR\", err.message, err)\n if (err && typeof err === \"object\") {\n const e = err as { code?: string; message?: string }\n return new TwError(\"rust\", e.code ?? \"RUST_ERROR\", e.message ?? String(err), err)\n }\n return new TwError(\"rust\", \"RUST_ERROR\", String(err), err)\n }\n\n /** Buat TwError dari ZodError — dukung shape Zod v3 (`errors`) dan v4 (`issues`). */\n static fromZod(err: { issues?: ZodLikeIssue[]; errors?: ZodLikeIssue[] }): TwError {\n const first = err.issues?.[0] ?? err.errors?.[0]\n const path = formatIssuePath(first?.path)\n const message = first ? `${path}: ${first.message}` : \"Schema validation failed\"\n return new TwError(\"validation\", \"SCHEMA_VALIDATION_FAILED\", message, err)\n }\n\n static wrap(source: string, code: string, err: unknown): TwError {\n if (err instanceof TwError) return err\n if (err instanceof Error) return new TwError(source, code, err.message, err)\n return new TwError(source, code, String(err), err)\n }\n\n override toString(): string {\n return `TwError [${this.source}:${this.code}] ${this.message}`\n }\n\n toJSON(): { name: string; source: string; code: string; message: string } {\n return { name: this.name, source: this.source, code: this.code, message: this.message }\n }\n\n toCliMessage(): string {\n return `[${this.source.toUpperCase()}:${this.code}] ${this.message}`\n }\n}\n\nexport function wrapUnknownError(domain: string, code: string, error: unknown): TwError {\n return TwError.wrap(domain, code, error)\n}\n\nexport function isTwError(err: unknown): err is TwError {\n return err instanceof TwError\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Native binding resolution\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface LoadNativeBindingOptions<T> {\n runtimeDir: string\n candidates: string[]\n isValid: (module: unknown) => module is T\n invalidExportMessage: string\n}\n\nexport interface LoadNativeBindingResult<T> {\n binding: T | null\n loadErrors: Array<{ path: string; message: string }>\n loadedPath?: string\n}\n\nexport function loadNativeBinding<T>(options: LoadNativeBindingOptions<T>): LoadNativeBindingResult<T> {\n const { runtimeDir, candidates, isValid } = options\n const loadErrors: Array<{ path: string; message: string }> = []\n\n for (const candidate of candidates) {\n const candidatePath = path.resolve(runtimeDir, candidate)\n try {\n if (!fs.existsSync(candidatePath) && !fs.existsSync(candidatePath + \".node\")) {\n continue\n }\n const mod = requireNativeModule(candidatePath)\n if (mod && isValid(mod)) {\n return { binding: mod, loadErrors, loadedPath: candidatePath }\n }\n loadErrors.push({ path: candidatePath, message: options.invalidExportMessage })\n } catch (e) {\n loadErrors.push({ path: candidatePath, message: e instanceof Error ? e.message : String(e) })\n }\n }\n\n return { binding: null, loadErrors }\n}\n\nconst _require = createRequire(import.meta.url)\n\nfunction requireNativeModule(p: string): unknown {\n return _require(p)\n}\n\nexport interface ResolveCandidatesOptions {\n runtimeDir?: string\n envVarNames?: string[]\n includeDefaultCandidates?: boolean\n enforceNodeExtensionForEnvPath?: boolean\n /** @deprecated — ignored, kept for backward compat */\n packageName?: string\n}\n\nexport function resolveNativeBindingCandidates(options: ResolveCandidatesOptions): string[] {\n const {\n envVarNames = [\"TW_NATIVE_PATH\", \"TWS_NATIVE_PATH\"],\n includeDefaultCandidates = true,\n enforceNodeExtensionForEnvPath = false,\n } = options\n // Default ke cwd kalau runtimeDir tidak disediakan\n const runtimeDir = options.runtimeDir || process.cwd()\n const candidates: string[] = []\n\n for (const envVar of envVarNames) {\n const envPath = process.env[envVar]\n if (envPath) {\n candidates.push(enforceNodeExtensionForEnvPath && !envPath.endsWith(\".node\") ? envPath + \".node\" : envPath)\n }\n }\n\n if (!includeDefaultCandidates) return candidates\n\n if (fs.existsSync(runtimeDir)) {\n try {\n for (const entry of fs.readdirSync(runtimeDir)) {\n if (entry.endsWith(\".node\")) candidates.push(entry)\n }\n } catch { /* ignore read errors */ }\n }\n\n const BINARY_NAMES = [\"tailwind-styled-native\", \"tailwind_styled_parser\"]\n const napiPlatform = process.platform === \"linux\" && process.arch === \"x64\" ? \"linux-x64-gnu\"\n : process.platform === \"linux\" && process.arch === \"arm64\" ? \"linux-arm64-gnu\"\n : `${process.platform}-${process.arch}`\n\n for (const bin of BINARY_NAMES) {\n candidates.push(path.resolve(runtimeDir, `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, `${bin}.${napiPlatform}.node`))\n // 1 level: dist/ → package-root/native/ (published npm package)\n candidates.push(path.resolve(runtimeDir, \"..\", \"native\", `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, \"..\", \"native\", `${bin}.${napiPlatform}.node`))\n // cwd fallback (user project root)\n candidates.push(path.resolve(process.cwd(), \"native\", `${bin}.node`))\n candidates.push(path.resolve(process.cwd(), \"native\", `${bin}.${napiPlatform}.node`))\n // 4 level: dist/ → package/ → domain/ → packages/ → repo-root/ (monorepo dev)\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"..\", \"native\", `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"..\", \"native\", `${bin}.${napiPlatform}.node`))\n // 3 level fallback\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"native\", `${bin}.node`))\n }\n\n return Array.from(new Set(candidates))\n}\n\nexport function resolveRuntimeDir(dir: string | undefined, importMetaUrl: string): string {\n if (dir) return path.resolve(dir)\n try {\n return path.dirname(fileURLToPath(importMetaUrl))\n } catch {\n return process.cwd()\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Hashing\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function hashContent(content: string, algorithm: string = \"md5\", length?: number): string {\n const hash = createHash(algorithm).update(content).digest(\"hex\")\n return length ? hash.slice(0, length) : hash\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error formatting\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function formatErrorMessage(error: unknown): string {\n if (error instanceof TwError) return error.toString()\n if (error instanceof Error) return error.message\n return String(error)\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// LRU Cache\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport class LRUCache<K, V> {\n private capacity: number\n private cache: Map<K, V>\n\n constructor(capacity: number) {\n this.capacity = capacity\n this.cache = new Map()\n }\n\n get(key: K): V | undefined {\n if (!this.cache.has(key)) return undefined\n const value = this.cache.get(key)!\n this.cache.delete(key)\n this.cache.set(key, value)\n return value\n }\n\n set(key: K, value: V): void {\n if (this.cache.has(key)) {\n this.cache.delete(key)\n } else if (this.cache.size >= this.capacity) {\n const firstKey = this.cache.keys().next().value\n if (firstKey !== undefined) {\n this.cache.delete(firstKey)\n }\n }\n this.cache.set(key, value)\n }\n\n delete(key: K): boolean {\n return this.cache.delete(key)\n }\n\n has(key: K): boolean {\n return this.cache.has(key)\n }\n\n clear(): void {\n this.cache.clear()\n }\n\n entries(): IterableIterator<[K, V]> {\n return this.cache.entries()\n }\n\n get size(): number {\n return this.cache.size\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Trace Utilities\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { TraceSnapshot, TraceSummary } from \"./trace\"\nexport {\n getHealthColor,\n getModeColor,\n formatMemory,\n formatDuration,\n calculateHealth,\n getBuildTimeColor,\n getMemoryColor,\n createTraceSnapshot,\n getPipelinePercentages,\n} from \"./trace\"\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Performance Telemetry\n// ─────────────────────────────────────────────────────────────────────────────\n\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error Codes\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { ErrorCode } from \"./error-codes\"\nexport { ERROR_CODES, getSuggestion, formatErrorCode } from \"./error-codes\"\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Tailwind Compatibility\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { TailwindInfo } from \"./compatibility\"\nexport { detectTailwind, assertTailwindV4, getTailwindVersion, isTailwindV4 } from \"./compatibility\"\n\n// ── Native binding schemas (Zod boundary validation)\nexport {\n NativeScanFileSchema, NativeScanResultSchema,\n NativeAnalyzerReportSchema, NativeTransformResultSchema,\n NativeCssCompileResultSchema, NativeWatchResultSchema,\n NativeCacheEntrySchema, NativeCacheReadResultSchema,\n safeParseNative, parseNative,\n} from './native-schemas'\n\n// ── ESM-safe runtime helpers ──────────────────────────────────────────────\nexport {\n createEsmRequire,\n getDirname,\n getFilename,\n resolveFromRoot,\n tryRequire,\n resolveNativeNodePath,\n} from \"./esmHelpers\"\n\n// ── Performance telemetry ────────────────────────────────────────────────────\nexport {\n TelemetryCollector,\n getGlobalTelemetry,\n resetGlobalTelemetry,\n createBuildTimer,\n type BuildTelemetry,\n type TelemetrySummary,\n type BuildPhases,\n} from \"./telemetry\"\n\n// ── Config/JSON schema validation ─────────────────────────────────────────────\nexport {\n ScanCacheSchema,\n ScanCacheClassEntrySchema,\n TailwindConfigSchema,\n RegistryPluginEntrySchema,\n RegistryFileSchema,\n PackageJsonSchema,\n parseJsonWithSchema,\n parseJsonFileWithSchema,\n type ScanCache,\n type ScanCacheClassEntry,\n type TailwindConfig,\n type RegistryPluginEntry,\n type RegistryFile,\n type PackageJson,\n} from \"./configSchemas\"\n\n// ── Worker/bootstrap path resolution ─────────────────────────────────────────\nexport {\n resolveWorkerPath,\n resolveLoaderPath,\n type WorkerPathOptions,\n type WorkerPathResult,\n} from \"./workerResolver\"\n\n// ── Codegen helpers ───────────────────────────────────────────────────────────\nexport {\n generateComponentCode,\n generateStorybookStory,\n generateClassRenameCodemod,\n generateBarrelFile,\n type ComponentCodegenOptions,\n} from \"./codegen\"\n\n// ── Native binary resolution (QA #1) ─────────────────────────────────────────\nexport {\n resolveNativeBinary,\n formatNativeNotFoundError,\n type NativeResolutionResult,\n} from \"./native-resolution\"\n\n// ── Shared observability contract ────────────────────────────────────────────\nexport {\n createObservabilityClient,\n type ClassInspection,\n type ClassProperty,\n type ClassUsageLocation,\n type BuildTrace,\n type BuildPhaseTrace,\n type DashboardMetrics,\n type DashboardSummary,\n type ObservabilityClient,\n} from \"./observability\"\n\nexport {\n TW_STATE_STATIC_FILENAME,\n extractStaticStateCss,\n appendStaticStateCssToSafelist,\n type TwStateConfigEntry,\n type StaticStateCssInput,\n type GeneratedStateRule,\n type StaticStateExtractionResult,\n} from \"./staticStateExtractor\"\nexport { setGlobalLogFile } from \"./logger\"","/**\n * tailwind-styled-v5 — Native Rust Bindings\n *\n * All functions require native Rust bindings.\n * Uses @tailwind-styled/shared for native resolution.\n */\n\nimport { createRequire } from \"node:module\"\nimport { dirname } from \"node:path\"\nimport { fileURLToPath } from \"node:url\"\nimport { resolveNativeBinary } from \"@tailwind-styled/shared\"\n\nconst isBrowser = typeof window !== \"undefined\" || typeof document !== \"undefined\"\nconst NATIVE_UNAVAILABLE_MESSAGE =\n \"[tailwind-styled/core] Native binding is required but not available.\\n\" +\n \"Please ensure you have run: npm run build:rust\"\n\nconst _nodeRequire = createRequire(import.meta.url)\nconst _loadNative = (path: string): unknown => _nodeRequire(path)\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Type Definitions\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface ParsedClassModifier {\n type: \"opacity\" | \"arbitrary\"\n value: string\n}\n\nexport interface ParsedClass {\n raw: string\n base: string\n variants: string[]\n modifier?: ParsedClassModifier\n}\n\nexport interface ThemeConfig {\n colors: Record<string, string>\n spacing: Record<string, string>\n fonts: Record<string, string>\n breakpoints: Record<string, string>\n animations: Record<string, string>\n raw: Record<string, string>\n}\n\ninterface NativeBinding {\n batchSplitClasses?: (input: string[]) => Array<{\n variantKey: string\n base: string\n variants: string[]\n isArbitrary: boolean\n hasModifier: boolean\n }>\n \n twMergeRaw?: (classLists: string[]) => string\n flattenAndResolve?: (nestedJson: string) => string\n resolveConflictGroup?: (base: string) => string\n\n compileTheme?: (themeConfig: string) => { css: string; variables: Record<string, string> }\n extractCssVars?: (css: string) => Record<string, string>\n extractThemeFromCss?: (css: string) => Array<{ key: string; value: string }>\n parseCssRules?: (css: string) => Array<{\n className: string\n property: string\n value: string\n isImportant: boolean\n variants: string[]\n specificity: number\n }>\n parseCssToRules?: (css: string) => string\n detectDeadCode?: (css: string, usedClasses: string[]) => string[]\n classifyKnownClasses?: (classes: string[]) => Array<{ className: string; category: string }>\n detectClassConflicts?: (classes: string) => { conflicts: Array<{ class1: string; class2: string; reason: string }>; conflictedClassNames: string[] }\n resolveVariants?: (configJson: string, propsJson: string) => { classes: string; resolvedCount: number }\n resolveSimpleVariants?: (base: string | null, variants: Record<string, Record<string, string>>, defaults: Record<string, string>, props: Record<string, string>) => string\n /** Parse template literal yang sudah di-join. Menggantikan parseTemplate() di twProxy.ts */\n parseTemplate?: (raw: string) => {\n base: string\n subsJson: string\n hasSubs: boolean\n }\n /** Validate ComponentConfig — menggantikan validateVariantConfig() di cv.ts */\n validateVariantConfig?: (configJson: string) => {\n valid: boolean\n errors: Array<{ errorType: string; key: string; value?: string; message: string }>\n warnings: string[]\n }\n /** Build lookup key untuk generated registry — menggantikan key builder di lookupGenerated() */\n buildVariantLookupKey?: (defaultVariantsJson: string, propsJson: string) => string\n /** Menggantikan cn() — filter+join class names dalam satu Rust pass. (class_utils.rs) */\n resolveClassNames?: (inputs: string[]) => string\n /** tw_merge dengan custom separator dan optional debug */\n twMergeWithSeparator?: (classString: string, opts: { separator?: string; debug?: boolean }) => string\n /** tw_merge_many dengan custom separator */\n twMergeManyWithSeparator?: (classStrings: string[], opts: { separator?: string; debug?: boolean }) => string\n /** conflict-aware Tailwind class merger — port of tailwind-merge. (tw_merge.rs) */\n twMerge?: (classString: string) => string\n /** variadic convenience wrapper untuk twMerge. (tw_merge.rs) */\n twMergeMany?: (classStrings: string[]) => string\n /** Tailwind classes → semicolon-separated inline CSS declarations. (state_css.rs) */\n twClassesToCss?: (classes: string) => string\n /**\n * Generate semua CSS rules untuk satu component dari state config — satu Rust call.\n *\n * Menggantikan JS loop di `injectStateStyles()` dan `generateStateCss()` yang\n * memanggil `twClassesToCss()` per state entry (N × NAPI calls → 1 call).\n *\n * @param id Component state class, e.g. `\"tw-s-abc123\"`\n * @param stateMapJson JSON object `{\"loading\":\"opacity-60 cursor-wait\",\"selected\":\"ring-2\"}`\n * @param resolvedCss Opsional Tailwind pipeline CSS untuk resolve named classes\n * @returns Array of `{ cssRule, stateName, declarations }` — satu per state entry\n */\n generateRuntimeStateCss?: (\n id: string,\n stateMapJson: string,\n resolvedCss: string | null\n ) => Array<{ cssRule: string; stateName: string; declarations: string }>\n /**\n * Hash a content string — menggantikan JS djb2 loop di hashState() dan hashContainer().\n * algorithm: \"md5\" | \"sha256\" | \"fnv\" | \"ahash\" (default: \"md5\")\n * length: potong output hex ke N karakter (mis. 6 untuk short ID)\n */\n hashContent?: (content: string, algorithm?: \"md5\" | \"sha256\" | \"fnv\" | \"ahash\", length?: number) => string\n /** Iterative CSS var() chain resolver. (theme.rs) */\n resolveThemeValue?: (key: string, rawMapJson: string) => string\n /**\n * Parse @theme CSS blocks, classify tokens ke buckets, resolve semua var() —\n * satu Rust call menggantikan extractThemeFromCss() + N × resolveThemeValue().\n * Return ClassifiedThemeConfig: { colors, spacing, fonts, breakpoints, animations, raw }\n */\n extractThemeFromCssClassified?: (css: string) => {\n colors: Record<string, string>\n spacing: Record<string, string>\n fonts: Record<string, string>\n breakpoints: Record<string, string>\n animations: Record<string, string>\n raw: Record<string, string>\n }\n /**\n * Generate TypeScript interface TailwindStyledThemeTokens dari theme JSON.\n * Build-time CLI only (tw generate-types). Menggantikan generateTypeDefinitions() JS.\n */\n generateTypeDefinitions?: (themeJson: string) => string\n /**\n * Generate `:root { --prefix-group-name: value; ... }` CSS block dari SystemTokenMap.\n *\n * Menggantikan nested JS loop di `injectTokensToRoot()` dan `setTokens()` di `styledSystem.ts`.\n *\n * `tokensJson`: JSON dari `SystemTokenMap` — `{\"colors\":{\"primary\":\"#6366f1\"},\"radius\":{\"base\":\"0.5rem\"}}`\n * `prefix`: CSS variable prefix, e.g. `\"sys\"` → `--sys-colors-primary`\n */\n generateSystemTokenCss?: (tokensJson: string, prefix: string) => string\n /** Parse sub-component block syntax from tw`` template. (tw_merge.rs) */\n parseSubcomponentBlocksNapi?: (template: string, componentName: string) => {\n baseClasses: string\n subMapJson: string\n }\n /** Menggantikan layoutClassesToCss() — static lookup + split dalam satu Rust pass. (container_query.rs) */\n layoutClassesToCss?: (classes: string) => string\n /** Menggantikan buildContainerRules() — generate @container CSS rules. (container_query.rs) */\n buildContainerRules?: (\n id: string,\n breakpoints: Array<{ key: string; classes: string }>,\n containerName: string | null\n ) => string\n /** Pre-generate semua kombinasi boolean states via bitmask (tw_merge.rs) */\n pregenerateStatesNapi?: (states: Record<string, string>) => {\n lookupJson: string\n stateKeys: string[]\n combinations: number\n }\n\n // ── Theme Parsing (napi_bridge_theme_parsing.rs) ───────────────────────────\n parseColorsNapi?: (colorsJson: string) => string | Record<string, string>\n parseSpacingNapi?: (spacingJson: string) => string | Record<string, string>\n parseTransformNapi?: (transformJson: string) => string | Record<string, string>\n normalizeColorNapi?: (color: string, opacity: string) => string\n sanitizeColorNapi?: (color: string) => string\n splitRgbaNapi?: (color: string) => string | { r: number; g: number; b: number; a: number }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Binding Loader\n// ─────────────────────────────────────────────────────────────────────────────\n\nlet nativeBinding: NativeBinding | null = null\nlet bindingLoadAttempted = false\n\nconst getBinding = (): NativeBinding => {\n if (isBrowser) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE + \"\\n\\nNative bindings are not available in browser. Use the compiled CSS output instead.\")\n }\n \n if (nativeBinding) return nativeBinding\n\n if (bindingLoadAttempted) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n\n bindingLoadAttempted = true\n\n try {\n const runtimeDir = isBrowser ? \"\" : dirname(fileURLToPath(import.meta.url))\n const result = isBrowser\n ? { path: null, source: \"not-found\", platform: \"browser\", tried: [] }\n : resolveNativeBinary(runtimeDir)\n\n if (result.path && result.path.endsWith(\".node\")) {\n const mod = _loadNative(result.path) as NativeBinding\n if (mod?.batchSplitClasses) {\n nativeBinding = mod\n return nativeBinding\n }\n }\n\n throw new Error(`${NATIVE_UNAVAILABLE_MESSAGE}\\n\\nTried: ${result.tried.join(\"\\n\")}`)\n } catch (err) {\n throw err instanceof Error ? err : new Error(String(err))\n }\n}\n\nexport const resetNativeBinding = (): void => {\n nativeBinding = null\n bindingLoadAttempted = false\n}\n\nexport const getNativeBinding = getBinding\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Parser Functions\n// ─────────────────────────────────────────────────────────────────────────────\n\nfunction splitClassListNative(input: string): string[] {\n const binding = getBinding()\n if (!binding?.batchSplitClasses) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n const result = binding.batchSplitClasses([input])\n if (result.length === 0) return []\n return result[0].base.split(\" \").filter(Boolean)\n}\n\nfunction parseClassTokenNative(rawToken: string): ParsedClass {\n const binding = getBinding()\n if (!binding?.batchSplitClasses) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n const result = binding.batchSplitClasses([rawToken])\n if (result.length === 0) {\n return { raw: rawToken, base: rawToken, variants: [] }\n }\n const r = result[0]\n const parsed: ParsedClass = {\n raw: r.base,\n base: r.base,\n variants: r.variants,\n }\n if (r.hasModifier) {\n const opacityMatch = r.base.match(/^(.*)\\/(\\d{1,3})$/)\n if (opacityMatch && opacityMatch[1].length > 0) {\n parsed.base = opacityMatch[1]\n parsed.modifier = { type: \"opacity\", value: opacityMatch[2] }\n } else {\n const arbitraryMatch = r.base.match(/\\((--[a-zA-Z0-9_-]+)\\)/)\n if (arbitraryMatch) {\n parsed.modifier = { type: \"arbitrary\", value: arbitraryMatch[1] }\n }\n }\n }\n return parsed\n}\n\nexport function splitClassList(input: string): string[] {\n return splitClassListNative(input)\n}\n\nexport function parseClassToken(rawToken: string): ParsedClass {\n return parseClassTokenNative(rawToken)\n}\n\nexport function parseTailwindClasses(input: string): ParsedClass[] {\n const classes = splitClassListNative(input)\n return classes.map((c) => parseClassTokenNative(c))\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// CSS/Theme Functions\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function compileTheme(themeConfig: Record<string, unknown>) {\n const binding = getBinding()\n if (!binding?.compileTheme) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.compileTheme(JSON.stringify(themeConfig))\n}\n\nexport function extractCssVars(css: string): Record<string, string> {\n const binding = getBinding()\n if (!binding?.extractCssVars) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.extractCssVars(css)\n}\n\nexport function parseCssRules(css: string) {\n const binding = getBinding()\n if (!binding?.parseCssRules) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.parseCssRules(css)\n}\n\nexport function parseCssToRules(css: string): string {\n const binding = getBinding()\n if (!binding?.parseCssToRules) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.parseCssToRules(css)\n}\n\nexport function detectDeadCode(css: string, usedClasses: string[]): string[] {\n const binding = getBinding()\n if (!binding?.detectDeadCode) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.detectDeadCode(css, usedClasses)\n}\n\nexport function classifyKnownClasses(classes: string[]) {\n const binding = getBinding()\n if (!binding?.classifyKnownClasses) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.classifyKnownClasses(classes)\n}\n\nexport function detectClassConflicts(classes: string[]) {\n const binding = getBinding()\n if (!binding?.detectClassConflicts) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.detectClassConflicts(classes.join(\" \"))\n}\n\nexport function extractThemeFromCSS(cssContent: string): ThemeConfig {\n const binding = getBinding()\n if (!binding?.parseCssRules) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n \n const properties = binding.parseCssRules(cssContent)\n const theme: ThemeConfig = {\n colors: {},\n spacing: {},\n fonts: {},\n breakpoints: {},\n animations: {},\n raw: {},\n }\n \n const prefixMap: Record<string, keyof ThemeConfig> = {\n \"color-\": \"colors\",\n \"spacing-\": \"spacing\",\n \"font-\": \"fonts\",\n \"breakpoint-\": \"breakpoints\",\n \"animate-\": \"animations\",\n }\n \n for (const prop of properties) {\n const cssVar = prop.property.replace(/^--/, \"\")\n theme.raw[cssVar] = prop.value\n \n for (const [prefix, category] of Object.entries(prefixMap)) {\n if (cssVar.startsWith(prefix)) {\n const name = cssVar.slice(prefix.length)\n if (name) theme[category][name] = prop.value\n break\n }\n }\n }\n \n return theme\n}","/**\n * tailwind-styled-v4 — createTwMerge()\n * Pure Node.js — requires native Rust binding.\n */\n\nimport { getNativeBinding } from \"./native\"\nimport type { ThemeConfig } from \"./themeReader\"\n\nexport interface MergeOptions {\n prefix?: string\n separator?: string\n theme?: ThemeConfig\n}\n\nexport function createTwMerge(_options: MergeOptions = {}) {\n return function twMerge(...classLists: Array<string | undefined | null | false>): string {\n const inputs: string[] = []\n for (let i = 0; i < classLists.length; i++) {\n const v = classLists[i]\n if (v) inputs.push(String(v))\n }\n if (inputs.length === 0) return \"\"\n\n const native = getNativeBinding()\n if (!native?.twMergeRaw) {\n throw new Error(\"Native binding 'twMergeRaw' is required but not available.\")\n }\n return native.twMergeRaw(inputs)\n }\n}\n\nexport const twMerge = createTwMerge()\n\nexport function mergeWithRules(\n rules: Record<string, (classes: string[]) => string>,\n ...classLists: string[]\n): string {\n const base = twMerge(...classLists)\n const classes = Object.values(rules).reduce(\n (acc, rule) => twMerge(rule(acc)).split(/\\s+/).filter(Boolean),\n base.split(/\\s+/).filter(Boolean)\n )\n return classes.join(\" \")\n}","/**\n * tailwind-styled-v4 — Vue Adapter\n *\n * Pola seperti `createComponent` di React tapi untuk Vue 3 Composition API.\n * Mendukung: base, variants, defaultVariants, compoundVariants.\n *\n * @example\n * import { tw } from '@tailwind-styled/vue'\n *\n * const Button = tw('button', {\n * base: 'px-4 py-2 rounded font-medium',\n * variants: {\n * intent: {\n * primary: 'bg-blue-500 text-white hover:bg-blue-600',\n * danger: 'bg-red-500 text-white hover:bg-red-600',\n * },\n * size: { sm: 'h-8 text-sm', md: 'h-10 text-base', lg: 'h-12 text-lg' },\n * },\n * defaultVariants: { intent: 'primary', size: 'md' },\n * })\n *\n * // In template:\n * // <Button intent=\"danger\" size=\"lg\">Delete</Button>\n */\n\nimport { twMerge } from \"@tailwind-styled/core\"\nimport { type App, type Component, computed, type DefineComponent, defineComponent, h } from \"vue\"\n\nimport type { VariantValue, VariantProps as Props, HtmlTagName as HtmlTag } from '@tailwind-styled/shared'\n\n\nconst isVariantValue = (value: unknown): value is VariantValue =>\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\" ||\n value === undefined\n\nconst toVariantProps = (input: Record<string, unknown>): Props => {\n const props: Props = {}\n for (const [key, value] of Object.entries(input)) {\n if (isVariantValue(value)) {\n props[key] = value\n }\n }\n return props\n}\n\nconst toClassName = (value: VariantValue): string | undefined => {\n if (typeof value === \"string\") return value\n if (typeof value === \"number\") return String(value)\n return undefined\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Types\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface VueComponentConfig {\n base?: string\n variants?: Record<string, Record<string, string>>\n compoundVariants?: Array<{ class: string; [key: string]: VariantValue }>\n defaultVariants?: Record<string, string>\n}\n\nexport type HtmlTagName = HtmlTag\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Variant resolver (sama dengan React adapter)\n// ─────────────────────────────────────────────────────────────────────────────\n\nfunction resolveVariants(\n variants: Record<string, Record<string, string>>,\n props: Props,\n defaults: Record<string, string> = {}\n): string {\n const classes: string[] = []\n for (const key in variants) {\n const val = props[key] ?? defaults[key]\n if (val !== undefined && variants[key][String(val)]) {\n classes.push(variants[key][String(val)])\n }\n }\n return classes.join(\" \")\n}\n\nfunction resolveCompound(\n compounds: Array<{ class: string; [key: string]: VariantValue }>,\n props: Props\n): string {\n return compounds\n .filter((c) => {\n const { class: _cls, ...conditions } = c\n return Object.entries(conditions).every(([k, v]) => props[k] === v)\n })\n .map((c) => c.class)\n .join(\" \")\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Core factory\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Buat Vue component dengan Tailwind class yang terstruktur.\n *\n * @param tag - HTML tag atau Vue component\n * @param config - Konfigurasi base, variants, defaultVariants\n */\nexport function tw<Tag extends HtmlTag>(\n tag: Tag,\n config: VueComponentConfig = {}\n): DefineComponent<Record<string, unknown>> {\n const { base = \"\", variants = {}, compoundVariants = [], defaultVariants = {} } = config\n\n const variantKeys = new Set(Object.keys(variants))\n\n // Props definition untuk Vue — semua variant key jadi optional prop\n const propsDefinition: Record<string, { type: null; default: undefined }> = {}\n for (const key of variantKeys) {\n propsDefinition[key] = { type: null, default: undefined }\n }\n propsDefinition.class = { type: null, default: undefined }\n\n return defineComponent({\n name: `TwStyled${String(tag).charAt(0).toUpperCase() + String(tag).slice(1)}`,\n inheritAttrs: false,\n props: propsDefinition,\n setup(props, { attrs, slots }) {\n const className = computed(() => {\n const variantProps = toVariantProps(props as Record<string, unknown>)\n const attrProps = toVariantProps(attrs as Record<string, unknown>)\n const mergedProps = { ...defaultVariants, ...variantProps, ...attrProps }\n const variantClasses = resolveVariants(variants, mergedProps, defaultVariants)\n const compoundClasses = resolveCompound(compoundVariants, mergedProps)\n return twMerge(\n base,\n variantClasses,\n compoundClasses,\n toClassName(variantProps.class),\n toClassName(attrProps.class)\n )\n })\n\n return () => {\n // Filter out variant props — jangan diteruskan ke HTML element\n const filteredAttrs: Record<string, unknown> = {}\n for (const key in attrs) {\n if (!variantKeys.has(key)) {\n filteredAttrs[key] = attrs[key]\n }\n }\n\n return h(tag as string, { ...filteredAttrs, class: className.value }, slots.default?.())\n }\n },\n })\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// cv() — class variant helper (framework-agnostic, sama dengan React)\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Class variant function — returns a class string resolver.\n * Framework-agnostic, bisa dipakai di mana saja.\n *\n * @example\n * const buttonCv = cv({\n * base: 'px-4 py-2 rounded',\n * variants: { size: { sm: 'h-8', lg: 'h-12' } },\n * defaultVariants: { size: 'sm' },\n * })\n *\n * buttonCv({ size: 'lg' }) // 'px-4 py-2 rounded h-12'\n */\nexport function cv(config: VueComponentConfig) {\n return (props: Props = {}) => {\n const { base = \"\", variants = {}, compoundVariants = [], defaultVariants = {} } = config\n const merged = { ...defaultVariants, ...props }\n const variantClasses = resolveVariants(variants, merged, defaultVariants)\n const compoundClasses = resolveCompound(compoundVariants, merged)\n return twMerge(base, variantClasses, compoundClasses, toClassName(props.class))\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Extend — tambahkan class ke komponen yang sudah ada\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Extend komponen Vue yang sudah ada dengan class tambahan.\n *\n * @example\n * const PrimaryButton = extend(Button, 'bg-blue-500 text-white')\n */\nexport function extend(\n component: Component,\n extraClasses: string\n): DefineComponent<Record<string, unknown>> {\n return defineComponent({\n name: `Extended${(\"name\" in component ? component.name : undefined) ?? \"Component\"}`,\n inheritAttrs: false,\n props: { class: { type: null, default: undefined } },\n setup(props, { attrs, slots }) {\n return () =>\n h(\n component,\n {\n ...attrs,\n class: twMerge(extraClasses, props.class as string, attrs.class as string),\n },\n slots.default?.()\n )\n },\n })\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Plugin Vue\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Vue plugin — daftarkan `tw` sebagai global composable.\n *\n * @example\n * // main.ts\n * import { createApp } from 'vue'\n * import { TailwindStyledPlugin } from '@tailwind-styled/vue'\n * import App from './App.vue'\n *\n * createApp(App).use(TailwindStyledPlugin).mount('#app')\n */\nexport const TailwindStyledPlugin = {\n install(app: App) {\n app.config.globalProperties.$tw = tw\n app.config.globalProperties.$cv = cv\n app.provide(\"tw\", tw)\n app.provide(\"cv\", cv)\n },\n}\n"]}
1
+ {"version":3,"sources":["../packages/domain/shared/src/native-resolution.ts","../packages/domain/shared/src/index.ts","../src/umbrella/vue.ts","../packages/domain/core/src/native.ts","../packages/domain/core/src/merge.ts","../packages/presentation/vue/src/index.ts"],"sourcesContent":["/**\n * Prebuilt binary resolution untuk native NAPI bindings.\n * QA #1: Resolve native binary dari prebuilt packages atau local build.\n *\n * Prioritas:\n * 1. TW_NATIVE_PATH env var (explicit override)\n * 2. Prebuilt binary dari platform-specific npm package\n * 3. Local build dari source (developer mode)\n */\n\nimport { createRequire } from \"node:module\"\nimport * as fs from \"node:fs\"\nimport * as path from \"node:path\"\n\nconst isBrowser = typeof window !== \"undefined\" || typeof document !== \"undefined\"\n\n// ESM-safe require — works in both ESM and CJS contexts\nconst _require = createRequire(\n typeof require !== \"undefined\"\n ? (typeof __filename !== \"undefined\" ? `file://${__filename}` : \"file://unknown\")\n : import.meta.url\n)\n\nexport interface NativeResolutionResult {\n path: string | null\n source: \"env\" | \"prebuilt\" | \"local\" | \"not-found\"\n platform: string\n tried: string[]\n}\n\n/** Platform key → prebuilt npm package name */\nconst PLATFORM_MAP: Record<string, string[]> = {\n \"linux-x64\": [\"@tailwind-styled/native-linux-x64-gnu\", \"@tailwind-styled/native-linux-x64\"],\n \"linux-arm64\": [\"@tailwind-styled/native-linux-arm64-gnu\", \"@tailwind-styled/native-linux-arm64\"],\n \"darwin-x64\": [\"@tailwind-styled/native-darwin-x64\"],\n \"darwin-arm64\": [\"@tailwind-styled/native-darwin-arm64\"],\n \"win32-x64\": [\"@tailwind-styled/native-win32-x64-msvc\", \"@tailwind-styled/native-win32-x64\"],\n \"win32-arm64\": [\"@tailwind-styled/native-win32-arm64-msvc\", \"@tailwind-styled/native-win32-arm64\"],\n}\n\nfunction platformKey(): string {\n if (isBrowser) return \"browser\"\n return `${process.platform}-${process.arch}`\n}\n\n/**\n * Resolve native binary path dari semua sumber yang tersedia.\n *\n * @example\n * const result = resolveNativeBinary()\n * if (result.path) {\n * const binding = require(result.path)\n * } else {\n * throw new Error(\"Native binding not found — run npm run build:rust\")\n * }\n */\nexport function resolveNativeBinary(runtimeDir?: string): NativeResolutionResult {\n const platform = platformKey()\n const tried: string[] = []\n\n if (isBrowser) {\n return { path: null, source: \"not-found\", platform, tried: [\"not available in browser\"] }\n }\n\n // 0. Disabled flag — always short-circuit before any I/O\n // TWS_NO_NATIVE adalah nama canonical; TWS_DISABLE_NATIVE diterima untuk backward compat\n if (process.env.TWS_NO_NATIVE === \"1\" || process.env.TWS_DISABLE_NATIVE === \"1\") {\n return { path: null, source: \"not-found\", platform, tried: [] }\n }\n\n // 1. Env var override\n const envPath = process.env.TW_NATIVE_PATH?.trim()\n if (envPath) {\n if (fs.existsSync(envPath)) {\n return { path: envPath, source: \"env\", platform, tried }\n }\n tried.push(`env:${envPath} (not found)`)\n }\n\n // 2. Prebuilt binary dari platform-specific npm package\n const prebuiltPkgs = PLATFORM_MAP[platform] ?? []\n for (const pkg of prebuiltPkgs) {\n try {\n const candidate = _require.resolve(`${pkg}/tailwind_styled_parser.node`)\n if (fs.existsSync(candidate)) {\n return { path: candidate, source: \"prebuilt\", platform, tried }\n }\n tried.push(`prebuilt:${pkg} (resolved but missing)`)\n } catch {\n tried.push(`prebuilt:${pkg} (not installed)`)\n }\n }\n\n // 2b. .node file bundled inside this package itself (via \"files\": [\"native/*.node\"])\n // Covers the case where user installs tailwind-styled-v4 directly from npm\n // and the .node file lands at node_modules/tailwind-styled-v4/native/*.node\n const napiPlatform = platform === \"linux-x64\" ? \"linux-x64-gnu\"\n : platform === \"linux-arm64\" ? \"linux-arm64-gnu\"\n : platform\n const BINARY_NAMES_SELF = [\"tailwind-styled-native\", \"tailwind_styled_parser\"]\n if (runtimeDir) {\n // runtimeDir is typically dist/ — go up to package root, then into native/\n for (const depth of [\"..\", path.join(\"..\", \"..\"), path.join(\"..\", \"..\", \"..\")]) {\n const pkgRoot = path.resolve(runtimeDir, depth)\n for (const bin of BINARY_NAMES_SELF) {\n for (const suffix of [\"\", `.${platform}`, `.${napiPlatform}`]) {\n const candidate = path.resolve(pkgRoot, \"native\", `${bin}${suffix}.node`)\n tried.push(`self-bundled:${candidate}`)\n if (fs.existsSync(candidate)) {\n return { path: candidate, source: \"prebuilt\", platform, tried }\n }\n }\n }\n }\n }\n\n // 3. Local build candidates\n const cwd = process.cwd()\n const base = runtimeDir ?? cwd\n // napi-rs naming: platform key may have -gnu suffix on Linux (already computed above)\n\n // Both possible binary names:\n // - \"tailwind_styled_parser\" (old hardcoded name in resolvers)\n // - \"tailwind-styled-native\" (actual binaryName in native/package.json)\n const BINARY_NAMES = [\"tailwind-styled-native\", \"tailwind_styled_parser\"]\n\n const localCandidates: string[] = []\n\n for (const bin of BINARY_NAMES) {\n localCandidates.push(path.resolve(base, `${bin}.node`))\n localCandidates.push(path.resolve(base, \"..\", `${bin}.node`))\n localCandidates.push(path.resolve(base, `${bin}.${platform}.node`))\n localCandidates.push(path.resolve(base, `${bin}.${napiPlatform}.node`))\n }\n\n // Walk up from cwd AND base to find repo root native/ dir\n // Needed when npm workspaces sets cwd to the package subdir\n for (const startDir of [cwd, base]) {\n let dir = startDir\n for (let i = 0; i < 6; i++) {\n const nativeDir = path.resolve(dir, \"native\")\n for (const bin of BINARY_NAMES) {\n localCandidates.push(path.resolve(nativeDir, `${bin}.node`))\n localCandidates.push(path.resolve(nativeDir, `${bin}.${platform}.node`))\n localCandidates.push(path.resolve(nativeDir, `${bin}.${napiPlatform}.node`))\n localCandidates.push(path.resolve(nativeDir, \"target\", \"release\", `${bin}.node`))\n }\n const parent = path.resolve(dir, \"..\")\n if (parent === dir) break\n dir = parent\n }\n }\n\n for (const candidate of localCandidates) {\n tried.push(`local:${candidate}`)\n if (fs.existsSync(candidate)) {\n return { path: candidate, source: \"local\", platform, tried }\n }\n }\n\n return { path: null, source: \"not-found\", platform, tried }\n}\n\n/**\n * Format human-readable error untuk \"binary not found\".\n */\nexport function formatNativeNotFoundError(result: NativeResolutionResult): string {\n const lines = [\n `[tailwind-styled] Native binding not found for ${result.platform}`,\n ``,\n `Tried:`,\n ...result.tried.map(t => ` - ${t}`),\n ``,\n `Solutions:`,\n ` 1. Build locally: npm run build:rust`,\n ` 2. Install prebuilt: npm install @tailwind-styled/native-${result.platform}`,\n ` 3. Override path: TW_NATIVE_PATH=/path/to/parser.node`,\n ]\n return lines.join(\"\\n\")\n}","import { createHash } from \"node:crypto\"\nimport fs from \"node:fs\"\nimport path from \"node:path\"\nimport { fileURLToPath } from \"node:url\"\nimport { createRequire } from \"node:module\"\n\n// Native-only: Node.js is always available. No browser fallback.\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Types\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type TokenMap = Record<string, string>\n\nexport type VariantValue = string | number | boolean | undefined\n\nexport type VariantProps = Record<string, VariantValue>\n\nexport type HtmlTagName = keyof HTMLElementTagNameMap\n\nexport type CompoundCondition = Record<string, string | number | boolean>\n\nexport type VariantMatrix = Record<string, Array<string | number | boolean>>\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Logging\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface Logger {\n warn(...args: unknown[]): void\n debug(...args: unknown[]): void\n error(...args: unknown[]): void\n log(...args: unknown[]): void\n}\n\nexport function createLogger(namespace: string): Logger {\n const prefix = `[${namespace}]`\n return {\n warn(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n debug(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n error(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n log(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n }\n}\n\nexport function createDebugLogger(namespace: string, label?: string): (msg: string) => void {\n const prefix = label ? `[${namespace}:${label}]` : `[${namespace}]`\n return (msg: string) => {\n if (process.env.DEBUG?.includes(namespace) || process.env.TW_DEBUG) {\n console.debug(prefix, msg)\n }\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error handling\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type ErrorSource = \"rust\" | \"validation\" | \"compile\" | \"io\" | \"config\" | \"unknown\"\n\ntype ZodLikeIssue = {\n path?: readonly PropertyKey[]\n message?: string\n}\n\nfunction formatIssuePath(path?: readonly PropertyKey[]): string {\n if (!path || path.length === 0) return \"(root)\"\n return path\n .map((segment) =>\n typeof segment === \"symbol\" ? segment.description ?? segment.toString() : String(segment)\n )\n .join(\".\")\n}\n\nexport class TwError extends Error {\n /** @deprecated Gunakan source */\n public readonly domain: string\n public readonly source: ErrorSource\n public readonly code: string\n public readonly originalCause?: unknown\n\n constructor(domainOrSource: string, code: string, message: string, cause?: unknown) {\n super(message)\n this.name = \"TwError\"\n this.domain = domainOrSource\n this.source = domainOrSource as ErrorSource\n this.code = code\n this.originalCause = cause\n if (Error.captureStackTrace) Error.captureStackTrace(this, TwError)\n }\n\n static fromIo(code: string, message: string): TwError {\n return new TwError(\"io\", code, message)\n }\n\n static fromCompile(code: string, message: string): TwError {\n return new TwError(\"compile\", code, message)\n }\n\n static fromRust(err: { code?: string; message?: string } | Error | unknown): TwError {\n if (err instanceof TwError) return err\n if (err instanceof Error) return new TwError(\"rust\", \"RUST_ERROR\", err.message, err)\n if (err && typeof err === \"object\") {\n const e = err as { code?: string; message?: string }\n return new TwError(\"rust\", e.code ?? \"RUST_ERROR\", e.message ?? String(err), err)\n }\n return new TwError(\"rust\", \"RUST_ERROR\", String(err), err)\n }\n\n /** Buat TwError dari ZodError — dukung shape Zod v3 (`errors`) dan v4 (`issues`). */\n static fromZod(err: { issues?: ZodLikeIssue[]; errors?: ZodLikeIssue[] }): TwError {\n const first = err.issues?.[0] ?? err.errors?.[0]\n const path = formatIssuePath(first?.path)\n const message = first ? `${path}: ${first.message}` : \"Schema validation failed\"\n return new TwError(\"validation\", \"SCHEMA_VALIDATION_FAILED\", message, err)\n }\n\n static wrap(source: string, code: string, err: unknown): TwError {\n if (err instanceof TwError) return err\n if (err instanceof Error) return new TwError(source, code, err.message, err)\n return new TwError(source, code, String(err), err)\n }\n\n override toString(): string {\n return `TwError [${this.source}:${this.code}] ${this.message}`\n }\n\n toJSON(): { name: string; source: string; code: string; message: string } {\n return { name: this.name, source: this.source, code: this.code, message: this.message }\n }\n\n toCliMessage(): string {\n return `[${this.source.toUpperCase()}:${this.code}] ${this.message}`\n }\n}\n\nexport function wrapUnknownError(domain: string, code: string, error: unknown): TwError {\n return TwError.wrap(domain, code, error)\n}\n\nexport function isTwError(err: unknown): err is TwError {\n return err instanceof TwError\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Native binding resolution\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface LoadNativeBindingOptions<T> {\n runtimeDir: string\n candidates: string[]\n isValid: (module: unknown) => module is T\n invalidExportMessage: string\n}\n\nexport interface LoadNativeBindingResult<T> {\n binding: T | null\n loadErrors: Array<{ path: string; message: string }>\n loadedPath?: string\n}\n\nexport function loadNativeBinding<T>(options: LoadNativeBindingOptions<T>): LoadNativeBindingResult<T> {\n const { runtimeDir, candidates, isValid } = options\n const loadErrors: Array<{ path: string; message: string }> = []\n\n for (const candidate of candidates) {\n const candidatePath = path.resolve(runtimeDir, candidate)\n try {\n if (!fs.existsSync(candidatePath) && !fs.existsSync(candidatePath + \".node\")) {\n continue\n }\n const mod = requireNativeModule(candidatePath)\n if (mod && isValid(mod)) {\n return { binding: mod, loadErrors, loadedPath: candidatePath }\n }\n loadErrors.push({ path: candidatePath, message: options.invalidExportMessage })\n } catch (e) {\n loadErrors.push({ path: candidatePath, message: e instanceof Error ? e.message : String(e) })\n }\n }\n\n return { binding: null, loadErrors }\n}\n\nconst _require = createRequire(\n typeof __filename !== \"undefined\"\n ? `file://${__filename}`\n : (import.meta.url ?? \"file://unknown\")\n)\n\nfunction requireNativeModule(p: string): unknown {\n return _require(p)\n}\n\nexport interface ResolveCandidatesOptions {\n runtimeDir?: string\n envVarNames?: string[]\n includeDefaultCandidates?: boolean\n enforceNodeExtensionForEnvPath?: boolean\n /** @deprecated — ignored, kept for backward compat */\n packageName?: string\n}\n\nexport function resolveNativeBindingCandidates(options: ResolveCandidatesOptions): string[] {\n const {\n envVarNames = [\"TW_NATIVE_PATH\", \"TWS_NATIVE_PATH\"],\n includeDefaultCandidates = true,\n enforceNodeExtensionForEnvPath = false,\n } = options\n // Default ke cwd kalau runtimeDir tidak disediakan\n const runtimeDir = options.runtimeDir || process.cwd()\n const candidates: string[] = []\n\n for (const envVar of envVarNames) {\n const envPath = process.env[envVar]\n if (envPath) {\n candidates.push(enforceNodeExtensionForEnvPath && !envPath.endsWith(\".node\") ? envPath + \".node\" : envPath)\n }\n }\n\n if (!includeDefaultCandidates) return candidates\n\n if (fs.existsSync(runtimeDir)) {\n try {\n for (const entry of fs.readdirSync(runtimeDir)) {\n if (entry.endsWith(\".node\")) candidates.push(entry)\n }\n } catch { /* ignore read errors */ }\n }\n\n const BINARY_NAMES = [\"tailwind-styled-native\", \"tailwind_styled_parser\"]\n const napiPlatform = process.platform === \"linux\" && process.arch === \"x64\" ? \"linux-x64-gnu\"\n : process.platform === \"linux\" && process.arch === \"arm64\" ? \"linux-arm64-gnu\"\n : `${process.platform}-${process.arch}`\n\n for (const bin of BINARY_NAMES) {\n candidates.push(path.resolve(runtimeDir, `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, `${bin}.${napiPlatform}.node`))\n // 1 level: dist/ → package-root/native/ (published npm package)\n candidates.push(path.resolve(runtimeDir, \"..\", \"native\", `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, \"..\", \"native\", `${bin}.${napiPlatform}.node`))\n // cwd fallback (user project root)\n candidates.push(path.resolve(process.cwd(), \"native\", `${bin}.node`))\n candidates.push(path.resolve(process.cwd(), \"native\", `${bin}.${napiPlatform}.node`))\n // 4 level: dist/ → package/ → domain/ → packages/ → repo-root/ (monorepo dev)\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"..\", \"native\", `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"..\", \"native\", `${bin}.${napiPlatform}.node`))\n // 3 level fallback\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"native\", `${bin}.node`))\n }\n\n return Array.from(new Set(candidates))\n}\n\nexport function resolveRuntimeDir(dir: string | undefined, importMetaUrl: string): string {\n if (dir) return path.resolve(dir)\n try {\n return path.dirname(fileURLToPath(importMetaUrl))\n } catch {\n return process.cwd()\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Hashing\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function hashContent(content: string, algorithm: string = \"md5\", length?: number): string {\n const hash = createHash(algorithm).update(content).digest(\"hex\")\n return length ? hash.slice(0, length) : hash\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error formatting\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function formatErrorMessage(error: unknown): string {\n if (error instanceof TwError) return error.toString()\n if (error instanceof Error) return error.message\n return String(error)\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// LRU Cache\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport class LRUCache<K, V> {\n private capacity: number\n private cache: Map<K, V>\n\n constructor(capacity: number) {\n this.capacity = capacity\n this.cache = new Map()\n }\n\n get(key: K): V | undefined {\n if (!this.cache.has(key)) return undefined\n const value = this.cache.get(key)!\n this.cache.delete(key)\n this.cache.set(key, value)\n return value\n }\n\n set(key: K, value: V): void {\n if (this.cache.has(key)) {\n this.cache.delete(key)\n } else if (this.cache.size >= this.capacity) {\n const firstKey = this.cache.keys().next().value\n if (firstKey !== undefined) {\n this.cache.delete(firstKey)\n }\n }\n this.cache.set(key, value)\n }\n\n delete(key: K): boolean {\n return this.cache.delete(key)\n }\n\n has(key: K): boolean {\n return this.cache.has(key)\n }\n\n clear(): void {\n this.cache.clear()\n }\n\n entries(): IterableIterator<[K, V]> {\n return this.cache.entries()\n }\n\n get size(): number {\n return this.cache.size\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Trace Utilities\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { TraceSnapshot, TraceSummary } from \"./trace\"\nexport {\n getHealthColor,\n getModeColor,\n formatMemory,\n formatDuration,\n calculateHealth,\n getBuildTimeColor,\n getMemoryColor,\n createTraceSnapshot,\n getPipelinePercentages,\n} from \"./trace\"\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Performance Telemetry\n// ─────────────────────────────────────────────────────────────────────────────\n\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error Codes\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { ErrorCode } from \"./error-codes\"\nexport { ERROR_CODES, getSuggestion, formatErrorCode } from \"./error-codes\"\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Tailwind Compatibility\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { TailwindInfo } from \"./compatibility\"\nexport { detectTailwind, assertTailwindV4, getTailwindVersion, isTailwindV4 } from \"./compatibility\"\n\n// ── Native binding schemas (Zod boundary validation)\nexport {\n NativeScanFileSchema, NativeScanResultSchema,\n NativeAnalyzerReportSchema, NativeTransformResultSchema,\n NativeCssCompileResultSchema, NativeWatchResultSchema,\n NativeCacheEntrySchema, NativeCacheReadResultSchema,\n safeParseNative, parseNative,\n} from './native-schemas'\n\n// ── ESM-safe runtime helpers ──────────────────────────────────────────────\nexport {\n createEsmRequire,\n getDirname,\n getFilename,\n resolveFromRoot,\n tryRequire,\n resolveNativeNodePath,\n} from \"./esmHelpers\"\n\n// ── Performance telemetry ────────────────────────────────────────────────────\nexport {\n TelemetryCollector,\n getGlobalTelemetry,\n resetGlobalTelemetry,\n createBuildTimer,\n type BuildTelemetry,\n type TelemetrySummary,\n type BuildPhases,\n} from \"./telemetry\"\n\n// ── Config/JSON schema validation ─────────────────────────────────────────────\nexport {\n ScanCacheSchema,\n ScanCacheClassEntrySchema,\n TailwindConfigSchema,\n RegistryPluginEntrySchema,\n RegistryFileSchema,\n PackageJsonSchema,\n parseJsonWithSchema,\n parseJsonFileWithSchema,\n type ScanCache,\n type ScanCacheClassEntry,\n type TailwindConfig,\n type RegistryPluginEntry,\n type RegistryFile,\n type PackageJson,\n} from \"./configSchemas\"\n\n// ── Worker/bootstrap path resolution ─────────────────────────────────────────\nexport {\n resolveWorkerPath,\n resolveLoaderPath,\n type WorkerPathOptions,\n type WorkerPathResult,\n} from \"./workerResolver\"\n\n// ── Codegen helpers ───────────────────────────────────────────────────────────\nexport {\n generateComponentCode,\n generateStorybookStory,\n generateClassRenameCodemod,\n generateBarrelFile,\n type ComponentCodegenOptions,\n} from \"./codegen\"\n\n// ── Native binary resolution (QA #1) ─────────────────────────────────────────\nexport {\n resolveNativeBinary,\n formatNativeNotFoundError,\n type NativeResolutionResult,\n} from \"./native-resolution\"\n\n// ── Shared observability contract ────────────────────────────────────────────\nexport {\n createObservabilityClient,\n type ClassInspection,\n type ClassProperty,\n type ClassUsageLocation,\n type BuildTrace,\n type BuildPhaseTrace,\n type DashboardMetrics,\n type DashboardSummary,\n type ObservabilityClient,\n} from \"./observability\"\n\nexport {\n TW_STATE_STATIC_FILENAME,\n extractStaticStateCss,\n appendStaticStateCssToSafelist,\n type TwStateConfigEntry,\n type StaticStateCssInput,\n type GeneratedStateRule,\n type StaticStateExtractionResult,\n} from \"./staticStateExtractor\"\nexport { setGlobalLogFile } from \"./logger\"","export * from \"@tailwind-styled/vue\"\n","/**\n * tailwind-styled-v5 — Native Rust Bindings\n *\n * All functions require native Rust bindings.\n * Uses @tailwind-styled/shared for native resolution.\n */\n\nimport { createRequire } from \"node:module\"\nimport { dirname } from \"node:path\"\nimport { fileURLToPath } from \"node:url\"\nimport { resolveNativeBinary } from \"@tailwind-styled/shared\"\n\nconst isBrowser = typeof window !== \"undefined\" || typeof document !== \"undefined\"\nconst NATIVE_UNAVAILABLE_MESSAGE =\n \"[tailwind-styled/core] Native binding is required but not available.\\n\" +\n \"Please ensure you have run: npm run build:rust\"\n\nconst _nodeRequire = createRequire(\n typeof __filename !== \"undefined\"\n ? `file://${__filename}`\n : (typeof import.meta !== \"undefined\" && import.meta.url ? import.meta.url : \"file://unknown\")\n)\nconst _loadNative = (path: string): unknown => _nodeRequire(path)\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Type Definitions\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface ParsedClassModifier {\n type: \"opacity\" | \"arbitrary\"\n value: string\n}\n\nexport interface ParsedClass {\n raw: string\n base: string\n variants: string[]\n modifier?: ParsedClassModifier\n}\n\nexport interface ThemeConfig {\n colors: Record<string, string>\n spacing: Record<string, string>\n fonts: Record<string, string>\n breakpoints: Record<string, string>\n animations: Record<string, string>\n raw: Record<string, string>\n}\n\ninterface NativeBinding {\n batchSplitClasses?: (input: string[]) => Array<{\n variantKey: string\n base: string\n variants: string[]\n isArbitrary: boolean\n hasModifier: boolean\n }>\n \n twMergeRaw?: (classLists: string[]) => string\n flattenAndResolve?: (nestedJson: string) => string\n resolveConflictGroup?: (base: string) => string\n\n compileTheme?: (themeConfig: string) => { css: string; variables: Record<string, string> }\n extractCssVars?: (css: string) => Record<string, string>\n extractThemeFromCss?: (css: string) => Array<{ key: string; value: string }>\n parseCssRules?: (css: string) => Array<{\n className: string\n property: string\n value: string\n isImportant: boolean\n variants: string[]\n specificity: number\n }>\n parseCssToRules?: (css: string) => string\n detectDeadCode?: (css: string, usedClasses: string[]) => string[]\n classifyKnownClasses?: (classes: string[]) => Array<{ className: string; category: string }>\n detectClassConflicts?: (classes: string) => { conflicts: Array<{ class1: string; class2: string; reason: string }>; conflictedClassNames: string[] }\n resolveVariants?: (configJson: string, propsJson: string) => { classes: string; resolvedCount: number }\n resolveSimpleVariants?: (base: string | null, variants: Record<string, Record<string, string>>, defaults: Record<string, string>, props: Record<string, string>) => string\n /** Parse template literal yang sudah di-join. Menggantikan parseTemplate() di twProxy.ts */\n parseTemplate?: (raw: string) => {\n base: string\n subsJson: string\n hasSubs: boolean\n }\n /** Validate ComponentConfig — menggantikan validateVariantConfig() di cv.ts */\n validateVariantConfig?: (configJson: string) => {\n valid: boolean\n errors: Array<{ errorType: string; key: string; value?: string; message: string }>\n warnings: string[]\n }\n /** Build lookup key untuk generated registry — menggantikan key builder di lookupGenerated() */\n buildVariantLookupKey?: (defaultVariantsJson: string, propsJson: string) => string\n /** Menggantikan cn() — filter+join class names dalam satu Rust pass. (class_utils.rs) */\n resolveClassNames?: (inputs: string[]) => string\n /** tw_merge dengan custom separator dan optional debug */\n twMergeWithSeparator?: (classString: string, opts: { separator?: string; debug?: boolean }) => string\n /** tw_merge_many dengan custom separator */\n twMergeManyWithSeparator?: (classStrings: string[], opts: { separator?: string; debug?: boolean }) => string\n /** conflict-aware Tailwind class merger — port of tailwind-merge. (tw_merge.rs) */\n twMerge?: (classString: string) => string\n /** variadic convenience wrapper untuk twMerge. (tw_merge.rs) */\n twMergeMany?: (classStrings: string[]) => string\n /** Tailwind classes → semicolon-separated inline CSS declarations. (state_css.rs) */\n twClassesToCss?: (classes: string) => string\n /**\n * Generate semua CSS rules untuk satu component dari state config — satu Rust call.\n *\n * Menggantikan JS loop di `injectStateStyles()` dan `generateStateCss()` yang\n * memanggil `twClassesToCss()` per state entry (N × NAPI calls → 1 call).\n *\n * @param id Component state class, e.g. `\"tw-s-abc123\"`\n * @param stateMapJson JSON object `{\"loading\":\"opacity-60 cursor-wait\",\"selected\":\"ring-2\"}`\n * @param resolvedCss Opsional Tailwind pipeline CSS untuk resolve named classes\n * @returns Array of `{ cssRule, stateName, declarations }` — satu per state entry\n */\n generateRuntimeStateCss?: (\n id: string,\n stateMapJson: string,\n resolvedCss: string | null\n ) => Array<{ cssRule: string; stateName: string; declarations: string }>\n /**\n * Hash a content string — menggantikan JS djb2 loop di hashState() dan hashContainer().\n * algorithm: \"md5\" | \"sha256\" | \"fnv\" | \"ahash\" (default: \"md5\")\n * length: potong output hex ke N karakter (mis. 6 untuk short ID)\n */\n hashContent?: (content: string, algorithm?: \"md5\" | \"sha256\" | \"fnv\" | \"ahash\", length?: number) => string\n /** Iterative CSS var() chain resolver. (theme.rs) */\n resolveThemeValue?: (key: string, rawMapJson: string) => string\n /**\n * Parse @theme CSS blocks, classify tokens ke buckets, resolve semua var() —\n * satu Rust call menggantikan extractThemeFromCss() + N × resolveThemeValue().\n * Return ClassifiedThemeConfig: { colors, spacing, fonts, breakpoints, animations, raw }\n */\n extractThemeFromCssClassified?: (css: string) => {\n colors: Record<string, string>\n spacing: Record<string, string>\n fonts: Record<string, string>\n breakpoints: Record<string, string>\n animations: Record<string, string>\n raw: Record<string, string>\n }\n /**\n * Generate TypeScript interface TailwindStyledThemeTokens dari theme JSON.\n * Build-time CLI only (tw generate-types). Menggantikan generateTypeDefinitions() JS.\n */\n generateTypeDefinitions?: (themeJson: string) => string\n /**\n * Generate `:root { --prefix-group-name: value; ... }` CSS block dari SystemTokenMap.\n *\n * Menggantikan nested JS loop di `injectTokensToRoot()` dan `setTokens()` di `styledSystem.ts`.\n *\n * `tokensJson`: JSON dari `SystemTokenMap` — `{\"colors\":{\"primary\":\"#6366f1\"},\"radius\":{\"base\":\"0.5rem\"}}`\n * `prefix`: CSS variable prefix, e.g. `\"sys\"` → `--sys-colors-primary`\n */\n generateSystemTokenCss?: (tokensJson: string, prefix: string) => string\n /** Parse sub-component block syntax from tw`` template. (tw_merge.rs) */\n parseSubcomponentBlocksNapi?: (template: string, componentName: string) => {\n baseClasses: string\n subMapJson: string\n }\n /** Menggantikan layoutClassesToCss() — static lookup + split dalam satu Rust pass. (container_query.rs) */\n layoutClassesToCss?: (classes: string) => string\n /** Menggantikan buildContainerRules() — generate @container CSS rules. (container_query.rs) */\n buildContainerRules?: (\n id: string,\n breakpoints: Array<{ key: string; classes: string }>,\n containerName: string | null\n ) => string\n /** Pre-generate semua kombinasi boolean states via bitmask (tw_merge.rs) */\n pregenerateStatesNapi?: (states: Record<string, string>) => {\n lookupJson: string\n stateKeys: string[]\n combinations: number\n }\n\n // ── Theme Parsing (napi_bridge_theme_parsing.rs) ───────────────────────────\n parseColorsNapi?: (colorsJson: string) => string | Record<string, string>\n parseSpacingNapi?: (spacingJson: string) => string | Record<string, string>\n parseTransformNapi?: (transformJson: string) => string | Record<string, string>\n normalizeColorNapi?: (color: string, opacity: string) => string\n sanitizeColorNapi?: (color: string) => string\n splitRgbaNapi?: (color: string) => string | { r: number; g: number; b: number; a: number }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Binding Loader\n// ─────────────────────────────────────────────────────────────────────────────\n\nlet nativeBinding: NativeBinding | null = null\nlet bindingLoadAttempted = false\n\nconst getBinding = (): NativeBinding => {\n if (isBrowser) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE + \"\\n\\nNative bindings are not available in browser. Use the compiled CSS output instead.\")\n }\n \n if (nativeBinding) return nativeBinding\n\n if (bindingLoadAttempted) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n\n bindingLoadAttempted = true\n\n try {\n const runtimeDir = isBrowser ? \"\" : dirname(\n typeof __filename !== \"undefined\"\n ? __filename\n : (typeof import.meta !== \"undefined\" && import.meta.url ? fileURLToPath(import.meta.url) : process.cwd())\n )\n const result = isBrowser\n ? { path: null, source: \"not-found\", platform: \"browser\", tried: [] }\n : resolveNativeBinary(runtimeDir)\n\n if (result.path && result.path.endsWith(\".node\")) {\n const mod = _loadNative(result.path) as NativeBinding\n if (mod?.batchSplitClasses) {\n nativeBinding = mod\n return nativeBinding\n }\n }\n\n throw new Error(`${NATIVE_UNAVAILABLE_MESSAGE}\\n\\nTried: ${result.tried.join(\"\\n\")}`)\n } catch (err) {\n throw err instanceof Error ? err : new Error(String(err))\n }\n}\n\nexport const resetNativeBinding = (): void => {\n nativeBinding = null\n bindingLoadAttempted = false\n}\n\nexport const getNativeBinding = getBinding\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Parser Functions\n// ─────────────────────────────────────────────────────────────────────────────\n\nfunction splitClassListNative(input: string): string[] {\n const binding = getBinding()\n if (!binding?.batchSplitClasses) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n const result = binding.batchSplitClasses([input])\n if (result.length === 0) return []\n return result[0].base.split(\" \").filter(Boolean)\n}\n\nfunction parseClassTokenNative(rawToken: string): ParsedClass {\n const binding = getBinding()\n if (!binding?.batchSplitClasses) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n const result = binding.batchSplitClasses([rawToken])\n if (result.length === 0) {\n return { raw: rawToken, base: rawToken, variants: [] }\n }\n const r = result[0]\n const parsed: ParsedClass = {\n raw: r.base,\n base: r.base,\n variants: r.variants,\n }\n if (r.hasModifier) {\n const opacityMatch = r.base.match(/^(.*)\\/(\\d{1,3})$/)\n if (opacityMatch && opacityMatch[1].length > 0) {\n parsed.base = opacityMatch[1]\n parsed.modifier = { type: \"opacity\", value: opacityMatch[2] }\n } else {\n const arbitraryMatch = r.base.match(/\\((--[a-zA-Z0-9_-]+)\\)/)\n if (arbitraryMatch) {\n parsed.modifier = { type: \"arbitrary\", value: arbitraryMatch[1] }\n }\n }\n }\n return parsed\n}\n\nexport function splitClassList(input: string): string[] {\n return splitClassListNative(input)\n}\n\nexport function parseClassToken(rawToken: string): ParsedClass {\n return parseClassTokenNative(rawToken)\n}\n\nexport function parseTailwindClasses(input: string): ParsedClass[] {\n const classes = splitClassListNative(input)\n return classes.map((c) => parseClassTokenNative(c))\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// CSS/Theme Functions\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function compileTheme(themeConfig: Record<string, unknown>) {\n const binding = getBinding()\n if (!binding?.compileTheme) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.compileTheme(JSON.stringify(themeConfig))\n}\n\nexport function extractCssVars(css: string): Record<string, string> {\n const binding = getBinding()\n if (!binding?.extractCssVars) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.extractCssVars(css)\n}\n\nexport function parseCssRules(css: string) {\n const binding = getBinding()\n if (!binding?.parseCssRules) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.parseCssRules(css)\n}\n\nexport function parseCssToRules(css: string): string {\n const binding = getBinding()\n if (!binding?.parseCssToRules) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.parseCssToRules(css)\n}\n\nexport function detectDeadCode(css: string, usedClasses: string[]): string[] {\n const binding = getBinding()\n if (!binding?.detectDeadCode) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.detectDeadCode(css, usedClasses)\n}\n\nexport function classifyKnownClasses(classes: string[]) {\n const binding = getBinding()\n if (!binding?.classifyKnownClasses) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.classifyKnownClasses(classes)\n}\n\nexport function detectClassConflicts(classes: string[]) {\n const binding = getBinding()\n if (!binding?.detectClassConflicts) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n return binding.detectClassConflicts(classes.join(\" \"))\n}\n\nexport function extractThemeFromCSS(cssContent: string): ThemeConfig {\n const binding = getBinding()\n if (!binding?.parseCssRules) {\n throw new Error(NATIVE_UNAVAILABLE_MESSAGE)\n }\n \n const properties = binding.parseCssRules(cssContent)\n const theme: ThemeConfig = {\n colors: {},\n spacing: {},\n fonts: {},\n breakpoints: {},\n animations: {},\n raw: {},\n }\n \n const prefixMap: Record<string, keyof ThemeConfig> = {\n \"color-\": \"colors\",\n \"spacing-\": \"spacing\",\n \"font-\": \"fonts\",\n \"breakpoint-\": \"breakpoints\",\n \"animate-\": \"animations\",\n }\n \n for (const prop of properties) {\n const cssVar = prop.property.replace(/^--/, \"\")\n theme.raw[cssVar] = prop.value\n \n for (const [prefix, category] of Object.entries(prefixMap)) {\n if (cssVar.startsWith(prefix)) {\n const name = cssVar.slice(prefix.length)\n if (name) theme[category][name] = prop.value\n break\n }\n }\n }\n \n return theme\n}","/**\n * tailwind-styled-v4 — createTwMerge()\n * Pure Node.js — requires native Rust binding.\n */\n\nimport { getNativeBinding } from \"./native\"\nimport type { ThemeConfig } from \"./themeReader\"\n\nexport interface MergeOptions {\n prefix?: string\n separator?: string\n theme?: ThemeConfig\n}\n\nexport function createTwMerge(_options: MergeOptions = {}) {\n return function twMerge(...classLists: Array<string | undefined | null | false>): string {\n const inputs: string[] = []\n for (let i = 0; i < classLists.length; i++) {\n const v = classLists[i]\n if (v) inputs.push(String(v))\n }\n if (inputs.length === 0) return \"\"\n\n const native = getNativeBinding()\n if (!native?.twMergeRaw) {\n throw new Error(\"Native binding 'twMergeRaw' is required but not available.\")\n }\n return native.twMergeRaw(inputs)\n }\n}\n\nexport const twMerge = createTwMerge()\n\nexport function mergeWithRules(\n rules: Record<string, (classes: string[]) => string>,\n ...classLists: string[]\n): string {\n const base = twMerge(...classLists)\n const classes = Object.values(rules).reduce(\n (acc, rule) => twMerge(rule(acc)).split(/\\s+/).filter(Boolean),\n base.split(/\\s+/).filter(Boolean)\n )\n return classes.join(\" \")\n}","/**\n * tailwind-styled-v4 — Vue Adapter\n *\n * Pola seperti `createComponent` di React tapi untuk Vue 3 Composition API.\n * Mendukung: base, variants, defaultVariants, compoundVariants.\n *\n * @example\n * import { tw } from '@tailwind-styled/vue'\n *\n * const Button = tw('button', {\n * base: 'px-4 py-2 rounded font-medium',\n * variants: {\n * intent: {\n * primary: 'bg-blue-500 text-white hover:bg-blue-600',\n * danger: 'bg-red-500 text-white hover:bg-red-600',\n * },\n * size: { sm: 'h-8 text-sm', md: 'h-10 text-base', lg: 'h-12 text-lg' },\n * },\n * defaultVariants: { intent: 'primary', size: 'md' },\n * })\n *\n * // In template:\n * // <Button intent=\"danger\" size=\"lg\">Delete</Button>\n */\n\nimport { twMerge } from \"@tailwind-styled/core\"\nimport { type App, type Component, computed, type DefineComponent, defineComponent, h } from \"vue\"\n\nimport type { VariantValue, VariantProps as Props, HtmlTagName as HtmlTag } from '@tailwind-styled/shared'\n\n\nconst isVariantValue = (value: unknown): value is VariantValue =>\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\" ||\n value === undefined\n\nconst toVariantProps = (input: Record<string, unknown>): Props => {\n const props: Props = {}\n for (const [key, value] of Object.entries(input)) {\n if (isVariantValue(value)) {\n props[key] = value\n }\n }\n return props\n}\n\nconst toClassName = (value: VariantValue): string | undefined => {\n if (typeof value === \"string\") return value\n if (typeof value === \"number\") return String(value)\n return undefined\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Types\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface VueComponentConfig {\n base?: string\n variants?: Record<string, Record<string, string>>\n compoundVariants?: Array<{ class: string; [key: string]: VariantValue }>\n defaultVariants?: Record<string, string>\n}\n\nexport type HtmlTagName = HtmlTag\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Variant resolver (sama dengan React adapter)\n// ─────────────────────────────────────────────────────────────────────────────\n\nfunction resolveVariants(\n variants: Record<string, Record<string, string>>,\n props: Props,\n defaults: Record<string, string> = {}\n): string {\n const classes: string[] = []\n for (const key in variants) {\n const val = props[key] ?? defaults[key]\n if (val !== undefined && variants[key][String(val)]) {\n classes.push(variants[key][String(val)])\n }\n }\n return classes.join(\" \")\n}\n\nfunction resolveCompound(\n compounds: Array<{ class: string; [key: string]: VariantValue }>,\n props: Props\n): string {\n return compounds\n .filter((c) => {\n const { class: _cls, ...conditions } = c\n return Object.entries(conditions).every(([k, v]) => props[k] === v)\n })\n .map((c) => c.class)\n .join(\" \")\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Core factory\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Buat Vue component dengan Tailwind class yang terstruktur.\n *\n * @param tag - HTML tag atau Vue component\n * @param config - Konfigurasi base, variants, defaultVariants\n */\nexport function tw<Tag extends HtmlTag>(\n tag: Tag,\n config: VueComponentConfig = {}\n): DefineComponent<Record<string, unknown>> {\n const { base = \"\", variants = {}, compoundVariants = [], defaultVariants = {} } = config\n\n const variantKeys = new Set(Object.keys(variants))\n\n // Props definition untuk Vue — semua variant key jadi optional prop\n const propsDefinition: Record<string, { type: null; default: undefined }> = {}\n for (const key of variantKeys) {\n propsDefinition[key] = { type: null, default: undefined }\n }\n propsDefinition.class = { type: null, default: undefined }\n\n return defineComponent({\n name: `TwStyled${String(tag).charAt(0).toUpperCase() + String(tag).slice(1)}`,\n inheritAttrs: false,\n props: propsDefinition,\n setup(props, { attrs, slots }) {\n const className = computed(() => {\n const variantProps = toVariantProps(props as Record<string, unknown>)\n const attrProps = toVariantProps(attrs as Record<string, unknown>)\n const mergedProps = { ...defaultVariants, ...variantProps, ...attrProps }\n const variantClasses = resolveVariants(variants, mergedProps, defaultVariants)\n const compoundClasses = resolveCompound(compoundVariants, mergedProps)\n return twMerge(\n base,\n variantClasses,\n compoundClasses,\n toClassName(variantProps.class),\n toClassName(attrProps.class)\n )\n })\n\n return () => {\n // Filter out variant props — jangan diteruskan ke HTML element\n const filteredAttrs: Record<string, unknown> = {}\n for (const key in attrs) {\n if (!variantKeys.has(key)) {\n filteredAttrs[key] = attrs[key]\n }\n }\n\n return h(tag as string, { ...filteredAttrs, class: className.value }, slots.default?.())\n }\n },\n })\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// cv() — class variant helper (framework-agnostic, sama dengan React)\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Class variant function — returns a class string resolver.\n * Framework-agnostic, bisa dipakai di mana saja.\n *\n * @example\n * const buttonCv = cv({\n * base: 'px-4 py-2 rounded',\n * variants: { size: { sm: 'h-8', lg: 'h-12' } },\n * defaultVariants: { size: 'sm' },\n * })\n *\n * buttonCv({ size: 'lg' }) // 'px-4 py-2 rounded h-12'\n */\nexport function cv(config: VueComponentConfig) {\n return (props: Props = {}) => {\n const { base = \"\", variants = {}, compoundVariants = [], defaultVariants = {} } = config\n const merged = { ...defaultVariants, ...props }\n const variantClasses = resolveVariants(variants, merged, defaultVariants)\n const compoundClasses = resolveCompound(compoundVariants, merged)\n return twMerge(base, variantClasses, compoundClasses, toClassName(props.class))\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Extend — tambahkan class ke komponen yang sudah ada\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Extend komponen Vue yang sudah ada dengan class tambahan.\n *\n * @example\n * const PrimaryButton = extend(Button, 'bg-blue-500 text-white')\n */\nexport function extend(\n component: Component,\n extraClasses: string\n): DefineComponent<Record<string, unknown>> {\n return defineComponent({\n name: `Extended${(\"name\" in component ? component.name : undefined) ?? \"Component\"}`,\n inheritAttrs: false,\n props: { class: { type: null, default: undefined } },\n setup(props, { attrs, slots }) {\n return () =>\n h(\n component,\n {\n ...attrs,\n class: twMerge(extraClasses, props.class as string, attrs.class as string),\n },\n slots.default?.()\n )\n },\n })\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Plugin Vue\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Vue plugin — daftarkan `tw` sebagai global composable.\n *\n * @example\n * // main.ts\n * import { createApp } from 'vue'\n * import { TailwindStyledPlugin } from '@tailwind-styled/vue'\n * import App from './App.vue'\n *\n * createApp(App).use(TailwindStyledPlugin).mount('#app')\n */\nexport const TailwindStyledPlugin = {\n install(app: App) {\n app.config.globalProperties.$tw = tw\n app.config.globalProperties.$cv = cv\n app.provide(\"tw\", tw)\n app.provide(\"cv\", cv)\n },\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAS,cAAsB;AAC7B,MAAI,UAAW,QAAO;AACtB,SAAO,GAAG,QAAQ,QAAQ,IAAI,QAAQ,IAAI;AAC5C;AAaO,SAAS,oBAAoB,YAA6C;AAC/E,QAAM,WAAW,YAAY;AAC7B,QAAM,QAAkB,CAAC;AAEzB,MAAI,WAAW;AACb,WAAO,EAAE,MAAM,MAAM,QAAQ,aAAa,UAAU,OAAO,CAAC,0BAA0B,EAAE;AAAA,EAC1F;AAIA,MAAI,QAAQ,IAAI,kBAAkB,OAAO,QAAQ,IAAI,uBAAuB,KAAK;AAC/E,WAAO,EAAE,MAAM,MAAM,QAAQ,aAAa,UAAU,OAAO,CAAC,EAAE;AAAA,EAChE;AAGA,QAAM,UAAU,QAAQ,IAAI,gBAAgB,KAAK;AACjD,MAAI,SAAS;AACX,QAAO,cAAW,OAAO,GAAG;AAC1B,aAAO,EAAE,MAAM,SAAS,QAAQ,OAAO,UAAU,MAAM;AAAA,IACzD;AACA,UAAM,KAAK,OAAO,OAAO,cAAc;AAAA,EACz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F;AACF;AAYO,SAAS,OACd,WACA,cAC0C;AAC1C,aAAO,4BAAgB;AAAA,IACrB,MAAM,YAAY,UAAU,YAAY,UAAU,OAAO,WAAc,WAAW;AAAA,IAClF,cAAc;AAAA,IACd,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,SAAS,OAAU,EAAE;AAAA,IACnD,MAAM,OAAO,EAAE,OAAO,MAAM,GAAG;AAC7B,aAAO,UACL;AAAA,QACE;AAAA,QACA;AAAA,UACE,GAAG;AAAA,UACH,OAAO,QAAQ,cAAc,MAAM,OAAiB,MAAM,KAAe;AAAA,QAC3E;AAAA,QACA,MAAM,UAAU;AAAA,MAClB;AAAA,IACJ;AAAA,EACF,CAAC;AACH;AAiBO,IAAM,uBAAuB;AAAA,EAClC,QAAQ,KAAU;AAChB,QAAI,OAAO,iBAAiB,MAAM;AAClC,QAAI,OAAO,iBAAiB,MAAMA;AAClC,QAAI,QAAQ,MAAM,EAAE;AACpB,QAAI,QAAQ,MAAMA,GAAE;AAAA,EACtB;AACF;","names":["import_node_module","_require","cv","import_node_module","import_node_path","import_node_url","isBrowser","path","twMerge","cv"]}