@yak/react 10.0.0-rc.0 → 10.0.0-rc.1

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 (67) hide show
  1. package/README.md +12 -0
  2. package/dist/context/baseContext.d.ts +1 -2
  3. package/dist/context/index.d.ts +3 -4
  4. package/dist/context/index.server.d.ts +2 -3
  5. package/dist/cross-file-resolver/index.d.ts +12 -12
  6. package/dist/cross-file-resolver/index.js +39 -5
  7. package/dist/cross-file-resolver/index.js.map +1 -1
  8. package/dist/index.d.ts +8 -8
  9. package/dist/index.js +1 -1
  10. package/dist/index.js.map +1 -1
  11. package/dist/internal.d.ts +139 -139
  12. package/dist/isolated-source-eval/index.d.ts +2 -2
  13. package/dist/jsx-dev-runtime.js.map +1 -1
  14. package/dist/jsx-runtime.d.ts +2 -2
  15. package/dist/jsx-runtime.js.map +1 -1
  16. package/dist/loaders/{turbo-loader.d.cts → turbo-loader.d.ts} +3 -3
  17. package/dist/loaders/{turbo-loader.cjs → turbo-loader.js} +60 -47
  18. package/dist/loaders/turbo-loader.js.map +1 -0
  19. package/dist/loaders/vite-plugin.d.ts +13 -21
  20. package/dist/loaders/vite-plugin.js +43 -36
  21. package/dist/loaders/vite-plugin.js.map +1 -1
  22. package/dist/loaders/{webpack-loader.d.cts → webpack-loader.d.ts} +3 -3
  23. package/dist/loaders/{webpack-loader.cjs → webpack-loader.js} +50 -37
  24. package/dist/loaders/webpack-loader.js.map +1 -0
  25. package/dist/rsbuild/index.d.ts +2 -2
  26. package/dist/rsbuild/index.js +1 -2
  27. package/dist/rsbuild/index.js.map +1 -1
  28. package/dist/static/index.js +1 -1
  29. package/dist/static/index.js.map +1 -1
  30. package/dist/withYak/index.d.ts +15 -24
  31. package/dist/withYak/index.js +7 -13
  32. package/dist/withYak/index.js.map +1 -1
  33. package/loaders/lib/resolveCrossFileSelectors.ts +0 -1
  34. package/loaders/turbo-loader.ts +11 -7
  35. package/loaders/webpack-loader.ts +3 -6
  36. package/package.json +45 -104
  37. package/rsbuild/index.ts +2 -3
  38. package/withYak/index.ts +7 -21
  39. package/dist/context/baseContext.cjs +0 -9
  40. package/dist/context/baseContext.cjs.map +0 -1
  41. package/dist/context/baseContext.d.cts +0 -6
  42. package/dist/context/index.cjs +0 -45
  43. package/dist/context/index.cjs.map +0 -1
  44. package/dist/context/index.d.cts +0 -21
  45. package/dist/context/index.server.cjs +0 -47
  46. package/dist/context/index.server.cjs.map +0 -1
  47. package/dist/context/index.server.d.cts +0 -10
  48. package/dist/index.cjs +0 -2
  49. package/dist/index.cjs.map +0 -1
  50. package/dist/index.d.cts +0 -320
  51. package/dist/internal.cjs +0 -544
  52. package/dist/internal.cjs.map +0 -1
  53. package/dist/internal.d.cts +0 -452
  54. package/dist/jsx-dev-runtime.cjs +0 -2
  55. package/dist/jsx-dev-runtime.cjs.map +0 -1
  56. package/dist/jsx-dev-runtime.d.cts +0 -7
  57. package/dist/jsx-runtime.cjs +0 -2
  58. package/dist/jsx-runtime.cjs.map +0 -1
  59. package/dist/jsx-runtime.d.cts +0 -38
  60. package/dist/loaders/turbo-loader.cjs.map +0 -1
  61. package/dist/loaders/webpack-loader.cjs.map +0 -1
  62. package/dist/static/index.cjs +0 -2
  63. package/dist/static/index.cjs.map +0 -1
  64. package/dist/static/index.d.cts +0 -28
  65. package/dist/withYak/index.cjs +0 -208
  66. package/dist/withYak/index.cjs.map +0 -1
  67. package/dist/withYak/index.d.cts +0 -121
