@cuppacue/cli 0.1.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 (247) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +85 -0
  3. package/dist/ai/__tests__/generate.test.d.ts +2 -0
  4. package/dist/ai/__tests__/generate.test.d.ts.map +1 -0
  5. package/dist/ai/__tests__/generate.test.js +129 -0
  6. package/dist/ai/__tests__/generate.test.js.map +1 -0
  7. package/dist/ai/__tests__/images.test.d.ts +2 -0
  8. package/dist/ai/__tests__/images.test.d.ts.map +1 -0
  9. package/dist/ai/__tests__/images.test.js +186 -0
  10. package/dist/ai/__tests__/images.test.js.map +1 -0
  11. package/dist/ai/__tests__/prompt.test.d.ts +2 -0
  12. package/dist/ai/__tests__/prompt.test.d.ts.map +1 -0
  13. package/dist/ai/__tests__/prompt.test.js +98 -0
  14. package/dist/ai/__tests__/prompt.test.js.map +1 -0
  15. package/dist/ai/__tests__/refine.test.d.ts +2 -0
  16. package/dist/ai/__tests__/refine.test.d.ts.map +1 -0
  17. package/dist/ai/__tests__/refine.test.js +87 -0
  18. package/dist/ai/__tests__/refine.test.js.map +1 -0
  19. package/dist/ai/client.d.ts +4 -0
  20. package/dist/ai/client.d.ts.map +1 -0
  21. package/dist/ai/client.js +36 -0
  22. package/dist/ai/client.js.map +1 -0
  23. package/dist/ai/example.d.ts +6 -0
  24. package/dist/ai/example.d.ts.map +1 -0
  25. package/dist/ai/example.js +284 -0
  26. package/dist/ai/example.js.map +1 -0
  27. package/dist/ai/generate.d.ts +15 -0
  28. package/dist/ai/generate.d.ts.map +1 -0
  29. package/dist/ai/generate.js +120 -0
  30. package/dist/ai/generate.js.map +1 -0
  31. package/dist/ai/images.d.ts +8 -0
  32. package/dist/ai/images.d.ts.map +1 -0
  33. package/dist/ai/images.js +71 -0
  34. package/dist/ai/images.js.map +1 -0
  35. package/dist/ai/index.d.ts +7 -0
  36. package/dist/ai/index.d.ts.map +1 -0
  37. package/dist/ai/index.js +7 -0
  38. package/dist/ai/index.js.map +1 -0
  39. package/dist/ai/prompt.d.ts +10 -0
  40. package/dist/ai/prompt.d.ts.map +1 -0
  41. package/dist/ai/prompt.js +119 -0
  42. package/dist/ai/prompt.js.map +1 -0
  43. package/dist/ai/refine.d.ts +6 -0
  44. package/dist/ai/refine.d.ts.map +1 -0
  45. package/dist/ai/refine.js +22 -0
  46. package/dist/ai/refine.js.map +1 -0
  47. package/dist/ai/schema.d.ts +5 -0
  48. package/dist/ai/schema.d.ts.map +1 -0
  49. package/dist/ai/schema.js +292 -0
  50. package/dist/ai/schema.js.map +1 -0
  51. package/dist/commands/__tests__/backstage.test.d.ts +2 -0
  52. package/dist/commands/__tests__/backstage.test.d.ts.map +1 -0
  53. package/dist/commands/__tests__/backstage.test.js +45 -0
  54. package/dist/commands/__tests__/backstage.test.js.map +1 -0
  55. package/dist/commands/__tests__/export.test.d.ts +2 -0
  56. package/dist/commands/__tests__/export.test.d.ts.map +1 -0
  57. package/dist/commands/__tests__/export.test.js +50 -0
  58. package/dist/commands/__tests__/export.test.js.map +1 -0
  59. package/dist/commands/ai.d.ts +2 -0
  60. package/dist/commands/ai.d.ts.map +1 -0
  61. package/dist/commands/ai.js +113 -0
  62. package/dist/commands/ai.js.map +1 -0
  63. package/dist/commands/build.d.ts +2 -0
  64. package/dist/commands/build.d.ts.map +1 -0
  65. package/dist/commands/build.js +121 -0
  66. package/dist/commands/build.js.map +1 -0
  67. package/dist/commands/export-pdf.d.ts +9 -0
  68. package/dist/commands/export-pdf.d.ts.map +1 -0
  69. package/dist/commands/export-pdf.js +109 -0
  70. package/dist/commands/export-pdf.js.map +1 -0
  71. package/dist/commands/export.d.ts +2 -0
  72. package/dist/commands/export.d.ts.map +1 -0
  73. package/dist/commands/export.js +147 -0
  74. package/dist/commands/export.js.map +1 -0
  75. package/dist/commands/init.d.ts +2 -0
  76. package/dist/commands/init.d.ts.map +1 -0
  77. package/dist/commands/init.js +54 -0
  78. package/dist/commands/init.js.map +1 -0
  79. package/dist/commands/preview.d.ts +2 -0
  80. package/dist/commands/preview.d.ts.map +1 -0
  81. package/dist/commands/preview.js +78 -0
  82. package/dist/commands/preview.js.map +1 -0
  83. package/dist/commands/serve.d.ts +7 -0
  84. package/dist/commands/serve.d.ts.map +1 -0
  85. package/dist/commands/serve.js +773 -0
  86. package/dist/commands/serve.js.map +1 -0
  87. package/dist/commands/validate.d.ts +2 -0
  88. package/dist/commands/validate.d.ts.map +1 -0
  89. package/dist/commands/validate.js +39 -0
  90. package/dist/commands/validate.js.map +1 -0
  91. package/dist/github/__tests__/fetcher.test.d.ts +2 -0
  92. package/dist/github/__tests__/fetcher.test.d.ts.map +1 -0
  93. package/dist/github/__tests__/fetcher.test.js +102 -0
  94. package/dist/github/__tests__/fetcher.test.js.map +1 -0
  95. package/dist/github/__tests__/rewrite-images.test.d.ts +2 -0
  96. package/dist/github/__tests__/rewrite-images.test.d.ts.map +1 -0
  97. package/dist/github/__tests__/rewrite-images.test.js +79 -0
  98. package/dist/github/__tests__/rewrite-images.test.js.map +1 -0
  99. package/dist/github/__tests__/url-parser.test.d.ts +2 -0
  100. package/dist/github/__tests__/url-parser.test.d.ts.map +1 -0
  101. package/dist/github/__tests__/url-parser.test.js +96 -0
  102. package/dist/github/__tests__/url-parser.test.js.map +1 -0
  103. package/dist/github/fetcher.d.ts +10 -0
  104. package/dist/github/fetcher.d.ts.map +1 -0
  105. package/dist/github/fetcher.js +53 -0
  106. package/dist/github/fetcher.js.map +1 -0
  107. package/dist/github/index.d.ts +5 -0
  108. package/dist/github/index.d.ts.map +1 -0
  109. package/dist/github/index.js +4 -0
  110. package/dist/github/index.js.map +1 -0
  111. package/dist/github/rewrite-images.d.ts +7 -0
  112. package/dist/github/rewrite-images.d.ts.map +1 -0
  113. package/dist/github/rewrite-images.js +26 -0
  114. package/dist/github/rewrite-images.js.map +1 -0
  115. package/dist/github/url-parser.d.ts +12 -0
  116. package/dist/github/url-parser.d.ts.map +1 -0
  117. package/dist/github/url-parser.js +60 -0
  118. package/dist/github/url-parser.js.map +1 -0
  119. package/dist/index.d.ts +3 -0
  120. package/dist/index.d.ts.map +1 -0
  121. package/dist/index.js +95 -0
  122. package/dist/index.js.map +1 -0
  123. package/dist/markdown/__tests__/auto-slide.test.d.ts +2 -0
  124. package/dist/markdown/__tests__/auto-slide.test.d.ts.map +1 -0
  125. package/dist/markdown/__tests__/auto-slide.test.js +325 -0
  126. package/dist/markdown/__tests__/auto-slide.test.js.map +1 -0
  127. package/dist/markdown/__tests__/compiler.test.d.ts +2 -0
  128. package/dist/markdown/__tests__/compiler.test.d.ts.map +1 -0
  129. package/dist/markdown/__tests__/compiler.test.js +142 -0
  130. package/dist/markdown/__tests__/compiler.test.js.map +1 -0
  131. package/dist/markdown/__tests__/custom-parsers.test.d.ts +2 -0
  132. package/dist/markdown/__tests__/custom-parsers.test.d.ts.map +1 -0
  133. package/dist/markdown/__tests__/custom-parsers.test.js +182 -0
  134. package/dist/markdown/__tests__/custom-parsers.test.js.map +1 -0
  135. package/dist/markdown/__tests__/frontmatter.test.d.ts +2 -0
  136. package/dist/markdown/__tests__/frontmatter.test.d.ts.map +1 -0
  137. package/dist/markdown/__tests__/frontmatter.test.js +162 -0
  138. package/dist/markdown/__tests__/frontmatter.test.js.map +1 -0
  139. package/dist/markdown/__tests__/layout.test.d.ts +2 -0
  140. package/dist/markdown/__tests__/layout.test.d.ts.map +1 -0
  141. package/dist/markdown/__tests__/layout.test.js +85 -0
  142. package/dist/markdown/__tests__/layout.test.js.map +1 -0
  143. package/dist/markdown/__tests__/parser.test.d.ts +2 -0
  144. package/dist/markdown/__tests__/parser.test.d.ts.map +1 -0
  145. package/dist/markdown/__tests__/parser.test.js +646 -0
  146. package/dist/markdown/__tests__/parser.test.js.map +1 -0
  147. package/dist/markdown/__tests__/timesheet-gen.test.d.ts +2 -0
  148. package/dist/markdown/__tests__/timesheet-gen.test.d.ts.map +1 -0
  149. package/dist/markdown/__tests__/timesheet-gen.test.js +90 -0
  150. package/dist/markdown/__tests__/timesheet-gen.test.js.map +1 -0
  151. package/dist/markdown/auto-slide.d.ts +16 -0
  152. package/dist/markdown/auto-slide.d.ts.map +1 -0
  153. package/dist/markdown/auto-slide.js +144 -0
  154. package/dist/markdown/auto-slide.js.map +1 -0
  155. package/dist/markdown/compiler.d.ts +12 -0
  156. package/dist/markdown/compiler.d.ts.map +1 -0
  157. package/dist/markdown/compiler.js +47 -0
  158. package/dist/markdown/compiler.js.map +1 -0
  159. package/dist/markdown/custom-parsers.d.ts +69 -0
  160. package/dist/markdown/custom-parsers.d.ts.map +1 -0
  161. package/dist/markdown/custom-parsers.js +227 -0
  162. package/dist/markdown/custom-parsers.js.map +1 -0
  163. package/dist/markdown/frontmatter.d.ts +33 -0
  164. package/dist/markdown/frontmatter.d.ts.map +1 -0
  165. package/dist/markdown/frontmatter.js +83 -0
  166. package/dist/markdown/frontmatter.js.map +1 -0
  167. package/dist/markdown/id.d.ts +4 -0
  168. package/dist/markdown/id.d.ts.map +1 -0
  169. package/dist/markdown/id.js +15 -0
  170. package/dist/markdown/id.js.map +1 -0
  171. package/dist/markdown/index.d.ts +8 -0
  172. package/dist/markdown/index.d.ts.map +1 -0
  173. package/dist/markdown/index.js +6 -0
  174. package/dist/markdown/index.js.map +1 -0
  175. package/dist/markdown/parser.d.ts +35 -0
  176. package/dist/markdown/parser.d.ts.map +1 -0
  177. package/dist/markdown/parser.js +605 -0
  178. package/dist/markdown/parser.js.map +1 -0
  179. package/dist/markdown/timesheet-gen.d.ts +6 -0
  180. package/dist/markdown/timesheet-gen.d.ts.map +1 -0
  181. package/dist/markdown/timesheet-gen.js +223 -0
  182. package/dist/markdown/timesheet-gen.js.map +1 -0
  183. package/dist/player/CuePlayer.d.ts +58 -0
  184. package/dist/player/CuePlayer.d.ts.map +1 -0
  185. package/dist/player/NavBar.d.ts +31 -0
  186. package/dist/player/NavBar.d.ts.map +1 -0
  187. package/dist/player/PresenterView.d.ts +25 -0
  188. package/dist/player/PresenterView.d.ts.map +1 -0
  189. package/dist/player/SlideOverview.d.ts +16 -0
  190. package/dist/player/SlideOverview.d.ts.map +1 -0
  191. package/dist/player/__mocks__/chart.d.ts +29 -0
  192. package/dist/player/__mocks__/chart.d.ts.map +1 -0
  193. package/dist/player/__mocks__/mermaid.d.ts +8 -0
  194. package/dist/player/__mocks__/mermaid.d.ts.map +1 -0
  195. package/dist/player/__tests__/animator.test.d.ts +2 -0
  196. package/dist/player/__tests__/animator.test.d.ts.map +1 -0
  197. package/dist/player/__tests__/layout.test.d.ts +2 -0
  198. package/dist/player/__tests__/layout.test.d.ts.map +1 -0
  199. package/dist/player/__tests__/overview.test.d.ts +2 -0
  200. package/dist/player/__tests__/overview.test.d.ts.map +1 -0
  201. package/dist/player/__tests__/timeline.test.d.ts +2 -0
  202. package/dist/player/__tests__/timeline.test.d.ts.map +1 -0
  203. package/dist/player/animator.d.ts +4 -0
  204. package/dist/player/animator.d.ts.map +1 -0
  205. package/dist/player/cuppacue-player.css +1 -0
  206. package/dist/player/cuppacue-player.js +3247 -0
  207. package/dist/player/index.d.ts +14 -0
  208. package/dist/player/index.d.ts.map +1 -0
  209. package/dist/player/loader.d.ts +3 -0
  210. package/dist/player/loader.d.ts.map +1 -0
  211. package/dist/player/main.d.ts +2 -0
  212. package/dist/player/main.d.ts.map +1 -0
  213. package/dist/player/navigator.d.ts +27 -0
  214. package/dist/player/navigator.d.ts.map +1 -0
  215. package/dist/player/renderer.d.ts +9 -0
  216. package/dist/player/renderer.d.ts.map +1 -0
  217. package/dist/player/renderers/cards.d.ts +3 -0
  218. package/dist/player/renderers/cards.d.ts.map +1 -0
  219. package/dist/player/renderers/chart.d.ts +3 -0
  220. package/dist/player/renderers/chart.d.ts.map +1 -0
  221. package/dist/player/renderers/icons.d.ts +6 -0
  222. package/dist/player/renderers/icons.d.ts.map +1 -0
  223. package/dist/player/renderers/mermaid.d.ts +3 -0
  224. package/dist/player/renderers/mermaid.d.ts.map +1 -0
  225. package/dist/player/renderers/stats.d.ts +3 -0
  226. package/dist/player/renderers/stats.d.ts.map +1 -0
  227. package/dist/player/renderers/terminal.d.ts +3 -0
  228. package/dist/player/renderers/terminal.d.ts.map +1 -0
  229. package/dist/player/themes/dark.d.ts +2 -0
  230. package/dist/player/themes/dark.d.ts.map +1 -0
  231. package/dist/player/themes/light.d.ts +2 -0
  232. package/dist/player/themes/light.d.ts.map +1 -0
  233. package/dist/player/timeline.d.ts +43 -0
  234. package/dist/player/timeline.d.ts.map +1 -0
  235. package/dist/serve.d.ts +2 -0
  236. package/dist/serve.d.ts.map +1 -0
  237. package/dist/serve.js +171 -0
  238. package/dist/serve.js.map +1 -0
  239. package/dist/templates/discover.d.ts +20 -0
  240. package/dist/templates/discover.d.ts.map +1 -0
  241. package/dist/templates/discover.js +86 -0
  242. package/dist/templates/discover.js.map +1 -0
  243. package/dist/templates/loader.d.ts +17 -0
  244. package/dist/templates/loader.d.ts.map +1 -0
  245. package/dist/templates/loader.js +40 -0
  246. package/dist/templates/loader.js.map +1 -0
  247. package/package.json +62 -0
