@bluepic/embed 0.4.0-next.99 → 0.5.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 (87) hide show
  1. package/dist/bluepic-embed.iife.js +402 -178
  2. package/dist/bluepic-embed.umd.js +402 -178
  3. package/dist/components/AssetViewer/AssetViewer.vue.d.ts +71 -0
  4. package/dist/components/BxAudioPlayButton.vue.d.ts +24 -0
  5. package/dist/components/BxCard.vue.d.ts +35 -0
  6. package/dist/components/BxInput.vue.d.ts +7 -1
  7. package/dist/components/BxList.vue.d.ts +9 -0
  8. package/dist/components/BxListItem.vue.d.ts +13 -1
  9. package/dist/components/BxPopover.vue.d.ts +7 -0
  10. package/dist/components/BxPreviewLayer.vue.d.ts +18 -0
  11. package/dist/components/BxScrollbar.vue.d.ts +7 -0
  12. package/dist/components/BxSelect.vue.d.ts +16 -2
  13. package/dist/components/BxTable.vue.d.ts +109 -0
  14. package/dist/components/BxTabs.vue.d.ts +7 -0
  15. package/dist/components/BxWaveformThumb.vue.d.ts +27 -0
  16. package/dist/components/CollectionFieldPopup.vue.d.ts +4 -0
  17. package/dist/components/PopoverElement.vue.d.ts +10 -1
  18. package/dist/components/TemplateEditor/BatchCell.vue.d.ts +18 -0
  19. package/dist/components/TemplateEditor/BatchEditor.vue.d.ts +264 -0
  20. package/dist/components/TemplateEditor/BatchExportPopup.vue.d.ts +68 -0
  21. package/dist/components/TemplateEditor/BatchImportPopup.vue.d.ts +25 -0
  22. package/dist/components/TemplateEditor/BxLiveTemplate.vue.d.ts +8 -0
  23. package/dist/components/TemplateEditor/BxTemplateEditor.vue.d.ts +285 -16
  24. package/dist/components/TemplateEditor/FieldHintsLayer.vue.d.ts +86 -0
  25. package/dist/components/TemplateEditor/TemplateView.vue.d.ts +77 -2
  26. package/dist/components/User/UserInfo.vue.d.ts +12 -1
  27. package/dist/components/directives/usePopup.d.ts +5 -0
  28. package/dist/components/fields/Collection.vue.d.ts +3 -0
  29. package/dist/components/fields/Image.vue.d.ts +19 -5
  30. package/dist/components/fields/ImageEdit.vue.d.ts +6 -1
  31. package/dist/components/fields/Text.vue.d.ts +1 -1
  32. package/dist/embed/embed.d.ts +1024 -228
  33. package/dist/{index-CWm6zOv7.js → index-C99_zLhc.js} +9 -9
  34. package/dist/index-D8N6IfRw.cjs +1 -0
  35. package/dist/main.cjs +240 -162
  36. package/dist/main.d.ts +20 -0
  37. package/dist/main.mjs +79043 -68465
  38. package/dist/markdown-it-5-ieF6Bh.js +3790 -0
  39. package/dist/markdown-it-CLB5Jta6.cjs +16 -0
  40. package/dist/postal-mime-Df-WB8Vq.js +3337 -0
  41. package/dist/postal-mime-_7WF5UBe.cjs +28 -0
  42. package/dist/style.css +1 -1
  43. package/dist/theme/bridge.d.ts +14 -0
  44. package/dist/theme/color.d.ts +80 -0
  45. package/dist/theme/css.d.ts +8 -0
  46. package/dist/theme/index.d.ts +19 -0
  47. package/dist/theme/legacy.d.ts +3 -0
  48. package/dist/theme/resolve.d.ts +10 -0
  49. package/dist/theme/tokens.d.ts +129 -0
  50. package/dist/theme/types-contract.d.ts +13 -0
  51. package/dist/theme.cjs +1 -0
  52. package/dist/theme.mjs +1313 -0
  53. package/dist/util/assetAuth.d.ts +35 -0
  54. package/dist/util/audioPreview.d.ts +8 -0
  55. package/dist/util/batch/csv.d.ts +58 -0
  56. package/dist/util/batch/export.d.ts +92 -0
  57. package/dist/util/batch/fields.d.ts +22 -0
  58. package/dist/util/batch/parseCSV.d.ts +72 -0
  59. package/dist/util/batch/useBatchRows.d.ts +67 -0
  60. package/dist/util/cloneDeep.d.ts +5 -5
  61. package/dist/util/cloudflareImages.d.ts +8 -1
  62. package/dist/util/contextCapture.d.ts +19 -0
  63. package/dist/util/export.d.ts +65 -18
  64. package/dist/util/fieldHints/chipAction.d.ts +23 -0
  65. package/dist/util/fieldHints/fieldFocus.d.ts +81 -0
  66. package/dist/util/fieldHints/geometry.d.ts +52 -0
  67. package/dist/util/fieldHints/index.d.ts +20 -0
  68. package/dist/util/fieldHints/probe.d.ts +84 -0
  69. package/dist/util/fieldHints/resolve.d.ts +55 -0
  70. package/dist/util/fieldHints/textProbe.d.ts +71 -0
  71. package/dist/util/fieldHints/useCanvasTextEditing.d.ts +125 -0
  72. package/dist/util/fieldHints/useChipHighlight.d.ts +29 -0
  73. package/dist/util/fieldHints/useFieldHitboxes.d.ts +5601 -0
  74. package/dist/util/fieldHints/useHintReveal.d.ts +10 -0
  75. package/dist/util/fieldTree.d.ts +20 -0
  76. package/dist/util/fields.d.ts +1 -1
  77. package/dist/util/gallery.d.ts +78 -30
  78. package/dist/util/popoverArrow.d.ts +33 -0
  79. package/dist/util/popupHeaderTools.d.ts +26 -0
  80. package/dist/util/scrollPassthrough.d.ts +9 -0
  81. package/dist/util/useTheme.d.ts +36 -1
  82. package/dist/util/visualViewport.d.ts +47 -0
  83. package/dist/xlsx-BopDBbWb.js +24176 -0
  84. package/dist/xlsx-qn1xoUuv.cjs +105 -0
  85. package/package.json +18 -5
  86. package/dist/index-DFXQWOGQ.cjs +0 -1
  87. package/dist/util/backgroundRemoval.d.ts +0 -51