package/dist/internal.cjs DELETED
@@ -1,544 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- //#region \0rolldown/runtime.js
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
- key = keys[i];
13
- if (!__hasOwnProp.call(to, key) && key !== except) {
14
- __defProp(to, key, {
15
- get: ((k) => from[k]).bind(null, key),
16
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
- });
18
- }
19
- }
20
- }
21
- return to;
22
- };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
24
- value: mod,
25
- enumerable: true
26
- }) : target, mod));
27
-
28
- //#endregion
29
- let react = require("react");
30
- react = __toESM(react, 1);
31
- let _yak_react_context = require("@yak/react/context");
32
-
33
- //#region runtime/cssLiteral.tsx
34
- const yakComponentSymbol = Symbol("yak");
35
- var ClassNames = class {
36
- constructor(initial) {
37
- this.value = initial || "";
38
- }
39
- add(className) {
40
- this.value += (this.value && " ") + className;
41
- }
42
- has(className) {
43
- return (" " + this.value + " ").includes(" " + className + " ");
44
- }
45
- delete(className) {
46
- if (this.has(className)) this.value = this.value.split(" ").filter((existing) => existing !== className).join(" ");
47
- }
48
- };
49
- function css(...args) {
50
- let className;
51
- const dynamicCssFunctions = [];
52
- for (const arg of args) if (typeof arg === "string") className = arg;
53
- else if (typeof arg === "function") dynamicCssFunctions.push(arg);
54
- else if (typeof arg === "object" && "style" in arg) dynamicCssFunctions.push((props, _, style) => {
55
- for (const key in arg.style) {
56
- const value = arg.style[key];
57
- if (typeof value === "function") style[key] = String(recursivePropExecution(props, value));
58
- else style[key] = String(value);
59
- }
60
- });
61
- if (dynamicCssFunctions.length === 0) return Object.assign((_, classNames) => {
62
- if (className) classNames.add(className);
63
- }, { $dynamic: false });
64
- return Object.assign((props, classNames, allStyles) => {
65
- if (className) classNames.add(className);
66
- for (let i = 0; i < dynamicCssFunctions.length; i++) unwrapProps(props, dynamicCssFunctions[i], classNames, allStyles);
67
- }, { $dynamic: true });
68
- }
69
- const unwrapProps = (props, fn, classNames, style) => {
70
- let result = fn(props, classNames, style);
71
- while (result) {
72
- if (typeof result === "function") {
73
- result = result(props, classNames, style);
74
- continue;
75
- } else if (typeof result === "object") {
76
- if ("className" in result && result.className) classNames.add(result.className);
77
- if ("style" in result && result.style) for (const key in result.style) style[key] = result.style[key];
78
- }
79
- break;
80
- }
81
- };
82
- const recursivePropExecution = (props, fn) => {
83
- const result = fn(props);
84
- if (typeof result === "function") return recursivePropExecution(props, result);
85
- if (typeof result !== "string" && typeof result !== "number" && !(result instanceof String)) {
86
- if (process.env.NODE_ENV === "development") throw new Error(`Dynamic CSS functions must return a string or number but returned ${JSON.stringify(result)}\n\nDynamic CSS function: ${fn.toString()}\n`);
87
- }
88
- return result;
89
- };
90
-
91
- //#endregion
92
- //#region runtime/internals/propMarkers.ts
93
- const ATTRS_MERGED = "$__a";
94
- const RUNTIME_STYLES_DONE = "$__r";
95
- const STATIC_ATTRS = "$sa";
96
-
97
- //#endregion
98
- //#region runtime/internals/mergeClassNames.ts
99
- const mergeClassNames = (a, b) => {
100
- if (!a) return b || void 0;
101
- if (!b) return a;
102
- return a + " " + b;
103
- };
104
-
105
- //#endregion
106
- //#region runtime/styled.tsx
107
- const styledFactory = (Component) => Object.assign(yakStyled(Component), { attrs: (attrs) => yakStyled(Component, attrs) });
108
- const styled = styledFactory;
109
- const yakStyled = (Component, attrs) => {
110
- const isYakComponent = typeof Component !== "string" && yakComponentSymbol in Component;
111
- const [, parentAttrsFn, parentRuntimeStylesFn, parentTarget] = isYakComponent ? Component[yakComponentSymbol] : [];
112
- const targetComponent = isYakComponent ? parentTarget : Component;
113
- const mergedAttrsFn = buildRuntimeAttrsProcessor(attrs, parentAttrsFn);
114
- const staticAttrs = mergedAttrsFn?.["$sa"];
115
- return (styles, ...values) => {
116
- const runtimeStylesFn = css(styles, ...values);
117
- const runtimeStyleProcessor = buildRuntimeStylesProcessor(runtimeStylesFn, parentRuntimeStylesFn);
118
- const Yak = (props) => {
119
- if ((!mergedAttrsFn || staticAttrs) && !runtimeStyleProcessor.$dynamic) {
120
- const source = staticAttrs && !("$__a" in props) ? combineProps({
121
- ...props,
122
- [ATTRS_MERGED]: true
123
- }, staticAttrs) : props;
124
- const filteredProps = removeNonDomProperties(source);
125
- if (!("$__r" in source)) {
126
- const classNames = new ClassNames(source.className);
127
- runtimeStyleProcessor(source, classNames, void 0);
128
- filteredProps.className = classNames.value || void 0;
129
- }
130
- const Target = targetComponent;
131
- return /* @__PURE__ */ react.default.createElement(Target, filteredProps);
132
- }
133
- const theme = (0, _yak_react_context.useTheme)();
134
- const combinedProps = "$__a" in props ? {
135
- theme,
136
- ...props
137
- } : combineProps({
138
- theme,
139
- ...props,
140
- [ATTRS_MERGED]: true
141
- }, mergedAttrsFn?.({
142
- theme,
143
- ...props
144
- }));
145
- if (!("$__r" in combinedProps)) {
146
- const classNames = new ClassNames(combinedProps.className);
147
- const styles = runtimeStyleProcessor.$dynamic ? { ...combinedProps.style } : combinedProps.style;
148
- runtimeStyleProcessor(combinedProps, classNames, styles);
149
- combinedProps[RUNTIME_STYLES_DONE] = true;
150
- combinedProps.className = classNames.value || void 0;
151
- if (styles !== combinedProps.style) combinedProps.style = styles;
152
- }
153
- const { theme: themeAfterAttr, ...combinedPropsWithoutTheme } = combinedProps;
154
- const filteredProps = removeNonDomProperties(themeAfterAttr === theme ? combinedPropsWithoutTheme : combinedProps);
155
- const Target = targetComponent;
156
- return /* @__PURE__ */ react.default.createElement(Target, filteredProps);
157
- };
158
- const taggedYak = Yak;
159
- taggedYak[yakComponentSymbol] = [
160
- Yak,
161
- mergedAttrsFn,
162
- runtimeStyleProcessor,
163
- targetComponent
164
- ];
165
- return taggedYak;
166
- };
167
- };
168
- const removeNonDomProperties = (obj) => {
169
- const result = {};
170
- for (const key in obj) if (!key.startsWith("$") && obj[key] !== void 0) result[key] = obj[key];
171
- return result;
172
- };
173
- const combineProps = (props, newProps) => newProps ? (props.className === newProps.className || !newProps.className) && (props.style === newProps.style || !newProps.style) ? {
174
- ...props,
175
- ...newProps
176
- } : {
177
- ...props,
178
- ...newProps,
179
- className: mergeClassNames(props.className, newProps.className),
180
- style: {
181
- ...props.style,
182
- ...newProps.style
183
- }
184
- } : props;
185
- const buildRuntimeAttrsProcessor = (attrs, parentAttrsFn) => {
186
- const ownAttrsFn = attrs && (typeof attrs === "function" ? attrs : () => attrs);
187
- if (ownAttrsFn && parentAttrsFn) return (props) => {
188
- const parentProps = parentAttrsFn(props);
189
- return combineProps(parentProps, ownAttrsFn(combineProps(props, parentProps)));
190
- };
191
- if (ownAttrsFn && typeof attrs !== "function") return Object.assign(ownAttrsFn, { ["$sa"]: attrs });
192
- return ownAttrsFn || parentAttrsFn;
193
- };
194
- const buildRuntimeStylesProcessor = (runtimeStylesFn, parentRuntimeStylesFn) => {
195
- if (runtimeStylesFn && parentRuntimeStylesFn) return Object.assign((props, classNames, style) => {
196
- parentRuntimeStylesFn(props, classNames, style);
197
- runtimeStylesFn(props, classNames, style);
198
- }, { $dynamic: runtimeStylesFn.$dynamic || parentRuntimeStylesFn.$dynamic });
199
- return runtimeStylesFn || parentRuntimeStylesFn;
200
- };
201
-
202
- //#endregion
203
- //#region runtime/atoms.tsx
204
- const atoms = (...atoms) => {
205
- const staticClasses = new ClassNames();
206
- const dynamicFunctions = [];
207
- for (const atom of atoms) if (typeof atom === "string") staticClasses.add(atom);
208
- else if (typeof atom === "function") dynamicFunctions.push(atom);
209
- return css(staticClasses.value, ...dynamicFunctions);
210
- };
211
-
212
- //#endregion
213
- //#region runtime/keyframes.tsx
214
- const keyframes = (styles, ..._dynamic) => {
215
- return styles;
216
- };
217
-
218
- //#endregion
219
- //#region runtime/globalStyle.tsx
220
- const globalStyle = (_styles, ..._values) => {};
221
-
222
- //#endregion
223
- //#region runtime/internals/unitPostFix.ts
224
- const unitPostFix = (arg, unit) => {
225
- switch (typeof arg) {
226
- case "function": return (props) => unitPostFix(arg(props), unit);
227
- case "number":
228
- case "string": return `${arg}${unit}`;
229
- default: return;
230
- }
231
- };
232
-
233
- //#endregion
234
- //#region runtime/internals/mergeCssProp.ts
235
- const mergeCssProp = (cssProp, ...sources) => {
236
- const result = Object.assign({}, ...sources);
237
- const classNames = new ClassNames(result.className);
238
- const existingStyle = result.style;
239
- const style = existingStyle ? { ...existingStyle } : {};
240
- if (typeof cssProp === "function") cssProp({}, classNames, style);
241
- else if (cssProp) {
242
- if (process.env.NODE_ENV === "development") {
243
- const received = cssProp;
244
- throw new Error(`The css prop only applies styles written in place, but received ${Array.isArray(received) ? "an array" : `a value of type ${typeof received}`}.\n\nCombine several styles in one template instead of an array: css={css\`\${first} \${second}\`}\nWrite declarations in a template instead of an object: css={css\`color: red;\`}`);
245
- }
246
- }
247
- if (Object.keys(style).length > 0) result.style = style;
248
- else delete result.style;
249
- if (classNames.value) result.className = classNames.value;
250
- else delete result.className;
251
- return result;
252
- };
253
-
254
- //#endregion
255
- //#region runtime/styledDom.tsx
256
- const __yak_a = /*#__PURE__*/ styled("a");
257
- const __yak_abbr = /*#__PURE__*/ styled("abbr");
258
- const __yak_address = /*#__PURE__*/ styled("address");
259
- const __yak_area = /*#__PURE__*/ styled("area");
260
- const __yak_article = /*#__PURE__*/ styled("article");
261
- const __yak_aside = /*#__PURE__*/ styled("aside");
262
- const __yak_audio = /*#__PURE__*/ styled("audio");
263
- const __yak_b = /*#__PURE__*/ styled("b");
264
- const __yak_base = /*#__PURE__*/ styled("base");
265
- const __yak_bdi = /*#__PURE__*/ styled("bdi");
266
- const __yak_bdo = /*#__PURE__*/ styled("bdo");
267
- const __yak_big = /*#__PURE__*/ styled("big");
268
- const __yak_blockquote = /*#__PURE__*/ styled("blockquote");
269
- const __yak_body = /*#__PURE__*/ styled("body");
270
- const __yak_br = /*#__PURE__*/ styled("br");
271
- const __yak_button = /*#__PURE__*/ styled("button");
272
- const __yak_canvas = /*#__PURE__*/ styled("canvas");
273
- const __yak_caption = /*#__PURE__*/ styled("caption");
274
- const __yak_cite = /*#__PURE__*/ styled("cite");
275
- const __yak_code = /*#__PURE__*/ styled("code");
276
- const __yak_col = /*#__PURE__*/ styled("col");
277
- const __yak_colgroup = /*#__PURE__*/ styled("colgroup");
278
- const __yak_data = /*#__PURE__*/ styled("data");
279
- const __yak_datalist = /*#__PURE__*/ styled("datalist");
280
- const __yak_dd = /*#__PURE__*/ styled("dd");
281
- const __yak_del = /*#__PURE__*/ styled("del");
282
- const __yak_details = /*#__PURE__*/ styled("details");
283
- const __yak_dfn = /*#__PURE__*/ styled("dfn");
284
- const __yak_dialog = /*#__PURE__*/ styled("dialog");
285
- const __yak_div = /*#__PURE__*/ styled("div");
286
- const __yak_dl = /*#__PURE__*/ styled("dl");
287
- const __yak_dt = /*#__PURE__*/ styled("dt");
288
- const __yak_em = /*#__PURE__*/ styled("em");
289
- const __yak_embed = /*#__PURE__*/ styled("embed");
290
- const __yak_fieldset = /*#__PURE__*/ styled("fieldset");
291
- const __yak_figcaption = /*#__PURE__*/ styled("figcaption");
292
- const __yak_figure = /*#__PURE__*/ styled("figure");
293
- const __yak_footer = /*#__PURE__*/ styled("footer");
294
- const __yak_form = /*#__PURE__*/ styled("form");
295
- const __yak_h1 = /*#__PURE__*/ styled("h1");
296
- const __yak_h2 = /*#__PURE__*/ styled("h2");
297
- const __yak_h3 = /*#__PURE__*/ styled("h3");
298
- const __yak_h4 = /*#__PURE__*/ styled("h4");
299
- const __yak_h5 = /*#__PURE__*/ styled("h5");
300
- const __yak_h6 = /*#__PURE__*/ styled("h6");
301
- const __yak_header = /*#__PURE__*/ styled("header");
302
- const __yak_hgroup = /*#__PURE__*/ styled("hgroup");
303
- const __yak_hr = /*#__PURE__*/ styled("hr");
304
- const __yak_html = /*#__PURE__*/ styled("html");
305
- const __yak_i = /*#__PURE__*/ styled("i");
306
- const __yak_iframe = /*#__PURE__*/ styled("iframe");
307
- const __yak_img = /*#__PURE__*/ styled("img");
308
- const __yak_input = /*#__PURE__*/ styled("input");
309
- const __yak_ins = /*#__PURE__*/ styled("ins");
310
- const __yak_kbd = /*#__PURE__*/ styled("kbd");
311
- const __yak_keygen = /*#__PURE__*/ styled("keygen");
312
- const __yak_label = /*#__PURE__*/ styled("label");
313
- const __yak_legend = /*#__PURE__*/ styled("legend");
314
- const __yak_li = /*#__PURE__*/ styled("li");
315
- const __yak_link = /*#__PURE__*/ styled("link");
316
- const __yak_main = /*#__PURE__*/ styled("main");
317
- const __yak_map = /*#__PURE__*/ styled("map");
318
- const __yak_mark = /*#__PURE__*/ styled("mark");
319
- const __yak_menu = /*#__PURE__*/ styled("menu");
320
- const __yak_menuitem = /*#__PURE__*/ styled("menuitem");
321
- const __yak_meta = /*#__PURE__*/ styled("meta");
322
- const __yak_meter = /*#__PURE__*/ styled("meter");
323
- const __yak_nav = /*#__PURE__*/ styled("nav");
324
- const __yak_noscript = /*#__PURE__*/ styled("noscript");
325
- const __yak_object = /*#__PURE__*/ styled("object");
326
- const __yak_ol = /*#__PURE__*/ styled("ol");
327
- const __yak_optgroup = /*#__PURE__*/ styled("optgroup");
328
- const __yak_option = /*#__PURE__*/ styled("option");
329
- const __yak_output = /*#__PURE__*/ styled("output");
330
- const __yak_p = /*#__PURE__*/ styled("p");
331
- const __yak_param = /*#__PURE__*/ styled("param");
332
- const __yak_picture = /*#__PURE__*/ styled("picture");
333
- const __yak_pre = /*#__PURE__*/ styled("pre");
334
- const __yak_progress = /*#__PURE__*/ styled("progress");
335
- const __yak_q = /*#__PURE__*/ styled("q");
336
- const __yak_rp = /*#__PURE__*/ styled("rp");
337
- const __yak_rt = /*#__PURE__*/ styled("rt");
338
- const __yak_ruby = /*#__PURE__*/ styled("ruby");
339
- const __yak_s = /*#__PURE__*/ styled("s");
340
- const __yak_samp = /*#__PURE__*/ styled("samp");
341
- const __yak_script = /*#__PURE__*/ styled("script");
342
- const __yak_section = /*#__PURE__*/ styled("section");
343
- const __yak_select = /*#__PURE__*/ styled("select");
344
- const __yak_small = /*#__PURE__*/ styled("small");
345
- const __yak_source = /*#__PURE__*/ styled("source");
346
- const __yak_span = /*#__PURE__*/ styled("span");
347
- const __yak_strong = /*#__PURE__*/ styled("strong");
348
- const __yak_style = /*#__PURE__*/ styled("style");
349
- const __yak_sub = /*#__PURE__*/ styled("sub");
350
- const __yak_summary = /*#__PURE__*/ styled("summary");
351
- const __yak_sup = /*#__PURE__*/ styled("sup");
352
- const __yak_table = /*#__PURE__*/ styled("table");
353
- const __yak_tbody = /*#__PURE__*/ styled("tbody");
354
- const __yak_td = /*#__PURE__*/ styled("td");
355
- const __yak_textarea = /*#__PURE__*/ styled("textarea");
356
- const __yak_tfoot = /*#__PURE__*/ styled("tfoot");
357
- const __yak_th = /*#__PURE__*/ styled("th");
358
- const __yak_thead = /*#__PURE__*/ styled("thead");
359
- const __yak_time = /*#__PURE__*/ styled("time");
360
- const __yak_tr = /*#__PURE__*/ styled("tr");
361
- const __yak_track = /*#__PURE__*/ styled("track");
362
- const __yak_u = /*#__PURE__*/ styled("u");
363
- const __yak_ul = /*#__PURE__*/ styled("ul");
364
- const __yak_use = /*#__PURE__*/ styled("use");
365
- const __yak_var = /*#__PURE__*/ styled("var");
366
- const __yak_video = /*#__PURE__*/ styled("video");
367
- const __yak_wbr = /*#__PURE__*/ styled("wbr");
368
- const __yak_circle = /*#__PURE__*/ styled("circle");
369
- const __yak_clipPath = /*#__PURE__*/ styled("clipPath");
370
- const __yak_defs = /*#__PURE__*/ styled("defs");
371
- const __yak_ellipse = /*#__PURE__*/ styled("ellipse");
372
- const __yak_foreignObject = /*#__PURE__*/ styled("foreignObject");
373
- const __yak_g = /*#__PURE__*/ styled("g");
374
- const __yak_image = /*#__PURE__*/ styled("image");
375
- const __yak_line = /*#__PURE__*/ styled("line");
376
- const __yak_linearGradient = /*#__PURE__*/ styled("linearGradient");
377
- const __yak_marker = /*#__PURE__*/ styled("marker");
378
- const __yak_mask = /*#__PURE__*/ styled("mask");
379
- const __yak_path = /*#__PURE__*/ styled("path");
380
- const __yak_pattern = /*#__PURE__*/ styled("pattern");
381
- const __yak_polygon = /*#__PURE__*/ styled("polygon");
382
- const __yak_polyline = /*#__PURE__*/ styled("polyline");
383
- const __yak_radialGradient = /*#__PURE__*/ styled("radialGradient");
384
- const __yak_rect = /*#__PURE__*/ styled("rect");
385
- const __yak_stop = /*#__PURE__*/ styled("stop");
386
- const __yak_svg = /*#__PURE__*/ styled("svg");
387
- const __yak_text = /*#__PURE__*/ styled("text");
388
- const __yak_tspan = /*#__PURE__*/ styled("tspan");
389
-
390
- //#endregion
391
- Object.defineProperty(exports, 'YakThemeProvider', {
392
- enumerable: true,
393
- get: function () {
394
- return _yak_react_context.YakThemeProvider;
395
- }
396
- });
397
- exports.__yak_a = __yak_a;
398
- exports.__yak_abbr = __yak_abbr;
399
- exports.__yak_address = __yak_address;
400
- exports.__yak_area = __yak_area;
401
- exports.__yak_article = __yak_article;
402
- exports.__yak_aside = __yak_aside;
403
- exports.__yak_audio = __yak_audio;
404
- exports.__yak_b = __yak_b;
405
- exports.__yak_base = __yak_base;
406
- exports.__yak_bdi = __yak_bdi;
407
- exports.__yak_bdo = __yak_bdo;
408
- exports.__yak_big = __yak_big;
409
- exports.__yak_blockquote = __yak_blockquote;
410
- exports.__yak_body = __yak_body;
411
- exports.__yak_br = __yak_br;
412
- exports.__yak_button = __yak_button;
413
- exports.__yak_canvas = __yak_canvas;
414
- exports.__yak_caption = __yak_caption;
415
- exports.__yak_circle = __yak_circle;
416
- exports.__yak_cite = __yak_cite;
417
- exports.__yak_clipPath = __yak_clipPath;
418
- exports.__yak_code = __yak_code;
419
- exports.__yak_col = __yak_col;
420
- exports.__yak_colgroup = __yak_colgroup;
421
- exports.__yak_data = __yak_data;
422
- exports.__yak_datalist = __yak_datalist;
423
- exports.__yak_dd = __yak_dd;
424
- exports.__yak_defs = __yak_defs;
425
- exports.__yak_del = __yak_del;
426
- exports.__yak_details = __yak_details;
427
- exports.__yak_dfn = __yak_dfn;
428
- exports.__yak_dialog = __yak_dialog;
429
- exports.__yak_div = __yak_div;
430
- exports.__yak_dl = __yak_dl;
431
- exports.__yak_dt = __yak_dt;
432
- exports.__yak_ellipse = __yak_ellipse;
433
- exports.__yak_em = __yak_em;
434
- exports.__yak_embed = __yak_embed;
435
- exports.__yak_fieldset = __yak_fieldset;
436
- exports.__yak_figcaption = __yak_figcaption;
437
- exports.__yak_figure = __yak_figure;
438
- exports.__yak_footer = __yak_footer;
439
- exports.__yak_foreignObject = __yak_foreignObject;
440
- exports.__yak_form = __yak_form;
441
- exports.__yak_g = __yak_g;
442
- exports.__yak_h1 = __yak_h1;
443
- exports.__yak_h2 = __yak_h2;
444
- exports.__yak_h3 = __yak_h3;
445
- exports.__yak_h4 = __yak_h4;
446
- exports.__yak_h5 = __yak_h5;
447
- exports.__yak_h6 = __yak_h6;
448
- exports.__yak_header = __yak_header;
449
- exports.__yak_hgroup = __yak_hgroup;
450
- exports.__yak_hr = __yak_hr;
451
- exports.__yak_html = __yak_html;
452
- exports.__yak_i = __yak_i;
453
- exports.__yak_iframe = __yak_iframe;
454
- exports.__yak_image = __yak_image;
455
- exports.__yak_img = __yak_img;
456
- exports.__yak_input = __yak_input;
457
- exports.__yak_ins = __yak_ins;
458
- exports.__yak_kbd = __yak_kbd;
459
- exports.__yak_keygen = __yak_keygen;
460
- exports.__yak_label = __yak_label;
461
- exports.__yak_legend = __yak_legend;
462
- exports.__yak_li = __yak_li;
463
- exports.__yak_line = __yak_line;
464
- exports.__yak_linearGradient = __yak_linearGradient;
465
- exports.__yak_link = __yak_link;
466
- exports.__yak_main = __yak_main;
467
- exports.__yak_map = __yak_map;
468
- exports.__yak_mark = __yak_mark;
469
- exports.__yak_marker = __yak_marker;
470
- exports.__yak_mask = __yak_mask;
471
- exports.__yak_menu = __yak_menu;
472
- exports.__yak_menuitem = __yak_menuitem;
473
- exports.__yak_mergeClassNames = mergeClassNames;
474
- exports.__yak_mergeCssProp = mergeCssProp;
475
- exports.__yak_meta = __yak_meta;
476
- exports.__yak_meter = __yak_meter;
477
- exports.__yak_nav = __yak_nav;
478
- exports.__yak_noscript = __yak_noscript;
479
- exports.__yak_object = __yak_object;
480
- exports.__yak_ol = __yak_ol;
481
- exports.__yak_optgroup = __yak_optgroup;
482
- exports.__yak_option = __yak_option;
483
- exports.__yak_output = __yak_output;
484
- exports.__yak_p = __yak_p;
485
- exports.__yak_param = __yak_param;
486
- exports.__yak_path = __yak_path;
487
- exports.__yak_pattern = __yak_pattern;
488
- exports.__yak_picture = __yak_picture;
489
- exports.__yak_polygon = __yak_polygon;
490
- exports.__yak_polyline = __yak_polyline;
491
- exports.__yak_pre = __yak_pre;
492
- exports.__yak_progress = __yak_progress;
493
- exports.__yak_q = __yak_q;
494
- exports.__yak_radialGradient = __yak_radialGradient;
495
- exports.__yak_rect = __yak_rect;
496
- exports.__yak_rp = __yak_rp;
497
- exports.__yak_rt = __yak_rt;
498
- exports.__yak_ruby = __yak_ruby;
499
- exports.__yak_s = __yak_s;
500
- exports.__yak_samp = __yak_samp;
501
- exports.__yak_script = __yak_script;
502
- exports.__yak_section = __yak_section;
503
- exports.__yak_select = __yak_select;
504
- exports.__yak_small = __yak_small;
505
- exports.__yak_source = __yak_source;
506
- exports.__yak_span = __yak_span;
507
- exports.__yak_stop = __yak_stop;
508
- exports.__yak_strong = __yak_strong;
509
- exports.__yak_style = __yak_style;
510
- exports.__yak_sub = __yak_sub;
511
- exports.__yak_summary = __yak_summary;
512
- exports.__yak_sup = __yak_sup;
513
- exports.__yak_svg = __yak_svg;
514
- exports.__yak_table = __yak_table;
515
- exports.__yak_tbody = __yak_tbody;
516
- exports.__yak_td = __yak_td;
517
- exports.__yak_text = __yak_text;
518
- exports.__yak_textarea = __yak_textarea;
519
- exports.__yak_tfoot = __yak_tfoot;
520
- exports.__yak_th = __yak_th;
521
- exports.__yak_thead = __yak_thead;
522
- exports.__yak_time = __yak_time;
523
- exports.__yak_tr = __yak_tr;
524
- exports.__yak_track = __yak_track;
525
- exports.__yak_tspan = __yak_tspan;
526
- exports.__yak_u = __yak_u;
527
- exports.__yak_ul = __yak_ul;
528
- exports.__yak_unitPostFix = unitPostFix;
529
- exports.__yak_use = __yak_use;
530
- exports.__yak_var = __yak_var;
531
- exports.__yak_video = __yak_video;
532
- exports.__yak_wbr = __yak_wbr;
533
- exports.atoms = atoms;
534
- exports.css = css;
535
- exports.globalStyle = globalStyle;
536
- exports.keyframes = keyframes;
537
- exports.styled = styled;
538
- Object.defineProperty(exports, 'useTheme', {
539
- enumerable: true,
540
- get: function () {
541
- return _yak_react_context.useTheme;
542
- }
543
- });
544
- //# sourceMappingURL=internal.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"internal.cjs","names":["INTERNAL.ATTRS_MERGED","useTheme","INTERNAL.RUNTIME_STYLES_DONE"],"sources":["../runtime/cssLiteral.tsx","../runtime/internals/propMarkers.ts","../runtime/internals/mergeClassNames.ts","../runtime/styled.tsx","../runtime/atoms.tsx","../runtime/keyframes.tsx","../runtime/globalStyle.tsx","../runtime/internals/unitPostFix.ts","../runtime/internals/mergeCssProp.ts","../runtime/styledDom.tsx"],"sourcesContent":["import type { YakTheme } from \"./index.ts\";\nimport { ClassNameCollector, RuntimeStyleProcessor } from \"./publicStyledApi.js\";\n\nexport const yakComponentSymbol = Symbol(\"yak\");\n\n/**\n * String-backed ClassNameCollector used by the render path\n *\n * `add` is a plain string append and does not deduplicate, so the collector is\n * a multiset - the same class may appear twice, e.g. `atoms(\"a b\", \"a\")` → `\"a b a\"`.\n * `has`/`delete` cover the rare path where a runtime function inspects or\n * removes classes; `delete` removes every occurrence\n */\nexport class ClassNames implements ClassNameCollector {\n value: string;\n constructor(initial?: string) {\n this.value = initial || \"\";\n }\n add(className: string) {\n this.value += (this.value && \" \") + className;\n }\n has(className: string) {\n return (\" \" + this.value + \" \").includes(\" \" + className + \" \");\n }\n delete(className: string) {\n if (this.has(className)) {\n this.value = this.value\n .split(\" \")\n .filter((existing) => existing !== className)\n .join(\" \");\n }\n }\n}\n\nexport type ComponentStyles<TProps> = (props: TProps) => {\n className: string;\n style?: {\n [key: string]: string;\n };\n};\n\nexport type CSSInterpolation<TProps> =\n | string\n | number\n | undefined\n | null\n | false\n | ComponentStyles<TProps>\n | {\n // type only identifier to allow targeting components\n // e.g. styled.svg`${Button}:hover & { fill: red; }`\n [yakComponentSymbol]: any;\n }\n | ((props: TProps) => CSSInterpolation<TProps>);\n\ntype CSSStyles<TProps = {}> = {\n style: { [key: string]: string | ((props: TProps) => string) };\n};\n\ntype CSSFunction = <TProps = {}>(\n styles: TemplateStringsArray,\n ...values: CSSInterpolation<TProps & { theme: YakTheme }>[]\n) => ComponentStyles<TProps>;\n\nexport type NestedRuntimeStyleProcessor = (\n props: unknown,\n classNames: ClassNameCollector,\n style: React.CSSProperties,\n) =>\n | {\n className?: string;\n style?: React.CSSProperties;\n }\n | void\n | NestedRuntimeStyleProcessor;\n\n/**\n * css() runtime factory of css``\n *\n * /!\\ @yak/react transpiles css`` and styled``\n *\n * This changes the typings of the css`` and styled`` functions.\n * During development the user of @yak/react wants to work with the\n * typings BEFORE compilation.\n *\n * Therefore this is only an internal function only and it must be cast to any\n * before exported to the user.\n *\n * The internal functioning of css`` is to return a single callback function that runs all functions\n * (or creates new ones if needed) that are passed as arguments. These functions receive the props, classNames, and style object as arguments\n * and operate directly on the classNames and style objects.\n */\nexport function css<TProps>(\n styles: TemplateStringsArray,\n ...values: CSSInterpolation<NoInfer<TProps> & { theme: YakTheme }>[]\n): ComponentStyles<TProps>;\nexport function css<TProps>(...args: Array<any>): RuntimeStyleProcessor<TProps> {\n // Normally this could be an array of strings passed, but as we transpile the usage of css`` ourselves, we control the arguments\n // and ensure that only the first argument is a string (class name of the non-dynamic styles)\n let className: string | undefined;\n const dynamicCssFunctions: NestedRuntimeStyleProcessor[] = [];\n for (const arg of args as Array<string | CSSFunction | CSSStyles<any>>) {\n // A CSS-module class name which got auto generated during build from static css\n // e.g. css`color: red;`\n // compiled -> css(\"yak31e4\")\n if (typeof arg === \"string\") {\n className = arg;\n }\n // Dynamic CSS e.g.\n // css`${props => props.active && css`color: red;`}`\n // compiled -> css((props: { active: boolean }) => props.active && css(\"yak31e4\"))\n else if (typeof arg === \"function\") {\n dynamicCssFunctions.push(arg as unknown as NestedRuntimeStyleProcessor);\n }\n // Dynamic CSS with css variables e.g.\n // css`transform: translate(${props => props.x}, ${props => props.y});`\n // compiled -> css(\"yak31e4\", { style: { \"--yakVarX\": props => props.x }, \"--yakVarY\": props => props.y }})\n else if (typeof arg === \"object\" && \"style\" in arg) {\n dynamicCssFunctions.push((props, _, style) => {\n for (const key in arg.style) {\n const value = arg.style[key];\n if (typeof value === \"function\") {\n // @ts-expect-error CSSProperties don't allow css variables\n style[key] = String(\n // The value for a css value can be a theme dependent function e.g.:\n // const borderColor = (props: { theme: { mode: \"dark\" | \"light\" } }) => props.theme === \"dark\" ? \"black\" : \"white\";\n // css`border-color: ${borderColor};`\n // Therefore the value has to be extracted recursively\n recursivePropExecution(props, value),\n );\n } else {\n // @ts-expect-error CSSProperties don't allow css variables\n style[key] = String(value);\n }\n }\n });\n }\n }\n\n // Non Dynamic CSS\n // This is just an optimization for the common case where there are no dynamic css functions\n // `$dynamic: false` lets the styled runtime skip theme lookup and\n // style-object allocation entirely for static components\n if (dynamicCssFunctions.length === 0) {\n return Object.assign(\n (_: unknown, classNames: ClassNameCollector) => {\n if (className) {\n classNames.add(className);\n }\n },\n { $dynamic: false },\n );\n }\n\n return Object.assign(\n (props: TProps, classNames: ClassNameCollector, allStyles: React.CSSProperties) => {\n if (className) {\n classNames.add(className);\n }\n for (let i = 0; i < dynamicCssFunctions.length; i++) {\n unwrapProps(props, dynamicCssFunctions[i], classNames, allStyles);\n }\n },\n { $dynamic: true },\n );\n}\n\n// Dynamic CSS with runtime logic\nconst unwrapProps = (\n props: unknown,\n fn: NestedRuntimeStyleProcessor,\n classNames: ClassNameCollector,\n style: React.CSSProperties,\n) => {\n let result = fn(props, classNames, style);\n while (result) {\n if (typeof result === \"function\") {\n result = result(props, classNames, style);\n continue;\n } else if (typeof result === \"object\") {\n if (\"className\" in result && result.className) {\n classNames.add(result.className);\n }\n if (\"style\" in result && result.style) {\n for (const key in result.style) {\n // This is hard for typescript to infer\n style[key as keyof React.CSSProperties] = result.style[\n key as keyof React.CSSProperties\n ] as any;\n }\n }\n }\n break;\n }\n};\n\nconst recursivePropExecution = (props: unknown, fn: (props: unknown) => any): string | number => {\n const result = fn(props);\n if (typeof result === \"function\") {\n return recursivePropExecution(props, result);\n }\n // the `process.env` lookup is a real per-call cost for unbundled Node\n // consumers, so it must stay behind the typeof guards on the invalid path\n if (typeof result !== \"string\" && typeof result !== \"number\" && !(result instanceof String)) {\n if (process.env.NODE_ENV === \"development\") {\n throw new Error(\n `Dynamic CSS functions must return a string or number but returned ${JSON.stringify(\n result,\n )}\\n\\nDynamic CSS function: ${fn.toString()}\\n`,\n );\n }\n }\n return result;\n};\n","/** Internal markers used by the render path */\n\n/**\n * Set on props once the attrs functions have been folded in, so a nested yak\n * wrapper further out the chain does not merge the same attrs twice\n */\nexport const ATTRS_MERGED = \"$__a\" as const;\n\n/**\n * Set on props once the runtime style processor has run, so an outer yak\n * component that receives already-processed props skips the collector entirely\n */\nexport const RUNTIME_STYLES_DONE = \"$__r\" as const;\n\n/**\n * Carries the constant `.attrs({...})` object on the merged attrs function,\n * marking it theme-independent so the fast render path can apply it without\n * executing anything. Lives on the function, never on props\n */\nexport const STATIC_ATTRS = \"$sa\" as const;\n","/**\n * Merges two optional class name values with a space.\n *\n * Used by the styled runtime to combine incoming and generated class names,\n * and injected by the compiler (as `__yak_mergeClassNames`) when it replaces\n * a JSX usage of a fully static styled component with a plain DOM element:\n * ```tsx\n * const Card = styled.div`color: red;`;\n * <Card className={active && \"active\"} />\n * ```\n * becomes\n * ```tsx\n * <div className={__yak_mergeClassNames(\"yX\", active && \"active\")} />\n * ```\n */\nexport const mergeClassNames = (\n a: string | false | null | undefined,\n b: string | false | null | undefined,\n) => {\n if (!a) return b || undefined;\n if (!b) return a;\n return a + \" \" + b;\n};\n","import { css, CSSInterpolation, ClassNames, yakComponentSymbol } from \"./cssLiteral.js\";\nimport * as INTERNAL from \"./internals/propMarkers.js\";\nimport React from \"react\";\nimport type {\n Attrs,\n AttrsMerged,\n Styled,\n YakComponent,\n AttrsFunction,\n StyledFn,\n HtmlTags,\n Substitute,\n StyledLiteral,\n RuntimeStyleProcessor,\n} from \"./publicStyledApi.js\";\n\n// the following export is not relative as \"@yak/react/context\"\n// links to one file for react server components and\n// to another file for classic react components\nimport { useTheme } from \"@yak/react/context\";\nimport type { YakTheme } from \"./context/index.tsx\";\nimport { mergeClassNames } from \"./internals/mergeClassNames.js\";\n\n//\n// The `styled()` API without `styled.` syntax\n//\n// The API design is inspired by styled-components:\n// https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/constructors/styled.tsx\n// https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/models/StyledComponent.ts\n//\nconst styledFactory: StyledFn = (Component) =>\n Object.assign(yakStyled(Component), {\n attrs: (attrs: Attrs<any>) => yakStyled(Component, attrs),\n });\n\n/**\n * The `styled` method works perfectly on all of your own or any third-party component,\n * as long as they attach the passed className prop to a DOM element.\n *\n * @usage\n *\n * ```tsx\n * const StyledLink = styled(Link)`\n * color: #BF4F74;\n * font-weight: bold;\n * `;\n * ```\n */\nexport const styled = styledFactory as Styled;\n\n/**\n * Real shape of the yakComponentSymbol tuple, which the public `YakComponent`\n * keeps opaque as `[unknown, ...]`\n */\ntype YakComponentInternals = [\n self: React.FunctionComponent,\n attrsFn: AttrsFunction<any, any, any> | undefined,\n styleProcessor: RuntimeStyleProcessor<unknown>,\n target: React.FunctionComponent | string,\n];\n\nconst yakStyled: StyledInternal = (Component, attrs) => {\n const isYakComponent = typeof Component !== \"string\" && yakComponentSymbol in Component;\n\n // if the component that is wrapped is a yak component, we can extract it to render the underlying component directly\n // and we can also extract the attrs function and the dynamic style function to merge it with the current attrs function (or dynamic style function)\n // so that the sequence of the attrs functions is preserved\n const [, parentAttrsFn, parentRuntimeStylesFn, parentTarget] = isYakComponent\n ? (Component[yakComponentSymbol] as [\n YakComponent<unknown>,\n ExtractAttrsFunction<typeof attrs>,\n RuntimeStyleProcessor<unknown>,\n React.FunctionComponent | string,\n ])\n : [];\n\n // the ultimate render target of the whole styled(styled(...)) chain:\n // attrs and style processors are already merged at construction time, so\n // a chain of N levels renders the target directly in ONE wrapper instead\n // of re-entering every parent wrapper per element per render\n const targetComponent = (isYakComponent ? parentTarget : Component) as\n | React.FunctionComponent\n | string;\n\n const mergedAttrsFn = buildRuntimeAttrsProcessor(attrs, parentAttrsFn);\n const staticAttrs = (mergedAttrsFn as StaticAttrsCarrier | undefined)?.[INTERNAL.STATIC_ATTRS];\n\n return (styles, ...values) => {\n // combine all interpolated logic into a single function\n // e.g. styled.button`color: ${props => props.color}; margin: ${props => props.margin};`\n const runtimeStylesFn = css(\n styles,\n ...(values as CSSInterpolation<unknown>[]),\n ) as RuntimeStyleProcessor<unknown>;\n const runtimeStyleProcessor = buildRuntimeStylesProcessor(\n runtimeStylesFn,\n parentRuntimeStylesFn,\n );\n const Yak: React.FunctionComponent = (props) => {\n // fast path for components that contribute the same thing on every\n // render — no attrs at all, or a constant `.attrs({...})` which cannot\n // read the theme — and no dynamic styles. Contributes the chain's class\n // names and strips $-props; skips theme lookup, prop spreading and style\n // cloning entirely (this is NOT against the rule of hooks — the condition\n // is constant for the lifetime of the component)\n if ((!mergedAttrsFn || staticAttrs) && !runtimeStyleProcessor.$dynamic) {\n // props that already went through a yak wrapper keep their processed\n // className, and `source` then aliases `props` — so the class names are\n // written to the fresh, filtered object rather than back into props\n const source = (\n staticAttrs && !(INTERNAL.ATTRS_MERGED in props)\n ? combineProps(\n {\n ...(props as { className?: string; style?: React.CSSProperties }),\n // mark the props as processed\n [INTERNAL.ATTRS_MERGED]: true,\n },\n staticAttrs,\n )\n : props\n ) as { className?: string; style?: React.CSSProperties };\n const filteredProps = removeNonDomProperties(source) as {\n className?: string;\n };\n if (!(INTERNAL.RUNTIME_STYLES_DONE in source)) {\n const classNames = new ClassNames(source.className);\n runtimeStyleProcessor(source, classNames, undefined as unknown as React.CSSProperties);\n filteredProps.className = classNames.value || undefined;\n }\n const Target = targetComponent as React.ElementType;\n return <Target {...(filteredProps as React.ComponentProps<typeof Target>)} />;\n }\n\n // attrs functions and dynamic style functions receive the theme —\n // fully static components take the fast path above and never read the\n // theme context\n const theme = useTheme();\n\n // The first components which is not wrapped in a yak component will execute all attrs functions\n // starting from the innermost yak component to the outermost yak component (itself)\n const combinedProps =\n INTERNAL.ATTRS_MERGED in props\n ? ({\n theme,\n ...props,\n } as {\n theme: YakTheme;\n className?: string;\n style?: React.CSSProperties;\n })\n : // overwrite and merge the current props with the processed attrs\n combineProps(\n {\n theme,\n ...(props as {\n className?: string;\n style?: React.CSSProperties;\n }),\n // mark the props as processed\n [INTERNAL.ATTRS_MERGED]: true,\n },\n mergedAttrsFn?.({ theme, ...(props as any) }),\n );\n\n // execute all functions inside the style literal if not already executed\n // e.g. styled.button`color: ${props => props.color};`\n //\n // inner levels of a styled(Component) chain receive already-processed\n // props and skip this entirely — no collector, no style clone\n if (!(INTERNAL.RUNTIME_STYLES_DONE in combinedProps)) {\n const classNames = new ClassNames(combinedProps.className);\n // static processors never write style values, so the incoming style\n // object can be passed through without a defensive copy\n const styles = runtimeStyleProcessor.$dynamic\n ? { ...combinedProps.style }\n : combinedProps.style;\n runtimeStyleProcessor(combinedProps, classNames, styles as React.CSSProperties);\n // @ts-expect-error this is not typed correctly\n combinedProps[INTERNAL.RUNTIME_STYLES_DONE] = true;\n\n combinedProps.className = classNames.value || undefined;\n if (styles !== combinedProps.style) {\n combinedProps.style = styles;\n }\n }\n\n // delete the yak theme from the props\n // this must happen after the runtimeStyles are calculated\n // prevents passing the theme prop to the DOM element of a styled component\n const { theme: themeAfterAttr, ...combinedPropsWithoutTheme } = combinedProps;\n const propsBeforeFiltering =\n themeAfterAttr === theme ? combinedPropsWithoutTheme : combinedProps;\n\n // remove all props that start with a $ sign so they reach neither DOM\n // elements nor custom components — this also strips the internal\n // INTERNAL.ATTRS_MERGED/INTERNAL.RUNTIME_STYLES_DONE markers, which must not cross a\n // custom component boundary (a custom component may render another yak\n // component that has to process its own attrs/styles)\n const filteredProps = removeNonDomProperties(propsBeforeFiltering);\n\n // render the chain's target directly — parent wrappers contribute only\n // their (already merged) attrs and style processors\n const Target = targetComponent as React.ElementType;\n return <Target {...(filteredProps as React.ComponentProps<typeof Target>)} />;\n };\n\n // Direct write instead of Object.assign (faster & smaller)\n const taggedYak = Yak as React.FunctionComponent & {\n [yakComponentSymbol]: YakComponentInternals;\n };\n taggedYak[yakComponentSymbol] = [Yak, mergedAttrsFn, runtimeStyleProcessor, targetComponent];\n return taggedYak;\n };\n};\n\n/**\n * Remove all entries that start with a $ sign\n *\n * This allows to have props that are used for internal styling purposes\n * but are not be passed to the DOM element\n */\nconst removeNonDomProperties = <T extends Record<string, unknown>>(obj: T): T => {\n const result = {} as T;\n for (const key in obj) {\n if (!key.startsWith(\"$\") && obj[key] !== undefined) {\n result[key] = obj[key];\n }\n }\n return result;\n};\n\n/**\n * merge props and processed props (including class names and styles)\n * e.g.:\\\n * `{ className: \"a\", foo: 1 }` and `{ className: \"b\", bar: 2 }` \\\n * => `{ className: \"a b\", foo: 1, bar: 2 }`\n */\nconst combineProps = <\n T extends {\n className?: string;\n style?: React.CSSProperties;\n },\n TOther extends\n | {\n className?: string;\n style?: React.CSSProperties;\n }\n | null\n | undefined,\n>(\n props: T,\n newProps: TOther,\n) =>\n newProps\n ? (props.className === newProps.className || !newProps.className) &&\n (props.style === newProps.style || !newProps.style)\n ? // shortcut if no style and class merging is necessary\n {\n ...props,\n ...newProps,\n }\n : // merge class names and styles\n {\n ...props,\n ...newProps,\n className: mergeClassNames(props.className, newProps.className),\n style: { ...props.style, ...newProps.style },\n }\n : // if no new props are provided, no merging is necessary\n props;\n\n/**\n * Merges the attrs function of the current component with the attrs function of the parent component\n * in order to preserve the sequence of the attrs functions.\n * Note: In theory, the parentAttrsFn can have different types for TAttrsIn and TAttrsOut\n * but as this is only used internally, we can ignore and simplify this case\n * @param attrs The attrs object or function of the current component (if any)\n * @param parentAttrsFn The attrs function of the parent/wrapped component (if any)\n * @returns A function that receives the props and returns the transformed props\n */\nconst buildRuntimeAttrsProcessor = <\n T,\n TAttrsIn extends object,\n TAttrsOut extends AttrsMerged<T, TAttrsIn>,\n>(\n attrs?: Attrs<T, TAttrsIn, TAttrsOut>,\n parentAttrsFn?: AttrsFunction<T, TAttrsIn, TAttrsOut>,\n): AttrsFunction<T, TAttrsIn, TAttrsOut> | undefined => {\n const ownAttrsFn = attrs && (typeof attrs === \"function\" ? attrs : () => attrs);\n\n if (ownAttrsFn && parentAttrsFn) {\n return (props) => {\n const parentProps = parentAttrsFn(props);\n\n // overwrite and merge the parent props with the props received from the attrs function\n // after they went through the parent attrs function.\n //\n // This makes sure the linearity of the attrs functions is preserved and all attrs function receive\n // the whole props object calculated from the previous attrs functions\n return combineProps(parentProps, ownAttrsFn(combineProps(props, parentProps)));\n };\n }\n\n // A constant `.attrs({...})` is wrapped into `() => attrs`, which makes it\n // indistinguishable from `.attrs(props => ...)` at render time — so record the\n // object it will always return. Only the wrapper closure is tagged, never a\n // user-supplied attrs function.\n //\n // A `styled(StyledWithAttrs).attrs({...})` chain merges its levels per render\n // and is not tagged, which keeps a mutation of an attrs object observable\n if (ownAttrsFn && typeof attrs !== \"function\") {\n return Object.assign(ownAttrsFn, {\n [INTERNAL.STATIC_ATTRS]: attrs,\n } as StaticAttrsCarrier);\n }\n\n return ownAttrsFn || parentAttrsFn;\n};\n\n/**\n * The constant object a `.attrs({...})` processor always returns\n *\n * Kept local to this module — like the `yakComponentSymbol` tuple, it is an\n * implementation detail and must not reach the public `AttrsFunction` type\n */\ntype StaticAttrsCarrier = { [K in typeof INTERNAL.STATIC_ATTRS]?: object };\n\n/**\n * Merges the runtime style function of the current component with the runtime style function of the parent component\n * in order to preserve the sequence of the attrs functions.\n * @param runtimeStylesFn The current runtime styles function\n * @param parentRuntimeStylesFn The parent runtime styles function\n * @returns The merged runtime styles function\n */\nconst buildRuntimeStylesProcessor = <T,>(\n runtimeStylesFn: RuntimeStyleProcessor<T>,\n parentRuntimeStylesFn?: RuntimeStyleProcessor<T>,\n) => {\n if (runtimeStylesFn && parentRuntimeStylesFn) {\n const combined: RuntimeStyleProcessor<T> = Object.assign(\n (\n props: T,\n classNames: Parameters<RuntimeStyleProcessor<T>>[1],\n style: React.CSSProperties,\n ) => {\n parentRuntimeStylesFn(props, classNames, style);\n runtimeStylesFn(props, classNames, style);\n },\n // the chain is dynamic if any level is dynamic\n { $dynamic: runtimeStylesFn.$dynamic || parentRuntimeStylesFn.$dynamic },\n );\n return combined;\n }\n return runtimeStylesFn || parentRuntimeStylesFn;\n};\n\n/**\n * Internal function where attrs are passed to be processed\n */\nexport type StyledInternal = <\n T extends object,\n TAttrsIn extends object = {},\n TAttrsOut extends AttrsMerged<T, TAttrsIn> = AttrsMerged<T, TAttrsIn>,\n>(\n Component: React.FunctionComponent<T> | YakComponent<T> | HtmlTags | string,\n attrs?: Attrs<T, TAttrsIn, TAttrsOut>,\n) => StyledLiteral<Substitute<T, TAttrsIn>>;\n\n/**\n * Utility type to extract the AttrsFunction from the Attrs type\n */\nexport type ExtractAttrsFunction<T> = T extends (p: any) => any ? T : never;\n","import { ClassNames, ComponentStyles, css } from \"./cssLiteral.js\";\nimport { RuntimeStyleProcessor } from \"./publicStyledApi.js\";\n\n/**\n * Allows to use atomic CSS classes in a styled or css block\n *\n * @usage\n *\n * ```tsx\n * import { styled, atoms } from \"@yak/react\";\n *\n * const Button = styled.button<{ $primary?: boolean }>`\n * ${atoms(\"text-teal-600\", \"text-base\", \"rounded-md\")}\n * ${props => props.$primary && atoms(\"shadow-md\")}\n * `;\n * ```\n */\nexport const atoms = <T,>(\n ...atoms: (string | RuntimeStyleProcessor<T> | false)[]\n): ComponentStyles<T> => {\n const staticClasses = new ClassNames();\n const dynamicFunctions: RuntimeStyleProcessor<T>[] = [];\n\n for (const atom of atoms) {\n if (typeof atom === \"string\") {\n staticClasses.add(atom);\n } else if (typeof atom === \"function\") {\n dynamicFunctions.push(atom);\n }\n }\n\n // the collected classes are passed as css()'s static class name,\n // only the dynamic atoms stay functions\n // @ts-expect-error the internal implementation of css is not typed\n return css(staticClasses.value, ...dynamicFunctions);\n};\n","/**\n * Allows to use CSS keyframe animations in a styled or css block\n *\n * @usage\n *\n * ```tsx\n * import { styled, keyframes } from \"@yak/react\";\n *\n * const rotate = keyframes`\n * from {\n * transform: rotate(0deg);\n * }\n * to {\n * transform: rotate(360deg);\n * }\n * `;\n *\n * const Spinner = styled.div`\n * animation: ${rotate} 1s linear infinite;\n * `;\n * ```\n */\nexport const keyframes = <T extends (string | number | bigint)[] = never>(\n styles: TemplateStringsArray,\n ..._dynamic: T\n): string => {\n // during compilation all args of keyframe are compiled\n // to a string which references the animation name\n return styles as any as string;\n};\n","import type { ComponentStyles } from \"./cssLiteral.js\";\nimport type { YakComponent } from \"./publicStyledApi.js\";\n\n/**\n * Values that may be interpolated into a `globalStyle` template.\n *\n * Only build-time values are allowed — constants, `keyframes` animation names,\n * static `css` mixins and styled-component selectors. Runtime functions\n * (`${(props) => ...}`) are intentionally excluded: a global rule has no element\n * to attach a CSS variable to. Declare a CSS custom property instead and toggle\n * it via an attribute/class on the root element.\n */\nexport type GlobalStyleInterpolation = string | number | ComponentStyles<{}> | YakComponent<any>;\n\n/**\n * Declares global, unscoped styles that ride the same zero-runtime extraction\n * pipeline as `styled` and `keyframes`.\n *\n * Global styles are **part of the stylesheet, not part of the render tree**.\n * They apply exactly when the module declaring them is included in the bundle —\n * typically by importing it from a layout or entry point. They cannot be\n * conditionally mounted; express conditions in CSS (`@media`, `@supports`,\n * `:root[data-theme]`, `:has()`) or through CSS custom properties.\n *\n * @usage\n *\n * ```tsx\n * import { globalStyle, keyframes } from \"@yak/react\";\n *\n * const fadeIn = keyframes`\n * from { opacity: 0; }\n * `;\n *\n * globalStyle`\n * :root {\n * --spacing: 4px;\n * }\n *\n * body {\n * margin: 0;\n * }\n *\n * ::view-transition-new(root) {\n * animation: ${fadeIn} 200ms ease;\n * }\n * `;\n * ```\n */\nexport const globalStyle = (\n _styles: TemplateStringsArray,\n ..._values: Array<GlobalStyleInterpolation>\n): void => {\n return undefined;\n};\n","/**\n * Internal helper called by transformed code - Do not use directly\n *\n * Takes a function and a css unit and returns the result of the function concatenated with the unit\n *\n * ```tsx\n * import { styled } from \"@yak/react\";\n *\n * const Button = styled.button<{ $width?: boolean }>`\n * width: ${({ $width }) => $width}px;\n * `;\n * ```\n *\n * Which will be transformed to:\n * ```tsx\n * import { styled } from \"@yak/react/internals\";\n *\n * const Button = styled.button<{ $width?: boolean }>(\n * \"button\", {\n * width: unitPostFix({ $width }) => $width, \"px\")\n * });\n */\nexport const unitPostFix = (arg: unknown, unit: string) => {\n switch (typeof arg) {\n case \"function\":\n return (props: any) => unitPostFix(arg(props), unit);\n case \"number\":\n case \"string\":\n return `${arg}${unit}`;\n // Ignore falsy values\n default:\n return undefined;\n }\n};\n","import { ClassNames } from \"../cssLiteral.js\";\nimport { RuntimeStyleProcessor } from \"../publicStyledApi.js\";\n\n/**\n * This is an internal helper function to merge relevant props of a native element with a css prop.\n * It's automatically added when using the `css` prop in a JSX element.\n * e.g.:\n * ```tsx\n * <p\n * className=\"foo\"\n * css={css`\n * color: green;\n * `}\n * {...{ style: { padding: \"30px\" }}}\n * />\n * ```\n * compiles to\n * ```tsx\n * <p {...__yak_mergeCssProp(css(\"yakCss1\"), { className: \"foo\" }, { style: { padding: \"30px\" } })} />\n * ```\n * The css value comes first, then every merged source in JSX order, so a\n * later source wins as it would in one object literal.\n */\nexport const mergeCssProp = (\n cssProp: RuntimeStyleProcessor<unknown> | false | null | undefined,\n ...sources: (Record<string, unknown> | null | undefined)[]\n) => {\n // React props are plain values, so the sources are merged up front\n const result: Record<string, unknown> & {\n className?: string;\n style?: Record<string, string>;\n } = Object.assign({}, ...sources);\n\n const classNames = new ClassNames(result.className);\n const existingStyle = result.style;\n const style = existingStyle ? { ...existingStyle } : {};\n\n // only a style function applies styles. A falsy css prop applies none,\n // e.g. `css={on && css`...`}` with `on` false\n if (typeof cssProp === \"function\") {\n cssProp({}, classNames, style);\n } else if (cssProp) {\n // The swc plugin rejects a value which can not apply styles at build time,\n // so this only runs where it can not see one during build time.\n if (process.env.NODE_ENV === \"development\") {\n const received: unknown = cssProp;\n throw new Error(\n `The css prop only applies styles written in place, but received ${\n Array.isArray(received) ? \"an array\" : `a value of type ${typeof received}`\n }.\\n\\nCombine several styles in one template instead of an array: css={css\\`\\${first} \\${second}\\`}\\nWrite declarations in a template instead of an object: css={css\\`color: red;\\`}`,\n );\n }\n }\n\n // Forward all other props (onClick, aria-*, id, …) untouched and only\n // override className/style with the merged result\n if (Object.keys(style).length > 0) {\n result.style = style;\n } else {\n delete result.style;\n }\n if (classNames.value) {\n result.className = classNames.value;\n } else {\n delete result.className;\n }\n\n return result;\n};\n","import { styled } from \"./styled.js\";\n/// Internal API to create styled components\n/// Optimization for faster rendering and smaller bundle size in production\n/// thanks to better minification and dead code elimination\n///\n/// List taken from https://github.com/styled-components/styled-components/blob/e0019ba666fab4b5aaa2bff71ba6ad0005a299fd/packages/styled-components/src/utils/domElements.ts#L90\nexport const __yak_a = /*#__PURE__*/ styled(\"a\");\nexport const __yak_abbr = /*#__PURE__*/ styled(\"abbr\");\nexport const __yak_address = /*#__PURE__*/ styled(\"address\");\nexport const __yak_area = /*#__PURE__*/ styled(\"area\");\nexport const __yak_article = /*#__PURE__*/ styled(\"article\");\nexport const __yak_aside = /*#__PURE__*/ styled(\"aside\");\nexport const __yak_audio = /*#__PURE__*/ styled(\"audio\");\nexport const __yak_b = /*#__PURE__*/ styled(\"b\");\nexport const __yak_base = /*#__PURE__*/ styled(\"base\");\nexport const __yak_bdi = /*#__PURE__*/ styled(\"bdi\");\nexport const __yak_bdo = /*#__PURE__*/ styled(\"bdo\");\nexport const __yak_big = /*#__PURE__*/ styled(\"big\");\nexport const __yak_blockquote = /*#__PURE__*/ styled(\"blockquote\");\nexport const __yak_body = /*#__PURE__*/ styled(\"body\");\nexport const __yak_br = /*#__PURE__*/ styled(\"br\");\nexport const __yak_button = /*#__PURE__*/ styled(\"button\");\nexport const __yak_canvas = /*#__PURE__*/ styled(\"canvas\");\nexport const __yak_caption = /*#__PURE__*/ styled(\"caption\");\nexport const __yak_cite = /*#__PURE__*/ styled(\"cite\");\nexport const __yak_code = /*#__PURE__*/ styled(\"code\");\nexport const __yak_col = /*#__PURE__*/ styled(\"col\");\nexport const __yak_colgroup = /*#__PURE__*/ styled(\"colgroup\");\nexport const __yak_data = /*#__PURE__*/ styled(\"data\");\nexport const __yak_datalist = /*#__PURE__*/ styled(\"datalist\");\nexport const __yak_dd = /*#__PURE__*/ styled(\"dd\");\nexport const __yak_del = /*#__PURE__*/ styled(\"del\");\nexport const __yak_details = /*#__PURE__*/ styled(\"details\");\nexport const __yak_dfn = /*#__PURE__*/ styled(\"dfn\");\nexport const __yak_dialog = /*#__PURE__*/ styled(\"dialog\");\nexport const __yak_div = /*#__PURE__*/ styled(\"div\");\nexport const __yak_dl = /*#__PURE__*/ styled(\"dl\");\nexport const __yak_dt = /*#__PURE__*/ styled(\"dt\");\nexport const __yak_em = /*#__PURE__*/ styled(\"em\");\nexport const __yak_embed = /*#__PURE__*/ styled(\"embed\");\nexport const __yak_fieldset = /*#__PURE__*/ styled(\"fieldset\");\nexport const __yak_figcaption = /*#__PURE__*/ styled(\"figcaption\");\nexport const __yak_figure = /*#__PURE__*/ styled(\"figure\");\nexport const __yak_footer = /*#__PURE__*/ styled(\"footer\");\nexport const __yak_form = /*#__PURE__*/ styled(\"form\");\nexport const __yak_h1 = /*#__PURE__*/ styled(\"h1\");\nexport const __yak_h2 = /*#__PURE__*/ styled(\"h2\");\nexport const __yak_h3 = /*#__PURE__*/ styled(\"h3\");\nexport const __yak_h4 = /*#__PURE__*/ styled(\"h4\");\nexport const __yak_h5 = /*#__PURE__*/ styled(\"h5\");\nexport const __yak_h6 = /*#__PURE__*/ styled(\"h6\");\nexport const __yak_header = /*#__PURE__*/ styled(\"header\");\nexport const __yak_hgroup = /*#__PURE__*/ styled(\"hgroup\");\nexport const __yak_hr = /*#__PURE__*/ styled(\"hr\");\nexport const __yak_html = /*#__PURE__*/ styled(\"html\");\nexport const __yak_i = /*#__PURE__*/ styled(\"i\");\nexport const __yak_iframe = /*#__PURE__*/ styled(\"iframe\");\nexport const __yak_img = /*#__PURE__*/ styled(\"img\");\nexport const __yak_input = /*#__PURE__*/ styled(\"input\");\nexport const __yak_ins = /*#__PURE__*/ styled(\"ins\");\nexport const __yak_kbd = /*#__PURE__*/ styled(\"kbd\");\nexport const __yak_keygen = /*#__PURE__*/ styled(\"keygen\");\nexport const __yak_label = /*#__PURE__*/ styled(\"label\");\nexport const __yak_legend = /*#__PURE__*/ styled(\"legend\");\nexport const __yak_li = /*#__PURE__*/ styled(\"li\");\nexport const __yak_link = /*#__PURE__*/ styled(\"link\");\nexport const __yak_main = /*#__PURE__*/ styled(\"main\");\nexport const __yak_map = /*#__PURE__*/ styled(\"map\");\nexport const __yak_mark = /*#__PURE__*/ styled(\"mark\");\nexport const __yak_menu = /*#__PURE__*/ styled(\"menu\");\nexport const __yak_menuitem = /*#__PURE__*/ styled(\"menuitem\");\nexport const __yak_meta = /*#__PURE__*/ styled(\"meta\");\nexport const __yak_meter = /*#__PURE__*/ styled(\"meter\");\nexport const __yak_nav = /*#__PURE__*/ styled(\"nav\");\nexport const __yak_noscript = /*#__PURE__*/ styled(\"noscript\");\nexport const __yak_object = /*#__PURE__*/ styled(\"object\");\nexport const __yak_ol = /*#__PURE__*/ styled(\"ol\");\nexport const __yak_optgroup = /*#__PURE__*/ styled(\"optgroup\");\nexport const __yak_option = /*#__PURE__*/ styled(\"option\");\nexport const __yak_output = /*#__PURE__*/ styled(\"output\");\nexport const __yak_p = /*#__PURE__*/ styled(\"p\");\nexport const __yak_param = /*#__PURE__*/ styled(\"param\");\nexport const __yak_picture = /*#__PURE__*/ styled(\"picture\");\nexport const __yak_pre = /*#__PURE__*/ styled(\"pre\");\nexport const __yak_progress = /*#__PURE__*/ styled(\"progress\");\nexport const __yak_q = /*#__PURE__*/ styled(\"q\");\nexport const __yak_rp = /*#__PURE__*/ styled(\"rp\");\nexport const __yak_rt = /*#__PURE__*/ styled(\"rt\");\nexport const __yak_ruby = /*#__PURE__*/ styled(\"ruby\");\nexport const __yak_s = /*#__PURE__*/ styled(\"s\");\nexport const __yak_samp = /*#__PURE__*/ styled(\"samp\");\nexport const __yak_script = /*#__PURE__*/ styled(\"script\");\nexport const __yak_section = /*#__PURE__*/ styled(\"section\");\nexport const __yak_select = /*#__PURE__*/ styled(\"select\");\nexport const __yak_small = /*#__PURE__*/ styled(\"small\");\nexport const __yak_source = /*#__PURE__*/ styled(\"source\");\nexport const __yak_span = /*#__PURE__*/ styled(\"span\");\nexport const __yak_strong = /*#__PURE__*/ styled(\"strong\");\nexport const __yak_style = /*#__PURE__*/ styled(\"style\");\nexport const __yak_sub = /*#__PURE__*/ styled(\"sub\");\nexport const __yak_summary = /*#__PURE__*/ styled(\"summary\");\nexport const __yak_sup = /*#__PURE__*/ styled(\"sup\");\nexport const __yak_table = /*#__PURE__*/ styled(\"table\");\nexport const __yak_tbody = /*#__PURE__*/ styled(\"tbody\");\nexport const __yak_td = /*#__PURE__*/ styled(\"td\");\nexport const __yak_textarea = /*#__PURE__*/ styled(\"textarea\");\nexport const __yak_tfoot = /*#__PURE__*/ styled(\"tfoot\");\nexport const __yak_th = /*#__PURE__*/ styled(\"th\");\nexport const __yak_thead = /*#__PURE__*/ styled(\"thead\");\nexport const __yak_time = /*#__PURE__*/ styled(\"time\");\nexport const __yak_tr = /*#__PURE__*/ styled(\"tr\");\nexport const __yak_track = /*#__PURE__*/ styled(\"track\");\nexport const __yak_u = /*#__PURE__*/ styled(\"u\");\nexport const __yak_ul = /*#__PURE__*/ styled(\"ul\");\nexport const __yak_use = /*#__PURE__*/ styled(\"use\");\nexport const __yak_var = /*#__PURE__*/ styled(\"var\");\nexport const __yak_video = /*#__PURE__*/ styled(\"video\");\nexport const __yak_wbr = /*#__PURE__*/ styled(\"wbr\");\nexport const __yak_circle = /*#__PURE__*/ styled(\"circle\");\nexport const __yak_clipPath = /*#__PURE__*/ styled(\"clipPath\");\nexport const __yak_defs = /*#__PURE__*/ styled(\"defs\");\nexport const __yak_ellipse = /*#__PURE__*/ styled(\"ellipse\");\nexport const __yak_foreignObject = /*#__PURE__*/ styled(\"foreignObject\");\nexport const __yak_g = /*#__PURE__*/ styled(\"g\");\nexport const __yak_image = /*#__PURE__*/ styled(\"image\");\nexport const __yak_line = /*#__PURE__*/ styled(\"line\");\nexport const __yak_linearGradient = /*#__PURE__*/ styled(\"linearGradient\");\nexport const __yak_marker = /*#__PURE__*/ styled(\"marker\");\nexport const __yak_mask = /*#__PURE__*/ styled(\"mask\");\nexport const __yak_path = /*#__PURE__*/ styled(\"path\");\nexport const __yak_pattern = /*#__PURE__*/ styled(\"pattern\");\nexport const __yak_polygon = /*#__PURE__*/ styled(\"polygon\");\nexport const __yak_polyline = /*#__PURE__*/ styled(\"polyline\");\nexport const __yak_radialGradient = /*#__PURE__*/ styled(\"radialGradient\");\nexport const __yak_rect = /*#__PURE__*/ styled(\"rect\");\nexport const __yak_stop = /*#__PURE__*/ styled(\"stop\");\nexport const __yak_svg = /*#__PURE__*/ styled(\"svg\");\nexport const __yak_text = /*#__PURE__*/ styled(\"text\");\nexport const __yak_tspan = /*#__PURE__*/ styled(\"tspan\");\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAa,qBAAqB,OAAO,KAAK;AAU9C,IAAa,aAAb,MAAsD;CAEpD,YAAY,SAAkB;EAC5B,KAAK,QAAQ,WAAW;CAC1B;CACA,IAAI,WAAmB;EACrB,KAAK,UAAU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