ooxml-ui 1.18.2 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +54 -0
  2. package/dist/building-block-styles.d.ts +5 -0
  3. package/dist/building-block-styles.d.ts.map +1 -0
  4. package/dist/chunk-6Y7KR2I3.js +299 -0
  5. package/dist/{chunk-EVL7GFC7.js → chunk-KH2ZG3N6.js} +2 -2
  6. package/dist/{chunk-MSXUCINT.js → chunk-QEIGB73C.js} +1 -1
  7. package/dist/docx/building-blocks.d.ts +31 -0
  8. package/dist/docx/component.d.ts +1 -1
  9. package/dist/docx/editor-core.d.ts +3 -0
  10. package/dist/docx/element-api.d.ts +8 -0
  11. package/dist/docx/index.d.ts +1 -0
  12. package/dist/docx/styles/index.d.ts +0 -4
  13. package/dist/docx.js +154 -38
  14. package/dist/index.js +3 -3
  15. package/dist/pptx/chunk-NDAE3JFO.cjs +1014 -0
  16. package/dist/pptx/{chunk-AUCJIB3M.mjs → chunk-NLUVYOKN.mjs} +113 -381
  17. package/dist/pptx/{chunk-S2Y3VUNC.cjs → chunk-OQQQ2GBW.cjs} +134 -402
  18. package/dist/pptx/chunk-UTFFX4M7.mjs +989 -0
  19. package/dist/pptx/dom/index.cjs +205 -205
  20. package/dist/pptx/dom/index.mjs +3 -3
  21. package/dist/pptx/index.cjs +2888 -2880
  22. package/dist/pptx/index.mjs +2 -2
  23. package/dist/pptx/render/morph-predicates.d.ts.map +1 -1
  24. package/dist/pptx/theme/index.cjs +24 -16
  25. package/dist/pptx/theme/index.d.ts +1 -0
  26. package/dist/pptx/theme/index.d.ts.map +1 -1
  27. package/dist/pptx/theme/index.mjs +1 -1
  28. package/dist/pptx/theme/office-css.d.ts +6 -0
  29. package/dist/pptx/theme/office-css.d.ts.map +1 -0
  30. package/dist/pptx/web-components/chart-format-pane-styles.d.ts +1 -1
  31. package/dist/pptx/web-components/chart-format-pane-styles.d.ts.map +1 -1
  32. package/dist/pptx/web-components/control-styles.d.ts.map +1 -1
  33. package/dist/pptx/web-components/index.d.ts.map +1 -1
  34. package/dist/pptx/web-components/mobile-bar-styles.d.ts +2 -2
  35. package/dist/pptx/web-components/mobile-bar-styles.d.ts.map +1 -1
  36. package/dist/pptx/web-components/mobile-insert-styles.d.ts +1 -1
  37. package/dist/pptx/web-components/mobile-insert-styles.d.ts.map +1 -1
  38. package/dist/pptx/web-components/notes-toolbar-styles.d.ts +1 -1
  39. package/dist/pptx/web-components/notes-toolbar-styles.d.ts.map +1 -1
  40. package/dist/pptx/web-components/office-token-bridge.d.ts.map +1 -1
  41. package/dist/pptx/web-components/subtitle-settings-styles.d.ts +1 -1
  42. package/dist/pptx/web-components/subtitle-settings-styles.d.ts.map +1 -1
  43. package/dist/pptx/web-components/theme-editor-styles.d.ts +1 -1
  44. package/dist/pptx/web-components/theme-editor-styles.d.ts.map +1 -1
  45. package/dist/teams.js +2 -2
  46. package/dist/theme-bridge.d.ts +28 -0
  47. package/dist/theme-bridge.d.ts.map +1 -0
  48. package/dist/theme.d.ts +10 -3
  49. package/dist/theme.d.ts.map +1 -0
  50. package/dist/theme.js +1 -1
  51. package/dist/visio/building-blocks.d.ts +37 -0
  52. package/dist/visio/controller.d.ts +6 -0
  53. package/dist/visio/index.d.ts +1 -0
  54. package/dist/visio/styles/theme.d.ts +1 -1
  55. package/dist/visio/styles.d.ts +1 -1
  56. package/dist/visio/viewer-element.d.ts +2 -0
  57. package/dist/visio.js +7446 -7321
  58. package/dist/xlsx/building-blocks.d.ts +55 -0
  59. package/dist/xlsx/component.d.ts +3 -1
  60. package/dist/xlsx/dialogs/styles.d.ts +1 -1
  61. package/dist/xlsx/editor-core.d.ts +1 -0
  62. package/dist/xlsx/element-api.d.ts +6 -0
  63. package/dist/xlsx/formula-bar/styles.d.ts +1 -1
  64. package/dist/xlsx/grid/page-break-layer.d.ts +1 -1
  65. package/dist/xlsx/grid/styles.d.ts +1 -1
  66. package/dist/xlsx/index.d.ts +1 -0
  67. package/dist/xlsx/page-views/page-layout-css.d.ts +1 -1
  68. package/dist/xlsx/sheet-tabs/styles.d.ts +1 -1
  69. package/dist/xlsx/surface-shell.d.ts +3 -0
  70. package/dist/xlsx/theme/styles.d.ts +1 -4
  71. package/dist/xlsx.js +412 -268
  72. package/package.json +4 -4
  73. package/dist/chunk-7E3HU7RL.js +0 -123
  74. package/dist/pptx/chunk-BDXQX6RA.cjs +0 -373
  75. package/dist/pptx/chunk-ZAOD6O2D.mjs +0 -357