package/dist/theme.mjs ADDED
@@ -0,0 +1,1313 @@
1
+ const dr = [
2
+ /* mode */
3
+ "color-scheme",
4
+ // 'dark' | 'light' — feeds the CSS `color-scheme` property
5
+ /* surfaces (elevation ladder; each step is guaranteed to be distinguishable from the previous) */
6
+ "surface",
7
+ // page / editor background (the user's "background" choice)
8
+ "surface-rgb",
9
+ "surface-1",
10
+ // cards, gallery cards, popups
11
+ "surface-1-rgb",
12
+ "surface-2",
13
+ // popovers, menus, dropdowns, tooltips' neighbours
14
+ "surface-2-rgb",
15
+ "surface-3",
16
+ // nested/raised elements inside popovers
17
+ "surface-inverse",
18
+ // tooltips, toasts
19
+ "scrim",
20
+ // modal backdrop
21
+ /* ink = the text colour family; alpha-based so it works on every surface step */
22
+ "ink",
23
+ // solid ink colour (white in dark, near-black in light)
24
+ "ink-rgb",
25
+ "text",
26
+ // primary text
27
+ "text-muted",
28
+ // labels, descriptions
29
+ "text-faint",
30
+ // placeholders, disabled
31
+ "text-inverse",
32
+ // text on surface-inverse
33
+ "text-on-surface-rgb",
34
+ // legacy `--text-color-base` triplet (= ink-rgb)
35
+ "text-on-inverse-rgb",
36
+ // legacy `--text-color-alt` triplet
37
+ /* borders & dividers */
38
+ "border",
39
+ // subtle component borders
40
+ "border-strong",
41
+ // outlined buttons, bordered inputs
42
+ "divider",
43
+ "border-rgb",
44
+ // legacy `--border-color-base` triplet
45
+ /* neutral interaction fills (buttons, list hover, inputs) */
46
+ "fill",
47
+ // tonal neutral fill (secondary button, tag, segment)
48
+ "fill-hover",
49
+ "fill-active",
50
+ "field",
51
+ // input / select background
52
+ "field-hover",
53
+ "field-focus",
54
+ "hover",
55
+ // transparent→tint hover for ghost elements / list rows
56
+ "pressed",
57
+ /* primary / brand */
58
+ "primary",
59
+ "primary-rgb",
60
+ "primary-hover",
61
+ "primary-active",
62
+ "on-primary",
63
+ // text/icon on solid primary — auto black/white
64
+ "primary-text",
65
+ // primary used AS text on `surface` (contrast-corrected)
66
+ "primary-border",
67
+ // primary used as a 1px border/indicator on `surface` (≥ 3:1)
68
+ "primary-soft",
69
+ // tinted background (selected menu item, active tab, soft button)
70
+ "primary-soft-hover",
71
+ "focus-ring",
72
+ "focus-ring-width",
73
+ "focus-ring-offset",
74
+ // derived shades (kept for the component tier's `rgba(var(--primary-color-light), a)` habit)
75
+ "primary-dark",
76
+ "primary-dark-rgb",
77
+ "primary-light",
78
+ "primary-light-rgb",
79
+ "primary-bright",
80
+ "primary-bright-rgb",
81
+ /* status — each: base (solid), on (text on solid), text (as text on surface), soft (tint bg), border, + shades */
82
+ "success",
83
+ "success-rgb",
84
+ "on-success",
85
+ "success-text",
86
+ "success-soft",
87
+ "success-border",
88
+ "success-dark-rgb",
89
+ "success-light-rgb",
90
+ "success-darker-rgb",
91
+ "warning",
92
+ "warning-rgb",
93
+ "on-warning",
94
+ "warning-text",
95
+ "warning-soft",
96
+ "warning-border",
97
+ "warning-dark-rgb",
98
+ "warning-light-rgb",
99
+ "warning-darker-rgb",
100
+ "error",
101
+ "error-rgb",
102
+ "on-error",
103
+ "error-text",
104
+ "error-soft",
105
+ "error-border",
106
+ "error-dark-rgb",
107
+ "error-light-rgb",
108
+ "error-darker-rgb",
109
+ "info",
110
+ "info-rgb",
111
+ "on-info",
112
+ "info-text",
113
+ "info-soft",
114
+ "info-border",
115
+ "info-dark-rgb",
116
+ "info-light-rgb",
117
+ "info-bright-rgb",
118
+ /* elevation shadows */
119
+ "shadow-1",
120
+ "shadow-2",
121
+ "shadow-3",
122
+ /* shape & typography */
123
+ "radius-sm",
124
+ "radius-md",
125
+ "radius-lg",
126
+ "radius-full",
127
+ "font-family",
128
+ // UI font (controls)
129
+ "font-family-heading",
130
+ // heading / content font ("real text")
131
+ "font-size",
132
+ // e.g. 14px
133
+ "root-font-size",
134
+ // legacy unitless number (14)
135
+ /* canvas (the template preview area) */
136
+ "canvas",
137
+ "canvas-image",
138
+ "canvas-control",
139
+ "canvas-control-hover",
140
+ "on-canvas-control",
141
+ /* disabled */
142
+ "disabled-opacity"
143
+ ], br = "--bx-", Lo = [
144
+ { label: "Surfaces", tokens: ["surface", "surface-1", "surface-2", "surface-3", "surface-inverse", "scrim"] },
145
+ { label: "Text", tokens: ["text", "text-muted", "text-faint", "text-inverse"] },
146
+ { label: "Borders", tokens: ["border", "border-strong", "divider"] },
147
+ { label: "Neutral fills", tokens: ["fill", "fill-hover", "fill-active", "field", "field-hover", "field-focus", "hover", "pressed"] },
148
+ { label: "Primary", tokens: ["primary", "primary-hover", "primary-active", "on-primary", "primary-text", "primary-border", "primary-soft", "primary-soft-hover", "focus-ring"] },
149
+ { label: "Success", tokens: ["success", "on-success", "success-text", "success-soft", "success-border"] },
150
+ { label: "Warning", tokens: ["warning", "on-warning", "warning-text", "warning-soft", "warning-border"] },
151
+ { label: "Error", tokens: ["error", "on-error", "error-text", "error-soft", "error-border"] },
152
+ { label: "Info", tokens: ["info", "on-info", "info-text", "info-soft", "info-border"] },
153
+ { label: "Shape & type", tokens: ["radius-sm", "radius-md", "radius-lg", "radius-full", "font-family", "font-family-heading", "font-size"] },
154
+ { label: "Canvas", tokens: ["canvas", "canvas-control", "on-canvas-control"] }
155
+ ], io = {
156
+ // Same surfaces as the historical presets so existing campaigns keep their background.
157
+ dark: { surface: "#27262e", primary: "#4472c7" },
158
+ light: { surface: "#f2f2f2", primary: "#124bba" }
159
+ }, Ho = [
160
+ { key: "light", label: "Light", description: "Neutral light surfaces, Bluepic blue.", input: { version: 2, preset: "light" } },
161
+ { key: "dark", label: "Dark", description: "Neutral dark surfaces, Bluepic blue.", input: { version: 2, preset: "dark" } },
162
+ { key: "midnight", label: "Midnight", description: "Near-black with cool, slightly tinted surfaces.", input: { version: 2, surface: "#0f1117", primary: "#7da8f7", tint: 0.35 } },
163
+ { key: "paper", label: "Paper", description: "Warm off-white, ink-black actions, crisp corners.", input: { version: 2, surface: "#fbf8f1", primary: "#1f1f1f", radius: "sm" } },
164
+ { key: "slate", label: "Slate", description: "Blue-grey dark surfaces with a teal accent.", input: { version: 2, surface: "#1e2530", primary: "#4fd1c5", tint: 0.4 } },
165
+ { key: "sand", label: "Sand", description: "Soft sand surfaces with a terracotta accent, rounded.", input: { version: 2, surface: "#f3ede3", primary: "#b5562c", radius: "lg" } },
166
+ { key: "forest", label: "Forest", description: "Deep green surfaces with a mint accent.", input: { version: 2, surface: "#0e1f17", primary: "#7ad39a", tint: 0.5 } },
167
+ { key: "ocean", label: "Ocean", description: "Cool light surfaces with a deep blue accent, pill shapes.", input: { version: 2, surface: "#eef4fb", primary: "#0b5cad", tint: 0.3, radius: "full" } },
168
+ { key: "graphite", label: "Graphite", description: "Pure black, high contrast, sharp corners — signage and dark brands.", input: { version: 2, surface: "#000000", primary: "#ffffff", radius: "none", contrast: "high" } },
169
+ { key: "plum", label: "Plum", description: "Deep aubergine surfaces with a warm coral accent.", input: { version: 2, surface: "#1f1423", primary: "#ff7a59", tint: 0.45, radius: "lg" } },
170
+ { key: "linen", label: "Linen", description: "Soft white linen with a muted navy accent, rounded.", input: { version: 2, surface: "#f7f7f4", primary: "#2f3e5c", tint: 0.15, radius: "lg" } }
171
+ ], lo = {
172
+ success: "#28a552",
173
+ warning: "#d9a400",
174
+ error: "#dc2f2f",
175
+ info: "#3b82f6"
176
+ }, I = Object.freeze({ r: 255, g: 255, b: 255, a: 1 }), Z = Object.freeze({ r: 0, g: 0, b: 0, a: 1 }), Pr = [I, Object.freeze({ r: 17, g: 17, b: 17, a: 1 })], pr = (o, e, t) => o < e ? e : o > t ? t : o, w = (o) => pr(o, 0, 1), y = (o, e = 0) => Number.isFinite(o) ? o : e, k = (o, e, t, a = 1) => ({ r: o, g: e, b: t, a }), B = (o) => Math.round(pr(y(o), 0, 255)), ur = (o) => B(o).toString(16).padStart(2, "0"), uo = {
177
+ aliceblue: 15792383,
178
+ antiquewhite: 16444375,
179
+ aqua: 65535,
180
+ aquamarine: 8388564,
181
+ azure: 15794175,
182
+ beige: 16119260,
183
+ bisque: 16770244,
184
+ black: 0,
185
+ blanchedalmond: 16772045,
186
+ blue: 255,
187
+ blueviolet: 9055202,
188
+ brown: 10824234,
189
+ burlywood: 14596231,
190
+ cadetblue: 6266528,
191
+ chartreuse: 8388352,
192
+ chocolate: 13789470,
193
+ coral: 16744272,
194
+ cornflowerblue: 6591981,
195
+ cornsilk: 16775388,
196
+ crimson: 14423100,
197
+ cyan: 65535,
198
+ darkblue: 139,
199
+ darkcyan: 35723,
200
+ darkgoldenrod: 12092939,
201
+ darkgray: 11119017,
202
+ darkgreen: 25600,
203
+ darkgrey: 11119017,
204
+ darkkhaki: 12433259,
205
+ darkmagenta: 9109643,
206
+ darkolivegreen: 5597999,
207
+ darkorange: 16747520,
208
+ darkorchid: 10040012,
209
+ darkred: 9109504,
210
+ darksalmon: 15308410,
211
+ darkseagreen: 9419919,
212
+ darkslateblue: 4734347,
213
+ darkslategray: 3100495,
214
+ darkslategrey: 3100495,
215
+ darkturquoise: 52945,
216
+ darkviolet: 9699539,
217
+ deeppink: 16716947,
218
+ deepskyblue: 49151,
219
+ dimgray: 6908265,
220
+ dimgrey: 6908265,
221
+ dodgerblue: 2003199,
222
+ firebrick: 11674146,
223
+ floralwhite: 16775920,
224
+ forestgreen: 2263842,
225
+ fuchsia: 16711935,
226
+ gainsboro: 14474460,
227
+ ghostwhite: 16316671,
228
+ gold: 16766720,
229
+ goldenrod: 14329120,
230
+ gray: 8421504,
231
+ green: 32768,
232
+ greenyellow: 11403055,
233
+ grey: 8421504,
234
+ honeydew: 15794160,
235
+ hotpink: 16738740,
236
+ indianred: 13458524,
237
+ indigo: 4915330,
238
+ ivory: 16777200,
239
+ khaki: 15787660,
240
+ lavender: 15132410,
241
+ lavenderblush: 16773365,
242
+ lawngreen: 8190976,
243
+ lemonchiffon: 16775885,
244
+ lightblue: 11393254,
245
+ lightcoral: 15761536,
246
+ lightcyan: 14745599,
247
+ lightgoldenrodyellow: 16448210,
248
+ lightgray: 13882323,
249
+ lightgreen: 9498256,
250
+ lightgrey: 13882323,
251
+ lightpink: 16758465,
252
+ lightsalmon: 16752762,
253
+ lightseagreen: 2142890,
254
+ lightskyblue: 8900346,
255
+ lightslategray: 7833753,
256
+ lightslategrey: 7833753,
257
+ lightsteelblue: 11584734,
258
+ lightyellow: 16777184,
259
+ lime: 65280,
260
+ limegreen: 3329330,
261
+ linen: 16445670,
262
+ magenta: 16711935,
263
+ maroon: 8388608,
264
+ mediumaquamarine: 6737322,
265
+ mediumblue: 205,
266
+ mediumorchid: 12211667,
267
+ mediumpurple: 9662683,
268
+ mediumseagreen: 3978097,
269
+ mediumslateblue: 8087790,
270
+ mediumspringgreen: 64154,
271
+ mediumturquoise: 4772300,
272
+ mediumvioletred: 13047173,
273
+ midnightblue: 1644912,
274
+ mintcream: 16121850,
275
+ mistyrose: 16770273,
276
+ moccasin: 16770229,
277
+ navajowhite: 16768685,
278
+ navy: 128,
279
+ oldlace: 16643558,
280
+ olive: 8421376,
281
+ olivedrab: 7048739,
282
+ orange: 16753920,
283
+ orangered: 16729344,
284
+ orchid: 14315734,
285
+ palegoldenrod: 15657130,
286
+ palegreen: 10025880,
287
+ paleturquoise: 11529966,
288
+ palevioletred: 14381203,
289
+ papayawhip: 16773077,
290
+ peachpuff: 16767673,
291
+ peru: 13468991,
292
+ pink: 16761035,
293
+ plum: 14524637,
294
+ powderblue: 11591910,
295
+ purple: 8388736,
296
+ rebeccapurple: 6697881,
297
+ red: 16711680,
298
+ rosybrown: 12357519,
299
+ royalblue: 4286945,
300
+ saddlebrown: 9127187,
301
+ salmon: 16416882,
302
+ sandybrown: 16032864,
303
+ seagreen: 3050327,
304
+ seashell: 16774638,
305
+ sienna: 10506797,
306
+ silver: 12632256,
307
+ skyblue: 8900331,
308
+ slateblue: 6970061,
309
+ slategray: 7372944,
310
+ slategrey: 7372944,
311
+ snow: 16775930,
312
+ springgreen: 65407,
313
+ steelblue: 4620980,
314
+ tan: 13808780,
315
+ teal: 32896,
316
+ thistle: 14204888,
317
+ tomato: 16737095,
318
+ turquoise: 4251856,
319
+ violet: 15631086,
320
+ wheat: 16113331,
321
+ white: 16777215,
322
+ whitesmoke: 16119285,
323
+ yellow: 16776960,
324
+ yellowgreen: 10145074
325
+ }, Br = /^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/, bo = /^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(deg|turn|rad|grad)?$/, go = /^(rgba?|hsla?)\(\s*(.*?)\s*\)$/;
326
+ function xr(o) {
327
+ if (o === "none") return { value: 0, percent: !1 };
328
+ const e = o.endsWith("%"), t = e ? o.slice(0, -1) : o;
329
+ if (!Br.test(t)) return null;
330
+ const a = Number(t);
331
+ return Number.isFinite(a) ? { value: a, percent: e } : null;
332
+ }
333
+ function hr(o) {
334
+ const e = xr(o);
335
+ return e ? pr(e.percent ? e.value * 255 / 100 : e.value, 0, 255) : null;
336
+ }
337
+ function fo(o) {
338
+ const e = xr(o);
339
+ return e ? w(e.percent ? e.value / 100 : e.value) : null;
340
+ }
341
+ function jr(o) {
342
+ const e = xr(o);
343
+ return e ? w(e.value / 100) : null;
344
+ }
345
+ function po(o) {
346
+ if (o === "none") return 0;
347
+ const e = bo.exec(o);
348
+ if (!e) return null;
349
+ let t = Number(e[1]);
350
+ if (!Number.isFinite(t)) return null;
351
+ switch (e[2]) {
352
+ case "turn":
353
+ t *= 360;
354
+ break;
355
+ case "rad":
356
+ t *= 180 / Math.PI;
357
+ break;
358
+ case "grad":
359
+ t *= 0.9;
360
+ break;
361
+ }
362
+ return t %= 360, t < 0 && (t += 360), t;
363
+ }
364
+ function ho(o) {
365
+ if (o.includes(",")) {
366
+ if (o.includes("/")) return null;
367
+ const n = o.split(",").map((c) => c.trim());
368
+ return n.length !== 3 && n.length !== 4 || n.some((c) => c === "" || /\s/.test(c)) ? null : { ch: [n[0], n[1], n[2]], alpha: n[3] };
369
+ }
370
+ const e = o.split("/");
371
+ if (e.length > 2) return null;
372
+ const t = e[0].trim().split(/\s+/);
373
+ if (t.length !== 3) return null;
374
+ let a;
375
+ return e.length === 2 && (a = e[1].trim(), a === "" || /\s/.test(a)) ? null : { ch: [t[0], t[1], t[2]], alpha: a };
376
+ }
377
+ function mo(o, e, t) {
378
+ const a = (n) => {
379
+ const c = (n + o / 30) % 12, s = e * Math.min(t, 1 - t);
380
+ return t - s * Math.max(-1, Math.min(c - 3, 9 - c, 1));
381
+ };
382
+ return [a(0) * 255, a(8) * 255, a(4) * 255];
383
+ }
384
+ function _(o) {
385
+ if (typeof o != "string") return null;
386
+ const e = o.trim().toLowerCase();
387
+ if (!e) return null;
388
+ if (e === "transparent") return k(0, 0, 0, 0);
389
+ const t = uo[e];
390
+ if (t !== void 0) return k(t >> 16, t >> 8 & 255, t & 255, 1);
391
+ if (e[0] === "#") {
392
+ const n = e.slice(1);
393
+ if (!/^[0-9a-f]+$/.test(n)) return null;
394
+ const c = (i) => parseInt(n[i], 16), s = (i) => parseInt(n.slice(i, i + 2), 16);
395
+ switch (n.length) {
396
+ case 3:
397
+ return k(c(0) * 17, c(1) * 17, c(2) * 17, 1);
398
+ case 4:
399
+ return k(c(0) * 17, c(1) * 17, c(2) * 17, c(3) * 17 / 255);
400
+ case 6:
401
+ return k(s(0), s(2), s(4), 1);
402
+ case 8:
403
+ return k(s(0), s(2), s(4), s(6) / 255);
404
+ default:
405
+ return null;
406
+ }
407
+ }
408
+ const a = go.exec(e);
409
+ if (a) {
410
+ const n = ho(a[2]);
411
+ if (!n) return null;
412
+ const c = n.alpha === void 0 ? 1 : fo(n.alpha);
413
+ if (c === null) return null;
414
+ if (a[1] === "rgb" || a[1] === "rgba") {
415
+ const x = hr(n.ch[0]), P = hr(n.ch[1]), p = hr(n.ch[2]);
416
+ return x === null || P === null || p === null ? null : k(x, P, p, c);
417
+ }
418
+ const s = po(n.ch[0]), i = jr(n.ch[1]), d = jr(n.ch[2]);
419
+ if (s === null || i === null || d === null) return null;
420
+ const [g, C, b] = mo(s, i, d);
421
+ return k(g, C, b, c);
422
+ }
423
+ if (e.includes(",")) {
424
+ const n = e.split(",").map((d) => d.trim());
425
+ if (n.length !== 3 || !n.every((d) => Br.test(d))) return null;
426
+ const [c, s, i] = n.map((d) => pr(Number(d), 0, 255));
427
+ return k(c, s, i, 1);
428
+ }
429
+ return null;
430
+ }
431
+ function q(o) {
432
+ const e = w(o);
433
+ return e <= 0.04045 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4);
434
+ }
435
+ function mr(o) {
436
+ const e = w(o);
437
+ return e <= 31308e-7 ? e * 12.92 : 1.055 * Math.pow(e, 1 / 2.4) - 0.055;
438
+ }
439
+ function vo(o, e, t) {
440
+ const a = 0.4122214708 * o + 0.5363325363 * e + 0.0514459929 * t, n = 0.2119034982 * o + 0.6806995451 * e + 0.1073969566 * t, c = 0.0883024619 * o + 0.2817188376 * e + 0.6299787005 * t, s = Math.cbrt(a), i = Math.cbrt(n), d = Math.cbrt(c);
441
+ return {
442
+ L: 0.2104542553 * s + 0.793617785 * i - 0.0040720468 * d,
443
+ a: 1.9779984951 * s - 2.428592205 * i + 0.4505937099 * d,
444
+ b: 0.0259040371 * s + 0.7827717662 * i - 0.808675766 * d
445
+ };
446
+ }
447
+ function vr(o, e, t) {
448
+ const a = o + 0.3963377774 * e + 0.2158037573 * t, n = o - 0.1055613458 * e - 0.0638541728 * t, c = o - 0.0894841775 * e - 1.291485548 * t, s = a * a * a, i = n * n * n, d = c * c * c;
449
+ return [
450
+ 4.0767416621 * s - 3.3077115913 * i + 0.2309699292 * d,
451
+ -1.2684380046 * s + 2.6097574011 * i - 0.3413193965 * d,
452
+ -0.0041960863 * s - 0.7034186147 * i + 1.707614701 * d
453
+ ];
454
+ }
455
+ function gr(o) {
456
+ return vo(q(o.r / 255), q(o.g / 255), q(o.b / 255));
457
+ }
458
+ const yo = 1e-6;
459
+ function Fr(o) {
460
+ const e = Math.hypot(o.a, o.b);
461
+ let t = e < yo ? 0 : Math.atan2(o.b, o.a) * 180 / Math.PI;
462
+ return t < 0 && (t += 360), t >= 360 && (t -= 360), { l: o.L, c: e, h: t };
463
+ }
464
+ function yr(o, e, t) {
465
+ const a = t * Math.PI / 180;
466
+ return { L: o, a: e * Math.cos(a), b: e * Math.sin(a) };
467
+ }
468
+ const z = 1e-6, Rr = (o) => o[0] >= -z && o[0] <= 1 + z && o[1] >= -z && o[1] <= 1 + z && o[2] >= -z && o[2] <= 1 + z;
469
+ function nr(o, e, t, a) {
470
+ const n = w(y(o));
471
+ let c = Math.max(0, y(e));
472
+ const s = y(t);
473
+ let i = yr(n, c, s), d = vr(i.L, i.a, i.b);
474
+ if (!Rr(d)) {
475
+ let g = 0, C = c;
476
+ for (let b = 0; b < 24; b++) {
477
+ const x = (g + C) / 2, P = yr(n, x, s);
478
+ Rr(vr(P.L, P.a, P.b)) ? g = x : C = x;
479
+ }
480
+ c = g, i = yr(n, c, s), d = vr(i.L, i.a, i.b);
481
+ }
482
+ return k(mr(d[0]) * 255, mr(d[1]) * 255, mr(d[2]) * 255, w(y(a, 1)));
483
+ }
484
+ function J(o) {
485
+ const e = Fr(gr(o));
486
+ return { l: e.l, c: e.c, h: e.h, a: w(y(o.a, 1)) };
487
+ }
488
+ function fr(o) {
489
+ return nr(o.l, o.c, o.h, o.a);
490
+ }
491
+ function xo(o) {
492
+ const e = w(y(o.a, 1)), t = `#${ur(o.r)}${ur(o.g)}${ur(o.b)}`;
493
+ return e < 1 ? `${t}${ur(e * 255)}` : t;
494
+ }
495
+ function kr(o) {
496
+ const e = w(y(o.a, 1)), t = B(o.r), a = B(o.g), n = B(o.b);
497
+ return e >= 1 ? `rgb(${t}, ${a}, ${n})` : `rgba(${t}, ${a}, ${n}, ${Number(e.toFixed(3))})`;
498
+ }
499
+ function Wr(o) {
500
+ return `${B(o.r)}, ${B(o.g)}, ${B(o.b)}`;
501
+ }
502
+ function or(o) {
503
+ return 0.2126 * q(y(o.r) / 255) + 0.7152 * q(y(o.g) / 255) + 0.0722 * q(y(o.b) / 255);
504
+ }
505
+ function m(o, e) {
506
+ const t = e.a >= 1 ? e : k(e.r, e.g, e.b, 1), a = o.a < 1 ? er(o, t) : o, n = or(a), c = or(t), s = Math.max(n, c), i = Math.min(n, c);
507
+ return (s + 0.05) / (i + 0.05);
508
+ }
509
+ function er(o, e) {
510
+ const t = w(y(o.a, 1)), a = w(y(e.a, 1)), n = t + a * (1 - t);
511
+ if (n <= 0) return k(0, 0, 0, 0);
512
+ const c = a * (1 - t) / n, s = t / n;
513
+ return k(o.r * s + e.r * c, o.g * s + e.g * c, o.b * s + e.b * c, n);
514
+ }
515
+ function tr(o, e, t) {
516
+ const a = w(y(t));
517
+ if (a <= 0) return k(o.r, o.g, o.b, w(y(o.a, 1)));
518
+ if (a >= 1) return k(e.r, e.g, e.b, w(y(e.a, 1)));
519
+ const n = w(y(o.a, 1)), c = w(y(e.a, 1)), s = gr(o), i = gr(e), d = n + (c - n) * a, g = d > 0 ? n * (1 - a) / d : 1 - a, C = d > 0 ? c * a / d : a, b = { L: s.L * g + i.L * C, a: s.a * g + i.a * C, b: s.b * g + i.b * C }, x = Fr(b);
520
+ return nr(x.l, x.c, x.h, d);
521
+ }
522
+ function D(o, e) {
523
+ return k(o.r, o.g, o.b, w(y(e, 1)));
524
+ }
525
+ function ko(o) {
526
+ return gr(o).L;
527
+ }
528
+ function E(o, e) {
529
+ const t = J(o);
530
+ return nr(w(t.l + y(e)), t.c, t.h, t.a);
531
+ }
532
+ function wo(o, e) {
533
+ const t = J(o);
534
+ return nr(w(y(e)), t.c, t.h, t.a);
535
+ }
536
+ const Io = [1, 0.75, 0.5, 0.25, 0], Mo = 24;
537
+ function R(o, e, t, a = "auto") {
538
+ const n = y(t, 1);
539
+ if (m(o, e) >= n) return o;
540
+ const c = J(o), s = k(e.r, e.g, e.b, 1), i = or(s), d = (f, A) => nr(f, A, c.h, c.a), g = (f) => m(f, s), C = (f) => or(f.a < 1 ? er(f, s) : f), b = (f) => k(Math.round(f.r), Math.round(f.g), Math.round(f.b), f.a), x = (f) => {
541
+ const A = f === "lighter" ? 1 : 0, j = (L) => f === "lighter" ? C(L) >= i : C(L) <= i, H = (L) => j(L) && g(L) >= n, Y = (L) => H(L) && H(b(L));
542
+ let U = null;
543
+ for (const L of Io) {
544
+ const O = c.c * L, K = d(A, O), ar = g(K);
545
+ if ((!U || ar > U.ratio) && (U = { color: K, ratio: ar }), !Y(K)) continue;
546
+ let cr = c.l, V = A;
547
+ for (let ir = 0; ir < Mo; ir++) {
548
+ const F = (cr + V) / 2;
549
+ Y(d(F, O)) ? V = F : cr = F;
550
+ }
551
+ const sr = d(V, O);
552
+ return { color: sr, ratio: g(sr) };
553
+ }
554
+ return U;
555
+ };
556
+ if (a === "lighter" || a === "darker") return x(a).color;
557
+ const P = g(d(1, 0)), p = g(d(0, 0));
558
+ return x(P >= p ? "lighter" : "darker").color;
559
+ }
560
+ function zr(o) {
561
+ return m(I, o) >= m(Z, o);
562
+ }
563
+ function Gr(o, e = Pr) {
564
+ const t = e.length ? e : Pr;
565
+ let a = t[0], n = -1;
566
+ for (const c of t) {
567
+ const s = m(c, o);
568
+ s > n && (n = s, a = c);
569
+ }
570
+ return k(a.r, a.g, a.b, a.a);
571
+ }
572
+ const _o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
573
+ __proto__: null,
574
+ BLACK: Z,
575
+ WHITE: I,
576
+ adjustL: E,
577
+ bestOn: Gr,
578
+ composite: er,
579
+ contrastRatio: m,
580
+ ensureContrast: R,
581
+ formatHex: xo,
582
+ formatRgb: kr,
583
+ formatTriplet: Wr,
584
+ fromOklch: fr,
585
+ isDarkSurface: zr,
586
+ lightness: ko,
587
+ mix: tr,
588
+ parseColor: _,
589
+ relativeLuminance: or,
590
+ setL: wo,
591
+ toOklch: J,
592
+ withAlpha: D
593
+ }, Symbol.toStringTag, { value: "Module" })), So = {
594
+ none: ["0px", "0px", "0px", "0px"],
595
+ sm: ["3px", "4px", "6px", "9999px"],
596
+ md: ["4px", "6px", "10px", "9999px"],
597
+ lg: ["6px", "10px", "16px", "9999px"],
598
+ full: ["10px", "16px", "24px", "9999px"]
599
+ }, $o = "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHg9IjAlIiB5PSIwJSIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiIHN0eWxlPSJmaWxsOiByZ2JhKDI1NSwgMjU1LCAyNTUsIDAuMDcpOyIgLz4KICA8cmVjdCB4PSI1MCUiIHk9IjAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSIgc3R5bGU9ImZpbGw6IHJnYmEoMjU1LCAyNTUsIDI1NSwgMCk7IiAvPgogIDxyZWN0IHg9IjUwJSIgeT0iNTAlIiB3aWR0aD0iNTAlIiBoZWlnaHQ9IjUwJSIgc3R5bGU9ImZpbGw6IHJnYmEoMjU1LCAyNTUsIDI1NSwgMC4wNyk7IiAvPgogIDxyZWN0IHg9IjAlIiB5PSI1MCUiIHdpZHRoPSI1MCUiIGhlaWdodD0iNTAlIiBzdHlsZT0iZmlsbDogcmdiYSgyNTUsIDI1NSwgMjU1LCAwKTsiIC8+Cjwvc3ZnPg==')", Ao = "url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHg9IjAlIiB5PSIwJSIgd2lkdGg9IjUwJSIgaGVpZ2h0PSI1MCUiIHN0eWxlPSJmaWxsOiByZ2JhKDAsIDAsIDAsIDAuMDQ1KTsiIC8+CiAgPHJlY3QgeD0iNTAlIiB5PSI1MCUiIHdpZHRoPSI1MCUiIGhlaWdodD0iNTAlIiBzdHlsZT0iZmlsbDogcmdiYSgwLCAwLCAwLCAwLjA0NSk7IiAvPgo8L3N2Zz4=')";
600
+ function To(o, e) {
601
+ const t = o === "dark", a = e ? 0.06 : 0;
602
+ return {
603
+ text: e ? 1 : t ? 0.92 : 0.88,
604
+ textMuted: e ? 0.85 : t ? 0.66 : 0.62,
605
+ textFaint: e ? 0.68 : t ? 0.46 : 0.42,
606
+ border: (t ? 0.12 : 0.1) + (e ? 0.18 : 0),
607
+ borderStrong: (t ? 0.28 : 0.22) + (e ? 0.25 : 0),
608
+ divider: (t ? 0.1 : 0.08) + (e ? 0.15 : 0),
609
+ fill: (t ? 0.09 : 0.06) + a,
610
+ fillHover: (t ? 0.14 : 0.1) + a,
611
+ fillActive: (t ? 0.2 : 0.15) + a,
612
+ field: (t ? 0.07 : 0.04) + a,
613
+ fieldHover: (t ? 0.1 : 0.06) + a,
614
+ fieldFocus: (t ? 0.1 : 0.05) + a,
615
+ hover: (t ? 0.07 : 0.05) + a,
616
+ pressed: (t ? 0.12 : 0.09) + a,
617
+ soft: (t ? 0.18 : 0.12) + (e ? 0.08 : 0),
618
+ softHover: (t ? 0.26 : 0.2) + (e ? 0.08 : 0),
619
+ elevationMin: e ? 1.3 : t ? 1.18 : 1.06
620
+ };
621
+ }
622
+ const v = (o) => kr(o), M = (o) => Wr(o), $ = (o, e) => kr(D(o, e)), Ur = (o) => ({ r: Math.round(o.r), g: Math.round(o.g), b: Math.round(o.b), a: o.a });
623
+ function G(o, e, t, a, n = (c) => c) {
624
+ let c = t, s = Ur(n(tr(o, e, c))), i = 0;
625
+ for (; m(s, o) < a && c < 1 && i++ < 40; )
626
+ c = Math.min(1, c + 0.02), s = Ur(n(tr(o, e, c)));
627
+ return D(s, 1);
628
+ }
629
+ function Or(o, e, t) {
630
+ if (t <= 0) return o;
631
+ const a = J(o), n = J(e);
632
+ return fr({ l: a.l, c: Math.min(0.03, 0.03 * t) + a.c * (1 - t), h: n.h, a: a.a });
633
+ }
634
+ function Do(o) {
635
+ var Tr, Nr, Cr, Er, Lr, Hr, _r;
636
+ const e = { version: 2, ...o ?? {} }, t = io[e.preset ?? "dark"], a = [];
637
+ let n = _(e.surface) ?? null;
638
+ n || (e.surface && a.push({ token: "surface", reason: `unparsable surface "${e.surface}", using preset` }), n = _(t.surface)), n = D(n, 1);
639
+ let c = _(e.primary) ?? null;
640
+ c || (e.primary && a.push({ token: "primary", reason: `unparsable primary "${e.primary}", using preset` }), c = _(t.primary)), c = D(c, 1);
641
+ const s = zr(n) ? "dark" : "light", i = s === "dark", d = e.contrast === "high", g = To(s, d), C = Math.max(0, Math.min(1, e.tint ?? 0)), b = d ? 7 : 4.5, x = d ? 4.5 : 3, p = Or(i ? I : { r: 17, g: 17, b: 17, a: 1 }, c, C);
642
+ let f, A, j;
643
+ const H = (l) => Or(l, c, C);
644
+ if (i) {
645
+ const l = m(I, n) >= 6 ? I : Z;
646
+ f = G(n, l, 0.07, g.elevationMin, H), A = G(f, l, 0.05, 1.12, H), j = G(A, l, 0.05, 1.12, H);
647
+ } else {
648
+ const l = m(I, n);
649
+ if (l >= g.elevationMin * 1.01) {
650
+ const u = l >= 1.149995 ? 1.1 : g.elevationMin;
651
+ f = G(n, I, 0.5, u, H), A = m(I, f) >= 1.03 ? G(f, I, 0.6, 1.03, H) : D(I, 1), j = H(tr(A, Z, 0.035));
652
+ }
653
+ (!f || m(f, n) < g.elevationMin) && (f = G(n, Z, 0.03, g.elevationMin, H), A = D(I, 1), j = H(tr(A, Z, 0.05)));
654
+ }
655
+ if (!f || !A || !j) throw new Error("theme: elevation ladder not resolved");
656
+ const Y = fr(i ? { l: 0.94, c: 0, h: 0, a: 1 } : { l: 0.28, c: 0, h: 0, a: 1 }), U = Gr(Y), L = (l) => [n, f, A, j].reduce((u, N) => m(l, N) < m(l, u) ? N : u, n), O = (l, u, N) => {
657
+ let S = l, W = 0;
658
+ for (; m(D(p, S), L(D(p, S))) < u && S < 1 && W++ < 25; ) S = Math.min(1, S + 0.04);
659
+ return S !== l && a.push({ token: N, reason: `raised opacity ${l}→${S.toFixed(2)} to reach ${u}:1 on surfaces` }), S;
660
+ }, K = O(g.text, b, "text"), ar = O(g.textMuted, b, "text-muted"), cr = O(g.textFaint, x, "text-faint"), V = (() => {
661
+ const l = m(I, c), u = m({ r: 17, g: 17, b: 17, a: 1 }, c);
662
+ if (l >= b) return I;
663
+ const N = u > l ? { r: 17, g: 17, b: 17, a: 1 } : I;
664
+ return Math.max(l, u) < b && a.push({ token: "on-primary", reason: `neither white nor black reaches ${b}:1 on primary (best ${Math.max(l, u).toFixed(2)}:1)` }), N;
665
+ })(), sr = E(c, i ? 0.06 : -0.06), ir = E(c, i ? 0.1 : -0.1), F = R(c, n, b, "auto");
666
+ m(F, n) > m(c, n) + 0.01 && a.push({ token: "primary-text", reason: `primary lightened/darkened to reach ${b}:1 as text on surface` });
667
+ const qr = R(c, n, x, "auto"), Jr = R(c, n, x, "auto"), lr = (l) => {
668
+ const u = _(lo[l]), N = m(I, u), S = m({ r: 17, g: 17, b: 17, a: 1 }, u), W = N >= b ? I : S > N ? { r: 17, g: 17, b: 17, a: 1 } : I, Q = D(u, g.soft), X = er(Q, n), Dr = (rr) => R(R(u, n, b, rr), X, b, rr), co = R(u, n, b, "auto"), so = [Dr("darker"), Dr("lighter")].find(
669
+ (rr) => m(rr, n) >= b && m(rr, X) >= b
670
+ );
671
+ return {
672
+ base: u,
673
+ on: W,
674
+ text: so ?? co,
675
+ soft: Q,
676
+ border: R(u, n, x, "auto"),
677
+ dark: E(u, -0.1),
678
+ light: E(u, 0.12),
679
+ darker: E(u, -0.18),
680
+ bright: E(u, 0.22)
681
+ };
682
+ }, Yr = lr("success"), Kr = lr("warning"), Vr = lr("error"), Qr = lr("info"), [Xr, ro, oo, eo] = So[e.radius ?? "md"], wr = "'Inter', sans-serif", Ir = (l) => {
683
+ var u;
684
+ return (u = l == null ? void 0 : l.name) != null && u.trim() ? `'${l.name.trim().replace(/'/g, "\\'")}', ${wr}` : wr;
685
+ }, Mr = Ir((Tr = e.fonts) == null ? void 0 : Tr.ui), to = (Nr = e.fonts) != null && Nr.heading ? Ir(e.fonts.heading) : Mr, no = Array.from(new Set([(Er = (Cr = e.fonts) == null ? void 0 : Cr.ui) == null ? void 0 : Er.src, (Hr = (Lr = e.fonts) == null ? void 0 : Lr.heading) == null ? void 0 : Hr.src].filter((l) => !!l && /^https?:\/\//.test(l)))), Sr = (_r = e.font) != null && _r.size && e.font.size > 0 ? e.font.size : 14, T = {
686
+ "color-scheme": s,
687
+ surface: v(n),
688
+ "surface-rgb": M(n),
689
+ "surface-1": v(f),
690
+ "surface-1-rgb": M(f),
691
+ "surface-2": v(A),
692
+ "surface-2-rgb": M(A),
693
+ "surface-3": v(j),
694
+ "surface-inverse": v(Y),
695
+ scrim: "rgba(0, 0, 0, 0.5)",
696
+ ink: v(p),
697
+ "ink-rgb": M(p),
698
+ text: $(p, K),
699
+ "text-muted": $(p, ar),
700
+ "text-faint": $(p, cr),
701
+ "text-inverse": v(U),
702
+ "text-on-surface-rgb": M(p),
703
+ "text-on-inverse-rgb": M(U),
704
+ border: $(p, g.border),
705
+ "border-strong": $(p, g.borderStrong),
706
+ divider: $(p, g.divider),
707
+ "border-rgb": M(p),
708
+ fill: $(p, g.fill),
709
+ "fill-hover": $(p, g.fillHover),
710
+ "fill-active": $(p, g.fillActive),
711
+ field: $(p, g.field),
712
+ "field-hover": $(p, g.fieldHover),
713
+ "field-focus": $(p, g.fieldFocus),
714
+ hover: $(p, g.hover),
715
+ pressed: $(p, g.pressed),
716
+ primary: v(c),
717
+ "primary-rgb": M(c),
718
+ "primary-hover": v(sr),
719
+ "primary-active": v(ir),
720
+ "on-primary": v(V),
721
+ "primary-text": v(F),
722
+ "primary-border": v(qr),
723
+ "primary-soft": $(c, g.soft),
724
+ "primary-soft-hover": $(c, g.softHover),
725
+ "focus-ring": v(Jr),
726
+ "focus-ring-width": d ? "3px" : "2px",
727
+ "focus-ring-offset": "2px",
728
+ "primary-dark": v(E(c, -0.1)),
729
+ "primary-dark-rgb": M(E(c, -0.1)),
730
+ "primary-light": v(E(c, 0.1)),
731
+ "primary-light-rgb": M(E(c, 0.1)),
732
+ "primary-bright": v(E(c, 0.2)),
733
+ "primary-bright-rgb": M(E(c, 0.2)),
734
+ "shadow-1": i ? "0 1px 2px rgba(0, 0, 0, 0.4)" : "0 1px 2px rgba(0, 0, 0, 0.08)",
735
+ "shadow-2": i ? "0 6px 20px rgba(0, 0, 0, 0.45)" : "0 6px 20px rgba(0, 0, 0, 0.12)",
736
+ "shadow-3": i ? "0 12px 40px rgba(0, 0, 0, 0.5)" : "0 12px 40px rgba(0, 0, 0, 0.16)",
737
+ "radius-sm": Xr,
738
+ "radius-md": ro,
739
+ "radius-lg": oo,
740
+ "radius-full": eo,
741
+ "font-family": Mr,
742
+ "font-family-heading": to,
743
+ "font-size": `${Sr}px`,
744
+ "root-font-size": String(Sr),
745
+ canvas: i ? "rgba(0, 0, 0, 0.25)" : "rgba(0, 0, 0, 0.04)",
746
+ "canvas-image": i ? $o : Ao,
747
+ // Controls float over arbitrary artwork → mode-independent dark glass + white glyphs.
748
+ "canvas-control": "rgba(0, 0, 0, 0.45)",
749
+ "canvas-control-hover": "rgba(0, 0, 0, 0.6)",
750
+ "on-canvas-control": "#ffffff",
751
+ "disabled-opacity": "0.55"
752
+ };
753
+ for (const [l, u] of [
754
+ ["success", Yr],
755
+ ["warning", Kr],
756
+ ["error", Vr],
757
+ ["info", Qr]
758
+ ])
759
+ T[l] = v(u.base), T[`${l}-rgb`] = M(u.base), T[`on-${l}`] = v(u.on), T[`${l}-text`] = v(u.text), T[`${l}-soft`] = v(u.soft), T[`${l}-border`] = v(u.border), T[`${l}-dark-rgb`] = M(u.dark), T[`${l}-light-rgb`] = M(u.light), l === "info" ? T["info-bright-rgb"] = M(u.bright) : T[`${l}-darker-rgb`] = M(u.darker);
760
+ if (e.overrides)
761
+ for (const [l, u] of Object.entries(e.overrides)) {
762
+ if (!u || !dr.includes(l)) continue;
763
+ T[l] = u;
764
+ const N = `${l}-rgb`;
765
+ if (dr.includes(N)) {
766
+ const S = _(u);
767
+ S && (T[N] = M(S));
768
+ }
769
+ }
770
+ for (const l of dr) T[l] === void 0 && (T[l] = "");
771
+ const $r = T, Ar = (l) => _($r[l]), h = (l, u, N, S) => {
772
+ const W = Ar(u), Q = Ar(N), X = W && Q ? m(W, er(Q, n)) : 0;
773
+ return { label: l, fg: u, bg: N, ratio: Math.round(X * 100) / 100, min: S, pass: X >= S };
774
+ }, ao = [
775
+ h("Text on surface", "text", "surface", b),
776
+ h("Muted text on surface", "text-muted", "surface", b),
777
+ h("Faint text on surface", "text-faint", "surface", x),
778
+ h("Text on cards (surface-1)", "text", "surface-1", b),
779
+ h("Text on popovers (surface-2)", "text", "surface-2", b),
780
+ h("Cards distinguishable from surface", "surface-1", "surface", g.elevationMin),
781
+ h("Popovers distinguishable from cards", "surface-2", "surface-1", i ? 1.12 : 1),
782
+ h("Strong border on surface", "border-strong", "surface", d ? 3 : 1.5),
783
+ h("Text on primary", "on-primary", "primary", b),
784
+ h("Primary as text on surface", "primary-text", "surface", b),
785
+ h("Primary border on surface", "primary-border", "surface", x),
786
+ h("Focus ring on surface", "focus-ring", "surface", x),
787
+ h("Success text on surface", "success-text", "surface", b),
788
+ h("Warning text on surface", "warning-text", "surface", b),
789
+ h("Error text on surface", "error-text", "surface", b),
790
+ h("Info text on surface", "info-text", "surface", b),
791
+ // Where status text is actually read: on its own tint (alerts, tags, banners).
792
+ h("Success text on success tint", "success-text", "success-soft", b),
793
+ h("Warning text on warning tint", "warning-text", "warning-soft", b),
794
+ h("Error text on error tint", "error-text", "error-soft", b),
795
+ h("Info text on info tint", "info-text", "info-soft", b),
796
+ h("Text on success", "on-success", "success", b),
797
+ h("Text on warning", "on-warning", "warning", b),
798
+ h("Text on error", "on-error", "error", b),
799
+ h("Text on tooltip", "text-inverse", "surface-inverse", b)
800
+ ];
801
+ return { input: e, mode: s, tokens: $r, report: { mode: s, checks: ao, adjustments: a }, fontUrls: no };
802
+ }
803
+ const r = (o) => `var(${br}${o})`, Zr = {
804
+ /* ------------------------------------------------------------------ */
805
+ /* Typography & focus ring */
806
+ /* ------------------------------------------------------------------ */
807
+ "root-font-size": r("root-font-size"),
808
+ "font-family": r("font-family"),
809
+ "bx-focus-ring-color": r("focus-ring"),
810
+ // NOTE: the two below are identical to the semantic tokens (`--bx-focus-ring-width/-offset`).
811
+ // Kept for coverage; emitters must skip them (see LEGACY_BRIDGE_IDENTITY_KEYS).
812
+ "bx-focus-ring-width": r("focus-ring-width"),
813
+ "bx-focus-ring-offset": r("focus-ring-offset"),
814
+ /* ------------------------------------------------------------------ */
815
+ /* App shell / views */
816
+ /* ------------------------------------------------------------------ */
817
+ "app-background-color": r("surface"),
818
+ "app-background-color-rgb": r("surface-rgb"),
819
+ "app-divider-color": r("divider"),
820
+ "secondary-color-rgb": r("surface-2-rgb"),
821
+ "editor-view-background-color": r("surface"),
822
+ "fields-view-background-color": "transparent",
823
+ "live-view-background-color": "transparent",
824
+ "popup-background-color": r("surface-1"),
825
+ "bluepic-embed-editor-border": `1px solid ${r("border")}`,
826
+ "bluepic-embed-editor-border-radius": r("radius-lg"),
827
+ /* ------------------------------------------------------------------ */
828
+ /* Colour triplets (legacy `rgba(var(--x), a)` habit) */
829
+ /* ------------------------------------------------------------------ */
830
+ "primary-color-base": r("primary-rgb"),
831
+ "primary-color-dark": r("primary-dark-rgb"),
832
+ "primary-color-light": r("primary-light-rgb"),
833
+ "primary-color-bright": r("primary-bright-rgb"),
834
+ "info-color-base": r("info-rgb"),
835
+ "info-color-dark": r("info-dark-rgb"),
836
+ "info-color-light": r("info-light-rgb"),
837
+ "info-color-bright": r("info-bright-rgb"),
838
+ "success-color-base": r("success-rgb"),
839
+ "success-color-light": r("success-light-rgb"),
840
+ "success-color-dark": r("success-dark-rgb"),
841
+ "success-color-darker": r("success-darker-rgb"),
842
+ "error-color-base": r("error-rgb"),
843
+ "error-color-light": r("error-light-rgb"),
844
+ "error-color-dark": r("error-dark-rgb"),
845
+ "error-color-darker": r("error-darker-rgb"),
846
+ "warning-color-base": r("warning-rgb"),
847
+ "warning-color-light": r("warning-light-rgb"),
848
+ "warning-color-dark": r("warning-dark-rgb"),
849
+ "warning-color-darker": r("warning-darker-rgb"),
850
+ "text-color-base": r("text-on-surface-rgb"),
851
+ "text-color-alt": r("text-on-inverse-rgb"),
852
+ "border-color-base": r("border-rgb"),
853
+ "background-color-base": r("surface-rgb"),
854
+ // Historical typos that components still reference — alias them to the intended triplets.
855
+ "priinfomary-color-base": r("info-rgb"),
856
+ "primainfory-color-bright": r("primary-bright-rgb"),
857
+ /* ------------------------------------------------------------------ */
858
+ /* Undefined-today aliases (referenced by components, never preset) */
859
+ /* ------------------------------------------------------------------ */
860
+ "primary-color": r("primary"),
861
+ "info-color": r("info"),
862
+ "bx-primary-color": r("primary"),
863
+ "bx-text-color": r("text"),
864
+ "bx-modal-color": r("surface-1"),
865
+ "bx-card-color": r("surface-1"),
866
+ "upload-background-color": r("field"),
867
+ "upload-text-color-title": r("text"),
868
+ "upload-text-color-description": r("text-muted"),
869
+ /* ------------------------------------------------------------------ */
870
+ /* Input */
871
+ /* ------------------------------------------------------------------ */
872
+ "input-background-color": r("field"),
873
+ "input-background-color-hover": r("field-hover"),
874
+ "input-background-color-focus": r("field-focus"),
875
+ "input-border-color": "transparent",
876
+ "input-border-color-hover": "transparent",
877
+ "input-border-color-focus": r("primary-border"),
878
+ "input-shadow-focus-color": r("focus-ring"),
879
+ "input-bordered-border-color": r("border-strong"),
880
+ "input-bordered-border-color-hover": r("border-strong"),
881
+ "input-bordered-border-color-focus": r("primary-border"),
882
+ "input-outline-color-focus": r("focus-ring"),
883
+ "input-border-color-disabled": r("border"),
884
+ "input-opacity-disabled": r("disabled-opacity"),
885
+ "input-ghost-border-color-hover": r("border"),
886
+ "input-ghost-border-color-focus": r("primary-border"),
887
+ "input-number-ctrl-separator-color": r("divider"),
888
+ "input-number-ctrl-color": r("text-muted"),
889
+ "input-number-ctrl-color-hover": r("text"),
890
+ "input-number-ctrl-background-color-hover": r("hover"),
891
+ /* Input states ('active' = primary tokens, others = status tokens) */
892
+ "input-state-active-background-color": r("primary-soft"),
893
+ "input-state-active-background-color-hover": r("primary-soft"),
894
+ "input-state-active-background-color-focus": r("primary-soft"),
895
+ "input-state-active-border-color": r("primary-border"),
896
+ "input-state-active-border-color-hover": r("primary-border"),
897
+ "input-state-active-border-color-focus": r("primary-border"),
898
+ "input-state-success-background-color": r("success-soft"),
899
+ "input-state-success-background-color-hover": r("success-soft"),
900
+ "input-state-success-background-color-focus": r("success-soft"),
901
+ "input-state-success-border-color": r("success-border"),
902
+ "input-state-success-border-color-hover": r("success-border"),
903
+ "input-state-success-border-color-focus": r("success-border"),
904
+ "input-state-error-background-color": r("error-soft"),
905
+ "input-state-error-background-color-hover": r("error-soft"),
906
+ "input-state-error-background-color-focus": r("error-soft"),
907
+ "input-state-error-border-color": r("error-border"),
908
+ "input-state-error-border-color-hover": r("error-border"),
909
+ "input-state-error-border-color-focus": r("error-border"),
910
+ "input-state-warning-background-color": r("warning-soft"),
911
+ "input-state-warning-background-color-hover": r("warning-soft"),
912
+ "input-state-warning-background-color-focus": r("warning-soft"),
913
+ "input-state-warning-border-color": r("warning-border"),
914
+ "input-state-warning-border-color-hover": r("warning-border"),
915
+ "input-state-warning-border-color-focus": r("warning-border"),
916
+ /* ------------------------------------------------------------------ */
917
+ /* Card */
918
+ /* ------------------------------------------------------------------ */
919
+ "card-background-color": r("surface-1"),
920
+ "card-background-color-hover": r("surface-2"),
921
+ "card-border-color": r("border"),
922
+ "card-header-divider-color": r("divider"),
923
+ "card-footer-divider-color": r("divider"),
924
+ "card-footer-background-color": r("hover"),
925
+ /* ------------------------------------------------------------------ */
926
+ /* Select */
927
+ /* ------------------------------------------------------------------ */
928
+ "select-background-color": r("field"),
929
+ "select-background-color-hover": r("field-hover"),
930
+ "select-background-color-focus": r("field-focus"),
931
+ "select-border": "1px solid transparent",
932
+ "select-border-hover": "1px solid transparent",
933
+ "select-border-focus": `1px solid ${r("primary-border")}`,
934
+ "select-color": r("text"),
935
+ "select-color-hover": r("text"),
936
+ "select-color-focus": r("text"),
937
+ "select-button-background-color": r("fill"),
938
+ "select-button-background-color-hover": r("fill-hover"),
939
+ "select-item-border": `2px solid ${r("primary-border")}`,
940
+ /* ------------------------------------------------------------------ */
941
+ /* Checkbox */
942
+ /* ------------------------------------------------------------------ */
943
+ "checkbox-background-color": r("field"),
944
+ "checkbox-border-color": r("border-strong"),
945
+ "checkbox-border-color-hover": r("primary-border"),
946
+ "checkbox-outline-color-focus": r("focus-ring"),
947
+ "checkbox-border-color-focus": r("primary-border"),
948
+ "checkbox-background-color-checked": r("primary"),
949
+ "checkbox-border-color-checked": "transparent",
950
+ "checkbox-background-color-checked-hover": r("primary-hover"),
951
+ "checkbox-border-color-checked-hover": "transparent",
952
+ "checkbox-symbol-color": r("text-faint"),
953
+ "checkbox-symbol-color-checked": r("on-primary"),
954
+ /* Checkbox, secondary (tonal) look */
955
+ "checkbox-secondary-background-color": r("fill"),
956
+ "checkbox-secondary-background-color-hover": r("fill-hover"),
957
+ "checkbox-secondary-background-color-checked": r("fill-active"),
958
+ "checkbox-secondary-border": `1px solid ${r("border")}`,
959
+ "checkbox-secondary-border-hover": `1px solid ${r("border-strong")}`,
960
+ "checkbox-secondary-border-checked": `1px solid ${r("border-strong")}`,
961
+ "checkbox-secondary-symbol-color": r("text-muted"),
962
+ "checkbox-secondary-symbol-color-checked": r("primary-text"),
963
+ /* ------------------------------------------------------------------ */
964
+ /* Popover / tooltip */
965
+ /* ------------------------------------------------------------------ */
966
+ "popover-background-color": r("surface-2"),
967
+ "popover-border-color": r("border"),
968
+ "popover-border": `1px solid ${r("border")}`,
969
+ "popover-arrow-border-color": r("border"),
970
+ "popover-without-darkened-bg-background-color": r("surface-2-rgb"),
971
+ "popover-without-darkened-bg-box-shadow": r("shadow-2"),
972
+ "tooltip-background-color": r("surface-inverse"),
973
+ "tooltip-text-color": r("text-inverse"),
974
+ "tooltip-border-color": "transparent",
975
+ /* ------------------------------------------------------------------ */
976
+ /* Menu / label / list / empty */
977
+ /* ------------------------------------------------------------------ */
978
+ "menu-item-color": r("text"),
979
+ "menu-item-color-active": r("primary-text"),
980
+ "menu-item-background-color": "transparent",
981
+ "menu-item-background-color-active": r("primary-soft"),
982
+ "menu-item-background-color-hover": r("hover"),
983
+ "menu-item-background-color-active-hover": r("primary-soft-hover"),
984
+ "menu-divider": `1px solid ${r("divider")}`,
985
+ "labeled-text-color": r("text-muted"),
986
+ "label-background-color": r("fill"),
987
+ "list-divider": `1px solid ${r("divider")}`,
988
+ "list-item-background-color-hover": r("hover"),
989
+ "empty-text-color": r("text-faint"),
990
+ /* ------------------------------------------------------------------ */
991
+ /* Tag */
992
+ /* ------------------------------------------------------------------ */
993
+ "tag-background-color": r("fill"),
994
+ "tag-color": r("text"),
995
+ "tag-border-color": r("border"),
996
+ "tag-error-background-color": r("error-soft"),
997
+ "tag-error-color": r("error-text"),
998
+ "tag-error-border-color": r("error-border"),
999
+ "tag-success-background-color": r("success-soft"),
1000
+ "tag-success-color": r("success-text"),
1001
+ "tag-success-border-color": r("success-border"),
1002
+ "tag-warning-background-color": r("warning-soft"),
1003
+ "tag-warning-color": r("warning-text"),
1004
+ "tag-warning-border-color": r("warning-border"),
1005
+ "tag-info-background-color": r("info-soft"),
1006
+ "tag-info-color": r("info-text"),
1007
+ "tag-info-border-color": r("info-border"),
1008
+ /* ------------------------------------------------------------------ */
1009
+ /* Alert */
1010
+ /* ------------------------------------------------------------------ */
1011
+ "alert-background-color": r("fill"),
1012
+ "alert-color": r("text"),
1013
+ "alert-border-color": r("border"),
1014
+ "alert-icon-color": r("text-muted"),
1015
+ "alert-info-background-color": r("info-soft"),
1016
+ "alert-info-color": r("info-text"),
1017
+ "alert-info-icon-color": r("info-text"),
1018
+ "alert-info-border-color": r("info-border"),
1019
+ "alert-success-background-color": r("success-soft"),
1020
+ "alert-success-color": r("success-text"),
1021
+ "alert-success-icon-color": r("success-text"),
1022
+ "alert-success-border-color": r("success-border"),
1023
+ "alert-warning-background-color": r("warning-soft"),
1024
+ "alert-warning-color": r("warning-text"),
1025
+ "alert-warning-icon-color": r("warning-text"),
1026
+ "alert-warning-border-color": r("warning-border"),
1027
+ "alert-error-background-color": r("error-soft"),
1028
+ "alert-error-color": r("error-text"),
1029
+ "alert-error-icon-color": r("error-text"),
1030
+ "alert-error-border-color": r("error-border"),
1031
+ /* ------------------------------------------------------------------ */
1032
+ /* Slider / progress */
1033
+ /* ------------------------------------------------------------------ */
1034
+ "slider-body-background-color": r("fill-active"),
1035
+ "slider-body-background-color-hover": r("fill-active"),
1036
+ "slider-body-background-color-focus": r("fill-active"),
1037
+ "slider-thumb-background-color": r("primary"),
1038
+ "slider-thumb-background-color-hover": r("primary-hover"),
1039
+ "slider-thumb-background-color-focus": r("primary-hover"),
1040
+ "slider-thumb-box-shadow": r("shadow-1"),
1041
+ "slider-value-background-color": r("primary"),
1042
+ "slider-value-background-color-hover": r("primary"),
1043
+ "slider-value-background-color-focus": r("primary"),
1044
+ "progress-background-color": r("fill"),
1045
+ "progress-value-color": r("primary"),
1046
+ /* ------------------------------------------------------------------ */
1047
+ /* Tabs */
1048
+ /* ------------------------------------------------------------------ */
1049
+ "tab-color": r("text-muted"),
1050
+ "tab-color-active": r("primary-text"),
1051
+ "tab-segment-background-color": r("fill"),
1052
+ "tab-segment-background-color-active": r("surface-2"),
1053
+ "tab-segment-color": r("text-muted"),
1054
+ "tab-segment-color-active": r("text"),
1055
+ "tab-inline-item-background-color-hover": r("hover"),
1056
+ "tab-item-active-box-shadow": r("shadow-1"),
1057
+ /* ------------------------------------------------------------------ */
1058
+ /* Switch */
1059
+ /* ------------------------------------------------------------------ */
1060
+ "switch-background-color": r("fill-active"),
1061
+ "switch-border": "none",
1062
+ "switch-thumb-background-color": r("surface-3"),
1063
+ "switch-thumb-border": "none",
1064
+ "switch-thumb-shadow": r("shadow-1"),
1065
+ "switch-border-hover": "none",
1066
+ "switch-background-color-hover": r("fill-active"),
1067
+ // no stronger neutral step exists; acceptable
1068
+ "switch-thumb-background-color-hover": r("surface-3"),
1069
+ "switch-thumb-border-hover": "none",
1070
+ "switch-active-background-color": r("primary"),
1071
+ "switch-active-border": "none",
1072
+ "switch-active-thumb-background-color": r("on-primary"),
1073
+ "switch-active-thumb-border": "none",
1074
+ "switch-active-thumb-shadow": r("shadow-1"),
1075
+ "switch-active-background-color-hover": r("primary-hover"),
1076
+ "switch-active-border-hover": "none",
1077
+ "switch-active-thumb-background-color-hover": r("on-primary"),
1078
+ "switch-active-thumb-border-hover": "none",
1079
+ /* ------------------------------------------------------------------ */
1080
+ /* Radio */
1081
+ /* ------------------------------------------------------------------ */
1082
+ "radio-background-color": "transparent",
1083
+ "radio-background-color-active": r("primary"),
1084
+ "radio-background-color-hover": "transparent",
1085
+ "radio-border": `1px solid ${r("border-strong")}`,
1086
+ "radio-border-active": `1px solid ${r("primary")}`,
1087
+ "radio-border-color-hover": r("primary-border"),
1088
+ "radio-symbol-color": r("on-primary"),
1089
+ "radio-label-color": r("text"),
1090
+ "radio-label-color-active": r("text"),
1091
+ /* ------------------------------------------------------------------ */
1092
+ /* Button — default variant (ghost; `.active` = solid primary) */
1093
+ /* ------------------------------------------------------------------ */
1094
+ "button-background-color": "transparent",
1095
+ "button-background-color-hover": r("hover"),
1096
+ "button-background-color-focus": r("hover"),
1097
+ // A TRANSPARENT 1px border, not `none` — the same placeholder the secondary
1098
+ // and tertiary families use. `none` reserves no space, so a button that
1099
+ // switches family (ghost ⇄ secondary, or any variant toggling `.active`)
1100
+ // would change size by 2px and shove its neighbours around.
1101
+ "button-border": "1px solid transparent",
1102
+ "button-border-hover": "1px solid transparent",
1103
+ "button-border-focus": "1px solid transparent",
1104
+ "button-text-color": r("text"),
1105
+ "button-text-color-hover": r("text"),
1106
+ "button-text-color-focus": r("text"),
1107
+ "button-box-shadow": "none",
1108
+ "button-box-shadow-hover": "none",
1109
+ "button-border-radius": r("radius-md"),
1110
+ "button-active-background-color": r("primary"),
1111
+ "button-active-text-color": r("on-primary"),
1112
+ "button-active-border": "1px solid transparent",
1113
+ "button-active-box-shadow": "none",
1114
+ "button-active-background-color-hover": r("primary-hover"),
1115
+ "button-active-text-color-hover": r("on-primary"),
1116
+ "button-active-border-hover": "1px solid transparent",
1117
+ "button-active-box-shadow-hover": "none",
1118
+ /* ------------------------------------------------------------------ */
1119
+ /* Button — secondary (tonal neutral in both modes) */
1120
+ /* ------------------------------------------------------------------ */
1121
+ "button-secondary-background-color": r("fill"),
1122
+ "button-secondary-background-color-hover": r("fill-hover"),
1123
+ "button-secondary-background-color-focus": r("fill-hover"),
1124
+ "button-secondary-border": "1px solid transparent",
1125
+ "button-secondary-border-hover": "1px solid transparent",
1126
+ "button-secondary-border-focus": "1px solid transparent",
1127
+ "button-secondary-text-color": r("text"),
1128
+ "button-secondary-text-color-hover": r("text"),
1129
+ "button-secondary-text-color-focus": r("text"),
1130
+ "button-secondary-box-shadow": "none",
1131
+ "button-secondary-box-shadow-hover": "none",
1132
+ "button-secondary-active-background-color": r("fill-active"),
1133
+ "button-secondary-active-background-color-hover": r("fill-active"),
1134
+ "button-secondary-active-background-color-focus": r("fill-active"),
1135
+ "button-secondary-active-border": "1px solid transparent",
1136
+ "button-secondary-active-border-hover": "1px solid transparent",
1137
+ "button-secondary-active-border-focus": "1px solid transparent",
1138
+ "button-secondary-active-text-color": r("text"),
1139
+ "button-secondary-active-text-color-hover": r("text"),
1140
+ "button-secondary-active-text-color-focus": r("text"),
1141
+ "button-secondary-active-box-shadow": "none",
1142
+ "button-secondary-active-box-shadow-hover": "none",
1143
+ /* ------------------------------------------------------------------ */
1144
+ /* Button — tertiary (outlined; `.active` = solid primary) */
1145
+ /* ------------------------------------------------------------------ */
1146
+ "button-tertiary-background-color": "transparent",
1147
+ "button-tertiary-background-color-hover": r("hover"),
1148
+ "button-tertiary-background-color-focus": r("hover"),
1149
+ "button-tertiary-border": `1px solid ${r("border-strong")}`,
1150
+ "button-tertiary-border-hover": `1px solid ${r("border-strong")}`,
1151
+ "button-tertiary-border-focus": `1px solid ${r("border-strong")}`,
1152
+ "button-tertiary-text-color": r("text"),
1153
+ "button-tertiary-text-color-hover": r("text"),
1154
+ "button-tertiary-text-color-focus": r("text"),
1155
+ "button-tertiary-box-shadow": "none",
1156
+ "button-tertiary-box-shadow-hover": "none",
1157
+ "button-tertiary-box-shadow-focus": "none",
1158
+ "button-tertiary-active-background-color": r("primary"),
1159
+ "button-tertiary-active-background-color-hover": r("primary-hover"),
1160
+ "button-tertiary-active-background-color-focus": r("primary-hover"),
1161
+ "button-tertiary-active-border": `1px solid ${r("primary")}`,
1162
+ "button-tertiary-active-border-hover": `1px solid ${r("primary")}`,
1163
+ "button-tertiary-active-border-focus": `1px solid ${r("primary")}`,
1164
+ "button-tertiary-active-text-color": r("on-primary"),
1165
+ "button-tertiary-active-text-color-hover": r("on-primary"),
1166
+ "button-tertiary-active-text-color-focus": r("on-primary"),
1167
+ "button-tertiary-active-box-shadow": "none",
1168
+ "button-tertiary-active-box-shadow-hover": "none",
1169
+ "button-tertiary-active-box-shadow-focus": "none",
1170
+ /* ------------------------------------------------------------------ */
1171
+ /* Button — quaternary (text only) */
1172
+ /* ------------------------------------------------------------------ */
1173
+ "button-quaternary-background-color": "transparent",
1174
+ // `-background-color-hover` was never defined by any preset (→ initial = transparent); keep it.
1175
+ "button-quaternary-background-color-hover": "transparent",
1176
+ "button-quaternary-text-color": r("text-muted"),
1177
+ "button-quaternary-text-color-hover": r("text"),
1178
+ "button-quaternary-active-background-color": "transparent",
1179
+ "button-quaternary-active-background-color-hover": "transparent",
1180
+ "button-quaternary-active-text-color": r("text"),
1181
+ "button-quaternary-active-text-color-hover": r("text"),
1182
+ /* ------------------------------------------------------------------ */
1183
+ /* Button states (active = primary tokens, success/error/warning = */
1184
+ /* status tokens). See BxButton.vue `@each $state` block: */
1185
+ /* -background-color / -hover tinted bg (secondary, hovers) */
1186
+ /* -background-color-active / -hover stronger tint (sec./tert. .active)*/
1187
+ /* -background-color-solid / -hover solid fill (default .active) */
1188
+ /* -border-color / -hover coloured border (tertiary) */
1189
+ /* -text-color text on EVERY variant */
1190
+ /* -text-color-tertiary text on the outlined variant */
1191
+ /* LIMITATION: `-text-color` is applied by BxButton on both the tinted */
1192
+ /* (soft) and the solid fills. We pick `<X>-text` (contrast-correct on */
1193
+ /* surface + soft); on the solid `.active` default fill the ideal would */
1194
+ /* be `on-<X>` — BxButton needs a dedicated var for that to be perfect. */
1195
+ /* Status tokens have no `-soft-hover` / `-hover` step: hovers reuse */
1196
+ /* `<status>-soft` / `<status>` (only `active` has primary-soft-hover */
1197
+ /* and primary-hover). */
1198
+ /* ------------------------------------------------------------------ */
1199
+ "button-state-active-background-color": r("primary-soft"),
1200
+ "button-state-active-background-color-hover": r("primary-soft-hover"),
1201
+ "button-state-active-background-color-active": r("primary-soft"),
1202
+ "button-state-active-background-color-active-hover": r("primary-soft-hover"),
1203
+ "button-state-active-background-color-solid": r("primary"),
1204
+ "button-state-active-background-color-solid-hover": r("primary-hover"),
1205
+ "button-state-active-border-color": r("primary-border"),
1206
+ "button-state-active-border-color-hover": r("primary-border"),
1207
+ "button-state-active-text-color": r("primary-text"),
1208
+ "button-state-active-text-color-tertiary": r("primary-text"),
1209
+ "button-state-success-background-color": r("success-soft"),
1210
+ "button-state-success-background-color-hover": r("success-soft"),
1211
+ "button-state-success-background-color-active": r("success-soft"),
1212
+ "button-state-success-background-color-active-hover": r("success-soft"),
1213
+ "button-state-success-background-color-solid": r("success"),
1214
+ "button-state-success-background-color-solid-hover": r("success"),
1215
+ "button-state-success-border-color": r("success-border"),
1216
+ "button-state-success-border-color-hover": r("success-border"),
1217
+ "button-state-success-text-color": r("success-text"),
1218
+ "button-state-success-text-color-tertiary": r("success-text"),
1219
+ "button-state-error-background-color": r("error-soft"),
1220
+ "button-state-error-background-color-hover": r("error-soft"),
1221
+ "button-state-error-background-color-active": r("error-soft"),
1222
+ "button-state-error-background-color-active-hover": r("error-soft"),
1223
+ "button-state-error-background-color-solid": r("error"),
1224
+ "button-state-error-background-color-solid-hover": r("error"),
1225
+ "button-state-error-border-color": r("error-border"),
1226
+ "button-state-error-border-color-hover": r("error-border"),
1227
+ "button-state-error-text-color": r("error-text"),
1228
+ "button-state-error-text-color-tertiary": r("error-text"),
1229
+ "button-state-warning-background-color": r("warning-soft"),
1230
+ "button-state-warning-background-color-hover": r("warning-soft"),
1231
+ "button-state-warning-background-color-active": r("warning-soft"),
1232
+ "button-state-warning-background-color-active-hover": r("warning-soft"),
1233
+ "button-state-warning-background-color-solid": r("warning"),
1234
+ "button-state-warning-background-color-solid-hover": r("warning"),
1235
+ "button-state-warning-border-color": r("warning-border"),
1236
+ "button-state-warning-border-color-hover": r("warning-border"),
1237
+ "button-state-warning-text-color": r("warning-text"),
1238
+ "button-state-warning-text-color-tertiary": r("warning-text"),
1239
+ /* ------------------------------------------------------------------ */
1240
+ /* Message */
1241
+ /* ------------------------------------------------------------------ */
1242
+ "message-body-background-color": r("surface-2"),
1243
+ "message-body-text-color": r("text"),
1244
+ "message-body-border": `1px solid ${r("border")}`,
1245
+ /* ------------------------------------------------------------------ */
1246
+ /* Canvas (template preview area) */
1247
+ /* ------------------------------------------------------------------ */
1248
+ "canvas-background-color": r("canvas"),
1249
+ "canvas-background-image": r("canvas-image"),
1250
+ "canvas-btn-background-color": r("canvas-control"),
1251
+ "canvas-btn-background-color-hover": r("canvas-control-hover"),
1252
+ "canvas-btn-color": r("on-canvas-control"),
1253
+ "btn-color": r("on-canvas-control"),
1254
+ /* ------------------------------------------------------------------ */
1255
+ /* Gallery (bx-template) */
1256
+ /* ------------------------------------------------------------------ */
1257
+ "gallery-card-background-color": r("surface-1"),
1258
+ "gallery-card-background-color-hover": r("surface-2"),
1259
+ "gallery-card-border": `1px solid ${r("border")}`,
1260
+ "gallery-action-btn-background-color": r("scrim"),
1261
+ // The ONLY colour literal in the bridge: the action button sits on `scrim`, which is dark in
1262
+ // every mode, so white text is correct regardless of theme.
1263
+ "gallery-action-btn-color": "#ffffff",
1264
+ "gallery-card-name-text-color": r("text"),
1265
+ "gallery-card-description-text-color": r("text-muted"),
1266
+ /* ------------------------------------------------------------------ */
1267
+ /* Misc */
1268
+ /* ------------------------------------------------------------------ */
1269
+ "spinner-color": r("text")
1270
+ }, No = new Set(
1271
+ Object.keys(Zr).filter(
1272
+ (o) => `--${o}`.startsWith(br) && dr.includes(`--${o}`.slice(br.length))
1273
+ )
1274
+ ), Co = Object.entries(
1275
+ Zr
1276
+ ).filter(([o]) => !No.has(o));
1277
+ function Eo(o) {
1278
+ const e = {};
1279
+ for (const [t, a] of Object.entries(o.tokens))
1280
+ a !== "" && (e[`${br}${t}`] = a);
1281
+ for (const [t, a] of Co)
1282
+ e[`--${t}`] = a;
1283
+ if (o.input.customStyle)
1284
+ for (const [t, a] of Object.entries(o.input.customStyle))
1285
+ t === "key" || a == null || a === "" || (e[t.startsWith("--") ? t : `--${t}`] = String(a));
1286
+ return e;
1287
+ }
1288
+ function Po(o, e) {
1289
+ const t = Array.isArray(e) ? e.join(", ") : e, a = Eo(o), n = Object.entries(a).map(([c, s]) => `${c}: ${s};`).join(" ");
1290
+ return `${t} { color-scheme: ${o.mode}; ${n} }`;
1291
+ }
1292
+ function jo(o) {
1293
+ return !!o && typeof o == "object" && o.version === 2;
1294
+ }
1295
+ function Ro(o) {
1296
+ const e = o ?? {}, t = e["editor-view-background-color"] || (e["app-background-color-rgb"] ? `rgb(${e["app-background-color-rgb"]})` : void 0) || e["popup-background-color"], a = e["primary-color-base"] ? `rgb(${e["primary-color-base"]})` : void 0, n = _(t) ? t : void 0, c = _(a) ? a : void 0, s = typeof e.key == "string" && e.key.endsWith("-wcag"), i = { version: 2 };
1297
+ return n && (i.surface = n), c && (i.primary = c), s && (i.contrast = "high"), typeof e.key == "string" && (i.preset = e.key.startsWith("light") ? "light" : "dark"), i;
1298
+ }
1299
+ export {
1300
+ Zr as LEGACY_BRIDGE,
1301
+ br as SEMANTIC_PREFIX,
1302
+ Lo as SEMANTIC_TOKEN_GROUPS,
1303
+ dr as SEMANTIC_TOKEN_NAMES,
1304
+ lo as STATUS_BASES,
1305
+ Ho as THEME_HOUSE_PRESETS,
1306
+ io as THEME_PRESETS,
1307
+ jo as looksLikeThemeInput,
1308
+ Do as resolveTheme,
1309
+ _o as themeColor,
1310
+ Ro as themeInputFromLegacyCustomStyle,
1311
+ Po as themeToCssText,
1312
+ Eo as themeToCssVars
1313
+ };