@@ -0,0 +1,3247 @@
1
+ var Me = Object.defineProperty;
2
+ var Ne = (t, e, a) => e in t ? Me(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
3
+ var f = (t, e, a) => Ne(t, typeof e != "symbol" ? e + "" : e, a);
4
+ const ve = {
5
+ name: "default",
6
+ fonts: {
7
+ heading: "'Inter', system-ui, sans-serif",
8
+ body: "'Inter', system-ui, sans-serif",
9
+ code: "'JetBrains Mono', 'Fira Code', monospace"
10
+ },
11
+ typography: {
12
+ title: { fontSize: "3.5rem", fontWeight: "700", lineHeight: "1.2" },
13
+ subtitle: { fontSize: "1.5rem", fontWeight: "400", lineHeight: "1.5" },
14
+ heading: { fontSize: "2.25rem", fontWeight: "600", lineHeight: "1.3" },
15
+ body: { fontSize: "1.25rem", fontWeight: "400", lineHeight: "1.5" },
16
+ caption: { fontSize: "1rem", fontWeight: "400", lineHeight: "1.5" }
17
+ }
18
+ }, Ie = {
19
+ name: "elegant",
20
+ fonts: {
21
+ heading: "'Playfair Display', Georgia, serif",
22
+ body: "'Lato', system-ui, sans-serif",
23
+ code: "'JetBrains Mono', 'Fira Code', monospace"
24
+ },
25
+ typography: {
26
+ title: { fontSize: "4rem", fontWeight: "700", lineHeight: "1.1", letterSpacing: "-0.02em" },
27
+ subtitle: { fontSize: "1.4rem", fontWeight: "300", lineHeight: "1.6", letterSpacing: "0.02em" },
28
+ heading: { fontSize: "2.5rem", fontWeight: "600", lineHeight: "1.2", letterSpacing: "-0.01em" },
29
+ body: { fontSize: "1.2rem", fontWeight: "400", lineHeight: "1.8" },
30
+ caption: { fontSize: "0.95rem", fontWeight: "300", lineHeight: "1.5", letterSpacing: "0.03em" }
31
+ },
32
+ fontImports: [
33
+ "https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Lato:wght@300;400;700&display=swap"
34
+ ]
35
+ }, Le = {
36
+ name: "minimal",
37
+ fonts: {
38
+ heading: "'Inter', system-ui, sans-serif",
39
+ body: "'Inter', system-ui, sans-serif",
40
+ code: "'JetBrains Mono', 'Fira Code', monospace"
41
+ },
42
+ typography: {
43
+ title: { fontSize: "3rem", fontWeight: "300", lineHeight: "1.3", letterSpacing: "0.02em" },
44
+ subtitle: { fontSize: "1.3rem", fontWeight: "300", lineHeight: "1.6", letterSpacing: "0.03em" },
45
+ heading: { fontSize: "2rem", fontWeight: "400", lineHeight: "1.4", letterSpacing: "0.01em" },
46
+ body: { fontSize: "1.1rem", fontWeight: "300", lineHeight: "1.8", letterSpacing: "0.01em" },
47
+ caption: { fontSize: "0.9rem", fontWeight: "300", lineHeight: "1.5", letterSpacing: "0.04em" }
48
+ }
49
+ }, ze = {
50
+ name: "bold",
51
+ fonts: {
52
+ heading: "'Inter', system-ui, sans-serif",
53
+ body: "'Inter', system-ui, sans-serif",
54
+ code: "'JetBrains Mono', 'Fira Code', monospace"
55
+ },
56
+ typography: {
57
+ title: { fontSize: "4rem", fontWeight: "800", lineHeight: "1.1", letterSpacing: "-0.03em" },
58
+ subtitle: { fontSize: "1.5rem", fontWeight: "500", lineHeight: "1.4" },
59
+ heading: { fontSize: "2.5rem", fontWeight: "700", lineHeight: "1.2", letterSpacing: "-0.02em" },
60
+ body: { fontSize: "1.3rem", fontWeight: "500", lineHeight: "1.6" },
61
+ caption: { fontSize: "1rem", fontWeight: "500", lineHeight: "1.4", textTransform: "uppercase", letterSpacing: "0.05em" }
62
+ }
63
+ }, Pe = {
64
+ default: ve,
65
+ elegant: Ie,
66
+ minimal: Le,
67
+ bold: ze
68
+ };
69
+ function ae(t) {
70
+ return Pe[t] ?? ve;
71
+ }
72
+ const He = {
73
+ name: "dark",
74
+ colors: {
75
+ background: "#0f172a",
76
+ foreground: "#e2e8f0",
77
+ primary: "#38bdf8",
78
+ secondary: "#a78bfa",
79
+ accent: "#f472b6",
80
+ codeBackground: "#1e293b",
81
+ codeForeground: "#e2e8f0"
82
+ },
83
+ fonts: {
84
+ heading: "'Inter', system-ui, sans-serif",
85
+ body: "'Inter', system-ui, sans-serif",
86
+ code: "'JetBrains Mono', 'Fira Code', monospace"
87
+ },
88
+ codeTheme: "vitesse-dark"
89
+ }, Be = {
90
+ name: "light",
91
+ colors: {
92
+ background: "#ffffff",
93
+ foreground: "#1e293b",
94
+ primary: "#0284c7",
95
+ secondary: "#7c3aed",
96
+ accent: "#db2777",
97
+ codeBackground: "#f1f5f9",
98
+ codeForeground: "#1e293b"
99
+ },
100
+ fonts: {
101
+ heading: "'Inter', system-ui, sans-serif",
102
+ body: "'Inter', system-ui, sans-serif",
103
+ code: "'JetBrains Mono', 'Fira Code', monospace"
104
+ },
105
+ codeTheme: "vitesse-light"
106
+ }, se = ae("minimal"), De = {
107
+ name: "minimal",
108
+ colors: {
109
+ background: "#fafafa",
110
+ foreground: "#374151",
111
+ primary: "#6b7280",
112
+ secondary: "#9ca3af",
113
+ accent: "#374151",
114
+ codeBackground: "#f3f4f6",
115
+ codeForeground: "#374151"
116
+ },
117
+ fonts: se.fonts,
118
+ typography: se.typography,
119
+ codeTheme: "vitesse-light"
120
+ }, je = {
121
+ name: "corporate",
122
+ colors: {
123
+ background: "#ffffff",
124
+ foreground: "#1f2937",
125
+ primary: "#1d4ed8",
126
+ secondary: "#4b5563",
127
+ accent: "#dc2626",
128
+ codeBackground: "#f8fafc",
129
+ codeForeground: "#1e293b"
130
+ },
131
+ fonts: {
132
+ heading: "'Inter', system-ui, sans-serif",
133
+ body: "'Inter', system-ui, sans-serif",
134
+ code: "'JetBrains Mono', 'Fira Code', monospace"
135
+ },
136
+ typography: {
137
+ title: { fontSize: "3.5rem", fontWeight: "700", lineHeight: "1.2" },
138
+ subtitle: { fontSize: "1.4rem", fontWeight: "400", lineHeight: "1.5", letterSpacing: "0.01em" },
139
+ heading: { fontSize: "2.25rem", fontWeight: "600", lineHeight: "1.3" },
140
+ body: { fontSize: "1.15rem", fontWeight: "400", lineHeight: "1.7" },
141
+ caption: { fontSize: "0.95rem", fontWeight: "400", lineHeight: "1.5", textTransform: "uppercase", letterSpacing: "0.04em" }
142
+ },
143
+ codeTheme: "vitesse-light"
144
+ }, X = ae("elegant"), Fe = {
145
+ name: "elegant",
146
+ colors: {
147
+ background: "#1a1a1a",
148
+ foreground: "#f5f0eb",
149
+ primary: "#d4a574",
150
+ secondary: "#a8927c",
151
+ accent: "#c47d5e",
152
+ codeBackground: "#2a2420",
153
+ codeForeground: "#f5f0eb"
154
+ },
155
+ fonts: X.fonts,
156
+ typography: X.typography,
157
+ fontImports: X.fontImports,
158
+ codeTheme: "vitesse-dark"
159
+ }, oe = ae("bold"), Re = {
160
+ name: "bold",
161
+ colors: {
162
+ background: "#000000",
163
+ foreground: "#ffffff",
164
+ primary: "#facc15",
165
+ secondary: "#a3a3a3",
166
+ accent: "#ef4444",
167
+ codeBackground: "#171717",
168
+ codeForeground: "#e5e5e5"
169
+ },
170
+ fonts: oe.fonts,
171
+ typography: oe.typography,
172
+ codeTheme: "vitesse-dark"
173
+ }, Oe = {
174
+ name: "forest",
175
+ colors: {
176
+ background: "#1a2e1a",
177
+ foreground: "#e8f0e8",
178
+ primary: "#4ade80",
179
+ secondary: "#86efac",
180
+ accent: "#fbbf24",
181
+ codeBackground: "#1e331e",
182
+ codeForeground: "#d1fae5"
183
+ },
184
+ fonts: {
185
+ heading: "'Inter', system-ui, sans-serif",
186
+ body: "'Inter', system-ui, sans-serif",
187
+ code: "'JetBrains Mono', 'Fira Code', monospace"
188
+ },
189
+ codeTheme: "vitesse-dark"
190
+ }, We = {
191
+ name: "ocean",
192
+ colors: {
193
+ background: "#0c1929",
194
+ foreground: "#e0f2fe",
195
+ primary: "#06b6d4",
196
+ secondary: "#67e8f9",
197
+ accent: "#f97316",
198
+ codeBackground: "#0f2235",
199
+ codeForeground: "#bae6fd"
200
+ },
201
+ fonts: {
202
+ heading: "'Inter', system-ui, sans-serif",
203
+ body: "'Inter', system-ui, sans-serif",
204
+ code: "'JetBrains Mono', 'Fira Code', monospace"
205
+ },
206
+ codeTheme: "vitesse-dark"
207
+ }, bn = {
208
+ dark: He,
209
+ light: Be,
210
+ minimal: De,
211
+ corporate: je,
212
+ elegant: Fe,
213
+ bold: Re,
214
+ forest: Oe,
215
+ ocean: We
216
+ };
217
+ function m(t, e) {
218
+ return { path: t, message: e };
219
+ }
220
+ function x(t) {
221
+ return typeof t == "string";
222
+ }
223
+ function H(t) {
224
+ return typeof t == "number" && !Number.isNaN(t);
225
+ }
226
+ function k(t) {
227
+ return t !== null && typeof t == "object" && !Array.isArray(t);
228
+ }
229
+ const re = /* @__PURE__ */ new Set(["text", "code", "image", "list", "divider", "table", "mermaid", "chart", "cards", "stats", "terminal"]), ce = /* @__PURE__ */ new Set([
230
+ "fadeIn",
231
+ "fadeOut",
232
+ "fadeInUp",
233
+ "fadeInDown",
234
+ "fadeInLeft",
235
+ "fadeInRight",
236
+ "typewriter",
237
+ "revealDown",
238
+ "scale",
239
+ "highlight",
240
+ "bounceIn",
241
+ "blurIn",
242
+ "rotateIn",
243
+ "slideUp",
244
+ "slideDown",
245
+ "zoomIn"
246
+ ]), le = /* @__PURE__ */ new Set([
247
+ "center",
248
+ "header-body",
249
+ "split",
250
+ "code-focus",
251
+ "full",
252
+ "blank",
253
+ "intro",
254
+ "section",
255
+ "end",
256
+ "quote",
257
+ "image-left",
258
+ "image-right",
259
+ "image-full",
260
+ "image-grid"
261
+ ]), de = /* @__PURE__ */ new Set(["pause", "auto"]);
262
+ function _e(t, e) {
263
+ const a = "manifest";
264
+ return k(t) ? (H(t.version) || e.push(m(`${a}.version`, "must be a number")), (!x(t.title) || t.title.length === 0) && e.push(m(`${a}.title`, "must be a non-empty string")), (!H(t.sceneCount) || t.sceneCount < 0) && e.push(m(`${a}.sceneCount`, "must be a non-negative number")), e.length === 0) : (e.push(m(a, "must be an object")), !1);
265
+ }
266
+ function Ve(t, e, a) {
267
+ if (!k(t))
268
+ return a.push(m(e, "must be an object")), !1;
269
+ switch ((!x(t.id) || t.id.length === 0) && a.push(m(`${e}.id`, "must be a non-empty string")), (!x(t.type) || !re.has(t.type)) && a.push(m(`${e}.type`, `must be one of: ${[...re].join(", ")}`)), t.type) {
270
+ case "text":
271
+ x(t.content) || a.push(m(`${e}.content`, "must be a string"));
272
+ break;
273
+ case "code":
274
+ x(t.content) || a.push(m(`${e}.content`, "must be a string")), x(t.language) || a.push(m(`${e}.language`, "must be a string"));
275
+ break;
276
+ case "image":
277
+ x(t.src) || a.push(m(`${e}.src`, "must be a string"));
278
+ break;
279
+ case "list":
280
+ (!Array.isArray(t.items) || !t.items.every(x)) && a.push(m(`${e}.items`, "must be an array of strings"));
281
+ break;
282
+ case "divider":
283
+ break;
284
+ case "table":
285
+ if ((!Array.isArray(t.headers) || !t.headers.every(x)) && a.push(m(`${e}.headers`, "must be an array of strings")), !Array.isArray(t.rows))
286
+ a.push(m(`${e}.rows`, "must be an array of arrays"));
287
+ else
288
+ for (let i = 0; i < t.rows.length; i++) {
289
+ const n = t.rows[i];
290
+ (!Array.isArray(n) || !n.every(x)) && a.push(m(`${e}.rows[${i}]`, "must be an array of strings"));
291
+ }
292
+ break;
293
+ case "mermaid":
294
+ x(t.definition) || a.push(m(`${e}.definition`, "must be a string"));
295
+ break;
296
+ case "chart": {
297
+ const i = /* @__PURE__ */ new Set(["bar", "line", "pie"]);
298
+ if ((!x(t.chartType) || !i.has(t.chartType)) && a.push(m(`${e}.chartType`, "must be one of: bar, line, pie")), (!Array.isArray(t.labels) || !t.labels.every(x)) && a.push(m(`${e}.labels`, "must be an array of strings")), !Array.isArray(t.datasets))
299
+ a.push(m(`${e}.datasets`, "must be an array"));
300
+ else
301
+ for (let n = 0; n < t.datasets.length; n++) {
302
+ const s = t.datasets[n];
303
+ k(s) ? (x(s.label) || a.push(m(`${e}.datasets[${n}].label`, "must be a string")), (!Array.isArray(s.data) || !s.data.every(H)) && a.push(m(`${e}.datasets[${n}].data`, "must be an array of numbers"))) : a.push(m(`${e}.datasets[${n}]`, "must be an object"));
304
+ }
305
+ break;
306
+ }
307
+ case "cards":
308
+ if (!Array.isArray(t.cards))
309
+ a.push(m(`${e}.cards`, "must be an array"));
310
+ else
311
+ for (let i = 0; i < t.cards.length; i++) {
312
+ const n = t.cards[i];
313
+ k(n) ? x(n.title) || a.push(m(`${e}.cards[${i}].title`, "must be a string")) : a.push(m(`${e}.cards[${i}]`, "must be an object"));
314
+ }
315
+ break;
316
+ case "stats":
317
+ if (!Array.isArray(t.stats))
318
+ a.push(m(`${e}.stats`, "must be an array"));
319
+ else
320
+ for (let i = 0; i < t.stats.length; i++) {
321
+ const n = t.stats[i];
322
+ k(n) ? (x(n.value) || a.push(m(`${e}.stats[${i}].value`, "must be a string")), x(n.label) || a.push(m(`${e}.stats[${i}].label`, "must be a string"))) : a.push(m(`${e}.stats[${i}]`, "must be an object"));
323
+ }
324
+ break;
325
+ case "terminal":
326
+ if (!Array.isArray(t.lines))
327
+ a.push(m(`${e}.lines`, "must be an array"));
328
+ else {
329
+ const i = /* @__PURE__ */ new Set(["command", "output"]);
330
+ for (let n = 0; n < t.lines.length; n++) {
331
+ const s = t.lines[n];
332
+ k(s) ? ((!x(s.type) || !i.has(s.type)) && a.push(m(`${e}.lines[${n}].type`, "must be one of: command, output")), x(s.text) || a.push(m(`${e}.lines[${n}].text`, "must be a string"))) : a.push(m(`${e}.lines[${n}]`, "must be an object"));
333
+ }
334
+ }
335
+ break;
336
+ }
337
+ return !0;
338
+ }
339
+ function qe(t, e, a) {
340
+ if (!k(t))
341
+ return a.push(m(e, "must be an object")), !1;
342
+ if ((!x(t.id) || t.id.length === 0) && a.push(m(`${e}.id`, "must be a non-empty string")), t.layout !== void 0 && (!x(t.layout) || !le.has(t.layout)) && a.push(m(`${e}.layout`, `must be one of: ${[...le].join(", ")}`)), t.transition !== void 0 && k(t.transition)) {
343
+ const i = /* @__PURE__ */ new Set(["fade", "slide", "none", "zoom", "reveal", "flip", "morph"]);
344
+ (!x(t.transition.type) || !i.has(t.transition.type)) && a.push(m(`${e}.transition.type`, `must be one of: ${[...i].join(", ")}`));
345
+ }
346
+ if (t.notes !== void 0 && !x(t.notes) && a.push(m(`${e}.notes`, "must be a string")), t.accentBar !== void 0)
347
+ if (!k(t.accentBar))
348
+ a.push(m(`${e}.accentBar`, "must be an object"));
349
+ else {
350
+ const i = t.accentBar;
351
+ x(i.color) || a.push(m(`${e}.accentBar.color`, "must be a string")), i.position !== void 0 && i.position !== "top" && i.position !== "bottom" && a.push(m(`${e}.accentBar.position`, "must be 'top' or 'bottom'")), i.height !== void 0 && !x(i.height) && a.push(m(`${e}.accentBar.height`, "must be a string"));
352
+ }
353
+ if (t.sceneTemplate !== void 0 && !x(t.sceneTemplate) && a.push(m(`${e}.sceneTemplate`, "must be a string")), t.templateData !== void 0)
354
+ if (!k(t.templateData))
355
+ a.push(m(`${e}.templateData`, "must be an object"));
356
+ else
357
+ for (const [i, n] of Object.entries(t.templateData))
358
+ x(n) || a.push(m(`${e}.templateData.${i}`, "must be a string"));
359
+ return Array.isArray(t.elements) ? t.elements.forEach((i, n) => Ve(i, `${e}.elements[${n}]`, a)) : a.push(m(`${e}.elements`, "must be an array")), !0;
360
+ }
361
+ function Ye(t, e) {
362
+ const a = "content";
363
+ return k(t) ? (Array.isArray(t.scenes) ? t.scenes.forEach((i, n) => qe(i, `${a}.scenes[${n}]`, e)) : e.push(m(`${a}.scenes`, "must be an array")), !0) : (e.push(m(a, "must be an object")), !1);
364
+ }
365
+ function Ge(t, e, a) {
366
+ return k(t) ? ((!x(t.elementId) || t.elementId.length === 0) && a.push(m(`${e}.elementId`, "must be a non-empty string")), (!x(t.animation) || !ce.has(t.animation)) && a.push(m(`${e}.animation`, `must be one of: ${[...ce].join(", ")}`)), (!H(t.at) || t.at < 0) && a.push(m(`${e}.at`, "must be a non-negative number")), !0) : (a.push(m(e, "must be an object")), !1);
367
+ }
368
+ function Ke(t, e, a) {
369
+ return k(t) ? ((!H(t.at) || t.at < 0) && a.push(m(`${e}.at`, "must be a non-negative number")), (!x(t.action) || !de.has(t.action)) && a.push(m(`${e}.action`, `must be one of: ${[...de].join(", ")}`)), !0) : (a.push(m(e, "must be an object")), !1);
370
+ }
371
+ function Je(t, e, a) {
372
+ return k(t) ? ((!x(t.sceneId) || t.sceneId.length === 0) && a.push(m(`${e}.sceneId`, "must be a non-empty string")), (!H(t.duration) || t.duration <= 0) && a.push(m(`${e}.duration`, "must be a positive number")), Array.isArray(t.events) ? t.events.forEach((i, n) => Ge(i, `${e}.events[${n}]`, a)) : a.push(m(`${e}.events`, "must be an array")), t.markers !== void 0 && (Array.isArray(t.markers) ? t.markers.forEach((i, n) => Ke(i, `${e}.markers[${n}]`, a)) : a.push(m(`${e}.markers`, "must be an array"))), !0) : (a.push(m(e, "must be an object")), !1);
373
+ }
374
+ function Xe(t, e) {
375
+ const a = "timesheet";
376
+ return k(t) ? (Array.isArray(t.timeline) ? t.timeline.forEach((i, n) => Je(i, `${a}.timeline[${n}]`, e)) : e.push(m(`${a}.timeline`, "must be an array")), !0) : (e.push(m(a, "must be an object")), !1);
377
+ }
378
+ function Ze(t, e) {
379
+ const a = "theme";
380
+ if (!k(t))
381
+ return e.push(m(a, "must be an object")), !1;
382
+ if ((!x(t.name) || t.name.length === 0) && e.push(m(`${a}.name`, "must be a non-empty string")), !k(t.colors))
383
+ e.push(m(`${a}.colors`, "must be an object"));
384
+ else {
385
+ const i = [
386
+ "background",
387
+ "foreground",
388
+ "primary",
389
+ "secondary",
390
+ "accent",
391
+ "codeBackground",
392
+ "codeForeground"
393
+ ];
394
+ for (const n of i)
395
+ x(t.colors[n]) || e.push(m(`${a}.colors.${n}`, "must be a string"));
396
+ }
397
+ if (!k(t.fonts))
398
+ e.push(m(`${a}.fonts`, "must be an object"));
399
+ else
400
+ for (const i of ["heading", "body", "code"])
401
+ x(t.fonts[i]) || e.push(m(`${a}.fonts.${i}`, "must be a string"));
402
+ return !0;
403
+ }
404
+ function Ue(t) {
405
+ const e = [];
406
+ if (!k(t))
407
+ return { valid: !1, errors: [m("", "input must be an object")] };
408
+ if (_e(t.manifest, e), Ye(t.content, e), Xe(t.timesheet, e), Ze(t.theme, e), k(t.content) && k(t.timesheet)) {
409
+ const a = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), n = t.content, s = t.timesheet;
410
+ if (Array.isArray(n.scenes)) {
411
+ for (const r of n.scenes)
412
+ if (r && typeof r == "object" && "id" in r && (i.add(r.id), Array.isArray(r.elements)))
413
+ for (const l of r.elements)
414
+ l && typeof l == "object" && "id" in l && a.add(l.id);
415
+ }
416
+ if (Array.isArray(s.timeline)) {
417
+ for (const r of s.timeline)
418
+ if (r && typeof r == "object" && "sceneId" in r && (i.has(r.sceneId) || e.push(m("timesheet.timeline", `references unknown scene "${r.sceneId}"`)), Array.isArray(r.events)))
419
+ for (const l of r.events)
420
+ l && typeof l == "object" && "elementId" in l && (a.has(l.elementId) || e.push(m("timesheet.timeline", `references unknown element "${l.elementId}"`)));
421
+ }
422
+ }
423
+ return { valid: e.length === 0, errors: e };
424
+ }
425
+ function Qe(t) {
426
+ switch (t.type) {
427
+ case "text": {
428
+ const e = t;
429
+ return e.role === "title" || e.role === "heading" ? 2 : e.role === "subtitle" ? 1.5 : 1;
430
+ }
431
+ case "code": {
432
+ const a = t.content.split(`
433
+ `).length;
434
+ return a <= 10 ? 2 : a <= 20 ? 3 : a <= 40 ? 4 : 5;
435
+ }
436
+ case "list": {
437
+ const a = t.items.length;
438
+ return a <= 3 ? 1 : a <= 6 ? 2 : a <= 10 ? 3 : 4;
439
+ }
440
+ case "table": {
441
+ const a = t.rows.length;
442
+ return a <= 3 ? 2 : a <= 6 ? 3 : 4;
443
+ }
444
+ case "image":
445
+ return 2;
446
+ case "mermaid":
447
+ return 3;
448
+ case "chart":
449
+ return 3;
450
+ case "cards":
451
+ return 2;
452
+ case "stats":
453
+ return 1.5;
454
+ case "terminal":
455
+ return 2;
456
+ case "flow":
457
+ return 3;
458
+ case "divider":
459
+ return 0.5;
460
+ default:
461
+ return 1;
462
+ }
463
+ }
464
+ async function et(t) {
465
+ const e = t.endsWith("/") ? t : t + "/", [a, i, n, s] = await Promise.all([
466
+ _(`${e}manifest.json`),
467
+ _(`${e}content.json`),
468
+ _(`${e}timesheet.json`),
469
+ _(`${e}theme.json`)
470
+ ]), r = { manifest: a, content: i, timesheet: n, theme: s }, l = Ue(r);
471
+ return l.valid || console.warn(
472
+ "[CuppaCue] Validation warnings:",
473
+ l.errors.map((u) => `${u.path}: ${u.message}`).join("; ")
474
+ ), r;
475
+ }
476
+ async function _(t) {
477
+ const e = await fetch(t);
478
+ if (!e.ok)
479
+ throw new Error(`Failed to fetch ${t}: ${e.status} ${e.statusText}`);
480
+ return e.json();
481
+ }
482
+ const tt = {
483
+ zap: '<path d="M13 2 3 14h9l-1 8 10-12h-9l1-8z"/>',
484
+ brain: '<path d="M9.5 2A5.5 5.5 0 0 0 5 6.36V6.5a4.5 4.5 0 0 0-.69 8.73A3.5 3.5 0 0 0 7.5 22h1a3.5 3.5 0 0 0 3.19-6.77A4.5 4.5 0 0 0 11 6.5v-.14A5.5 5.5 0 0 0 9.5 2z"/><path d="M14.5 2A5.5 5.5 0 0 1 19 6.36V6.5a4.5 4.5 0 0 1 .69 8.73A3.5 3.5 0 0 1 16.5 22h-1a3.5 3.5 0 0 1-3.19-6.77A4.5 4.5 0 0 1 13 6.5v-.14A5.5 5.5 0 0 1 14.5 2z"/><path d="M12 2v20"/>',
485
+ code: '<polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/>',
486
+ star: '<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/>',
487
+ check: '<polyline points="20 6 9 17 4 12"/>',
488
+ heart: '<path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"/>',
489
+ shield: '<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"/>',
490
+ rocket: '<path d="M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"/><path d="m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"/><path d="M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0"/><path d="M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"/>',
491
+ globe: '<circle cx="12" cy="12" r="10"/><path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"/><path d="M2 12h20"/>',
492
+ database: '<ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M3 5V19a9 3 0 0 0 18 0V5"/><path d="M3 12a9 3 0 0 0 18 0"/>',
493
+ server: '<rect width="20" height="8" x="2" y="2" rx="2" ry="2"/><rect width="20" height="8" x="2" y="14" rx="2" ry="2"/><line x1="6" x2="6.01" y1="6" y2="6"/><line x1="6" x2="6.01" y1="18" y2="18"/>',
494
+ cloud: '<path d="M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z"/>',
495
+ lock: '<rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/>',
496
+ key: '<path d="m21 2-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0 3 3L22 7l-3-3m-3.5 3.5L19 4"/>',
497
+ "bar-chart": '<line x1="12" x2="12" y1="20" y2="10"/><line x1="18" x2="18" y1="20" y2="4"/><line x1="6" x2="6" y1="20" y2="16"/>',
498
+ users: '<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/>',
499
+ mail: '<rect width="20" height="16" x="2" y="4" rx="2"/><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/>',
500
+ clock: '<circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/>',
501
+ "arrow-right": '<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>',
502
+ sparkles: '<path d="m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"/><path d="M5 3v4"/><path d="M19 17v4"/><path d="M3 5h4"/><path d="M17 19h4"/>',
503
+ refresh: '<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M3 21v-5h5"/>',
504
+ search: '<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>',
505
+ settings: '<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/>',
506
+ link: '<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/>',
507
+ target: '<circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="6"/><circle cx="12" cy="12" r="2"/>',
508
+ layers: '<path d="m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z"/><path d="m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65"/><path d="m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65"/>',
509
+ cpu: '<rect width="16" height="16" x="4" y="4" rx="2"/><rect width="6" height="6" x="9" y="9" rx="1"/><path d="M15 2v2"/><path d="M15 20v2"/><path d="M2 15h2"/><path d="M2 9h2"/><path d="M20 15h2"/><path d="M20 9h2"/><path d="M9 2v2"/><path d="M9 20v2"/>',
510
+ wifi: '<path d="M12 20h.01"/><path d="M2 8.82a15 15 0 0 1 20 0"/><path d="M5 12.859a10 10 0 0 1 14 0"/><path d="M8.5 16.429a5 5 0 0 1 7 0"/>',
511
+ "git-branch": '<line x1="6" x2="6" y1="3" y2="15"/><circle cx="18" cy="6" r="3"/><circle cx="6" cy="18" r="3"/><path d="M18 9a9 9 0 0 1-9 9"/>',
512
+ "message-circle": '<path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/>',
513
+ package: '<path d="m7.5 4.27 9 5.15"/><path d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"/><path d="m3.3 7 8.7 5 8.7-5"/><path d="M12 22V12"/>',
514
+ "trending-up": '<polyline points="22 7 13.5 15.5 8.5 10.5 2 17"/><polyline points="16 7 22 7 22 13"/>',
515
+ activity: '<path d="M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"/>',
516
+ download: '<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/>',
517
+ upload: '<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" x2="12" y1="3" y2="15"/>',
518
+ "alert-triangle": '<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/>',
519
+ info: '<circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/>',
520
+ "check-circle": '<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><path d="m9 11 3 3L22 4"/>',
521
+ "file-text": '<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M10 9H8"/><path d="M16 13H8"/><path d="M16 17H8"/>',
522
+ layout: '<rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><line x1="3" x2="21" y1="9" y2="9"/><line x1="9" x2="9" y1="21" y2="9"/>',
523
+ terminal: '<polyline points="4 17 10 11 4 5"/><line x1="12" x2="20" y1="19" y2="19"/>',
524
+ "help-circle": '<circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><path d="M12 17h.01"/>',
525
+ eye: '<path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"/><circle cx="12" cy="12" r="3"/>',
526
+ bolt: '<path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/><circle cx="12" cy="12" r="4"/>'
527
+ };
528
+ function nt(t, e = 24) {
529
+ const a = tt[t];
530
+ return a ? `<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${e}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${a}</svg>` : "";
531
+ }
532
+ function at(t, e) {
533
+ const a = document.createElement("div");
534
+ a.className = "cue-cards";
535
+ for (const i of t.cards) {
536
+ const n = document.createElement("div");
537
+ if (n.className = "cue-card", i.accent && (n.dataset.accent = "", n.style.setProperty("--cue-card-accent", i.accent)), i.icon) {
538
+ const r = document.createElement("div");
539
+ r.className = "cue-card-icon", r.innerHTML = nt(i.icon, 32), r.innerHTML || (r.textContent = i.icon), n.appendChild(r);
540
+ }
541
+ const s = document.createElement("div");
542
+ if (s.className = "cue-card-title", s.textContent = i.title, n.appendChild(s), i.description) {
543
+ const r = document.createElement("div");
544
+ r.className = "cue-card-desc", r.textContent = i.description, n.appendChild(r);
545
+ }
546
+ a.appendChild(n);
547
+ }
548
+ return a;
549
+ }
550
+ function it(t, e, a = 1500) {
551
+ const i = e.match(/^([<>~]?)(\d[\d,.]*)(.*)/);
552
+ if (!i) {
553
+ t.textContent = e;
554
+ return;
555
+ }
556
+ const n = i[1], s = i[2].replace(/,/g, ""), r = i[3], l = parseFloat(s), u = !s.includes("."), c = i[2].includes(","), o = performance.now();
557
+ function d(p) {
558
+ const g = p - o, h = Math.min(g / a, 1), v = 1 - Math.pow(1 - h, 3), y = l * v;
559
+ let b;
560
+ if (u) {
561
+ const w = Math.round(y);
562
+ b = c ? w.toLocaleString() : String(w);
563
+ } else {
564
+ const w = (s.split(".")[1] || "").length, A = y.toFixed(w);
565
+ b = c ? parseFloat(A).toLocaleString(void 0, { minimumFractionDigits: w }) : A;
566
+ }
567
+ t.textContent = `${n}${b}${r}`, h < 1 ? requestAnimationFrame(d) : t.textContent = e;
568
+ }
569
+ t.textContent = `${n}0${r}`, requestAnimationFrame(d);
570
+ }
571
+ function st(t) {
572
+ const e = document.createElement("div");
573
+ e.className = "cue-stats";
574
+ for (const i of t.stats) {
575
+ const n = document.createElement("div");
576
+ n.className = "cue-stat";
577
+ const s = document.createElement("div");
578
+ s.className = "cue-stat-value", s.textContent = i.value, s.dataset.target = i.value, n.appendChild(s);
579
+ const r = document.createElement("div");
580
+ r.className = "cue-stat-label", r.textContent = i.label, n.appendChild(r), e.appendChild(n);
581
+ }
582
+ const a = new MutationObserver(() => {
583
+ parseFloat(getComputedStyle(e).opacity) > 0 && (a.disconnect(), e.querySelectorAll(".cue-stat-value").forEach((s, r) => {
584
+ const l = s.dataset.target || "";
585
+ setTimeout(() => it(s, l), r * 200);
586
+ }));
587
+ });
588
+ return a.observe(e, { attributes: !0, attributeFilter: ["style"] }), e;
589
+ }
590
+ function ot(t) {
591
+ const e = document.createElement("div");
592
+ e.className = "cue-terminal";
593
+ const a = document.createElement("div");
594
+ a.className = "cue-terminal-chrome", a.innerHTML = '<span class="cue-terminal-dot cue-terminal-dot--red"></span><span class="cue-terminal-dot cue-terminal-dot--yellow"></span><span class="cue-terminal-dot cue-terminal-dot--green"></span>', e.appendChild(a);
595
+ const i = document.createElement("div");
596
+ i.className = "cue-terminal-body";
597
+ for (const s of t.lines) {
598
+ const r = document.createElement("div");
599
+ if (r.className = `cue-terminal-line cue-terminal-line--${s.type}`, s.type === "command") {
600
+ const l = document.createElement("span");
601
+ l.className = "cue-terminal-prompt", l.textContent = "$ ", r.appendChild(l);
602
+ const u = document.createElement("span");
603
+ u.className = "cue-terminal-text", u.dataset.fullText = s.text, u.textContent = "", r.appendChild(u);
604
+ } else
605
+ r.textContent = s.text, r.style.display = "none";
606
+ i.appendChild(r);
607
+ }
608
+ e.appendChild(i);
609
+ const n = new MutationObserver(() => {
610
+ e.style.opacity === "1" && (n.disconnect(), rt(i));
611
+ });
612
+ return n.observe(e, { attributes: !0, attributeFilter: ["style"] }), e;
613
+ }
614
+ async function rt(t) {
615
+ const e = t.querySelectorAll(".cue-terminal-line");
616
+ for (const a of e)
617
+ if (a.classList.contains("cue-terminal-line--command")) {
618
+ const i = a.querySelector(".cue-terminal-text");
619
+ if (i) {
620
+ const n = i.dataset.fullText || "";
621
+ await ct(i, n), await ue(200);
622
+ }
623
+ } else
624
+ a.style.display = "", await ue(50);
625
+ }
626
+ function ct(t, e, a = 30) {
627
+ return new Promise((i) => {
628
+ let n = 0;
629
+ function s() {
630
+ n < e.length ? (t.textContent += e[n], n++, setTimeout(s, a)) : i();
631
+ }
632
+ s();
633
+ });
634
+ }
635
+ function ue(t) {
636
+ return new Promise((e) => setTimeout(e, t));
637
+ }
638
+ let Z = null, lt = 0;
639
+ function dt() {
640
+ return Z || (Z = import("mermaid").then((t) => {
641
+ const e = t.default;
642
+ return e.initialize({
643
+ startOnLoad: !1,
644
+ theme: "dark",
645
+ themeVariables: {
646
+ darkMode: !0,
647
+ background: "transparent",
648
+ primaryColor: "#60a5fa",
649
+ primaryTextColor: "#e2e8f0",
650
+ lineColor: "#94a3b8"
651
+ }
652
+ }), e;
653
+ })), Z;
654
+ }
655
+ async function ut(t) {
656
+ const e = document.createElement("div");
657
+ e.className = "cue-mermaid";
658
+ try {
659
+ const a = await dt(), i = `cue-mermaid-${++lt}`, { svg: n } = await a.render(i, t.definition);
660
+ e.innerHTML = n;
661
+ const s = e.querySelector("svg");
662
+ if (s) {
663
+ const r = s.getAttribute("width"), l = s.getAttribute("height");
664
+ if (!s.getAttribute("viewBox") && r && l) {
665
+ const u = parseFloat(r), c = parseFloat(l);
666
+ !isNaN(u) && !isNaN(c) && s.setAttribute("viewBox", `0 0 ${u} ${c}`);
667
+ }
668
+ s.removeAttribute("width"), s.removeAttribute("height"), s.style.width = "100%", s.style.height = "100%", s.style.maxWidth = "100%", s.style.maxHeight = "100%";
669
+ }
670
+ } catch (a) {
671
+ const i = document.createElement("pre");
672
+ i.className = "cue-mermaid-fallback", i.textContent = t.definition, e.appendChild(i), console.warn("[CuppaCue] Mermaid render failed:", a);
673
+ }
674
+ return e;
675
+ }
676
+ let U = null;
677
+ function pt() {
678
+ return U || (U = import("chart.js").then((t) => (t.Chart.register(
679
+ t.CategoryScale,
680
+ t.LinearScale,
681
+ t.BarController,
682
+ t.BarElement,
683
+ t.LineController,
684
+ t.LineElement,
685
+ t.PointElement,
686
+ t.PieController,
687
+ t.ArcElement,
688
+ t.Tooltip,
689
+ t.Legend,
690
+ t.Filler
691
+ ), t))), U;
692
+ }
693
+ const V = [
694
+ "#60a5fa",
695
+ // blue
696
+ "#34d399",
697
+ // green
698
+ "#f472b6",
699
+ // pink
700
+ "#fbbf24",
701
+ // yellow
702
+ "#a78bfa",
703
+ // purple
704
+ "#f87171",
705
+ // red
706
+ "#38bdf8",
707
+ // cyan
708
+ "#fb923c"
709
+ // orange
710
+ ];
711
+ async function ht(t, e) {
712
+ const a = document.createElement("div");
713
+ a.className = "cue-chart";
714
+ const i = document.createElement("canvas");
715
+ a.appendChild(i);
716
+ try {
717
+ const { Chart: n } = await pt(), s = t.chartType === "pie", r = t.datasets.map((o, d) => {
718
+ const p = V[d % V.length];
719
+ return s ? {
720
+ label: o.label,
721
+ data: o.data,
722
+ backgroundColor: o.data.map((g, h) => V[h % V.length]),
723
+ borderColor: e.colors.background,
724
+ borderWidth: 2
725
+ } : {
726
+ label: o.label,
727
+ data: o.data,
728
+ backgroundColor: t.chartType === "bar" ? p : `${p}33`,
729
+ borderColor: p,
730
+ borderWidth: 2,
731
+ fill: t.chartType === "line",
732
+ tension: 0.3
733
+ };
734
+ }), l = r.length > 1, u = l ? r.map((o, d) => d === 0 ? o : { ...o, data: o.data.map(() => 0), hidden: !0 }) : r, c = new n(i, {
735
+ type: t.chartType,
736
+ data: {
737
+ labels: t.labels,
738
+ datasets: u
739
+ },
740
+ options: {
741
+ responsive: !0,
742
+ maintainAspectRatio: !0,
743
+ animation: {
744
+ duration: 1e3,
745
+ easing: "easeOutQuart"
746
+ },
747
+ plugins: {
748
+ legend: {
749
+ display: t.datasets.length > 1 || s,
750
+ labels: {
751
+ color: e.colors.foreground,
752
+ font: { family: e.fonts.body }
753
+ }
754
+ },
755
+ tooltip: {
756
+ enabled: !0
757
+ }
758
+ },
759
+ scales: s ? {} : {
760
+ x: {
761
+ ticks: { color: e.colors.foreground + "aa" },
762
+ grid: { color: e.colors.foreground + "11" }
763
+ },
764
+ y: {
765
+ ticks: { color: e.colors.foreground + "aa" },
766
+ grid: { color: e.colors.foreground + "11" }
767
+ }
768
+ }
769
+ }
770
+ });
771
+ l && (a.__cueChart = c, a.__cueChartDatasets = r, a.__cueChartStep = 0);
772
+ } catch (n) {
773
+ a.textContent = `[Chart: ${t.chartType}]`, console.warn("[CuppaCue] Chart.js render failed:", n);
774
+ }
775
+ return a;
776
+ }
777
+ function mt(t) {
778
+ const e = document.createElement("div");
779
+ e.className = "cue-flow";
780
+ const a = t.direction !== "TD", i = 200, n = 60, s = a ? 120 : 80, r = a ? 80 : 100, l = t.nodes.map((h, v) => ({
781
+ id: h.id,
782
+ x: a ? v * (i + s) : v % 2 * (i + s),
783
+ y: a ? 0 : v * (n + r),
784
+ width: i,
785
+ height: n
786
+ })), u = Math.max(...l.map((h) => h.x + h.width)), c = Math.max(...l.map((h) => h.y + h.height)), o = u + 40, d = c + 40, p = document.createElementNS("http://www.w3.org/2000/svg", "svg");
787
+ p.setAttribute("viewBox", `0 0 ${o} ${d}`), p.setAttribute("class", "cue-flow-svg"), p.style.width = "100%", p.style.maxWidth = `${o}px`;
788
+ const g = new Map(l.map((h) => [h.id, h]));
789
+ for (const h of t.edges) {
790
+ const v = g.get(h.from), y = g.get(h.to);
791
+ if (!v || !y) continue;
792
+ const b = document.createElementNS("http://www.w3.org/2000/svg", "g");
793
+ b.setAttribute("class", "cue-flow-edge"), b.setAttribute("data-from", h.from), b.setAttribute("data-to", h.to);
794
+ const w = v.x + v.width / 2 + 20, A = v.y + v.height / 2 + 20, I = y.x + y.width / 2 + 20, Ae = y.y + y.height / 2 + 20;
795
+ let z, P, S, $;
796
+ a ? (z = v.x + v.width + 20, P = A, S = y.x + 20, $ = Ae) : (z = w, P = v.y + v.height + 20, S = I, $ = y.y + 20);
797
+ const K = (z + S) / 2, J = (P + $) / 2, O = document.createElementNS("http://www.w3.org/2000/svg", "path");
798
+ a ? O.setAttribute("d", `M${z},${P} C${K},${P} ${K},${$} ${S},${$}`) : O.setAttribute("d", `M${z},${P} C${z},${J} ${S},${J} ${S},${$}`), O.setAttribute("class", "cue-flow-path"), b.appendChild(O);
799
+ const W = document.createElementNS("http://www.w3.org/2000/svg", "polygon"), M = 8;
800
+ if (a ? W.setAttribute(
801
+ "points",
802
+ `${S},${$} ${S - M},${$ - M / 2} ${S - M},${$ + M / 2}`
803
+ ) : W.setAttribute(
804
+ "points",
805
+ `${S},${$} ${S - M / 2},${$ - M} ${S + M / 2},${$ - M}`
806
+ ), W.setAttribute("class", "cue-flow-arrow"), b.appendChild(W), h.label) {
807
+ const j = document.createElementNS("http://www.w3.org/2000/svg", "text");
808
+ j.setAttribute("x", String(K)), j.setAttribute("y", String(J - 8)), j.setAttribute("class", "cue-flow-edge-label"), j.textContent = h.label, b.appendChild(j);
809
+ }
810
+ p.appendChild(b);
811
+ }
812
+ for (let h = 0; h < t.nodes.length; h++) {
813
+ const v = t.nodes[h], y = l[h], b = document.createElementNS("http://www.w3.org/2000/svg", "g");
814
+ b.setAttribute("class", "cue-flow-node"), b.setAttribute("data-node-id", v.id), b.setAttribute("data-node-index", String(h));
815
+ const w = document.createElementNS("http://www.w3.org/2000/svg", "rect");
816
+ w.setAttribute("x", String(y.x + 20)), w.setAttribute("y", String(y.y + 20)), w.setAttribute("width", String(y.width)), w.setAttribute("height", String(y.height)), w.setAttribute("rx", "10"), w.setAttribute("class", "cue-flow-node-rect"), v.color && w.setAttribute("fill", v.color), b.appendChild(w);
817
+ const A = document.createElementNS("http://www.w3.org/2000/svg", "text");
818
+ if (A.setAttribute("x", String(y.x + y.width / 2 + 20)), A.setAttribute("y", String(y.y + y.height / 2 + 20)), A.setAttribute("class", "cue-flow-node-label"), A.textContent = v.label, b.appendChild(A), v.icon) {
819
+ const I = document.createElementNS("http://www.w3.org/2000/svg", "text");
820
+ I.setAttribute("x", String(y.x + 35)), I.setAttribute("y", String(y.y + y.height / 2 + 20)), I.setAttribute("class", "cue-flow-node-icon"), I.textContent = v.icon, b.appendChild(I);
821
+ }
822
+ p.appendChild(b);
823
+ }
824
+ return e.appendChild(p), e;
825
+ }
826
+ const C = "http://www.w3.org/2000/svg";
827
+ function B() {
828
+ const t = document.createElement("div");
829
+ return t.className = "cue-st-decorations", t;
830
+ }
831
+ function D() {
832
+ const t = document.createElementNS(C, "svg");
833
+ return t.setAttribute("viewBox", "0 0 1920 1080"), t.setAttribute("preserveAspectRatio", "xMidYMid slice"), t.style.width = "100%", t.style.height = "100%", t;
834
+ }
835
+ function ft(t) {
836
+ const e = B(), a = D();
837
+ for (const i of t) {
838
+ const n = document.createElementNS(C, "circle");
839
+ n.setAttribute("cx", String(i.cx)), n.setAttribute("cy", String(i.cy)), n.setAttribute("r", String(i.r)), n.setAttribute("fill", i.color), n.setAttribute("opacity", String(i.opacity ?? 0.12)), a.appendChild(n);
840
+ }
841
+ return e.appendChild(a), e;
842
+ }
843
+ function xe(t, e) {
844
+ const a = B();
845
+ {
846
+ const i = D(), n = document.createElementNS(C, "defs"), s = document.createElementNS(C, "radialGradient");
847
+ s.setAttribute("id", "cue-grad-wash"), s.setAttribute("cx", "50%"), s.setAttribute("cy", "50%"), s.setAttribute("r", "70%");
848
+ for (const { color: l, stop: u, opacity: c } of e) {
849
+ const o = document.createElementNS(C, "stop");
850
+ o.setAttribute("offset", `${u}%`), o.setAttribute("stop-color", l), o.setAttribute("stop-opacity", String(c ?? 1)), s.appendChild(o);
851
+ }
852
+ n.appendChild(s), i.appendChild(n);
853
+ const r = document.createElementNS(C, "rect");
854
+ r.setAttribute("width", "1920"), r.setAttribute("height", "1080"), r.setAttribute("fill", "url(#cue-grad-wash)"), i.appendChild(r), a.appendChild(i);
855
+ }
856
+ return a;
857
+ }
858
+ function gt(t, e = 40, a = 2, i = 0.15) {
859
+ const n = B(), s = D(), r = document.createElementNS(C, "defs"), l = document.createElementNS(C, "pattern");
860
+ l.setAttribute("id", "cue-dots"), l.setAttribute("width", String(e)), l.setAttribute("height", String(e)), l.setAttribute("patternUnits", "userSpaceOnUse");
861
+ const u = document.createElementNS(C, "circle");
862
+ u.setAttribute("cx", String(e / 2)), u.setAttribute("cy", String(e / 2)), u.setAttribute("r", String(a)), u.setAttribute("fill", t), l.appendChild(u), r.appendChild(l), s.appendChild(r);
863
+ const c = document.createElementNS(C, "rect");
864
+ return c.setAttribute("width", "1920"), c.setAttribute("height", "1080"), c.setAttribute("fill", "url(#cue-dots)"), c.setAttribute("opacity", String(i)), s.appendChild(c), n.appendChild(s), n;
865
+ }
866
+ function we(t, e = "bottom", a = 0.15) {
867
+ const i = B(), n = D(), s = document.createElementNS(C, "path");
868
+ return e === "bottom" ? s.setAttribute(
869
+ "d",
870
+ "M0 900 C320 820, 640 980, 960 900 S1600 820, 1920 900 L1920 1080 L0 1080 Z"
871
+ ) : s.setAttribute(
872
+ "d",
873
+ "M0 180 C320 260, 640 100, 960 180 S1600 260, 1920 180 L1920 0 L0 0 Z"
874
+ ), s.setAttribute("fill", t), s.setAttribute("opacity", String(a)), n.appendChild(s), i.appendChild(n), i;
875
+ }
876
+ function ke(t, e = "top-right", a = 400, i = 0.1) {
877
+ const n = B(), s = D(), r = document.createElementNS(C, "path"), l = {
878
+ "top-right": `M${1920 - a} 0 L1920 0 L1920 ${a} Z`,
879
+ "top-left": `M0 0 L${a} 0 L0 ${a} Z`,
880
+ "bottom-right": `M1920 ${1080 - a} L1920 1080 L${1920 - a} 1080 Z`,
881
+ "bottom-left": `M0 ${1080 - a} L${a} 1080 L0 1080 Z`
882
+ };
883
+ return r.setAttribute("d", l[e]), r.setAttribute("fill", t), r.setAttribute("opacity", String(i)), s.appendChild(r), n.appendChild(s), n;
884
+ }
885
+ function Ce(t, e = 80, a = 1, i = 0.08) {
886
+ const n = B(), s = D(), r = document.createElementNS(C, "defs"), l = document.createElementNS(C, "pattern");
887
+ l.setAttribute("id", "cue-grid"), l.setAttribute("width", String(e)), l.setAttribute("height", String(e)), l.setAttribute("patternUnits", "userSpaceOnUse");
888
+ const u = document.createElementNS(C, "line");
889
+ u.setAttribute("x1", "0"), u.setAttribute("y1", String(e)), u.setAttribute("x2", String(e)), u.setAttribute("y2", String(e)), u.setAttribute("stroke", t), u.setAttribute("stroke-width", String(a)), l.appendChild(u);
890
+ const c = document.createElementNS(C, "line");
891
+ c.setAttribute("x1", String(e)), c.setAttribute("y1", "0"), c.setAttribute("x2", String(e)), c.setAttribute("y2", String(e)), c.setAttribute("stroke", t), c.setAttribute("stroke-width", String(a)), l.appendChild(c), r.appendChild(l), s.appendChild(r);
892
+ const o = document.createElementNS(C, "rect");
893
+ return o.setAttribute("width", "1920"), o.setAttribute("height", "1080"), o.setAttribute("fill", "url(#cue-grid)"), o.setAttribute("opacity", String(i)), s.appendChild(o), n.appendChild(s), n;
894
+ }
895
+ function Ee(t, e) {
896
+ return ft([
897
+ { cx: 1400, cy: 300, r: 400, color: t, opacity: 0.12 },
898
+ { cx: 1550, cy: 700, r: 350, color: e, opacity: 0.1 }
899
+ ]);
900
+ }
901
+ function L(t, e) {
902
+ const a = document.createElement("div");
903
+ return a.className = "cue-st-badge", a.textContent = t, a.style.backgroundColor = e, a;
904
+ }
905
+ function yt(t) {
906
+ const e = document.createElement("div");
907
+ return e.className = "cue-st-footer-bar", e.textContent = t, e;
908
+ }
909
+ function E(t, e = "top") {
910
+ const a = document.createElement("div");
911
+ return a.className = "cue-st-accent-bar", a.style.backgroundColor = t, e === "bottom" && (a.style.top = "auto", a.style.bottom = "0"), a;
912
+ }
913
+ const bt = {
914
+ async render(t, e, a, i) {
915
+ var c, o;
916
+ const n = document.createElement("div");
917
+ n.className = "cue-scene cue-st-tech-talk-intro", n.dataset.sceneId = t.id, n.style.background = e.colors.background;
918
+ const s = Ee(e.colors.accent, e.colors.primary);
919
+ n.appendChild(s);
920
+ const r = E(e.colors.accent);
921
+ if (n.appendChild(r), (c = t.templateData) != null && c.badge) {
922
+ const d = L(t.templateData.badge, e.colors.accent);
923
+ n.appendChild(d);
924
+ }
925
+ const l = document.createElement("div");
926
+ l.className = "cue-st-content";
927
+ const u = /* @__PURE__ */ new Map();
928
+ for (const d of t.elements) {
929
+ const p = await a(d, e, i);
930
+ u.set(d.id, p), l.appendChild(p);
931
+ }
932
+ if (n.appendChild(l), (o = t.templateData) != null && o.footerKeywords) {
933
+ const d = yt(t.templateData.footerKeywords);
934
+ n.appendChild(d);
935
+ }
936
+ return { container: n, elementMap: u };
937
+ }
938
+ }, vt = {
939
+ async render(t, e, a, i) {
940
+ const n = document.createElement("div");
941
+ n.className = "cue-scene cue-st-tech-talk-section", n.dataset.sceneId = t.id, n.style.background = e.colors.background;
942
+ const s = document.createElement("div");
943
+ s.className = "cue-st-section-gradient", s.style.background = `radial-gradient(ellipse at center, ${e.colors.accent}08 0%, transparent 70%)`, n.appendChild(s);
944
+ const r = document.createElement("div");
945
+ r.className = "cue-st-section-stripe", r.style.backgroundColor = e.colors.accent, n.appendChild(r);
946
+ const l = document.createElement("div");
947
+ l.className = "cue-st-content";
948
+ const u = /* @__PURE__ */ new Map();
949
+ for (const o of t.elements) {
950
+ const d = await a(o, e, i);
951
+ u.set(o.id, d), l.appendChild(d);
952
+ }
953
+ const c = document.createElement("div");
954
+ return c.className = "cue-st-accent-line", c.style.backgroundColor = e.colors.accent, l.appendChild(c), n.appendChild(l), { container: n, elementMap: u };
955
+ }
956
+ }, xt = {
957
+ async render(t, e, a, i) {
958
+ var c;
959
+ const n = document.createElement("div");
960
+ n.className = "cue-scene cue-st-tech-talk-closing", n.dataset.sceneId = t.id, n.style.background = e.colors.background;
961
+ const s = Ee(e.colors.accent, e.colors.primary);
962
+ n.appendChild(s);
963
+ const r = E(e.colors.accent);
964
+ if (n.appendChild(r), (c = t.templateData) != null && c.badge) {
965
+ const o = L(t.templateData.badge, e.colors.accent);
966
+ n.appendChild(o);
967
+ }
968
+ const l = document.createElement("div");
969
+ l.className = "cue-st-content";
970
+ const u = /* @__PURE__ */ new Map();
971
+ for (const o of t.elements) {
972
+ const d = await a(o, e, i);
973
+ u.set(o.id, d), l.appendChild(d);
974
+ }
975
+ return n.appendChild(l), { container: n, elementMap: u };
976
+ }
977
+ }, pe = [
978
+ "#3b82f6",
979
+ // blue
980
+ "#8b5cf6",
981
+ // violet
982
+ "#06b6d4",
983
+ // cyan
984
+ "#f59e0b",
985
+ // amber
986
+ "#10b981",
987
+ // emerald
988
+ "#ef4444"
989
+ // red
990
+ ];
991
+ function he(t) {
992
+ return /<(strong|em|del|code|a |br)\b/.test(t);
993
+ }
994
+ function wt(t) {
995
+ const e = t.match(
996
+ /^<strong>(.+?)<\/strong>\s*(?:—|–|-|:)\s*(.+)$/
997
+ );
998
+ if (e)
999
+ return { title: e[1], description: e[2] };
1000
+ const a = t.match(/^\*\*(.+?)\*\*\s*(?:—|–|-|:)\s*(.+)$/);
1001
+ return a ? { title: a[1], description: a[2] } : null;
1002
+ }
1003
+ function T(t, e) {
1004
+ const a = document.createElement("div");
1005
+ a.className = "cue-st-list-rows", a.dataset.elementId = t.id, a.style.opacity = "0";
1006
+ for (let i = 0; i < t.items.length; i++) {
1007
+ const n = t.items[i], s = document.createElement("div");
1008
+ s.className = "cue-st-list-row";
1009
+ const r = pe[i % pe.length];
1010
+ if (t.ordered) {
1011
+ const u = document.createElement("div");
1012
+ u.className = "cue-st-list-number", u.style.backgroundColor = r, u.textContent = String(i + 1), s.appendChild(u);
1013
+ } else {
1014
+ const u = document.createElement("div");
1015
+ u.className = "cue-st-list-accent", u.style.backgroundColor = r, s.appendChild(u);
1016
+ }
1017
+ const l = wt(n);
1018
+ if (l) {
1019
+ const u = document.createElement("div");
1020
+ u.className = "cue-st-list-text cue-st-list-text--two-line";
1021
+ const c = document.createElement("div");
1022
+ c.className = "cue-st-list-title", c.textContent = l.title;
1023
+ const o = document.createElement("div");
1024
+ o.className = "cue-st-list-desc", he(l.description) ? o.innerHTML = l.description : o.textContent = l.description, u.appendChild(c), u.appendChild(o), s.appendChild(u);
1025
+ } else {
1026
+ const u = document.createElement("div");
1027
+ u.className = "cue-st-list-text", he(n) ? u.innerHTML = n : u.textContent = n, s.appendChild(u);
1028
+ }
1029
+ a.appendChild(s);
1030
+ }
1031
+ return a;
1032
+ }
1033
+ function kt(t) {
1034
+ const e = t.replace("#", "");
1035
+ if (e.length < 6) return !1;
1036
+ const a = parseInt(e.slice(0, 2), 16), i = parseInt(e.slice(2, 4), 16), n = parseInt(e.slice(4, 6), 16);
1037
+ return a * 0.299 + i * 0.587 + n * 0.114 > 160;
1038
+ }
1039
+ const Ct = {
1040
+ async render(t, e, a, i) {
1041
+ var o;
1042
+ const n = document.createElement("div");
1043
+ n.className = "cue-scene cue-st-tech-talk-content", n.dataset.sceneId = t.id;
1044
+ const s = t.background || e.colors.background;
1045
+ n.style.background = s, t.background && kt(t.background) && (n.dataset.light = ""), n.appendChild(E(e.colors.accent));
1046
+ const r = t.elements.filter(
1047
+ (d) => d.type === "text" && (d.role === "title" || d.role === "heading")
1048
+ ), l = t.elements.filter(
1049
+ (d) => !(d.type === "text" && (d.role === "title" || d.role === "heading"))
1050
+ ), u = /* @__PURE__ */ new Map();
1051
+ if (r.length > 0) {
1052
+ const d = document.createElement("div");
1053
+ d.className = "cue-st-content-header";
1054
+ for (const g of r) {
1055
+ const h = await a(g, e, i);
1056
+ u.set(g.id, h), d.appendChild(h);
1057
+ }
1058
+ const p = document.createElement("div");
1059
+ p.className = "cue-st-content-underline", p.style.backgroundColor = e.colors.accent, d.appendChild(p), n.appendChild(d);
1060
+ }
1061
+ const c = document.createElement("div");
1062
+ c.className = "cue-st-content-body";
1063
+ for (const d of l)
1064
+ if (d.type === "list") {
1065
+ const p = T(d);
1066
+ u.set(d.id, p), c.appendChild(p);
1067
+ } else {
1068
+ const p = await a(d, e, i);
1069
+ u.set(d.id, p), c.appendChild(p);
1070
+ }
1071
+ if (n.appendChild(c), (o = t.templateData) != null && o.footer) {
1072
+ const d = document.createElement("div");
1073
+ d.className = "cue-st-content-footer", d.textContent = t.templateData.footer, n.appendChild(d);
1074
+ }
1075
+ return { container: n, elementMap: u };
1076
+ }
1077
+ }, Et = {
1078
+ async render(t, e, a, i) {
1079
+ var c;
1080
+ const n = document.createElement("div");
1081
+ n.className = "cue-scene cue-st-tech-talk-code", n.dataset.sceneId = t.id, n.style.background = e.colors.background, n.appendChild(E(e.colors.accent));
1082
+ const s = t.elements.filter(
1083
+ (o) => o.type === "text" && (o.role === "title" || o.role === "heading")
1084
+ ), r = t.elements.filter((o) => o.type === "code"), l = t.elements.filter(
1085
+ (o) => !(o.type === "text" && (o.role === "title" || o.role === "heading")) && o.type !== "code"
1086
+ ), u = /* @__PURE__ */ new Map();
1087
+ if (s.length > 0) {
1088
+ const o = document.createElement("div");
1089
+ o.className = "cue-st-code-header";
1090
+ for (const d of s) {
1091
+ const p = await a(d, e, i);
1092
+ u.set(d.id, p), o.appendChild(p);
1093
+ }
1094
+ n.appendChild(o);
1095
+ }
1096
+ if (r.length > 0) {
1097
+ const o = document.createElement("div");
1098
+ o.className = "cue-st-code-container";
1099
+ for (const d of r) {
1100
+ const p = await a(d, e, i);
1101
+ u.set(d.id, p), o.appendChild(p);
1102
+ }
1103
+ n.appendChild(o);
1104
+ }
1105
+ if (l.length > 0) {
1106
+ const o = document.createElement("div");
1107
+ o.className = "cue-st-code-footer";
1108
+ for (const d of l) {
1109
+ const p = await a(d, e, i);
1110
+ u.set(d.id, p), o.appendChild(p);
1111
+ }
1112
+ n.appendChild(o);
1113
+ }
1114
+ if ((c = t.templateData) != null && c.footer) {
1115
+ const o = document.createElement("div");
1116
+ o.className = "cue-st-content-footer", o.textContent = t.templateData.footer, n.appendChild(o);
1117
+ }
1118
+ return { container: n, elementMap: u };
1119
+ }
1120
+ }, St = {
1121
+ async render(t, e, a, i) {
1122
+ var c;
1123
+ const n = document.createElement("div");
1124
+ n.className = "cue-scene cue-st-pitch-deck-hero", n.dataset.sceneId = t.id, n.style.background = e.colors.background;
1125
+ const s = xe("radial", [
1126
+ { color: e.colors.accent, stop: 0, opacity: 0.15 },
1127
+ { color: e.colors.accent, stop: 50, opacity: 0.05 },
1128
+ { color: e.colors.background, stop: 100, opacity: 0 }
1129
+ ]);
1130
+ n.appendChild(s);
1131
+ const r = ke(e.colors.accent, "top-right", 400, 0.12);
1132
+ n.appendChild(r);
1133
+ const l = document.createElement("div");
1134
+ l.className = "cue-st-content";
1135
+ const u = /* @__PURE__ */ new Map();
1136
+ for (const o of t.elements) {
1137
+ const d = await a(o, e, i);
1138
+ u.set(o.id, d), l.appendChild(d);
1139
+ }
1140
+ if ((c = t.templateData) != null && c.tagline) {
1141
+ const o = document.createElement("div");
1142
+ o.className = "cue-st-tagline", o.textContent = t.templateData.tagline, l.appendChild(o);
1143
+ }
1144
+ return n.appendChild(l), { container: n, elementMap: u };
1145
+ }
1146
+ }, $t = {
1147
+ async render(t, e, a, i) {
1148
+ const n = document.createElement("div");
1149
+ n.className = "cue-scene cue-st-pitch-deck-problem", n.dataset.sceneId = t.id, n.style.background = e.colors.background, n.appendChild(E(e.colors.accent));
1150
+ const s = t.elements.filter(
1151
+ (c) => c.type === "text" && (c.role === "title" || c.role === "heading")
1152
+ ), r = t.elements.filter(
1153
+ (c) => !(c.type === "text" && (c.role === "title" || c.role === "heading"))
1154
+ ), l = /* @__PURE__ */ new Map();
1155
+ if (s.length > 0) {
1156
+ const c = document.createElement("div");
1157
+ c.className = "cue-st-content-header";
1158
+ for (const d of s) {
1159
+ const p = await a(d, e, i);
1160
+ l.set(d.id, p), c.appendChild(p);
1161
+ }
1162
+ const o = document.createElement("div");
1163
+ o.className = "cue-st-content-underline", o.style.backgroundColor = e.colors.accent, c.appendChild(o), n.appendChild(c);
1164
+ }
1165
+ const u = document.createElement("div");
1166
+ u.className = "cue-st-content-body";
1167
+ for (const c of r)
1168
+ if (c.type === "list") {
1169
+ const o = T(c);
1170
+ l.set(c.id, o), u.appendChild(o);
1171
+ } else {
1172
+ const o = await a(c, e, i);
1173
+ l.set(c.id, o), u.appendChild(o);
1174
+ }
1175
+ return n.appendChild(u), { container: n, elementMap: l };
1176
+ }
1177
+ }, Tt = {
1178
+ async render(t, e, a, i) {
1179
+ const n = document.createElement("div");
1180
+ n.className = "cue-scene cue-st-pitch-deck-solution", n.dataset.sceneId = t.id, n.style.background = e.colors.background, n.appendChild(E(e.colors.accent));
1181
+ const s = t.elements.filter(
1182
+ (u) => u.type === "text" && (u.role === "title" || u.role === "heading")
1183
+ ), r = t.elements.filter(
1184
+ (u) => !(u.type === "text" && (u.role === "title" || u.role === "heading"))
1185
+ ), l = /* @__PURE__ */ new Map();
1186
+ if (s.length > 0) {
1187
+ const u = document.createElement("div");
1188
+ u.className = "cue-st-content-header";
1189
+ for (const o of s) {
1190
+ const d = await a(o, e, i);
1191
+ l.set(o.id, d), u.appendChild(d);
1192
+ }
1193
+ const c = document.createElement("div");
1194
+ c.className = "cue-st-content-underline", c.style.backgroundColor = e.colors.accent, u.appendChild(c), n.appendChild(u);
1195
+ }
1196
+ if (r.length > 0) {
1197
+ const u = document.createElement("div");
1198
+ u.className = "cue-st-content-body";
1199
+ for (const c of r)
1200
+ if (c.type === "list") {
1201
+ const o = T(c);
1202
+ l.set(c.id, o), u.appendChild(o);
1203
+ } else {
1204
+ const o = await a(c, e, i);
1205
+ l.set(c.id, o), u.appendChild(o);
1206
+ }
1207
+ n.appendChild(u);
1208
+ }
1209
+ return { container: n, elementMap: l };
1210
+ }
1211
+ }, At = {
1212
+ async render(t, e, a, i) {
1213
+ var u;
1214
+ const n = document.createElement("div");
1215
+ n.className = "cue-scene cue-st-pitch-deck-metrics", n.dataset.sceneId = t.id, n.style.background = e.colors.background, n.appendChild(E(e.colors.accent));
1216
+ const s = t.elements.filter(
1217
+ (c) => c.type === "text" && (c.role === "title" || c.role === "heading")
1218
+ ), r = t.elements.filter(
1219
+ (c) => !(c.type === "text" && (c.role === "title" || c.role === "heading"))
1220
+ ), l = /* @__PURE__ */ new Map();
1221
+ if (s.length > 0) {
1222
+ const c = document.createElement("div");
1223
+ c.className = "cue-st-content-header";
1224
+ for (const o of s) {
1225
+ const d = await a(o, e, i);
1226
+ l.set(o.id, d), c.appendChild(d);
1227
+ }
1228
+ n.appendChild(c);
1229
+ }
1230
+ if (r.length > 0) {
1231
+ const c = document.createElement("div");
1232
+ c.className = "cue-st-content-body";
1233
+ for (const o of r)
1234
+ if (o.type === "list") {
1235
+ const d = T(o);
1236
+ l.set(o.id, d), c.appendChild(d);
1237
+ } else {
1238
+ const d = await a(o, e, i);
1239
+ l.set(o.id, d), c.appendChild(d);
1240
+ }
1241
+ n.appendChild(c);
1242
+ }
1243
+ if ((u = t.templateData) != null && u.footer) {
1244
+ const c = document.createElement("div");
1245
+ c.className = "cue-st-content-footer", c.textContent = t.templateData.footer, n.appendChild(c);
1246
+ }
1247
+ return { container: n, elementMap: l };
1248
+ }
1249
+ }, Mt = {
1250
+ async render(t, e, a, i) {
1251
+ var c;
1252
+ const n = document.createElement("div");
1253
+ n.className = "cue-scene cue-st-pitch-deck-cta", n.dataset.sceneId = t.id, n.style.background = e.colors.background;
1254
+ const s = xe("radial", [
1255
+ { color: e.colors.accent, stop: 0, opacity: 0.12 },
1256
+ { color: e.colors.accent, stop: 60, opacity: 0.04 },
1257
+ { color: e.colors.background, stop: 100, opacity: 0 }
1258
+ ]);
1259
+ n.appendChild(s);
1260
+ const r = ke(e.colors.accent, "bottom-left", 400, 0.12);
1261
+ n.appendChild(r);
1262
+ const l = document.createElement("div");
1263
+ l.className = "cue-st-content";
1264
+ const u = /* @__PURE__ */ new Map();
1265
+ for (const o of t.elements) {
1266
+ const d = await a(o, e, i);
1267
+ u.set(o.id, d), l.appendChild(d);
1268
+ }
1269
+ if ((c = t.templateData) != null && c.tagline) {
1270
+ const o = document.createElement("div");
1271
+ o.className = "cue-st-tagline", o.textContent = t.templateData.tagline, l.appendChild(o);
1272
+ }
1273
+ return n.appendChild(l), { container: n, elementMap: u };
1274
+ }
1275
+ }, Nt = {
1276
+ async render(t, e, a, i) {
1277
+ var p, g, h, v;
1278
+ const n = document.createElement("div");
1279
+ n.className = "cue-scene cue-st-workshop-intro", n.dataset.sceneId = t.id, n.style.background = e.colors.background;
1280
+ const s = we(e.colors.accent, "bottom");
1281
+ n.appendChild(s);
1282
+ const r = L("WORKSHOP", e.colors.accent);
1283
+ n.appendChild(r);
1284
+ const l = document.createElement("div");
1285
+ l.className = "cue-st-content";
1286
+ const u = t.elements.filter(
1287
+ (y) => y.type === "text" && (y.role === "title" || y.role === "heading")
1288
+ ), c = t.elements.filter(
1289
+ (y) => !(y.type === "text" && (y.role === "title" || y.role === "heading"))
1290
+ ), o = /* @__PURE__ */ new Map();
1291
+ for (const y of u) {
1292
+ const b = await a(y, e, i);
1293
+ o.set(y.id, b), l.appendChild(b);
1294
+ }
1295
+ for (const y of c) {
1296
+ const b = await a(y, e, i);
1297
+ o.set(y.id, b), l.appendChild(b);
1298
+ }
1299
+ const d = document.createElement("div");
1300
+ if (d.className = "cue-st-workshop-meta", (p = t.templateData) != null && p.duration) {
1301
+ const y = document.createElement("span");
1302
+ y.className = "cue-st-workshop-meta-item", y.textContent = t.templateData.duration, d.appendChild(y);
1303
+ }
1304
+ if ((g = t.templateData) != null && g.prerequisites) {
1305
+ const y = document.createElement("span");
1306
+ y.className = "cue-st-workshop-meta-item", y.textContent = t.templateData.prerequisites, d.appendChild(y);
1307
+ }
1308
+ return ((h = t.templateData) != null && h.duration || (v = t.templateData) != null && v.prerequisites) && l.appendChild(d), n.appendChild(l), { container: n, elementMap: o };
1309
+ }
1310
+ }, It = {
1311
+ async render(t, e, a, i) {
1312
+ var p;
1313
+ const n = document.createElement("div");
1314
+ n.className = "cue-scene cue-st-workshop-step", n.dataset.sceneId = t.id, n.style.background = e.colors.background;
1315
+ const s = gt(e.colors.accent);
1316
+ n.appendChild(s), n.appendChild(E(e.colors.accent));
1317
+ const r = ((p = t.templateData) == null ? void 0 : p.stepNumber) ?? "1", l = document.createElement("div");
1318
+ l.className = "cue-st-workshop-step-badge", l.style.backgroundColor = e.colors.accent, l.textContent = r, n.appendChild(l);
1319
+ const u = t.elements.filter(
1320
+ (g) => g.type === "text" && (g.role === "title" || g.role === "heading")
1321
+ ), c = t.elements.filter(
1322
+ (g) => !(g.type === "text" && (g.role === "title" || g.role === "heading"))
1323
+ ), o = /* @__PURE__ */ new Map();
1324
+ if (u.length > 0) {
1325
+ const g = document.createElement("div");
1326
+ g.className = "cue-st-content-header";
1327
+ for (const v of u) {
1328
+ const y = await a(v, e, i);
1329
+ o.set(v.id, y), g.appendChild(y);
1330
+ }
1331
+ const h = document.createElement("div");
1332
+ h.className = "cue-st-content-underline", h.style.backgroundColor = e.colors.accent, g.appendChild(h), n.appendChild(g);
1333
+ }
1334
+ const d = document.createElement("div");
1335
+ d.className = "cue-st-content-body";
1336
+ for (const g of c)
1337
+ if (g.type === "list") {
1338
+ const h = T(g);
1339
+ o.set(g.id, h), d.appendChild(h);
1340
+ } else {
1341
+ const h = await a(g, e, i);
1342
+ o.set(g.id, h), d.appendChild(h);
1343
+ }
1344
+ return n.appendChild(d), { container: n, elementMap: o };
1345
+ }
1346
+ }, Lt = {
1347
+ async render(t, e, a, i) {
1348
+ var o;
1349
+ const n = document.createElement("div");
1350
+ n.className = "cue-scene cue-st-workshop-exercise", n.dataset.sceneId = t.id, n.style.background = e.colors.background, n.appendChild(E(e.colors.accent));
1351
+ const s = L("EXERCISE", e.colors.accent);
1352
+ if (n.appendChild(s), (o = t.templateData) != null && o.timer) {
1353
+ const d = document.createElement("div");
1354
+ d.className = "cue-st-workshop-timer", d.textContent = t.templateData.timer, d.style.backgroundColor = e.colors.accent, n.appendChild(d);
1355
+ }
1356
+ const r = t.elements.filter(
1357
+ (d) => d.type === "text" && (d.role === "title" || d.role === "heading")
1358
+ ), l = t.elements.filter(
1359
+ (d) => !(d.type === "text" && (d.role === "title" || d.role === "heading"))
1360
+ ), u = /* @__PURE__ */ new Map();
1361
+ if (r.length > 0) {
1362
+ const d = document.createElement("div");
1363
+ d.className = "cue-st-content-header";
1364
+ for (const p of r) {
1365
+ const g = await a(p, e, i);
1366
+ u.set(p.id, g), d.appendChild(g);
1367
+ }
1368
+ n.appendChild(d);
1369
+ }
1370
+ const c = document.createElement("div");
1371
+ c.className = "cue-st-content-body";
1372
+ for (const d of l)
1373
+ if (d.type === "list") {
1374
+ const p = T(d);
1375
+ u.set(d.id, p), c.appendChild(p);
1376
+ } else {
1377
+ const p = await a(d, e, i);
1378
+ u.set(d.id, p), c.appendChild(p);
1379
+ }
1380
+ return n.appendChild(c), { container: n, elementMap: u };
1381
+ }
1382
+ }, zt = {
1383
+ async render(t, e, a, i) {
1384
+ const n = document.createElement("div");
1385
+ n.className = "cue-scene cue-st-workshop-checkpoint", n.dataset.sceneId = t.id, n.style.background = e.colors.background, n.appendChild(E(e.colors.accent));
1386
+ const s = t.elements.filter(
1387
+ (c) => c.type === "text" && (c.role === "title" || c.role === "heading")
1388
+ ), r = t.elements.filter(
1389
+ (c) => !(c.type === "text" && (c.role === "title" || c.role === "heading"))
1390
+ ), l = /* @__PURE__ */ new Map();
1391
+ if (s.length > 0) {
1392
+ const c = document.createElement("div");
1393
+ c.className = "cue-st-content-header";
1394
+ for (const d of s) {
1395
+ const p = await a(d, e, i);
1396
+ l.set(d.id, p), c.appendChild(p);
1397
+ }
1398
+ const o = document.createElement("div");
1399
+ o.className = "cue-st-content-underline", o.style.backgroundColor = e.colors.accent, c.appendChild(o), n.appendChild(c);
1400
+ }
1401
+ const u = document.createElement("div");
1402
+ u.className = "cue-st-content-body";
1403
+ for (const c of r)
1404
+ if (c.type === "list") {
1405
+ const o = T(c);
1406
+ l.set(c.id, o), u.appendChild(o);
1407
+ } else {
1408
+ const o = await a(c, e, i);
1409
+ l.set(c.id, o), u.appendChild(o);
1410
+ }
1411
+ return n.appendChild(u), { container: n, elementMap: l };
1412
+ }
1413
+ }, Pt = {
1414
+ async render(t, e, a, i) {
1415
+ const n = document.createElement("div");
1416
+ n.className = "cue-scene cue-st-workshop-summary", n.dataset.sceneId = t.id, n.style.background = e.colors.background;
1417
+ const s = we(e.colors.accent, "bottom");
1418
+ n.appendChild(s), n.appendChild(E(e.colors.accent));
1419
+ const r = t.elements.filter(
1420
+ (o) => o.type === "text" && (o.role === "title" || o.role === "heading")
1421
+ ), l = t.elements.filter(
1422
+ (o) => !(o.type === "text" && (o.role === "title" || o.role === "heading"))
1423
+ ), u = /* @__PURE__ */ new Map();
1424
+ if (r.length > 0) {
1425
+ const o = document.createElement("div");
1426
+ o.className = "cue-st-content-header";
1427
+ for (const p of r) {
1428
+ const g = await a(p, e, i);
1429
+ u.set(p.id, g), o.appendChild(g);
1430
+ }
1431
+ const d = document.createElement("div");
1432
+ d.className = "cue-st-content-underline", d.style.backgroundColor = e.colors.accent, o.appendChild(d), n.appendChild(o);
1433
+ }
1434
+ const c = document.createElement("div");
1435
+ c.className = "cue-st-content-body";
1436
+ for (const o of l)
1437
+ if (o.type === "list") {
1438
+ const d = T(o);
1439
+ u.set(o.id, d), c.appendChild(d);
1440
+ } else {
1441
+ const d = await a(o, e, i);
1442
+ u.set(o.id, d), c.appendChild(d);
1443
+ }
1444
+ return n.appendChild(c), { container: n, elementMap: u };
1445
+ }
1446
+ }, Ht = {
1447
+ async render(t, e, a, i) {
1448
+ var p, g;
1449
+ const n = document.createElement("div");
1450
+ n.className = "cue-scene cue-st-changelog-cover", n.dataset.sceneId = t.id, n.style.background = e.colors.background;
1451
+ const s = Ce(e.colors.foreground);
1452
+ n.appendChild(s);
1453
+ const r = document.createElement("div");
1454
+ r.className = "cue-st-content";
1455
+ const l = ((p = t.templateData) == null ? void 0 : p.version) ?? "";
1456
+ if (l) {
1457
+ const h = document.createElement("div");
1458
+ h.className = "cue-st-version-badge", h.textContent = l, h.style.color = e.colors.accent, r.appendChild(h);
1459
+ }
1460
+ const u = t.elements.filter(
1461
+ (h) => h.type === "text" && (h.role === "title" || h.role === "heading")
1462
+ ), c = t.elements.filter(
1463
+ (h) => !(h.type === "text" && (h.role === "title" || h.role === "heading"))
1464
+ ), o = /* @__PURE__ */ new Map();
1465
+ for (const h of u) {
1466
+ const v = await a(h, e, i);
1467
+ o.set(h.id, v), r.appendChild(v);
1468
+ }
1469
+ for (const h of c) {
1470
+ const v = await a(h, e, i);
1471
+ o.set(h.id, v), r.appendChild(v);
1472
+ }
1473
+ const d = ((g = t.templateData) == null ? void 0 : g.date) ?? "";
1474
+ if (d) {
1475
+ const h = document.createElement("div");
1476
+ h.className = "cue-st-changelog-date", h.textContent = d, r.appendChild(h);
1477
+ }
1478
+ return n.appendChild(r), { container: n, elementMap: o };
1479
+ }
1480
+ }, Bt = {
1481
+ async render(t, e, a, i) {
1482
+ const n = document.createElement("div");
1483
+ n.className = "cue-scene cue-st-changelog-feature", n.dataset.sceneId = t.id, n.style.background = e.colors.background, n.appendChild(E(e.colors.accent));
1484
+ const s = L("NEW", e.colors.secondary);
1485
+ n.appendChild(s);
1486
+ const r = t.elements.filter(
1487
+ (o) => o.type === "text" && (o.role === "title" || o.role === "heading")
1488
+ ), l = t.elements.filter(
1489
+ (o) => !(o.type === "text" && (o.role === "title" || o.role === "heading"))
1490
+ ), u = /* @__PURE__ */ new Map();
1491
+ if (r.length > 0) {
1492
+ const o = document.createElement("div");
1493
+ o.className = "cue-st-content-header";
1494
+ for (const p of r) {
1495
+ const g = await a(p, e, i);
1496
+ u.set(p.id, g), o.appendChild(g);
1497
+ }
1498
+ const d = document.createElement("div");
1499
+ d.className = "cue-st-content-underline", d.style.backgroundColor = e.colors.accent, o.appendChild(d), n.appendChild(o);
1500
+ }
1501
+ const c = document.createElement("div");
1502
+ c.className = "cue-st-content-body";
1503
+ for (const o of l)
1504
+ if (o.type === "list") {
1505
+ const d = T(o);
1506
+ u.set(o.id, d), c.appendChild(d);
1507
+ } else {
1508
+ const d = await a(o, e, i);
1509
+ u.set(o.id, d), c.appendChild(d);
1510
+ }
1511
+ return n.appendChild(c), { container: n, elementMap: u };
1512
+ }
1513
+ }, Dt = {
1514
+ async render(t, e, a, i) {
1515
+ const n = document.createElement("div");
1516
+ n.className = "cue-scene cue-st-changelog-breaking", n.dataset.sceneId = t.id, n.style.background = e.colors.background, n.appendChild(E(e.colors.accent));
1517
+ const s = L("BREAKING", e.colors.accent);
1518
+ n.appendChild(s);
1519
+ const r = t.elements.filter(
1520
+ (o) => o.type === "text" && (o.role === "title" || o.role === "heading")
1521
+ ), l = t.elements.filter(
1522
+ (o) => !(o.type === "text" && (o.role === "title" || o.role === "heading"))
1523
+ ), u = /* @__PURE__ */ new Map();
1524
+ if (r.length > 0) {
1525
+ const o = document.createElement("div");
1526
+ o.className = "cue-st-content-header";
1527
+ for (const p of r) {
1528
+ const g = await a(p, e, i);
1529
+ u.set(p.id, g), o.appendChild(g);
1530
+ }
1531
+ const d = document.createElement("div");
1532
+ d.className = "cue-st-content-underline", d.style.backgroundColor = e.colors.accent, o.appendChild(d), n.appendChild(o);
1533
+ }
1534
+ const c = document.createElement("div");
1535
+ c.className = "cue-st-content-body";
1536
+ for (const o of l)
1537
+ if (o.type === "list") {
1538
+ const d = T(o);
1539
+ u.set(o.id, d), c.appendChild(d);
1540
+ } else {
1541
+ const d = await a(o, e, i);
1542
+ u.set(o.id, d), c.appendChild(d);
1543
+ }
1544
+ return n.appendChild(c), { container: n, elementMap: u };
1545
+ }
1546
+ }, jt = {
1547
+ async render(t, e, a, i) {
1548
+ const n = document.createElement("div");
1549
+ n.className = "cue-scene cue-st-changelog-fixes", n.dataset.sceneId = t.id, n.style.background = e.colors.background, n.appendChild(E(e.colors.accent));
1550
+ const s = L("FIXES", e.colors.primary);
1551
+ n.appendChild(s);
1552
+ const r = t.elements.filter(
1553
+ (o) => o.type === "text" && (o.role === "title" || o.role === "heading")
1554
+ ), l = t.elements.filter(
1555
+ (o) => !(o.type === "text" && (o.role === "title" || o.role === "heading"))
1556
+ ), u = /* @__PURE__ */ new Map();
1557
+ if (r.length > 0) {
1558
+ const o = document.createElement("div");
1559
+ o.className = "cue-st-content-header";
1560
+ for (const p of r) {
1561
+ const g = await a(p, e, i);
1562
+ u.set(p.id, g), o.appendChild(g);
1563
+ }
1564
+ const d = document.createElement("div");
1565
+ d.className = "cue-st-content-underline", d.style.backgroundColor = e.colors.accent, o.appendChild(d), n.appendChild(o);
1566
+ }
1567
+ const c = document.createElement("div");
1568
+ c.className = "cue-st-content-body";
1569
+ for (const o of l)
1570
+ if (o.type === "list") {
1571
+ const d = T(o);
1572
+ u.set(o.id, d), c.appendChild(d);
1573
+ } else {
1574
+ const d = await a(o, e, i);
1575
+ u.set(o.id, d), c.appendChild(d);
1576
+ }
1577
+ return n.appendChild(c), { container: n, elementMap: u };
1578
+ }
1579
+ }, Ft = {
1580
+ async render(t, e, a, i) {
1581
+ const n = document.createElement("div");
1582
+ n.className = "cue-scene cue-st-changelog-credits", n.dataset.sceneId = t.id, n.style.background = e.colors.background;
1583
+ const s = Ce(e.colors.foreground);
1584
+ n.appendChild(s);
1585
+ const r = document.createElement("div");
1586
+ r.className = "cue-st-content";
1587
+ const l = /* @__PURE__ */ new Map();
1588
+ for (const u of t.elements) {
1589
+ const c = await a(u, e, i);
1590
+ l.set(u.id, c), r.appendChild(c);
1591
+ }
1592
+ return n.appendChild(r), { container: n, elementMap: l };
1593
+ }
1594
+ }, G = {
1595
+ "tech-talk/intro": bt,
1596
+ "tech-talk/section": vt,
1597
+ "tech-talk/closing": xt,
1598
+ "tech-talk/content": Ct,
1599
+ "tech-talk/code": Et,
1600
+ "pitch-deck/hero": St,
1601
+ "pitch-deck/problem": $t,
1602
+ "pitch-deck/solution": Tt,
1603
+ "pitch-deck/metrics": At,
1604
+ "pitch-deck/cta": Mt,
1605
+ "workshop/intro": Nt,
1606
+ "workshop/step": It,
1607
+ "workshop/exercise": Lt,
1608
+ "workshop/checkpoint": zt,
1609
+ "workshop/summary": Pt,
1610
+ "changelog/cover": Ht,
1611
+ "changelog/feature": Bt,
1612
+ "changelog/breaking": Dt,
1613
+ "changelog/fixes": jt,
1614
+ "changelog/credits": Ft
1615
+ };
1616
+ function vn(t, e) {
1617
+ G[t] = e;
1618
+ }
1619
+ function xn(t) {
1620
+ for (const [e, a] of Object.entries(t.renderers))
1621
+ G[e] = a;
1622
+ }
1623
+ function Rt(t) {
1624
+ return G[t];
1625
+ }
1626
+ function wn() {
1627
+ return Object.keys(G);
1628
+ }
1629
+ let Q = null;
1630
+ function Ot(t) {
1631
+ return Q || (Q = import("shiki").then(
1632
+ (e) => e.createHighlighter({
1633
+ themes: [t || "vitesse-dark"],
1634
+ langs: [
1635
+ "typescript",
1636
+ "javascript",
1637
+ "json",
1638
+ "html",
1639
+ "css",
1640
+ "bash",
1641
+ "shell",
1642
+ "python",
1643
+ "ruby",
1644
+ "go",
1645
+ "rust",
1646
+ "swift",
1647
+ "kotlin",
1648
+ "java",
1649
+ "c",
1650
+ "cpp",
1651
+ "yaml",
1652
+ "toml",
1653
+ "dockerfile",
1654
+ "sql",
1655
+ "markdown",
1656
+ "xml",
1657
+ "graphql",
1658
+ "text"
1659
+ ]
1660
+ })
1661
+ )), Q;
1662
+ }
1663
+ function Wt(t, e) {
1664
+ if (t.style.position = "absolute", !e) {
1665
+ t.style.left = "50%", t.style.top = "50%", t.style.transform = "translate(-50%, -50%)";
1666
+ return;
1667
+ }
1668
+ e.maxWidth && (t.style.maxWidth = e.maxWidth), e.width && (t.style.width = e.width);
1669
+ const a = e.anchor ?? "center", i = e.x ?? "50%", n = e.y ?? "50%";
1670
+ switch (a) {
1671
+ case "center":
1672
+ t.style.left = i, t.style.top = n, t.style.transform = "translate(-50%, -50%)";
1673
+ break;
1674
+ case "top-left":
1675
+ t.style.left = i, t.style.top = n;
1676
+ break;
1677
+ case "top-center":
1678
+ t.style.left = i, t.style.top = n, t.style.transform = "translateX(-50%)";
1679
+ break;
1680
+ case "top-right":
1681
+ t.style.right = `calc(100% - ${i})`, t.style.top = n;
1682
+ break;
1683
+ case "center-left":
1684
+ t.style.left = i, t.style.top = n, t.style.transform = "translateY(-50%)";
1685
+ break;
1686
+ case "center-right":
1687
+ t.style.right = `calc(100% - ${i})`, t.style.top = n, t.style.transform = "translateY(-50%)";
1688
+ break;
1689
+ case "bottom-left":
1690
+ t.style.left = i, t.style.bottom = `calc(100% - ${n})`;
1691
+ break;
1692
+ case "bottom-center":
1693
+ t.style.left = i, t.style.bottom = `calc(100% - ${n})`, t.style.transform = "translateX(-50%)";
1694
+ break;
1695
+ case "bottom-right":
1696
+ t.style.right = `calc(100% - ${i})`, t.style.bottom = `calc(100% - ${n})`;
1697
+ break;
1698
+ }
1699
+ }
1700
+ function _t(t, e) {
1701
+ if (t.type === "text" && t.role === "footer") return "footer";
1702
+ switch (e) {
1703
+ case "center":
1704
+ return "default";
1705
+ case "intro":
1706
+ case "end":
1707
+ return t.type === "image" ? "right" : "left";
1708
+ case "section":
1709
+ case "quote":
1710
+ return "default";
1711
+ case "header-body":
1712
+ return t.type === "text" && (t.role === "title" || t.role === "heading") ? "header" : "body";
1713
+ case "split":
1714
+ return t.type === "text" && (t.role === "title" || t.role === "heading") ? "header" : t.type === "code" || t.type === "image" || t.type === "terminal" ? "right" : "left";
1715
+ case "code-focus":
1716
+ return t.type === "text" && (t.role === "title" || t.role === "heading") ? "header" : "code";
1717
+ case "image-left":
1718
+ return t.type === "image" ? "left" : "right";
1719
+ case "image-right":
1720
+ return t.type === "image" ? "right" : "left";
1721
+ case "image-full":
1722
+ return "default";
1723
+ case "image-grid":
1724
+ return t.type === "text" && (t.role === "title" || t.role === "heading") ? "header" : "body";
1725
+ case "full":
1726
+ case "blank":
1727
+ return "default";
1728
+ }
1729
+ }
1730
+ function me(t) {
1731
+ return t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
1732
+ }
1733
+ const Vt = /\.(jpe?g|png|gif|svg|webp|avif|bmp)$/i;
1734
+ function qt(t) {
1735
+ return Vt.test(t) || t.startsWith("resources/");
1736
+ }
1737
+ const ee = /(https?:\/\/[^\s<>"')\]]+)/g;
1738
+ function Se(t) {
1739
+ return ee.test(t) ? (ee.lastIndex = 0, t.replace(ee, (e) => {
1740
+ const a = e.length > 60 ? e.slice(0, 57) + "..." : e;
1741
+ return `<a href="${me(e)}" target="_blank" rel="noopener noreferrer">${me(a)}</a>`;
1742
+ })) : null;
1743
+ }
1744
+ function $e(t) {
1745
+ return /<(strong|em|del|code|a |br)\b/.test(t);
1746
+ }
1747
+ function Yt(t) {
1748
+ const e = document.createElement("div");
1749
+ e.className = "cue-text", e.dataset.role = t.role ?? "body";
1750
+ const a = t.content;
1751
+ if ($e(a))
1752
+ e.innerHTML = a;
1753
+ else {
1754
+ const i = Se(a);
1755
+ i ? e.innerHTML = i : e.textContent = a;
1756
+ }
1757
+ return e;
1758
+ }
1759
+ async function Gt(t, e) {
1760
+ var i;
1761
+ const a = document.createElement("div");
1762
+ a.className = "cue-code";
1763
+ try {
1764
+ const n = await Ot(e.codeTheme ?? "vitesse-dark");
1765
+ a.innerHTML = n.codeToHtml(t.content, {
1766
+ lang: t.language,
1767
+ theme: e.codeTheme ?? "vitesse-dark"
1768
+ });
1769
+ } catch {
1770
+ const n = document.createElement("pre"), s = document.createElement("code");
1771
+ s.textContent = t.content, n.appendChild(s), a.appendChild(n);
1772
+ }
1773
+ if ((i = t.highlightLines) != null && i.length) {
1774
+ const n = a.querySelectorAll(".line"), s = n.length;
1775
+ n.forEach((r, l) => {
1776
+ r.dataset.line = String(l + 1), t.highlightLines.includes(l + 1) || r.classList.add("cue-code-line-dimmed");
1777
+ }), a.classList.add("cue-code-steppable"), a.dataset.totalLines = String(s), a.dataset.highlightLines = t.highlightLines.join(","), a.dataset.codeStepIndex = "0";
1778
+ }
1779
+ return a;
1780
+ }
1781
+ function Kt(t, e) {
1782
+ const a = document.createElement("div");
1783
+ if (a.className = "cue-image", t.placeholder) {
1784
+ const i = document.createElement("div");
1785
+ i.className = "cue-image-placeholder";
1786
+ const n = document.createElement("div");
1787
+ if (n.className = "cue-image-placeholder-icon", n.innerHTML = '<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><path d="m21 15-5-5L5 21"/></svg>', i.appendChild(n), t.alt) {
1788
+ const s = document.createElement("div");
1789
+ s.className = "cue-image-placeholder-label", s.textContent = t.alt, i.appendChild(s);
1790
+ }
1791
+ a.appendChild(i);
1792
+ } else {
1793
+ const i = document.createElement("img"), n = t.src.startsWith("resources/") && e ? e + t.src : t.src;
1794
+ i.src = n, t.alt && (i.alt = t.alt), t.width && (i.style.width = t.width), t.height && (i.style.height = t.height), a.appendChild(i);
1795
+ }
1796
+ return a;
1797
+ }
1798
+ function Jt(t) {
1799
+ const e = t.ordered ? "ol" : "ul", a = document.createElement(e);
1800
+ a.className = "cue-list";
1801
+ for (const i of t.items) {
1802
+ const n = document.createElement("li");
1803
+ if ($e(i))
1804
+ n.innerHTML = i;
1805
+ else {
1806
+ const s = Se(i);
1807
+ s ? n.innerHTML = s : n.textContent = i;
1808
+ }
1809
+ a.appendChild(n);
1810
+ }
1811
+ return a;
1812
+ }
1813
+ const fe = [
1814
+ "#3b82f6",
1815
+ // blue
1816
+ "#8b5cf6",
1817
+ // violet
1818
+ "#06b6d4",
1819
+ // cyan
1820
+ "#f59e0b",
1821
+ // amber
1822
+ "#10b981",
1823
+ // emerald
1824
+ "#ef4444"
1825
+ // red
1826
+ ];
1827
+ function Xt(t) {
1828
+ const e = document.createElement("div"), a = t.headers.length >= 3;
1829
+ e.className = a ? "cue-table cue-table--styled" : "cue-table";
1830
+ const i = document.createElement("table"), n = document.createElement("thead"), s = document.createElement("tr");
1831
+ t.headers.forEach((l, u) => {
1832
+ var o;
1833
+ const c = document.createElement("th");
1834
+ c.innerHTML = l, (o = t.alignments) != null && o[u] && (c.style.textAlign = t.alignments[u]), a && (c.style.backgroundColor = fe[u % fe.length]), s.appendChild(c);
1835
+ }), n.appendChild(s), i.appendChild(n);
1836
+ const r = document.createElement("tbody");
1837
+ for (const l of t.rows) {
1838
+ const u = document.createElement("tr");
1839
+ l.forEach((c, o) => {
1840
+ var p;
1841
+ const d = document.createElement("td");
1842
+ d.innerHTML = c, (p = t.alignments) != null && p[o] && (d.style.textAlign = t.alignments[o]), u.appendChild(d);
1843
+ }), r.appendChild(u);
1844
+ }
1845
+ return i.appendChild(r), e.appendChild(i), e;
1846
+ }
1847
+ function Zt() {
1848
+ const t = document.createElement("hr");
1849
+ return t.className = "cue-divider", t;
1850
+ }
1851
+ function Ut(t, e) {
1852
+ const a = document.createElement("div");
1853
+ return a.className = "cue-error-placeholder", a.innerHTML = `<svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg><span>Failed to render ${t.type}</span>`, console.warn(`[CuppaCue] Failed to render element "${t.id}" (${t.type}):`, e), a;
1854
+ }
1855
+ async function te(t, e, a) {
1856
+ let i;
1857
+ try {
1858
+ switch (t.type) {
1859
+ case "text":
1860
+ i = Yt(t);
1861
+ break;
1862
+ case "code":
1863
+ i = await Gt(t, e);
1864
+ break;
1865
+ case "image":
1866
+ i = Kt(t, a);
1867
+ break;
1868
+ case "list":
1869
+ i = Jt(t);
1870
+ break;
1871
+ case "divider":
1872
+ i = Zt();
1873
+ break;
1874
+ case "table":
1875
+ i = Xt(t);
1876
+ break;
1877
+ case "mermaid":
1878
+ i = await ut(t);
1879
+ break;
1880
+ case "chart":
1881
+ i = await ht(t, e);
1882
+ break;
1883
+ case "cards":
1884
+ i = at(t, e);
1885
+ break;
1886
+ case "stats":
1887
+ i = st(t);
1888
+ break;
1889
+ case "terminal":
1890
+ i = ot(t);
1891
+ break;
1892
+ case "flow":
1893
+ i = mt(t);
1894
+ break;
1895
+ }
1896
+ } catch (n) {
1897
+ i = Ut(t, n);
1898
+ }
1899
+ if (i.dataset.elementId = t.id, i.style.opacity = "0", t.style) {
1900
+ const n = t.style;
1901
+ n.fontSize && (i.style.fontSize = n.fontSize), n.color && (i.style.color = n.color), n.fontWeight && (i.style.fontWeight = n.fontWeight), n.fontFamily && (i.style.fontFamily = n.fontFamily), n.textAlign && (i.style.textAlign = n.textAlign), n.padding && (i.style.padding = n.padding);
1902
+ }
1903
+ return i;
1904
+ }
1905
+ async function ie(t, e, a = "") {
1906
+ const i = t.sceneTemplate ? Rt(t.sceneTemplate) : void 0;
1907
+ if (i)
1908
+ return i.render(t, e, te, a);
1909
+ const n = document.createElement("div");
1910
+ if (n.className = "cue-scene", n.dataset.sceneId = t.id, t.background)
1911
+ if (qt(t.background)) {
1912
+ const r = t.background.startsWith("resources/") && a ? a + t.background : t.background;
1913
+ n.style.backgroundImage = `url("${r}")`, n.style.backgroundSize = "cover", n.style.backgroundPosition = "center";
1914
+ } else
1915
+ n.style.background = t.background;
1916
+ if (t.class)
1917
+ for (const r of t.class.split(/\s+/))
1918
+ r && n.classList.add(r);
1919
+ t.accentBar && (n.dataset.accentBar = t.accentBar.position ?? "top", n.style.setProperty("--cue-accent-bar-color", t.accentBar.color), t.accentBar.height && n.style.setProperty("--cue-accent-bar-height", t.accentBar.height));
1920
+ const s = /* @__PURE__ */ new Map();
1921
+ if (t.layout) {
1922
+ n.dataset.layout = t.layout;
1923
+ const r = /* @__PURE__ */ new Map();
1924
+ for (const l of t.elements) {
1925
+ const u = _t(l, t.layout);
1926
+ r.has(u) || r.set(u, []), r.get(u).push(l);
1927
+ }
1928
+ for (const [l, u] of r) {
1929
+ const c = document.createElement("div");
1930
+ c.className = "cue-slot", c.dataset.slot = l;
1931
+ for (const o of u) {
1932
+ const d = await te(o, e, a);
1933
+ l !== "header" && (d.style.flexGrow = String(Qe(o))), s.set(o.id, d), c.appendChild(d);
1934
+ }
1935
+ n.appendChild(c);
1936
+ }
1937
+ } else
1938
+ for (const r of t.elements) {
1939
+ const l = await te(r, e, a);
1940
+ Wt(l, r.position), s.set(r.id, l), n.appendChild(l);
1941
+ }
1942
+ return { container: n, elementMap: s };
1943
+ }
1944
+ const Te = {
1945
+ fadeIn: {
1946
+ keyframes: [
1947
+ { opacity: 0 },
1948
+ { opacity: 1 }
1949
+ ]
1950
+ },
1951
+ fadeOut: {
1952
+ keyframes: [
1953
+ { opacity: 1 },
1954
+ { opacity: 0 }
1955
+ ]
1956
+ },
1957
+ fadeInUp: {
1958
+ keyframes: [
1959
+ { opacity: 0, transform: "translateY(30px)" },
1960
+ { opacity: 1, transform: "translateY(0)" }
1961
+ ]
1962
+ },
1963
+ fadeInDown: {
1964
+ keyframes: [
1965
+ { opacity: 0, transform: "translateY(-30px)" },
1966
+ { opacity: 1, transform: "translateY(0)" }
1967
+ ]
1968
+ },
1969
+ fadeInLeft: {
1970
+ keyframes: [
1971
+ { opacity: 0, transform: "translateX(-40px)" },
1972
+ { opacity: 1, transform: "translateX(0)" }
1973
+ ]
1974
+ },
1975
+ fadeInRight: {
1976
+ keyframes: [
1977
+ { opacity: 0, transform: "translateX(40px)" },
1978
+ { opacity: 1, transform: "translateX(0)" }
1979
+ ]
1980
+ },
1981
+ typewriter: {
1982
+ keyframes: [
1983
+ { clipPath: "inset(0 100% 0 0)", opacity: 1 },
1984
+ { clipPath: "inset(0 0% 0 0)", opacity: 1 }
1985
+ ],
1986
+ options: {
1987
+ easing: "steps(40, end)"
1988
+ }
1989
+ },
1990
+ revealDown: {
1991
+ keyframes: [
1992
+ { clipPath: "inset(0 0 100% 0)", opacity: 1 },
1993
+ { clipPath: "inset(0 0 0% 0)", opacity: 1 }
1994
+ ],
1995
+ options: {
1996
+ easing: "steps(20, end)"
1997
+ }
1998
+ },
1999
+ scale: {
2000
+ keyframes: [
2001
+ { opacity: 0, transform: "scale(0.7)" },
2002
+ { opacity: 1, transform: "scale(1)" }
2003
+ ],
2004
+ options: {
2005
+ easing: "cubic-bezier(0.34, 1.56, 0.64, 1)"
2006
+ }
2007
+ },
2008
+ highlight: {
2009
+ keyframes: [
2010
+ { backgroundColor: "transparent", opacity: 1 },
2011
+ { backgroundColor: "rgba(56, 189, 248, 0.2)", opacity: 1 }
2012
+ ]
2013
+ },
2014
+ bounceIn: {
2015
+ keyframes: [
2016
+ { opacity: 0, transform: "scale(0.3)" },
2017
+ { opacity: 1, transform: "scale(1.05)" },
2018
+ { opacity: 1, transform: "scale(0.95)" },
2019
+ { opacity: 1, transform: "scale(1)" }
2020
+ ],
2021
+ options: {
2022
+ easing: "cubic-bezier(0.215, 0.61, 0.355, 1)"
2023
+ }
2024
+ },
2025
+ blurIn: {
2026
+ keyframes: [
2027
+ { opacity: 0, filter: "blur(20px)" },
2028
+ { opacity: 1, filter: "blur(0px)" }
2029
+ ],
2030
+ options: {
2031
+ easing: "cubic-bezier(0.4, 0, 0.2, 1)"
2032
+ }
2033
+ },
2034
+ rotateIn: {
2035
+ keyframes: [
2036
+ { opacity: 0, transform: "rotate(-15deg) scale(0.9)" },
2037
+ { opacity: 1, transform: "rotate(0deg) scale(1)" }
2038
+ ],
2039
+ options: {
2040
+ easing: "cubic-bezier(0.34, 1.56, 0.64, 1)"
2041
+ }
2042
+ },
2043
+ slideUp: {
2044
+ keyframes: [
2045
+ { opacity: 0, transform: "translateY(100%)" },
2046
+ { opacity: 1, transform: "translateY(0)" }
2047
+ ],
2048
+ options: {
2049
+ easing: "cubic-bezier(0.4, 0, 0.2, 1)"
2050
+ }
2051
+ },
2052
+ slideDown: {
2053
+ keyframes: [
2054
+ { opacity: 0, transform: "translateY(-100%)" },
2055
+ { opacity: 1, transform: "translateY(0)" }
2056
+ ],
2057
+ options: {
2058
+ easing: "cubic-bezier(0.4, 0, 0.2, 1)"
2059
+ }
2060
+ },
2061
+ zoomIn: {
2062
+ keyframes: [
2063
+ { opacity: 0, transform: "scale(0)" },
2064
+ { opacity: 1, transform: "scale(1)" }
2065
+ ],
2066
+ options: {
2067
+ easing: "cubic-bezier(0.34, 1.56, 0.64, 1)"
2068
+ }
2069
+ },
2070
+ codeStep: {
2071
+ keyframes: [
2072
+ { opacity: 0.3 },
2073
+ { opacity: 1 }
2074
+ ],
2075
+ options: {
2076
+ easing: "cubic-bezier(0.4, 0, 0.2, 1)"
2077
+ }
2078
+ },
2079
+ chartStep: {
2080
+ keyframes: [
2081
+ { opacity: 0.3 },
2082
+ { opacity: 1 }
2083
+ ],
2084
+ options: {
2085
+ easing: "cubic-bezier(0.4, 0, 0.2, 1)"
2086
+ }
2087
+ },
2088
+ flowReveal: {
2089
+ keyframes: [
2090
+ { opacity: 0 },
2091
+ { opacity: 1 }
2092
+ ],
2093
+ options: {
2094
+ easing: "cubic-bezier(0.4, 0, 0.2, 1)"
2095
+ }
2096
+ }
2097
+ };
2098
+ function Qt(t, e) {
2099
+ const i = e - 300;
2100
+ t.style.opacity = "1";
2101
+ const n = t.querySelector("pre");
2102
+ return n ? (t.style.background = "var(--cue-code-bg)", t.style.borderRadius = "12px", n.style.setProperty("background", "transparent", "important"), n.style.clipPath = "inset(0 0 100% 0)", t.animate(
2103
+ [{ opacity: 0 }, { opacity: 1 }],
2104
+ { duration: 300, fill: "forwards", easing: "ease-out" }
2105
+ ), n.animate(
2106
+ [
2107
+ { clipPath: "inset(0 0 100% 0)" },
2108
+ { clipPath: "inset(0 0 0% 0)" }
2109
+ ],
2110
+ {
2111
+ duration: i,
2112
+ fill: "forwards",
2113
+ easing: "steps(20, end)",
2114
+ delay: 300
2115
+ }
2116
+ )) : t.animate(
2117
+ [{ opacity: 0 }, { opacity: 1 }],
2118
+ { duration: e, fill: "forwards", easing: "cubic-bezier(0.4, 0, 0.2, 1)" }
2119
+ );
2120
+ }
2121
+ function en(t, e) {
2122
+ const a = t.dataset.highlightLines, i = parseInt(t.dataset.totalLines ?? "0", 10);
2123
+ if (!a || i === 0)
2124
+ return t.animate([{ opacity: 1 }], { duration: 0, fill: "forwards" });
2125
+ const n = a.split(",").map(Number).sort((d, p) => d - p), s = [];
2126
+ let r = [n[0]];
2127
+ for (let d = 1; d < n.length; d++)
2128
+ n[d] === n[d - 1] + 1 ? r.push(n[d]) : (s.push(r), r = [n[d]]);
2129
+ if (s.push(r), s.length > 1) {
2130
+ const d = [];
2131
+ for (let p = 1; p <= i; p++) d.push(p);
2132
+ s.push(d);
2133
+ }
2134
+ const l = parseInt(t.dataset.codeStepIndex ?? "0", 10) + 1;
2135
+ t.dataset.codeStepIndex = String(l);
2136
+ const u = s[Math.min(l, s.length - 1)], c = new Set(u);
2137
+ return t.querySelectorAll(".line").forEach((d) => {
2138
+ const p = parseInt(d.dataset.line ?? "0", 10);
2139
+ c.has(p) ? d.classList.remove("cue-code-line-dimmed") : d.classList.add("cue-code-line-dimmed");
2140
+ }), t.animate(
2141
+ [{ opacity: 1 }, { opacity: 1 }],
2142
+ { duration: e, fill: "forwards", easing: "linear" }
2143
+ );
2144
+ }
2145
+ function tn(t, e) {
2146
+ const a = t.querySelectorAll(".cue-flow-node:not([data-revealed])"), i = t.querySelectorAll(".cue-flow-edge:not([data-revealed])");
2147
+ if (a.length > 0) {
2148
+ const n = a[0], s = n.getAttribute("data-node-id");
2149
+ n.setAttribute("data-revealed", ""), i.forEach((r) => {
2150
+ r.getAttribute("data-to") === s && r.setAttribute("data-revealed", "");
2151
+ });
2152
+ }
2153
+ return t.animate(
2154
+ [{ opacity: 1 }, { opacity: 1 }],
2155
+ { duration: e, fill: "forwards", easing: "linear" }
2156
+ );
2157
+ }
2158
+ function nn(t, e) {
2159
+ const a = t.__cueChart, i = t.__cueChartDatasets;
2160
+ if (a && i) {
2161
+ let n = t.__cueChartStep ?? 0;
2162
+ n++, n < i.length && (a.data.datasets[n] = { ...i[n], hidden: !1 }, a.update("active"), t.__cueChartStep = n);
2163
+ }
2164
+ return t.animate(
2165
+ [{ opacity: 1 }, { opacity: 1 }],
2166
+ { duration: e, fill: "forwards", easing: "linear" }
2167
+ );
2168
+ }
2169
+ function an(t, e, a = 600) {
2170
+ var s;
2171
+ const i = Te[e];
2172
+ if (!i)
2173
+ throw new Error(`Unknown animation: ${e}`);
2174
+ return e === "revealDown" && t.classList.contains("cue-code") ? Qt(t, a) : e === "codeStep" && t.classList.contains("cue-code-steppable") ? en(t, a) : e === "chartStep" && t.classList.contains("cue-chart") ? nn(t, a) : e === "flowReveal" && t.classList.contains("cue-flow") ? tn(t, a) : ((e === "typewriter" || e === "revealDown" || e === "bounceIn" || e === "slideUp" || e === "slideDown") && (t.style.opacity = "1"), t.animate(i.keyframes, {
2175
+ duration: a,
2176
+ fill: "forwards",
2177
+ easing: ((s = i.options) == null ? void 0 : s.easing) ?? "cubic-bezier(0.4, 0, 0.2, 1)",
2178
+ ...i.options
2179
+ }));
2180
+ }
2181
+ function kn() {
2182
+ return Object.keys(Te);
2183
+ }
2184
+ class ge {
2185
+ constructor(e = 600) {
2186
+ f(this, "entry", null);
2187
+ f(this, "elementMap", /* @__PURE__ */ new Map());
2188
+ f(this, "currentTime", 0);
2189
+ f(this, "playing", !1);
2190
+ f(this, "paused", !1);
2191
+ f(this, "rafId", null);
2192
+ f(this, "lastTimestamp", null);
2193
+ f(this, "firedEvents", /* @__PURE__ */ new Set());
2194
+ f(this, "firedMarkers", /* @__PURE__ */ new Set());
2195
+ f(this, "activeAnimations", []);
2196
+ f(this, "listeners", []);
2197
+ f(this, "defaultDuration");
2198
+ f(this, "tick", () => {
2199
+ if (!this.playing || !this.entry) return;
2200
+ const e = performance.now();
2201
+ if (this.lastTimestamp !== null) {
2202
+ const a = e - this.lastTimestamp;
2203
+ this.currentTime += a;
2204
+ }
2205
+ this.lastTimestamp = e;
2206
+ for (let a = 0; a < this.entry.events.length; a++) {
2207
+ if (this.firedEvents.has(a)) continue;
2208
+ const i = this.entry.events[a];
2209
+ this.currentTime >= i.at && (this.fireEvent(i), this.firedEvents.add(a));
2210
+ }
2211
+ if (this.entry.markers)
2212
+ for (let a = 0; a < this.entry.markers.length; a++) {
2213
+ if (this.firedMarkers.has(a)) continue;
2214
+ const i = this.entry.markers[a];
2215
+ if (this.currentTime >= i.at && (this.firedMarkers.add(a), this.emit("marker", i), i.action === "pause")) {
2216
+ this.pause();
2217
+ return;
2218
+ }
2219
+ }
2220
+ if (this.currentTime >= this.entry.duration) {
2221
+ this.playing = !1, this.emit("complete");
2222
+ return;
2223
+ }
2224
+ this.emit("tick"), this.rafId = requestAnimationFrame(this.tick);
2225
+ });
2226
+ this.defaultDuration = e;
2227
+ }
2228
+ on(e) {
2229
+ return this.listeners.push(e), () => {
2230
+ this.listeners = this.listeners.filter((a) => a !== e);
2231
+ };
2232
+ }
2233
+ emit(e, a) {
2234
+ for (const i of this.listeners)
2235
+ i(e, a);
2236
+ }
2237
+ load(e, a) {
2238
+ this.stop(), this.entry = e, this.elementMap = a, this.currentTime = 0, this.firedEvents.clear(), this.firedMarkers.clear(), this.activeAnimations = [];
2239
+ }
2240
+ play() {
2241
+ if (this.entry) {
2242
+ if (this.paused) {
2243
+ this.resume();
2244
+ return;
2245
+ }
2246
+ this.playing = !0, this.paused = !1, this.lastTimestamp = null, this.tick();
2247
+ }
2248
+ }
2249
+ pause() {
2250
+ if (this.playing) {
2251
+ this.playing = !1, this.paused = !0, this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null);
2252
+ for (const e of this.activeAnimations)
2253
+ e.playState === "running" && e.pause();
2254
+ this.emit("pause");
2255
+ }
2256
+ }
2257
+ resume() {
2258
+ if (this.paused) {
2259
+ this.paused = !1, this.playing = !0;
2260
+ for (const e of this.activeAnimations)
2261
+ e.playState === "paused" && e.play();
2262
+ this.lastTimestamp = null, this.tick(), this.emit("resume");
2263
+ }
2264
+ }
2265
+ stop() {
2266
+ this.playing = !1, this.paused = !1, this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null);
2267
+ for (const e of this.activeAnimations)
2268
+ e.cancel();
2269
+ this.activeAnimations = [], this.lastTimestamp = null;
2270
+ }
2271
+ /** Advance timeline to the end, firing all remaining events immediately */
2272
+ skipToEnd() {
2273
+ if (this.entry) {
2274
+ for (let e = 0; e < this.entry.events.length; e++)
2275
+ this.firedEvents.has(e) || (this.fireEvent(this.entry.events[e]), this.firedEvents.add(e));
2276
+ this.currentTime = this.entry.duration, this.stop(), this.emit("complete");
2277
+ }
2278
+ }
2279
+ isPlaying() {
2280
+ return this.playing;
2281
+ }
2282
+ isPaused() {
2283
+ return this.paused;
2284
+ }
2285
+ getCurrentTime() {
2286
+ return this.currentTime;
2287
+ }
2288
+ /** Returns true if there are unfired events remaining */
2289
+ hasUnfiredEvents() {
2290
+ return this.entry ? this.firedEvents.size < this.entry.events.length : !1;
2291
+ }
2292
+ /** Returns true if there are unfired pause markers remaining */
2293
+ hasUnfiredMarkers() {
2294
+ var i;
2295
+ if (!((i = this.entry) != null && i.markers)) return !1;
2296
+ const e = this.entry.markers.filter((n) => n.action === "pause");
2297
+ return [...this.firedMarkers].filter(
2298
+ (n) => this.entry.markers[n].action === "pause"
2299
+ ).length < e.length;
2300
+ }
2301
+ /** Total step count for this scene (number of pause markers + 1 for the final state) */
2302
+ totalSteps() {
2303
+ var a;
2304
+ return (a = this.entry) != null && a.markers ? this.entry.markers.filter((i) => i.action === "pause").length + 1 : 1;
2305
+ }
2306
+ /** Skip forward to the next unfired marker, firing all events up to that point */
2307
+ skipToNextMarker() {
2308
+ var e;
2309
+ if ((e = this.entry) != null && e.markers)
2310
+ for (let a = 0; a < this.entry.markers.length; a++) {
2311
+ if (this.firedMarkers.has(a)) continue;
2312
+ const i = this.entry.markers[a];
2313
+ for (let n = 0; n < (this.entry.events ?? []).length; n++) {
2314
+ if (this.firedEvents.has(n)) continue;
2315
+ const s = this.entry.events[n];
2316
+ s.at <= i.at && (this.fireEvent(s), this.firedEvents.add(n));
2317
+ }
2318
+ this.currentTime = i.at, this.firedMarkers.add(a), this.emit("marker", i), i.action === "pause" && this.pause();
2319
+ return;
2320
+ }
2321
+ }
2322
+ /** Current step (how many pause markers have been fired) */
2323
+ currentStep() {
2324
+ var a;
2325
+ if (!((a = this.entry) != null && a.markers)) return 1;
2326
+ let e = 0;
2327
+ for (let i = 0; i < this.entry.markers.length; i++)
2328
+ this.firedMarkers.has(i) && this.entry.markers[i].action === "pause" && e++;
2329
+ return e + 1;
2330
+ }
2331
+ fireEvent(e) {
2332
+ const a = this.elementMap.get(e.elementId);
2333
+ if (!a) {
2334
+ console.warn(`[CuppaCue] Element not found: ${e.elementId}`);
2335
+ return;
2336
+ }
2337
+ const i = e.duration ?? this.defaultDuration, n = an(a, e.animation, i);
2338
+ this.activeAnimations.push(n), n.finished.then(() => {
2339
+ this.activeAnimations = this.activeAnimations.filter((s) => s !== n);
2340
+ }).catch(() => {
2341
+ });
2342
+ }
2343
+ }
2344
+ const Y = class Y {
2345
+ constructor(e) {
2346
+ f(this, "actions");
2347
+ f(this, "boundKeyHandler");
2348
+ f(this, "boundClickHandler");
2349
+ f(this, "boundTouchStart");
2350
+ f(this, "boundTouchEnd");
2351
+ f(this, "container", null);
2352
+ f(this, "touchStartX", 0);
2353
+ f(this, "touchStartY", 0);
2354
+ f(this, "lastNavTime", 0);
2355
+ this.actions = e, this.boundKeyHandler = this.handleKeyDown.bind(this), this.boundClickHandler = this.handleClick.bind(this), this.boundTouchStart = this.handleTouchStart.bind(this), this.boundTouchEnd = this.handleTouchEnd.bind(this);
2356
+ }
2357
+ attach(e) {
2358
+ this.container = e, document.addEventListener("keydown", this.boundKeyHandler), e.addEventListener("click", this.boundClickHandler), e.addEventListener("touchstart", this.boundTouchStart, { passive: !0 }), e.addEventListener("touchend", this.boundTouchEnd), e.style.cursor = "pointer", e.tabIndex = 0;
2359
+ }
2360
+ detach() {
2361
+ document.removeEventListener("keydown", this.boundKeyHandler), this.container && (this.container.removeEventListener("click", this.boundClickHandler), this.container.removeEventListener("touchstart", this.boundTouchStart), this.container.removeEventListener("touchend", this.boundTouchEnd), this.container = null);
2362
+ }
2363
+ throttleNav() {
2364
+ const e = Date.now();
2365
+ return e - this.lastNavTime < Y.NAV_COOLDOWN ? !0 : (this.lastNavTime = e, !1);
2366
+ }
2367
+ handleKeyDown(e) {
2368
+ switch (e.key) {
2369
+ case "ArrowRight":
2370
+ case "ArrowDown":
2371
+ case " ":
2372
+ e.preventDefault(), this.throttleNav() || this.actions.next();
2373
+ break;
2374
+ case "ArrowLeft":
2375
+ case "ArrowUp":
2376
+ e.preventDefault(), this.throttleNav() || this.actions.prev();
2377
+ break;
2378
+ case "f":
2379
+ e.preventDefault(), this.actions.toggleFullscreen();
2380
+ break;
2381
+ case "Escape":
2382
+ this.actions.isOverviewVisible() ? (e.preventDefault(), this.actions.toggleOverview()) : document.fullscreenElement && (e.preventDefault(), document.exitFullscreen());
2383
+ break;
2384
+ case "p":
2385
+ e.preventDefault(), this.actions.togglePlayPause();
2386
+ break;
2387
+ case "n":
2388
+ e.preventDefault(), this.actions.openPresenterView();
2389
+ break;
2390
+ case "o":
2391
+ e.preventDefault(), this.actions.toggleOverview();
2392
+ break;
2393
+ }
2394
+ }
2395
+ handleClick(e) {
2396
+ this.throttleNav() || this.actions.next();
2397
+ }
2398
+ handleTouchStart(e) {
2399
+ const a = e.touches[0];
2400
+ this.touchStartX = a.clientX, this.touchStartY = a.clientY;
2401
+ }
2402
+ handleTouchEnd(e) {
2403
+ const a = e.changedTouches[0], i = a.clientX - this.touchStartX, n = a.clientY - this.touchStartY;
2404
+ Math.abs(n) > Math.abs(i) || Math.abs(i) < 50 || (e.preventDefault(), !this.throttleNav() && (i < 0 ? this.actions.next() : this.actions.prev()));
2405
+ }
2406
+ };
2407
+ f(Y, "NAV_COOLDOWN", 150);
2408
+ let ne = Y;
2409
+ class sn {
2410
+ constructor(e, a, i) {
2411
+ f(this, "overlay", null);
2412
+ f(this, "container");
2413
+ f(this, "cupFile");
2414
+ f(this, "visible", !1);
2415
+ f(this, "onSelectScene");
2416
+ this.container = e, this.cupFile = a, this.onSelectScene = i;
2417
+ }
2418
+ isVisible() {
2419
+ return this.visible;
2420
+ }
2421
+ async toggle() {
2422
+ this.visible ? this.hide() : await this.show();
2423
+ }
2424
+ async show() {
2425
+ if (this.overlay) return;
2426
+ this.visible = !0, this.overlay = document.createElement("div"), this.overlay.className = "cue-overview", this.overlay.addEventListener("click", (i) => {
2427
+ i.target === this.overlay && this.hide();
2428
+ });
2429
+ const e = document.createElement("div");
2430
+ e.className = "cue-overview-grid";
2431
+ const a = this.cupFile.content.scenes;
2432
+ for (let i = 0; i < a.length; i++) {
2433
+ const n = await this.createThumbnail(a[i], i);
2434
+ e.appendChild(n);
2435
+ }
2436
+ this.overlay.appendChild(e), this.container.appendChild(this.overlay), requestAnimationFrame(() => {
2437
+ var i;
2438
+ (i = this.overlay) == null || i.classList.add("cue-overview--visible");
2439
+ });
2440
+ }
2441
+ hide() {
2442
+ if (!this.overlay) return;
2443
+ this.visible = !1, this.overlay.classList.remove("cue-overview--visible");
2444
+ const e = this.overlay;
2445
+ setTimeout(() => {
2446
+ e.remove();
2447
+ }, 300), this.overlay = null;
2448
+ }
2449
+ destroy() {
2450
+ this.hide();
2451
+ }
2452
+ async createThumbnail(e, a) {
2453
+ const i = document.createElement("div");
2454
+ i.className = "cue-overview-thumb", i.dataset.index = String(a);
2455
+ const n = document.createElement("div");
2456
+ n.className = "cue-overview-label", n.textContent = String(a + 1), i.appendChild(n);
2457
+ const s = document.createElement("div");
2458
+ s.className = "cue-overview-scene";
2459
+ try {
2460
+ const r = await ie(e, this.cupFile.theme);
2461
+ for (const [, l] of r.elementMap)
2462
+ l.style.opacity = "1";
2463
+ s.appendChild(r.container);
2464
+ } catch {
2465
+ s.textContent = `Scene ${a + 1}`;
2466
+ }
2467
+ return i.appendChild(s), i.addEventListener("click", (r) => {
2468
+ r.stopPropagation(), this.onSelectScene(a), this.hide();
2469
+ }), i;
2470
+ }
2471
+ }
2472
+ const on = '@import"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap";:root{--cue-bg: #0f172a;--cue-fg: #e2e8f0;--cue-primary: #38bdf8;--cue-secondary: #a78bfa;--cue-accent: #f472b6;--cue-code-bg: #1e293b;--cue-code-fg: #e2e8f0;--cue-font-heading: "Inter", system-ui, sans-serif;--cue-font-body: "Inter", system-ui, sans-serif;--cue-font-code: "JetBrains Mono", "Fira Code", monospace;--cue-shadow: 0 4px 24px rgba(0, 0, 0, .12);--cue-shadow-lg: 0 8px 32px rgba(0, 0, 0, .18)}', rn = ".cue-text{line-height:1.5}.cue-text[data-role=title]{font-family:var(--cue-font-heading);font-size:var(--cue-typo-title-size, clamp(1.5rem, 5vw, 3.5rem));font-weight:var(--cue-typo-title-weight, 700);line-height:var(--cue-typo-title-lh, 1.2);letter-spacing:var(--cue-typo-title-ls, normal);text-transform:var(--cue-typo-title-tt, none);color:var(--cue-fg);text-align:center}.cue-text[data-role=subtitle]{font-family:var(--cue-font-body);font-size:var(--cue-typo-subtitle-size, clamp(.9rem, 2.5vw, 1.5rem));font-weight:var(--cue-typo-subtitle-weight, 400);line-height:var(--cue-typo-subtitle-lh, 1.5);letter-spacing:var(--cue-typo-subtitle-ls, normal);text-transform:var(--cue-typo-subtitle-tt, none);color:var(--cue-secondary);text-align:center}.cue-text[data-role=heading]{font-family:var(--cue-font-heading);font-size:var(--cue-typo-heading-size, 2.25rem);font-weight:var(--cue-typo-heading-weight, 600);line-height:var(--cue-typo-heading-lh, 1.3);letter-spacing:var(--cue-typo-heading-ls, normal);text-transform:var(--cue-typo-heading-tt, none);color:var(--cue-primary);text-align:center}.cue-text[data-role=body]{font-family:var(--cue-font-body);font-size:var(--cue-typo-body-size, 1.25rem);font-weight:var(--cue-typo-body-weight, 400);line-height:var(--cue-typo-body-lh, 1.5);letter-spacing:var(--cue-typo-body-ls, normal);text-transform:var(--cue-typo-body-tt, none);color:var(--cue-fg)}.cue-text[data-role=caption]{font-family:var(--cue-font-body);font-size:var(--cue-typo-caption-size, 1rem);font-weight:var(--cue-typo-caption-weight, 400);line-height:var(--cue-typo-caption-lh, 1.5);letter-spacing:var(--cue-typo-caption-ls, normal);text-transform:var(--cue-typo-caption-tt, none);color:var(--cue-fg);opacity:.6;text-align:center}.cue-text[data-role=footer]{font-family:var(--cue-font-body);font-size:var(--cue-typo-footer-size, .85rem);font-weight:var(--cue-typo-footer-weight, 400);line-height:var(--cue-typo-footer-lh, 1.5);letter-spacing:var(--cue-typo-footer-ls, normal);text-transform:var(--cue-typo-footer-tt, none);color:var(--cue-secondary);opacity:.6}.cue-code{font-family:var(--cue-font-code);font-size:clamp(1rem,1.6vw,1.5rem);line-height:1.7;overflow:hidden}.cue-code pre{background:var(--cue-code-bg)!important;border-radius:12px;padding:1.5rem;overflow-x:auto;margin:0;box-shadow:var(--cue-shadow)}.cue-code code{font-family:inherit}.cue-code-steppable .line{transition:opacity .3s ease}.cue-code-line-dimmed{opacity:.3}.cue-list{font-family:var(--cue-font-body);font-size:1.25rem;line-height:2;color:var(--cue-fg);padding-left:1.5em}.cue-list li{margin-bottom:.25em}.cue-list li::marker{color:var(--cue-primary)}.cue-divider{border:none;height:2px;background:linear-gradient(90deg,transparent,var(--cue-primary),transparent)}.cue-image{display:flex;justify-content:center;align-items:center}.cue-image img{max-width:100%;max-height:100%;border-radius:8px;object-fit:contain}.cue-scene[data-layout] .cue-image{flex:1 1 0;min-height:0}.cue-scene[data-layout] .cue-image img{width:100%;height:100%;object-fit:contain}.cue-scene[data-layout=full] .cue-image img{border-radius:0}.cue-image-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;width:100%;min-height:200px;padding:2rem;border:2px dashed var(--cue-secondary);border-radius:12px;background:color-mix(in srgb,var(--cue-secondary) 8%,transparent)}.cue-image-placeholder-icon{color:var(--cue-secondary);opacity:.6}.cue-image-placeholder-label{font-size:.9rem;color:var(--cue-secondary);opacity:.8;font-style:italic;text-align:center;max-width:80%}.cue-text a,.cue-list a{color:var(--cue-primary);text-decoration:underline;text-underline-offset:2px;transition:opacity .2s ease}.cue-text a:hover,.cue-list a:hover{opacity:.8}.cue-scene[data-layout] .cue-text[data-role=heading],.cue-scene[data-layout] .cue-text[data-role=title]{text-align:left}.cue-scene[data-layout=center] .cue-text[data-role=heading],.cue-scene[data-layout=center] .cue-text[data-role=title]{text-align:center}.cue-scene[data-layout] .cue-code{flex:1 1 0;min-height:0}.cue-scene[data-layout] .cue-code pre{height:100%;overflow:auto}.cue-scene[data-layout] .cue-list{flex:1 1 0}.cue-text strong,.cue-list strong{font-weight:700}.cue-text em,.cue-list em{font-style:italic}.cue-text del,.cue-list del{text-decoration:line-through;opacity:.7}.cue-text code,.cue-list code{font-family:var(--cue-font-code);font-size:.85em;background:color-mix(in srgb,var(--cue-code-bg) 60%,transparent);padding:.15em .4em;border-radius:4px}.cue-table{font-family:var(--cue-font-body);font-size:1.1rem;line-height:1.6;color:var(--cue-fg);overflow-x:auto;width:100%}.cue-table table{width:100%;border-collapse:collapse;border-spacing:0}.cue-table th,.cue-table td{padding:.75rem 1rem;border-bottom:1px solid color-mix(in srgb,var(--cue-fg) 15%,transparent)}.cue-table th{font-weight:600;text-align:left;color:var(--cue-primary);border-bottom-width:2px;border-bottom-color:var(--cue-primary)}.cue-table tbody tr:hover{background:color-mix(in srgb,var(--cue-fg) 5%,transparent)}.cue-table tbody tr:last-child td{border-bottom:none}.cue-table--styled th{color:#fff;font-weight:700;padding:.85rem 1rem;border-bottom:none}.cue-table--styled th:first-child{border-radius:8px 0 0}.cue-table--styled th:last-child{border-radius:0 8px 0 0}.cue-table--styled tbody tr:nth-child(2n){background:color-mix(in srgb,var(--cue-fg) 4%,transparent)}.cue-scene[data-layout] .cue-table{flex:1 1 0}.cue-table code{font-family:var(--cue-font-code);font-size:.85em;background:color-mix(in srgb,var(--cue-code-bg) 60%,transparent);padding:.15em .4em;border-radius:4px}.cue-table a{color:var(--cue-primary);text-decoration:underline;text-underline-offset:2px}.cue-mermaid{display:flex;justify-content:center;align-items:center;flex:1;min-height:0;padding:1rem}.cue-mermaid svg{width:100%;height:100%;max-width:100%;max-height:100%;display:block}.cue-mermaid-fallback{font-family:var(--cue-font-code);font-size:.9rem;color:var(--cue-fg);opacity:.7;white-space:pre-wrap}.cue-chart{display:flex;justify-content:center;align-items:center;flex:1;min-height:0;padding:1rem}.cue-chart canvas{width:100%;height:100%;max-width:100%;max-height:100%}.cue-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1.5rem;width:100%;padding:.5rem}.cue-card{display:flex;flex-direction:column;align-items:center;text-align:center;gap:.75rem;padding:2rem 1.5rem;border-radius:16px;background:color-mix(in srgb,var(--cue-fg) 5%,transparent);border:1px solid color-mix(in srgb,var(--cue-fg) 12%,transparent);box-shadow:var(--cue-shadow);transition:transform .2s ease,box-shadow .2s ease}.cue-card:hover{transform:translateY(-2px);box-shadow:var(--cue-shadow-lg)}.cue-card[data-accent]{border-top:3px solid var(--cue-card-accent)}.cue-card-icon{color:var(--cue-primary);width:32px;height:32px}.cue-card-icon svg{width:100%;height:100%}.cue-card-title{font-family:var(--cue-font-heading);font-size:1.25rem;font-weight:600;color:var(--cue-fg)}.cue-card-desc{font-family:var(--cue-font-body);font-size:.95rem;color:var(--cue-secondary);line-height:1.5}.cue-stats{display:flex;flex-wrap:wrap;justify-content:center;gap:3rem;width:100%;padding:1rem}.cue-stat{display:flex;flex-direction:column;align-items:center;gap:.5rem;min-width:140px}.cue-stat-value{font-family:var(--cue-font-heading);font-size:3.5rem;font-weight:700;color:var(--cue-primary);font-variant-numeric:tabular-nums;line-height:1.1}.cue-stat-label{font-family:var(--cue-font-body);font-size:1rem;color:var(--cue-secondary);text-transform:uppercase;letter-spacing:.05em}.cue-terminal{font-family:var(--cue-font-code);font-size:.95rem;line-height:1.7;background:#1a1a2e;border-radius:12px;overflow:hidden;width:100%;box-shadow:var(--cue-shadow)}.cue-terminal-chrome{display:flex;gap:6px;padding:12px 16px;background:#16162a}.cue-terminal-dot{width:12px;height:12px;border-radius:50%}.cue-terminal-dot--red{background:#ff5f56}.cue-terminal-dot--yellow{background:#ffbd2e}.cue-terminal-dot--green{background:#27c93f}.cue-terminal-body{padding:1rem 1.5rem 1.5rem}.cue-terminal-line{white-space:pre-wrap;word-break:break-all}.cue-terminal-line--command{color:#e2e8f0}.cue-terminal-line--output{color:#94a3b8}.cue-terminal-prompt{color:#27c93f;-webkit-user-select:none;user-select:none}.cue-terminal-text{color:#e2e8f0}.cue-scene[data-layout] .cue-terminal,.cue-scene[data-layout] .cue-cards,.cue-scene[data-layout] .cue-stats,.cue-scene[data-layout] .cue-mermaid,.cue-scene[data-layout] .cue-chart{flex:1 1 0;min-height:0}.cue-flow{display:flex;align-items:center;justify-content:center}.cue-flow-svg{height:auto}.cue-flow-node-rect{fill:var(--cue-accent, #3b82f6);opacity:.15;stroke:var(--cue-accent, #3b82f6);stroke-width:2;transition:opacity .4s ease}.cue-flow-node-label{fill:var(--cue-fg, #fff);font-family:var(--cue-font-body);font-size:14px;text-anchor:middle;dominant-baseline:central}.cue-flow-node-icon{fill:var(--cue-fg, #fff);font-size:16px;dominant-baseline:central}.cue-flow-path{fill:none;stroke:var(--cue-secondary, #94a3b8);stroke-width:2;stroke-dasharray:500;stroke-dashoffset:500;transition:stroke-dashoffset .6s ease}.cue-flow-arrow{fill:var(--cue-secondary, #94a3b8);opacity:0;transition:opacity .3s ease .4s}.cue-flow-edge-label{fill:var(--cue-secondary, #94a3b8);font-family:var(--cue-font-body);font-size:12px;text-anchor:middle;opacity:0;transition:opacity .3s ease .4s}.cue-flow-node[data-revealed] .cue-flow-node-rect{opacity:.3}.cue-flow-edge[data-revealed] .cue-flow-path{stroke-dashoffset:0}.cue-flow-edge[data-revealed] .cue-flow-arrow,.cue-flow-edge[data-revealed] .cue-flow-edge-label{opacity:1}.cue-scene[data-layout] .cue-flow{flex:1 1 0;min-height:0}.cue-error-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;width:100%;min-height:120px;padding:2rem;border:2px dashed color-mix(in srgb,var(--cue-fg) 25%,transparent);border-radius:12px;background:color-mix(in srgb,var(--cue-fg) 5%,transparent);color:color-mix(in srgb,var(--cue-fg) 50%,transparent);font-family:var(--cue-font-body);font-size:.9rem}", cn = '.cue-scene[data-layout]{display:grid;padding:5% 6%;gap:2rem;align-content:start}.cue-scene[data-layout=center]{grid-template-rows:1fr;grid-template-columns:1fr;align-content:center;justify-items:center;text-align:center}.cue-scene[data-layout=intro]{grid-template-rows:auto;grid-template-columns:1fr;grid-template-areas:"left";align-content:center;justify-items:start;text-align:left}.cue-scene[data-layout=intro]:has(.cue-slot[data-slot=right]){grid-template-columns:3fr 2fr;grid-template-areas:"left right"}.cue-scene[data-layout=intro] .cue-slot[data-slot=left]{align-self:center}.cue-scene[data-layout=intro] .cue-slot[data-slot=right]{align-self:center;justify-self:center}.cue-scene[data-layout=intro] .cue-slot[data-slot=right] .cue-image{max-height:70vh;display:flex;align-items:center;justify-content:center}.cue-scene[data-layout=intro] .cue-slot[data-slot=right] .cue-image img{max-width:100%;max-height:70vh;object-fit:contain;border-radius:12px}.cue-scene[data-layout=header-body]{grid-template-rows:auto 1fr auto;grid-template-columns:1fr;grid-template-areas:"header" "body" "footer"}.cue-scene[data-layout=split]{grid-template-rows:auto 1fr auto;grid-template-columns:1fr 1fr;grid-template-areas:"header header" "left right" "footer footer"}.cue-scene[data-layout=code-focus]{grid-template-rows:auto 1fr auto;grid-template-columns:1fr;grid-template-areas:"header" "code" "footer"}.cue-scene[data-layout=full]{grid-template-rows:1fr;grid-template-columns:1fr;padding:2%}.cue-scene[data-layout=blank]{grid-template-rows:1fr;grid-template-columns:1fr;padding:0}.cue-scene[data-layout=section]{grid-template-rows:1fr;grid-template-columns:1fr;align-content:center;justify-items:center;text-align:center}.cue-scene[data-layout=section] .cue-text[data-role=heading],.cue-scene[data-layout=section] .cue-text[data-role=title]{font-size:3rem;position:relative;padding-bottom:1rem}.cue-scene[data-layout=section] .cue-text[data-role=heading]:after,.cue-scene[data-layout=section] .cue-text[data-role=title]:after{content:"";position:absolute;bottom:0;left:50%;transform:translate(-50%);width:80px;height:4px;background:var(--cue-primary);border-radius:2px}.cue-scene[data-layout=end]{grid-template-rows:auto;grid-template-columns:1fr;grid-template-areas:"left";align-content:center;justify-items:start;text-align:left}.cue-scene[data-layout=end]:has(.cue-slot[data-slot=right]){grid-template-columns:3fr 2fr;grid-template-areas:"left right"}.cue-scene[data-layout=end] .cue-slot[data-slot=left]{align-self:center}.cue-scene[data-layout=end] .cue-slot[data-slot=right]{align-self:center;justify-self:center}.cue-scene[data-layout=quote]{grid-template-rows:1fr;grid-template-columns:1fr;align-content:center;justify-items:center;text-align:center;padding:10% 15%}.cue-scene[data-layout=quote] .cue-text[data-role=caption],.cue-scene[data-layout=quote] .cue-text[data-role=body]{font-size:1.8rem;font-style:italic;line-height:1.6;position:relative;padding:1.5rem 0}.cue-scene[data-layout=quote] .cue-text[data-role=caption]:before,.cue-scene[data-layout=quote] .cue-text[data-role=body]:before{content:"“";position:absolute;top:-.5rem;left:-1.5rem;font-size:4rem;color:var(--cue-primary);opacity:.4;font-style:normal}.cue-scene[data-layout=image-left]{grid-template-rows:1fr;grid-template-columns:2fr 3fr;grid-template-areas:"left right";align-content:center;padding:3%;gap:3rem}.cue-scene[data-layout=image-left] .cue-slot[data-slot=left]{align-self:center;justify-self:center}.cue-scene[data-layout=image-left] .cue-slot[data-slot=left] .cue-image img{max-width:100%;max-height:80vh;object-fit:contain;border-radius:12px}.cue-scene[data-layout=image-left] .cue-slot[data-slot=right]{align-self:center;padding:2% 4%}.cue-scene[data-layout=image-right]{grid-template-rows:1fr;grid-template-columns:3fr 2fr;grid-template-areas:"left right";align-content:center;padding:3%;gap:3rem}.cue-scene[data-layout=image-right] .cue-slot[data-slot=left]{align-self:center;padding:2% 4%}.cue-scene[data-layout=image-right] .cue-slot[data-slot=right]{align-self:center;justify-self:center}.cue-scene[data-layout=image-right] .cue-slot[data-slot=right] .cue-image img{max-width:100%;max-height:80vh;object-fit:contain;border-radius:12px}.cue-scene[data-layout=image-full]{grid-template-rows:1fr;grid-template-columns:1fr;align-content:end;justify-items:start;padding:6% 8%;position:relative}.cue-scene[data-layout=image-full] .cue-image{position:absolute;top:0;right:0;bottom:0;left:0;z-index:0}.cue-scene[data-layout=image-full] .cue-image img{width:100%;height:100%;object-fit:cover}.cue-scene[data-layout=image-full] .cue-text{position:relative;z-index:1;text-shadow:0 2px 8px rgba(0,0,0,.6)}.cue-scene[data-layout=image-grid]{grid-template-rows:auto 1fr;grid-template-columns:1fr;grid-template-areas:"header" "body";padding:3% 4%;gap:1.5rem;align-content:center}.cue-scene[data-layout=image-grid] .cue-slot[data-slot=body]{flex-direction:row;flex-wrap:wrap;gap:1.5rem;align-items:center;justify-content:center;overflow:visible}.cue-scene[data-layout=image-grid] .cue-slot .cue-image{flex:1 1 0;min-width:0;min-height:0;max-height:100%}.cue-scene[data-layout=image-grid] .cue-slot .cue-image img{width:100%;height:auto;max-height:80vh;object-fit:contain;border-radius:12px}.cue-scene[data-layout=image-grid].vertical .cue-slot[data-slot=body]{flex-direction:column;align-items:center}.cue-scene[data-layout=image-grid].vertical .cue-slot .cue-image{flex:0 1 auto;width:50%}.cue-slot{display:flex;flex-direction:column;gap:1rem;min-width:0;min-height:0;overflow:hidden}.cue-slot[data-slot=header]{grid-area:header}.cue-slot[data-slot=body]{grid-area:body}.cue-slot[data-slot=left]{grid-area:left}.cue-slot[data-slot=right]{grid-area:right}.cue-slot[data-slot=code]{grid-area:code}.cue-slot[data-slot=footer]{grid-area:footer;align-self:end}.cue-scene[data-accent-bar]{position:relative}.cue-scene[data-accent-bar]:before{content:"";position:absolute;left:0;right:0;height:var(--cue-accent-bar-height, 4px);background:var(--cue-accent-bar-color);z-index:10}.cue-scene[data-accent-bar=top]:before{top:0}.cue-scene[data-accent-bar=bottom]:before{bottom:0}', ln = ".cue-st-decorations{position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;pointer-events:none;overflow:hidden}.cue-st-badge{position:absolute;top:8%;left:6%;z-index:2;padding:.5rem 2rem;border-radius:4px;font-family:var(--cue-font-body);font-size:.85rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:#fff}.cue-st-footer-bar{position:absolute;bottom:0;left:0;right:0;z-index:2;padding:1rem 6%;text-align:center;font-family:var(--cue-font-body);font-size:.9rem;color:var(--cue-secondary);opacity:.7;background:linear-gradient(transparent,#0000004d)}.cue-st-accent-bar{position:absolute;top:0;left:0;right:0;height:4px;z-index:10}.cue-st-content{position:relative;z-index:2;display:flex;flex-direction:column;gap:1rem}.cue-st-badge{opacity:0;animation:cue-st-fade-in .6s ease .3s forwards}.cue-st-footer-bar{opacity:0;animation:cue-st-slide-up .5s ease .5s forwards}.cue-st-decorations{opacity:0;animation:cue-st-fade-in 1s ease forwards}.cue-st-accent-bar{opacity:0;animation:cue-st-fade-in .4s ease .1s forwards}@keyframes cue-st-fade-in{to{opacity:1}}@keyframes cue-st-slide-up{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.cue-st-tech-talk-intro{position:relative;display:flex;align-items:center;padding:15% 6% 5%}.cue-st-tech-talk-intro .cue-st-content{max-width:60%}.cue-st-tech-talk-intro .cue-text[data-role=title]{font-size:clamp(2.5rem,7vw,5rem);line-height:1.1}.cue-st-tech-talk-intro .cue-text[data-role=subtitle]{color:var(--cue-accent);font-style:italic;font-size:clamp(1.1rem,2.5vw,1.8rem)}.cue-st-tech-talk-section{position:relative;display:flex;align-items:center;justify-content:center;text-align:center;padding:5% 10%}.cue-st-section-gradient{position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;pointer-events:none}.cue-st-section-stripe{position:absolute;left:0;top:15%;bottom:15%;width:4px;z-index:1;opacity:0;animation:cue-st-fade-in .6s ease .2s forwards}.cue-st-tech-talk-section .cue-text[data-role=heading]{font-size:clamp(1.8rem,5vw,3.5rem)}.cue-st-accent-line{width:80px;height:4px;margin:1rem auto 0;border-radius:2px;opacity:0;animation:cue-st-fade-in .5s ease .4s forwards}.cue-st-tech-talk-closing{position:relative;display:flex;align-items:center;justify-content:center;text-align:center;padding:5% 6%}.cue-st-tech-talk-closing .cue-text[data-role=title],.cue-st-tech-talk-closing .cue-text[data-role=heading]{font-size:clamp(2rem,5vw,3.5rem)}.cue-st-tech-talk-closing .cue-text[data-role=subtitle]{color:var(--cue-accent)}.cue-st-tech-talk-content{position:relative;display:flex;flex-direction:column;padding:5% 6% 4%}.cue-st-content-header{flex-shrink:0;margin-bottom:1.5rem}.cue-st-content-header .cue-text[data-role=heading],.cue-st-content-header .cue-text[data-role=title]{text-align:left;font-size:clamp(1.5rem,4vw,2.5rem)}.cue-st-content-underline{width:60px;height:3px;border-radius:2px;margin-top:.75rem;opacity:0;animation:cue-st-fade-in .5s ease .3s forwards}.cue-st-content-body{position:relative;z-index:2;display:flex;flex-direction:column;gap:1rem;flex:1 1 0;min-height:0}.cue-st-list-rows{display:flex;flex-direction:column;gap:.75rem;flex:1 1 0;min-height:0}.cue-st-list-row{display:flex;align-items:center;gap:1rem;padding:1rem 1.25rem;border-radius:10px;background:color-mix(in srgb,var(--cue-fg) 5%,transparent);border:1px solid color-mix(in srgb,var(--cue-fg) 8%,transparent)}.cue-st-list-accent{width:4px;align-self:stretch;border-radius:2px;flex-shrink:0}.cue-st-list-number{width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-family:var(--cue-font-heading);font-size:.95rem;font-weight:700;color:#fff;flex-shrink:0}.cue-st-list-text{flex:1;font-family:var(--cue-font-body);font-size:1.15rem;line-height:1.5;color:var(--cue-fg)}.cue-st-list-text--two-line{display:flex;flex-direction:column;gap:.15rem}.cue-st-list-title{font-weight:700;font-size:1.15rem;color:var(--cue-fg)}.cue-st-list-desc{font-size:.95rem;color:var(--cue-secondary);line-height:1.4}.cue-st-list-text strong{font-weight:700}.cue-st-list-text em{font-style:italic}.cue-st-list-text code{font-family:var(--cue-font-code);font-size:.85em;background:color-mix(in srgb,var(--cue-code-bg) 60%,transparent);padding:.15em .4em;border-radius:4px}.cue-st-tech-talk-code{position:relative;display:flex;flex-direction:column;padding:4% 6%}.cue-st-code-header{flex-shrink:0;margin-bottom:1rem}.cue-st-code-header .cue-text[data-role=heading],.cue-st-code-header .cue-text[data-role=title]{text-align:left;font-size:clamp(1.5rem,4vw,2.5rem)}.cue-st-code-container{flex:1 1 0;min-height:0;container-type:size;display:flex;flex-direction:column}.cue-st-code-container .cue-code{flex:1 1 0;min-height:0;font-size:clamp(.75rem,3.5cqh,1.8rem)}.cue-st-code-container .cue-code pre{height:100%;overflow:auto}.cue-st-code-footer{flex-shrink:0;margin-top:1rem;display:flex;flex-direction:column;gap:.5rem}.cue-st-tech-talk-content .cue-cards{align-content:center}.cue-st-tech-talk-content .cue-card{background:#fff;border:none;color:#1a1a2e;box-shadow:0 4px 16px #00000026,0 1px 4px #0000001a}.cue-st-tech-talk-content .cue-card:hover{box-shadow:0 8px 24px #0003,0 2px 8px #0000001f}.cue-st-tech-talk-content .cue-card-title{color:#1a1a2e}.cue-st-tech-talk-content .cue-card-desc{color:#4a5568}.cue-st-tech-talk-content .cue-card-icon{color:var(--cue-card-accent, var(--cue-primary))}.cue-st-tech-talk-content .cue-card-title{font-size:1.5rem}.cue-st-tech-talk-content .cue-card-desc{font-size:1.05rem;line-height:1.6}.cue-st-tech-talk-content[data-light] .cue-st-content-header .cue-text[data-role=heading],.cue-st-tech-talk-content[data-light] .cue-st-content-header .cue-text[data-role=title],.cue-st-tech-talk-content[data-light] .cue-st-list-text{color:#1a1a2e}.cue-st-tech-talk-content[data-light] .cue-st-list-row{background:#0000000a;border-color:#00000014}.cue-st-tech-talk-content .cue-stats{gap:1.5rem;justify-content:center}.cue-st-tech-talk-content .cue-stat{background:#fff;border-radius:16px;padding:2rem 2.5rem;min-width:200px;box-shadow:0 4px 16px #00000026,0 1px 4px #0000001a}.cue-st-tech-talk-content .cue-stat-value{color:var(--cue-accent)}.cue-st-tech-talk-content .cue-stat-label{color:#4a5568}.cue-st-content-body .cue-terminal,.cue-st-content-body .cue-code,.cue-st-content-body .cue-mermaid,.cue-st-content-body .cue-chart,.cue-st-content-body .cue-table{flex:1 1 0;min-height:0}.cue-st-content-body .cue-terminal{font-size:clamp(.95rem,1.8vw,1.4rem)}.cue-st-content-footer{flex-shrink:0;margin-top:auto;padding:1rem 6%;font-family:var(--cue-font-body);font-size:1.15rem;line-height:1.6;color:var(--cue-secondary);text-align:center;background:color-mix(in srgb,var(--cue-fg) 4%,transparent);border-radius:8px}.cue-st-tech-talk-content[data-light] .cue-st-content-footer{color:#4a5568;background:#0000000a}.cue-st-pitch-deck-hero{position:relative;display:flex;align-items:center;justify-content:center;text-align:center;padding:8% 10%}.cue-st-pitch-deck-hero .cue-st-content{max-width:70%;align-items:center}.cue-st-pitch-deck-hero .cue-text[data-role=title]{font-size:clamp(2.5rem,7vw,5.5rem);line-height:1.1}.cue-st-pitch-deck-hero .cue-text[data-role=subtitle]{font-size:clamp(1.1rem,2.5vw,1.8rem);color:var(--cue-secondary)}.cue-st-pitch-deck-hero .cue-st-tagline{margin-top:1.5rem;font-family:var(--cue-font-body);font-size:1.15rem;color:var(--cue-secondary);opacity:.8}.cue-st-pitch-deck-problem{position:relative;display:flex;flex-direction:column;padding:5% 6% 4%}.cue-st-pitch-deck-problem .cue-st-content-header .cue-text[data-role=heading],.cue-st-pitch-deck-problem .cue-st-content-header .cue-text[data-role=title]{text-align:left;font-size:clamp(1.5rem,4vw,2.5rem)}.cue-st-pitch-deck-problem .cue-st-content-body{flex:1 1 0;min-height:0}.cue-st-pitch-deck-solution{position:relative;display:flex;flex-direction:column;padding:5% 6% 4%}.cue-st-pitch-deck-solution .cue-st-content-header .cue-text[data-role=heading],.cue-st-pitch-deck-solution .cue-st-content-header .cue-text[data-role=title]{text-align:left;font-size:clamp(1.5rem,4vw,2.5rem)}.cue-st-pitch-deck-solution .cue-st-content-body{flex:1 1 0;min-height:0}.cue-st-pitch-deck-metrics{position:relative;display:flex;flex-direction:column;padding:5% 6% 4%}.cue-st-pitch-deck-metrics .cue-st-content-header .cue-text[data-role=heading],.cue-st-pitch-deck-metrics .cue-st-content-header .cue-text[data-role=title]{text-align:center;font-size:clamp(1.5rem,4vw,2.5rem)}.cue-st-pitch-deck-metrics .cue-st-content-body{flex:1 1 0;min-height:0;display:flex;align-items:center;justify-content:center}.cue-st-pitch-deck-metrics .cue-stats{gap:2rem;justify-content:center}.cue-st-pitch-deck-metrics .cue-stat{background:color-mix(in srgb,var(--cue-fg) 5%,transparent);border-radius:16px;padding:2.5rem 3rem;min-width:220px}.cue-st-pitch-deck-metrics .cue-stat-value{font-size:clamp(2rem,5vw,3.5rem);color:var(--cue-accent)}.cue-st-pitch-deck-cta{position:relative;display:flex;align-items:center;justify-content:center;text-align:center;padding:8% 10%}.cue-st-pitch-deck-cta .cue-st-content{max-width:70%;align-items:center}.cue-st-pitch-deck-cta .cue-text[data-role=title],.cue-st-pitch-deck-cta .cue-text[data-role=heading]{font-size:clamp(2rem,5vw,3.5rem)}.cue-st-pitch-deck-cta .cue-text[data-role=subtitle]{color:var(--cue-accent)}.cue-st-pitch-deck-cta .cue-st-tagline{margin-top:1.5rem;font-family:var(--cue-font-body);font-size:1.15rem;color:var(--cue-secondary);opacity:.8}.cue-st-workshop-intro{position:relative;display:flex;align-items:center;padding:15% 6% 5%}.cue-st-workshop-intro .cue-st-content{max-width:65%}.cue-st-workshop-intro .cue-text[data-role=title]{font-size:clamp(2.5rem,7vw,5rem);line-height:1.1}.cue-st-workshop-intro .cue-text[data-role=subtitle]{color:var(--cue-accent);font-size:clamp(1.1rem,2.5vw,1.8rem)}.cue-st-workshop-meta{display:flex;gap:2rem;margin-top:1.5rem;flex-wrap:wrap}.cue-st-workshop-meta-item{display:flex;align-items:center;gap:.5rem;font-family:var(--cue-font-body);font-size:1rem;color:var(--cue-secondary);opacity:.8}.cue-st-workshop-meta-label{font-weight:600;text-transform:uppercase;font-size:.8rem;letter-spacing:.05em}.cue-st-workshop-step{position:relative;display:flex;flex-direction:column;padding:5% 6% 4%}.cue-st-workshop-step-badge{position:absolute;top:5%;right:5%;width:64px;height:64px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-family:var(--cue-font-heading);font-size:1.8rem;font-weight:800;color:#fff;z-index:3;opacity:0;animation:cue-st-fade-in .5s ease .2s forwards}.cue-st-workshop-step .cue-st-content-header .cue-text[data-role=heading],.cue-st-workshop-step .cue-st-content-header .cue-text[data-role=title]{text-align:left;font-size:clamp(1.5rem,4vw,2.5rem)}.cue-st-workshop-step .cue-st-content-body{flex:1 1 0;min-height:0}.cue-st-workshop-exercise{position:relative;display:flex;flex-direction:column;padding:5% 6% 4%}.cue-st-workshop-exercise .cue-st-badge{position:static;align-self:flex-start;margin-bottom:.75rem}.cue-st-workshop-exercise .cue-st-content-header .cue-text[data-role=heading],.cue-st-workshop-exercise .cue-st-content-header .cue-text[data-role=title]{text-align:left;font-size:clamp(1.5rem,4vw,2.5rem)}.cue-st-workshop-exercise .cue-st-content-body{flex:1 1 0;min-height:0;padding:1.5rem;border:2px solid var(--cue-accent);border-radius:12px;background:color-mix(in srgb,var(--cue-accent) 5%,transparent)}.cue-st-workshop-timer{position:absolute;top:5%;right:5%;padding:.4rem 1rem;border-radius:20px;font-family:var(--cue-font-body);font-size:.9rem;font-weight:600;color:#fff;z-index:3;opacity:0;animation:cue-st-fade-in .5s ease .3s forwards}.cue-st-workshop-checkpoint{position:relative;display:flex;flex-direction:column;padding:5% 6% 4%}.cue-st-workshop-checkpoint .cue-st-content-header .cue-text[data-role=heading],.cue-st-workshop-checkpoint .cue-st-content-header .cue-text[data-role=title]{text-align:left;font-size:clamp(1.5rem,4vw,2.5rem)}.cue-st-workshop-checkpoint .cue-st-content-body{flex:1 1 0;min-height:0}.cue-st-workshop-summary{position:relative;display:flex;flex-direction:column;padding:5% 6% 4%}.cue-st-workshop-summary .cue-st-content-header .cue-text[data-role=heading],.cue-st-workshop-summary .cue-st-content-header .cue-text[data-role=title]{text-align:left;font-size:clamp(1.5rem,4vw,2.5rem)}.cue-st-workshop-summary .cue-st-content-body{flex:1 1 0;min-height:0}.cue-st-changelog-cover{position:relative;display:flex;align-items:center;justify-content:center;text-align:center;padding:8% 10%}.cue-st-changelog-cover .cue-st-content{align-items:center}.cue-st-version-badge{display:inline-block;padding:.5rem 2.5rem;border-radius:30px;border:2px solid var(--cue-accent);font-family:var(--cue-font-code);font-size:clamp(1.5rem,4vw,3rem);font-weight:700;color:var(--cue-accent);margin-bottom:1.5rem;opacity:0;animation:cue-st-fade-in .6s ease .2s forwards}.cue-st-changelog-cover .cue-text[data-role=title]{font-size:clamp(1.8rem,5vw,3.5rem)}.cue-st-changelog-date{margin-top:.75rem;font-family:var(--cue-font-body);font-size:1rem;color:var(--cue-secondary);opacity:0;animation:cue-st-fade-in .5s ease .4s forwards}.cue-st-changelog-feature{position:relative;display:flex;flex-direction:column;padding:5% 6% 4%}.cue-st-changelog-feature .cue-st-badge{position:static;align-self:flex-start;margin-bottom:.75rem;background-color:#22c55e}.cue-st-changelog-feature .cue-st-content-header .cue-text[data-role=heading],.cue-st-changelog-feature .cue-st-content-header .cue-text[data-role=title]{text-align:left;font-size:clamp(1.5rem,4vw,2.5rem)}.cue-st-changelog-feature .cue-st-content-body{flex:1 1 0;min-height:0}.cue-st-changelog-breaking{position:relative;display:flex;flex-direction:column;padding:5% 6% 4%}.cue-st-changelog-breaking .cue-st-badge{position:static;align-self:flex-start;margin-bottom:.75rem;background-color:#ef4444}.cue-st-changelog-breaking .cue-st-accent-bar{background-color:#ef4444!important}.cue-st-changelog-breaking .cue-st-content-header .cue-text[data-role=heading],.cue-st-changelog-breaking .cue-st-content-header .cue-text[data-role=title]{text-align:left;font-size:clamp(1.5rem,4vw,2.5rem)}.cue-st-changelog-breaking .cue-st-content-body{flex:1 1 0;min-height:0;padding:1.5rem;border:2px solid #ef4444;border-radius:12px;background:color-mix(in srgb,#ef4444 5%,transparent)}.cue-st-changelog-fixes{position:relative;display:flex;flex-direction:column;padding:5% 6% 4%}.cue-st-changelog-fixes .cue-st-badge{position:static;align-self:flex-start;margin-bottom:.75rem;background-color:#3b82f6}.cue-st-changelog-fixes .cue-st-content-header .cue-text[data-role=heading],.cue-st-changelog-fixes .cue-st-content-header .cue-text[data-role=title]{text-align:left;font-size:clamp(1.5rem,4vw,2.5rem)}.cue-st-changelog-fixes .cue-st-content-body{flex:1 1 0;min-height:0}.cue-st-changelog-credits{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:5% 10%}.cue-st-changelog-credits .cue-text[data-role=heading],.cue-st-changelog-credits .cue-text[data-role=title]{font-size:clamp(1.8rem,5vw,3.5rem)}.cue-st-changelog-credits .cue-text[data-role=subtitle]{color:var(--cue-accent)}.cue-st-changelog-fixes .cue-st-list-rows{display:flex;flex-direction:column;gap:.75rem}.cue-st-changelog-fixes .cue-st-list-row{border-left:3px solid #22c55e}";
2473
+ class dn {
2474
+ constructor(e, a) {
2475
+ f(this, "win", null);
2476
+ f(this, "cupFile");
2477
+ f(this, "callbacks", null);
2478
+ f(this, "startTime", 0);
2479
+ f(this, "timerInterval", null);
2480
+ this.cupFile = e, this.callbacks = a ?? null;
2481
+ }
2482
+ open() {
2483
+ const e = Math.min(screen.availWidth, 1400), a = Math.min(screen.availHeight, 900);
2484
+ this.win = window.open("", "cuppacue-presenter", `width=${e},height=${a}`), this.win && (this.win.document.title = "Presenter View — CuppaCue", this.renderShell(), this.attachKeyboard(), this.attachCloseDetection(), this.startTime = Date.now(), this.startTimer());
2485
+ }
2486
+ close() {
2487
+ var e;
2488
+ this.timerInterval && clearInterval(this.timerInterval), this.timerInterval = null, (e = this.win) == null || e.close(), this.win = null;
2489
+ }
2490
+ isOpen() {
2491
+ return this.win !== null && !this.win.closed;
2492
+ }
2493
+ async updateScene(e) {
2494
+ if (!this.win || this.win.closed) return;
2495
+ const a = this.cupFile.content.scenes, i = a[e], n = e + 1 < a.length ? a[e + 1] : null;
2496
+ if (await this.renderPreview("presenter-current", i), n)
2497
+ await this.renderPreview("presenter-next", n);
2498
+ else {
2499
+ const l = this.win.document.getElementById("presenter-next");
2500
+ l && (l.innerHTML = '<div style="display:flex;align-items:center;justify-content:center;height:100%;opacity:0.4;">End of presentation</div>');
2501
+ }
2502
+ const s = this.win.document.getElementById("presenter-notes");
2503
+ s && (s.textContent = i.notes ?? "(No notes for this scene)");
2504
+ const r = this.win.document.getElementById("presenter-counter");
2505
+ r && (r.textContent = `${e + 1} / ${a.length}`);
2506
+ }
2507
+ buildThemeVars() {
2508
+ const e = this.cupFile.theme, a = [
2509
+ `--cue-bg: ${e.colors.background}`,
2510
+ `--cue-fg: ${e.colors.foreground}`,
2511
+ `--cue-primary: ${e.colors.primary}`,
2512
+ `--cue-secondary: ${e.colors.secondary}`,
2513
+ `--cue-accent: ${e.colors.accent}`,
2514
+ `--cue-code-bg: ${e.colors.codeBackground}`,
2515
+ `--cue-code-fg: ${e.colors.codeForeground}`,
2516
+ `--cue-font-heading: ${e.fonts.heading}`,
2517
+ `--cue-font-body: ${e.fonts.body}`,
2518
+ `--cue-font-code: ${e.fonts.code}`
2519
+ ];
2520
+ if (e.typography)
2521
+ for (const [i, n] of Object.entries(e.typography))
2522
+ n.fontSize && a.push(`--cue-typo-${i}-size: ${n.fontSize}`), n.fontWeight && a.push(`--cue-typo-${i}-weight: ${n.fontWeight}`), n.lineHeight && a.push(`--cue-typo-${i}-lh: ${n.lineHeight}`), n.letterSpacing && a.push(`--cue-typo-${i}-ls: ${n.letterSpacing}`), n.textTransform && a.push(`--cue-typo-${i}-tt: ${n.textTransform}`);
2523
+ return `:root { ${a.join("; ")}; }`;
2524
+ }
2525
+ renderShell() {
2526
+ if (!this.win) return;
2527
+ const e = this.cupFile.theme.colors.background, a = this.cupFile.theme.colors.foreground, i = this.cupFile.theme.colors.primary, n = this.win.document;
2528
+ n.open(), n.write(`<!DOCTYPE html>
2529
+ <html>
2530
+ <head>
2531
+ <title>Presenter View — CuppaCue</title>
2532
+ <!-- Player CSS for scene rendering -->
2533
+ <style>${on}</style>
2534
+ <style>${rn}</style>
2535
+ <style>${cn}</style>
2536
+ <style>${ln}</style>
2537
+ <style>${this.buildThemeVars()}</style>
2538
+ <style>
2539
+ * { margin: 0; padding: 0; box-sizing: border-box; }
2540
+ body {
2541
+ background: ${e}; color: ${a};
2542
+ font-family: 'Inter', system-ui, sans-serif;
2543
+ display: grid;
2544
+ grid-template-columns: 65% 35%;
2545
+ grid-template-rows: 1fr auto;
2546
+ height: 100vh;
2547
+ overflow: hidden;
2548
+ }
2549
+
2550
+ /* Left column: current slide */
2551
+ .left-col {
2552
+ grid-row: 1;
2553
+ display: flex;
2554
+ flex-direction: column;
2555
+ gap: 6px;
2556
+ padding: 12px;
2557
+ min-height: 0;
2558
+ }
2559
+
2560
+ /* Right column: next slide + notes */
2561
+ .right-col {
2562
+ grid-row: 1;
2563
+ display: flex;
2564
+ flex-direction: column;
2565
+ padding: 12px 12px 12px 0;
2566
+ gap: 12px;
2567
+ min-height: 0;
2568
+ }
2569
+
2570
+ .section-label {
2571
+ font-size: 12px;
2572
+ text-transform: uppercase;
2573
+ letter-spacing: 0.1em;
2574
+ opacity: 0.5;
2575
+ font-weight: 600;
2576
+ flex-shrink: 0;
2577
+ }
2578
+
2579
+ /* Scene preview container — scene fills this natively */
2580
+ .preview-frame {
2581
+ position: relative;
2582
+ border: 1px solid rgba(255,255,255,0.15);
2583
+ border-radius: 8px;
2584
+ overflow: hidden;
2585
+ background: rgba(0,0,0,0.3);
2586
+ }
2587
+ /* Current: fill available height */
2588
+ .left-col .preview-frame { flex: 1; min-height: 0; }
2589
+ /* Next: fixed 16:9 aspect */
2590
+ .next-section .preview-frame { aspect-ratio: 16 / 9; }
2591
+
2592
+ /* Override .cue-scene positioning for preview frames */
2593
+ .preview-frame .cue-scene {
2594
+ position: absolute;
2595
+ inset: 0;
2596
+ background: ${e};
2597
+ color: ${a};
2598
+ }
2599
+
2600
+ .next-section { flex-shrink: 0; }
2601
+ .notes-section {
2602
+ flex: 1;
2603
+ overflow-y: auto;
2604
+ min-height: 0;
2605
+ border-top: 1px solid rgba(255,255,255,0.1);
2606
+ padding-top: 12px;
2607
+ }
2608
+ .notes-label {
2609
+ font-size: 12px;
2610
+ text-transform: uppercase;
2611
+ letter-spacing: 0.1em;
2612
+ opacity: 0.5;
2613
+ margin-bottom: 8px;
2614
+ font-weight: 600;
2615
+ }
2616
+ .notes-text { font-size: 18px; line-height: 1.7; white-space: pre-wrap; }
2617
+
2618
+ .footer {
2619
+ grid-column: 1 / -1;
2620
+ grid-row: 2;
2621
+ display: flex;
2622
+ justify-content: space-between;
2623
+ align-items: center;
2624
+ padding: 8px 16px;
2625
+ border-top: 1px solid rgba(255,255,255,0.1);
2626
+ font-size: 14px;
2627
+ opacity: 0.6;
2628
+ }
2629
+ .footer-left { display: flex; align-items: center; gap: 16px; }
2630
+ .footer-center { display: flex; align-items: center; gap: 8px; }
2631
+ .timer { font-variant-numeric: tabular-nums; color: ${i}; font-weight: 600; font-size: 18px; }
2632
+
2633
+ /* Navigation buttons */
2634
+ .nav-btn {
2635
+ background: rgba(255,255,255,0.1);
2636
+ border: 1px solid rgba(255,255,255,0.2);
2637
+ color: ${a};
2638
+ padding: 6px 14px;
2639
+ border-radius: 6px;
2640
+ font-size: 14px;
2641
+ cursor: pointer;
2642
+ transition: background 0.15s ease;
2643
+ }
2644
+ .nav-btn:hover { background: rgba(255,255,255,0.2); }
2645
+ .nav-btn:active { background: rgba(255,255,255,0.3); }
2646
+
2647
+ /* Close button */
2648
+ .close-btn {
2649
+ background: none;
2650
+ border: none;
2651
+ color: ${a};
2652
+ font-size: 20px;
2653
+ cursor: pointer;
2654
+ opacity: 0.5;
2655
+ padding: 4px 8px;
2656
+ border-radius: 4px;
2657
+ transition: opacity 0.15s ease, background 0.15s ease;
2658
+ }
2659
+ .close-btn:hover { opacity: 1; background: rgba(255,255,255,0.1); }
2660
+
2661
+ .shortcut-hint {
2662
+ font-size: 11px;
2663
+ opacity: 0.4;
2664
+ }
2665
+ </style>
2666
+ </head>
2667
+ <body>
2668
+ <div class="left-col">
2669
+ <div class="section-label">Current</div>
2670
+ <div class="preview-frame" id="presenter-current"></div>
2671
+ </div>
2672
+ <div class="right-col">
2673
+ <div class="next-section">
2674
+ <div class="section-label">Next</div>
2675
+ <div class="preview-frame" id="presenter-next"></div>
2676
+ </div>
2677
+ <div class="notes-section">
2678
+ <div class="notes-label">Speaker Notes</div>
2679
+ <div class="notes-text" id="presenter-notes">(No notes)</div>
2680
+ </div>
2681
+ </div>
2682
+ <div class="footer">
2683
+ <div class="footer-left">
2684
+ <span id="presenter-timer" class="timer">00:00</span>
2685
+ <span class="shortcut-hint">Esc to close</span>
2686
+ </div>
2687
+ <div class="footer-center">
2688
+ <button class="nav-btn" id="presenter-prev" title="Previous slide (Left arrow)">Prev</button>
2689
+ <button class="nav-btn" id="presenter-next-btn" title="Next slide (Right arrow)">Next</button>
2690
+ </div>
2691
+ <div style="display:flex;align-items:center;gap:12px;">
2692
+ <span id="presenter-counter">0 / 0</span>
2693
+ <button class="close-btn" id="presenter-close" title="Close presenter view (Esc)">&#x2715;</button>
2694
+ </div>
2695
+ </div>
2696
+ </body>
2697
+ </html>`), n.close();
2698
+ const s = n.getElementById("presenter-prev"), r = n.getElementById("presenter-next-btn"), l = n.getElementById("presenter-close");
2699
+ s == null || s.addEventListener("click", () => {
2700
+ var u;
2701
+ return (u = this.callbacks) == null ? void 0 : u.onPrev();
2702
+ }), r == null || r.addEventListener("click", () => {
2703
+ var u;
2704
+ return (u = this.callbacks) == null ? void 0 : u.onNext();
2705
+ }), l == null || l.addEventListener("click", () => {
2706
+ var u;
2707
+ (u = this.callbacks) == null || u.onClose(), this.close();
2708
+ });
2709
+ }
2710
+ attachKeyboard() {
2711
+ this.win && this.win.addEventListener("keydown", (e) => {
2712
+ var a, i, n;
2713
+ switch (e.key) {
2714
+ case "Escape":
2715
+ case "n":
2716
+ e.preventDefault(), (a = this.callbacks) == null || a.onClose(), this.close();
2717
+ break;
2718
+ case "ArrowRight":
2719
+ case " ":
2720
+ e.preventDefault(), (i = this.callbacks) == null || i.onNext();
2721
+ break;
2722
+ case "ArrowLeft":
2723
+ e.preventDefault(), (n = this.callbacks) == null || n.onPrev();
2724
+ break;
2725
+ }
2726
+ });
2727
+ }
2728
+ attachCloseDetection() {
2729
+ this.win && this.win.addEventListener("beforeunload", () => {
2730
+ var e;
2731
+ this.timerInterval && clearInterval(this.timerInterval), this.timerInterval = null, this.win = null, (e = this.callbacks) == null || e.onClose();
2732
+ });
2733
+ }
2734
+ startTimer() {
2735
+ this.timerInterval = setInterval(() => {
2736
+ if (!this.win || this.win.closed) {
2737
+ this.timerInterval && clearInterval(this.timerInterval), this.timerInterval = null;
2738
+ return;
2739
+ }
2740
+ const e = Date.now() - this.startTime, a = Math.floor(e / 6e4), i = Math.floor(e % 6e4 / 1e3), n = this.win.document.getElementById("presenter-timer");
2741
+ n && (n.textContent = `${String(a).padStart(2, "0")}:${String(i).padStart(2, "0")}`);
2742
+ }, 1e3);
2743
+ }
2744
+ async renderPreview(e, a) {
2745
+ if (!this.win || this.win.closed) return;
2746
+ const i = this.win.document.getElementById(e);
2747
+ if (i)
2748
+ try {
2749
+ const n = await ie(a, this.cupFile.theme);
2750
+ for (const [, s] of n.elementMap)
2751
+ s.style.opacity = "1";
2752
+ i.innerHTML = "", i.appendChild(n.container);
2753
+ } catch {
2754
+ i.innerHTML = '<div style="padding:2rem;opacity:0.4;">Unable to render preview</div>';
2755
+ }
2756
+ }
2757
+ }
2758
+ const N = {
2759
+ prev: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>',
2760
+ next: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>',
2761
+ play: '<svg viewBox="0 0 24 24" fill="currentColor"><polygon points="6,4 20,12 6,20"/></svg>',
2762
+ pause: '<svg viewBox="0 0 24 24" fill="currentColor"><rect x="6" y="4" width="4" height="16"/><rect x="14" y="4" width="4" height="16"/></svg>',
2763
+ overview: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="7" height="7"/><rect x="14" y="3" width="7" height="7"/><rect x="3" y="14" width="7" height="7"/><rect x="14" y="14" width="7" height="7"/></svg>',
2764
+ fullscreen: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" y1="3" x2="14" y2="10"/><line x1="3" y1="21" x2="10" y2="14"/></svg>',
2765
+ help: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg>'
2766
+ }, un = [
2767
+ { key: "← →", label: "Navigate slides" },
2768
+ { key: "Space", label: "Next slide / step" },
2769
+ { key: "P", label: "Play / Pause" },
2770
+ { key: "F", label: "Fullscreen" },
2771
+ { key: "O", label: "Slide overview" }
2772
+ ];
2773
+ class pn {
2774
+ constructor(e, a) {
2775
+ f(this, "el");
2776
+ f(this, "counter");
2777
+ f(this, "playBtn");
2778
+ f(this, "actions");
2779
+ f(this, "hideTimeout", null);
2780
+ f(this, "helpPopup", null);
2781
+ this.actions = a, this.el = document.createElement("div"), this.el.className = "cue-navbar", this.el.addEventListener("click", (i) => i.stopPropagation()), this.el.appendChild(this.makeBtn(N.prev, "Previous slide (←)", () => a.prev())), this.el.appendChild(this.makeBtn(N.next, "Next slide (→)", () => a.next())), this.counter = document.createElement("span"), this.counter.className = "cue-navbar-counter", this.counter.textContent = "– / –", this.el.appendChild(this.counter), this.el.appendChild(this.makeSep()), this.playBtn = this.makeBtn(N.play, "Play / Pause (P)", () => a.togglePlayPause()), this.el.appendChild(this.playBtn), this.el.appendChild(this.makeBtn(N.overview, "Slide overview (O)", () => a.toggleOverview())), this.el.appendChild(this.makeBtn(N.fullscreen, "Fullscreen (F)", () => a.toggleFullscreen())), this.el.appendChild(this.makeSep()), this.el.appendChild(this.makeBtn(N.help, "Keyboard shortcuts (?)", () => this.toggleHelp())), e.appendChild(this.el), e.addEventListener("mousemove", (i) => {
2782
+ const n = e.getBoundingClientRect();
2783
+ i.clientY - n.top > n.height * 0.85 && this.show();
2784
+ }), e.addEventListener("mouseleave", () => this.scheduleHide());
2785
+ }
2786
+ /** Flash the navbar briefly so users know it exists */
2787
+ showBriefly() {
2788
+ this.el.classList.add("cue-navbar--visible"), setTimeout(() => {
2789
+ this.helpPopup || this.el.classList.remove("cue-navbar--visible");
2790
+ }, 2500);
2791
+ }
2792
+ update(e, a, i) {
2793
+ this.counter.textContent = `${e + 1} / ${a}`, this.playBtn.innerHTML = i ? N.pause : N.play, this.playBtn.title = i ? "Pause (P)" : "Play (P)";
2794
+ }
2795
+ destroy() {
2796
+ this.hideTimeout && clearTimeout(this.hideTimeout), this.dismissHelp(), this.el.remove();
2797
+ }
2798
+ show() {
2799
+ this.hideTimeout && (clearTimeout(this.hideTimeout), this.hideTimeout = null), this.el.classList.add("cue-navbar--visible"), this.scheduleHide();
2800
+ }
2801
+ scheduleHide() {
2802
+ this.hideTimeout && clearTimeout(this.hideTimeout), this.hideTimeout = setTimeout(() => {
2803
+ this.el.classList.remove("cue-navbar--visible"), this.hideTimeout = null;
2804
+ }, 3e3);
2805
+ }
2806
+ toggleHelp() {
2807
+ this.helpPopup ? this.dismissHelp() : this.showHelp();
2808
+ }
2809
+ showHelp() {
2810
+ var i;
2811
+ if (this.helpPopup) return;
2812
+ this.helpPopup = document.createElement("div"), this.helpPopup.className = "cue-help-popup";
2813
+ const e = document.createElement("div");
2814
+ e.className = "cue-help-title", e.textContent = "Keyboard Shortcuts", this.helpPopup.appendChild(e);
2815
+ for (const n of un) {
2816
+ const s = document.createElement("div");
2817
+ s.className = "cue-help-row";
2818
+ const r = document.createElement("kbd");
2819
+ r.className = "cue-help-key", r.textContent = n.key;
2820
+ const l = document.createElement("span");
2821
+ l.className = "cue-help-label", l.textContent = n.label, s.appendChild(r), s.appendChild(l), this.helpPopup.appendChild(s);
2822
+ }
2823
+ (i = this.el.parentElement) == null || i.appendChild(this.helpPopup), this.hideTimeout && (clearTimeout(this.hideTimeout), this.hideTimeout = null), requestAnimationFrame(() => {
2824
+ var n;
2825
+ (n = this.helpPopup) == null || n.classList.add("cue-help-popup--visible");
2826
+ });
2827
+ const a = (n) => {
2828
+ var s;
2829
+ !((s = this.helpPopup) != null && s.contains(n.target)) && !this.el.contains(n.target) && (this.dismissHelp(), document.removeEventListener("click", a));
2830
+ };
2831
+ setTimeout(() => document.addEventListener("click", a), 0);
2832
+ }
2833
+ dismissHelp() {
2834
+ if (!this.helpPopup) return;
2835
+ this.helpPopup.classList.remove("cue-help-popup--visible");
2836
+ const e = this.helpPopup;
2837
+ this.helpPopup = null, setTimeout(() => e.remove(), 200), this.scheduleHide();
2838
+ }
2839
+ makeBtn(e, a, i) {
2840
+ const n = document.createElement("button");
2841
+ return n.className = "cue-navbar-btn", n.innerHTML = e, n.title = a, n.addEventListener("click", i), n;
2842
+ }
2843
+ makeSep() {
2844
+ const e = document.createElement("div");
2845
+ return e.className = "cue-navbar-sep", e;
2846
+ }
2847
+ }
2848
+ const F = 600;
2849
+ function hn(t, e) {
2850
+ const a = t.length, i = e.length, n = Array.from({ length: a + 1 }, () => new Array(i + 1).fill(0));
2851
+ for (let c = 1; c <= a; c++)
2852
+ for (let o = 1; o <= i; o++)
2853
+ t[c - 1] === e[o - 1] ? n[c][o] = n[c - 1][o - 1] + 1 : n[c][o] = Math.max(n[c - 1][o], n[c][o - 1]);
2854
+ const s = [];
2855
+ let r = a, l = i;
2856
+ const u = [];
2857
+ for (; r > 0 || l > 0; )
2858
+ r > 0 && l > 0 && t[r - 1] === e[l - 1] ? (u.push({ type: "unchanged", text: t[r - 1], oldIndex: r - 1, newIndex: l - 1 }), r--, l--) : l > 0 && (r === 0 || n[r][l - 1] >= n[r - 1][l]) ? (u.push({ type: "added", text: e[l - 1], newIndex: l - 1 }), l--) : (u.push({ type: "removed", text: t[r - 1], oldIndex: r - 1 }), r--);
2859
+ for (let c = u.length - 1; c >= 0; c--)
2860
+ s.push(u[c]);
2861
+ return s;
2862
+ }
2863
+ function ye(t) {
2864
+ return t.textContent ?? "";
2865
+ }
2866
+ function mn(t) {
2867
+ const e = t.querySelector(".line");
2868
+ return e && e.getBoundingClientRect().height || 20;
2869
+ }
2870
+ function q(t) {
2871
+ return t.querySelector(".cue-code");
2872
+ }
2873
+ function fn(t, e) {
2874
+ return t ? !!(q(t) && q(e)) : !1;
2875
+ }
2876
+ function gn(t, e, a) {
2877
+ var y;
2878
+ const i = q(e), n = q(a), s = Array.from(i.querySelectorAll(".line")), r = Array.from(n.querySelectorAll(".line")), l = s.map(ye), u = r.map(ye), c = hn(l, u), o = mn(i), d = i.getBoundingClientRect(), p = t.getBoundingClientRect(), g = document.createElement("div");
2879
+ g.className = "cue-code-morph-overlay", g.style.cssText = `
2880
+ position: absolute;
2881
+ top: ${d.top - p.top}px;
2882
+ left: ${d.left - p.left}px;
2883
+ width: ${d.width}px;
2884
+ height: ${Math.max(d.height, r.length * o + 40)}px;
2885
+ overflow: hidden;
2886
+ z-index: 10;
2887
+ background: var(--cue-code-bg);
2888
+ border-radius: 12px;
2889
+ `;
2890
+ const h = i.querySelector("pre"), v = h ? parseInt(getComputedStyle(h).paddingTop || "16", 10) : 16;
2891
+ for (const b of c) {
2892
+ if (b.type === "unchanged" && b.oldIndex !== void 0 && b.newIndex !== void 0) {
2893
+ const w = s[b.oldIndex].cloneNode(!0);
2894
+ w.style.cssText = `
2895
+ position: absolute;
2896
+ top: ${v + b.oldIndex * o}px;
2897
+ left: 0;
2898
+ right: 0;
2899
+ padding: 0 16px;
2900
+ height: ${o}px;
2901
+ line-height: ${o}px;
2902
+ transition: top ${F}ms cubic-bezier(0.4, 0, 0.2, 1);
2903
+ white-space: pre;
2904
+ `, g.appendChild(w), requestAnimationFrame(() => {
2905
+ w.style.top = `${v + b.newIndex * o}px`;
2906
+ });
2907
+ } else if (b.type === "added" && b.newIndex !== void 0) {
2908
+ const w = (y = r[b.newIndex]) == null ? void 0 : y.cloneNode(!0);
2909
+ w && (w.style.cssText = `
2910
+ position: absolute;
2911
+ top: ${v + b.newIndex * o}px;
2912
+ left: 0;
2913
+ right: 0;
2914
+ padding: 0 16px;
2915
+ height: ${o}px;
2916
+ line-height: ${o}px;
2917
+ opacity: 0;
2918
+ background: rgba(56, 189, 248, 0.1);
2919
+ white-space: pre;
2920
+ `, g.appendChild(w), w.animate(
2921
+ [
2922
+ { opacity: 0, background: "rgba(56, 189, 248, 0.2)" },
2923
+ { opacity: 1, background: "rgba(56, 189, 248, 0.05)" }
2924
+ ],
2925
+ {
2926
+ duration: F,
2927
+ delay: F * 0.3,
2928
+ fill: "forwards",
2929
+ easing: "cubic-bezier(0.4, 0, 0.2, 1)"
2930
+ }
2931
+ ));
2932
+ } else if (b.type === "removed" && b.oldIndex !== void 0) {
2933
+ const w = s[b.oldIndex].cloneNode(!0);
2934
+ w.style.cssText = `
2935
+ position: absolute;
2936
+ top: ${v + b.oldIndex * o}px;
2937
+ left: 0;
2938
+ right: 0;
2939
+ padding: 0 16px;
2940
+ height: ${o}px;
2941
+ line-height: ${o}px;
2942
+ white-space: pre;
2943
+ `, g.appendChild(w), w.animate(
2944
+ [
2945
+ { opacity: 1, background: "transparent" },
2946
+ { opacity: 0, background: "rgba(239, 68, 68, 0.1)" }
2947
+ ],
2948
+ {
2949
+ duration: F * 0.6,
2950
+ fill: "forwards",
2951
+ easing: "ease-out"
2952
+ }
2953
+ );
2954
+ }
2955
+ b.type;
2956
+ }
2957
+ return t.appendChild(g), new Promise((b) => {
2958
+ setTimeout(() => {
2959
+ g.remove(), e.remove(), a.classList.remove("cue-scene--entering"), b();
2960
+ }, F + 100);
2961
+ });
2962
+ }
2963
+ const R = class R {
2964
+ constructor(e) {
2965
+ f(this, "container");
2966
+ f(this, "viewport");
2967
+ f(this, "cupFile", null);
2968
+ f(this, "currentSceneIndex", -1);
2969
+ f(this, "renderedScene", null);
2970
+ f(this, "timeline");
2971
+ f(this, "navigator");
2972
+ f(this, "sceneCounter");
2973
+ f(this, "progressBar");
2974
+ f(this, "statusBadge");
2975
+ f(this, "statusTimeout", null);
2976
+ f(this, "eventListeners", /* @__PURE__ */ new Map());
2977
+ f(this, "slideOverview", null);
2978
+ f(this, "presenterView", null);
2979
+ f(this, "navBar", null);
2980
+ f(this, "autoPlay", !1);
2981
+ f(this, "stepIndicator");
2982
+ f(this, "dataBaseUrl", "");
2983
+ f(this, "transitionDirection", "forward");
2984
+ f(this, "transitioning", !1);
2985
+ f(this, "navigating", !1);
2986
+ f(this, "unsubTimeline", null);
2987
+ f(this, "resizeObserver", null);
2988
+ this.container = document.createElement("div"), this.container.className = "cue-player", e.appendChild(this.container), this.viewport = document.createElement("div"), this.viewport.className = "cue-viewport", this.container.appendChild(this.viewport), this.sceneCounter = document.createElement("div"), this.sceneCounter.className = "cue-scene-counter", this.container.appendChild(this.sceneCounter), this.progressBar = document.createElement("div"), this.progressBar.className = "cue-progress", this.container.appendChild(this.progressBar), this.statusBadge = document.createElement("div"), this.statusBadge.className = "cue-status", this.container.appendChild(this.statusBadge), this.stepIndicator = document.createElement("div"), this.stepIndicator.className = "cue-step-indicator", this.container.appendChild(this.stepIndicator), this.timeline = new ge(), this.unsubTimeline = this.timeline.on((a) => {
2989
+ switch (a) {
2990
+ case "complete":
2991
+ this.handleSceneComplete();
2992
+ break;
2993
+ case "pause":
2994
+ this.emit("pause");
2995
+ break;
2996
+ case "tick":
2997
+ this.updateProgress();
2998
+ break;
2999
+ case "marker":
3000
+ this.updateStepIndicator();
3001
+ break;
3002
+ }
3003
+ }), this.navigator = new ne({
3004
+ next: () => this.next(),
3005
+ prev: () => this.prevScene(),
3006
+ toggleFullscreen: () => this.toggleFullscreen(),
3007
+ togglePlayPause: () => this.togglePlayPause(),
3008
+ openPresenterView: () => this.openPresenterView(),
3009
+ toggleOverview: () => this.toggleOverview(),
3010
+ isOverviewVisible: () => {
3011
+ var a;
3012
+ return ((a = this.slideOverview) == null ? void 0 : a.isVisible()) ?? !1;
3013
+ }
3014
+ }), this.navigator.attach(this.container), this.resizeObserver = new ResizeObserver(() => this.updateScale()), this.resizeObserver.observe(this.viewport), this.navBar = new pn(this.container, {
3015
+ prev: () => this.prevScene(),
3016
+ next: () => this.next(),
3017
+ toggleFullscreen: () => this.toggleFullscreen(),
3018
+ togglePlayPause: () => this.togglePlayPause(),
3019
+ toggleOverview: () => this.toggleOverview(),
3020
+ isPlaying: () => this.timeline.isPlaying(),
3021
+ getCurrentScene: () => this.currentSceneIndex,
3022
+ getTotalScenes: () => {
3023
+ var a;
3024
+ return ((a = this.cupFile) == null ? void 0 : a.content.scenes.length) ?? 0;
3025
+ }
3026
+ });
3027
+ }
3028
+ async load(e) {
3029
+ typeof e == "string" ? (this.dataBaseUrl = e.endsWith("/") ? e : e + "/", this.cupFile = await et(e)) : this.cupFile = e, this.applyTheme(this.cupFile.theme), this.slideOverview = new sn(
3030
+ this.container,
3031
+ this.cupFile,
3032
+ (a) => this.goToScene(a)
3033
+ ), this.emit("load");
3034
+ }
3035
+ play() {
3036
+ var e;
3037
+ this.cupFile && (this.autoPlay = !0, this.currentSceneIndex < 0 ? this.goToScene(0) : this.timeline.isPaused() && (this.timeline.resume(), this.emit("play")), this.showStatus("playing"), (e = this.navBar) == null || e.update(this.currentSceneIndex, this.cupFile.content.scenes.length, !0));
3038
+ }
3039
+ pause() {
3040
+ var e;
3041
+ this.cupFile && (this.autoPlay = !1, this.timeline.pause(), this.showStatus("paused"), (e = this.navBar) == null || e.update(this.currentSceneIndex, this.cupFile.content.scenes.length, !1));
3042
+ }
3043
+ next() {
3044
+ if (!this.navigating) {
3045
+ if (this.timeline.isPaused() && (this.timeline.hasUnfiredEvents() || this.timeline.hasUnfiredMarkers())) {
3046
+ this.timeline.resume(), this.updateStepIndicator();
3047
+ return;
3048
+ }
3049
+ if (this.timeline.isPlaying() && this.timeline.hasUnfiredMarkers()) {
3050
+ this.timeline.skipToNextMarker(), this.updateStepIndicator();
3051
+ return;
3052
+ }
3053
+ this.timeline.stop(), this.hideStatus(), this.hideStepIndicator(), this.nextScene();
3054
+ }
3055
+ }
3056
+ goToScene(e) {
3057
+ if (!this.cupFile) return;
3058
+ const a = this.cupFile.content.scenes;
3059
+ if (e < 0 || e >= a.length) return;
3060
+ this.navigating = !0, this.timeline.stop(), this.hideStepIndicator();
3061
+ const i = this.currentSceneIndex;
3062
+ this.currentSceneIndex = e;
3063
+ const n = a[e], s = this.cupFile.timesheet.timeline.find(
3064
+ (r) => r.sceneId === n.id
3065
+ );
3066
+ ie(n, this.cupFile.theme, this.dataBaseUrl).then((r) => {
3067
+ var d, p, g, h, v, y;
3068
+ this.renderedScene = r, this.navigating = !1;
3069
+ const l = n.transition ?? { type: "fade" }, u = i < 0, c = this.viewport.querySelector(".cue-scene"), o = !u && l.type !== "none" && fn(c, r.container);
3070
+ if (u || l.type === "none" ? (this.viewport.innerHTML = "", this.viewport.appendChild(r.container)) : o && c ? (r.container.classList.add("cue-scene--entering"), r.container.style.opacity = "0", this.viewport.appendChild(r.container), this.transitioning = !0, gn(this.viewport, c, r.container).then(() => {
3071
+ r.container.style.opacity = "", this.transitioning = !1;
3072
+ })) : this.applyTransition(r.container, l), this.updateSceneCounter(), this.emit("scenechange", { index: e, sceneId: n.id }), (d = this.presenterView) == null || d.updateScene(e), (p = this.navBar) == null || p.update(e, this.cupFile.content.scenes.length, this.autoPlay), u && ((g = this.navBar) == null || g.showBriefly()), s) {
3073
+ (h = this.unsubTimeline) == null || h.call(this);
3074
+ const b = ((v = this.cupFile.timesheet.defaults) == null ? void 0 : v.animationDuration) ?? 600;
3075
+ if (this.timeline = new ge(b), this.unsubTimeline = this.timeline.on((w) => {
3076
+ switch (w) {
3077
+ case "complete":
3078
+ this.handleSceneComplete();
3079
+ break;
3080
+ case "pause":
3081
+ this.emit("pause");
3082
+ break;
3083
+ case "tick":
3084
+ this.updateProgress();
3085
+ break;
3086
+ case "marker":
3087
+ this.updateStepIndicator();
3088
+ break;
3089
+ }
3090
+ }), this.timeline.load(s, r.elementMap), this.autoPlay || (y = s.markers) != null && y.length)
3091
+ this.timeline.play(), this.autoPlay && this.emit("play");
3092
+ else
3093
+ for (const [, w] of r.elementMap)
3094
+ w.style.opacity = "1";
3095
+ }
3096
+ });
3097
+ }
3098
+ nextScene() {
3099
+ if (!this.cupFile || this.navigating) return;
3100
+ const e = this.currentSceneIndex + 1;
3101
+ e < this.cupFile.content.scenes.length ? (this.transitionDirection = "forward", this.goToScene(e)) : this.emit("end");
3102
+ }
3103
+ prevScene() {
3104
+ if (this.navigating) return;
3105
+ if (this.timeline.currentStep() > 1) {
3106
+ this.transitionDirection = "forward", this.goToScene(this.currentSceneIndex);
3107
+ return;
3108
+ }
3109
+ const e = this.currentSceneIndex - 1;
3110
+ e >= 0 && (this.transitionDirection = "backward", this.goToScene(e));
3111
+ }
3112
+ toggleFullscreen() {
3113
+ document.fullscreenElement ? document.exitFullscreen() : this.container.requestFullscreen();
3114
+ }
3115
+ togglePlayPause() {
3116
+ this.timeline.isPlaying() ? this.pause() : this.play();
3117
+ }
3118
+ openPresenterView() {
3119
+ var e;
3120
+ if (this.cupFile) {
3121
+ if ((e = this.presenterView) != null && e.isOpen()) {
3122
+ this.presenterView.close(), this.presenterView = null;
3123
+ return;
3124
+ }
3125
+ this.presenterView = new dn(this.cupFile, {
3126
+ onNext: () => this.next(),
3127
+ onPrev: () => this.prevScene(),
3128
+ onClose: () => {
3129
+ this.presenterView = null;
3130
+ }
3131
+ }), this.presenterView.open(), this.currentSceneIndex >= 0 && this.presenterView.updateScene(this.currentSceneIndex);
3132
+ }
3133
+ }
3134
+ async toggleOverview() {
3135
+ var e;
3136
+ await ((e = this.slideOverview) == null ? void 0 : e.toggle());
3137
+ }
3138
+ on(e, a) {
3139
+ return this.eventListeners.has(e) || this.eventListeners.set(e, /* @__PURE__ */ new Set()), this.eventListeners.get(e).add(a), () => {
3140
+ var i;
3141
+ return (i = this.eventListeners.get(e)) == null ? void 0 : i.delete(a);
3142
+ };
3143
+ }
3144
+ destroy() {
3145
+ var e, a, i, n, s;
3146
+ (e = this.unsubTimeline) == null || e.call(this), this.timeline.stop(), this.navigator.detach(), (a = this.slideOverview) == null || a.destroy(), (i = this.presenterView) == null || i.close(), (n = this.navBar) == null || n.destroy(), (s = this.resizeObserver) == null || s.disconnect(), this.container.remove();
3147
+ }
3148
+ emit(e, a) {
3149
+ const i = this.eventListeners.get(e);
3150
+ if (i)
3151
+ for (const n of i) n(a);
3152
+ }
3153
+ showStatus(e) {
3154
+ this.statusTimeout && (clearTimeout(this.statusTimeout), this.statusTimeout = null), e === "paused" ? (this.statusBadge.innerHTML = '<svg viewBox="0 0 24 24" fill="currentColor"><rect x="6" y="4" width="4" height="16"/><rect x="14" y="4" width="4" height="16"/></svg><span>Paused</span><span class="cue-status-hint">P to resume</span>', this.statusBadge.classList.add("cue-status--visible")) : (this.statusBadge.innerHTML = '<svg viewBox="0 0 24 24" fill="currentColor"><polygon points="6,4 20,12 6,20"/></svg><span>Playing</span>', this.statusBadge.classList.add("cue-status--visible"), this.statusTimeout = setTimeout(() => {
3155
+ this.statusBadge.classList.remove("cue-status--visible"), this.statusTimeout = null;
3156
+ }, 1500));
3157
+ }
3158
+ hideStatus() {
3159
+ this.statusTimeout && (clearTimeout(this.statusTimeout), this.statusTimeout = null), this.statusBadge.classList.remove("cue-status--visible");
3160
+ }
3161
+ applyTransition(e, a) {
3162
+ const n = `${a.duration ?? 400}ms ease`, s = this.viewport.querySelector(".cue-scene");
3163
+ if (this.transitioning && s) {
3164
+ s.getAnimations().forEach((r) => r.cancel()), this.viewport.innerHTML = "", this.viewport.appendChild(e), this.transitioning = !1;
3165
+ return;
3166
+ }
3167
+ if (this.transitioning = !0, a.type === "fade")
3168
+ e.classList.add("cue-scene--entering"), e.style.animation = `cue-fade-in ${n}`, this.viewport.appendChild(e), s && (s.classList.add("cue-scene--exiting"), s.style.animation = `cue-fade-out ${n}`, s.addEventListener("animationend", () => s.remove(), { once: !0 }));
3169
+ else if (a.type === "slide") {
3170
+ const r = this.transitionDirection === "forward", l = r ? "cue-slide-in-from-right" : "cue-slide-in-from-left", u = r ? "cue-slide-out-to-left" : "cue-slide-out-to-right";
3171
+ e.classList.add("cue-scene--entering"), e.style.animation = `${l} ${n}`, this.viewport.appendChild(e), s && (s.classList.add("cue-scene--exiting"), s.style.animation = `${u} ${n}`, s.addEventListener("animationend", () => s.remove(), { once: !0 }));
3172
+ } else a.type === "zoom" ? (e.classList.add("cue-scene--entering"), e.style.animation = `cue-zoom-in ${n}`, this.viewport.appendChild(e), s && (s.classList.add("cue-scene--exiting"), s.style.animation = `cue-zoom-out ${n}`, s.addEventListener("animationend", () => s.remove(), { once: !0 }))) : a.type === "reveal" ? (e.classList.add("cue-scene--entering"), e.style.animation = `cue-reveal-in ${n}`, this.viewport.appendChild(e), s && (s.classList.add("cue-scene--exiting"), s.style.animation = `cue-reveal-out ${n}`, s.addEventListener("animationend", () => s.remove(), { once: !0 }))) : a.type === "flip" ? (e.classList.add("cue-scene--entering"), e.style.animation = `cue-flip-in ${n}`, this.viewport.appendChild(e), s && (s.classList.add("cue-scene--exiting"), s.style.animation = `cue-flip-out ${n}`, s.addEventListener("animationend", () => s.remove(), { once: !0 }))) : a.type === "morph" ? (e.classList.add("cue-scene--entering"), e.style.animation = `cue-morph-in ${n}`, this.viewport.appendChild(e), s && (s.classList.add("cue-scene--exiting"), s.style.animation = `cue-morph-out ${n}`, s.addEventListener("animationend", () => s.remove(), { once: !0 }))) : (this.viewport.innerHTML = "", this.viewport.appendChild(e));
3173
+ e.addEventListener("animationend", () => {
3174
+ e.classList.remove("cue-scene--entering"), e.style.animation = "", this.transitioning = !1;
3175
+ }, { once: !0 });
3176
+ }
3177
+ handleSceneComplete() {
3178
+ this.autoPlay && setTimeout(() => this.nextScene(), 100);
3179
+ }
3180
+ updateSceneCounter() {
3181
+ if (!this.cupFile) return;
3182
+ const e = this.cupFile.content.scenes.length;
3183
+ this.sceneCounter.textContent = `${this.currentSceneIndex + 1} / ${e}`;
3184
+ }
3185
+ updateStepIndicator() {
3186
+ const e = this.timeline.totalSteps();
3187
+ if (e <= 1) {
3188
+ this.hideStepIndicator();
3189
+ return;
3190
+ }
3191
+ const a = this.timeline.currentStep();
3192
+ this.stepIndicator.textContent = `${a} / ${e}`, this.stepIndicator.classList.add("cue-step-indicator--visible");
3193
+ }
3194
+ hideStepIndicator() {
3195
+ this.stepIndicator.classList.remove("cue-step-indicator--visible");
3196
+ }
3197
+ updateProgress() {
3198
+ if (!this.cupFile) return;
3199
+ const e = this.cupFile.content.scenes.length, a = (this.currentSceneIndex + 1) / e * 100;
3200
+ this.progressBar.style.width = `${a}%`;
3201
+ }
3202
+ updateScale() {
3203
+ const e = this.viewport.clientWidth, a = this.viewport.clientHeight;
3204
+ if (e === 0 || a === 0) return;
3205
+ let i = 1920, n = 1080;
3206
+ Math.min(e / i, a / n) < R.MIN_SCALE && (i = Math.round(e / R.MIN_SCALE), n = Math.round(i * 9 / 16));
3207
+ const r = Math.min(e / i, a / n);
3208
+ this.viewport.style.setProperty("--cue-design-w", `${i}px`), this.viewport.style.setProperty("--cue-design-h", `${n}px`), this.viewport.style.setProperty("--cue-scale", String(r));
3209
+ }
3210
+ applyTheme(e) {
3211
+ const a = this.container;
3212
+ if (a.style.setProperty("--cue-bg", e.colors.background), a.style.setProperty("--cue-fg", e.colors.foreground), a.style.setProperty("--cue-primary", e.colors.primary), a.style.setProperty("--cue-secondary", e.colors.secondary), a.style.setProperty("--cue-accent", e.colors.accent), a.style.setProperty("--cue-code-bg", e.colors.codeBackground), a.style.setProperty("--cue-code-fg", e.colors.codeForeground), a.style.setProperty("--cue-font-heading", e.fonts.heading), a.style.setProperty("--cue-font-body", e.fonts.body), a.style.setProperty("--cue-font-code", e.fonts.code), e.typography) {
3213
+ const i = ["title", "subtitle", "heading", "body", "caption", "footer"];
3214
+ for (const n of i) {
3215
+ const s = e.typography[n];
3216
+ s && (s.fontSize && a.style.setProperty(`--cue-typo-${n}-size`, s.fontSize), s.fontWeight && a.style.setProperty(`--cue-typo-${n}-weight`, s.fontWeight), s.lineHeight && a.style.setProperty(`--cue-typo-${n}-lh`, s.lineHeight), s.letterSpacing && a.style.setProperty(`--cue-typo-${n}-ls`, s.letterSpacing), s.textTransform && a.style.setProperty(`--cue-typo-${n}-tt`, s.textTransform));
3217
+ }
3218
+ }
3219
+ if (e.fontImports) {
3220
+ for (const i of e.fontImports)
3221
+ if (!document.querySelector(`link[href="${i}"]`)) {
3222
+ const n = document.createElement("link");
3223
+ n.rel = "stylesheet", n.href = i, document.head.appendChild(n);
3224
+ }
3225
+ }
3226
+ }
3227
+ };
3228
+ f(R, "MIN_SCALE", 0.5);
3229
+ let be = R;
3230
+ export {
3231
+ be as CuePlayer,
3232
+ ne as Navigator,
3233
+ dn as PresenterView,
3234
+ sn as SlideOverview,
3235
+ bn as THEMES,
3236
+ ge as TimelineController,
3237
+ an as animate,
3238
+ He as darkTheme,
3239
+ kn as getAnimationNames,
3240
+ Rt as getTemplateRenderer,
3241
+ wn as getTemplateRendererIds,
3242
+ Be as lightTheme,
3243
+ et as loadFromUrl,
3244
+ xn as registerTemplatePackage,
3245
+ vn as registerTemplateRenderer,
3246
+ ie as renderScene
3247
+ };