@cloudvoyant/helical-ui 0.19.0-rc.202609202037.f0e5ef1

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 (61) hide show
  1. package/dist/index.cjs +2918 -0
  2. package/dist/index.d.cts +987 -0
  3. package/dist/index.d.ts +987 -0
  4. package/dist/index.js +2585 -0
  5. package/package.json +86 -0
  6. package/src/components.css +129 -0
  7. package/src/theme.css +189 -0
  8. package/src/themes/amber-minimal.css +83 -0
  9. package/src/themes/amethyst-haze.css +83 -0
  10. package/src/themes/anthropic.css +60 -0
  11. package/src/themes/anyscale.css +73 -0
  12. package/src/themes/bold-tech.css +82 -0
  13. package/src/themes/bubblegum.css +85 -0
  14. package/src/themes/caffeine.css +73 -0
  15. package/src/themes/candyland.css +75 -0
  16. package/src/themes/catppuccin.css +81 -0
  17. package/src/themes/claude.css +81 -0
  18. package/src/themes/claymorphism.css +83 -0
  19. package/src/themes/clean-slate.css +82 -0
  20. package/src/themes/cosmic-night.css +82 -0
  21. package/src/themes/cyberpunk.css +81 -0
  22. package/src/themes/darkmatter.css +84 -0
  23. package/src/themes/default.css +62 -0
  24. package/src/themes/doom-64.css +95 -0
  25. package/src/themes/elegant-luxury.css +82 -0
  26. package/src/themes/graphite.css +59 -0
  27. package/src/themes/green.css +57 -0
  28. package/src/themes/helical-ui.css +88 -0
  29. package/src/themes/kodama-grove.css +81 -0
  30. package/src/themes/lambda.css +63 -0
  31. package/src/themes/mdbook.css +108 -0
  32. package/src/themes/midnight-bloom.css +82 -0
  33. package/src/themes/mocha-mousse.css +82 -0
  34. package/src/themes/modern-minimal.css +76 -0
  35. package/src/themes/mono.css +81 -0
  36. package/src/themes/nature.css +76 -0
  37. package/src/themes/neo-brutalism.css +81 -0
  38. package/src/themes/northern-lights.css +76 -0
  39. package/src/themes/notebook.css +95 -0
  40. package/src/themes/ocean-breeze.css +82 -0
  41. package/src/themes/openai.css +59 -0
  42. package/src/themes/pastel-dreams.css +82 -0
  43. package/src/themes/perpetuity.css +91 -0
  44. package/src/themes/quantum-rose.css +85 -0
  45. package/src/themes/retro-arcade.css +81 -0
  46. package/src/themes/rose.css +57 -0
  47. package/src/themes/sage-garden.css +84 -0
  48. package/src/themes/slate.css +57 -0
  49. package/src/themes/soft-pop.css +95 -0
  50. package/src/themes/solar-dusk.css +83 -0
  51. package/src/themes/starry-night.css +74 -0
  52. package/src/themes/sunset-horizon.css +82 -0
  53. package/src/themes/supabase.css +83 -0
  54. package/src/themes/t3-chat.css +72 -0
  55. package/src/themes/tangerine.css +81 -0
  56. package/src/themes/twitter.css +82 -0
  57. package/src/themes/vercel.css +85 -0
  58. package/src/themes/vintage-paper.css +82 -0
  59. package/src/themes/violet-bloom.css +95 -0
  60. package/src/themes/vitepress.css +60 -0
  61. package/src/themes.css +4184 -0