@@ -0,0 +1,989 @@
1
+ import { THEME_PRESETS, themeColorSchemesEqual } from 'ooxml-core/pptx';
2
+
3
+ // src/pptx/theme/defaults.ts
4
+ var defaultThemeColors = {
5
+ background: "#030712",
6
+ // gray-950
7
+ foreground: "#f3f4f6",
8
+ // gray-100
9
+ card: "#111827",
10
+ // gray-900
11
+ cardForeground: "#f3f4f6",
12
+ // gray-100
13
+ popover: "#111827",
14
+ // gray-900
15
+ popoverForeground: "#f3f4f6",
16
+ // gray-100
17
+ primary: "#6366f1",
18
+ // indigo-500
19
+ primaryForeground: "#ffffff",
20
+ // white
21
+ secondary: "#1f2937",
22
+ // gray-800
23
+ secondaryForeground: "#f3f4f6",
24
+ // gray-100
25
+ muted: "#1f2937",
26
+ // gray-800
27
+ mutedForeground: "#9ca3af",
28
+ // gray-400
29
+ accent: "#1f2937",
30
+ // gray-800
31
+ accentForeground: "#f3f4f6",
32
+ // gray-100
33
+ destructive: "#ef4444",
34
+ // red-500
35
+ destructiveForeground: "#ffffff",
36
+ // white
37
+ border: "#374151",
38
+ // gray-700
39
+ input: "#374151",
40
+ // gray-700
41
+ ring: "#6366f1"
42
+ // indigo-500
43
+ };
44
+ var defaultRadius = "0.5rem";
45
+ var lightThemeColors = {
46
+ background: "#f8fafc",
47
+ // slate-50
48
+ foreground: "#0f172a",
49
+ // slate-900
50
+ card: "#ffffff",
51
+ cardForeground: "#0f172a",
52
+ // slate-900
53
+ popover: "#ffffff",
54
+ popoverForeground: "#0f172a",
55
+ // slate-900
56
+ primary: "#4f46e5",
57
+ // indigo-600
58
+ primaryForeground: "#ffffff",
59
+ secondary: "#f1f5f9",
60
+ // slate-100
61
+ secondaryForeground: "#0f172a",
62
+ // slate-900
63
+ muted: "#f1f5f9",
64
+ // slate-100
65
+ mutedForeground: "#64748b",
66
+ // slate-500
67
+ accent: "#f1f5f9",
68
+ // slate-100
69
+ accentForeground: "#0f172a",
70
+ // slate-900
71
+ destructive: "#dc2626",
72
+ // red-600
73
+ destructiveForeground: "#ffffff",
74
+ border: "#e2e8f0",
75
+ // slate-200
76
+ input: "#e2e8f0",
77
+ // slate-200
78
+ ring: "#4f46e5"
79
+ // indigo-600
80
+ };
81
+ var lightTheme = {
82
+ colors: lightThemeColors
83
+ };
84
+
85
+ // src/pptx/theme/css-vars.ts
86
+ var COLOR_KEY_TO_CSS = {
87
+ background: "background",
88
+ foreground: "foreground",
89
+ card: "card",
90
+ cardForeground: "card-foreground",
91
+ popover: "popover",
92
+ popoverForeground: "popover-foreground",
93
+ primary: "primary",
94
+ primaryForeground: "primary-foreground",
95
+ secondary: "secondary",
96
+ secondaryForeground: "secondary-foreground",
97
+ muted: "muted",
98
+ mutedForeground: "muted-foreground",
99
+ accent: "accent",
100
+ accentForeground: "accent-foreground",
101
+ destructive: "destructive",
102
+ destructiveForeground: "destructive-foreground",
103
+ border: "border",
104
+ input: "input",
105
+ ring: "ring"
106
+ };
107
+ var DERIVED_COLOR_TOKENS = [
108
+ { source: "primary", cssSuffix: "inspector-active" },
109
+ { source: "border", cssSuffix: "inspector-border" }
110
+ ];
111
+ function themeToCssVars(theme, omitDefaults = false) {
112
+ const vars = {};
113
+ if (!theme) {
114
+ return vars;
115
+ }
116
+ const colors = theme.colors;
117
+ if (colors) {
118
+ for (const [key, cssSuffix] of Object.entries(COLOR_KEY_TO_CSS)) {
119
+ const value2 = colors[key];
120
+ if (value2 === void 0) {
121
+ continue;
122
+ }
123
+ if (omitDefaults && value2 === defaultThemeColors[key]) {
124
+ continue;
125
+ }
126
+ vars[`--pptx-${cssSuffix}`] = value2;
127
+ vars[`--color-${cssSuffix}`] = value2;
128
+ }
129
+ for (const { source, cssSuffix } of DERIVED_COLOR_TOKENS) {
130
+ const value2 = colors[source];
131
+ if (value2 === void 0) {
132
+ continue;
133
+ }
134
+ if (omitDefaults && value2 === defaultThemeColors[source]) {
135
+ continue;
136
+ }
137
+ vars[`--pptx-${cssSuffix}`] = value2;
138
+ }
139
+ }
140
+ if (theme.radius !== void 0) {
141
+ if (!omitDefaults || theme.radius !== defaultRadius) {
142
+ vars["--pptx-radius"] = theme.radius;
143
+ const r = theme.radius;
144
+ vars["--radius-sm"] = `calc(${r} - 4px)`;
145
+ vars["--radius-md"] = `calc(${r} - 2px)`;
146
+ vars["--radius-lg"] = r;
147
+ vars["--radius-xl"] = `calc(${r} + 4px)`;
148
+ }
149
+ }
150
+ if (theme.cssVars) {
151
+ for (const [key, value2] of Object.entries(theme.cssVars)) {
152
+ vars[key] = value2;
153
+ }
154
+ }
155
+ return vars;
156
+ }
157
+ function defaultCssVars() {
158
+ const vars = {};
159
+ for (const [key, cssSuffix] of Object.entries(COLOR_KEY_TO_CSS)) {
160
+ vars[`--pptx-${cssSuffix}`] = defaultThemeColors[key];
161
+ }
162
+ for (const { source, cssSuffix } of DERIVED_COLOR_TOKENS) {
163
+ vars[`--pptx-${cssSuffix}`] = defaultThemeColors[source];
164
+ }
165
+ vars["--pptx-radius"] = defaultRadius;
166
+ return vars;
167
+ }
168
+
169
+ // src/pptx/theme/presets.ts
170
+ var vermilionLightColors = {
171
+ background: "#fbfaf7",
172
+ foreground: "#1a1d21",
173
+ card: "#ffffff",
174
+ cardForeground: "#1a1d21",
175
+ popover: "#ffffff",
176
+ popoverForeground: "#1a1d21",
177
+ primary: "#c2431f",
178
+ primaryForeground: "#ffffff",
179
+ secondary: "#f2efe8",
180
+ secondaryForeground: "#1a1d21",
181
+ muted: "#f2efe8",
182
+ mutedForeground: "#5a626e",
183
+ accent: "rgba(194, 67, 31, 0.08)",
184
+ accentForeground: "#1a1d21",
185
+ destructive: "#dc2626",
186
+ destructiveForeground: "#ffffff",
187
+ border: "#e6e2d9",
188
+ input: "#e6e2d9",
189
+ ring: "#c2431f"
190
+ };
191
+ var vermilionDarkColors = {
192
+ background: "#0f1113",
193
+ foreground: "#f0efec",
194
+ card: "#171a1e",
195
+ cardForeground: "#f0efec",
196
+ popover: "#171a1e",
197
+ popoverForeground: "#f0efec",
198
+ primary: "#e86a40",
199
+ primaryForeground: "#ffffff",
200
+ secondary: "#1f242b",
201
+ secondaryForeground: "#f0efec",
202
+ muted: "#1f242b",
203
+ mutedForeground: "#9aa1ab",
204
+ accent: "rgba(232, 106, 64, 0.1)",
205
+ accentForeground: "#f0efec",
206
+ destructive: "#ef4444",
207
+ destructiveForeground: "#ffffff",
208
+ border: "#272c33",
209
+ input: "#272c33",
210
+ ring: "#e86a40"
211
+ };
212
+ var vermilionRadius = "0.375rem";
213
+ var vermilionLightTheme = {
214
+ colors: vermilionLightColors,
215
+ radius: vermilionRadius
216
+ };
217
+ var vermilionDarkTheme = {
218
+ colors: vermilionDarkColors,
219
+ radius: vermilionRadius
220
+ };
221
+
222
+ // src/pptx/theme/theme-catalog.ts
223
+ var THEME_CATALOG = [
224
+ { key: "default", labelKey: "pptx.settings.theme.default", theme: void 0 },
225
+ { key: "light", labelKey: "pptx.settings.theme.light", theme: lightTheme },
226
+ {
227
+ key: "vermilionLight",
228
+ labelKey: "pptx.settings.theme.vermilionLight",
229
+ theme: vermilionLightTheme
230
+ },
231
+ {
232
+ key: "vermilionDark",
233
+ labelKey: "pptx.settings.theme.vermilionDark",
234
+ theme: vermilionDarkTheme
235
+ }
236
+ ];
237
+ function resolveThemeCatalogEntry(key, catalog = THEME_CATALOG) {
238
+ return catalog.find((entry) => entry.key === key)?.theme;
239
+ }
240
+ function corePreset(id) {
241
+ const preset = THEME_PRESETS.find((p) => p.id === id);
242
+ if (!preset) {
243
+ throw new Error(`theme-gallery-presets: core THEME_PRESETS is missing "${id}"`);
244
+ }
245
+ return preset;
246
+ }
247
+ var WISP_PRESET = {
248
+ id: "wisp",
249
+ name: "Wisp",
250
+ colorScheme: {
251
+ dk1: "#000000",
252
+ lt1: "#FFFFFF",
253
+ dk2: "#46393B",
254
+ lt2: "#E8DCD8",
255
+ accent1: "#A53010",
256
+ accent2: "#DE7E18",
257
+ accent3: "#9F8351",
258
+ accent4: "#728653",
259
+ accent5: "#92AA4C",
260
+ accent6: "#6AAC91",
261
+ hlink: "#FB4F14",
262
+ folHlink: "#E25839"
263
+ },
264
+ fontScheme: {
265
+ majorFont: { latin: "Century Gothic" },
266
+ minorFont: { latin: "Century Gothic" }
267
+ }
268
+ };
269
+ var BERLIN_PRESET = {
270
+ id: "berlin",
271
+ name: "Berlin",
272
+ colorScheme: {
273
+ dk1: "#000000",
274
+ lt1: "#FFFFFF",
275
+ dk2: "#3E5C61",
276
+ lt2: "#D5E0D0",
277
+ accent1: "#F09415",
278
+ accent2: "#C1B56B",
279
+ accent3: "#89C2A3",
280
+ accent4: "#729BBE",
281
+ accent5: "#9A90C2",
282
+ accent6: "#BE8DBE",
283
+ hlink: "#25A0DA",
284
+ folHlink: "#FF7F00"
285
+ },
286
+ fontScheme: {
287
+ majorFont: { latin: "Trebuchet MS" },
288
+ minorFont: { latin: "Trebuchet MS" }
289
+ }
290
+ };
291
+ var SLICE_PRESET = {
292
+ id: "slice",
293
+ name: "Slice",
294
+ colorScheme: {
295
+ dk1: "#000000",
296
+ lt1: "#FFFFFF",
297
+ dk2: "#2E3B4C",
298
+ lt2: "#C7CDD3",
299
+ accent1: "#E2751D",
300
+ accent2: "#C53B23",
301
+ accent3: "#A13D69",
302
+ accent4: "#58599E",
303
+ accent5: "#36749D",
304
+ accent6: "#4EA39A",
305
+ hlink: "#FD6B32",
306
+ folHlink: "#D14D0F"
307
+ },
308
+ fontScheme: {
309
+ majorFont: { latin: "Century Gothic" },
310
+ minorFont: { latin: "Century Gothic" }
311
+ }
312
+ };
313
+ var DIVIDEND_PRESET = {
314
+ id: "dividend",
315
+ name: "Dividend",
316
+ colorScheme: {
317
+ dk1: "#000000",
318
+ lt1: "#FFFFFF",
319
+ dk2: "#3D3D3D",
320
+ lt2: "#E1E1E1",
321
+ accent1: "#4D1434",
322
+ accent2: "#903163",
323
+ accent3: "#B2324B",
324
+ accent4: "#D34817",
325
+ accent5: "#E8971C",
326
+ accent6: "#FDCB00",
327
+ hlink: "#A03068",
328
+ folHlink: "#C34882"
329
+ },
330
+ fontScheme: {
331
+ majorFont: { latin: "Gill Sans MT" },
332
+ minorFont: { latin: "Gill Sans MT" }
333
+ }
334
+ };
335
+ var GALLERY_THEME_PRESETS = [
336
+ corePreset("office"),
337
+ corePreset("facet"),
338
+ corePreset("integral"),
339
+ corePreset("ion"),
340
+ corePreset("retrospect"),
341
+ corePreset("organic"),
342
+ WISP_PRESET,
343
+ BERLIN_PRESET,
344
+ SLICE_PRESET,
345
+ DIVIDEND_PRESET
346
+ ];
347
+ function activeGalleryThemePreset(theme) {
348
+ if (!theme) {
349
+ return void 0;
350
+ }
351
+ const colorScheme = theme.colorScheme;
352
+ return colorScheme && GALLERY_THEME_PRESETS.find(
353
+ (preset) => themeColorSchemesEqual(colorScheme, preset.colorScheme)
354
+ ) || GALLERY_THEME_PRESETS.find((preset) => preset.name === theme.name);
355
+ }
356
+
357
+ // src/tokens.ts
358
+ var OFFICE_TOKENS = {
359
+ // Colour: semantic
360
+ "--office-foreground": "#1f2937",
361
+ "--office-muted-foreground": "#6b7280",
362
+ "--office-background": "#ffffff",
363
+ "--office-surface": "#f3f4f6",
364
+ "--office-selected": "#e5e7eb",
365
+ "--office-border": "#d1d5db",
366
+ "--office-accent": "#2563eb",
367
+ "--office-accent-foreground": "#ffffff",
368
+ "--office-ring": "#2563eb",
369
+ "--office-danger": "#b91c1c",
370
+ "--office-danger-foreground": "#ffffff",
371
+ "--office-warning": "#d97706",
372
+ "--office-warning-foreground": "#ffffff",
373
+ "--office-info": "#3b82f6",
374
+ "--office-popover": "var(--office-background, #ffffff)",
375
+ "--office-popover-foreground": "var(--office-foreground, #1f2937)",
376
+ "--office-overlay": "rgb(0 0 0 / 40%)",
377
+ "--office-notice-background": "#fef3c7",
378
+ "--office-notice-foreground": "#78350f",
379
+ "--office-notice-border": "rgb(180 83 9 / 30%)",
380
+ "--office-notice-accent": "#d97706",
381
+ "--office-keytip-background": "#ffffff",
382
+ "--office-keytip-foreground": "#1f1f1f",
383
+ "--office-keytip-border": "#8a8886",
384
+ "--office-highlight": "#dc2626",
385
+ "--office-paper": "#ffffff",
386
+ "--office-accent-hover": "color-mix(in srgb, var(--office-accent, #2563eb) 85%, #000)",
387
+ // Typography
388
+ "--office-font": 'system-ui, -apple-system, "Segoe UI", sans-serif',
389
+ "--office-font-size-3xs": "9px",
390
+ "--office-font-size-2xs": "10px",
391
+ "--office-font-size-xs": "11px",
392
+ "--office-font-size-sm": "12px",
393
+ "--office-font-size": "13px",
394
+ "--office-font-size-md": "14px",
395
+ "--office-font-size-lg": "15px",
396
+ "--office-font-size-xl": "18px",
397
+ /** Smallest text size that keeps mobile browsers from zooming a focused field. */
398
+ "--office-font-size-touch": "16px",
399
+ "--office-font-weight-medium": "500",
400
+ "--office-font-weight-bold": "600",
401
+ "--office-line-height": "1.4",
402
+ "--office-line-height-tight": "1.2",
403
+ "--office-icon-stroke": "1.5",
404
+ // Space
405
+ "--office-space-px": "1px",
406
+ "--office-space-0": "2px",
407
+ "--office-space-1": "4px",
408
+ "--office-space-1-5": "6px",
409
+ "--office-space-2": "8px",
410
+ "--office-space-2-5": "10px",
411
+ "--office-space-3": "12px",
412
+ "--office-space-3-5": "14px",
413
+ "--office-space-4": "16px",
414
+ "--office-space-5": "20px",
415
+ "--office-space-6": "24px",
416
+ // Shape
417
+ "--office-border-width": "1px",
418
+ "--office-border-width-thick": "2px",
419
+ "--office-radius-xs": "2px",
420
+ "--office-radius-sm": "3px",
421
+ "--office-radius": "4px",
422
+ "--office-radius-md": "6px",
423
+ "--office-radius-lg": "8px",
424
+ "--office-radius-full": "999px",
425
+ // Focus
426
+ "--office-focus-width": "2px",
427
+ "--office-focus-offset": "2px",
428
+ // Sizes
429
+ "--office-target-size": "28px",
430
+ "--office-target-size-touch": "44px",
431
+ /** Minimum pointer target on touch layouts. */
432
+ "--office-touch-target": "36px",
433
+ "--office-control-height": "24px",
434
+ "--office-control-height-md": "28px",
435
+ "--office-control-height-lg": "32px",
436
+ "--office-input-height": "26px",
437
+ "--office-control-height-xs": "22px",
438
+ "--office-icon-size-xs": "10px",
439
+ "--office-icon-size-sm": "12px",
440
+ "--office-icon-size": "14px",
441
+ "--office-icon-size-md": "16px",
442
+ "--office-icon-size-ml": "18px",
443
+ "--office-icon-size-lg": "20px",
444
+ // Elevation and layering
445
+ "--office-shadow-sm": "0 1px 3px rgb(0 0 0 / 20%)",
446
+ "--office-shadow": "0 6px 20px rgb(0 0 0 / 18%)",
447
+ "--office-shadow-lg": "0 10px 25px rgb(0 0 0 / 20%)",
448
+ "--office-z-popover": "1100",
449
+ "--office-z-dialog": "1000",
450
+ "--office-z-backstage": "30",
451
+ // Motion
452
+ "--office-duration-fast": ".12s",
453
+ "--office-duration": ".15s",
454
+ "--office-duration-spin": ".8s",
455
+ // Component: fields
456
+ "--office-field-height": "28px",
457
+ "--office-field-height-lg": "40px",
458
+ "--office-field-radius": "5px",
459
+ "--office-field-border": "var(--office-border, #d1d5db)",
460
+ "--office-field-border-focus": "var(--office-ring, #2563eb)",
461
+ "--office-field-background": "var(--office-background, #ffffff)",
462
+ "--office-field-foreground": "var(--office-foreground, #1f2937)",
463
+ "--office-field-placeholder": "var(--office-muted-foreground, #6b7280)",
464
+ // Component: checkbox, radio, switch
465
+ "--office-checkbox-size": "16px",
466
+ "--office-checkbox-size-touch": "22px",
467
+ "--office-checkbox-radius": "3px",
468
+ "--office-checkbox-border": "var(--office-border, #d1d5db)",
469
+ "--office-checkbox-background": "var(--office-background, #ffffff)",
470
+ "--office-checkbox-accent": "var(--office-accent, #2563eb)",
471
+ "--office-checkbox-accent-foreground": "var(--office-accent-foreground, #ffffff)",
472
+ "--office-radio-dot-size": "8px",
473
+ "--office-radio-dot-size-touch": "12px",
474
+ "--office-switch-width": "32px",
475
+ "--office-switch-height": "18px",
476
+ "--office-switch-width-touch": "44px",
477
+ "--office-switch-height-touch": "24px",
478
+ "--office-switch-border-width": "1px",
479
+ "--office-switch-knob-size": "12px",
480
+ "--office-switch-knob-size-touch": "18px",
481
+ "--office-switch-knob-offset": "2px",
482
+ "--office-switch-border": "var(--office-border, #d1d5db)",
483
+ "--office-switch-track": "var(--office-surface, #f3f4f6)",
484
+ "--office-switch-track-on": "var(--office-accent, #2563eb)",
485
+ "--office-switch-thumb": "var(--office-foreground, #1f2937)",
486
+ "--office-switch-thumb-on": "var(--office-accent-foreground, #ffffff)",
487
+ // Component: ribbon, status bar, tabs
488
+ "--office-ribbon-tab-height": "35px",
489
+ "--office-ribbon-contextual": "var(--office-accent, #2563eb)",
490
+ "--office-ribbon-group-gap": "2px",
491
+ "--office-ribbon-group-height": "78px",
492
+ "--office-ribbon-group-padding": "4px 8px 2px",
493
+ "--office-ribbon-separator-inset": "0px",
494
+ "--office-ribbon-separator": "color-mix(in srgb, var(--office-border, #d1d5db) 60%, transparent)",
495
+ "--office-ribbon-caption-size": "10px",
496
+ "--office-ribbon-caption-padding": "2px 0 0",
497
+ "--office-launcher-inset-end": "-6px",
498
+ "--office-launcher-inset-bottom": "-1px",
499
+ "--office-ribbon-compact-row-max": "36px",
500
+ "--office-ribbon-stack-max-height": "80px",
501
+ "--office-ribbon-collapse-x": "8px",
502
+ "--office-ribbon-collapse-y": "120px",
503
+ "--office-command-icon-color": "currentColor",
504
+ "--office-command-large-height": "66px",
505
+ "--office-command-large-min-width": "48px",
506
+ "--office-command-large-max-width": "80px",
507
+ "--office-command-large-icon": "32px",
508
+ "--office-command-small-icon": "16px",
509
+ "--office-command-tall-height": "62px",
510
+ "--office-command-tall-min-width": "40px",
511
+ "--office-command-tall-icon": "30px",
512
+ "--office-command-active": "color-mix(in srgb, var(--office-accent, #2563eb) 15%, transparent)",
513
+ "--office-collapsed-group-min-width": "56px",
514
+ "--office-ribbon-caption-line-height": "12px",
515
+ "--office-ribbon-row-height": "22px",
516
+ "--office-ribbon-file-min-width": "52px",
517
+ "--office-launcher-width": "16px",
518
+ "--office-launcher-height": "14px",
519
+ "--office-tab-indicator-width": "2.5px",
520
+ "--office-status-bar-height": "24px",
521
+ "--office-status-bar-separator-opacity": "1",
522
+ "--office-tab-height": "28px",
523
+ "--office-tab-max-width": "220px",
524
+ "--office-zoom-slider-width": "120px",
525
+ "--office-zoom-slider-min-width": "48px",
526
+ "--office-zoom-value-width": "40px",
527
+ // Component: panels and dialogs
528
+ "--office-dialog-width": "auto",
529
+ "--office-dialog-max-width": "min(640px, 100vw)",
530
+ "--office-dialog-max-height": "90vh",
531
+ "--office-dialog-min-width": "min(320px, 100vw)",
532
+ "--office-dialog-button-min-width": "76px",
533
+ "--office-options-width": "min(728px, 92vw)",
534
+ "--office-options-nav-width": "172px",
535
+ "--office-options-height": "510px",
536
+ "--office-options-chrome-height": "130px",
537
+ "--office-options-text-width": "180px",
538
+ "--office-options-row-height": "30px",
539
+ "--office-options-number-width": "112px",
540
+ "--office-options-check-size": "16px",
541
+ "--office-info-size": "15px",
542
+ "--office-selection-bar-width": "3px",
543
+ "--office-backstage-nav-width": "200px",
544
+ "--office-backstage-nav-background": "var(--office-accent, #2563eb)",
545
+ "--office-backstage-nav-foreground": "var(--office-accent-foreground, #ffffff)",
546
+ "--office-backstage-item-hover": "rgb(0 0 0 / 22%)",
547
+ "--office-backstage-padding": "28px 40px",
548
+ "--office-backstage-back-size": "36px",
549
+ "--office-backstage-item-height": "38px",
550
+ "--office-menu-min-width": "180px",
551
+ "--office-menu-max-height": "60vh",
552
+ "--office-context-menu-min-width": "200px",
553
+ "--office-search-popup-min-width": "240px",
554
+ "--office-search-popup-max-height": "320px",
555
+ "--office-select-max-height": "240px",
556
+ "--office-select-background": "var(--office-background, #ffffff)",
557
+ "--office-select-menu-min-width": "90px",
558
+ "--office-select-option-active": "color-mix(in srgb, var(--office-accent, #2563eb) 20%, var(--office-popover, #ffffff))",
559
+ "--office-select-ribbon-menu-width": "192px",
560
+ "--office-font-picker-max-height": "320px",
561
+ "--office-font-picker-width": "256px",
562
+ "--office-chevron-size": "6px",
563
+ "--office-ribbon-combo-height": "28px",
564
+ "--office-ribbon-icon-select-width": "36px",
565
+ "--office-search-width": "320px",
566
+ "--office-print-preview-width": "420px",
567
+ "--office-find-max-width": "640px",
568
+ "--office-find-bar-height": "40px",
569
+ "--office-find-replace-field-min-width": "120px",
570
+ "--office-find-replace-select-min-width": "150px",
571
+ "--office-ruler-size": "18px",
572
+ "--office-avatar-size": "48px",
573
+ "--office-avatar-color": "var(--office-muted-foreground, #6b7280)",
574
+ "--office-toast-width": "360px",
575
+ "--office-comments-pane-width": "300px",
576
+ "--office-comment-avatar-size": "24px",
577
+ "--office-account-field-width": "320px",
578
+ // Component: galleries
579
+ "--office-gallery-trigger-height": "24px",
580
+ "--office-gallery-strip-background": "color-mix(in srgb, var(--office-surface, #f3f4f6) 30%, transparent)",
581
+ "--office-gallery-command-min-width": "54px",
582
+ "--office-gallery-command-max-width": "78px",
583
+ "--office-gallery-command-height": "58px",
584
+ "--office-gallery-command-icon": "24px",
585
+ "--office-gallery-popup-max-height": "65vh",
586
+ // Component: title bar
587
+ "--office-title-bar-height": "36px",
588
+ "--office-title-bar-below-height": "28px",
589
+ "--office-title-bar-background": "var(--office-surface, #f3f4f6)",
590
+ "--office-title-bar-foreground": "var(--office-foreground, #1f2937)",
591
+ "--office-title-bar-border": "var(--office-border, #d1d5db)",
592
+ "--office-title-bar-mark-size": "20px",
593
+ "--office-title-bar-mark-background": "var(--office-accent, #2563eb)",
594
+ "--office-title-bar-mark-foreground": "var(--office-accent-foreground, #ffffff)",
595
+ "--office-title-bar-name-foreground": "var(--office-title-bar-foreground, var(--office-foreground, #1f2937))",
596
+ "--office-title-bar-result-selected": "var(--office-selected, #e5e7eb)",
597
+ "--office-title-bar-name-max-width": "240px",
598
+ "--office-title-bar-name-max-width-narrow": "140px",
599
+ "--office-title-bar-search-max-width": "448px",
600
+ "--office-title-bar-results-max-height": "256px",
601
+ // Component: team workspace (a Teams-like surface)
602
+ "--office-teams-brand": "#5b5fc7",
603
+ "--office-teams-brand-hover": "#4f52b2",
604
+ "--office-teams-brand-pressed": "#3f4296",
605
+ "--office-teams-brand-subtle": "#e8ebfa",
606
+ "--office-teams-brand-foreground": "#ffffff",
607
+ "--office-teams-rail": "#ebebeb",
608
+ "--office-teams-panel": "#f5f5f5",
609
+ "--office-teams-bubble": "#f5f5f5",
610
+ "--office-teams-bubble-own": "#e8ebfa",
611
+ "--office-teams-divider": "#e0e0e0",
612
+ "--office-teams-text-subtle": "#616161",
613
+ "--office-teams-message-gap": "var(--office-space-3)",
614
+ "--office-teams-message-padding": "var(--office-space-2) var(--office-space-3)",
615
+ "--office-presence-available": "#6bb700",
616
+ "--office-presence-busy": "#c50f1f",
617
+ "--office-presence-away": "#eaa300",
618
+ "--office-presence-offline": "#8a8886",
619
+ "--office-file-docx": "#2b579a",
620
+ "--office-file-xlsx": "#217346",
621
+ "--office-file-pptx": "#c43e1c",
622
+ "--office-file-vsdx": "#3955a3",
623
+ "--office-file-other": "#6b7280",
624
+ "--office-call-background": "#292929",
625
+ "--office-call-tile": "#3d3d3d",
626
+ "--office-call-foreground": "#ffffff",
627
+ "--office-call-muted-foreground": "#c8c8c8",
628
+ "--office-call-control": "#3d3d3d",
629
+ "--office-call-control-hover": "#525252",
630
+ "--office-call-danger": "#c4314b",
631
+ "--office-call-danger-hover": "#a72a40",
632
+ "--office-call-live": "#6bb700",
633
+ "--office-call-scrim": "rgb(0 0 0 / 60%)",
634
+ "--office-shadow-teams": "0 2px 4px rgb(0 0 0 / 14%), 0 0 2px rgb(0 0 0 / 12%)"
635
+ };
636
+ function tok(name) {
637
+ return `var(${name}, ${OFFICE_TOKENS[name]})`;
638
+ }
639
+ `outline: ${tok("--office-focus-width")} solid ${tok("--office-ring")}; outline-offset: ${tok("--office-focus-offset")};`;
640
+ var COMPACT = "(max-width: 767px)";
641
+ var TOUCH = `(pointer: coarse), ${COMPACT}`;
642
+
643
+ // src/theme-bridge.ts
644
+ var LEGACY_OFFICE_THEME_TOKENS = {
645
+ background: "--office-background",
646
+ foreground: "--office-foreground",
647
+ card: "--office-surface",
648
+ "card-foreground": "--office-foreground",
649
+ popover: "--office-popover",
650
+ "popover-foreground": "--office-popover-foreground",
651
+ primary: "--office-accent",
652
+ "primary-foreground": "--office-accent-foreground",
653
+ secondary: "--office-surface",
654
+ "secondary-foreground": "--office-foreground",
655
+ muted: "--office-surface",
656
+ "muted-foreground": "--office-muted-foreground",
657
+ accent: "--office-selected",
658
+ "accent-foreground": "--office-foreground",
659
+ destructive: "--office-danger",
660
+ "destructive-foreground": "--office-danger-foreground",
661
+ border: "--office-border",
662
+ input: "--office-border",
663
+ ring: "--office-ring",
664
+ radius: "--office-radius",
665
+ font: "--office-font"
666
+ };
667
+ function legacyThemeAliases(selector, prefix, privatePrefix) {
668
+ return `${selector} {
669
+ ${Object.entries(LEGACY_OFFICE_THEME_TOKENS).map(
670
+ ([name, canonical]) => `${privatePrefix}${name}: var(${prefix}${name}, var(${canonical}, ${OFFICE_TOKENS[canonical]}));`
671
+ ).join("\n")}
672
+ }`;
673
+ }
674
+ function legacyThemeBridge(selector, privatePrefix) {
675
+ return shadcnBridge(selector, privatePrefix, {
676
+ extra: {
677
+ "--office-font": `var(${privatePrefix}font)`,
678
+ "--office-radius": `var(${privatePrefix}radius)`
679
+ }
680
+ });
681
+ }
682
+ var SHADCN_NAMES = [
683
+ "foreground",
684
+ "muted-foreground",
685
+ "background",
686
+ "card",
687
+ "accent",
688
+ "border",
689
+ "primary",
690
+ "primary-foreground",
691
+ "ring",
692
+ "popover",
693
+ "popover-foreground",
694
+ "destructive",
695
+ "destructive-foreground"
696
+ ].map((name) => {
697
+ const token = LEGACY_OFFICE_THEME_TOKENS[name];
698
+ return name === "popover-foreground" ? [token, name, "foreground"] : [token, name];
699
+ });
700
+ var reads = (value2) => [...value2.matchAll(/var\((--office-[\w-]+)/g)].map((m) => m[1]);
701
+ function derivedTokens(bridged) {
702
+ const derived = /* @__PURE__ */ new Map();
703
+ let grew = true;
704
+ while (grew) {
705
+ grew = false;
706
+ for (const [name, value2] of Object.entries(OFFICE_TOKENS)) {
707
+ if (bridged.has(name) || derived.has(name)) continue;
708
+ if (reads(value2).some((token) => bridged.has(token) || derived.has(token))) {
709
+ derived.set(name, value2);
710
+ grew = true;
711
+ }
712
+ }
713
+ }
714
+ return [...derived];
715
+ }
716
+ function themeBridge(selector, map) {
717
+ const mapped = Object.entries(map).filter((entry) => !!entry[1]);
718
+ const lines = [...mapped, ...derivedTokens(new Set(mapped.map(([name]) => name)))].map(
719
+ ([name, value2]) => ` ${name}: ${value2};`
720
+ );
721
+ return `${selector} {
722
+ ${lines.join("\n")}
723
+ }
724
+ `;
725
+ }
726
+ function shadcnBridge(selector, prefix, options = {}) {
727
+ const map = {};
728
+ for (const [token, name, fallbackName] of SHADCN_NAMES) {
729
+ const fallback = options.fallbacks?.[name];
730
+ const inner = fallbackName ? `var(${prefix}${fallbackName})` : fallback;
731
+ map[token] = `var(${prefix}${name}${inner ? `, ${inner}` : ""})`;
732
+ }
733
+ return themeBridge(selector, { ...map, ...options.extra });
734
+ }
735
+
736
+ // src/building-block-styles.ts
737
+ var value = (name) => `var(${name}, ${OFFICE_TOKENS[name]})`;
738
+ var palette = {
739
+ foreground: "--office-foreground",
740
+ background: "--office-background",
741
+ surface: "--office-surface",
742
+ border: "--office-border",
743
+ accent: "--office-accent",
744
+ selected: "--office-selected",
745
+ ring: "--office-ring",
746
+ font: "--office-font",
747
+ radius: "--office-radius"
748
+ };
749
+ function productAliases(product) {
750
+ const names = product === "visio" ? {
751
+ foreground: "ink",
752
+ background: "surface",
753
+ surface: "surface",
754
+ border: "border",
755
+ accent: "accent",
756
+ selected: "accent-soft",
757
+ ring: "focus",
758
+ font: "font",
759
+ radius: "radius"
760
+ } : {
761
+ foreground: "foreground",
762
+ background: "background",
763
+ surface: "card",
764
+ border: "border",
765
+ accent: "primary",
766
+ selected: "accent",
767
+ ring: "ring",
768
+ font: "font",
769
+ radius: "radius"
770
+ };
771
+ const prefix = { docx: "--dve-", xlsx: "--xve-", visio: "--vv-", pptx: "--pptx-" }[product];
772
+ return `:where([data-office-block][data-office-product="${product}"]) {
773
+ ${Object.entries(palette).map(
774
+ ([key, token]) => `--_office-block-${key}: var(${prefix}${names[key]}, ${value(token)});`
775
+ ).join("\n")}
776
+ }`;
777
+ }
778
+ var BUILDING_BLOCKS_CSS = `
779
+ :where([data-office-block]) {
780
+ ${Object.entries(palette).map(([key, token]) => `--_office-block-${key}: ${value(token)};`).join("\n")}
781
+ box-sizing: border-box;
782
+ color: var(--_office-block-foreground);
783
+ background: var(--_office-block-surface);
784
+ font-family: var(--_office-block-font);
785
+ font-size: ${value("--office-font-size")};
786
+ line-height: ${value("--office-line-height")};
787
+ }
788
+ ${["docx", "xlsx", "visio", "pptx"].map(productAliases).join("\n")}
789
+ :where([data-office-block="toolbar"], [data-office-block="formula-bar"], [data-office-block="tabs"]:not(select)) {
790
+ display: flex;
791
+ flex-wrap: wrap;
792
+ align-items: center;
793
+ gap: ${value("--office-space-1")};
794
+ padding: ${value("--office-space-1")};
795
+ border: ${value("--office-border-width")} solid var(--_office-block-border);
796
+ border-radius: var(--_office-block-radius);
797
+ }
798
+ :where([data-office-block] button, [data-office-block] input, [data-office-block] select,
799
+ button[data-office-block], input[data-office-block], select[data-office-block]) {
800
+ box-sizing: border-box;
801
+ font-family: var(--_office-block-font);
802
+ font-size: ${value("--office-font-size")};
803
+ line-height: ${value("--office-line-height")};
804
+ color: var(--_office-block-foreground);
805
+ background: var(--_office-block-background);
806
+ border: ${value("--office-border-width")} solid var(--_office-block-border);
807
+ border-radius: var(--_office-block-radius);
808
+ min-height: ${value("--office-target-size")};
809
+ padding: ${value("--office-space-1")} ${value("--office-space-2")};
810
+ }
811
+ :where([data-office-block] button, button[data-office-block]) { cursor: pointer; }
812
+ :where([data-office-block] button:hover:not(:disabled)) { background: var(--_office-block-selected); }
813
+ :where([data-office-block] [aria-pressed="true"], [data-office-block] [aria-pressed="mixed"],
814
+ [data-office-block] [aria-selected="true"]) {
815
+ background: var(--_office-block-selected);
816
+ border-color: var(--_office-block-accent);
817
+ }
818
+ :where([data-office-block] :focus-visible, [data-office-block]:focus-visible) {
819
+ outline: ${value("--office-focus-width")} solid var(--_office-block-ring);
820
+ outline-offset: ${value("--office-focus-offset")};
821
+ }
822
+ :where([data-office-block] :disabled, [data-office-block]:disabled) { opacity: .55; cursor: default; }
823
+ :where([data-office-block] [aria-invalid="true"]) { border-color: ${value("--office-danger")}; }
824
+ :where([data-office-block="formula-bar"] input:last-child) { flex: 1; min-width: 8em; }
825
+ :where([data-office-block="inspector"]) { padding: ${value("--office-space-2")}; }
826
+ :where([data-office-block="inspector"] dl) { display: grid; grid-template-columns: auto 1fr; gap: ${value("--office-space-1")}; }
827
+ :where([data-office-block="inspector"] dt) { font-weight: ${value("--office-font-weight-bold")}; }
828
+ :where([data-office-block="inspector"] dd) { margin: 0; overflow-wrap: anywhere; }
829
+ :where([data-office-block="inspector"] a) { color: var(--_office-block-accent); }
830
+ `;
831
+
832
+ // src/theme.ts
833
+ var THEME_STYLE_ID = "office-ui-theme";
834
+ var DARK = `
835
+ --office-foreground: #f9fafb;
836
+ --office-muted-foreground: #9ca3af;
837
+ --office-background: #111827;
838
+ --office-surface: #1f2937;
839
+ --office-border: #374151;
840
+ --office-accent: #6366f1;
841
+ --office-ring: #818cf8;
842
+ --office-danger: #f87171;
843
+ --office-selected: #374151;
844
+ --office-notice-background: rgb(120 53 15 / 20%);
845
+ --office-notice-foreground: #fde68a;
846
+ --office-notice-accent: #fbbf24;
847
+ --office-info: #60a5fa;
848
+ --office-warning: #f59e0b;
849
+ --office-teams-brand: #7f85f5;
850
+ --office-teams-brand-hover: #96a0ff;
851
+ --office-teams-brand-subtle: #2f2f4a;
852
+ --office-teams-rail: #141414;
853
+ --office-teams-panel: #1f1f1f;
854
+ --office-teams-bubble: #2d2d2d;
855
+ --office-teams-bubble-own: #2f2f4a;
856
+ --office-teams-divider: #3d3d3d;
857
+ --office-teams-text-subtle: #adadad;
858
+ --office-shadow: 0 6px 20px rgb(0 0 0 / 45%);
859
+ --office-shadow-lg: 0 10px 25px rgb(0 0 0 / 45%);`;
860
+ var LIGHT = Object.entries(OFFICE_TOKENS).map(([name, value2]) => ` ${name}: ${value2};`).join("\n");
861
+ var darkEntries = [...DARK.matchAll(/(--office-[\w-]+): ([^;]+);/g)].map(
862
+ (match) => [match[1], match[2]]
863
+ );
864
+ var lightPalette = Object.fromEntries(
865
+ darkEntries.map(([name]) => [name, OFFICE_TOKENS[name]])
866
+ );
867
+ var darkPalette = Object.fromEntries(darkEntries);
868
+ var modeCss = (selector, dark) => themeBridge(selector, {
869
+ ...lightPalette,
870
+ ...dark ? darkPalette : {},
871
+ "--office-accent-foreground": OFFICE_TOKENS["--office-accent-foreground"]
872
+ }) + `${selector} { color-scheme: ${dark ? "dark" : "light"}; }`;
873
+ var THEME_CSS = `
874
+ :where(:root) {
875
+ ${LIGHT}
876
+ color-scheme: light;
877
+ }
878
+ ${modeCss(':where([data-office-theme="light"], [data-office-theme="auto"])', false)}
879
+ ${modeCss(':where([data-office-theme="dark"])', true)}
880
+ @media (prefers-color-scheme: dark) {
881
+ ${modeCss(':where(:root:not([data-office-theme="light"]), [data-office-theme="auto"])', true)}
882
+ }
883
+ @media ${TOUCH} {
884
+ :where(:root) { --office-target-size: var(--office-target-size-touch); }
885
+ }
886
+ @media (forced-colors: active) {
887
+ :where(:root, [data-office-theme]) {
888
+ --office-foreground: CanvasText;
889
+ --office-muted-foreground: GrayText;
890
+ --office-background: Canvas;
891
+ --office-surface: Canvas;
892
+ --office-border: CanvasText;
893
+ --office-accent: Highlight;
894
+ --office-accent-foreground: HighlightText;
895
+ --office-ring: Highlight;
896
+ --office-danger: CanvasText;
897
+ }
898
+ }
899
+ ${BUILDING_BLOCKS_CSS}
900
+ `;
901
+ function installOfficeUiTheme(root = globalThis.document) {
902
+ if (!root) return false;
903
+ const documentRoot = root.nodeType === 9;
904
+ if (!documentRoot && !("host" in root)) return false;
905
+ const doc = documentRoot ? root : root.ownerDocument;
906
+ const container = documentRoot ? root.head : root;
907
+ if (!doc || !container) return false;
908
+ if (!root.getElementById(THEME_STYLE_ID)) {
909
+ const style = doc.createElement("style");
910
+ style.id = THEME_STYLE_ID;
911
+ style.textContent = THEME_CSS;
912
+ container.append(style);
913
+ }
914
+ return true;
915
+ }
916
+ function installOfficeUiThemeRoots(host) {
917
+ let installed = installOfficeUiTheme(host.ownerDocument);
918
+ let root = host.getRootNode();
919
+ while (root.nodeType === 11 && "host" in root) {
920
+ const shadow = root;
921
+ installed = installOfficeUiTheme(shadow) && installed;
922
+ root = shadow.host.getRootNode();
923
+ }
924
+ return installed;
925
+ }
926
+ function installOfficeUiThemeFor(host) {
927
+ const installed = installOfficeUiThemeRoots(host);
928
+ queueMicrotask(() => {
929
+ installOfficeUiThemeRoots(host);
930
+ });
931
+ return installed;
932
+ }
933
+
934
+ // src/pptx/theme/office-css.ts
935
+ var MARKER = "/* ooxml-pptx-office-theme */";
936
+ function withOfficeThemeCss(css, selector) {
937
+ if (css.includes(MARKER)) return css;
938
+ function reference(value2, start) {
939
+ let depth = 1, end = start + 4;
940
+ for (; end < value2.length && depth; end++) {
941
+ if (value2[end] === "(") depth++;
942
+ else if (value2[end] === ")") depth--;
943
+ }
944
+ if (depth) return void 0;
945
+ const body = value2.slice(start + 4, end - 1);
946
+ const comma = body.indexOf(",");
947
+ return {
948
+ name: (comma < 0 ? body : body.slice(0, comma)).trim(),
949
+ fallback: comma < 0 ? "" : body.slice(comma + 1).trim(),
950
+ end
951
+ };
952
+ }
953
+ function rewrite(value2) {
954
+ let result = "", cursor = 0;
955
+ while (cursor < value2.length) {
956
+ const start = value2.indexOf("var(", cursor);
957
+ if (start < 0) return result + value2.slice(cursor);
958
+ const current = reference(value2, start);
959
+ if (!current) return result + value2.slice(cursor);
960
+ result += value2.slice(cursor, start);
961
+ const key = current.name.slice("--pptx-".length);
962
+ if (current.name.startsWith("--pptx-") && key in LEGACY_OFFICE_THEME_TOKENS) {
963
+ const names = [current.name];
964
+ let fallback = current.fallback;
965
+ while (fallback.startsWith("var(")) {
966
+ const next = reference(fallback, 0);
967
+ if (!next || next.end !== fallback.length || !next.name.startsWith("--pptx-") || !(next.name.slice(7) in LEGACY_OFFICE_THEME_TOKENS))
968
+ break;
969
+ names.push(next.name);
970
+ fallback = next.fallback;
971
+ }
972
+ const canonical = `var(--_pptx-${key}${fallback ? ", " + rewrite(fallback) : ""})`;
973
+ result += names.length > 1 ? names.reduceRight((inner, name) => `var(${name}, ${inner})`, canonical) : canonical;
974
+ } else
975
+ result += `var(${current.name}${current.fallback ? ", " + rewrite(current.fallback) : ""})`;
976
+ cursor = current.end;
977
+ }
978
+ return result;
979
+ }
980
+ return `${MARKER}
981
+ ${legacyThemeAliases(selector, "--pptx-", "--_pptx-")}
982
+ ${rewrite(css)}`;
983
+ }
984
+ function pptxThemeValue(name) {
985
+ const token = LEGACY_OFFICE_THEME_TOKENS[name];
986
+ return `var(--pptx-${name}, var(${token}, ${OFFICE_TOKENS[token]}))`;
987
+ }
988
+
989
+ export { GALLERY_THEME_PRESETS, LEGACY_OFFICE_THEME_TOKENS, OFFICE_TOKENS, THEME_CATALOG, TOUCH, activeGalleryThemePreset, defaultCssVars, defaultRadius, defaultThemeColors, installOfficeUiTheme, installOfficeUiThemeFor, legacyThemeBridge, lightTheme, lightThemeColors, pptxThemeValue, resolveThemeCatalogEntry, themeToCssVars, tok, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius, withOfficeThemeCss };