package/dist/index.cjs ADDED
@@ -0,0 +1,2918 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ EditorHeading: () => EditorHeading,
34
+ ExitHeading: () => ExitHeading,
35
+ HeadingWithId: () => HeadingWithId,
36
+ SIDEBAR_KEYBOARD_SHORTCUT: () => SIDEBAR_KEYBOARD_SHORTCUT,
37
+ SIDEBAR_WIDTH: () => SIDEBAR_WIDTH,
38
+ SIDEBAR_WIDTH_ICON: () => SIDEBAR_WIDTH_ICON,
39
+ SIDEBAR_WIDTH_MOBILE: () => SIDEBAR_WIDTH_MOBILE,
40
+ THEMES: () => THEMES,
41
+ THEME_NAMES: () => THEME_NAMES,
42
+ TitleHeading: () => TitleHeading,
43
+ badgeVariants: () => badgeVariants,
44
+ buildChartDefinition: () => buildChartDefinition,
45
+ buildExtensions: () => buildExtensions,
46
+ buttonVariants: () => buttonVariants,
47
+ cardBodyBase: () => cardBodyBase,
48
+ cardCoverVariants: () => cardCoverVariants,
49
+ cardDescriptionBase: () => cardDescriptionBase,
50
+ cardFooterBase: () => cardFooterBase,
51
+ cardHeaderBase: () => cardHeaderBase,
52
+ cardTitleBase: () => cardTitleBase,
53
+ cardVariants: () => cardVariants,
54
+ centerBase: () => centerBase,
55
+ chartPlaceholderBase: () => chartPlaceholderBase,
56
+ chartPlaceholderLabelBase: () => chartPlaceholderLabelBase,
57
+ chartRootBase: () => chartRootBase,
58
+ checkboxGroupBase: () => checkboxGroupBase,
59
+ checkboxIndicatorBase: () => checkboxIndicatorBase,
60
+ checkboxLabelBase: () => checkboxLabelBase,
61
+ checkboxVariants: () => checkboxVariants,
62
+ clipboardTriggerBase: () => clipboardTriggerBase,
63
+ cn: () => cn,
64
+ codeBlockBodyBase: () => codeBlockBodyBase,
65
+ codeBlockBodyScrollableBase: () => codeBlockBodyScrollableBase,
66
+ codeBlockContentBase: () => codeBlockContentBase,
67
+ codeBlockCopyFloatBase: () => codeBlockCopyFloatBase,
68
+ codeBlockHeaderBase: () => codeBlockHeaderBase,
69
+ codeBlockHeaderInfoBase: () => codeBlockHeaderInfoBase,
70
+ codeBlockHighlightBase: () => codeBlockHighlightBase,
71
+ codeBlockLineNumbersBase: () => codeBlockLineNumbersBase,
72
+ codeBlockLoadingBase: () => codeBlockLoadingBase,
73
+ codeBlockRootBase: () => codeBlockRootBase,
74
+ codeBlockSpinnerBase: () => codeBlockSpinnerBase,
75
+ codeBlockTitleBase: () => codeBlockTitleBase,
76
+ colBase: () => colBase,
77
+ comboboxClearTriggerBase: () => comboboxClearTriggerBase,
78
+ comboboxContentBase: () => comboboxContentBase,
79
+ comboboxControlBase: () => comboboxControlBase,
80
+ comboboxEmptyBase: () => comboboxEmptyBase,
81
+ comboboxInputBase: () => comboboxInputBase,
82
+ comboboxItemGroupLabelBase: () => comboboxItemGroupLabelBase,
83
+ comboboxItemIndicatorBase: () => comboboxItemIndicatorBase,
84
+ comboboxItemVariants: () => comboboxItemVariants,
85
+ comboboxListBase: () => comboboxListBase,
86
+ comboboxPositionerBase: () => comboboxPositionerBase,
87
+ comboboxTriggerBase: () => comboboxTriggerBase,
88
+ containerBase: () => containerBase,
89
+ createCodeBlockCustom: () => createCodeBlockCustom,
90
+ createImageNode: () => createImageNode,
91
+ createInternalMention: () => createInternalMention,
92
+ createLinkPreview: () => createLinkPreview,
93
+ createNoticeNode: () => createNoticeNode,
94
+ createUrlMention: () => createUrlMention,
95
+ defaultChartColor: () => defaultChartColor,
96
+ defaultListboxFilter: () => defaultListboxFilter,
97
+ dialogBackdropBase: () => dialogBackdropBase,
98
+ dialogCloseTriggerBase: () => dialogCloseTriggerBase,
99
+ dialogContentBase: () => dialogContentBase,
100
+ dialogDescriptionBase: () => dialogDescriptionBase,
101
+ dialogFooterBase: () => dialogFooterBase,
102
+ dialogFooterStickyBase: () => dialogFooterStickyBase,
103
+ dialogFullscreenContentBase: () => dialogFullscreenContentBase,
104
+ dialogHeaderBase: () => dialogHeaderBase,
105
+ dialogHeaderStickyBase: () => dialogHeaderStickyBase,
106
+ dialogPositionerBase: () => dialogPositionerBase,
107
+ dialogTitleBase: () => dialogTitleBase,
108
+ extractYouTubeId: () => extractYouTubeId,
109
+ feedbackCorrectBase: () => feedbackCorrectBase,
110
+ feedbackExplanationBase: () => feedbackExplanationBase,
111
+ feedbackIncorrectBase: () => feedbackIncorrectBase,
112
+ fetchYouTubeMetadata: () => fetchYouTubeMetadata,
113
+ fieldErrorBase: () => fieldErrorBase,
114
+ fieldHelperBase: () => fieldHelperBase,
115
+ fieldLabelBase: () => fieldLabelBase,
116
+ fieldRequiredIndicatorBase: () => fieldRequiredIndicatorBase,
117
+ fieldRootBase: () => fieldRootBase,
118
+ fieldsetErrorBase: () => fieldsetErrorBase,
119
+ fieldsetHelperBase: () => fieldsetHelperBase,
120
+ fieldsetLegendBase: () => fieldsetLegendBase,
121
+ fieldsetRootBase: () => fieldsetRootBase,
122
+ figureCaptionBase: () => figureCaptionBase,
123
+ figureImageBase: () => figureImageBase,
124
+ figureRootBase: () => figureRootBase,
125
+ findEditorScrollContainer: () => findEditorScrollContainer,
126
+ formatTime: () => formatTime,
127
+ hstackBase: () => hstackBase,
128
+ injectCodeBlockStyles: () => injectCodeBlockStyles,
129
+ inputVariants: () => inputVariants,
130
+ insertPastedUrlAsLink: () => insertPastedUrlAsLink,
131
+ itemVariants: () => itemVariants,
132
+ latexDisplayBase: () => latexDisplayBase,
133
+ latexErrorBase: () => latexErrorBase,
134
+ latexInlineBase: () => latexInlineBase,
135
+ latexRootBase: () => latexRootBase,
136
+ listboxContentBase: () => listboxContentBase,
137
+ listboxEmptyBase: () => listboxEmptyBase,
138
+ listboxInputBase: () => listboxInputBase,
139
+ listboxItemBase: () => listboxItemBase,
140
+ listboxItemIndicatorBase: () => listboxItemIndicatorBase,
141
+ listboxItemTextBase: () => listboxItemTextBase,
142
+ listboxLabelBase: () => listboxLabelBase,
143
+ listboxRootBase: () => listboxRootBase,
144
+ lockEditorOverlayScroll: () => lockEditorOverlayScroll,
145
+ manimCaptionBase: () => manimCaptionBase,
146
+ manimContainerBase: () => manimContainerBase,
147
+ manimErrorBase: () => manimErrorBase,
148
+ manimPlaceholderBase: () => manimPlaceholderBase,
149
+ manimPlaceholderLabelBase: () => manimPlaceholderLabelBase,
150
+ manimRootBase: () => manimRootBase,
151
+ mermaidLoadingBase: () => mermaidLoadingBase,
152
+ mermaidRootBase: () => mermaidRootBase,
153
+ mermaidSourceBase: () => mermaidSourceBase,
154
+ mermaidSvgAspectRatio: () => mermaidSvgAspectRatio,
155
+ mermaidSvgBase: () => mermaidSvgBase,
156
+ nativeSelectIconBase: () => nativeSelectIconBase,
157
+ nativeSelectVariants: () => nativeSelectVariants,
158
+ nativeSelectWrapperBase: () => nativeSelectWrapperBase,
159
+ navbarActionsBase: () => navbarActionsBase,
160
+ navbarActivationAreaBase: () => navbarActivationAreaBase,
161
+ navbarBrandBase: () => navbarBrandBase,
162
+ navbarContainerBase: () => navbarContainerBase,
163
+ navbarDensityVariants: () => navbarDensityVariants,
164
+ navbarMenuBase: () => navbarMenuBase,
165
+ navbarMenuContentBase: () => navbarMenuContentBase,
166
+ navbarMenuIndicatorBase: () => navbarMenuIndicatorBase,
167
+ navbarMenuItemBase: () => navbarMenuItemBase,
168
+ navbarMenuLinkBase: () => navbarMenuLinkBase,
169
+ navbarMenuListBase: () => navbarMenuListBase,
170
+ navbarMenuPlacementVariants: () => navbarMenuPlacementVariants,
171
+ navbarMenuRootBase: () => navbarMenuRootBase,
172
+ navbarMenuTriggerStyle: () => navbarMenuTriggerStyle,
173
+ navbarMenuViewportBase: () => navbarMenuViewportBase,
174
+ navbarMenuViewportPositionerBase: () => navbarMenuViewportPositionerBase,
175
+ navbarMobileActionsBase: () => navbarMobileActionsBase,
176
+ navbarMobileBase: () => navbarMobileBase,
177
+ navbarMobileContentBase: () => navbarMobileContentBase,
178
+ navbarMobileHeaderBase: () => navbarMobileHeaderBase,
179
+ navbarMobileMenuBase: () => navbarMobileMenuBase,
180
+ navbarMobileMenuContentBase: () => navbarMobileMenuContentBase,
181
+ navbarMobileMenuTriggerBase: () => navbarMobileMenuTriggerBase,
182
+ navbarShrunkBase: () => navbarShrunkBase,
183
+ navbarTriggerVariants: () => navbarTriggerVariants,
184
+ navbarVariants: () => navbarVariants,
185
+ noticeDescriptionBase: () => noticeDescriptionBase,
186
+ noticeTitleBase: () => noticeTitleBase,
187
+ noticeVariants: () => noticeVariants,
188
+ numberInputControlBase: () => numberInputControlBase,
189
+ numberInputInputBase: () => numberInputInputBase,
190
+ numberInputRootBase: () => numberInputRootBase,
191
+ numberInputTriggerBase: () => numberInputTriggerBase,
192
+ pageContentBase: () => pageContentBase,
193
+ pageFooterBase: () => pageFooterBase,
194
+ pageGutterAreaBase: () => pageGutterAreaBase,
195
+ pageGutterContentVariants: () => pageGutterContentVariants,
196
+ pageGutterVariants: () => pageGutterVariants,
197
+ pageSectionBase: () => pageSectionBase,
198
+ pageVariants: () => pageVariants,
199
+ paginationEllipsisBase: () => paginationEllipsisBase,
200
+ paginationItemBase: () => paginationItemBase,
201
+ paginationRootBase: () => paginationRootBase,
202
+ paginationTriggerBase: () => paginationTriggerBase,
203
+ parseYouTubeChapters: () => parseYouTubeChapters,
204
+ placeEditorOverlay: () => placeEditorOverlay,
205
+ placeEditorOverlayAt: () => placeEditorOverlayAt,
206
+ popoverArrowBase: () => popoverArrowBase,
207
+ popoverCloseTriggerBase: () => popoverCloseTriggerBase,
208
+ popoverContentBase: () => popoverContentBase,
209
+ popoverDescriptionBase: () => popoverDescriptionBase,
210
+ popoverIndicatorBase: () => popoverIndicatorBase,
211
+ popoverPositionerBase: () => popoverPositionerBase,
212
+ popoverTitleBase: () => popoverTitleBase,
213
+ prevNextDirectionBase: () => prevNextDirectionBase,
214
+ prevNextLinkBase: () => prevNextLinkBase,
215
+ prevNextLinkNextBase: () => prevNextLinkNextBase,
216
+ prevNextRootBase: () => prevNextRootBase,
217
+ prevNextSpacerBase: () => prevNextSpacerBase,
218
+ prevNextTitleBase: () => prevNextTitleBase,
219
+ proseVariants: () => proseVariants,
220
+ questionCardBase: () => questionCardBase,
221
+ questionCheckButtonBase: () => questionCheckButtonBase,
222
+ questionGroupBase: () => questionGroupBase,
223
+ questionInputBase: () => questionInputBase,
224
+ questionOptionBase: () => questionOptionBase,
225
+ questionOptionCorrectBase: () => questionOptionCorrectBase,
226
+ questionOptionIncorrectBase: () => questionOptionIncorrectBase,
227
+ questionPromptBase: () => questionPromptBase,
228
+ questionUnitBase: () => questionUnitBase,
229
+ quizHeaderBase: () => quizHeaderBase,
230
+ quizResetButtonBase: () => quizResetButtonBase,
231
+ quizResultBase: () => quizResultBase,
232
+ quizResultTextBase: () => quizResultTextBase,
233
+ quizResultTitleBase: () => quizResultTitleBase,
234
+ quizRootBase: () => quizRootBase,
235
+ quizScoreBase: () => quizScoreBase,
236
+ quizSubmitButtonBase: () => quizSubmitButtonBase,
237
+ quizTitleBase: () => quizTitleBase,
238
+ radioGroupItemControlBase: () => radioGroupItemControlBase,
239
+ radioGroupItemTextBase: () => radioGroupItemTextBase,
240
+ radioGroupRootBase: () => radioGroupRootBase,
241
+ registerImageInsertCallback: () => registerImageInsertCallback,
242
+ registerYouTubeInsertCallback: () => registerYouTubeInsertCallback,
243
+ renderChartSvgString: () => renderChartSvgString,
244
+ renderCodeToHtml: () => renderCodeToHtml,
245
+ renderMermaidSource: () => renderMermaidSource,
246
+ resolveMermaidThemeVariables: () => resolveMermaidThemeVariables,
247
+ revealChevronBase: () => revealChevronBase,
248
+ revealContentBase: () => revealContentBase,
249
+ revealRootBase: () => revealRootBase,
250
+ revealTriggerBase: () => revealTriggerBase,
251
+ rowBase: () => rowBase,
252
+ scrollContentBase: () => scrollContentBase,
253
+ scrollCornerBase: () => scrollCornerBase,
254
+ scrollRootBase: () => scrollRootBase,
255
+ scrollScrollbarBase: () => scrollScrollbarBase,
256
+ scrollThumbBase: () => scrollThumbBase,
257
+ scrollViewportBase: () => scrollViewportBase,
258
+ selectClearTriggerBase: () => selectClearTriggerBase,
259
+ selectContentBase: () => selectContentBase,
260
+ selectIndicatorBase: () => selectIndicatorBase,
261
+ selectItemBase: () => selectItemBase,
262
+ selectItemGroupLabelBase: () => selectItemGroupLabelBase,
263
+ selectItemIndicatorBase: () => selectItemIndicatorBase,
264
+ selectItemTextBase: () => selectItemTextBase,
265
+ selectPositionerBase: () => selectPositionerBase,
266
+ selectTriggerBase: () => selectTriggerBase,
267
+ selectValueBase: () => selectValueBase,
268
+ sidebarMenuButtonVariants: () => sidebarMenuButtonVariants,
269
+ sidebarStyles: () => sidebarStyles,
270
+ slashCommands: () => slashCommands,
271
+ splitterPanelBase: () => splitterPanelBase,
272
+ splitterResizeTriggerBase: () => splitterResizeTriggerBase,
273
+ splitterResizeTriggerIndicatorBase: () => splitterResizeTriggerIndicatorBase,
274
+ splitterResizeTriggerSeparatorBase: () => splitterResizeTriggerSeparatorBase,
275
+ splitterRootBase: () => splitterRootBase,
276
+ stackBase: () => stackBase,
277
+ switchControlBase: () => switchControlBase,
278
+ switchLabelBase: () => switchLabelBase,
279
+ switchThumbBase: () => switchThumbBase,
280
+ switchVariants: () => switchVariants,
281
+ tabsContentBase: () => tabsContentBase,
282
+ tabsIndicatorBase: () => tabsIndicatorBase,
283
+ tabsIndicatorVariants: () => tabsIndicatorVariants,
284
+ tabsListBase: () => tabsListBase,
285
+ tabsListVariants: () => tabsListVariants,
286
+ tabsRootBase: () => tabsRootBase,
287
+ tabsTriggerBase: () => tabsTriggerBase,
288
+ tagsInputClearTriggerBase: () => tagsInputClearTriggerBase,
289
+ tagsInputControlBase: () => tagsInputControlBase,
290
+ tagsInputInputBase: () => tagsInputInputBase,
291
+ tagsInputItemBase: () => tagsInputItemBase,
292
+ tagsInputItemDeleteTriggerBase: () => tagsInputItemDeleteTriggerBase,
293
+ tagsInputItemInputBase: () => tagsInputItemInputBase,
294
+ tagsInputItemTextBase: () => tagsInputItemTextBase,
295
+ tagsInputRootBase: () => tagsInputRootBase,
296
+ textareaBase: () => textareaBase,
297
+ toLaTeX: () => toLaTeX,
298
+ tocIndicatorBase: () => tocIndicatorBase,
299
+ tocItemBase: () => tocItemBase,
300
+ tocLinkBase: () => tocLinkBase,
301
+ tocLinkVariants: () => tocLinkVariants,
302
+ tocListBase: () => tocListBase,
303
+ tocListVariants: () => tocListVariants,
304
+ tocNavBase: () => tocNavBase,
305
+ tocSkeletonBase: () => tocSkeletonBase,
306
+ tocTitleBase: () => tocTitleBase,
307
+ toggleButtonVariants: () => toggleButtonVariants,
308
+ toggleGroupRootVariants: () => toggleGroupRootVariants,
309
+ tooltipArrowBase: () => tooltipArrowBase,
310
+ tooltipContentBase: () => tooltipContentBase,
311
+ tooltipPositionerBase: () => tooltipPositionerBase,
312
+ unregisterImageInsertCallback: () => unregisterImageInsertCallback,
313
+ unregisterYouTubeInsertCallback: () => unregisterYouTubeInsertCallback,
314
+ vstackBase: () => vstackBase,
315
+ windowBodyBase: () => windowBodyBase,
316
+ windowCloseTriggerBase: () => windowCloseTriggerBase,
317
+ windowContentBase: () => windowContentBase,
318
+ windowControlBase: () => windowControlBase,
319
+ windowDragTriggerBase: () => windowDragTriggerBase,
320
+ windowHeaderBase: () => windowHeaderBase,
321
+ windowPositionerBase: () => windowPositionerBase,
322
+ windowResizeTriggerBase: () => windowResizeTriggerBase,
323
+ windowStageTriggerBase: () => windowStageTriggerBase,
324
+ windowTitleBase: () => windowTitleBase,
325
+ youtubeChapterButtonBase: () => youtubeChapterButtonBase,
326
+ youtubeChapterLabelBase: () => youtubeChapterLabelBase,
327
+ youtubeChapterTimeBase: () => youtubeChapterTimeBase,
328
+ youtubeChaptersBase: () => youtubeChaptersBase,
329
+ youtubeChaptersChevronBase: () => youtubeChaptersChevronBase,
330
+ youtubeChaptersListBase: () => youtubeChaptersListBase,
331
+ youtubeChaptersSummaryBase: () => youtubeChaptersSummaryBase,
332
+ youtubeDescriptionBase: () => youtubeDescriptionBase,
333
+ youtubeFacadeBase: () => youtubeFacadeBase,
334
+ youtubePlayButtonBase: () => youtubePlayButtonBase,
335
+ youtubePlayButtonInnerBase: () => youtubePlayButtonInnerBase,
336
+ youtubeRootBase: () => youtubeRootBase,
337
+ youtubeTitleBase: () => youtubeTitleBase
338
+ });
339
+ module.exports = __toCommonJS(index_exports);
340
+
341
+ // src/button.ts
342
+ var import_class_variance_authority = require("class-variance-authority");
343
+ var fills = {
344
+ solid: {
345
+ primary: "bg-primary text-primary-foreground hover:bg-primary/90",
346
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
347
+ success: "bg-success text-success-foreground hover:bg-success/90",
348
+ danger: "bg-danger text-danger-foreground hover:bg-danger/90",
349
+ warn: "bg-warn text-warn-foreground hover:bg-warn/90",
350
+ info: "bg-info text-info-foreground hover:bg-info/90"
351
+ },
352
+ outline: {
353
+ primary: "border border-primary/40 bg-background text-primary hover:bg-primary/10",
354
+ secondary: "border border-secondary-foreground/30 bg-background text-secondary-foreground hover:bg-secondary",
355
+ success: "border border-success/50 bg-background text-success hover:bg-success/10",
356
+ danger: "border border-danger/50 bg-background text-danger hover:bg-danger/10",
357
+ warn: "border border-warn/60 bg-background text-warn hover:bg-warn/15",
358
+ info: "border border-info/50 bg-background text-info hover:bg-info/10"
359
+ },
360
+ text: {
361
+ primary: "bg-transparent text-primary hover:bg-primary/10",
362
+ secondary: "bg-transparent text-secondary-foreground hover:bg-secondary",
363
+ success: "bg-transparent text-success hover:bg-success/10",
364
+ danger: "bg-transparent text-danger hover:bg-danger/10",
365
+ warn: "bg-transparent text-warn hover:bg-warn/15",
366
+ info: "bg-transparent text-info hover:bg-info/10"
367
+ }
368
+ };
369
+ var compoundVariants = Object.entries(fills).flatMap(
370
+ ([variant, colors]) => Object.entries(colors).map(([color, className]) => ({ variant, color, className }))
371
+ );
372
+ var buttonVariants = (0, import_class_variance_authority.cva)(
373
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
374
+ {
375
+ variants: {
376
+ variant: {
377
+ solid: "",
378
+ outline: "",
379
+ text: ""
380
+ },
381
+ color: {
382
+ primary: "",
383
+ secondary: "",
384
+ success: "",
385
+ danger: "",
386
+ warn: "",
387
+ info: ""
388
+ },
389
+ size: {
390
+ sm: "h-9 px-3",
391
+ md: "h-10 px-4 py-2",
392
+ lg: "h-11 px-8",
393
+ icon: "size-10"
394
+ }
395
+ },
396
+ compoundVariants,
397
+ defaultVariants: {
398
+ variant: "solid",
399
+ color: "primary",
400
+ size: "md"
401
+ }
402
+ }
403
+ );
404
+
405
+ // src/toggle-button.ts
406
+ var import_class_variance_authority2 = require("class-variance-authority");
407
+ var toggleButtonVariants = (0, import_class_variance_authority2.cva)(
408
+ "inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
409
+ {
410
+ variants: {
411
+ variant: {
412
+ default: "bg-transparent",
413
+ outline: "border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"
414
+ },
415
+ size: {
416
+ default: "h-9 min-w-9 px-2",
417
+ sm: "h-8 min-w-8 px-1.5",
418
+ lg: "h-10 min-w-10 px-2.5"
419
+ }
420
+ },
421
+ defaultVariants: { variant: "default", size: "default" }
422
+ }
423
+ );
424
+
425
+ // src/tooltip.ts
426
+ var tooltipPositionerBase = "z-50 [--z-index:50]!";
427
+ var tooltipArrowBase = "[--arrow-size:0.5rem] [--arrow-background:var(--color-popover)] z-[60]! [--arrow-size-half:calc(var(--arrow-size)/2_+_1px)]!";
428
+ var tooltipContentBase = "relative z-50 max-w-xs rounded-md border bg-popover px-3 py-1.5 text-xs text-popover-foreground shadow-md outline-none";
429
+
430
+ // src/popover.ts
431
+ var popoverPositionerBase = "z-50 [--z-index:50]!";
432
+ var popoverArrowBase = "[--arrow-size:0.5rem] [--arrow-background:var(--color-popover)] z-[60]! [--arrow-size-half:calc(var(--arrow-size)/2_+_1px)]!";
433
+ var popoverContentBase = "relative z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none";
434
+ var popoverTitleBase = "text-sm font-semibold leading-none";
435
+ var popoverDescriptionBase = "text-sm text-muted-foreground";
436
+ var popoverCloseTriggerBase = "absolute end-3.5 top-3.5 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-[3px] focus:ring-ring/30 disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0";
437
+ var popoverIndicatorBase = "transition-transform data-[state=open]:rotate-180";
438
+
439
+ // src/dialog.ts
440
+ var dialogBackdropBase = "bg-black/50";
441
+ var dialogPositionerBase = "fixed inset-0 z-50 [--z-index:50]! flex items-start justify-center overflow-y-auto p-4";
442
+ var dialogContentBase = "relative z-50 my-auto grid w-full max-w-lg gap-4 border bg-background p-6 shadow-lg sm:rounded-lg outline-none";
443
+ var dialogTitleBase = "text-lg font-semibold leading-none tracking-tight";
444
+ var dialogDescriptionBase = "text-sm text-muted-foreground";
445
+ var dialogHeaderBase = "flex flex-col gap-2";
446
+ var dialogFooterBase = "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end";
447
+ var dialogHeaderStickyBase = "sticky top-0 z-10 bg-background";
448
+ var dialogFooterStickyBase = "sticky bottom-0 z-10 bg-background";
449
+ var dialogFullscreenContentBase = "h-dvh w-full max-w-none rounded-none border-0 p-0 sm:rounded-none";
450
+ var dialogCloseTriggerBase = "absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-[3px] focus:ring-ring/30 disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0";
451
+
452
+ // src/window.ts
453
+ var windowPositionerBase = "z-50 [--z-index:50]!";
454
+ var windowContentBase = "relative z-50 flex w-80 flex-col overflow-hidden rounded-lg border bg-popover text-popover-foreground shadow-lg";
455
+ var windowDragTriggerBase = "flex flex-col";
456
+ var windowHeaderBase = "flex cursor-move items-center justify-between gap-2 border-b px-4 py-2.5";
457
+ var windowTitleBase = "text-sm font-semibold leading-none";
458
+ var windowControlBase = "flex items-center gap-1";
459
+ var windowStageTriggerBase = "inline-flex size-6 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus:outline-none focus:ring-[3px] focus:ring-ring/30 [&_svg]:size-3.5 [&_svg]:shrink-0";
460
+ var windowCloseTriggerBase = "inline-flex size-6 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus:outline-none focus:ring-[3px] focus:ring-ring/30 [&_svg]:size-3.5 [&_svg]:shrink-0";
461
+ var windowBodyBase = "flex flex-1 flex-col gap-4 overflow-auto p-4 text-sm";
462
+ var windowResizeTriggerBase = "absolute bottom-0 right-0 size-4 cursor-se-resize";
463
+
464
+ // src/badge.ts
465
+ var import_class_variance_authority3 = require("class-variance-authority");
466
+ var fills2 = {
467
+ solid: {
468
+ primary: "border-transparent bg-primary text-primary-foreground",
469
+ secondary: "border-transparent bg-secondary text-secondary-foreground",
470
+ success: "border-transparent bg-success text-success-foreground",
471
+ danger: "border-transparent bg-danger text-danger-foreground",
472
+ warn: "border-transparent bg-warn text-warn-foreground",
473
+ info: "border-transparent bg-info text-info-foreground"
474
+ },
475
+ subtle: {
476
+ primary: "border-transparent bg-primary/10 text-primary",
477
+ secondary: "border-transparent bg-secondary/10 text-secondary-foreground",
478
+ success: "border-transparent bg-success/10 text-success",
479
+ danger: "border-transparent bg-danger/10 text-danger",
480
+ warn: "border-transparent bg-warn/10 text-warn",
481
+ info: "border-transparent bg-info/10 text-info"
482
+ },
483
+ outline: {
484
+ primary: "border-primary/40 bg-transparent text-primary",
485
+ secondary: "border-secondary-foreground/30 bg-transparent text-secondary-foreground",
486
+ success: "border-success/50 bg-transparent text-success",
487
+ danger: "border-danger/50 bg-transparent text-danger",
488
+ warn: "border-warn/50 bg-transparent text-warn",
489
+ info: "border-info/50 bg-transparent text-info"
490
+ },
491
+ surface: {
492
+ primary: "border-primary/40 bg-primary/10 text-primary",
493
+ secondary: "border-secondary-foreground/30 bg-secondary text-secondary-foreground",
494
+ success: "border-success/50 bg-success/10 text-success",
495
+ danger: "border-danger/50 bg-danger/10 text-danger",
496
+ warn: "border-warn/50 bg-warn/10 text-warn",
497
+ info: "border-info/50 bg-info/10 text-info"
498
+ },
499
+ plain: {
500
+ primary: "border-transparent bg-transparent text-primary",
501
+ secondary: "border-transparent bg-transparent text-secondary-foreground",
502
+ success: "border-transparent bg-transparent text-success",
503
+ danger: "border-transparent bg-transparent text-danger",
504
+ warn: "border-transparent bg-transparent text-warn",
505
+ info: "border-transparent bg-transparent text-info"
506
+ }
507
+ };
508
+ var compoundVariants2 = Object.entries(fills2).flatMap(
509
+ ([variant, colors]) => Object.entries(colors).map(([color, className]) => ({ variant, color, className }))
510
+ );
511
+ var badgeVariants = (0, import_class_variance_authority3.cva)(
512
+ "inline-flex items-center gap-1 rounded-md border font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
513
+ {
514
+ variants: {
515
+ variant: {
516
+ solid: "",
517
+ subtle: "",
518
+ outline: "",
519
+ surface: "",
520
+ plain: ""
521
+ },
522
+ color: {
523
+ primary: "",
524
+ secondary: "",
525
+ success: "",
526
+ danger: "",
527
+ warn: "",
528
+ info: ""
529
+ },
530
+ size: {
531
+ xs: "px-1.5 py-0.5 text-[10px]",
532
+ sm: "px-2 py-0.5 text-xs",
533
+ md: "px-2.5 py-1 text-xs",
534
+ lg: "px-3 py-1 text-sm"
535
+ }
536
+ },
537
+ compoundVariants: compoundVariants2,
538
+ defaultVariants: {
539
+ variant: "subtle",
540
+ color: "primary",
541
+ size: "sm"
542
+ }
543
+ }
544
+ );
545
+
546
+ // src/layout.ts
547
+ var containerBase = "relative mx-auto w-full max-w-[90rem] px-4 md:px-6 lg:px-8";
548
+ var rowBase = "flex flex-row";
549
+ var colBase = "flex flex-col";
550
+ var stackBase = "flex flex-col gap-1";
551
+ var hstackBase = "flex flex-row gap-1";
552
+ var vstackBase = "flex flex-col gap-1";
553
+ var centerBase = "flex items-center justify-center";
554
+
555
+ // src/item.ts
556
+ var import_class_variance_authority4 = require("class-variance-authority");
557
+ var itemVariants = (0, import_class_variance_authority4.cva)("flex-1 p-3 text-sm", {
558
+ variants: {
559
+ variant: {
560
+ plain: "",
561
+ surface: "rounded-md border border-border bg-card text-card-foreground"
562
+ }
563
+ },
564
+ defaultVariants: {
565
+ variant: "plain"
566
+ }
567
+ });
568
+
569
+ // src/card.ts
570
+ var import_class_variance_authority5 = require("class-variance-authority");
571
+ var cardVariants = (0, import_class_variance_authority5.cva)("flex flex-col overflow-hidden rounded-lg border bg-card text-card-foreground", {
572
+ variants: {
573
+ variant: {
574
+ outline: "border-border shadow-xs",
575
+ elevated: "border-transparent shadow-md",
576
+ subtle: "border-transparent bg-muted"
577
+ },
578
+ size: {
579
+ sm: "gap-3 p-3 [--card-padding:0.75rem]",
580
+ md: "gap-4 p-4 [--card-padding:1rem]",
581
+ lg: "gap-6 p-6 [--card-padding:1.5rem]"
582
+ },
583
+ orientation: {
584
+ vertical: "",
585
+ horizontal: "flex-row"
586
+ }
587
+ },
588
+ defaultVariants: {
589
+ variant: "outline",
590
+ size: "md",
591
+ orientation: "vertical"
592
+ }
593
+ });
594
+ var cardCoverVariants = (0, import_class_variance_authority5.cva)("shrink-0 overflow-hidden", {
595
+ variants: {
596
+ variant: {
597
+ flush: "",
598
+ inset: "rounded-md"
599
+ },
600
+ orientation: {
601
+ vertical: "",
602
+ horizontal: ""
603
+ }
604
+ },
605
+ compoundVariants: [
606
+ {
607
+ variant: "flush",
608
+ orientation: "vertical",
609
+ className: "-mx-[var(--card-padding)] -mt-[var(--card-padding)]"
610
+ },
611
+ {
612
+ variant: "flush",
613
+ orientation: "horizontal",
614
+ className: "-ml-[var(--card-padding)] -mt-[var(--card-padding)] -mb-[var(--card-padding)]"
615
+ }
616
+ ],
617
+ defaultVariants: {
618
+ variant: "flush",
619
+ orientation: "vertical"
620
+ }
621
+ });
622
+ var cardHeaderBase = "flex flex-col gap-1";
623
+ var cardBodyBase = "";
624
+ var cardFooterBase = "flex items-center gap-2";
625
+ var cardTitleBase = "font-semibold leading-tight";
626
+ var cardDescriptionBase = "text-sm text-muted-foreground";
627
+
628
+ // src/scroll.ts
629
+ var scrollRootBase = "relative flex h-full w-full flex-col overflow-hidden [--scrollbar-size:0.5rem] [--scrollbar-margin:2px]";
630
+ var scrollViewportBase = "flex h-full w-full flex-col rounded-[inherit] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden";
631
+ var scrollContentBase = "min-w-full";
632
+ var scrollScrollbarBase = "relative m-[var(--scrollbar-margin)] flex touch-none select-none rounded-full bg-border/10 opacity-0 transition-opacity duration-150 data-[hover]:opacity-100 data-[scrolling]:opacity-100 data-[orientation=vertical]:w-[var(--scrollbar-size)] data-[orientation=vertical]:flex-col data-[orientation=horizontal]:h-[var(--scrollbar-size)] data-[orientation=horizontal]:flex-row [&:not([data-overflow-x],[data-overflow-y])]:hidden";
633
+ var scrollThumbBase = "rounded-[inherit] bg-border/40 transition-colors data-[orientation=vertical]:w-full data-[orientation=horizontal]:h-full";
634
+ var scrollCornerBase = "m-[var(--scrollbar-margin)] bg-muted opacity-0 transition-opacity duration-150 data-[hover]:opacity-100";
635
+
636
+ // src/page.ts
637
+ var import_class_variance_authority6 = require("class-variance-authority");
638
+
639
+ // src/cn.ts
640
+ var import_clsx = require("clsx");
641
+ var import_tailwind_merge = require("tailwind-merge");
642
+ function cn(...inputs) {
643
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
644
+ }
645
+
646
+ // src/page.ts
647
+ var pageVariants = (0, import_class_variance_authority6.cva)("min-h-svh w-full", {
648
+ variants: {
649
+ variant: {
650
+ default: 'grid grid-cols-[auto_minmax(0,1fr)_auto] grid-rows-[minmax(100svh,1fr)_auto] [grid-template-areas:"left_content_right"_"footer_footer_footer"]',
651
+ landing: colBase
652
+ }
653
+ },
654
+ defaultVariants: { variant: "default" }
655
+ });
656
+ var pageGutterAreaBase = "h-full min-w-0 [grid-area:left]";
657
+ var pageGutterVariants = (0, import_class_variance_authority6.cva)(
658
+ "sticky top-0 h-svh w-4 shrink-0 overflow-hidden p-0.5 md:w-56 md:p-2 lg:w-72 lg:p-3",
659
+ {
660
+ variants: {
661
+ side: {
662
+ left: "",
663
+ right: ""
664
+ }
665
+ },
666
+ defaultVariants: { side: "left" }
667
+ }
668
+ );
669
+ var pageGutterContentVariants = (0, import_class_variance_authority6.cva)("hidden h-full w-full flex-col md:flex", {
670
+ variants: {
671
+ align: {
672
+ start: "justify-start",
673
+ center: "justify-center",
674
+ end: "justify-end"
675
+ }
676
+ },
677
+ defaultVariants: { align: "start" }
678
+ });
679
+ var pageContentBase = "min-w-0 [grid-area:content]";
680
+ var pageFooterBase = "w-full shrink-0 [grid-area:footer]";
681
+ var pageSectionBase = cn(colBase, "min-h-svh w-full");
682
+
683
+ // src/splitter.ts
684
+ var splitterRootBase = "";
685
+ var splitterPanelBase = "";
686
+ var splitterResizeTriggerBase = "group relative grid place-items-center outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 data-[orientation=horizontal]:-mx-1 data-[orientation=horizontal]:min-w-2 data-[orientation=vertical]:-my-1 data-[orientation=vertical]:min-h-2";
687
+ var splitterResizeTriggerSeparatorBase = "absolute bg-border group-data-[orientation=horizontal]:inset-y-0 group-data-[orientation=horizontal]:right-1 group-data-[orientation=horizontal]:w-px group-data-[orientation=vertical]:inset-x-0 group-data-[orientation=vertical]:bottom-1 group-data-[orientation=vertical]:h-px";
688
+ var splitterResizeTriggerIndicatorBase = "relative z-10 rounded-full border border-border bg-muted shadow-xs data-[dragging]:bg-muted-foreground data-[focus]:bg-accent data-[disabled]:hidden data-[orientation=horizontal]:h-6 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-6";
689
+
690
+ // src/sidebar.ts
691
+ var import_class_variance_authority7 = require("class-variance-authority");
692
+ var SIDEBAR_WIDTH = "16rem";
693
+ var SIDEBAR_WIDTH_MOBILE = "18rem";
694
+ var SIDEBAR_WIDTH_ICON = "3rem";
695
+ var SIDEBAR_KEYBOARD_SHORTCUT = "b";
696
+ var sidebarMenuButtonVariants = (0, import_class_variance_authority7.cva)(
697
+ "peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
698
+ {
699
+ variants: {
700
+ variant: {
701
+ default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
702
+ outline: "bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"
703
+ },
704
+ size: {
705
+ default: "h-8 text-sm",
706
+ sm: "h-7 text-xs",
707
+ lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
708
+ }
709
+ },
710
+ defaultVariants: {
711
+ variant: "default",
712
+ size: "default"
713
+ }
714
+ }
715
+ );
716
+ var sidebarStyles = {
717
+ wrapperClass: "group/sidebar-wrapper min-h-svh w-full has-data-[variant=inset]:bg-sidebar",
718
+ // Base (static) classes for the desktop sidebar container. Side- and
719
+ // variant-specific classes are applied inline in the framework wrappers via
720
+ // ternaries, exactly as in the shadcn source. The `flex` direction bases are
721
+ // provided by the Row/Col layout primitives at render time.
722
+ containerClass: "fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
723
+ gapClass: "relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear group-data-[collapsible=offcanvas]:w-0",
724
+ innerClass: "flex h-full w-full flex-col bg-sidebar data-[variant=floating]:rounded-lg data-[variant=floating]:border data-[variant=floating]:border-sidebar-border data-[variant=floating]:shadow-sm",
725
+ headerClass: "gap-2 p-2",
726
+ footerClass: "gap-2 p-2",
727
+ separatorClass: "mx-2 w-auto bg-sidebar-border",
728
+ contentClass: "min-h-0 flex-1 gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
729
+ groupClass: "relative w-full min-w-0 p-2",
730
+ groupLabelClass: "flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0 group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
731
+ groupActionClass: "absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0 after:absolute after:-inset-2 md:after:hidden group-data-[collapsible=icon]:hidden",
732
+ groupContentClass: "w-full text-sm",
733
+ menuClass: "flex w-full min-w-0 flex-col gap-1",
734
+ menuItemClass: "group/menu-item relative",
735
+ menuActionClass: "absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0 after:absolute after:-inset-2 md:after:hidden peer-data-[size=sm]/menu-button:top-1 peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 group-data-[collapsible=icon]:hidden",
736
+ menuBadgeClass: "pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground peer-data-[size=sm]/menu-button:top-1 peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 group-data-[collapsible=icon]:hidden",
737
+ menuSkeletonClass: "flex h-8 items-center gap-2 rounded-md px-2",
738
+ menuSubClass: "mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden",
739
+ menuSubItemClass: "group/menu-sub-item relative",
740
+ menuSubButtonClass: "flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[size=sm]:text-xs data-[size=md]:text-sm group-data-[collapsible=icon]:hidden",
741
+ triggerClass: "flex size-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground ring-sidebar-ring outline-hidden transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
742
+ railClass: "absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[side=left]:cursor-w-resize group-data-[side=right]:cursor-e-resize [[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize [[data-side=left][data-collapsible=offcanvas]_&]:-right-2 [[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
743
+ insetClass: "relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
744
+ inputClass: "h-8 w-full bg-background shadow-none",
745
+ tooltipContentClass: "z-50 w-auto rounded-md bg-sidebar-primary px-2 py-1.5 text-xs text-sidebar-primary-foreground"
746
+ };
747
+
748
+ // src/navbar-menu.ts
749
+ var import_class_variance_authority8 = require("class-variance-authority");
750
+ var navbarMenuRootBase = "group/nav-menu relative flex max-w-max flex-1 items-center justify-center";
751
+ var navbarMenuListBase = "group flex flex-1 list-none items-center justify-center gap-1";
752
+ var navbarMenuItemBase = "relative";
753
+ var navbarMenuTriggerStyle = (0, import_class_variance_authority8.cva)(
754
+ "group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-3 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-accent/50 data-[state=open]:text-accent-foreground data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent",
755
+ {
756
+ variants: {
757
+ density: {
758
+ relaxed: "",
759
+ compact: "h-8 px-2 text-xs"
760
+ },
761
+ variant: {
762
+ default: "",
763
+ link: "bg-transparent px-3 text-muted-foreground hover:bg-transparent hover:text-primary focus:bg-transparent focus:text-primary focus-visible:ring-2 focus-visible:ring-ring data-[state=open]:bg-transparent data-[state=open]:text-primary data-[state=open]:hover:bg-transparent data-[state=open]:focus:bg-transparent data-[active=true]:bg-transparent data-[active=true]:text-primary"
764
+ }
765
+ },
766
+ defaultVariants: { density: "relaxed", variant: "default" }
767
+ }
768
+ );
769
+ var navbarMenuContentBase = "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95 left-0 top-0 w-full min-w-44 bg-popover p-2 text-popover-foreground md:absolute md:w-auto";
770
+ var navbarMenuLinkBase = "data-[active=true]:bg-accent data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring";
771
+ var navbarMobileMenuContentBase = "flex flex-col gap-1 py-1";
772
+ var navbarMobileMenuTriggerBase = "flex w-full items-center justify-between rounded-md px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";
773
+ var navbarMenuViewportPositionerBase = "absolute left-0 top-full z-50 w-full";
774
+ var navbarMenuViewportBase = "absolute left-(--viewport-x) top-0 mt-1.5 h-(--viewport-height) w-(--viewport-width) overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md transition-[width,height] duration-200";
775
+ var navbarMenuIndicatorBase = "data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-50 flex h-1.5 items-end justify-center overflow-hidden";
776
+
777
+ // src/tabs.ts
778
+ var import_class_variance_authority9 = require("class-variance-authority");
779
+ var tabsRootBase = "flex flex-col gap-2 data-[orientation=vertical]:flex-row";
780
+ var tabsListBase = "relative z-0 flex w-fit items-center justify-center gap-x-0.5 text-muted-foreground data-[orientation=vertical]:flex-col";
781
+ var tabsListVariants = (0, import_class_variance_authority9.cva)("", {
782
+ variants: {
783
+ variant: {
784
+ default: "rounded-lg",
785
+ underline: "data-[orientation=vertical]:px-1 data-[orientation=horizontal]:py-1"
786
+ }
787
+ },
788
+ defaultVariants: {
789
+ variant: "default"
790
+ }
791
+ });
792
+ var tabsIndicatorBase = "absolute inset-x-0 bottom-0 h-(--height) w-(--width) transition-[width,translate] duration-200 ease-in-out motion-reduce:transition-none";
793
+ var tabsIndicatorVariants = (0, import_class_variance_authority9.cva)("", {
794
+ variants: {
795
+ variant: {
796
+ default: "-z-1 rounded-lg bg-accent",
797
+ underline: "z-10 bg-primary data-[orientation=horizontal]:h-0.5 data-[orientation=vertical]:w-0.5"
798
+ }
799
+ },
800
+ defaultVariants: {
801
+ variant: "default"
802
+ }
803
+ });
804
+ var tabsTriggerBase = "relative flex h-9 shrink-0 grow items-center justify-center gap-1.5 rounded-lg border border-transparent px-[calc(--spacing(2.5)-1px)] text-sm font-medium whitespace-nowrap transition-[color,background-color,box-shadow] data-[orientation=vertical]:w-full data-[orientation=vertical]:justify-start hover:text-foreground/72 aria-selected:text-foreground outline-none focus-visible:border-primary focus-visible:ring-3 focus-visible:ring-ring/30 data-disabled:pointer-events-none data-disabled:opacity-50 motion-reduce:transition-none sm:h-8 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0";
805
+ var tabsContentBase = "flex-1 outline-none";
806
+
807
+ // src/toc.ts
808
+ var import_class_variance_authority10 = require("class-variance-authority");
809
+ var tocNavBase = "w-full min-w-0 text-sm";
810
+ var tocTitleBase = "mb-2 text-xs font-semibold tracking-wider text-muted-foreground uppercase";
811
+ var tocListBase = "relative flex min-w-0 flex-col";
812
+ var tocListVariants = (0, import_class_variance_authority10.cva)(tocListBase, {
813
+ variants: {
814
+ variant: {
815
+ default: "gap-0.5 border-s border-border",
816
+ indicator: "gap-0.5 border-s border-border",
817
+ hover: "gap-0.5",
818
+ rail: "gap-0.5",
819
+ tree: "gap-0.5",
820
+ collapsible: "gap-0.5"
821
+ }
822
+ },
823
+ defaultVariants: { variant: "default" }
824
+ });
825
+ var tocItemBase = "min-w-0";
826
+ var tocLinkBase = "flex items-center gap-1.5 truncate rounded-md py-1 pe-2 text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/30 data-[active]:text-foreground motion-reduce:transition-none";
827
+ var tocLinkVariants = (0, import_class_variance_authority10.cva)(tocLinkBase, {
828
+ variants: {
829
+ variant: {
830
+ // -1px + border pulls the active marker over the list's own start border
831
+ default: "-ms-px border-s-2 border-transparent ps-[calc(--spacing(3)+(var(--depth,2)-2)*--spacing(3))] data-[active]:border-primary",
832
+ indicator: "ps-[calc(--spacing(3)+(var(--depth,2)-2)*--spacing(3))]",
833
+ hover: "ps-2",
834
+ rail: "group/link relative ps-2",
835
+ tree: "ps-1.5",
836
+ collapsible: "ps-2"
837
+ }
838
+ },
839
+ defaultVariants: { variant: "default" }
840
+ });
841
+ var tocIndicatorBase = "pointer-events-none absolute start-0 h-(--height) w-0.5 translate-y-(--top) rounded-full bg-primary transition-[translate,height] duration-200 ease-out motion-reduce:transition-none";
842
+ var tocSkeletonBase = "h-1.5 rounded-full bg-border transition-colors";
843
+
844
+ // src/pagination.ts
845
+ var paginationRootBase = "mx-auto flex w-full justify-center gap-1";
846
+ var paginationTriggerBase = "inline-flex h-9 items-center justify-center gap-2 whitespace-nowrap rounded-md px-3 text-sm font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0";
847
+ var paginationItemBase = "inline-flex h-9 min-w-9 items-center justify-center whitespace-nowrap rounded-md px-3 text-sm font-medium tabular-nums text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[selected]:bg-accent data-[selected]:text-accent-foreground";
848
+ var paginationEllipsisBase = "flex h-8 w-12 items-end justify-center text-muted-foreground pointer-events-none select-none [&_svg]:size-4";
849
+
850
+ // src/navbar.ts
851
+ var import_class_variance_authority11 = require("class-variance-authority");
852
+ var navbarVariants = (0, import_class_variance_authority11.cva)(
853
+ "w-full bg-background/80 backdrop-blur transition-[box-shadow,height,translate] duration-300",
854
+ {
855
+ variants: {
856
+ variant: {
857
+ scroll: "border-b border-border",
858
+ sticky: "sticky top-0 z-50 border-b border-border data-[scrolled=true]:bg-background/95 data-[scrolled=true]:shadow-md",
859
+ shrink: "sticky top-0 z-50 border-b border-border data-[scrolled=true]:bg-background/95 data-[scrolled=true]:shadow-md",
860
+ hide: "sticky top-0 z-50 border-b border-border data-[scrolled=true]:bg-background/95 data-[scrolled=true]:shadow-md data-[hidden=true]:-translate-y-full"
861
+ },
862
+ floating: {
863
+ false: "",
864
+ true: "fixed inset-x-0 top-4 z-50 mx-auto w-[calc(100%-2rem)] max-w-6xl rounded-full border"
865
+ }
866
+ },
867
+ defaultVariants: {
868
+ variant: "sticky",
869
+ floating: false
870
+ }
871
+ }
872
+ );
873
+ var navbarContainerBase = "flex items-center justify-between transition-[height,gap,padding] duration-300";
874
+ var navbarDensityVariants = (0, import_class_variance_authority11.cva)("", {
875
+ variants: {
876
+ density: {
877
+ relaxed: "h-16 gap-4 px-4 md:px-6",
878
+ compact: "h-12 gap-1.5 px-2"
879
+ }
880
+ },
881
+ defaultVariants: {
882
+ density: "relaxed"
883
+ }
884
+ });
885
+ var navbarShrunkBase = "h-12";
886
+ var navbarBrandBase = "flex shrink-0 items-center gap-2";
887
+ var navbarMenuBase = "hidden items-center md:flex";
888
+ var navbarMenuPlacementVariants = (0, import_class_variance_authority11.cva)("", {
889
+ variants: {
890
+ placement: {
891
+ left: "justify-start",
892
+ center: "justify-center",
893
+ right: "justify-end"
894
+ }
895
+ },
896
+ defaultVariants: {
897
+ placement: "center"
898
+ }
899
+ });
900
+ var navbarActionsBase = "ml-auto hidden items-center gap-2 md:flex";
901
+ var navbarTriggerVariants = (0, import_class_variance_authority11.cva)(
902
+ "inline-flex h-9 w-9 items-center justify-center text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
903
+ {
904
+ variants: {
905
+ floating: {
906
+ false: "rounded-md border border-border",
907
+ true: "rounded-full"
908
+ }
909
+ },
910
+ defaultVariants: {
911
+ floating: false
912
+ }
913
+ }
914
+ );
915
+ var navbarMobileBase = "md:hidden";
916
+ var navbarActivationAreaBase = "fixed inset-x-0 top-0 z-40 h-12";
917
+ var navbarMobileContentBase = "flex h-full flex-col bg-background";
918
+ var navbarMobileHeaderBase = "flex items-center justify-between gap-2 px-4 py-3";
919
+ var navbarMobileMenuBase = "flex flex-1 flex-col gap-1 overflow-y-auto px-4 py-2";
920
+ var navbarMobileActionsBase = "flex items-center gap-2 border-t border-border px-4 py-4";
921
+
922
+ // src/themes.ts
923
+ var THEMES = [
924
+ { name: "amber-minimal", label: "Amber Minimal" },
925
+ { name: "amethyst-haze", label: "Amethyst Haze" },
926
+ { name: "anthropic", label: "Anthropic" },
927
+ { name: "anyscale", label: "Anyscale" },
928
+ { name: "bold-tech", label: "Bold Tech" },
929
+ { name: "bubblegum", label: "Bubblegum" },
930
+ { name: "caffeine", label: "Caffeine" },
931
+ { name: "candyland", label: "Candyland" },
932
+ { name: "catppuccin", label: "Catppuccin" },
933
+ { name: "claude", label: "Claude" },
934
+ { name: "claymorphism", label: "Claymorphism" },
935
+ { name: "clean-slate", label: "Clean Slate" },
936
+ { name: "cosmic-night", label: "Cosmic Night" },
937
+ { name: "cyberpunk", label: "Cyberpunk" },
938
+ { name: "darkmatter", label: "Darkmatter" },
939
+ { name: "default", label: "Default" },
940
+ { name: "doom-64", label: "Doom 64" },
941
+ { name: "elegant-luxury", label: "Elegant Luxury" },
942
+ { name: "graphite", label: "Graphite" },
943
+ { name: "green", label: "Green" },
944
+ { name: "kodama-grove", label: "Kodama Grove" },
945
+ { name: "lambda", label: "Lambda" },
946
+ { name: "mdbook", label: "mdBook" },
947
+ { name: "midnight-bloom", label: "Midnight Bloom" },
948
+ { name: "mocha-mousse", label: "Mocha Mousse" },
949
+ { name: "modern-minimal", label: "Modern Minimal" },
950
+ { name: "mono", label: "Mono" },
951
+ { name: "nature", label: "Nature" },
952
+ { name: "neo-brutalism", label: "Neo Brutalism" },
953
+ { name: "northern-lights", label: "Northern Lights" },
954
+ { name: "notebook", label: "Notebook" },
955
+ { name: "ocean-breeze", label: "Ocean Breeze" },
956
+ { name: "openai", label: "Openai" },
957
+ { name: "pastel-dreams", label: "Pastel Dreams" },
958
+ { name: "perpetuity", label: "Perpetuity" },
959
+ { name: "quantum-rose", label: "Quantum Rose" },
960
+ { name: "retro-arcade", label: "Retro Arcade" },
961
+ { name: "rose", label: "Rose" },
962
+ { name: "sage-garden", label: "Sage Garden" },
963
+ { name: "slate", label: "Slate" },
964
+ { name: "soft-pop", label: "Soft Pop" },
965
+ { name: "solar-dusk", label: "Solar Dusk" },
966
+ { name: "starry-night", label: "Starry Night" },
967
+ { name: "sunset-horizon", label: "Sunset Horizon" },
968
+ { name: "supabase", label: "Supabase" },
969
+ { name: "t3-chat", label: "T3 Chat" },
970
+ { name: "tangerine", label: "Tangerine" },
971
+ { name: "twitter", label: "Twitter" },
972
+ { name: "vercel", label: "Vercel" },
973
+ { name: "vintage-paper", label: "Vintage Paper" },
974
+ { name: "violet-bloom", label: "Violet Bloom" },
975
+ { name: "vitepress", label: "Vitepress" },
976
+ { name: "helical-ui", label: "Helical UI" }
977
+ ];
978
+ var THEME_NAMES = THEMES.map((t) => t.name);
979
+
980
+ // src/field.ts
981
+ var fieldRootBase = "flex w-full flex-col gap-2 data-invalid:text-destructive";
982
+ var fieldLabelBase = "flex w-fit select-none items-center gap-1 text-sm font-medium leading-none text-foreground";
983
+ var fieldHelperBase = "text-sm text-muted-foreground";
984
+ var fieldErrorBase = "text-sm text-destructive";
985
+ var fieldRequiredIndicatorBase = "text-destructive";
986
+ var fieldsetRootBase = "flex flex-col gap-6";
987
+ var fieldsetLegendBase = "mb-3 text-base font-medium";
988
+ var fieldsetHelperBase = "text-sm text-muted-foreground";
989
+ var fieldsetErrorBase = "text-sm text-destructive";
990
+
991
+ // src/input.ts
992
+ var import_class_variance_authority12 = require("class-variance-authority");
993
+ var inputVariants = (0, import_class_variance_authority12.cva)(
994
+ "flex w-full min-w-0 rounded-md border border-input bg-transparent px-3 text-sm shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/30 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/24 data-invalid:border-destructive data-invalid:ring-[3px] data-invalid:ring-destructive/24",
995
+ {
996
+ variants: {
997
+ size: {
998
+ sm: "h-8 px-2.5",
999
+ md: "h-9",
1000
+ lg: "h-10"
1001
+ }
1002
+ },
1003
+ defaultVariants: {
1004
+ size: "md"
1005
+ }
1006
+ }
1007
+ );
1008
+
1009
+ // src/textarea.ts
1010
+ var textareaBase = "field-sizing-content flex min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/30 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/24 data-invalid:border-destructive data-invalid:ring-[3px] data-invalid:ring-destructive/24";
1011
+
1012
+ // src/number-input.ts
1013
+ var numberInputRootBase = "flex w-full flex-col items-start gap-2";
1014
+ var numberInputControlBase = "flex w-full items-center justify-between rounded-md border border-input bg-transparent shadow-xs transition-[box-shadow] outline-none focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/30 aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/24 data-invalid:border-destructive data-invalid:ring-[3px] data-invalid:ring-destructive/24";
1015
+ var numberInputInputBase = "h-9 w-full min-w-0 flex-1 border-0 bg-transparent px-3 text-center text-sm tabular-nums shadow-none outline-none ring-0 focus-visible:ring-0 disabled:cursor-not-allowed disabled:opacity-50";
1016
+ var numberInputTriggerBase = "flex size-9 shrink-0 items-center justify-center text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0";
1017
+
1018
+ // src/checkbox.ts
1019
+ var import_class_variance_authority13 = require("class-variance-authority");
1020
+ var checkboxVariants = (0, import_class_variance_authority13.cva)(
1021
+ "relative inline-flex size-4 shrink-0 items-center justify-center rounded-sm border border-input bg-transparent shadow-xs transition-shadow focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/30 focus-visible:ring-offset-1 focus-visible:ring-offset-background data-invalid:border-destructive data-invalid:ring-[3px] data-invalid:ring-destructive/24 disabled:pointer-events-none disabled:opacity-50",
1022
+ {
1023
+ variants: {
1024
+ size: {
1025
+ sm: "size-3.5",
1026
+ md: "size-4",
1027
+ lg: "size-5"
1028
+ }
1029
+ },
1030
+ defaultVariants: {
1031
+ size: "md"
1032
+ }
1033
+ }
1034
+ );
1035
+ var checkboxIndicatorBase = "flex size-full items-center justify-center text-primary-foreground data-[state=unchecked]:hidden [&_svg]:pointer-events-none [&_svg]:size-3 [&_svg]:shrink-0";
1036
+ var checkboxLabelBase = "select-none text-sm font-medium leading-none";
1037
+ var checkboxGroupBase = "flex flex-col gap-2";
1038
+
1039
+ // src/switch.ts
1040
+ var import_class_variance_authority14 = require("class-variance-authority");
1041
+ var switchVariants = (0, import_class_variance_authority14.cva)(
1042
+ "inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border border-transparent bg-input p-0.5 shadow-xs transition-colors outline-none data-[state=checked]:bg-primary data-invalid:border-destructive data-invalid:ring-[3px] data-invalid:ring-destructive/24 focus-visible:ring-[3px] focus-visible:ring-ring/30 disabled:pointer-events-none disabled:opacity-50",
1043
+ {
1044
+ variants: {
1045
+ size: {
1046
+ sm: "h-5 w-9",
1047
+ md: "h-6 w-11",
1048
+ lg: "h-7 w-12"
1049
+ }
1050
+ },
1051
+ defaultVariants: {
1052
+ size: "md"
1053
+ }
1054
+ }
1055
+ );
1056
+ var switchControlBase = "flex size-full items-center";
1057
+ var switchThumbBase = "pointer-events-none block aspect-square h-full w-auto rounded-full bg-background shadow-sm transition-transform data-[state=checked]:translate-x-[calc(100%-1px)] data-[state=unchecked]:translate-x-0 dark:data-[state=unchecked]:bg-foreground";
1058
+ var switchLabelBase = "select-none text-sm font-medium leading-none";
1059
+
1060
+ // src/select.ts
1061
+ var import_class_variance_authority15 = require("class-variance-authority");
1062
+ var selectTriggerBase = "flex w-fit cursor-default items-center gap-2 whitespace-nowrap data-[placeholder-shown]:text-muted-foreground data-[state=open]:border-ring data-[state=open]:ring-[3px] data-[state=open]:ring-ring/30 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-muted-foreground";
1063
+ var selectValueBase = "flex min-w-0 items-center gap-2 truncate";
1064
+ var selectIndicatorBase = "flex items-center justify-center text-muted-foreground";
1065
+ var selectClearTriggerBase = "flex items-center justify-center text-muted-foreground opacity-60 transition-opacity hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none [&_svg]:pointer-events-none [&_svg]:size-3.5 [&_svg]:shrink-0";
1066
+ var selectPositionerBase = "z-50 [--z-index:50]!";
1067
+ var selectContentBase = "relative z-50 max-h-96 min-w-(--reference-width) overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md outline-none";
1068
+ var selectItemGroupLabelBase = "px-2 py-1.5 text-xs font-semibold text-muted-foreground";
1069
+ var selectItemBase = "relative flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 pe-8 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-muted-foreground";
1070
+ var selectItemTextBase = "flex w-full flex-1 items-center gap-2";
1071
+ var selectItemIndicatorBase = "absolute inset-y-0 end-2 flex items-center justify-center text-foreground";
1072
+ var nativeSelectVariants = (0, import_class_variance_authority15.cva)(
1073
+ "appearance-none w-full min-w-0 rounded-md border border-input bg-transparent pe-8 ps-2.5 text-sm shadow-xs transition-colors outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/30 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/24",
1074
+ {
1075
+ variants: {
1076
+ size: {
1077
+ sm: "h-8",
1078
+ md: "h-9",
1079
+ lg: "h-10"
1080
+ }
1081
+ },
1082
+ defaultVariants: {
1083
+ size: "md"
1084
+ }
1085
+ }
1086
+ );
1087
+ var nativeSelectWrapperBase = "relative w-fit [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-muted-foreground";
1088
+ var nativeSelectIconBase = "pointer-events-none absolute inset-y-0 end-2.5 flex items-center justify-center text-muted-foreground";
1089
+
1090
+ // src/combobox.ts
1091
+ var import_class_variance_authority16 = require("class-variance-authority");
1092
+ var comboboxControlBase = "relative flex w-full flex-wrap items-center gap-1";
1093
+ var comboboxInputBase = "pe-8";
1094
+ var comboboxTriggerBase = "absolute inset-y-0 end-1 flex w-8 items-center justify-center text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0";
1095
+ var comboboxClearTriggerBase = "absolute inset-y-0 end-9 flex items-center justify-center text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none [&_svg]:pointer-events-none [&_svg]:size-3.5 [&_svg]:shrink-0";
1096
+ var comboboxPositionerBase = "z-50 [--z-index:50]!";
1097
+ var comboboxContentBase = "relative z-50 max-h-96 min-w-48 overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md outline-none";
1098
+ var comboboxItemGroupLabelBase = "px-2 py-1.5 text-xs font-semibold text-muted-foreground";
1099
+ var comboboxItemVariants = (0, import_class_variance_authority16.cva)(
1100
+ "relative flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-muted-foreground",
1101
+ {
1102
+ variants: {
1103
+ showIndicator: {
1104
+ true: "pe-8",
1105
+ false: "pe-2"
1106
+ }
1107
+ },
1108
+ defaultVariants: {
1109
+ showIndicator: true
1110
+ }
1111
+ }
1112
+ );
1113
+ var comboboxItemIndicatorBase = "absolute inset-y-0 end-2 flex items-center justify-center text-foreground";
1114
+ var comboboxListBase = "flex flex-col";
1115
+ var comboboxEmptyBase = "px-2 py-1.5 text-center text-sm text-muted-foreground";
1116
+
1117
+ // src/tags-input.ts
1118
+ var tagsInputRootBase = "flex w-full flex-col gap-2";
1119
+ var tagsInputControlBase = "flex w-full flex-wrap items-center gap-1.5 rounded-md border border-input bg-transparent p-1.5 shadow-xs transition-[box-shadow] outline-none focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/30 data-invalid:border-destructive data-invalid:ring-[3px] data-invalid:ring-destructive/24 data-disabled:pointer-events-none data-disabled:opacity-50";
1120
+ var tagsInputInputBase = "min-w-12 flex-1 border-0 bg-transparent px-1 text-sm outline-none ring-0 placeholder:text-muted-foreground focus-visible:ring-0";
1121
+ var tagsInputItemBase = "inline-flex h-6 max-w-full shrink-0 items-center gap-1 rounded-md border bg-secondary px-1.5 text-xs text-secondary-foreground outline-none data-[highlighted]:border-primary/30 data-[highlighted]:bg-primary/10";
1122
+ var tagsInputItemTextBase = "truncate";
1123
+ var tagsInputItemInputBase = "w-16 border-0 bg-transparent text-xs outline-none";
1124
+ var tagsInputItemDeleteTriggerBase = "flex size-4 shrink-0 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none [&_svg]:pointer-events-none [&_svg]:size-3 [&_svg]:shrink-0";
1125
+ var tagsInputClearTriggerBase = "ms-auto flex shrink-0 items-center justify-center self-center text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none [&_svg]:pointer-events-none [&_svg]:size-3.5 [&_svg]:shrink-0";
1126
+
1127
+ // src/mermaid.ts
1128
+ var mermaidRootBase = "not-prose my-4 overflow-x-auto";
1129
+ var mermaidSourceBase = "w-full overflow-x-auto bg-muted p-4 font-mono text-sm whitespace-pre";
1130
+ var mermaidSvgBase = "flex w-full items-center justify-center [&>svg]:max-w-full";
1131
+ var mermaidLoadingBase = "flex min-h-40 w-full items-center justify-center gap-3";
1132
+ var mermaidThemeVariableTokens = {
1133
+ primaryColor: "--card",
1134
+ primaryTextColor: "--foreground",
1135
+ primaryBorderColor: "--border",
1136
+ lineColor: "--muted-foreground",
1137
+ secondaryColor: "--muted",
1138
+ tertiaryColor: "--accent",
1139
+ background: "--background",
1140
+ mainBkg: "--card",
1141
+ nodeBorder: "--border"
1142
+ };
1143
+ var scratchCtx;
1144
+ function normalizeMermaidColor(value) {
1145
+ scratchCtx ??= document.createElement("canvas").getContext("2d", { willReadFrequently: true });
1146
+ if (!scratchCtx) return value;
1147
+ scratchCtx.fillStyle = "rgb(1 2 3)";
1148
+ scratchCtx.fillStyle = value;
1149
+ scratchCtx.clearRect(0, 0, 1, 1);
1150
+ scratchCtx.fillRect(0, 0, 1, 1);
1151
+ const [r, g, b, a] = scratchCtx.getImageData(0, 0, 1, 1).data;
1152
+ if (r === 1 && g === 2 && b === 3 && a === 255) return value;
1153
+ if (a === 255) return `#${[r, g, b].map((c) => c.toString(16).padStart(2, "0")).join("")}`;
1154
+ return `rgba(${r}, ${g}, ${b}, ${Math.round(a / 255 * 1e3) / 1e3})`;
1155
+ }
1156
+ function resolveMermaidThemeVariables() {
1157
+ const styles = getComputedStyle(document.documentElement);
1158
+ const themeVariables = {};
1159
+ for (const [key, token] of Object.entries(mermaidThemeVariableTokens)) {
1160
+ const value = styles.getPropertyValue(token).trim();
1161
+ if (value) themeVariables[key] = normalizeMermaidColor(value);
1162
+ }
1163
+ return themeVariables;
1164
+ }
1165
+ var mermaidSeq = 0;
1166
+ function mermaidSvgAspectRatio(svg) {
1167
+ const match = /viewBox="\s*[-\d.]+\s+[-\d.]+\s+([-\d.]+)\s+([-\d.]+)"/.exec(svg);
1168
+ if (!match) return void 0;
1169
+ const width = Number(match[1]);
1170
+ const height = Number(match[2]);
1171
+ if (!Number.isFinite(width) || !Number.isFinite(height) || width <= 0 || height <= 0) return void 0;
1172
+ return `${width} / ${height}`;
1173
+ }
1174
+ async function renderMermaidSource(code) {
1175
+ const mermaid = (await import("mermaid")).default;
1176
+ const dark = document.documentElement.classList.contains("dark");
1177
+ mermaid.initialize({
1178
+ startOnLoad: false,
1179
+ securityLevel: "strict",
1180
+ suppressErrorRendering: true,
1181
+ theme: dark ? "dark" : "default",
1182
+ themeVariables: resolveMermaidThemeVariables()
1183
+ });
1184
+ const { svg } = await mermaid.render(`helical-ui-mmd-${Date.now()}-${mermaidSeq++}`, code);
1185
+ return svg;
1186
+ }
1187
+
1188
+ // src/clipboard.ts
1189
+ var clipboardTriggerBase = "inline-flex h-7 w-7 shrink-0 items-center justify-center gap-1.5 rounded-md text-xs text-muted-foreground transition-colors hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&_svg]:size-3.5 [&_svg]:shrink-0";
1190
+
1191
+ // src/radio-group.ts
1192
+ var radioGroupRootBase = "flex flex-col gap-2";
1193
+ var radioGroupItemControlBase = "relative inline-flex size-4 shrink-0 items-center justify-center rounded-full border border-input bg-transparent shadow-xs transition-shadow focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/30 focus-visible:ring-offset-1 focus-visible:ring-offset-background data-invalid:border-destructive data-invalid:ring-[3px] data-invalid:ring-destructive/24 data-[state=checked]:border-primary data-[state=checked]:text-primary disabled:pointer-events-none disabled:opacity-50";
1194
+ var radioGroupItemTextBase = "select-none text-sm font-medium leading-none";
1195
+
1196
+ // src/notice.ts
1197
+ var import_class_variance_authority17 = require("class-variance-authority");
1198
+ var noticeVariants = (0, import_class_variance_authority17.cva)(
1199
+ "not-prose relative my-4 grid w-full items-center gap-y-0.5 rounded-lg border px-3 py-2.5 text-sm grid-cols-[0_1fr] has-[>svg]:grid-cols-[calc(var(--spacing)*3)_1fr] has-[>svg]:gap-x-2.5 [&>svg]:size-4",
1200
+ {
1201
+ variants: {
1202
+ variant: {
1203
+ none: "bg-card text-card-foreground",
1204
+ info: "border-info/30 bg-info/5 [&>svg]:text-info",
1205
+ success: "border-success/30 bg-success/5 [&>svg]:text-success",
1206
+ warning: "border-warn/30 bg-warn/5 [&>svg]:text-warn",
1207
+ error: "border-danger/30 bg-danger/5 [&>svg]:text-danger"
1208
+ }
1209
+ },
1210
+ defaultVariants: {
1211
+ variant: "info"
1212
+ }
1213
+ }
1214
+ );
1215
+ var noticeTitleBase = "col-start-2 min-h-4 font-semibold tracking-tight";
1216
+ var noticeDescriptionBase = "col-start-2 text-sm text-foreground [&_p]:leading-relaxed";
1217
+
1218
+ // src/figure.ts
1219
+ var figureRootBase = "not-prose my-4 flex flex-col items-center";
1220
+ var figureImageBase = "rounded-lg border border-border";
1221
+ var figureCaptionBase = "mt-2 text-center text-sm text-muted-foreground";
1222
+
1223
+ // src/reveal.ts
1224
+ var revealRootBase = "not-prose my-4 overflow-hidden rounded-lg border border-border bg-muted/40";
1225
+ var revealTriggerBase = "flex w-full cursor-pointer items-center gap-2 px-3 py-2.5 text-sm font-semibold";
1226
+ var revealChevronBase = "size-4 shrink-0 text-muted-foreground transition-transform duration-200 data-[state=open]:rotate-90";
1227
+ var revealContentBase = "border-t border-border px-3 py-2.5 text-sm text-foreground";
1228
+
1229
+ // src/prevnext.ts
1230
+ var prevNextRootBase = "not-prose mt-8 flex flex-col gap-3 border-t border-border pt-6 sm:flex-row sm:justify-between";
1231
+ var prevNextLinkBase = "group flex min-w-0 flex-1 flex-col rounded-lg border border-border px-4 py-3 no-underline transition-colors hover:border-primary";
1232
+ var prevNextLinkNextBase = "items-end text-right";
1233
+ var prevNextDirectionBase = "text-xs font-medium text-muted-foreground";
1234
+ var prevNextTitleBase = "truncate text-sm font-medium text-foreground transition-colors group-hover:text-primary";
1235
+ var prevNextSpacerBase = "flex-1";
1236
+
1237
+ // src/latex.ts
1238
+ var import_katex = __toESM(require("katex"), 1);
1239
+ var latexRootBase = "not-prose";
1240
+ var latexDisplayBase = "my-4 block w-full overflow-x-auto py-1";
1241
+ var latexInlineBase = "inline-block align-middle";
1242
+ var latexErrorBase = "font-mono text-sm text-destructive";
1243
+ function toLaTeX(latex, opts) {
1244
+ return import_katex.default.renderToString(latex, {
1245
+ displayMode: opts?.displayMode ?? false,
1246
+ throwOnError: false,
1247
+ strict: false
1248
+ });
1249
+ }
1250
+
1251
+ // src/code-block.ts
1252
+ var codeBlockRootBase = "not-prose my-4 overflow-hidden rounded-lg border";
1253
+ var codeBlockHeaderBase = "flex h-10 items-center justify-between gap-2 border-b bg-muted/50 px-4";
1254
+ var codeBlockHeaderInfoBase = "flex min-w-0 items-center gap-2 text-muted-foreground";
1255
+ var codeBlockTitleBase = "min-w-0 truncate font-mono text-xs";
1256
+ var codeBlockBodyBase = "hx-cb relative overflow-x-auto bg-background";
1257
+ var codeBlockBodyScrollableBase = "overflow-y-auto";
1258
+ var codeBlockContentBase = "text-sm [&>pre]:p-4 [&_.line]:leading-[1.7]";
1259
+ var codeBlockLineNumbersBase = "cbln";
1260
+ var codeBlockHighlightBase = "cbhl";
1261
+ var codeBlockLoadingBase = "flex h-16 items-center justify-center";
1262
+ var codeBlockSpinnerBase = "h-4 w-4 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent";
1263
+ var codeBlockCopyFloatBase = "absolute right-2 top-2";
1264
+ var CODE_BLOCK_STYLES = `
1265
+ .hx-cb pre.shiki{margin:0!important;border:0!important;border-radius:0!important;background:transparent!important}
1266
+ .hx-cb pre.shiki code{border:0!important;border-radius:0!important;background:transparent!important;padding:0!important}
1267
+ :root.dark .hx-cb .shiki,
1268
+ :root.dark .hx-cb .shiki span{color:var(--shiki-dark)!important;font-style:var(--shiki-dark-font-style)!important;font-weight:var(--shiki-dark-font-weight)!important;text-decoration:var(--shiki-dark-text-decoration)!important}
1269
+ .hx-cb .cbln code{counter-reset:line;counter-increment:line 0}
1270
+ .hx-cb .cbln .line::before{content:counter(line);counter-increment:line;display:inline-block;min-width:1.5rem;padding-right:.75rem;margin-right:1rem;text-align:right;font-size:.75rem;line-height:1.7;user-select:none;color:color-mix(in srgb,var(--muted-foreground,#888) 55%,transparent)}
1271
+ .hx-cb .cbhl .line-highlighted{display:block;background-color:oklch(0.828 0.189 84.429/.12);border-left:2px solid oklch(0.769 0.188 70.08);margin:0 -1rem;padding:0 1rem}
1272
+ `;
1273
+ function injectCodeBlockStyles() {
1274
+ if (typeof document === "undefined") return;
1275
+ if (document.getElementById("hx-code-block")) return;
1276
+ const el = document.createElement("style");
1277
+ el.id = "hx-code-block";
1278
+ el.textContent = CODE_BLOCK_STYLES;
1279
+ document.head.appendChild(el);
1280
+ }
1281
+ function escapeHtml(s) {
1282
+ return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
1283
+ }
1284
+ function plaintextFallback(code) {
1285
+ const lines = code.split("\n").map((l) => `<span class="line">${escapeHtml(l)}</span>`).join("\n");
1286
+ return `<pre class="shiki" tabindex="-1"><code>${lines}</code></pre>`;
1287
+ }
1288
+ async function renderCodeToHtml(code, language, highlightLines) {
1289
+ injectCodeBlockStyles();
1290
+ try {
1291
+ const { codeToHtml } = await import("shiki/bundle/full");
1292
+ return await codeToHtml(code, {
1293
+ lang: language,
1294
+ themes: { light: "github-light", dark: "github-dark" },
1295
+ tabindex: false,
1296
+ transformers: [
1297
+ {
1298
+ pre(node) {
1299
+ if (node.properties?.["style"]) {
1300
+ node.properties["style"] = node.properties["style"].replace(/background-color:\s*[^;]+;?\s*/gi, "").replace(/--shiki-dark-bg:\s*[^;]+;?\s*/gi, "");
1301
+ }
1302
+ },
1303
+ line(node, line) {
1304
+ if (highlightLines?.includes(line)) {
1305
+ this.addClassToHast(node, "line-highlighted");
1306
+ }
1307
+ }
1308
+ }
1309
+ ]
1310
+ });
1311
+ } catch {
1312
+ return plaintextFallback(code);
1313
+ }
1314
+ }
1315
+
1316
+ // src/manim.ts
1317
+ var manimRootBase = "not-prose my-4";
1318
+ var manimContainerBase = "relative w-full overflow-hidden rounded-lg border border-border [&_canvas]:!h-auto [&_canvas]:!max-w-full";
1319
+ var manimPlaceholderBase = "flex w-full items-center justify-center bg-muted/40";
1320
+ var manimPlaceholderLabelBase = "text-sm text-muted-foreground";
1321
+ var manimErrorBase = "flex items-center justify-center border-destructive/50 bg-destructive/5 p-6 text-sm text-destructive";
1322
+ var manimCaptionBase = "mt-2 text-center text-sm text-muted-foreground";
1323
+
1324
+ // src/youtube.ts
1325
+ var youtubeRootBase = "not-prose my-4";
1326
+ var youtubeTitleBase = "mb-2 text-lg font-semibold text-foreground";
1327
+ var youtubeFacadeBase = "group relative aspect-video w-full cursor-pointer overflow-hidden rounded-md border border-border bg-muted/40";
1328
+ var youtubePlayButtonBase = "absolute inset-0 flex items-center justify-center";
1329
+ var youtubePlayButtonInnerBase = "flex items-center justify-center rounded-xl bg-red-600 px-4 py-2 text-white drop-shadow-lg transition-transform group-hover:scale-105";
1330
+ var youtubeDescriptionBase = "mt-2 text-sm text-muted-foreground";
1331
+ var youtubeChaptersBase = "group mt-3 rounded-lg border border-border bg-muted/40";
1332
+ var youtubeChaptersSummaryBase = "flex cursor-pointer list-none items-center gap-2 px-3 py-2.5 text-sm font-medium [&::-webkit-details-marker]:hidden";
1333
+ var youtubeChaptersChevronBase = "size-4 shrink-0 text-muted-foreground transition-transform duration-200 group-open:rotate-90";
1334
+ var youtubeChaptersListBase = "border-t border-border px-2 py-2";
1335
+ var youtubeChapterButtonBase = "inline-flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";
1336
+ var youtubeChapterTimeBase = "font-mono text-xs text-primary";
1337
+ var youtubeChapterLabelBase = "text-foreground";
1338
+ function extractYouTubeId(raw) {
1339
+ try {
1340
+ const url = new URL(raw);
1341
+ const v = url.searchParams.get("v");
1342
+ if (v) return v;
1343
+ if (url.hostname === "youtu.be") return url.pathname.slice(1);
1344
+ } catch {
1345
+ }
1346
+ return raw;
1347
+ }
1348
+ function formatTime(seconds) {
1349
+ const h = Math.floor(seconds / 3600);
1350
+ const m = Math.floor(seconds % 3600 / 60);
1351
+ const s = Math.floor(seconds % 60);
1352
+ const mm = String(m).padStart(2, "0");
1353
+ const ss = String(s).padStart(2, "0");
1354
+ return h > 0 ? `${h}:${mm}:${ss}` : `${mm}:${ss}`;
1355
+ }
1356
+ var TIMESTAMP_RE = /^\s*\[?\(?(?:(\d+):)?(\d{1,2}):(\d{2})\)?\]?\s+(\S.*)$/;
1357
+ function parseYouTubeChapters(description) {
1358
+ return description.split("\n").map((line) => {
1359
+ const m = TIMESTAMP_RE.exec(line);
1360
+ if (!m) return null;
1361
+ const hours = m[1] ? Number(m[1]) : 0;
1362
+ const t = hours * 3600 + Number(m[2]) * 60 + Number(m[3]);
1363
+ return { t, label: m[4] };
1364
+ }).filter((c) => c !== null);
1365
+ }
1366
+ async function fetchYouTubeMetadata(url) {
1367
+ const videoId = extractYouTubeId(url);
1368
+ const res = await fetch(
1369
+ `https://noembed.com/embed?url=${encodeURIComponent(`https://www.youtube.com/watch?v=${videoId}`)}`
1370
+ );
1371
+ if (!res.ok) return {};
1372
+ const data = await res.json();
1373
+ return { title: data.title, description: data.description };
1374
+ }
1375
+
1376
+ // src/chart.ts
1377
+ var import_charts = require("@tanstack/charts");
1378
+ var import_polar = require("@tanstack/charts/polar");
1379
+ var import_linear = require("@tanstack/charts/scales/linear");
1380
+ var import_ordinal = require("@tanstack/charts/scales/ordinal");
1381
+ var import_point = require("@tanstack/charts/scales/point");
1382
+ var import_tooltip = require("@tanstack/charts/tooltip");
1383
+ var chartRootBase = "not-prose my-4";
1384
+ var chartPlaceholderBase = "flex items-center justify-center rounded-md border border-border bg-muted/40";
1385
+ var chartPlaceholderLabelBase = "text-sm text-muted-foreground";
1386
+ function defaultChartColor(index) {
1387
+ return `var(--chart-${index % 5 + 1})`;
1388
+ }
1389
+ var COLOR_TOKENS = ["var(--chart-1)", "var(--chart-2)", "var(--chart-3)", "var(--chart-4)", "var(--chart-5)"];
1390
+ function buildChartDefinition(props) {
1391
+ const {
1392
+ type,
1393
+ data,
1394
+ series,
1395
+ xKey = "name",
1396
+ nameKey = "name",
1397
+ showLegend = true,
1398
+ showGrid = true,
1399
+ showAxis = true
1400
+ } = props;
1401
+ const colors = series.map((s, i) => s.color ?? COLOR_TOKENS[i % COLOR_TOKENS.length]);
1402
+ if (type === "pie") {
1403
+ const valueKey = series[0]?.key ?? "value";
1404
+ const slices = (0, import_polar.pie)(data, { value: valueKey });
1405
+ const pieColors = data.map((_, i) => series[0]?.color ?? COLOR_TOKENS[i % COLOR_TOKENS.length]);
1406
+ const spec2 = {
1407
+ marks: [
1408
+ (0, import_polar.polar)({
1409
+ scales: { angle: null, radius: null },
1410
+ radiusRatio: 0.82,
1411
+ marks: [(0, import_polar.radialArc)(slices, { color: nameKey, key: nameKey, cornerRadius: 3 })]
1412
+ })
1413
+ ],
1414
+ scales: { x: null, y: null },
1415
+ color: {
1416
+ domain: data.map((d) => String(d[nameKey])),
1417
+ range: pieColors,
1418
+ legend: showLegend ? (0, import_charts.colorLegend)({}) : void 0
1419
+ },
1420
+ tooltip: import_tooltip.tooltip
1421
+ };
1422
+ return (0, import_charts.defineChart)(spec2);
1423
+ }
1424
+ const rows = data.flatMap(
1425
+ (row) => series.map((s) => ({
1426
+ ...row,
1427
+ _series: s.label ?? s.key,
1428
+ _value: Number(row[s.key])
1429
+ }))
1430
+ );
1431
+ const markOpts = { x: xKey, y: "_value", z: "_series" };
1432
+ const mark = type === "bar" ? (0, import_charts.barY)(rows, { ...markOpts, fillOpacity: 0.85 }) : type === "area" ? (0, import_charts.areaY)(rows, { ...markOpts, fillOpacity: 0.15 }) : (0, import_charts.lineY)(rows, { ...markOpts, strokeWidth: 2 });
1433
+ const spec = {
1434
+ marks: [mark],
1435
+ scales: {
1436
+ x: { scale: () => (0, import_point.scalePoint)().padding(0.4), axis: showAxis ? {} : void 0 },
1437
+ y: {
1438
+ scale: import_linear.scaleLinear,
1439
+ nice: true,
1440
+ grid: showGrid,
1441
+ axis: showAxis ? { ticks: { count: 5 } } : void 0
1442
+ }
1443
+ },
1444
+ color: {
1445
+ scale: () => (0, import_ordinal.scaleOrdinal)().range(colors),
1446
+ domain: series.map((s) => s.label ?? s.key),
1447
+ legend: showLegend ? (0, import_charts.colorLegend)({}) : void 0
1448
+ },
1449
+ tooltip: import_tooltip.tooltip
1450
+ };
1451
+ return (0, import_charts.defineChart)(spec);
1452
+ }
1453
+ function renderChartSvgString(props, opts = {}) {
1454
+ const { width = 720, height = props.height ?? 400, ariaLabel = "Chart" } = opts;
1455
+ const definition = buildChartDefinition(props);
1456
+ const runtime = (0, import_charts.createChartRuntime)();
1457
+ try {
1458
+ const scene = runtime.render(definition, { width, height });
1459
+ return (0, import_charts.renderChartSvg)(scene, { ariaLabel, idPrefix: "hx-chart" });
1460
+ } finally {
1461
+ runtime.destroy();
1462
+ }
1463
+ }
1464
+
1465
+ // src/question.ts
1466
+ var questionCardBase = "not-prose my-4 rounded-lg border border-border bg-card p-4";
1467
+ var questionPromptBase = "mb-3 text-sm font-medium text-foreground";
1468
+ var questionGroupBase = "grid gap-2";
1469
+ var questionOptionBase = "rounded-md px-3 py-2 transition-colors hover:bg-muted/60";
1470
+ var questionOptionCorrectBase = "bg-success/10";
1471
+ var questionOptionIncorrectBase = "bg-destructive/10";
1472
+ var questionCheckButtonBase = "mt-3 rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50";
1473
+ var questionInputBase = "h-9 w-32 rounded-md border border-input bg-background px-3 text-sm text-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50";
1474
+ var questionUnitBase = "text-sm text-muted-foreground";
1475
+ var feedbackCorrectBase = "text-success";
1476
+ var feedbackIncorrectBase = "text-destructive";
1477
+ var feedbackExplanationBase = "mt-1.5 text-sm text-muted-foreground";
1478
+ var quizRootBase = "not-prose my-6 rounded-lg border border-border bg-card/50 p-4";
1479
+ var quizHeaderBase = "mb-4 flex items-center justify-between gap-3";
1480
+ var quizTitleBase = "text-base font-semibold text-foreground";
1481
+ var quizScoreBase = "inline-flex items-center rounded-full bg-muted px-2.5 py-0.5 text-xs font-medium text-muted-foreground";
1482
+ var quizResultBase = "mt-4 rounded-lg border border-border bg-muted/40 p-4";
1483
+ var quizResultTitleBase = "text-lg font-semibold text-foreground";
1484
+ var quizResultTextBase = "mt-1 text-sm text-muted-foreground";
1485
+ var quizSubmitButtonBase = "rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50";
1486
+ var quizResetButtonBase = "inline-flex items-center gap-1.5 rounded-md border border-border bg-background px-3 py-1.5 text-sm font-medium text-foreground transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";
1487
+
1488
+ // src/prose.ts
1489
+ var import_class_variance_authority18 = require("class-variance-authority");
1490
+ var proseVariants = (0, import_class_variance_authority18.cva)(
1491
+ [
1492
+ "text-foreground",
1493
+ "max-w-none",
1494
+ // Top spacing scales WITH the heading — a bigger heading gets more space above it — and the
1495
+ // first child never carries a top margin (otherwise a leading heading opens a large gap).
1496
+ // Previously h1 had mt-0 while h2 had mt-8, so a smaller heading had more top padding than a
1497
+ // larger one.
1498
+ "[&>*:first-child]:mt-0",
1499
+ "[&_h1]:font-bold [&_h1]:tracking-tight [&_h1]:mt-10 [&_h1]:mb-4",
1500
+ "[&_h2]:font-semibold [&_h2]:tracking-tight [&_h2]:mt-8 [&_h2]:mb-3",
1501
+ "[&_h3]:font-semibold [&_h3]:mt-6 [&_h3]:mb-2",
1502
+ "[&_h4]:font-semibold [&_h4]:mt-4 [&_h4]:mb-2",
1503
+ "[&_h5]:font-semibold [&_h5]:mt-4 [&_h5]:mb-1",
1504
+ "[&_h6]:font-semibold [&_h6]:mt-4 [&_h6]:mb-1 [&_h6]:text-muted-foreground",
1505
+ "[&_p]:my-4 [&_p]:leading-7",
1506
+ "[&_a]:text-primary [&_a]:underline [&_a]:underline-offset-2 hover:[&_a]:opacity-80",
1507
+ "[&_strong]:font-semibold",
1508
+ "[&_ul]:my-4 [&_ul]:list-disc [&_ul]:pl-6",
1509
+ "[&_ol]:my-4 [&_ol]:list-decimal [&_ol]:pl-6",
1510
+ "[&_li]:my-1",
1511
+ "[&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-4 [&_blockquote]:italic [&_blockquote]:text-muted-foreground",
1512
+ "[&_hr]:my-8 [&_hr]:border-border",
1513
+ "[&_code]:rounded [&_code]:bg-muted [&_code]:px-1.5 [&_code]:py-0.5 [&_code]:text-[0.875em]",
1514
+ "[&_pre]:rounded-lg [&_pre]:bg-muted [&_pre]:p-4 [&_pre]:overflow-x-auto",
1515
+ "[&_pre_code]:bg-transparent [&_pre_code]:p-0",
1516
+ "[&_img]:rounded-lg [&_img]:my-6",
1517
+ "[&_figure]:my-6",
1518
+ "[&_figcaption]:mt-2 [&_figcaption]:text-center [&_figcaption]:text-sm [&_figcaption]:italic [&_figcaption]:text-muted-foreground"
1519
+ ],
1520
+ {
1521
+ variants: {
1522
+ size: {
1523
+ sm: "text-sm [&_h1]:text-2xl [&_h2]:text-xl [&_h3]:text-lg [&_h4]:text-base [&_h5]:text-sm",
1524
+ base: "text-base [&_h1]:text-4xl [&_h2]:text-2xl [&_h3]:text-xl [&_h4]:text-lg [&_h5]:text-base",
1525
+ lg: "text-lg [&_h1]:text-5xl [&_h2]:text-3xl [&_h3]:text-2xl [&_h4]:text-xl [&_h5]:text-lg"
1526
+ }
1527
+ },
1528
+ defaultVariants: { size: "base" }
1529
+ }
1530
+ );
1531
+
1532
+ // src/toggle-group.ts
1533
+ var import_class_variance_authority19 = require("class-variance-authority");
1534
+ var toggleGroupRootVariants = (0, import_class_variance_authority19.cva)("inline-flex items-center", {
1535
+ variants: {
1536
+ orientation: { horizontal: "flex-row", vertical: "flex-col" },
1537
+ // `gap` belongs to the variants, not the base. With a `gap-1` base plus a `gap-0` variant
1538
+ // BOTH utilities land on the element and the winner is decided by Tailwind's emission order,
1539
+ // not by the variant — `.gap-1` is emitted after `.gap-0`, which silently defeated `attached`
1540
+ // and left a 1-unit gap between buttons.
1541
+ attached: {
1542
+ true: "gap-0 [&>*]:rounded-none [&>*]:shadow-none [&>*[data-state=on]]:z-10 [&>*[data-state=on]]:border-primary",
1543
+ false: "gap-1"
1544
+ }
1545
+ },
1546
+ // `attached` radii/overlap must follow the layout axis: rounded-s/e and -ms are inline-axis,
1547
+ // which is wrong for a vertical group. Keep them in orientation-scoped compound variants.
1548
+ compoundVariants: [
1549
+ {
1550
+ orientation: "horizontal",
1551
+ attached: true,
1552
+ class: "[&>*:first-child]:rounded-s-md [&>*:last-child]:rounded-e-md [&>*:not(:first-child)]:-ms-px"
1553
+ },
1554
+ {
1555
+ orientation: "vertical",
1556
+ attached: true,
1557
+ class: "[&>*:first-child]:rounded-t-md [&>*:last-child]:rounded-b-md [&>*:not(:first-child)]:-mt-px"
1558
+ }
1559
+ ],
1560
+ defaultVariants: { orientation: "horizontal", attached: false }
1561
+ });
1562
+
1563
+ // src/listbox.ts
1564
+ function defaultListboxFilter(item, query) {
1565
+ if (!query) return true;
1566
+ return item.label.toLowerCase().includes(query.toLowerCase());
1567
+ }
1568
+ var listboxRootBase = "flex flex-col overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-sm";
1569
+ var listboxContentBase = "max-h-72 overflow-y-auto p-1 outline-none";
1570
+ var listboxItemBase = "relative flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 pe-8 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[state=checked]:font-medium data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0";
1571
+ var listboxItemTextBase = "flex w-full flex-1 items-center gap-2";
1572
+ var listboxItemIndicatorBase = "absolute inset-y-0 end-2 flex items-center justify-center text-foreground";
1573
+ var listboxInputBase = "w-full border-b border-input bg-transparent px-2.5 py-1.5 text-sm outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/30";
1574
+ var listboxEmptyBase = "px-2 py-6 text-center text-sm text-muted-foreground";
1575
+ var listboxLabelBase = "px-2 py-1.5 text-xs font-semibold text-muted-foreground";
1576
+
1577
+ // src/editor/build-extensions.ts
1578
+ var import_starter_kit = __toESM(require("@tiptap/starter-kit"), 1);
1579
+ var import_extension_placeholder = __toESM(require("@tiptap/extension-placeholder"), 1);
1580
+ var import_extension_highlight = __toESM(require("@tiptap/extension-highlight"), 1);
1581
+ var import_extension_link = __toESM(require("@tiptap/extension-link"), 1);
1582
+ var import_extension_typography = __toESM(require("@tiptap/extension-typography"), 1);
1583
+ var import_extension_underline = __toESM(require("@tiptap/extension-underline"), 1);
1584
+ var import_extension_text_style = require("@tiptap/extension-text-style");
1585
+ var import_extension_color = require("@tiptap/extension-color");
1586
+ var import_extension_text_align = __toESM(require("@tiptap/extension-text-align"), 1);
1587
+ var import_extension_task_list = __toESM(require("@tiptap/extension-task-list"), 1);
1588
+ var import_extension_task_item = __toESM(require("@tiptap/extension-task-item"), 1);
1589
+ var import_extension_character_count = __toESM(require("@tiptap/extension-character-count"), 1);
1590
+ var import_lowlight = require("lowlight");
1591
+
1592
+ // src/editor/extensions/title-heading.ts
1593
+ var import_core = require("@tiptap/core");
1594
+ var import_state = require("@tiptap/pm/state");
1595
+ var TitleHeading = import_core.Extension.create({
1596
+ name: "titleHeading",
1597
+ addProseMirrorPlugins() {
1598
+ return [
1599
+ new import_state.Plugin({
1600
+ key: new import_state.PluginKey("titleHeading"),
1601
+ appendTransaction: (transactions, oldState, newState) => {
1602
+ const tr = newState.tr;
1603
+ let modified = false;
1604
+ const firstNode = newState.doc.firstChild;
1605
+ if (!firstNode) {
1606
+ tr.insert(0, newState.schema.nodes.heading.create({ level: 1 }));
1607
+ modified = true;
1608
+ } else if (firstNode.type.name !== "heading" || firstNode.attrs.level !== 1) {
1609
+ const h1 = newState.schema.nodes.heading.create({ level: 1 }, firstNode.content);
1610
+ tr.replaceWith(0, firstNode.nodeSize, h1);
1611
+ modified = true;
1612
+ }
1613
+ return modified ? tr : null;
1614
+ }
1615
+ })
1616
+ ];
1617
+ }
1618
+ });
1619
+
1620
+ // src/editor/extensions/exit-heading.ts
1621
+ var import_core2 = require("@tiptap/core");
1622
+ var ExitHeading = import_core2.Extension.create({
1623
+ name: "exitHeading",
1624
+ addKeyboardShortcuts() {
1625
+ return {
1626
+ Enter: ({ editor }) => {
1627
+ const { state } = editor;
1628
+ const { selection } = state;
1629
+ const { $from } = selection;
1630
+ if ($from.parent.type.name === "heading") {
1631
+ if ($from.parent.textContent.length === 0) {
1632
+ return editor.chain().setNode("paragraph").run();
1633
+ }
1634
+ if (selection.empty && $from.parentOffset === $from.parent.textContent.length) {
1635
+ return editor.chain().command(({ tr }) => {
1636
+ tr.split(selection.from);
1637
+ return true;
1638
+ }).setNode("paragraph").run();
1639
+ }
1640
+ }
1641
+ return false;
1642
+ }
1643
+ };
1644
+ }
1645
+ });
1646
+
1647
+ // src/editor/extensions/heading-with-id.ts
1648
+ var import_extension_heading = require("@tiptap/extension-heading");
1649
+ var import_core3 = require("@tiptap/core");
1650
+ var HeadingWithId = import_extension_heading.Heading.extend({
1651
+ renderHTML({ node, HTMLAttributes }) {
1652
+ const level = node.attrs.level;
1653
+ const id = node.textContent.toLowerCase().replace(/\s+/g, "-");
1654
+ return [`h${level}`, (0, import_core3.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes, { id }), 0];
1655
+ }
1656
+ });
1657
+
1658
+ // src/editor/extensions/editor-heading.ts
1659
+ var import_core4 = require("@tiptap/core");
1660
+ var import_extension_heading2 = require("@tiptap/extension-heading");
1661
+ var EditorHeading = import_extension_heading2.Heading.extend({
1662
+ addInputRules() {
1663
+ const rules = this.options.levels.map(
1664
+ (level) => (0, import_core4.textblockTypeInputRule)({
1665
+ find: new RegExp(`^(#{${level}})\\s$`),
1666
+ type: this.type,
1667
+ getAttributes: { level }
1668
+ })
1669
+ );
1670
+ if (this.options.levels.includes(2)) {
1671
+ rules.unshift(
1672
+ (0, import_core4.textblockTypeInputRule)({
1673
+ find: /^#\s$/,
1674
+ type: this.type,
1675
+ getAttributes: { level: 2 }
1676
+ })
1677
+ );
1678
+ }
1679
+ return rules;
1680
+ }
1681
+ });
1682
+
1683
+ // src/editor/extensions/slash-commands.ts
1684
+ var import_core5 = require("@tiptap/core");
1685
+ var import_state2 = require("@tiptap/pm/state");
1686
+ var import_suggestion = __toESM(require("@tiptap/suggestion"), 1);
1687
+ function registerImageInsertCallback(editor, cb) {
1688
+ editor.storage.slashCommands.onInsertImage = cb;
1689
+ }
1690
+ function unregisterImageInsertCallback(editor) {
1691
+ editor.storage.slashCommands.onInsertImage = void 0;
1692
+ }
1693
+ function registerYouTubeInsertCallback(editor, cb) {
1694
+ editor.storage.slashCommands.onInsertYouTube = cb;
1695
+ }
1696
+ function unregisterYouTubeInsertCallback(editor) {
1697
+ editor.storage.slashCommands.onInsertYouTube = void 0;
1698
+ }
1699
+ var slashCommands = import_core5.Extension.create({
1700
+ name: "slashCommands",
1701
+ addOptions() {
1702
+ return {
1703
+ suggestion: {
1704
+ char: "/",
1705
+ pluginKey: new import_state2.PluginKey("slashCommands"),
1706
+ command: ({
1707
+ editor,
1708
+ range,
1709
+ props
1710
+ }) => {
1711
+ props.command({ editor, range });
1712
+ },
1713
+ items: ({ query }) => {
1714
+ const commands = [
1715
+ {
1716
+ title: "Heading 1",
1717
+ description: "Large section heading",
1718
+ icon: "Heading1",
1719
+ category: "suggested",
1720
+ shortcut: "#",
1721
+ command: ({ editor, range }) => {
1722
+ editor.chain().focus().deleteRange(range).setNode("heading", { level: 2 }).run();
1723
+ }
1724
+ },
1725
+ {
1726
+ title: "Heading 2",
1727
+ description: "Medium section heading",
1728
+ icon: "Heading2",
1729
+ category: "suggested",
1730
+ shortcut: "##",
1731
+ command: ({ editor, range }) => {
1732
+ editor.chain().focus().deleteRange(range).setNode("heading", { level: 3 }).run();
1733
+ }
1734
+ },
1735
+ {
1736
+ title: "Heading 3",
1737
+ description: "Small section heading",
1738
+ icon: "Heading3",
1739
+ category: "suggested",
1740
+ shortcut: "###",
1741
+ command: ({ editor, range }) => {
1742
+ editor.chain().focus().deleteRange(range).setNode("heading", { level: 4 }).run();
1743
+ }
1744
+ },
1745
+ {
1746
+ title: "Heading 4",
1747
+ description: "Minor section heading",
1748
+ icon: "Heading4",
1749
+ category: "suggested",
1750
+ shortcut: "####",
1751
+ command: ({ editor, range }) => {
1752
+ editor.chain().focus().deleteRange(range).setNode("heading", { level: 5 }).run();
1753
+ }
1754
+ },
1755
+ {
1756
+ title: "Quote",
1757
+ description: "Insert a blockquote",
1758
+ icon: "Quote",
1759
+ category: "basic",
1760
+ shortcut: ">",
1761
+ command: ({ editor, range }) => {
1762
+ editor.chain().focus().deleteRange(range).toggleBlockquote().run();
1763
+ }
1764
+ },
1765
+ {
1766
+ title: "Notice",
1767
+ description: "Insert a styled callout",
1768
+ icon: "MessageSquareWarning",
1769
+ category: "basic",
1770
+ command: ({ editor, range }) => {
1771
+ editor.chain().focus().deleteRange(range).insertNotice({ variant: "info", title: "Note" }).run();
1772
+ }
1773
+ },
1774
+ {
1775
+ title: "Bullet List",
1776
+ description: "Create a bulleted list",
1777
+ icon: "List",
1778
+ category: "suggested",
1779
+ shortcut: "-",
1780
+ command: ({ editor, range }) => {
1781
+ editor.chain().focus().deleteRange(range).toggleBulletList().run();
1782
+ }
1783
+ },
1784
+ {
1785
+ title: "Numbered List",
1786
+ description: "Create a numbered list",
1787
+ icon: "ListOrdered",
1788
+ category: "suggested",
1789
+ shortcut: "1.",
1790
+ command: ({ editor, range }) => {
1791
+ editor.chain().focus().deleteRange(range).toggleOrderedList().run();
1792
+ }
1793
+ },
1794
+ {
1795
+ title: "Todo List",
1796
+ description: "Create a task list with checkboxes",
1797
+ icon: "ListTodo",
1798
+ category: "suggested",
1799
+ shortcut: "[]",
1800
+ command: ({ editor, range }) => {
1801
+ editor.chain().focus().deleteRange(range).toggleTaskList().run();
1802
+ }
1803
+ },
1804
+ {
1805
+ title: "Divider",
1806
+ description: "Insert a horizontal divider",
1807
+ icon: "Minus",
1808
+ category: "basic",
1809
+ shortcut: "---",
1810
+ command: ({ editor, range }) => {
1811
+ editor.chain().focus().deleteRange(range).setHorizontalRule().run();
1812
+ }
1813
+ },
1814
+ {
1815
+ title: "Code Block",
1816
+ description: "Insert a code block with syntax highlighting",
1817
+ icon: "Code",
1818
+ category: "advanced",
1819
+ shortcut: "```",
1820
+ command: ({ editor, range }) => {
1821
+ editor.chain().focus().deleteRange(range).setCodeBlock({ language: "plaintext" }).run();
1822
+ }
1823
+ },
1824
+ {
1825
+ title: "YouTube",
1826
+ description: "Embed a YouTube video",
1827
+ icon: "YouTube",
1828
+ category: "media",
1829
+ command: ({ editor, range }) => {
1830
+ editor.chain().focus().deleteRange(range).run();
1831
+ editor.storage.slashCommands.onInsertYouTube?.(
1832
+ range.from
1833
+ );
1834
+ }
1835
+ },
1836
+ {
1837
+ title: "Image",
1838
+ description: "Upload an image from your computer",
1839
+ icon: "Image",
1840
+ category: "media",
1841
+ command: ({ editor, range }) => {
1842
+ editor.chain().focus().deleteRange(range).run();
1843
+ editor.storage.slashCommands.onInsertImage?.(
1844
+ range.from
1845
+ );
1846
+ }
1847
+ },
1848
+ {
1849
+ title: "Bookmark",
1850
+ description: "Create a rich link preview card",
1851
+ icon: "Bookmark",
1852
+ category: "media",
1853
+ command: ({ editor, range }) => {
1854
+ editor.chain().focus().deleteRange(range).run();
1855
+ editor.storage["bookmarkInput"] = {
1856
+ active: true,
1857
+ position: range.from
1858
+ };
1859
+ }
1860
+ }
1861
+ ];
1862
+ return commands.filter((item) => item.title.toLowerCase().startsWith(query.toLowerCase()));
1863
+ }
1864
+ }
1865
+ };
1866
+ },
1867
+ addStorage() {
1868
+ return { onInsertImage: void 0, onInsertYouTube: void 0 };
1869
+ },
1870
+ addProseMirrorPlugins() {
1871
+ return [
1872
+ (0, import_suggestion.default)({
1873
+ editor: this.editor,
1874
+ ...this.options.suggestion
1875
+ })
1876
+ ];
1877
+ }
1878
+ });
1879
+
1880
+ // src/editor/extensions/code-block-custom.ts
1881
+ var import_extension_code_block_lowlight = __toESM(require("@tiptap/extension-code-block-lowlight"), 1);
1882
+ var createCodeBlockCustom = (lowlight, nodeView) => import_extension_code_block_lowlight.default.extend({
1883
+ addNodeView() {
1884
+ return nodeView();
1885
+ },
1886
+ addKeyboardShortcuts() {
1887
+ return {
1888
+ Tab: () => {
1889
+ if (this.editor.isActive("codeBlock")) {
1890
+ return this.editor.commands.insertContent(" ");
1891
+ }
1892
+ return false;
1893
+ },
1894
+ "Shift-Tab": () => {
1895
+ if (this.editor.isActive("codeBlock")) {
1896
+ const { state } = this.editor;
1897
+ const { selection } = state;
1898
+ const { $from } = selection;
1899
+ const textBefore = $from.parent.textBetween(0, $from.parentOffset);
1900
+ if (textBefore.endsWith(" ")) {
1901
+ return this.editor.commands.deleteRange({
1902
+ from: $from.pos - 1,
1903
+ to: $from.pos
1904
+ });
1905
+ }
1906
+ }
1907
+ return false;
1908
+ }
1909
+ };
1910
+ }
1911
+ }).configure({
1912
+ lowlight,
1913
+ defaultLanguage: "javascript"
1914
+ });
1915
+
1916
+ // src/editor/extensions/image-node.ts
1917
+ var import_core6 = require("@tiptap/core");
1918
+ var import_state3 = require("@tiptap/pm/state");
1919
+ var import_view = require("@tiptap/pm/view");
1920
+ var imageBackspaceKey = new import_state3.PluginKey("imageBackspace");
1921
+ var createImageNode = (nodeView) => import_core6.Node.create({
1922
+ name: "imageNode",
1923
+ group: "block",
1924
+ atom: true,
1925
+ addAttributes() {
1926
+ return {
1927
+ src: { default: null },
1928
+ srcset: { default: null },
1929
+ alt: { default: "" },
1930
+ caption: { default: "" }
1931
+ };
1932
+ },
1933
+ parseHTML() {
1934
+ return [{ tag: 'figure[data-type="image-node"]' }];
1935
+ },
1936
+ renderHTML({ HTMLAttributes }) {
1937
+ const { src, srcset, alt, caption } = HTMLAttributes;
1938
+ const imgAttrs = {
1939
+ src,
1940
+ srcset,
1941
+ alt: alt || "",
1942
+ sizes: "(max-width: 768px) 100vw, 720px",
1943
+ class: "w-full object-cover"
1944
+ };
1945
+ if (!caption) {
1946
+ return ["figure", { "data-type": "image-node", class: "my-6 m-0" }, ["img", imgAttrs]];
1947
+ }
1948
+ return [
1949
+ "figure",
1950
+ { "data-type": "image-node", class: "my-6 m-0" },
1951
+ ["img", imgAttrs],
1952
+ ["figcaption", { class: "mt-4 text-sm text-muted-foreground text-center italic" }, caption]
1953
+ ];
1954
+ },
1955
+ addNodeView() {
1956
+ return nodeView();
1957
+ },
1958
+ addCommands() {
1959
+ return {
1960
+ insertImage: (attrs) => ({ commands }) => {
1961
+ return commands.insertContent({
1962
+ type: this.name,
1963
+ attrs
1964
+ });
1965
+ }
1966
+ };
1967
+ },
1968
+ addProseMirrorPlugins() {
1969
+ let arrowKeyPressed = false;
1970
+ const captionFocusPlugin = new import_state3.Plugin({
1971
+ key: new import_state3.PluginKey("imageNodeCaptionFocus"),
1972
+ props: {
1973
+ handleKeyDown(_view, event) {
1974
+ if (event.key === "ArrowDown" || event.key === "ArrowUp") {
1975
+ arrowKeyPressed = true;
1976
+ }
1977
+ return false;
1978
+ }
1979
+ },
1980
+ view() {
1981
+ return {
1982
+ update(view, prevState) {
1983
+ const { selection } = view.state;
1984
+ const { selection: prevSelection } = prevState;
1985
+ const movedOntoImage = arrowKeyPressed && selection instanceof import_state3.NodeSelection && selection.node.type.name === "imageNode" && !(prevSelection instanceof import_state3.NodeSelection && prevSelection.from === selection.from);
1986
+ arrowKeyPressed = false;
1987
+ if (movedOntoImage) {
1988
+ const pos = selection.from;
1989
+ const nodeSize = selection.node.nodeSize;
1990
+ const dom = view.nodeDOM(pos);
1991
+ const input = dom ? dom.querySelector(".caption-input") : null;
1992
+ if (input) {
1993
+ const { tr, doc } = view.state;
1994
+ const $after = doc.resolve(Math.min(pos + nodeSize, doc.content.size));
1995
+ view.dispatch(tr.setSelection(import_state3.TextSelection.near($after)));
1996
+ input.focus({ preventScroll: true });
1997
+ setTimeout(() => {
1998
+ const rect = input.getBoundingClientRect();
1999
+ if (rect.bottom > window.innerHeight || rect.top < 0) {
2000
+ input.scrollIntoView({ block: "nearest", behavior: "smooth" });
2001
+ }
2002
+ }, 0);
2003
+ }
2004
+ }
2005
+ }
2006
+ };
2007
+ }
2008
+ });
2009
+ const backspacePlugin = new import_state3.Plugin({
2010
+ key: imageBackspaceKey,
2011
+ state: {
2012
+ init: () => null,
2013
+ apply(tr, value) {
2014
+ const meta = tr.getMeta(imageBackspaceKey);
2015
+ if (meta !== void 0) return meta;
2016
+ if (tr.docChanged) return null;
2017
+ if (value === null) return null;
2018
+ const { selection } = tr;
2019
+ if (!selection.empty || selection.$from.parentOffset !== 0) return null;
2020
+ return value;
2021
+ }
2022
+ },
2023
+ props: {
2024
+ handleKeyDown(view, event) {
2025
+ if (event.key !== "Backspace") return false;
2026
+ const { selection, doc } = view.state;
2027
+ const pendingPos = imageBackspaceKey.getState(view.state);
2028
+ if (pendingPos != null) {
2029
+ const node = doc.nodeAt(pendingPos);
2030
+ if (node?.type.name === "imageNode") {
2031
+ view.dispatch(
2032
+ view.state.tr.delete(pendingPos, pendingPos + node.nodeSize).setMeta(imageBackspaceKey, null)
2033
+ );
2034
+ return true;
2035
+ }
2036
+ }
2037
+ if (selection.empty && selection.$from.parentOffset === 0) {
2038
+ const $from = selection.$from;
2039
+ const posBeforeBlock = $from.before($from.depth);
2040
+ const nodeBefore = doc.resolve(posBeforeBlock).nodeBefore;
2041
+ if (nodeBefore?.type.name === "imageNode") {
2042
+ const imageStart = posBeforeBlock - nodeBefore.nodeSize;
2043
+ view.dispatch(view.state.tr.setMeta(imageBackspaceKey, imageStart));
2044
+ return true;
2045
+ }
2046
+ }
2047
+ return false;
2048
+ },
2049
+ decorations(state) {
2050
+ const pendingPos = imageBackspaceKey.getState(state);
2051
+ if (pendingPos == null) return null;
2052
+ const node = state.doc.nodeAt(pendingPos);
2053
+ if (!node) return null;
2054
+ return import_view.DecorationSet.create(state.doc, [
2055
+ import_view.Decoration.node(pendingPos, pendingPos + node.nodeSize, {
2056
+ class: "image-node-pending-delete"
2057
+ })
2058
+ ]);
2059
+ }
2060
+ }
2061
+ });
2062
+ return [captionFocusPlugin, backspacePlugin];
2063
+ }
2064
+ });
2065
+
2066
+ // src/editor/extensions/url-mention.ts
2067
+ var import_core7 = require("@tiptap/core");
2068
+ function safeUrl(value) {
2069
+ if (typeof value !== "string") return "";
2070
+ try {
2071
+ const parsed = new URL(value);
2072
+ return parsed.protocol === "http:" || parsed.protocol === "https:" ? value : "";
2073
+ } catch {
2074
+ return "";
2075
+ }
2076
+ }
2077
+ var LINK_ICON_PATH = "M12.586 4.586a2 2 0 112.828 2.828l-3 3a2 2 0 01-2.828 0 1 1 0 00-1.414 1.414 4 4 0 005.656 0l-3-3a4 4 0 00-5.656-5.656l-1.5 1.5a1 1 0 101.414 1.414l1.5-1.5zm-5 5a2 2 0 012.828 0 1 1 0 101.414-1.414 4 4 0 00-5.656 0l-3 3a4 4 0 105.656 5.656l1.5-1.5a1 1 0 10-1.414-1.414l-1.5 1.5a2 2 0 11-2.828-2.828l3-3z";
2078
+ var createUrlMention = (nodeView) => import_core7.Node.create({
2079
+ name: "urlMention",
2080
+ group: "inline",
2081
+ inline: true,
2082
+ atom: true,
2083
+ addAttributes() {
2084
+ return {
2085
+ url: { default: null },
2086
+ title: { default: null },
2087
+ favicon: { default: null }
2088
+ };
2089
+ },
2090
+ parseHTML() {
2091
+ return [
2092
+ {
2093
+ tag: 'span[data-type="url-mention"]'
2094
+ }
2095
+ ];
2096
+ },
2097
+ renderHTML({ HTMLAttributes }) {
2098
+ const { url, title, favicon } = HTMLAttributes;
2099
+ const displayTitle = title || url || "";
2100
+ return [
2101
+ "a",
2102
+ (0, import_core7.mergeAttributes)(HTMLAttributes, {
2103
+ "data-type": "url-mention",
2104
+ href: safeUrl(url),
2105
+ target: "_blank",
2106
+ rel: "noopener noreferrer",
2107
+ class: "url-mention-pill",
2108
+ style: "text-decoration: none !important; color: inherit;"
2109
+ }),
2110
+ favicon ? [
2111
+ "img",
2112
+ {
2113
+ src: favicon,
2114
+ alt: "",
2115
+ class: "inline-block w-3.5 h-3.5 flex-shrink-0",
2116
+ onerror: "this.style.display='none'"
2117
+ }
2118
+ ] : [
2119
+ "svg",
2120
+ { class: "inline-block w-3.5 h-3.5 flex-shrink-0", fill: "currentColor", viewBox: "0 0 20 20" },
2121
+ ["path", { d: LINK_ICON_PATH }]
2122
+ ],
2123
+ ["span", {}, displayTitle]
2124
+ ];
2125
+ },
2126
+ addNodeView() {
2127
+ return nodeView();
2128
+ },
2129
+ addCommands() {
2130
+ return {
2131
+ insertUrlMention: (attributes) => ({ commands }) => {
2132
+ return commands.insertContent({
2133
+ type: this.name,
2134
+ attrs: attributes
2135
+ });
2136
+ }
2137
+ };
2138
+ }
2139
+ });
2140
+
2141
+ // src/editor/extensions/link-preview.ts
2142
+ var import_core8 = require("@tiptap/core");
2143
+ function safeUrl2(value) {
2144
+ if (typeof value !== "string") return "";
2145
+ try {
2146
+ const parsed = new URL(value);
2147
+ return parsed.protocol === "http:" || parsed.protocol === "https:" ? value : "";
2148
+ } catch {
2149
+ return "";
2150
+ }
2151
+ }
2152
+ function safeEmbedUrl(value) {
2153
+ const url = safeUrl2(value);
2154
+ if (!url) return "";
2155
+ try {
2156
+ const parsed = new URL(url);
2157
+ const host = parsed.hostname.replace(/^www\./, "");
2158
+ let videoId;
2159
+ if (host === "youtu.be") {
2160
+ videoId = /^\/([^/]+)/.exec(parsed.pathname)?.[1];
2161
+ } else if (host === "youtube.com" || host === "m.youtube.com" || host === "youtube-nocookie.com") {
2162
+ videoId = parsed.searchParams.get("v") ?? /^\/embed\/([^/]+)/.exec(parsed.pathname)?.[1];
2163
+ }
2164
+ return videoId ? `https://www.youtube-nocookie.com/embed/${encodeURIComponent(videoId)}` : url;
2165
+ } catch {
2166
+ return "";
2167
+ }
2168
+ }
2169
+ var LINK_ICON_PATH2 = "M12.586 4.586a2 2 0 112.828 2.828l-3 3a2 2 0 01-2.828 0 1 1 0 00-1.414 1.414 4 4 0 005.656 0l-3-3a4 4 0 00-5.656-5.656l-1.5 1.5a1 1 0 101.414 1.414l1.5-1.5zm-5 5a2 2 0 012.828 0 1 1 0 101.414-1.414 4 4 0 00-5.656 0l-3 3a4 4 0 105.656 5.656l1.5-1.5a1 1 0 10-1.414-1.414l-1.5 1.5a2 2 0 11-2.828-2.828l3-3z";
2170
+ var createLinkPreview = (nodeView) => import_core8.Node.create({
2171
+ name: "linkPreview",
2172
+ group: "block",
2173
+ atom: true,
2174
+ addAttributes() {
2175
+ return {
2176
+ url: { default: null },
2177
+ title: { default: null },
2178
+ description: { default: null },
2179
+ image: { default: null },
2180
+ favicon: { default: null },
2181
+ provider: { default: null },
2182
+ type: { default: "bookmark" }
2183
+ // bookmark | embed
2184
+ };
2185
+ },
2186
+ parseHTML() {
2187
+ return [
2188
+ {
2189
+ tag: 'div[data-type="link-preview"]'
2190
+ }
2191
+ ];
2192
+ },
2193
+ renderHTML({ HTMLAttributes }) {
2194
+ const { url, title, description, image, favicon, type } = HTMLAttributes;
2195
+ if (type === "embed") {
2196
+ return [
2197
+ "div",
2198
+ (0, import_core8.mergeAttributes)(HTMLAttributes, { "data-type": "link-preview" }),
2199
+ [
2200
+ "div",
2201
+ { class: "relative pb-[56.25%] h-0 overflow-hidden rounded-lg" },
2202
+ [
2203
+ "iframe",
2204
+ {
2205
+ src: safeEmbedUrl(url),
2206
+ title: title || "",
2207
+ frameborder: "0",
2208
+ allowfullscreen: "",
2209
+ class: "absolute top-0 left-0 w-full h-full"
2210
+ }
2211
+ ]
2212
+ ]
2213
+ ];
2214
+ }
2215
+ const hostname = url ? (() => {
2216
+ try {
2217
+ return new URL(url).hostname;
2218
+ } catch {
2219
+ return url;
2220
+ }
2221
+ })() : "";
2222
+ const faviconNode = favicon ? [
2223
+ "img",
2224
+ {
2225
+ src: favicon,
2226
+ alt: "",
2227
+ class: "w-3.5 h-3.5 flex-shrink-0",
2228
+ onerror: "this.style.display='none'"
2229
+ }
2230
+ ] : [
2231
+ "svg",
2232
+ { class: "w-3 h-3 flex-shrink-0", fill: "currentColor", viewBox: "0 0 20 20" },
2233
+ ["path", { d: LINK_ICON_PATH2 }]
2234
+ ];
2235
+ const textBlock = [["div", { class: "text-base font-semibold mb-1 line-clamp-1" }, title || ""]];
2236
+ if (description) {
2237
+ textBlock.push(["p", { class: "text-xs text-muted-foreground mb-2 line-clamp-2 leading-snug" }, description]);
2238
+ }
2239
+ const cardChildren = [
2240
+ [
2241
+ "div",
2242
+ { class: "flex-1 min-w-0 flex flex-col justify-between px-3 py-1.5" },
2243
+ ["div", {}, ...textBlock],
2244
+ [
2245
+ "div",
2246
+ { class: "flex items-center gap-1.5 text-xs text-muted-foreground mt-auto" },
2247
+ faviconNode,
2248
+ ["span", { class: "truncate opacity-80" }, hostname]
2249
+ ]
2250
+ ]
2251
+ ];
2252
+ if (image) {
2253
+ cardChildren.push([
2254
+ "div",
2255
+ { class: "flex-shrink-0 w-44 aspect-video bg-muted" },
2256
+ [
2257
+ "img",
2258
+ {
2259
+ src: image,
2260
+ alt: title || "",
2261
+ class: "w-full h-full object-cover",
2262
+ onerror: "this.parentElement.style.display='none'"
2263
+ }
2264
+ ]
2265
+ ]);
2266
+ }
2267
+ return [
2268
+ "div",
2269
+ (0, import_core8.mergeAttributes)(HTMLAttributes, {
2270
+ "data-type": "link-preview",
2271
+ class: "link-preview my-4"
2272
+ }),
2273
+ [
2274
+ "a",
2275
+ {
2276
+ href: safeUrl2(url),
2277
+ target: "_blank",
2278
+ rel: "noopener noreferrer",
2279
+ class: "flex transition-colors overflow-hidden bookmark-link",
2280
+ style: "text-decoration: none !important; color: inherit;"
2281
+ },
2282
+ ...cardChildren
2283
+ ]
2284
+ ];
2285
+ },
2286
+ addNodeView() {
2287
+ return nodeView();
2288
+ },
2289
+ addCommands() {
2290
+ return {
2291
+ insertLinkPreview: (attributes) => ({ commands }) => {
2292
+ return commands.insertContent({
2293
+ type: this.name,
2294
+ attrs: attributes
2295
+ });
2296
+ }
2297
+ };
2298
+ }
2299
+ });
2300
+
2301
+ // src/editor/extensions/internal-mention.ts
2302
+ var import_extension_mention = require("@tiptap/extension-mention");
2303
+ var createInternalMention = ({ mentionSource, hrefBuilder, render }) => import_extension_mention.Mention.extend({
2304
+ name: "internalMention",
2305
+ parseHTML() {
2306
+ return [
2307
+ {
2308
+ tag: 'span[data-type="internal-mention"]'
2309
+ }
2310
+ ];
2311
+ },
2312
+ renderHTML({ node, HTMLAttributes }) {
2313
+ const { id, label, type, seriesId } = node.attrs;
2314
+ const href = hrefBuilder ? hrefBuilder({ id, label, type, seriesId }) : type === "post" && seriesId ? `/read/${seriesId}?post=${id}` : `/read/${id}`;
2315
+ return [
2316
+ "a",
2317
+ {
2318
+ ...HTMLAttributes,
2319
+ class: "internal-mention",
2320
+ "data-type": "internal-mention",
2321
+ "data-id": id,
2322
+ "data-label": label,
2323
+ "data-mention-type": type,
2324
+ "data-series-id": seriesId,
2325
+ href,
2326
+ target: "_blank",
2327
+ rel: "noopener noreferrer"
2328
+ },
2329
+ label
2330
+ ];
2331
+ },
2332
+ addAttributes() {
2333
+ return {
2334
+ id: {
2335
+ default: null,
2336
+ parseHTML: (element) => element.getAttribute("data-id"),
2337
+ renderHTML: (attributes) => ({
2338
+ "data-id": attributes.id
2339
+ })
2340
+ },
2341
+ label: {
2342
+ default: null,
2343
+ parseHTML: (element) => element.getAttribute("data-label"),
2344
+ renderHTML: (attributes) => ({
2345
+ "data-label": attributes.label
2346
+ })
2347
+ },
2348
+ type: {
2349
+ default: "post",
2350
+ parseHTML: (element) => element.getAttribute("data-type"),
2351
+ renderHTML: (attributes) => ({
2352
+ "data-type": attributes.type
2353
+ })
2354
+ },
2355
+ seriesId: {
2356
+ default: null,
2357
+ parseHTML: (element) => element.getAttribute("data-series-id"),
2358
+ renderHTML: (attributes) => ({
2359
+ "data-series-id": attributes.seriesId
2360
+ })
2361
+ }
2362
+ };
2363
+ }
2364
+ }).configure({
2365
+ HTMLAttributes: {
2366
+ class: "internal-mention"
2367
+ },
2368
+ suggestion: {
2369
+ char: "@",
2370
+ allowSpaces: true,
2371
+ command: ({ editor, range, props }) => {
2372
+ editor.chain().focus().insertContentAt(range, [
2373
+ {
2374
+ type: "internalMention",
2375
+ attrs: props
2376
+ }
2377
+ ]).run();
2378
+ },
2379
+ items: async ({ query }) => {
2380
+ if (!mentionSource) return [];
2381
+ try {
2382
+ return await mentionSource(query);
2383
+ } catch {
2384
+ return [];
2385
+ }
2386
+ },
2387
+ render
2388
+ }
2389
+ });
2390
+
2391
+ // src/editor/extensions/notice-node.ts
2392
+ var import_core9 = require("@tiptap/core");
2393
+ var import_state4 = require("@tiptap/pm/state");
2394
+ var createNoticeNode = (nodeView) => import_core9.Node.create({
2395
+ name: "notice",
2396
+ group: "block",
2397
+ content: "block+",
2398
+ defining: true,
2399
+ addAttributes() {
2400
+ return {
2401
+ variant: { default: "info" },
2402
+ title: {
2403
+ default: "Note",
2404
+ parseHTML: (element) => element.querySelector("[data-notice-title]")?.textContent ?? "Note"
2405
+ }
2406
+ };
2407
+ },
2408
+ parseHTML() {
2409
+ return [{ tag: 'aside[data-type="notice"]', contentElement: "[data-notice-body]" }];
2410
+ },
2411
+ renderHTML({ HTMLAttributes }) {
2412
+ const { title = "Note", variant: rawVariant = "info", ...attributes } = HTMLAttributes;
2413
+ const variant = rawVariant;
2414
+ return [
2415
+ "aside",
2416
+ (0, import_core9.mergeAttributes)(attributes, {
2417
+ "data-type": "notice",
2418
+ "data-variant": variant,
2419
+ class: "editor-notice my-4 rounded-lg border border-border bg-muted/40 p-4"
2420
+ }),
2421
+ ["div", { "data-notice-title": "", class: "font-semibold tracking-tight" }, String(title)],
2422
+ ["div", { "data-notice-body": "" }, 0]
2423
+ ];
2424
+ },
2425
+ addNodeView() {
2426
+ return nodeView ? nodeView() : null;
2427
+ },
2428
+ addProseMirrorPlugins() {
2429
+ return [
2430
+ new import_state4.Plugin({
2431
+ props: {
2432
+ handleKeyDown: (view, event) => {
2433
+ if (event.key !== "ArrowUp") return false;
2434
+ const { selection } = view.state;
2435
+ const { $from } = selection;
2436
+ if (!selection.empty) return false;
2437
+ let noticeDepth = -1;
2438
+ for (let depth = $from.depth; depth > 0; depth -= 1) {
2439
+ if ($from.node(depth).type.name === this.name) {
2440
+ noticeDepth = depth;
2441
+ break;
2442
+ }
2443
+ }
2444
+ if (noticeDepth < 0 || $from.index(noticeDepth) !== 0) return false;
2445
+ const cursorCoords = view.coordsAtPos(selection.from);
2446
+ const firstLineCoords = view.coordsAtPos($from.start());
2447
+ if (cursorCoords.top > firstLineCoords.top + 2) return false;
2448
+ const dom = view.nodeDOM($from.before(noticeDepth));
2449
+ if (!(dom instanceof HTMLElement)) return false;
2450
+ const titleInput = dom.querySelector('input[aria-label="Notice title"]');
2451
+ if (!titleInput) return false;
2452
+ titleInput.focus();
2453
+ return true;
2454
+ }
2455
+ }
2456
+ })
2457
+ ];
2458
+ },
2459
+ addCommands() {
2460
+ return {
2461
+ insertNotice: (attributes = {}) => ({ commands }) => commands.insertContent({
2462
+ type: this.name,
2463
+ attrs: attributes,
2464
+ content: [{ type: "paragraph", content: [] }]
2465
+ })
2466
+ };
2467
+ }
2468
+ });
2469
+
2470
+ // src/editor/extensions/current-empty-block.ts
2471
+ var import_core10 = require("@tiptap/core");
2472
+ var import_state5 = require("@tiptap/pm/state");
2473
+ var import_view2 = require("@tiptap/pm/view");
2474
+ var currentEmptyBlockKey = new import_state5.PluginKey("currentEmptyBlock");
2475
+ var CurrentEmptyBlock = import_core10.Extension.create({
2476
+ name: "currentEmptyBlock",
2477
+ addProseMirrorPlugins() {
2478
+ return [
2479
+ new import_state5.Plugin({
2480
+ key: currentEmptyBlockKey,
2481
+ props: {
2482
+ decorations(state) {
2483
+ const { selection } = state;
2484
+ const { $from } = selection;
2485
+ if (!selection.empty || $from.depth === 0 || $from.parent.content.size > 0) return null;
2486
+ return import_view2.DecorationSet.create(state.doc, [
2487
+ import_view2.Decoration.node($from.before($from.depth), $from.after($from.depth), {
2488
+ class: "is-current-empty"
2489
+ })
2490
+ ]);
2491
+ }
2492
+ }
2493
+ })
2494
+ ];
2495
+ }
2496
+ });
2497
+
2498
+ // src/editor/build-extensions.ts
2499
+ function buildExtensions(options) {
2500
+ const { nodeViews, mentionSource, hrefBuilder, mentionRender, slashRender, headingWithId } = options;
2501
+ const enforceTitle = options.enforceTitle ?? true;
2502
+ const lowlight = (0, import_lowlight.createLowlight)(import_lowlight.common);
2503
+ return [
2504
+ import_starter_kit.default.configure({
2505
+ codeBlock: false,
2506
+ // we use CodeBlockCustom
2507
+ link: false,
2508
+ // we configure Link explicitly below
2509
+ underline: false,
2510
+ // we configure Underline explicitly below
2511
+ heading: false
2512
+ // Reader and editor install their own heading variants below.
2513
+ }),
2514
+ ...headingWithId ? [HeadingWithId.configure({ levels: [1, 2, 3, 4, 5, 6] })] : [EditorHeading.configure({ levels: [1, 2, 3, 4, 5, 6] })],
2515
+ ...enforceTitle ? [TitleHeading, ExitHeading] : [],
2516
+ import_extension_placeholder.default.configure({
2517
+ showOnlyCurrent: false,
2518
+ placeholder: ({ node }) => node.type.name === "codeBlock" ? "" : options.placeholder ? options.placeholder(node.type.name, node.attrs.level) : node.type.name === "heading" && node.attrs.level === 1 ? "Untitled" : "Type '/' for commands"
2519
+ }),
2520
+ CurrentEmptyBlock,
2521
+ import_extension_highlight.default.configure({ multicolor: true }),
2522
+ import_extension_link.default.configure({
2523
+ openOnClick: false,
2524
+ HTMLAttributes: {
2525
+ class: "text-primary underline",
2526
+ target: "_blank",
2527
+ rel: "noopener noreferrer"
2528
+ }
2529
+ }),
2530
+ import_extension_typography.default,
2531
+ import_extension_underline.default,
2532
+ import_extension_text_style.TextStyle,
2533
+ import_extension_color.Color,
2534
+ import_extension_text_align.default.configure({
2535
+ types: ["heading", "paragraph"],
2536
+ alignments: ["left", "center", "right", "justify"],
2537
+ defaultAlignment: "left"
2538
+ }),
2539
+ createCodeBlockCustom(lowlight, nodeViews.codeBlock),
2540
+ import_extension_character_count.default.configure({ mode: "textSize" }),
2541
+ import_extension_task_list.default,
2542
+ import_extension_task_item.default.configure({ nested: true }),
2543
+ createNoticeNode(nodeViews.notice),
2544
+ createInternalMention({
2545
+ mentionSource,
2546
+ hrefBuilder,
2547
+ // Without a framework-supplied render the suggestion is inert, so fall back to a no-op
2548
+ // rather than throwing when a consumer builds extensions headlessly (e.g. unit tests).
2549
+ render: mentionRender ?? (() => ({}))
2550
+ }),
2551
+ createLinkPreview(nodeViews.linkPreview),
2552
+ createImageNode(nodeViews.image),
2553
+ createUrlMention(nodeViews.urlMention),
2554
+ slashCommands.configure({ suggestion: { render: slashRender ?? (() => ({})) } })
2555
+ ];
2556
+ }
2557
+
2558
+ // src/editor/paste-url.ts
2559
+ function insertPastedUrlAsLink(view, event) {
2560
+ const value = event.clipboardData?.getData("text/plain").trim() ?? "";
2561
+ if (!value || /\s/.test(value)) return false;
2562
+ try {
2563
+ const protocol = new URL(value).protocol;
2564
+ if (protocol !== "http:" && protocol !== "https:") return false;
2565
+ } catch {
2566
+ return false;
2567
+ }
2568
+ const link = view.state.schema.marks.link;
2569
+ if (!link) return false;
2570
+ event.preventDefault();
2571
+ const text = view.state.schema.text(value, [link.create({ href: value })]);
2572
+ view.dispatch(view.state.tr.replaceSelectionWith(text, false).scrollIntoView());
2573
+ return true;
2574
+ }
2575
+
2576
+ // src/editor/overlay-position.ts
2577
+ function placeEditorOverlay(rect, { width, height, gap = 8, viewportGap = 16 }) {
2578
+ const spaceBelow = window.innerHeight - rect.bottom;
2579
+ const spaceAbove = rect.top;
2580
+ const preferredTop = spaceBelow < height && spaceAbove > spaceBelow ? rect.top - height - gap : rect.bottom + gap;
2581
+ const maxLeft = Math.max(window.innerWidth - width - viewportGap, viewportGap);
2582
+ const maxTop = Math.max(window.innerHeight - height - viewportGap, viewportGap);
2583
+ return {
2584
+ left: Math.min(Math.max(rect.left, viewportGap), maxLeft),
2585
+ top: Math.min(Math.max(preferredTop, viewportGap), maxTop)
2586
+ };
2587
+ }
2588
+ function placeEditorOverlayAt(editor, position, options) {
2589
+ return placeEditorOverlay(editor.view.coordsAtPos(position), options);
2590
+ }
2591
+ function findEditorScrollContainer(element) {
2592
+ let current = element.parentElement;
2593
+ while (current && current !== document.body) {
2594
+ const overflowY = window.getComputedStyle(current).overflowY;
2595
+ if (/(auto|scroll)/.test(overflowY) && current.scrollHeight > current.clientHeight) return current;
2596
+ current = current.parentElement;
2597
+ }
2598
+ return null;
2599
+ }
2600
+ function lockEditorOverlayScroll(editorElement, overlayElement) {
2601
+ const container = findEditorScrollContainer(editorElement);
2602
+ if (!container) return () => void 0;
2603
+ const preventWheel = (event) => {
2604
+ const target = event.target;
2605
+ if (target instanceof Node && overlayElement?.contains(target)) return;
2606
+ event.preventDefault();
2607
+ };
2608
+ container.addEventListener("wheel", preventWheel, { passive: false });
2609
+ return () => container.removeEventListener("wheel", preventWheel);
2610
+ }
2611
+ // Annotate the CommonJS export names for ESM import in node:
2612
+ 0 && (module.exports = {
2613
+ EditorHeading,
2614
+ ExitHeading,
2615
+ HeadingWithId,
2616
+ SIDEBAR_KEYBOARD_SHORTCUT,
2617
+ SIDEBAR_WIDTH,
2618
+ SIDEBAR_WIDTH_ICON,
2619
+ SIDEBAR_WIDTH_MOBILE,
2620
+ THEMES,
2621
+ THEME_NAMES,
2622
+ TitleHeading,
2623
+ badgeVariants,
2624
+ buildChartDefinition,
2625
+ buildExtensions,
2626
+ buttonVariants,
2627
+ cardBodyBase,
2628
+ cardCoverVariants,
2629
+ cardDescriptionBase,
2630
+ cardFooterBase,
2631
+ cardHeaderBase,
2632
+ cardTitleBase,
2633
+ cardVariants,
2634
+ centerBase,
2635
+ chartPlaceholderBase,
2636
+ chartPlaceholderLabelBase,
2637
+ chartRootBase,
2638
+ checkboxGroupBase,
2639
+ checkboxIndicatorBase,
2640
+ checkboxLabelBase,
2641
+ checkboxVariants,
2642
+ clipboardTriggerBase,
2643
+ cn,
2644
+ codeBlockBodyBase,
2645
+ codeBlockBodyScrollableBase,
2646
+ codeBlockContentBase,
2647
+ codeBlockCopyFloatBase,
2648
+ codeBlockHeaderBase,
2649
+ codeBlockHeaderInfoBase,
2650
+ codeBlockHighlightBase,
2651
+ codeBlockLineNumbersBase,
2652
+ codeBlockLoadingBase,
2653
+ codeBlockRootBase,
2654
+ codeBlockSpinnerBase,
2655
+ codeBlockTitleBase,
2656
+ colBase,
2657
+ comboboxClearTriggerBase,
2658
+ comboboxContentBase,
2659
+ comboboxControlBase,
2660
+ comboboxEmptyBase,
2661
+ comboboxInputBase,
2662
+ comboboxItemGroupLabelBase,
2663
+ comboboxItemIndicatorBase,
2664
+ comboboxItemVariants,
2665
+ comboboxListBase,
2666
+ comboboxPositionerBase,
2667
+ comboboxTriggerBase,
2668
+ containerBase,
2669
+ createCodeBlockCustom,
2670
+ createImageNode,
2671
+ createInternalMention,
2672
+ createLinkPreview,
2673
+ createNoticeNode,
2674
+ createUrlMention,
2675
+ defaultChartColor,
2676
+ defaultListboxFilter,
2677
+ dialogBackdropBase,
2678
+ dialogCloseTriggerBase,
2679
+ dialogContentBase,
2680
+ dialogDescriptionBase,
2681
+ dialogFooterBase,
2682
+ dialogFooterStickyBase,
2683
+ dialogFullscreenContentBase,
2684
+ dialogHeaderBase,
2685
+ dialogHeaderStickyBase,
2686
+ dialogPositionerBase,
2687
+ dialogTitleBase,
2688
+ extractYouTubeId,
2689
+ feedbackCorrectBase,
2690
+ feedbackExplanationBase,
2691
+ feedbackIncorrectBase,
2692
+ fetchYouTubeMetadata,
2693
+ fieldErrorBase,
2694
+ fieldHelperBase,
2695
+ fieldLabelBase,
2696
+ fieldRequiredIndicatorBase,
2697
+ fieldRootBase,
2698
+ fieldsetErrorBase,
2699
+ fieldsetHelperBase,
2700
+ fieldsetLegendBase,
2701
+ fieldsetRootBase,
2702
+ figureCaptionBase,
2703
+ figureImageBase,
2704
+ figureRootBase,
2705
+ findEditorScrollContainer,
2706
+ formatTime,
2707
+ hstackBase,
2708
+ injectCodeBlockStyles,
2709
+ inputVariants,
2710
+ insertPastedUrlAsLink,
2711
+ itemVariants,
2712
+ latexDisplayBase,
2713
+ latexErrorBase,
2714
+ latexInlineBase,
2715
+ latexRootBase,
2716
+ listboxContentBase,
2717
+ listboxEmptyBase,
2718
+ listboxInputBase,
2719
+ listboxItemBase,
2720
+ listboxItemIndicatorBase,
2721
+ listboxItemTextBase,
2722
+ listboxLabelBase,
2723
+ listboxRootBase,
2724
+ lockEditorOverlayScroll,
2725
+ manimCaptionBase,
2726
+ manimContainerBase,
2727
+ manimErrorBase,
2728
+ manimPlaceholderBase,
2729
+ manimPlaceholderLabelBase,
2730
+ manimRootBase,
2731
+ mermaidLoadingBase,
2732
+ mermaidRootBase,
2733
+ mermaidSourceBase,
2734
+ mermaidSvgAspectRatio,
2735
+ mermaidSvgBase,
2736
+ nativeSelectIconBase,
2737
+ nativeSelectVariants,
2738
+ nativeSelectWrapperBase,
2739
+ navbarActionsBase,
2740
+ navbarActivationAreaBase,
2741
+ navbarBrandBase,
2742
+ navbarContainerBase,
2743
+ navbarDensityVariants,
2744
+ navbarMenuBase,
2745
+ navbarMenuContentBase,
2746
+ navbarMenuIndicatorBase,
2747
+ navbarMenuItemBase,
2748
+ navbarMenuLinkBase,
2749
+ navbarMenuListBase,
2750
+ navbarMenuPlacementVariants,
2751
+ navbarMenuRootBase,
2752
+ navbarMenuTriggerStyle,
2753
+ navbarMenuViewportBase,
2754
+ navbarMenuViewportPositionerBase,
2755
+ navbarMobileActionsBase,
2756
+ navbarMobileBase,
2757
+ navbarMobileContentBase,
2758
+ navbarMobileHeaderBase,
2759
+ navbarMobileMenuBase,
2760
+ navbarMobileMenuContentBase,
2761
+ navbarMobileMenuTriggerBase,
2762
+ navbarShrunkBase,
2763
+ navbarTriggerVariants,
2764
+ navbarVariants,
2765
+ noticeDescriptionBase,
2766
+ noticeTitleBase,
2767
+ noticeVariants,
2768
+ numberInputControlBase,
2769
+ numberInputInputBase,
2770
+ numberInputRootBase,
2771
+ numberInputTriggerBase,
2772
+ pageContentBase,
2773
+ pageFooterBase,
2774
+ pageGutterAreaBase,
2775
+ pageGutterContentVariants,
2776
+ pageGutterVariants,
2777
+ pageSectionBase,
2778
+ pageVariants,
2779
+ paginationEllipsisBase,
2780
+ paginationItemBase,
2781
+ paginationRootBase,
2782
+ paginationTriggerBase,
2783
+ parseYouTubeChapters,
2784
+ placeEditorOverlay,
2785
+ placeEditorOverlayAt,
2786
+ popoverArrowBase,
2787
+ popoverCloseTriggerBase,
2788
+ popoverContentBase,
2789
+ popoverDescriptionBase,
2790
+ popoverIndicatorBase,
2791
+ popoverPositionerBase,
2792
+ popoverTitleBase,
2793
+ prevNextDirectionBase,
2794
+ prevNextLinkBase,
2795
+ prevNextLinkNextBase,
2796
+ prevNextRootBase,
2797
+ prevNextSpacerBase,
2798
+ prevNextTitleBase,
2799
+ proseVariants,
2800
+ questionCardBase,
2801
+ questionCheckButtonBase,
2802
+ questionGroupBase,
2803
+ questionInputBase,
2804
+ questionOptionBase,
2805
+ questionOptionCorrectBase,
2806
+ questionOptionIncorrectBase,
2807
+ questionPromptBase,
2808
+ questionUnitBase,
2809
+ quizHeaderBase,
2810
+ quizResetButtonBase,
2811
+ quizResultBase,
2812
+ quizResultTextBase,
2813
+ quizResultTitleBase,
2814
+ quizRootBase,
2815
+ quizScoreBase,
2816
+ quizSubmitButtonBase,
2817
+ quizTitleBase,
2818
+ radioGroupItemControlBase,
2819
+ radioGroupItemTextBase,
2820
+ radioGroupRootBase,
2821
+ registerImageInsertCallback,
2822
+ registerYouTubeInsertCallback,
2823
+ renderChartSvgString,
2824
+ renderCodeToHtml,
2825
+ renderMermaidSource,
2826
+ resolveMermaidThemeVariables,
2827
+ revealChevronBase,
2828
+ revealContentBase,
2829
+ revealRootBase,
2830
+ revealTriggerBase,
2831
+ rowBase,
2832
+ scrollContentBase,
2833
+ scrollCornerBase,
2834
+ scrollRootBase,
2835
+ scrollScrollbarBase,
2836
+ scrollThumbBase,
2837
+ scrollViewportBase,
2838
+ selectClearTriggerBase,
2839
+ selectContentBase,
2840
+ selectIndicatorBase,
2841
+ selectItemBase,
2842
+ selectItemGroupLabelBase,
2843
+ selectItemIndicatorBase,
2844
+ selectItemTextBase,
2845
+ selectPositionerBase,
2846
+ selectTriggerBase,
2847
+ selectValueBase,
2848
+ sidebarMenuButtonVariants,
2849
+ sidebarStyles,
2850
+ slashCommands,
2851
+ splitterPanelBase,
2852
+ splitterResizeTriggerBase,
2853
+ splitterResizeTriggerIndicatorBase,
2854
+ splitterResizeTriggerSeparatorBase,
2855
+ splitterRootBase,
2856
+ stackBase,
2857
+ switchControlBase,
2858
+ switchLabelBase,
2859
+ switchThumbBase,
2860
+ switchVariants,
2861
+ tabsContentBase,
2862
+ tabsIndicatorBase,
2863
+ tabsIndicatorVariants,
2864
+ tabsListBase,
2865
+ tabsListVariants,
2866
+ tabsRootBase,
2867
+ tabsTriggerBase,
2868
+ tagsInputClearTriggerBase,
2869
+ tagsInputControlBase,
2870
+ tagsInputInputBase,
2871
+ tagsInputItemBase,
2872
+ tagsInputItemDeleteTriggerBase,
2873
+ tagsInputItemInputBase,
2874
+ tagsInputItemTextBase,
2875
+ tagsInputRootBase,
2876
+ textareaBase,
2877
+ toLaTeX,
2878
+ tocIndicatorBase,
2879
+ tocItemBase,
2880
+ tocLinkBase,
2881
+ tocLinkVariants,
2882
+ tocListBase,
2883
+ tocListVariants,
2884
+ tocNavBase,
2885
+ tocSkeletonBase,
2886
+ tocTitleBase,
2887
+ toggleButtonVariants,
2888
+ toggleGroupRootVariants,
2889
+ tooltipArrowBase,
2890
+ tooltipContentBase,
2891
+ tooltipPositionerBase,
2892
+ unregisterImageInsertCallback,
2893
+ unregisterYouTubeInsertCallback,
2894
+ vstackBase,
2895
+ windowBodyBase,
2896
+ windowCloseTriggerBase,
2897
+ windowContentBase,
2898
+ windowControlBase,
2899
+ windowDragTriggerBase,
2900
+ windowHeaderBase,
2901
+ windowPositionerBase,
2902
+ windowResizeTriggerBase,
2903
+ windowStageTriggerBase,
2904
+ windowTitleBase,
2905
+ youtubeChapterButtonBase,
2906
+ youtubeChapterLabelBase,
2907
+ youtubeChapterTimeBase,
2908
+ youtubeChaptersBase,
2909
+ youtubeChaptersChevronBase,
2910
+ youtubeChaptersListBase,
2911
+ youtubeChaptersSummaryBase,
2912
+ youtubeDescriptionBase,
2913
+ youtubeFacadeBase,
2914
+ youtubePlayButtonBase,
2915
+ youtubePlayButtonInnerBase,
2916
+ youtubeRootBase,
2917
+ youtubeTitleBase
2918
+ });