vanilla-breeze 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +9527 -9580
- package/dist/cdn/components/accordion-wc.js +1 -1
- package/dist/cdn/components/activity-feed.js +1 -1
- package/dist/cdn/components/ai-chat.js +6 -6
- package/dist/cdn/components/ai-summary.js +2 -2
- package/dist/cdn/components/analytics-panel.js +2 -2
- package/dist/cdn/components/audio-player.js +4 -4
- package/dist/cdn/components/audio-visualizer.js +2 -2
- package/dist/cdn/components/author-index.js +2 -2
- package/dist/cdn/components/brand-mark.js +1 -1
- package/dist/cdn/components/bread-crumb.js +1 -1
- package/dist/cdn/components/calendar-wc.js +2 -2
- package/dist/cdn/components/card-list.js +1 -1
- package/dist/cdn/components/carousel-wc.js +1 -1
- package/dist/cdn/components/change-set.js +1 -1
- package/dist/cdn/components/chart-wc.js +13 -13
- package/dist/cdn/components/chat-input.js +1 -1
- package/dist/cdn/components/chat-window.js +1 -1
- package/dist/cdn/components/color-picker.js +1 -1
- package/dist/cdn/components/combo-box.js +1 -1
- package/dist/cdn/components/command-palette.js +1 -1
- package/dist/cdn/components/comment-box.js +35 -35
- package/dist/cdn/components/comment-thread.js +38 -38
- package/dist/cdn/components/comment-wc.js +1 -1
- package/dist/cdn/components/compare-surface.js +1 -1
- package/dist/cdn/components/consent-banner.js +1 -1
- package/dist/cdn/components/content-lens.js +1 -1
- package/dist/cdn/components/content-swap.js +1 -1
- package/dist/cdn/components/context-menu.js +1 -1
- package/dist/cdn/components/data-table.js +1 -1
- package/dist/cdn/components/date-picker.js +1 -1
- package/dist/cdn/components/day-view.js +1 -1
- package/dist/cdn/components/diagram-wc.js +2 -2
- package/dist/cdn/components/drag-surface.js +1 -1
- package/dist/cdn/components/drop-down.js +1 -1
- package/dist/cdn/components/emoji-picker.js +1 -1
- package/dist/cdn/components/flow-diagram.js +1 -1
- package/dist/cdn/components/foot-notes.js +1 -1
- package/dist/cdn/components/form-field.js +1 -1
- package/dist/cdn/components/geo-map.js +3 -3
- package/dist/cdn/components/glossary-index.js +1 -1
- package/dist/cdn/components/glossary-wc.js +1 -1
- package/dist/cdn/components/heading-links.js +1 -1
- package/dist/cdn/components/highlight-wc.js +2 -2
- package/dist/cdn/components/icon-wc.js +2 -2
- package/dist/cdn/components/image-gallery.js +1 -1
- package/dist/cdn/components/image-map.js +1 -1
- package/dist/cdn/components/include-file.js +1 -1
- package/dist/cdn/components/manifest.json +60 -56
- package/dist/cdn/components/markdown-editor.js +25 -25
- package/dist/cdn/components/markdown-viewer.js +27 -27
- package/dist/cdn/components/nav-bar.js +1 -1
- package/dist/cdn/components/note-wc.js +2 -2
- package/dist/cdn/components/notification-wc.js +23 -22
- package/dist/cdn/components/page-info.js +6 -6
- package/dist/cdn/components/page-stats.js +1 -1
- package/dist/cdn/components/page-toc.js +1 -1
- package/dist/cdn/components/page-tools.js +1 -1
- package/dist/cdn/components/page-tour.js +1 -1
- package/dist/cdn/components/pager-wc.js +1 -1
- package/dist/cdn/components/poll-wc.js +1 -1
- package/dist/cdn/components/pop-over.js +1 -1
- package/dist/cdn/components/popularity-index.js +1 -1
- package/dist/cdn/components/print-page.js +1 -1
- package/dist/cdn/components/progress-tracker.js +1 -1
- package/dist/cdn/components/qr-code.js +1 -1
- package/dist/cdn/components/reaction-bar.js +1 -1
- package/dist/cdn/components/reading-progress.js +1 -1
- package/dist/cdn/components/recently-visited.js +1 -1
- package/dist/cdn/components/score-card.js +2 -2
- package/dist/cdn/components/selection-menu.js +1 -1
- package/dist/cdn/components/settings-panel.js +6 -6
- package/dist/cdn/components/share-wc.js +2 -2
- package/dist/cdn/components/short-cuts.js +1 -1
- package/dist/cdn/components/site-index.js +1 -1
- package/dist/cdn/components/site-map.js +1 -1
- package/dist/cdn/components/site-search.js +1 -1
- package/dist/cdn/components/slide-accept.js +1 -1
- package/dist/cdn/components/social-embed.js +1 -1
- package/dist/cdn/components/social-links.js +2 -0
- package/dist/cdn/components/split-surface.js +1 -1
- package/dist/cdn/components/star-rating.js +1 -1
- package/dist/cdn/components/status-wc.js +1 -1
- package/dist/cdn/components/stepper-wc.js +1 -1
- package/dist/cdn/components/tab-set.js +1 -1
- package/dist/cdn/components/text-reader.js +2 -2
- package/dist/cdn/components/theme-picker.js +44 -212
- package/dist/cdn/components/time-index.js +1 -1
- package/dist/cdn/components/time-picker.js +1 -1
- package/dist/cdn/components/toast-msg.js +2 -2
- package/dist/cdn/components/tool-tip.js +1 -1
- package/dist/cdn/components/topic-map.js +4 -4
- package/dist/cdn/components/trust-filter.js +1 -1
- package/dist/cdn/components/version-switcher.js +6 -6
- package/dist/cdn/components/video-player.js +4 -4
- package/dist/cdn/components/watch-wc.js +2 -2
- package/dist/cdn/components/week-view.js +1 -1
- package/dist/cdn/components/youtube-player.js +1 -1
- package/dist/cdn/fonts/barlow-condensed-OFL.txt +93 -0
- package/dist/cdn/fonts/barlow-condensed-latin-400-italic.woff2 +0 -0
- package/dist/cdn/fonts/barlow-condensed-latin-400-normal.woff2 +0 -0
- package/dist/cdn/fonts/barlow-condensed-latin-500-normal.woff2 +0 -0
- package/dist/cdn/fonts/barlow-condensed-latin-600-normal.woff2 +0 -0
- package/dist/cdn/fonts/barlow-condensed-latin-700-italic.woff2 +0 -0
- package/dist/cdn/fonts/barlow-condensed-latin-700-normal.woff2 +0 -0
- package/dist/cdn/fonts/barlow-condensed-latin-ext-400-italic.woff2 +0 -0
- package/dist/cdn/fonts/barlow-condensed-latin-ext-400-normal.woff2 +0 -0
- package/dist/cdn/fonts/barlow-condensed-latin-ext-500-normal.woff2 +0 -0
- package/dist/cdn/fonts/barlow-condensed-latin-ext-600-normal.woff2 +0 -0
- package/dist/cdn/fonts/barlow-condensed-latin-ext-700-italic.woff2 +0 -0
- package/dist/cdn/fonts/barlow-condensed-latin-ext-700-normal.woff2 +0 -0
- package/dist/cdn/fonts/big-shoulders-display-OFL.txt +93 -0
- package/dist/cdn/fonts/big-shoulders-display-latin-ext-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/big-shoulders-display-latin-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/caveat-OFL.txt +93 -0
- package/dist/cdn/fonts/caveat-latin-ext-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/caveat-latin-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/courier-prime-OFL.txt +93 -0
- package/dist/cdn/fonts/courier-prime-latin-400-normal.woff2 +0 -0
- package/dist/cdn/fonts/courier-prime-latin-700-normal.woff2 +0 -0
- package/dist/cdn/fonts/courier-prime-latin-ext-400-normal.woff2 +0 -0
- package/dist/cdn/fonts/courier-prime-latin-ext-700-normal.woff2 +0 -0
- package/dist/cdn/fonts/dm-sans-OFL.txt +93 -0
- package/dist/cdn/fonts/dm-sans-latin-ext-wght-italic.woff2 +0 -0
- package/dist/cdn/fonts/dm-sans-latin-ext-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/dm-sans-latin-wght-italic.woff2 +0 -0
- package/dist/cdn/fonts/dm-sans-latin-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/dm-serif-display-OFL.txt +93 -0
- package/dist/cdn/fonts/dm-serif-display-latin-400-italic.woff2 +0 -0
- package/dist/cdn/fonts/dm-serif-display-latin-400-normal.woff2 +0 -0
- package/dist/cdn/fonts/dm-serif-display-latin-ext-400-italic.woff2 +0 -0
- package/dist/cdn/fonts/dm-serif-display-latin-ext-400-normal.woff2 +0 -0
- package/dist/cdn/fonts/exo-2-OFL.txt +93 -0
- package/dist/cdn/fonts/exo-2-latin-ext-wght-italic.woff2 +0 -0
- package/dist/cdn/fonts/exo-2-latin-ext-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/exo-2-latin-wght-italic.woff2 +0 -0
- package/dist/cdn/fonts/exo-2-latin-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/fira-code-OFL.txt +93 -0
- package/dist/cdn/fonts/fira-code-latin-ext-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/fira-code-latin-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/flow-block-OFL.txt +93 -0
- package/dist/cdn/fonts/flow-block-latin-400-normal.woff2 +0 -0
- package/dist/cdn/fonts/flow-block-latin-ext-400-normal.woff2 +0 -0
- package/dist/cdn/fonts/fraunces-OFL.txt +93 -0
- package/dist/cdn/fonts/fraunces-latin-ext-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/fraunces-latin-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/ibm-plex-mono-OFL.txt +93 -0
- package/dist/cdn/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
- package/dist/cdn/fonts/ibm-plex-mono-latin-700-normal.woff2 +0 -0
- package/dist/cdn/fonts/ibm-plex-mono-latin-ext-400-normal.woff2 +0 -0
- package/dist/cdn/fonts/ibm-plex-mono-latin-ext-700-normal.woff2 +0 -0
- package/dist/cdn/fonts/inter-OFL.txt +93 -0
- package/dist/cdn/fonts/inter-latin-ext-wght-italic.woff2 +0 -0
- package/dist/cdn/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/inter-latin-wght-italic.woff2 +0 -0
- package/dist/cdn/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/jetbrains-mono-OFL.txt +93 -0
- package/dist/cdn/fonts/jetbrains-mono-latin-ext-wght-italic.woff2 +0 -0
- package/dist/cdn/fonts/jetbrains-mono-latin-ext-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/jetbrains-mono-latin-wght-italic.woff2 +0 -0
- package/dist/cdn/fonts/jetbrains-mono-latin-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/josefin-sans-OFL.txt +93 -0
- package/dist/cdn/fonts/josefin-sans-latin-ext-wght-italic.woff2 +0 -0
- package/dist/cdn/fonts/josefin-sans-latin-ext-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/josefin-sans-latin-wght-italic.woff2 +0 -0
- package/dist/cdn/fonts/josefin-sans-latin-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/lora-OFL.txt +93 -0
- package/dist/cdn/fonts/lora-latin-ext-wght-italic.woff2 +0 -0
- package/dist/cdn/fonts/lora-latin-ext-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/lora-latin-wght-italic.woff2 +0 -0
- package/dist/cdn/fonts/lora-latin-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/merriweather-OFL.txt +93 -0
- package/dist/cdn/fonts/merriweather-latin-ext-wght-italic.woff2 +0 -0
- package/dist/cdn/fonts/merriweather-latin-ext-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/merriweather-latin-wght-italic.woff2 +0 -0
- package/dist/cdn/fonts/merriweather-latin-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/newsreader-OFL.txt +93 -0
- package/dist/cdn/fonts/newsreader-latin-ext-wght-italic.woff2 +0 -0
- package/dist/cdn/fonts/newsreader-latin-ext-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/newsreader-latin-wght-italic.woff2 +0 -0
- package/dist/cdn/fonts/newsreader-latin-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/nunito-OFL.txt +93 -0
- package/dist/cdn/fonts/nunito-latin-ext-wght-italic.woff2 +0 -0
- package/dist/cdn/fonts/nunito-latin-ext-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/nunito-latin-wght-italic.woff2 +0 -0
- package/dist/cdn/fonts/nunito-latin-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/orbitron-OFL.txt +93 -0
- package/dist/cdn/fonts/orbitron-latin-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/playfair-display-OFL.txt +93 -0
- package/dist/cdn/fonts/playfair-display-latin-ext-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/playfair-display-latin-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/press-start-2p-OFL.txt +93 -0
- package/dist/cdn/fonts/press-start-2p-latin-400-normal.woff2 +0 -0
- package/dist/cdn/fonts/press-start-2p-latin-ext-400-normal.woff2 +0 -0
- package/dist/cdn/fonts/redacted-script-OFL.txt +93 -0
- package/dist/cdn/fonts/redacted-script-latin-300-normal.woff2 +0 -0
- package/dist/cdn/fonts/redacted-script-latin-400-normal.woff2 +0 -0
- package/dist/cdn/fonts/redacted-script-latin-700-normal.woff2 +0 -0
- package/dist/cdn/fonts/redacted-script-latin-ext-300-normal.woff2 +0 -0
- package/dist/cdn/fonts/redacted-script-latin-ext-400-normal.woff2 +0 -0
- package/dist/cdn/fonts/redacted-script-latin-ext-700-normal.woff2 +0 -0
- package/dist/cdn/fonts/shantell-sans-OFL.txt +93 -0
- package/dist/cdn/fonts/shantell-sans-latin-ext-wght-italic.woff2 +0 -0
- package/dist/cdn/fonts/shantell-sans-latin-ext-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/shantell-sans-latin-wght-italic.woff2 +0 -0
- package/dist/cdn/fonts/shantell-sans-latin-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/share-tech-mono-OFL.txt +93 -0
- package/dist/cdn/fonts/share-tech-mono-latin-400-normal.woff2 +0 -0
- package/dist/cdn/fonts/source-code-pro-OFL.txt +93 -0
- package/dist/cdn/fonts/source-code-pro-latin-ext-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/source-code-pro-latin-wght-normal.woff2 +0 -0
- package/dist/cdn/fonts/space-mono-OFL.txt +93 -0
- package/dist/cdn/fonts/space-mono-latin-400-normal.woff2 +0 -0
- package/dist/cdn/fonts/space-mono-latin-700-normal.woff2 +0 -0
- package/dist/cdn/fonts/space-mono-latin-ext-400-normal.woff2 +0 -0
- package/dist/cdn/fonts/space-mono-latin-ext-700-normal.woff2 +0 -0
- package/dist/cdn/fonts/vt323-OFL.txt +93 -0
- package/dist/cdn/fonts/vt323-latin-400-normal.woff2 +0 -0
- package/dist/cdn/fonts/vt323-latin-ext-400-normal.woff2 +0 -0
- package/dist/cdn/packs/effects.full.js +1 -1
- package/dist/cdn/packs/kawaii/fonts/fira-code-latin-ext-wght-normal.woff2 +0 -0
- package/dist/cdn/packs/kawaii/fonts/fira-code-latin-wght-normal.woff2 +0 -0
- package/dist/cdn/packs/kawaii/fonts/nunito-latin-ext-wght-italic.woff2 +0 -0
- package/dist/cdn/packs/kawaii/fonts/nunito-latin-ext-wght-normal.woff2 +0 -0
- package/dist/cdn/packs/kawaii/fonts/nunito-latin-wght-italic.woff2 +0 -0
- package/dist/cdn/packs/kawaii/fonts/nunito-latin-wght-normal.woff2 +0 -0
- package/dist/cdn/packs/kawaii.full.css +1 -1
- package/dist/cdn/packs/kawaii.theme.css +1 -1
- package/dist/cdn/packs/manifest.json +5 -5
- package/dist/cdn/packs/prototype.full.js +1 -1
- package/dist/cdn/packs/ui.full.css +1 -1
- package/dist/cdn/packs/ui.full.js +44 -212
- package/dist/cdn/themes/8bit.css +1 -1
- package/dist/cdn/themes/8bit.tokens.json +8 -37
- package/dist/cdn/themes/alpha1999-dark.tokens.json +1 -1
- package/dist/cdn/themes/alpha1999.css +1 -1
- package/dist/cdn/themes/alpha1999.tokens.json +3 -6
- package/dist/cdn/themes/art-deco-dark.tokens.json +3 -27
- package/dist/cdn/themes/art-deco.css +1 -1
- package/dist/cdn/themes/art-deco.tokens.json +5 -11
- package/dist/cdn/themes/bauhaus-dark.tokens.json +1 -1
- package/dist/cdn/themes/bauhaus.css +1 -1
- package/dist/cdn/themes/bauhaus.tokens.json +13 -7
- package/dist/cdn/themes/brutalist-dark.tokens.json +3 -27
- package/dist/cdn/themes/brutalist.tokens.json +5 -11
- package/dist/cdn/themes/catppuccin-frappe.css +1 -1
- package/dist/cdn/themes/catppuccin-frappe.tokens.json +1 -1
- package/dist/cdn/themes/catppuccin-latte-dark.tokens.json +1 -1
- package/dist/cdn/themes/catppuccin-latte.css +1 -1
- package/dist/cdn/themes/catppuccin-latte.tokens.json +1 -1
- package/dist/cdn/themes/catppuccin-macchiato.css +1 -1
- package/dist/cdn/themes/catppuccin-macchiato.tokens.json +1 -1
- package/dist/cdn/themes/catppuccin-mocha.css +1 -1
- package/dist/cdn/themes/catppuccin-mocha.tokens.json +1 -1
- package/dist/cdn/themes/classic-dark.tokens.json +41 -41
- package/dist/cdn/themes/classic.tokens.json +25 -31
- package/dist/cdn/themes/claymorphism-dark.tokens.json +533 -161
- package/dist/cdn/themes/claymorphism.css +1 -1
- package/dist/cdn/themes/claymorphism.tokens.json +531 -135
- package/dist/cdn/themes/clinical-dark.tokens.json +1 -1
- package/dist/cdn/themes/clinical.tokens.json +1 -1
- package/dist/cdn/themes/cottagecore-dark.tokens.json +1 -1
- package/dist/cdn/themes/cottagecore.css +1 -1
- package/dist/cdn/themes/cottagecore.tokens.json +1 -1
- package/dist/cdn/themes/cyber.css +1 -1
- package/dist/cdn/themes/cyber.tokens.json +5 -11
- package/dist/cdn/themes/dawn-dark.tokens.json +3 -27
- package/dist/cdn/themes/dawn.css +1 -1
- package/dist/cdn/themes/dawn.tokens.json +1 -1
- package/dist/cdn/themes/dracula.css +1 -1
- package/dist/cdn/themes/dracula.tokens.json +1 -1
- package/dist/cdn/themes/dusk.css +1 -1
- package/dist/cdn/themes/dusk.tokens.json +10 -1
- package/dist/cdn/themes/editorial-dark.tokens.json +1 -1
- package/dist/cdn/themes/editorial.css +1 -1
- package/dist/cdn/themes/editorial.tokens.json +19 -16
- package/dist/cdn/themes/financial-dark.tokens.json +1 -1
- package/dist/cdn/themes/financial.css +1 -1
- package/dist/cdn/themes/financial.tokens.json +1 -1
- package/dist/cdn/themes/genai.css +1 -1
- package/dist/cdn/themes/genai.tokens.json +1 -1
- package/dist/cdn/themes/glassmorphism-dark.tokens.json +233 -116
- package/dist/cdn/themes/glassmorphism.css +1 -1
- package/dist/cdn/themes/glassmorphism.tokens.json +233 -116
- package/dist/cdn/themes/government-dark.tokens.json +1 -1
- package/dist/cdn/themes/government.tokens.json +1 -1
- package/dist/cdn/themes/gruvbox-dark.tokens.json +1 -1
- package/dist/cdn/themes/gruvbox.css +1 -1
- package/dist/cdn/themes/gruvbox.tokens.json +3 -2
- package/dist/cdn/themes/high-noon-dark.tokens.json +1 -1
- package/dist/cdn/themes/high-noon.css +1 -1
- package/dist/cdn/themes/high-noon.tokens.json +10 -1
- package/dist/cdn/themes/journal-dark.tokens.json +3 -27
- package/dist/cdn/themes/journal.css +1 -1
- package/dist/cdn/themes/journal.tokens.json +21 -21
- package/dist/cdn/themes/kawaii-dark.tokens.json +1 -1
- package/dist/cdn/themes/kawaii.css +1 -1
- package/dist/cdn/themes/kawaii.tokens.json +1 -1
- package/dist/cdn/themes/magna-dark.tokens.json +1 -1
- package/dist/cdn/themes/magna.css +1 -1
- package/dist/cdn/themes/magna.tokens.json +2 -14
- package/dist/cdn/themes/manifest.json +37 -37
- package/dist/cdn/themes/midnight.css +1 -1
- package/dist/cdn/themes/midnight.tokens.json +9 -1
- package/dist/cdn/themes/minimal-dark.tokens.json +1 -1
- package/dist/cdn/themes/minimal.tokens.json +25 -27
- package/dist/cdn/themes/modern-dark.tokens.json +41 -41
- package/dist/cdn/themes/modern.css +1 -1
- package/dist/cdn/themes/modern.tokens.json +21 -21
- package/dist/cdn/themes/nes-dark.tokens.json +3 -27
- package/dist/cdn/themes/nes.css +1 -1
- package/dist/cdn/themes/nes.tokens.json +10 -39
- package/dist/cdn/themes/neumorphism-dark.tokens.json +266 -134
- package/dist/cdn/themes/neumorphism.css +1 -1
- package/dist/cdn/themes/neumorphism.tokens.json +266 -134
- package/dist/cdn/themes/nord-dark.tokens.json +3 -27
- package/dist/cdn/themes/nord.css +1 -1
- package/dist/cdn/themes/nord.tokens.json +3 -2
- package/dist/cdn/themes/organic-dark.tokens.json +1 -1
- package/dist/cdn/themes/organic.css +1 -1
- package/dist/cdn/themes/organic.tokens.json +5 -14
- package/dist/cdn/themes/rose-pine-dark.tokens.json +1 -1
- package/dist/cdn/themes/rose-pine.css +1 -1
- package/dist/cdn/themes/rose-pine.tokens.json +3 -2
- package/dist/cdn/themes/rough-dark.tokens.json +1 -1
- package/dist/cdn/themes/rough.css +1 -1
- package/dist/cdn/themes/rough.tokens.json +1 -1
- package/dist/cdn/themes/solarized-dark.tokens.json +1 -1
- package/dist/cdn/themes/solarized.css +1 -1
- package/dist/cdn/themes/solarized.tokens.json +1 -1
- package/dist/cdn/themes/startup-dark.tokens.json +1 -1
- package/dist/cdn/themes/startup.css +1 -1
- package/dist/cdn/themes/startup.tokens.json +1 -1
- package/dist/cdn/themes/super2026-dark.tokens.json +6 -30
- package/dist/cdn/themes/super2026.css +1 -1
- package/dist/cdn/themes/super2026.tokens.json +1 -1
- package/dist/cdn/themes/swiss-dark.tokens.json +4 -40
- package/dist/cdn/themes/swiss.tokens.json +34 -68
- package/dist/cdn/themes/terminal.css +1 -1
- package/dist/cdn/themes/terminal.tokens.json +286 -120
- package/dist/cdn/themes/tokyo-night-dark.tokens.json +3 -27
- package/dist/cdn/themes/tokyo-night.css +1 -1
- package/dist/cdn/themes/tokyo-night.tokens.json +3 -2
- package/dist/cdn/themes/vaporwave-dark.tokens.json +3 -27
- package/dist/cdn/themes/vaporwave.css +1 -1
- package/dist/cdn/themes/vaporwave.tokens.json +9 -1
- package/dist/cdn/themes/win9x-dark.tokens.json +5 -29
- package/dist/cdn/themes/win9x.tokens.json +9 -9
- package/dist/cdn/vanilla-breeze-autoload.js +113 -107
- package/dist/cdn/vanilla-breeze-charts.js +13 -13
- package/dist/cdn/vanilla-breeze-core.css +1 -1
- package/dist/cdn/vanilla-breeze-core.js +86 -80
- package/dist/cdn/vanilla-breeze-dev.css +1 -1
- package/dist/cdn/vanilla-breeze-extras.js +33 -33
- package/dist/cdn/vanilla-breeze.css +1 -1
- package/dist/cdn/vanilla-breeze.js +158 -325
- package/package.json +2 -2
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
var
|
|
2
|
-
]`).replace("lheading",fe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ze=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
|
|
3
|
-
`).map(
|
|
4
|
-
`)}var
|
|
1
|
+
var Vt=window.matchMedia("(prefers-reduced-motion: reduce)");var se=new Map;function ie(r,e,t={}){let s=t.priority??10,n={impl:e,bundle:t.bundle,contract:t.contract,priority:s},a=se.get(r);if(customElements.get(r)){if(!a||a.priority>=s){a&&a.priority===s&&a.impl!==e&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${a.bundle}" (priority ${a.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> defined by "${a.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(a&&a.priority>=s){a.priority===s&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${a.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}se.set(r,n),customElements.define(r,e)}var z=class extends HTMLElement{#r=[];#t;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let e of this.#r)e();this.#r=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,s,n){e.addEventListener(t,s,n),this.#r.push(()=>e.removeEventListener(t,s,n))}_reinit(){for(let e of this.#r)e();this.#r=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,t){this.#t||(this.#t=this.attachInternals());let s=this.#t.states;try{t?s.add(e):s.delete(e)}catch{let n=`--${e}`;t?s.add(n):s.delete(n)}}_adoptInternals(e){this.#t||(this.#t=e)}#e(){return this.constructor.formAssociated&&this.#t?this.#t:null}get validity(){return this.#e()?.validity}get validationMessage(){return this.#e()?.validationMessage??""}get willValidate(){return this.#e()?.willValidate??!1}get form(){return this.#e()?.form??null}checkValidity(){return this.#e()?.checkValidity()??!0}reportValidity(){return this.#e()?.reportValidity()??!0}};function U(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var A=U();function pe(r){A=r}var S={exec:()=>null};function h(r,e=""){let t=typeof r=="string"?r:r.source,s={replace:(n,a)=>{let i=typeof a=="string"?a:a.source;return i=i.replace(b.caret,"$1"),t=t.replace(n,i),s},getRegex:()=>new RegExp(t,e)};return s}var Ce=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),b={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}>`)},ze=/^(?:[ \t]*(?:\n|$))+/,_e=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ie=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,C=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Pe=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Z=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,de=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,fe=h(de).replace(/bull/g,Z).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Me=h(de).replace(/bull/g,Z).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),F=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Be=/^[^\n]+/,Q=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,qe=h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Q).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),De=h(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Z).getRegex(),B="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",W=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Oe=h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",W).replace("tag",B).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ge=h(F).replace("hr",C).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",B).getRegex(),He=h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ge).getRegex(),N={blockquote:He,code:_e,def:qe,fences:Ie,heading:Pe,hr:C,html:Oe,lheading:fe,list:De,newline:ze,paragraph:ge,table:S,text:Be},ae=h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",C).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",B).getRegex(),je={...N,lheading:Me,table:ae,paragraph:h(F).replace("hr",C).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ae).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",B).getRegex()},Ue={...N,html:h(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",W).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:S,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:h(F).replace("hr",C).replace("heading",` *#{1,6} *[^
|
|
2
|
+
]`).replace("lheading",fe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ze=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Fe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ke=/^( {2,}|\\)\n(?!\s*$)/,Qe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,T=/[\p{P}\p{S}]/u,q=/[\s\p{P}\p{S}]/u,V=/[^\s\p{P}\p{S}]/u,We=h(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,q).getRegex(),be=/(?!~)[\p{P}\p{S}]/u,Ne=/(?!~)[\s\p{P}\p{S}]/u,Ve=/(?:[^\s\p{P}\p{S}]|~)/u,Ge=h(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ce?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),me=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Xe=h(me,"u").replace(/punct/g,T).getRegex(),Ke=h(me,"u").replace(/punct/g,be).getRegex(),xe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Je=h(xe,"gu").replace(/notPunctSpace/g,V).replace(/punctSpace/g,q).replace(/punct/g,T).getRegex(),Ye=h(xe,"gu").replace(/notPunctSpace/g,Ve).replace(/punctSpace/g,Ne).replace(/punct/g,be).getRegex(),et=h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,V).replace(/punctSpace/g,q).replace(/punct/g,T).getRegex(),tt=h(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,T).getRegex(),rt="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",nt=h(rt,"gu").replace(/notPunctSpace/g,V).replace(/punctSpace/g,q).replace(/punct/g,T).getRegex(),st=h(/\\(punct)/,"gu").replace(/punct/g,T).getRegex(),it=h(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),at=h(W).replace("(?:-->|$)","-->").getRegex(),lt=h("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",at).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),I=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,ot=h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",I).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),we=h(/^!?\[(label)\]\[(ref)\]/).replace("label",I).replace("ref",Q).getRegex(),ye=h(/^!?\[(ref)\](?:\[\])?/).replace("ref",Q).getRegex(),ct=h("reflink|nolink(?!\\()","g").replace("reflink",we).replace("nolink",ye).getRegex(),le=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,G={_backpedal:S,anyPunctuation:st,autolink:it,blockSkip:Ge,br:ke,code:Fe,del:S,delLDelim:S,delRDelim:S,emStrongLDelim:Xe,emStrongRDelimAst:Je,emStrongRDelimUnd:et,escape:Ze,link:ot,nolink:ye,punctuation:We,reflink:we,reflinkSearch:ct,tag:lt,text:Qe,url:S},ut={...G,link:h(/^!?\[(label)\]\((.*?)\)/).replace("label",I).getRegex(),reflink:h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",I).getRegex()},O={...G,emStrongRDelimAst:Ye,emStrongLDelim:Ke,delLDelim:tt,delRDelim:nt,url:h(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",le).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:h(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",le).getRegex()},ht={...O,br:h(ke).replace("{2,}","*").getRegex(),text:h(O.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},_={normal:N,gfm:je,pedantic:Ue},R={normal:G,gfm:O,breaks:ht,pedantic:ut},pt={"&":"&","<":"<",">":">",'"':""","'":"'"},oe=r=>pt[r];function w(r,e){if(e){if(b.escapeTest.test(r))return r.replace(b.escapeReplace,oe)}else if(b.escapeTestNoEncode.test(r))return r.replace(b.escapeReplaceNoEncode,oe);return r}function ce(r){try{r=encodeURI(r).replace(b.percentDecode,"%")}catch{return null}return r}function ue(r,e){let t=r.replace(b.findPipe,(a,i,o)=>{let l=!1,u=i;for(;--u>=0&&o[u]==="\\";)l=!l;return l?"|":" |"}),s=t.split(b.splitPipe),n=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;n<s.length;n++)s[n]=s[n].trim().replace(b.slashPipe,"|");return s}function E(r,e,t){let s=r.length;if(s===0)return"";let n=0;for(;n<s;){let a=r.charAt(s-n-1);if(a===e&&!t)n++;else if(a!==e&&t)n++;else break}return r.slice(0,s-n)}function dt(r,e){if(r.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<r.length;s++)if(r[s]==="\\")s++;else if(r[s]===e[0])t++;else if(r[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}function ft(r,e=0){let t=e,s="";for(let n of r)if(n===" "){let a=4-t%4;s+=" ".repeat(a),t+=a}else s+=n,t++;return s}function he(r,e,t,s,n){let a=e.href,i=e.title||null,o=r[1].replace(n.other.outputLinkReplace,"$1");s.state.inLink=!0;let l={type:r[0].charAt(0)==="!"?"image":"link",raw:t,href:a,title:i,text:o,tokens:s.inlineTokens(o)};return s.state.inLink=!1,l}function gt(r,e,t){let s=r.match(t.other.indentCodeCompensation);if(s===null)return e;let n=s[1];return e.split(`
|
|
3
|
+
`).map(a=>{let i=a.match(t.other.beginningSpace);if(i===null)return a;let[o]=i;return o.length>=n.length?a.slice(n.length):a}).join(`
|
|
4
|
+
`)}var P=class{options;rules;lexer;constructor(r){this.options=r||A}space(r){let e=this.rules.block.newline.exec(r);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(r){let e=this.rules.block.code.exec(r);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:E(t,`
|
|
5
5
|
`)}}}fences(r){let e=this.rules.block.fences.exec(r);if(e){let t=e[0],s=gt(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(r){let e=this.rules.block.heading.exec(r);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let s=E(t,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(t=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(r){let e=this.rules.block.hr.exec(r);if(e)return{type:"hr",raw:E(e[0],`
|
|
6
6
|
`)}}blockquote(r){let e=this.rules.block.blockquote.exec(r);if(e){let t=E(e[0],`
|
|
7
7
|
`).split(`
|
|
8
|
-
`),s="",n="",
|
|
9
|
-
`),c=
|
|
8
|
+
`),s="",n="",a=[];for(;t.length>0;){let i=!1,o=[],l;for(l=0;l<t.length;l++)if(this.rules.other.blockquoteStart.test(t[l]))o.push(t[l]),i=!0;else if(!i)o.push(t[l]);else break;t=t.slice(l);let u=o.join(`
|
|
9
|
+
`),c=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
10
10
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
11
|
-
${
|
|
12
|
-
${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,
|
|
11
|
+
${u}`:u,n=n?`${n}
|
|
12
|
+
${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,a,!0),this.lexer.state.top=d,t.length===0)break;let p=a.at(-1);if(p?.type==="code")break;if(p?.type==="blockquote"){let k=p,g=k.raw+`
|
|
13
13
|
`+t.join(`
|
|
14
|
-
`),y=this.blockquote(g);
|
|
14
|
+
`),y=this.blockquote(g);a[a.length-1]=y,s=s.substring(0,s.length-k.raw.length)+y.raw,n=n.substring(0,n.length-k.text.length)+y.text;break}else if(p?.type==="list"){let k=p,g=k.raw+`
|
|
15
15
|
`+t.join(`
|
|
16
|
-
`),y=this.list(g);
|
|
17
|
-
`);continue}}return{type:"blockquote",raw:s,tokens:
|
|
16
|
+
`),y=this.list(g);a[a.length-1]=y,s=s.substring(0,s.length-p.raw.length)+y.raw,n=n.substring(0,n.length-k.raw.length)+y.raw,t=g.substring(a.at(-1).raw.length).split(`
|
|
17
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:a,text:n}}}list(r){let e=this.rules.block.list.exec(r);if(e){let t=e[1].trim(),s=t.length>1,n={type:"list",raw:"",ordered:s,start:s?+t.slice(0,-1):"",loose:!1,items:[]};t=s?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=s?t:"[*+-]");let a=this.rules.other.listItemRegex(t),i=!1;for(;r;){let l=!1,u="",c="";if(!(e=a.exec(r))||this.rules.block.hr.test(r))break;u=e[0],r=r.substring(u.length);let d=ft(e[2].split(`
|
|
18
18
|
`,1)[0],e[1].length),p=r.split(`
|
|
19
|
-
`,1)[0],k=!d.trim(),g=0;if(this.options.pedantic?(g=2,c=d.trimStart()):k?g=e[1].length+1:(g=d.search(this.rules.other.nonSpaceChar),g=g>4?1:g,c=d.slice(g),g+=e[1].length),k&&this.rules.other.blankLine.test(p)&&(
|
|
20
|
-
`,r=r.substring(p.length+1),
|
|
21
|
-
`,1)[0],
|
|
22
|
-
`+
|
|
23
|
-
`+p}k=!p.trim(),
|
|
24
|
-
`,r=r.substring(
|
|
25
|
-
`):[],
|
|
26
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(r){let e=this.rules.block.text.exec(r);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(r){let e=this.rules.inline.escape.exec(r);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(r){let e=this.rules.inline.tag.exec(r);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(r){let e=this.rules.inline.link.exec(r);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let
|
|
19
|
+
`,1)[0],k=!d.trim(),g=0;if(this.options.pedantic?(g=2,c=d.trimStart()):k?g=e[1].length+1:(g=d.search(this.rules.other.nonSpaceChar),g=g>4?1:g,c=d.slice(g),g+=e[1].length),k&&this.rules.other.blankLine.test(p)&&(u+=p+`
|
|
20
|
+
`,r=r.substring(p.length+1),l=!0),!l){let y=this.rules.other.nextBulletRegex(g),te=this.rules.other.hrRegex(g),re=this.rules.other.fencesBeginRegex(g),ne=this.rules.other.headingBeginRegex(g),Ee=this.rules.other.htmlBeginRegex(g),Le=this.rules.other.blockquoteBeginRegex(g);for(;r;){let D=r.split(`
|
|
21
|
+
`,1)[0],v;if(p=D,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),v=p):v=p.replace(this.rules.other.tabCharGlobal," "),re.test(p)||ne.test(p)||Ee.test(p)||Le.test(p)||y.test(p)||te.test(p))break;if(v.search(this.rules.other.nonSpaceChar)>=g||!p.trim())c+=`
|
|
22
|
+
`+v.slice(g);else{if(k||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||re.test(d)||ne.test(d)||te.test(d))break;c+=`
|
|
23
|
+
`+p}k=!p.trim(),u+=D+`
|
|
24
|
+
`,r=r.substring(D.length+1),d=v.slice(g)}}n.loose||(i?n.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(i=!0)),n.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),n.raw+=u}let o=n.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let l of n.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let u=this.rules.other.listTaskCheckbox.exec(l.raw);if(u){let c={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};l.checked=c.checked,n.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=c.raw+l.tokens[0].raw,l.tokens[0].text=c.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(c)):l.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):l.tokens.unshift(c)}}if(!n.loose){let u=l.tokens.filter(d=>d.type==="space"),c=u.length>0&&u.some(d=>this.rules.other.anyLine.test(d.raw));n.loose=c}}if(n.loose)for(let l of n.items){l.loose=!0;for(let u of l.tokens)u.type==="text"&&(u.type="paragraph")}return n}}html(r){let e=this.rules.block.html.exec(r);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(r){let e=this.rules.block.def.exec(r);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:s,title:n}}}table(r){let e=this.rules.block.table.exec(r);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=ue(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
25
|
+
`):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===s.length){for(let i of s)this.rules.other.tableAlignRight.test(i)?a.align.push("right"):this.rules.other.tableAlignCenter.test(i)?a.align.push("center"):this.rules.other.tableAlignLeft.test(i)?a.align.push("left"):a.align.push(null);for(let i=0;i<t.length;i++)a.header.push({text:t[i],tokens:this.lexer.inline(t[i]),header:!0,align:a.align[i]});for(let i of n)a.rows.push(ue(i,a.header.length).map((o,l)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:a.align[l]})));return a}}lheading(r){let e=this.rules.block.lheading.exec(r);if(e){let t=e[1].trim();return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:t,tokens:this.lexer.inline(t)}}}paragraph(r){let e=this.rules.block.paragraph.exec(r);if(e){let t=e[1].charAt(e[1].length-1)===`
|
|
26
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(r){let e=this.rules.block.text.exec(r);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(r){let e=this.rules.inline.escape.exec(r);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(r){let e=this.rules.inline.tag.exec(r);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(r){let e=this.rules.inline.link.exec(r);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let a=E(t.slice(0,-1),"\\");if((t.length-a.length)%2===0)return}else{let a=dt(e[2],"()");if(a===-2)return;if(a>-1){let i=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,i).trim(),e[3]=""}}let s=e[2],n="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(s);a&&(s=a[1],n=a[3])}else n=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?s=s.slice(1):s=s.slice(1,-1)),he(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(r,e){let t;if((t=this.rules.inline.reflink.exec(r))||(t=this.rules.inline.nolink.exec(r))){let s=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=e[s.toLowerCase()];if(!n){let a=t[0].charAt(0);return{type:"text",raw:a,text:a}}return he(t,n,t[0],this.lexer,this.rules)}}emStrong(r,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(r);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!t||this.rules.inline.punctuation.exec(t))){let n=[...s[0]].length-1,a,i,o=n,l=0,u=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*r.length+n);(s=u.exec(e))!==null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(i=[...a].length,s[3]||s[4]){o+=i;continue}else if((s[5]||s[6])&&n%3&&!((n+i)%3)){l+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o+l);let c=[...s[0]][0].length,d=r.slice(0,n+s.index+c+i);if(Math.min(n,i)%2){let k=d.slice(1,-1);return{type:"em",raw:d,text:k,tokens:this.lexer.inlineTokens(k)}}let p=d.slice(2,-2);return{type:"strong",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(r){let e=this.rules.inline.code.exec(r);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(t),n=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return s&&n&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(r){let e=this.rules.inline.br.exec(r);if(e)return{type:"br",raw:e[0]}}del(r,e,t=""){let s=this.rules.inline.delLDelim.exec(r);if(s&&(!s[1]||!t||this.rules.inline.punctuation.exec(t))){let n=[...s[0]].length-1,a,i,o=n,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*r.length+n);(s=l.exec(e))!==null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a||(i=[...a].length,i!==n))continue;if(s[3]||s[4]){o+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o);let u=[...s[0]][0].length,c=r.slice(0,n+s.index+u+i),d=c.slice(n,-n);return{type:"del",raw:c,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(r){let e=this.rules.inline.autolink.exec(r);if(e){let t,s;return e[2]==="@"?(t=e[1],s="mailto:"+t):(t=e[1],s=t),{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}url(r){let e;if(e=this.rules.inline.url.exec(r)){let t,s;if(e[2]==="@")t=e[0],s="mailto:"+t;else{let n;do n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(n!==e[0]);t=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(r){let e=this.rules.inline.text.exec(r);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},m=class H{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||A,this.options.tokenizer=this.options.tokenizer||new P,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:b,block:_.normal,inline:R.normal};this.options.pedantic?(t.block=_.pedantic,t.inline=R.pedantic):this.options.gfm&&(t.block=_.gfm,this.options.breaks?t.inline=R.breaks:t.inline=R.gfm),this.tokenizer.rules=t}static get rules(){return{block:_,inline:R}}static lex(e,t){return new H(t).lex(e)}static lexInline(e,t){return new H(t).inlineTokens(e)}lex(e){e=e.replace(b.carriageReturn,`
|
|
27
27
|
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(b.tabCharGlobal," ").replace(b.spaceLine,""));e;){let n;if(this.options.extensions?.block?.some(i=>(n=i.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);let i=t.at(-1);n.raw.length===1&&i!==void 0?i.raw+=`
|
|
28
28
|
`:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);let i=t.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
|
29
29
|
`)?"":`
|
|
@@ -31,31 +31,31 @@ ${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
31
31
|
`+n.text,this.inlineQueue.at(-1).src=i.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length);let i=t.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
|
32
32
|
`)?"":`
|
|
33
33
|
`)+n.raw,i.text+=`
|
|
34
|
-
`+n.raw,this.inlineQueue.at(-1).src=i.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title},t.push(n));continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}let
|
|
34
|
+
`+n.raw,this.inlineQueue.at(-1).src=i.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title},t.push(n));continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}let a=e;if(this.options.extensions?.startBlock){let i=1/0,o=e.slice(1),l;this.options.extensions.startBlock.forEach(u=>{l=u.call({lexer:this},o),typeof l=="number"&&l>=0&&(i=Math.min(i,l))}),i<1/0&&i>=0&&(a=e.substring(0,i+1))}if(this.state.top&&(n=this.tokenizer.paragraph(a))){let i=t.at(-1);s&&i?.type==="paragraph"?(i.raw+=(i.raw.endsWith(`
|
|
35
35
|
`)?"":`
|
|
36
36
|
`)+n.raw,i.text+=`
|
|
37
|
-
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(n),s=
|
|
37
|
+
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(n),s=a.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);let i=t.at(-1);i?.type==="text"?(i.raw+=(i.raw.endsWith(`
|
|
38
38
|
`)?"":`
|
|
39
39
|
`)+n.raw,i.text+=`
|
|
40
|
-
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(n);continue}if(e){let i="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let s=e,n=null;if(this.tokens.links){let
|
|
40
|
+
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(n);continue}if(e){let i="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let s=e,n=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(s))!==null;)l.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(s))!==null;)s=s.slice(0,n.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(n=this.tokenizer.rules.inline.blockSkip.exec(s))!==null;)a=n[2]?n[2].length:0,s=s.slice(0,n.index+a)+"["+"a".repeat(n[0].length-a-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let i=!1,o="";for(;e;){i||(o=""),i=!1;let l;if(this.options.extensions?.inline?.some(c=>(l=c.call({lexer:this},e,t))?(e=e.substring(l.raw.length),t.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let c=t.at(-1);l.type==="text"&&c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):t.push(l);continue}if(l=this.tokenizer.emStrong(e,s,o)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.del(e,s,o)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),t.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),t.push(l);continue}let u=e;if(this.options.extensions?.startInline){let c=1/0,d=e.slice(1),p;this.options.extensions.startInline.forEach(k=>{p=k.call({lexer:this},d),typeof p=="number"&&p>=0&&(c=Math.min(c,p))}),c<1/0&&c>=0&&(u=e.substring(0,c+1))}if(l=this.tokenizer.inlineText(u)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(o=l.raw.slice(-1)),i=!0;let c=t.at(-1);c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):t.push(l);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return t}},M=class{options;parser;constructor(r){this.options=r||A}space(r){return""}code({text:r,lang:e,escaped:t}){let s=(e||"").match(b.notSpaceStart)?.[0],n=r.replace(b.endingNewline,"")+`
|
|
41
41
|
`;return s?'<pre><code class="language-'+w(s)+'">'+(t?n:w(n,!0))+`</code></pre>
|
|
42
42
|
`:"<pre><code>"+(t?n:w(n,!0))+`</code></pre>
|
|
43
43
|
`}blockquote({tokens:r}){return`<blockquote>
|
|
44
44
|
${this.parser.parse(r)}</blockquote>
|
|
45
45
|
`}html({text:r}){return r}def(r){return""}heading({tokens:r,depth:e}){return`<h${e}>${this.parser.parseInline(r)}</h${e}>
|
|
46
46
|
`}hr(r){return`<hr>
|
|
47
|
-
`}list(r){let e=r.ordered,t=r.start,s="";for(let i=0;i<r.items.length;i++){let o=r.items[i];s+=this.listitem(o)}let n=e?"ol":"ul",
|
|
47
|
+
`}list(r){let e=r.ordered,t=r.start,s="";for(let i=0;i<r.items.length;i++){let o=r.items[i];s+=this.listitem(o)}let n=e?"ol":"ul",a=e&&t!==1?' start="'+t+'"':"";return"<"+n+a+`>
|
|
48
48
|
`+s+"</"+n+`>
|
|
49
49
|
`}listitem(r){return`<li>${this.parser.parse(r.tokens)}</li>
|
|
50
50
|
`}checkbox({checked:r}){return"<input "+(r?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:r}){return`<p>${this.parser.parseInline(r)}</p>
|
|
51
|
-
`}table(r){let e="",t="";for(let n=0;n<r.header.length;n++)t+=this.tablecell(r.header[n]);e+=this.tablerow({text:t});let s="";for(let n=0;n<r.rows.length;n++){let
|
|
51
|
+
`}table(r){let e="",t="";for(let n=0;n<r.header.length;n++)t+=this.tablecell(r.header[n]);e+=this.tablerow({text:t});let s="";for(let n=0;n<r.rows.length;n++){let a=r.rows[n];t="";for(let i=0;i<a.length;i++)t+=this.tablecell(a[i]);s+=this.tablerow({text:t})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
52
52
|
<thead>
|
|
53
53
|
`+e+`</thead>
|
|
54
54
|
`+s+`</table>
|
|
55
55
|
`}tablerow({text:r}){return`<tr>
|
|
56
56
|
${r}</tr>
|
|
57
57
|
`}tablecell(r){let e=this.parser.parseInline(r.tokens),t=r.header?"th":"td";return(r.align?`<${t} align="${r.align}">`:`<${t}>`)+e+`</${t}>
|
|
58
|
-
`}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${w(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:e,tokens:t}){let s=this.parser.parseInline(t),n=ce(r);if(n===null)return s;r=n;let
|
|
59
|
-
Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error occurred:</p><pre>"+w(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}}
|
|
60
|
-
`}},
|
|
58
|
+
`}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${w(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:e,tokens:t}){let s=this.parser.parseInline(t),n=ce(r);if(n===null)return s;r=n;let a='<a href="'+r+'"';return e&&(a+=' title="'+w(e)+'"'),a+=">"+s+"</a>",a}image({href:r,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));let n=ce(r);if(n===null)return w(t);r=n;let a=`<img src="${r}" alt="${w(t)}"`;return e&&(a+=` title="${w(e)}"`),a+=">",a}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:w(r.text)}},X=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}checkbox({raw:r}){return r}},x=class j{options;renderer;textRenderer;constructor(e){this.options=e||A,this.options.renderer=this.options.renderer||new M,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new X}static parse(e,t){return new j(t).parse(e)}static parseInline(e,t){return new j(t).parseInline(e)}parse(e){this.renderer.parser=this;let t="";for(let s=0;s<e.length;s++){let n=e[s];if(this.options.extensions?.renderers?.[n.type]){let i=n,o=this.options.extensions.renderers[i.type].call({parser:this},i);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(i.type)){t+=o||"";continue}}let a=n;switch(a.type){case"space":{t+=this.renderer.space(a);break}case"hr":{t+=this.renderer.hr(a);break}case"heading":{t+=this.renderer.heading(a);break}case"code":{t+=this.renderer.code(a);break}case"table":{t+=this.renderer.table(a);break}case"blockquote":{t+=this.renderer.blockquote(a);break}case"list":{t+=this.renderer.list(a);break}case"checkbox":{t+=this.renderer.checkbox(a);break}case"html":{t+=this.renderer.html(a);break}case"def":{t+=this.renderer.def(a);break}case"paragraph":{t+=this.renderer.paragraph(a);break}case"text":{t+=this.renderer.text(a);break}default:{let i='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let s="";for(let n=0;n<e.length;n++){let a=e[n];if(this.options.extensions?.renderers?.[a.type]){let o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){s+=o||"";continue}}let i=a;switch(i.type){case"escape":{s+=t.text(i);break}case"html":{s+=t.html(i);break}case"link":{s+=t.link(i);break}case"image":{s+=t.image(i);break}case"checkbox":{s+=t.checkbox(i);break}case"strong":{s+=t.strong(i);break}case"em":{s+=t.em(i);break}case"codespan":{s+=t.codespan(i);break}case"br":{s+=t.br(i);break}case"del":{s+=t.del(i);break}case"text":{s+=t.text(i);break}default:{let o='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}},L=class{options;block;constructor(r){this.options=r||A}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}emStrongMask(r){return r}provideLexer(r=this.block){return r?m.lex:m.lexInline}provideParser(r=this.block){return r?x.parse:x.parseInline}},K=class{defaults=U();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=x;Renderer=M;TextRenderer=X;Lexer=m;Tokenizer=P;Hooks=L;constructor(...r){this.use(...r)}walkTokens(r,e){let t=[];for(let s of r)switch(t=t.concat(e.call(this,s)),s.type){case"table":{let n=s;for(let a of n.header)t=t.concat(this.walkTokens(a.tokens,e));for(let a of n.rows)for(let i of a)t=t.concat(this.walkTokens(i.tokens,e));break}case"list":{let n=s;t=t.concat(this.walkTokens(n.items,e));break}default:{let n=s;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(a=>{let i=n[a].flat(1/0);t=t.concat(this.walkTokens(i,e))}):n.tokens&&(t=t.concat(this.walkTokens(n.tokens,e)))}}return t}use(...r){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return r.forEach(t=>{let s={...t};if(s.async=this.defaults.async||s.async||!1,t.extensions&&(t.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let a=e.renderers[n.name];a?e.renderers[n.name]=function(...i){let o=n.renderer.apply(this,i);return o===!1&&(o=a.apply(this,i)),o}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=e[n.level];a?a.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),s.extensions=e),t.renderer){let n=this.defaults.renderer||new M(this.defaults);for(let a in t.renderer){if(!(a in n))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let i=a,o=t.renderer[i],l=n[i];n[i]=(...u)=>{let c=o.apply(n,u);return c===!1&&(c=l.apply(n,u)),c||""}}s.renderer=n}if(t.tokenizer){let n=this.defaults.tokenizer||new P(this.defaults);for(let a in t.tokenizer){if(!(a in n))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let i=a,o=t.tokenizer[i],l=n[i];n[i]=(...u)=>{let c=o.apply(n,u);return c===!1&&(c=l.apply(n,u)),c}}s.tokenizer=n}if(t.hooks){let n=this.defaults.hooks||new L;for(let a in t.hooks){if(!(a in n))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let i=a,o=t.hooks[i],l=n[i];L.passThroughHooks.has(a)?n[i]=u=>{if(this.defaults.async&&L.passThroughHooksRespectAsync.has(a))return(async()=>{let d=await o.call(n,u);return l.call(n,d)})();let c=o.call(n,u);return l.call(n,c)}:n[i]=(...u)=>{if(this.defaults.async)return(async()=>{let d=await o.apply(n,u);return d===!1&&(d=await l.apply(n,u)),d})();let c=o.apply(n,u);return c===!1&&(c=l.apply(n,u)),c}}s.hooks=n}if(t.walkTokens){let n=this.defaults.walkTokens,a=t.walkTokens;s.walkTokens=function(i){let o=[];return o.push(a.call(this,i)),n&&(o=o.concat(n.call(this,i))),o}}this.defaults={...this.defaults,...s}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,e){return m.lex(r,e??this.defaults)}parser(r,e){return x.parse(r,e??this.defaults)}parseMarkdown(r){return(e,t)=>{let s={...t},n={...this.defaults,...s},a=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&s.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=r),n.async)return(async()=>{let i=n.hooks?await n.hooks.preprocess(e):e,o=await(n.hooks?await n.hooks.provideLexer(r):r?m.lex:m.lexInline)(i,n),l=n.hooks?await n.hooks.processAllTokens(o):o;n.walkTokens&&await Promise.all(this.walkTokens(l,n.walkTokens));let u=await(n.hooks?await n.hooks.provideParser(r):r?x.parse:x.parseInline)(l,n);return n.hooks?await n.hooks.postprocess(u):u})().catch(a);try{n.hooks&&(e=n.hooks.preprocess(e));let i=(n.hooks?n.hooks.provideLexer(r):r?m.lex:m.lexInline)(e,n);n.hooks&&(i=n.hooks.processAllTokens(i)),n.walkTokens&&this.walkTokens(i,n.walkTokens);let o=(n.hooks?n.hooks.provideParser(r):r?x.parse:x.parseInline)(i,n);return n.hooks&&(o=n.hooks.postprocess(o)),o}catch(i){return a(i)}}}onError(r,e){return t=>{if(t.message+=`
|
|
59
|
+
Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error occurred:</p><pre>"+w(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},$=new K;function f(r,e){return $.parse(r,e)}f.options=f.setOptions=function(r){return $.setOptions(r),f.defaults=$.defaults,pe(f.defaults),f};f.getDefaults=U;f.defaults=A;f.use=function(...r){return $.use(...r),f.defaults=$.defaults,pe(f.defaults),f};f.walkTokens=function(r,e){return $.walkTokens(r,e)};f.parseInline=$.parseInline;f.Parser=x;f.parser=x.parse;f.Renderer=M;f.TextRenderer=X;f.Lexer=m;f.lexer=m.lex;f.Tokenizer=P;f.Hooks=L;f.parse=f;var Kt=f.options,Jt=f.setOptions,Yt=f.use,er=f.walkTokens,tr=f.parseInline;var rr=x.parse,nr=m.lex;var kt="http://www.w3.org/1999/xhtml",J="http://www.w3.org/2000/svg",bt="http://www.w3.org/1998/Math/MathML",mt=new Set([kt,J,bt]),Y="user-content-",xt=new Set(["script","iframe","frame","frameset","object","embed","applet","portal","fencedframe","form","base","link","meta","noscript","foreignobject","style","xmp","noembed","noframes","plaintext","mglyph","malignmark","annotation-xml"]),$e=new Set(["title","desc"]),wt=new Set(["animate","set","animatemotion","animatetransform"]),yt=new Set(["href","xlink:href","action","formaction","data","codebase","cite","background","longdesc","manifest","to","from","values","by"]),St=new Set(["src","poster","srcset"]),$t=new Set(["srcdoc","form","formaction","formmethod","formtarget","formenctype","formnovalidate","action","method","ping"]),At=new Set(["popovertarget","popovertargetaction","commandfor","command","interestfor","autofocus"]),Tt=new Set(["for","headers","list","aria-labelledby","aria-describedby","aria-controls","aria-owns","aria-flowto","aria-details","aria-errormessage","aria-activedescendant"]),vt={"include-file":["trusted","allow-scripts","allow-cross-origin"],"markdown-viewer":["src","sanitize","ping","allow-cross-origin"]},Rt=new Set(["social-embed","youtube-player","geo-map"]),Et=["src","src-dark","data-src","url","endpoint","tile-url","data-versions"],Lt=new Set(["audio-player","video-player","image-map","brand-mark"]);function Ct(r){return String(r).replace(/[\u0000- \u007f-\u009f]/g,"").toLowerCase()}function Se(r,e=!1){let t=Ct(r);return e?/(^|,)(javascript|vbscript|livescript):/.test(t)?!0:/(^|,)data:/.test(t)?t.split(/(?=data:)/).filter(n=>n.startsWith("data:")).some(n=>!/^data:(image|audio|video|font)\//.test(n)):!1:/^(javascript|vbscript|livescript|data):/.test(t)}function Ae(r){let e=String(r).replace(/\/\*[\s\S]*?\*\//g,"").replace(/\\/g,"").replace(/\s+/g,"").toLowerCase();return/expression\(|javascript:|vbscript:|-moz-binding|behavior:|@import|position:fixed/.test(e)}var zt=r=>String(r.localName||r.tagName||"").toLowerCase(),_t=r=>r.startsWith(Y)?r:Y+r;function It(r,e){if(xt.has(e))return!0;let t=r.namespaceURI;return!!(t&&!mt.has(t)||e==="title"&&t!==J||$e.has(e)&&t===J&&r.children?.length||wt.has(e)&&(r.getAttribute("attributeName")||r.getAttribute("attributename")||"").toLowerCase().includes("href"))}function Pt(r,e){for(let t of[...r.attributes]){let s=t.name.toLowerCase();if(s.startsWith("on")||$t.has(s)||!e.keepIds&&At.has(s)){r.removeAttribute(t.name);continue}if(s==="style"){(!e.keepStyle||Ae(t.value))&&r.removeAttribute(t.name);continue}if((s==="id"||s==="name")&&!e.keepIds){let n=_t(t.value);s==="id"?e.ids.set(t.value,n):e.ids.set(`name:${t.value}`,n),r.setAttribute(t.name,n);continue}if(yt.has(s)||s.endsWith(":href")){Se(t.value,!1)&&r.removeAttribute(t.name);continue}St.has(s)&&Se(t.value,!0)&&r.removeAttribute(t.name)}}function Mt(r,e){let t=(r.getAttribute("type")||"").toLowerCase();e==="button"&&t!=="button"&&r.setAttribute("type","button"),e==="input"&&/^(submit|reset|image)$/.test(t)&&r.setAttribute("type","button")}function Bt(r,e){for(let t of r)for(let s of[...t.attributes]){let n=s.name.toLowerCase(),a=s.value;if((n==="href"||n.endsWith(":href"))&&a.startsWith("#")){let i=qt(a.slice(1));e.has(i)&&t.setAttribute(s.name,`#${e.get(i)}`)}else if(n==="usemap"&&a.startsWith("#")){let i=e.get(`name:${a.slice(1)}`);i?t.setAttribute(s.name,`#${i}`):t.removeAttribute(s.name)}else if(Tt.has(n)){let i=a.split(/\s+/).filter(Boolean).map(o=>e.get(o)||(o.startsWith(Y)?o:null)).filter(Boolean);i.length?t.setAttribute(s.name,i.join(" ")):t.removeAttribute(s.name)}else a.includes("url(#")&&t.setAttribute(s.name,a.replace(/url\(#([^)]+)\)/g,(i,o)=>e.has(o)?`url(#${e.get(o)})`:i))}}function qt(r){try{return decodeURIComponent(r)}catch{return r}}function Te(r){let e=r.childNodes;if(e)for(let t of[...e])t.nodeType===8?t.remove():(t.nodeType===1||t.nodeType===11)&&Te(t)}function ve(r,e){Te(r);let t=[...r.querySelectorAll("*")];e.includeRoot&&t.unshift(r);let s=new Map,n=[],a={...e,ids:s};for(let i of t){if(!Ot(i,r))continue;let o=zt(i);if(e.svgOnly&&($e.has(o)||o==="style")){if(o==="style"&&Ae(i.textContent||"")){i.remove();continue}}else if(It(i,o)){i.remove();continue}if(!e.keepIds&&!e.svgOnly&&Rt.has(o)){Dt(i);continue}if(o==="template"){let u=i.content;u&&ve(u,{...e,includeRoot:!1})}Pt(i,a),e.keepIds||Mt(i,o);let l=vt[o];if(l)for(let u of l)i.removeAttribute(u);if(o==="include-file"&&!e.allowIncludeFile&&i.removeAttribute("src"),!e.keepIds&&!e.svgOnly&&o.includes("-")&&o!=="include-file"&&!Lt.has(o))for(let u of Et)i.removeAttribute(u);n.push(i)}!e.keepIds&&s.size&&Bt(n,s)}function Dt(r){let e=r.parentNode;if(e){for(let t of[...r.childNodes])e.insertBefore(t,r);r.remove()}}function Ot(r,e){let t=r;for(;t;){if(t===e)return!0;t=t.parentNode??t.parent??null}return!1}function Re(r,e={}){let t=document.createElement("template");return r&&typeof r=="string"&&(t.innerHTML=r,ve(t.content,{allowIncludeFile:!!e.allowIncludeFile,keepIds:!!e.keepIds,keepStyle:!!e.keepStyle})),t.content}var Ht="Failed to load markdown",jt=/^:::[ \t]*(note|info|tip|warning|danger)(?:[ \t]+([^\n]*?))?[ \t]*\n([\s\S]*?)\n?^:::[ \t]*(?:\n+|$)/m,Ut=r=>r.replace(/[&<>"']/g,e=>`&#${e.charCodeAt(0)};`),Zt={name:"vbCallout",level:"block",start(r){return r.match(/^:::[ \t]*(?:note|info|tip|warning|danger)\b/m)?.index},tokenizer(r){let e=jt.exec(r);if(!e||e.index!==0)return;let t=e[1],s=(e[2]||"").trim()||t[0].toUpperCase()+t.slice(1),n={type:"vbCallout",raw:e[0],kind:t,title:s,tokens:[]};return this.lexer.blockTokens(e[3],n.tokens),n},renderer(r){return`<aside data-callout="${r.kind}" role="note"><p data-callout-title><strong>${Ut(r.title)}</strong></p>${this.parser.parse(r.tokens)}</aside>
|
|
60
|
+
`}},Ft=new K({gfm:!0,extensions:[Zt]}),ee=class extends z{#r=null;#t=null;#e=null;#l=null;#n=null;#o=null;#s=0;static get observedAttributes(){return["src","sanitize","allow-cross-origin"]}setup(){this.#i()}teardown(){this.#t?.abort(),this.removeAttribute("data-rendered"),this.removeAttribute("data-loading")}attributeChangedCallback(e,t,s){t===s||!this.isConnected||!this.hasAttribute("data-upgraded")||this.#i()}get parser(){return this.#r}set parser(e){this.#r=typeof e=="function"?e:null}get markdown(){return this.#n??this.#o??""}set markdown(e){let t=e==null?null:String(e);this.#n!==t&&(this.#n=t,this.#i())}async render(){await this.#i()}async reload(){this.getAttribute("src")&&await this.#i()}#h(){let e=this.querySelector('script[type="text/markdown"]');if(e)return e.textContent;let t=this.querySelector("template[data-md]");if(t)return t.content.textContent;let s=this.querySelector(":scope > pre");return s?s.textContent:null}#p(e){let t;try{t=new URL(e,document.baseURI)}catch{throw new Error(`Invalid URL: ${e}`)}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new Error(`Refused ${t.protocol} URL: only http(s) is allowed`);return this.#c(t.href),t.href}#c(e){if(!this.hasAttribute("allow-cross-origin")&&new URL(e).origin!==location.origin)throw new Error(`Refused cross-origin URL ${e} (add allow-cross-origin to permit)`)}async#i(){let e=++this.#s,t=this.getAttribute("src"),s;if(this.#t?.abort(),this.#t=null,this.removeAttribute("data-rendered"),this.removeAttribute("data-error"),this.removeAttribute("data-loading"),this.#l?.remove(),this.#l=null,t){let i=new AbortController;this.#t=i,this.setAttribute("data-loading",""),this.#a("markdown-viewer:fetch",{src:t});try{let o=this.#p(t),l=await fetch(o,{signal:i.signal});if(l.url&&this.#c(l.url),!l.ok)throw new Error(`HTTP ${l.status}: ${l.statusText}`);s=await l.text()}catch(o){if(o.name==="AbortError"||e!==this.#s)return;this.#u(o);return}if(e!==this.#s)return;this.removeAttribute("data-loading")}else this.#n!=null?s=this.#n:s=this.#h();if(s==null){this.#e?.replaceChildren();return}this.#o=s;let n;try{n=await(await this.#d())(s)}catch(i){if(e!==this.#s)return;this.#u(i);return}if(e!==this.#s)return;(!this.#e||this.#e.parentNode!==this)&&(this.#e=document.createElement("div"),this.#e.className="md-content",this.#e.setAttribute("part","content"),this.appendChild(this.#e)),this.hasAttribute("dir")?this.#e.removeAttribute("dir"):this.#e.setAttribute("dir","auto"),this.#f()?this.#e.replaceChildren(Re(String(n??""))):this.#e.innerHTML=String(n??""),this.#g(),this.setAttribute("data-rendered","");let a=this.getAttribute("ping");if(a&&navigator.sendBeacon?.(a,JSON.stringify({src:t||"inline"})),this.#a("markdown-viewer:rendered",{src:t,node:this.#e}),this.hasAttribute("highlight"))for(let i of this.#e.querySelectorAll('pre > code[class*="language-"]')){let o=i.className.match(/language-(\S+)/)?.[1]||"";this.#a("markdown-viewer:highlight",{node:i,language:o})}}#u(e){if(this.removeAttribute("data-loading"),this.setAttribute("data-error",""),this.#e?.replaceChildren(),!this.querySelector(":scope > pre")){let t=document.createElement("p");t.setAttribute("role","alert"),t.setAttribute("data-md-error",""),t.textContent=this.getAttribute("data-label-error")||Ht,this.append(t),this.#l=t}this.#a("markdown-viewer:error",{error:e.message})}async#d(){return this.#r?this.#r:e=>Ft.parse(e)}#f(){let e=this.getAttribute("sanitize");return e==null?!0:!/^(off|false)$/i.test(e.trim())}#g(){if(!this.#e)return;let e=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;e&&(this.#e.dataset.theme=e)}#a(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}};ie("markdown-viewer",ee);export{ee as MarkdownViewer};
|
|
61
61
|
//# sourceMappingURL=markdown-viewer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var A=window.matchMedia("(prefers-reduced-motion: reduce)");var m=new Map;function g(s,t,
|
|
1
|
+
var A=window.matchMedia("(prefers-reduced-motion: reduce)");var m=new Map;function g(s,t,r={}){let e=r.priority??10,n={impl:t,bundle:r.bundle,contract:r.contract,priority:e},i=m.get(s);if(customElements.get(s)){if(!i||i.priority>=e){i&&i.priority===e&&i.impl!==t&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${r.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${r.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=e){i.priority===e&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${i.bundle}". Skipping "${r.bundle}" (first wins at equal priority).`);return}m.set(s,n),customElements.define(s,t)}var h=class extends HTMLElement{#e=[];#t;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#e)t();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,r,e,n){t.addEventListener(r,e,n),this.#e.push(()=>t.removeEventListener(r,e,n))}_reinit(){for(let t of this.#e)t();this.#e=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,r){this.#t||(this.#t=this.attachInternals());let e=this.#t.states;try{r?e.add(t):e.delete(t)}catch{let n=`--${t}`;r?e.add(n):e.delete(n)}}_adoptInternals(t){this.#t||(this.#t=t)}#r(){return this.constructor.formAssociated&&this.#t?this.#t:null}get validity(){return this.#r()?.validity}get validationMessage(){return this.#r()?.validationMessage??""}get willValidate(){return this.#r()?.willValidate??!1}get form(){return this.#r()?.form??null}checkValidity(){return this.#r()?.checkValidity()??!0}reportValidity(){return this.#r()?.reportValidity()??!0}};var b=class extends h{#e=null;#t=!1;#r=null;setup(){!this.hasAttribute("role")&&!this.querySelector("nav")&&this.setAttribute("role","navigation"),this.#n("pathname"),this.listen(window,"popstate",this.#o);let t=window.navigation;t&&typeof t.addEventListener=="function"&&this.listen(t,"currententrychange",this.#a)}get items(){return this.#e?this.#e.map(t=>({...t})):Array.from(this.#i()).map(t=>({href:t.getAttribute("href")||"",label:t.textContent?.trim()||""}))}set items(t){if(!Array.isArray(t))return;let r=t.map(e=>({...e}));this.#e&&this.#f(this.#e,r)||(this.#e=r,this.#l(r),this.#t?this.#s(this.#r):this.#n("pathname"),this.dispatchEvent(new CustomEvent("nav-bar:items-changed",{detail:{items:this.items,source:"property"},bubbles:!0,composed:!0})))}get current(){if(this.#t)return this.#r;for(let t of this.#i())if(t.getAttribute("aria-current")==="page")return t.getAttribute("data-route")||t.getAttribute("href")||null;return null}set current(t){let r=this.current,e=t==null?null:String(t);this.#t=!0,this.#r=e,this.#s(e),r!==e&&this.dispatchEvent(new CustomEvent("nav-bar:current-changed",{detail:{current:e,previous:r,source:"property"},bubbles:!0,composed:!0}))}releaseCurrent(){this.#t&&(this.#t=!1,this.#r=null,this.#n("pathname"))}refresh(){this.#t||this.#n("pathname")}#i(){let t=this.querySelectorAll("a[data-nav-link]");return t.length>0?t:this.querySelectorAll(":scope > a")}#o=()=>{this.#t||this.#n("popstate")};#a=()=>{queueMicrotask(()=>{this.#t||!this.isConnected||this.#n("navigation")})};#n(t){let r=this.current,e=this.#c();this.#s(e),e==null&&this.#u(),r!==e&&this.dispatchEvent(new CustomEvent("nav-bar:current-changed",{detail:{current:e,previous:r,source:t},bubbles:!0,composed:!0}))}#c(){let t=p(window.location.pathname),r=window.location.origin,e=Array.from(this.#i());if(e.length===0)return null;let n=this.getAttribute("data-match")==="exact",i=null,o=null,d=-1;for(let l of e){let u=l.getAttribute("href");if(!u||u.startsWith("#"))continue;let c;try{c=new URL(u,document.baseURI)}catch{continue}if(!/^https?:$/.test(c.protocol)||c.origin!==r)continue;let a=p(c.pathname);if(a===t){i==null&&(i=l);continue}!n&&a!=="/"&&t.startsWith(a+"/")&&a.length>d&&(o=l,d=a.length)}let f=i||o;return f?f.getAttribute("data-route")||f.getAttribute("href"):null}#u(){let t=p(window.location.pathname),r=window.location.origin,e=this.getAttribute("data-match")==="exact",n=null,i=-1;for(let o of this.querySelectorAll("a[data-nav-link]")){let d=o.closest("drop-down, li");if(!(!d||!this.contains(d)))for(let f of d.querySelectorAll("a[href]:not([data-nav-link])")){let l=f.getAttribute("href");if(!l||l.startsWith("#"))continue;let u;try{u=new URL(l,document.baseURI)}catch{continue}if(!/^https?:$/.test(u.protocol)||u.origin!==r)continue;let c=p(u.pathname),a=-1;c===t?a=Number.MAX_SAFE_INTEGER:!e&&c!=="/"&&t.startsWith(c+"/")&&(a=c.length),a>i&&(n=o,i=a)}}n&&n.setAttribute("aria-current","true")}#s(t){let r=this.#i();for(let e of r){let n=e.getAttribute("data-route")||e.getAttribute("href");t!=null&&n===t?e.setAttribute("aria-current","page"):e.removeAttribute("aria-current")}}#l(t){this.querySelectorAll(":scope > a").forEach(n=>n.remove());let r=this.querySelector("a[data-nav-link]")!=null,e=document.createDocumentFragment();for(let n of t){let i=this.#d(n);r&&i.setAttribute("data-nav-link",""),e.appendChild(i)}this.appendChild(e)}#d(t){let r=document.createElement("a"),e=y(t.href);if(e!=null&&r.setAttribute("href",e),t.route&&r.setAttribute("data-route",t.route),t.external&&(r.target="_blank",r.rel="noopener noreferrer"),t.icon){let n=document.createElement("icon-wc");n.setAttribute("name",String(t.icon)),n.setAttribute("size","sm"),r.appendChild(n)}if(r.appendChild(document.createTextNode(t.label||"")),t.external){let n=document.createElement("span");n.className="sr-only",n.textContent=` ${this.getAttribute("data-label-new-tab")??"(opens in new tab)"}`,r.appendChild(n)}if(t.badge!=null){let n=document.createElement("span");n.className="badge",n.textContent=String(t.badge),r.appendChild(n)}return r}#f(t,r){if(t.length!==r.length)return!1;for(let e=0;e<t.length;e++){let n=Object.keys(t[e]).sort(),i=Object.keys(r[e]).sort();if(n.length!==i.length)return!1;for(let o=0;o<n.length;o++)if(n[o]!==i[o]||t[e][n[o]]!==r[e][i[o]])return!1}return!0}};function p(s){let t=s.replace(/\/+$/,"");return t===""?"/":t}function y(s){if(s==null||s==="")return"#";let t=String(s),r;try{r=new URL(t,document.baseURI)}catch{return null}return/^https?:$/.test(r.protocol)?t:null}g("nav-bar",b);export{b as NavBar};
|
|
2
2
|
//# sourceMappingURL=nav-bar.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
1
|
+
var w=class extends HTMLElement{#t=[];#n;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,n,s){t.addEventListener(e,n,s),this.#t.push(()=>t.removeEventListener(e,n,s))}_reinit(){for(let t of this.#t)t();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,e){this.#n||(this.#n=this.attachInternals());let n=this.#n.states;try{e?n.add(t):n.delete(t)}catch{let s=`--${t}`;e?n.add(s):n.delete(s)}}_adoptInternals(t){this.#n||(this.#n=t)}#i(){return this.constructor.formAssociated&&this.#n?this.#n:null}get validity(){return this.#i()?.validity}get validationMessage(){return this.#i()?.validationMessage??""}get willValidate(){return this.#i()?.willValidate??!1}get form(){return this.#i()?.form??null}checkValidity(){return this.#i()?.checkValidity()??!0}reportValidity(){return this.#i()?.reportValidity()??!0}};var St=window.matchMedia("(prefers-reduced-motion: reduce)");var F=new Map;function I(i,t,e={}){let n=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:n},r=F.get(i);if(customElements.get(i)){if(!r||r.priority>=n){r&&r.priority===n&&r.impl!==t&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=n){r.priority===n&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${r.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}F.set(i,s),customElements.define(i,t)}function nt(){let i=globalThis.localStorage;if(!i)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(t){return i.getItem(t)},async setRaw(t,e){i.setItem(t,e)},async removeRaw(t){i.removeItem(t)},async keys(t){let e=[];for(let n=0;n<i.length;n++){let s=i.key(n);s&&s.startsWith(t)&&e.push(s)}return e}}}var x="__vbStoreBackend",S=globalThis;function p(){return S[x]||(S[x]=nt()),S[x]}function O(i,t){if(typeof i!="string"||!i)throw new TypeError("VBStore: namespace must be a non-empty string");if(typeof t!="string"||!t)throw new TypeError("VBStore: key must be a non-empty string");return`vb:${i}:${t}`}function N(i){if(typeof i!="string"||!i)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${i}:`}function q(i){try{let t=JSON.parse(i);if(t&&typeof t=="object"&&typeof t.timestamp=="number")return t}catch{}return null}var v={configure(i={}){S[x]=i.backend??null},async set(i,t,e){let n={data:e,timestamp:Date.now()};await p().setRaw(O(i,t),JSON.stringify(n))},async get(i,t,e){let n=await p().getRaw(O(i,t));if(n==null)return null;let s=q(n);return!s||e?.maxAge!=null&&Date.now()-s.timestamp>e.maxAge?null:s.data},async remove(i,t){await p().removeRaw(O(i,t))},async list(i){let t=N(i),e=await p().keys(t),n=[];for(let s of e){let r=await p().getRaw(s);if(r==null)continue;let o=q(r);o&&n.push({key:s.slice(t.length),data:o.data,timestamp:o.timestamp})}return n},async clear(i){let t=N(i),e=await p().keys(t);for(let n of e)await p().removeRaw(n)},async clearAll(){let i=await p().keys("vb:");for(let t of i)await p().removeRaw(t)},async setMany(i,t){for(let[e,n]of t)await v.set(i,e,n)}};if(typeof window<"u"){let i=window.VB??(window.VB={});i.store??=v}var it=["position:absolute","inline-size:1px","block-size:1px","padding:0","margin:-1px","overflow:hidden","clip-path:inset(50%)","white-space:nowrap","border:0"].join(";"),D=new WeakMap;function st(i,t){let e=D.get(t);e||D.set(t,e=new Map);let n=e.get(i);if(!n||!n.region.isConnected){let r=(t.ownerDocument||document).createElement("span");r.setAttribute("data-vb-announcer",i),r.setAttribute("role",i==="assertive"?"alert":"status"),r.setAttribute("aria-live",i),r.setAttribute("aria-atomic","true"),r.style.cssText=it,t.appendChild(r),n={region:r},e.set(i,n)}return n}function A(i,{politeness:t="polite",root:e}={}){let n=String(i??"").trim();if(!n||typeof document>"u")return null;let s=e||document.body;if(!s)return null;let o=st(t==="assertive"?"assertive":"polite",s);return clearTimeout(o.write),clearTimeout(o.clear),o.region.textContent="",o.write=setTimeout(()=>{o.region.textContent=n,o.clear=setTimeout(()=>{o.region.textContent=""},7e3)},50),o.region}var V=i=>i.replace(/\s+/g,""),rt=i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function ot(i,t){let e=0;for(;e<i.length&&e<t.length&&i[i.length-1-e]===t[t.length-1-e];)e++;return e}function at(i,t){let e=0;for(;e<i.length&&e<t.length&&i[e]===t[e];)e++;return e}function C(i,t,e){return{prefix:i.slice(Math.max(0,t-32),t),suffix:i.slice(e,e+32)}}function j(i,t){let e=V(t.text??"");if(!e)return null;if(t.endOffset<=i.length&&V(i.slice(t.startOffset,t.endOffset))===e)return{start:t.startOffset,end:t.endOffset};let n=new RegExp(t.text.trim().split(/\s+/).map(rt).join("\\s*"),"g"),s=t.prefix??"",r=t.suffix??"",o=null,a=-1,l=1/0;for(let c of i.matchAll(n)){let d=c.index,f=d+c[0].length,u=C(i,d,f),g=ot(u.prefix,s)+at(u.suffix,r),h=Math.abs(d-t.startOffset);(g>a||g===a&&h<l)&&(o={start:d,end:f},a=g,l=h)}return o}var R="[data-highlights]",X="highlights",ct=["yellow","green","blue","pink"];var lt=typeof CSS<"u"&&"highlights"in CSS,$=new WeakMap;function U(i){let t=2166136261;for(let e=0;e<i.length;e++)t^=i.charCodeAt(e),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function J(){return"hn-"+crypto.randomUUID().slice(0,8)}var dt=/^[a-z0-9_-]+$/i,G=["solid","double","dotted","dashed","wavy"],ht={annotation:"You highlighted",added:"Highlight added",removed:"Highlight removed",noteSaved:"Note saved"};function k(i,t){let e="highlightsLabel"+t[0].toUpperCase()+t.slice(1);return i.dataset[e]||ht[t]}function ut(i,{textLength:t,colors:e}){if(!i||typeof i!="object")return null;let n=i,{startOffset:s,endOffset:r,color:o}=n;if(!Number.isInteger(s)||!Number.isInteger(r))return null;let a=s,l=r;return a<0||l<=a||l>t||!M(o)||!e.includes(o)||n.id!=null&&(typeof n.id!="string"||!/^[\w-]{1,64}$/.test(n.id))||n.text!=null&&typeof n.text!="string"||n.note!=null&&typeof n.note!="string"||n.prefix!=null&&typeof n.prefix!="string"||n.suffix!=null&&typeof n.suffix!="string"?null:{id:n.id||J(),startOffset:a,endOffset:l,text:n.text??"",prefix:(n.prefix??"").slice(-32),suffix:(n.suffix??"").slice(0,32),color:o,note:n.note??"",created:Number.isFinite(n.created)?n.created:Date.now()}}function M(i){return typeof i=="string"&&dt.test(i)}var m=null,b=new Map,E=new Map;function Q(){if(b.size===0){m&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(n=>n!==m),m=null);return}m||(m=new CSSStyleSheet,document.adoptedStyleSheets=[...document.adoptedStyleSheets,m]);let i=[...b.keys()],t=i.map(n=>`::highlight(hn-${n}) { background-color: var(--highlight-${n}); color: var(--highlight-${n}-ink, var(--highlight-ink, CanvasText)); text-decoration-line: underline; text-decoration-color: var(--highlight-${n}); text-underline-offset: 2px; }`),e=i.map((n,s)=>`::highlight(hn-${n}) { background-color: Mark; color: MarkText; text-decoration-line: underline; text-decoration-color: MarkText; text-decoration-style: ${G[s%G.length]}; text-decoration-thickness: 2px; }`);m.replaceSync(`${t.join(`
|
|
2
2
|
`)}
|
|
3
3
|
@media (forced-colors: active) {
|
|
4
4
|
${e.join(`
|
|
5
5
|
`)}
|
|
6
|
-
}`)}function st(s){for(let t of s)m.set(t,(m.get(t)??0)+1);X()}function ot(s){for(let t of s){let e=(m.get(t)??0)-1;e>0?m.set(t,e):m.delete(t)}X()}function rt(s){let t=w.get(s),e=t?[...t.values()].flat():[];e.length===0?(CSS.highlights.delete(`hn-${s}`),w.delete(s)):CSS.highlights.set(`hn-${s}`,new Highlight(...e))}function V(s,t){let e=new Set(t.keys());for(let[n,i]of w)i.has(s)&&e.add(n);for(let n of e){let i=t.get(n)??[],o=w.get(n);i.length?(o||w.set(n,o=new Map),o.set(s,i)):o?.delete(s),rt(n)}}function j(s,t,e){let n=document.createTreeWalker(s,NodeFilter.SHOW_TEXT),i=0;for(;n.nextNode();){if(n.currentNode===t)return i+e;i+=(n.currentNode.textContent??"").length}return-1}function k(s,t,e){let n=document.createTreeWalker(s,NodeFilter.SHOW_TEXT),i=0,o=null,r=0,l=null,c=0;for(;n.nextNode();){let a=n.currentNode,h=(a.textContent??"").length;if(!o&&i+h>t&&(o=a,r=t-i),i+h>=e){l=a,c=e-i;break}i+=h}if(!o||!l)return null;try{let a=document.createRange();return a.setStart(o,Math.min(r,(o.textContent??"").length)),a.setEnd(l,Math.min(c,(l.textContent??"").length)),a}catch{return null}}var T=class{#t;#n;#i;#f;#e=[];#r=!tt;#s;#g;#a=!1;#h=[];#o=new Map;constructor(t){this.#t=t,this.#f=t.hasAttribute("data-highlights-readonly");let e=t.dataset.highlights;this.#n=e&&e!==""?e:location.pathname;let n=t.dataset.highlightsColors,i=n?n.split(",").map(o=>o.trim()).filter(L):[...Z];this.#i=[...new Set(i)],this.#r||st(this.#i),this.#u(),this.#f||(this.#s=this.#p.bind(this),this.#g=this.#c.bind(this),t.addEventListener("pointerup",this.#s),t.addEventListener("click",this.#g)),t.setAttribute("data-highlights-init",""),this.#S().then(()=>{this.#a||this.#u()})}get colors(){return[...this.#i]}get destroyed(){return this.#a}get element(){return this.#t}getHighlights(){return this.#e.map(t=>({...t}))}removeHighlight(t){let e=this.#e.findIndex(n=>n.id===t);e<0||(this.#e.splice(e,1),this.#d(),this.#u(),this.#l("highlights:removed",{id:t}),A(x(this.#t,"removed")))}clearAll(){this.#e=[],this.#d(),this.#u()}exportHighlights(){return JSON.stringify({version:1,highlights:this.#e})}importHighlights(t){let e;try{e=typeof t=="string"?JSON.parse(t):t}catch{return{imported:0,rejected:0}}if(!e||!Array.isArray(e.highlights))return{imported:0,rejected:0};let n=this.#m(e.highlights);return this.#e=n,this.#d(),this.#u(),{imported:n.length,rejected:e.highlights.length-n.length}}#m(t){let e={textLength:(this.#t.textContent??"").length,colors:this.#i},n=new Set,i=[];for(let o of t){let r=it(o,e);!r||n.has(r.id)||(n.add(r.id),i.push(r))}return i}destroy(){this.#a||(this.#a=!0,this.#s&&this.#t.removeEventListener("pointerup",this.#s),this.#g&&this.#t.removeEventListener("click",this.#g),this.#r?this.#t.querySelectorAll("mark[data-hn-id]").forEach(t=>{let e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t),e.normalize()}):(V(this,new Map),ot(this.#i)),this.#b(),this.#o.clear(),this.#t.removeAttribute("data-highlights-init"),O.get(this.#t)===this&&O.delete(this.#t))}#p(){requestAnimationFrame(()=>{if(this.#a)return;let t=window.getSelection();if(!t||t.isCollapsed||!t.toString().trim())return;let e=t.getRangeAt(0);this.#t.contains(e.commonAncestorContainer)&&this.#l("highlights:selected",{text:t.toString().trim(),rect:e.getBoundingClientRect()})})}#c(t){let e=t.target.closest?.(".hn-margin-annotation");if(e){let i=e.dataset.hnId,o=this.#e.find(r=>r.id===i);if(o){this.#l("highlights:clicked",{id:i,highlight:{...o}}),this.#l("highlights:request-note",{id:i,highlight:{...o},controller:this});return}}let n=t.target.closest?.("mark[data-hn-id]");if(n){let i=n.dataset.hnId,o=this.#e.find(r=>r.id===i);if(o){this.#l("highlights:clicked",{id:i,highlight:{...o}});return}}if(!this.#r){let i=this.#E(t.clientX,t.clientY);i&&this.#l("highlights:clicked",{id:i.id,highlight:{...i}})}}findHighlightRect(t){let e=this.#e.find(o=>o.id===t);if(!e)return null;let n=this.#w(e);if(!n)return null;let i=n.getClientRects();return i.length?i[0]:null}#w(t){return this.#o.get(t.id)??k(this.#t,t.startOffset,t.endOffset)}#y(){this.#o.clear();for(let t of this.#e){let e=k(this.#t,t.startOffset,t.endOffset);e&&this.#o.set(t.id,e)}}#E(t,e){for(let n of this.#e){let i=this.#o.get(n.id);if(!i)continue;let o=i.getClientRects();for(let r of o)if(t>=r.left&&t<=r.right&&e>=r.top&&e<=r.bottom)return n}return null}_createFromSelection(t){let e=window.getSelection();if(!e||e.isCollapsed)return;let n=e.getRangeAt(0);if(!this.#t.contains(n.commonAncestorContainer))return;let i=j(this.#t,n.startContainer,n.startOffset),o=j(this.#t,n.endContainer,n.endOffset);if(i<0||o<0||i>=o)return;let r=e.toString().trim(),l={id:W(),startOffset:i,endOffset:o,text:r,color:t,note:"",created:Date.now()};this.#e.push(l),this.#d(),this.#u(),e.removeAllRanges(),this.#l("highlights:added",{id:l.id,text:r,color:t,note:""}),A(x(this.#t,"added"))}_changeColor(t,e){let n=this.#e.find(i=>i.id===t);n&&(n.color=e,this.#d(),this.#u())}_updateNote(t,e){let n=this.#e.find(i=>i.id===t);n&&(n.note=e,this.#d(),this.#v(),this.#l("highlights:note-changed",{id:t,note:e}),A(x(this.#t,"noteSaved")))}async#S(){let t=await v.get(P,this.#n);if(!t||!Array.isArray(t.highlights)||this.#a)return;let e=this.#m(t.highlights),n=D(this.#t.textContent);t.contentHash&&t.contentHash!==n?(this.#e=e.filter(i=>{let o=k(this.#t,i.startOffset,i.endOffset);return o?o.toString().trim()===i.text:!1}),this.#d()):this.#e=e}#d(){let t={version:1,contentHash:D(this.#t.textContent),highlights:this.#e};v.set(P,this.#n,t).catch(()=>{})}#u(){this.#r?(this.#A(),this.#y()):(this.#y(),this.#C()),this.#v()}#C(){let t=new Map;for(let e of this.#i)t.set(e,[]);for(let e of this.#e){let n=this.#o.get(e.id);n&&t.has(e.color)&&t.get(e.color).push(n)}V(this,t)}#A(){this.#t.querySelectorAll("mark[data-hn-id]").forEach(e=>{let n=e.parentNode;for(;e.firstChild;)n.insertBefore(e.firstChild,e);n.removeChild(e)}),this.#t.normalize();let t=[...this.#e].sort((e,n)=>n.startOffset-e.startOffset);for(let e of t){let n=k(this.#t,e.startOffset,e.endOffset);if(!n)continue;let i=document.createElement("mark");i.dataset.hnId=e.id,L(e.color)&&(i.dataset.hnColor=e.color,i.style.setProperty("--_hn-color",`var(--highlight-${e.color})`),i.style.setProperty("--_hn-ink",`var(--highlight-${e.color}-ink, var(--highlight-ink))`));try{n.surroundContents(i)}catch{let o=n.extractContents();i.appendChild(o),n.insertNode(i)}}}#b(){for(let t of this.#h)t.remove();this.#h=[]}#v(){if(this.#b(),this.#e.length===0)return;getComputedStyle(this.#t).position==="static"&&(this.#t.style.position="relative");let e=this.#t.getBoundingClientRect(),n=x(this.#t,"annotation");for(let i of this.#e){let o=this.#o.get(i.id);if(!o)continue;let r=o.getClientRects();if(r.length===0)continue;let l=r[0].top-e.top,c=document.createElement("span");if(c.className="hn-margin-annotation",c.dataset.hnId=i.id,c.setAttribute("aria-hidden","true"),c.style.insetBlockStart=`${l}px`,i.note){let a=document.createElement("span");a.className="hn-note-indicator",a.textContent="*",c.append(a,` ${n}`),c.classList.add("hn-has-note")}else c.textContent=n;this.#t.appendChild(c),this.#h.push(c)}}#l(t,e={}){this.#t.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0}))}};function y(s){let t=O.get(s);if(t&&!t.destroyed)return t;let e=new T(s);return O.set(s,e),e}function z(s=document){s.querySelectorAll(R).forEach(t=>{t.hasAttribute("data-highlights-init")||y(t)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>z()):z();var at=new MutationObserver(s=>{for(let t of s)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let n=e;n.matches(R)&&y(n),n.querySelectorAll(R).forEach(i=>{i.hasAttribute("data-highlights-init")||y(i)})}});at.observe(document.documentElement,{childList:!0,subtree:!0});var ct={add:"Add private note",view:"View notes",dialog:"Private note",heading:"Private note",placeholder:"Add a note\u2026",textarea:"Note for highlighted text",save:"Save",cancel:"Cancel"},K=!1,$=new Set;function U(s,t,e){if(!s.contains(t))return-1;let n=document.createRange();return n.setStart(s,0),n.setEnd(t,e),n.toString().length}var M=class extends E{#t=!1;#n=null;#i=null;#f=null;#e=null;#r=null;setup(){this.#t=!!this.closest("selection-menu");let t=this.hasAttribute("for");$.add(this),K||(K=!0,document.addEventListener("highlights:request-note",lt));let e=this.querySelector(":scope > button[data-note-action]");if(!this.#t&&!t){e?.remove();return}if(!e){e=document.createElement("button"),e.type="button",e.setAttribute("data-note-action","");let n=document.createElement("icon-wc");n.setAttribute("name","sticky-note"),n.setAttribute("size","sm"),n.setAttribute("aria-hidden","true"),e.appendChild(n),this.appendChild(e)}e.setAttribute("aria-label",this.#s(this.#t?"add":"view")),this.listen(e,"click",this.#t?()=>this.#g():()=>this.#a())}teardown(){$.delete(this),this.#c({restoreFocus:!1})}#s(t){return this.getAttribute(`data-label-${t}`)??ct[t]??t}openFor(t,e,n){this.#h(t,e,n??document.activeElement)}#g(){let t=this.closest("selection-menu");if(!t)return;let e=t.getSelection();if(!e)return;let n=e.target,i=document.activeElement;n.hasAttribute("data-highlights-init")||n.setAttribute("data-highlights","");let o=y(n),r=e.range,l=U(n,r.startContainer,r.startOffset),c=U(n,r.endContainer,r.endOffset),a=null;if(l>=0&&c>l&&(a=o.getHighlights().find(h=>h.startOffset<=l&&h.endOffset>=c)??null),!a){let h=window.getSelection();h&&(h.isCollapsed||h.rangeCount===0)&&(h.removeAllRanges(),h.addRange(r)),o._createFromSelection("yellow");let p=o.getHighlights();a=p.find(f=>f.startOffset===l&&f.endOffset===c)??p[p.length-1]??null}t.dismiss(),a&&this.#h(a,o,i)}#a(){let t=this.getAttribute("for"),e=t?document.getElementById(t):null;if(!e)return;e.hasAttribute("data-highlights-init")||e.setAttribute("data-highlights","");let n=y(e),i=n.getHighlights(),o=i.find(r=>r.note)??i[0];o&&this.#h(o,n,document.activeElement)}#h(t,e,n){this.#c({restoreFocus:!1});let i=e.element;this.#i=n&&n!==document.body?n:null,this.#f=t,this.#e=e;let o=document.createElement("div");o.className="hn-note-panel",o.setAttribute("role","dialog"),o.setAttribute("aria-label",this.#s("dialog"));let r=document.createElement("header");r.className="hn-note-header";let l=document.createElement("small");l.textContent=this.#s("heading"),r.appendChild(l),o.appendChild(r);let c=document.createElement("blockquote");c.className="hn-note-quote",c.textContent=t.text.length>80?t.text.slice(0,80)+"\u2026":t.text,o.appendChild(c);let a=document.createElement("textarea");a.className="hn-note-textarea",a.placeholder=this.#s("placeholder"),a.value=t.note||"",a.rows=3,a.setAttribute("aria-label",this.#s("textarea")),o.appendChild(a);let h=document.createElement("footer");h.className="hn-note-actions";let p=()=>{e._updateNote(t.id,a.value.trim()),this.#c()},f=document.createElement("button");f.type="button",f.className="hn-action hn-action-save",f.textContent=this.#s("save"),f.addEventListener("click",p);let b=document.createElement("button");if(b.type="button",b.className="hn-action",b.textContent=this.#s("cancel"),b.addEventListener("click",()=>this.#c()),h.append(f,b),o.appendChild(h),o.addEventListener("keydown",d=>{d.key==="Escape"?(d.preventDefault(),d.stopPropagation(),this.#c()):d.key==="Enter"&&(d.metaKey||d.ctrlKey)&&d.target===a&&(d.preventDefault(),p())}),getComputedStyle(i).position==="static"&&(i.setAttribute("data-note-host",""),this.#r=i),i.appendChild(o),typeof e.findHighlightRect=="function"){let d=e.findHighlightRect(t.id);if(d){let Y=i.getBoundingClientRect();o.style.top=`${d.top-Y.top}px`}}this.#n=o,requestAnimationFrame(()=>{this.#n===o&&(a.focus(),document.addEventListener("pointerdown",this.#o))})}#o=t=>{if(!this.#n||this.#n.contains(t.target))return;this.#c({restoreFocus:!1});let e=this.#m;document.addEventListener("pointerup",()=>{setTimeout(()=>{let n=document.activeElement;(!n||n===document.body)&&e?.()})},{once:!0,capture:!0})};#m=null;#p(){let t=this.#i,e=this.#e?.element,n=this.#f?.id;return()=>{if(t?.isConnected&&(typeof t.checkVisibility!="function"||t.checkVisibility())&&(t.focus({preventScroll:!0}),document.activeElement===t)||!e?.isConnected)return;let o=(n?e.querySelector(`mark[data-hn-id="${CSS.escape(n)}"]`):null)??e;o.tabIndex<0&&!o.hasAttribute("tabindex")&&(o.setAttribute("tabindex","-1"),o.addEventListener("blur",()=>o.removeAttribute("tabindex"),{once:!0})),o.focus({preventScroll:!0})}}#c({restoreFocus:t=!0}={}){if(!this.#n)return;let e=this.#p();document.removeEventListener("pointerdown",this.#o),this.#n.remove(),this.#n=null,this.#r?.removeAttribute("data-note-host"),this.#r=null,this.#m=e,this.#i=null,this.#f=null,this.#e=null,t&&e()}};function lt(s){let{highlight:t,controller:e}=s.detail||{};if(!t||!e)return;let n=$.values().next().value;n&&n.openFor(t,e)}F("note-wc",M);
|
|
6
|
+
}`)}function ft(i){for(let t of i)b.set(t,(b.get(t)??0)+1);Q()}function gt(i){for(let t of i){let e=(b.get(t)??0)-1;e>0?b.set(t,e):b.delete(t)}Q()}function pt(i){let t=E.get(i),e=t?[...t.values()].flat():[];e.length===0?(CSS.highlights.delete(`hn-${i}`),E.delete(i)):CSS.highlights.set(`hn-${i}`,new Highlight(...e))}function K(i,t){let e=new Set(t.keys());for(let[n,s]of E)s.has(i)&&e.add(n);for(let n of e){let s=t.get(n)??[],r=E.get(n);s.length?(r||E.set(n,r=new Map),r.set(i,s)):r?.delete(i),pt(n)}}function H(i){return document.createTreeWalker(i,NodeFilter.SHOW_TEXT,t=>t.parentElement?.closest(".hn-margin-annotation")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT)}function T(i){let t=H(i),e="";for(;t.nextNode();)e+=t.currentNode.textContent??"";return e}function W(i,t,e){let n=H(i),s=0;for(;n.nextNode();){if(n.currentNode===t)return s+e;s+=(n.currentNode.textContent??"").length}return-1}function L(i,t,e){let n=H(i),s=0,r=null,o=0,a=null,l=0;for(;n.nextNode();){let c=n.currentNode,d=(c.textContent??"").length;if(!r&&s+d>t&&(r=c,o=t-s),s+d>=e){a=c,l=e-s;break}s+=d}if(!r||!a)return null;try{let c=document.createRange();return c.setStart(r,Math.min(o,(r.textContent??"").length)),c.setEnd(a,Math.min(l,(a.textContent??"").length)),c}catch{return null}}var _=class{#t;#n;#i;#u;#e=[];#s=[];#r=!lt;#f;#g;#o=!1;#p=[];#a=new Map;constructor(t){this.#t=t,this.#u=t.hasAttribute("data-highlights-readonly");let e=t.dataset.highlights;this.#n=e&&e!==""?e:location.pathname;let n=t.dataset.highlightsColors,s=n?n.split(",").map(r=>r.trim()).filter(M):[...ct];this.#i=[...new Set(s)],this.#r||ft(this.#i),this.#h(),this.#u||(this.#f=this.#l.bind(this),this.#g=this.#E.bind(this),t.addEventListener("pointerup",this.#f),t.addEventListener("click",this.#g)),t.setAttribute("data-highlights-init",""),this.#S().then(()=>{this.#o||(this.#h(),this.#A())})}get colors(){return[...this.#i]}get destroyed(){return this.#o}get element(){return this.#t}getHighlights(){return this.#e.map(t=>({...t}))}getUnplaced(){return this.#s.map(t=>({...t}))}removeHighlight(t){let e=this.#e.findIndex(s=>s.id===t),n=this.#s.findIndex(s=>s.id===t);e<0&&n<0||(e>=0?this.#e.splice(e,1):this.#s.splice(n,1),this.#d(),this.#h(),this.#c("highlights:removed",{id:t}),A(k(this.#t,"removed")))}clearAll(){this.#e=[],this.#s=[],this.#d(),this.#h()}exportHighlights(){return JSON.stringify({version:1,highlights:this.#e})}importHighlights(t){let e;try{e=typeof t=="string"?JSON.parse(t):t}catch{return{imported:0,rejected:0}}if(!e||!Array.isArray(e.highlights))return{imported:0,rejected:0};let n=this.#m(e.highlights);return this.#e=n,this.#s=[],this.#d(),this.#h(),{imported:n.length,rejected:e.highlights.length-n.length}}#m(t,e=T(this.#t).length){let n={textLength:e,colors:this.#i},s=new Set,r=[];for(let o of t){let a=ut(o,n);!a||s.has(a.id)||(s.add(a.id),r.push(a))}return r}destroy(){this.#o||(this.#o=!0,this.#f&&this.#t.removeEventListener("pointerup",this.#f),this.#g&&this.#t.removeEventListener("click",this.#g),this.#r?this.#t.querySelectorAll("mark[data-hn-id]").forEach(t=>{let e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t),e.normalize()}):(K(this,new Map),gt(this.#i)),this.#y(),this.#a.clear(),this.#t.removeAttribute("data-highlights-init"),$.get(this.#t)===this&&$.delete(this.#t))}#l(){requestAnimationFrame(()=>{if(this.#o)return;let t=window.getSelection();if(!t||t.isCollapsed||!t.toString().trim())return;let e=t.getRangeAt(0);this.#t.contains(e.commonAncestorContainer)&&this.#c("highlights:selected",{text:t.toString().trim(),rect:e.getBoundingClientRect()})})}#E(t){let e=t.target.closest?.(".hn-margin-annotation");if(e){let s=e.dataset.hnId,r=this.#e.find(o=>o.id===s);if(r){this.#c("highlights:clicked",{id:s,highlight:{...r}}),this.#c("highlights:request-note",{id:s,highlight:{...r},controller:this});return}}let n=t.target.closest?.("mark[data-hn-id]");if(n){let s=n.dataset.hnId,r=this.#e.find(o=>o.id===s);if(r){this.#c("highlights:clicked",{id:s,highlight:{...r}});return}}if(!this.#r){let s=this.#x(t.clientX,t.clientY);s&&this.#c("highlights:clicked",{id:s.id,highlight:{...s}})}}findHighlightRect(t){let e=this.#e.find(r=>r.id===t);if(!e)return null;let n=this.#w(e);if(!n)return null;let s=n.getClientRects();return s.length?s[0]:null}#w(t){return this.#a.get(t.id)??L(this.#t,t.startOffset,t.endOffset)}#b(){this.#a.clear();for(let t of this.#e){let e=L(this.#t,t.startOffset,t.endOffset);e&&this.#a.set(t.id,e)}}#x(t,e){for(let n of this.#e){let s=this.#a.get(n.id);if(!s)continue;let r=s.getClientRects();for(let o of r)if(t>=o.left&&t<=o.right&&e>=o.top&&e<=o.bottom)return n}return null}_createFromSelection(t){let e=window.getSelection();if(!e||e.isCollapsed)return;let n=e.getRangeAt(0);if(!this.#t.contains(n.commonAncestorContainer))return;let s=W(this.#t,n.startContainer,n.startOffset),r=W(this.#t,n.endContainer,n.endOffset);if(s<0||r<0||s>=r)return;let o=e.toString().trim(),a={id:J(),startOffset:s,endOffset:r,text:o,...C(T(this.#t),s,r),color:t,note:"",created:Date.now()};this.#e.push(a),this.#d(),this.#h(),e.removeAllRanges(),this.#c("highlights:added",{id:a.id,text:o,color:t,note:""}),A(k(this.#t,"added"))}_changeColor(t,e){let n=this.#e.find(s=>s.id===t);n&&(n.color=e,this.#d(),this.#h())}_updateNote(t,e){let n=this.#e.find(s=>s.id===t);n&&(n.note=e,this.#d(),this.#v(),this.#c("highlights:note-changed",{id:t,note:e}),A(k(this.#t,"noteSaved")))}async#S(){let t=await v.get(X,this.#n);if(!t||!Array.isArray(t.highlights)||this.#o)return;let e=Array.isArray(t.unplaced)?t.unplaced:[],n=this.#m([...t.highlights,...e],1/0),s=T(this.#t);if(e.length===0&&t.contentHash===U(s)){this.#e=n;return}this.#e=[],this.#s=[];for(let r of n){let o=j(s,r);o?this.#e.push({...r,startOffset:o.start,endOffset:o.end,...C(s,o.start,o.end)}):this.#s.push(r)}this.#d()}#A(){this.#s.length!==0&&(console.warn(`[highlights] ${this.#s.length} stored highlight(s) could not be found in the current text. They are kept in storage.`,this.#t),this.#c("highlights:unplaced",{highlights:this.getUnplaced()}))}#d(){let t={version:1,contentHash:U(T(this.#t)),highlights:this.#e,...this.#s.length?{unplaced:this.#s}:{}};v.set(X,this.#n,t).catch(()=>{})}#h(){this.#r?(this.#k(),this.#b()):(this.#b(),this.#C()),this.#v()}#C(){let t=new Map;for(let e of this.#i)t.set(e,[]);for(let e of this.#e){let n=this.#a.get(e.id);n&&t.has(e.color)&&t.get(e.color).push(n)}K(this,t)}#k(){this.#t.querySelectorAll("mark[data-hn-id]").forEach(e=>{let n=e.parentNode;for(;e.firstChild;)n.insertBefore(e.firstChild,e);n.removeChild(e)}),this.#t.normalize();let t=[...this.#e].sort((e,n)=>n.startOffset-e.startOffset);for(let e of t){let n=L(this.#t,e.startOffset,e.endOffset);if(!n)continue;let s=document.createElement("mark");s.dataset.hnId=e.id,M(e.color)&&(s.dataset.hnColor=e.color,s.style.setProperty("--_hn-color",`var(--highlight-${e.color})`),s.style.setProperty("--_hn-ink",`var(--highlight-${e.color}-ink, var(--highlight-ink))`));try{n.surroundContents(s)}catch{let r=n.extractContents();s.appendChild(r),n.insertNode(s)}}}#y(){for(let t of this.#p)t.remove();this.#p=[]}#v(){if(this.#y(),this.#e.length===0)return;getComputedStyle(this.#t).position==="static"&&(this.#t.style.position="relative");let e=this.#t.getBoundingClientRect(),n=k(this.#t,"annotation");for(let s of this.#e){let r=this.#a.get(s.id);if(!r)continue;let o=r.getClientRects();if(o.length===0)continue;let a=o[0].top-e.top,l=document.createElement("span");if(l.className="hn-margin-annotation",l.dataset.hnId=s.id,l.setAttribute("aria-hidden","true"),l.style.insetBlockStart=`${a}px`,s.note){let c=document.createElement("span");c.className="hn-note-indicator",c.textContent="*",l.append(c,` ${n}`),l.classList.add("hn-has-note")}else l.textContent=n;this.#t.appendChild(l),this.#p.push(l)}}#c(t,e={}){this.#t.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0}))}};function y(i){let t=$.get(i);if(t&&!t.destroyed)return t;let e=new _(i);return $.set(i,e),e}function Y(i=document){i.querySelectorAll(R).forEach(t=>{t.hasAttribute("data-highlights-init")||y(t)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Y()):Y();var mt=new MutationObserver(i=>{for(let t of i)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let n=e;n.matches(R)&&y(n),n.querySelectorAll(R).forEach(s=>{s.hasAttribute("data-highlights-init")||y(s)})}});mt.observe(document.documentElement,{childList:!0,subtree:!0});var bt={add:"Add private note",view:"View notes",dialog:"Private note",heading:"Private note",placeholder:"Add a note\u2026",textarea:"Note for highlighted text",save:"Save",cancel:"Cancel"},Z=!1,P=new Set;function tt(i,t,e){if(!i.contains(t))return-1;let n=document.createRange();return n.setStart(i,0),n.setEnd(t,e),n.toString().length}var B=class extends w{#t=!1;#n=null;#i=null;#u=null;#e=null;#s=null;setup(){this.#t=!!this.closest("selection-menu");let t=this.hasAttribute("for");P.add(this),Z||(Z=!0,document.addEventListener("highlights:request-note",yt));let e=this.querySelector(":scope > button[data-note-action]");if(!this.#t&&!t){e?.remove();return}if(!e){e=document.createElement("button"),e.type="button",e.setAttribute("data-note-action","");let n=document.createElement("icon-wc");n.setAttribute("name","sticky-note"),n.setAttribute("size","sm"),n.setAttribute("aria-hidden","true"),e.appendChild(n),this.appendChild(e)}e.setAttribute("aria-label",this.#r(this.#t?"add":"view")),this.listen(e,"click",this.#t?()=>this.#f():()=>this.#g())}teardown(){P.delete(this),this.#l()}#r(t){return this.getAttribute(`data-label-${t}`)??bt[t]??t}openFor(t,e,n){this.#o(t,e,n??document.activeElement)}#f(){let t=this.closest("selection-menu");if(!t)return;let e=t.getSelection();if(!e)return;let n=e.target,s=document.activeElement;n.hasAttribute("data-highlights-init")||n.setAttribute("data-highlights","");let r=y(n),o=e.range,a=tt(n,o.startContainer,o.startOffset),l=tt(n,o.endContainer,o.endOffset),c=null;if(a>=0&&l>a&&(c=r.getHighlights().find(d=>d.startOffset<=a&&d.endOffset>=l)??null),!c){let d=window.getSelection();d&&(d.isCollapsed||d.rangeCount===0)&&(d.removeAllRanges(),d.addRange(o)),r._createFromSelection("yellow");let f=r.getHighlights();c=f.find(u=>u.startOffset===a&&u.endOffset===l)??f[f.length-1]??null}t.dismiss(),c&&this.#o(c,r,s)}#g(){let t=this.getAttribute("for"),e=t?document.getElementById(t):null;if(!e)return;e.hasAttribute("data-highlights-init")||e.setAttribute("data-highlights","");let n=y(e),s=n.getHighlights(),r=s.find(o=>o.note)??s[0];r&&this.#o(r,n,document.activeElement)}#o(t,e,n){this.#l({restoreFocus:!1});let s=e.element;this.#i=n&&n!==document.body?n:null,this.#u=t,this.#e=e;let r=document.createElement("div");r.className="hn-note-panel",r.setAttribute("role","dialog"),r.setAttribute("aria-label",this.#r("dialog"));let o=document.createElement("header");o.className="hn-note-header";let a=document.createElement("small");a.textContent=this.#r("heading"),o.appendChild(a),r.appendChild(o);let l=document.createElement("blockquote");l.className="hn-note-quote",l.textContent=t.text.length>80?t.text.slice(0,80)+"\u2026":t.text,r.appendChild(l);let c=document.createElement("textarea");c.className="hn-note-textarea",c.placeholder=this.#r("placeholder"),c.value=t.note||"",c.rows=3,c.setAttribute("aria-label",this.#r("textarea")),r.appendChild(c);let d=document.createElement("footer");d.className="hn-note-actions";let f=()=>{e._updateNote(t.id,c.value.trim()),this.#l()},u=document.createElement("button");u.type="button",u.className="hn-action hn-action-save",u.textContent=this.#r("save"),u.addEventListener("click",f);let g=document.createElement("button");if(g.type="button",g.className="hn-action",g.textContent=this.#r("cancel"),g.addEventListener("click",()=>this.#l()),d.append(u,g),r.appendChild(d),r.addEventListener("keydown",h=>{h.defaultPrevented||(h.key==="Escape"?(h.preventDefault(),h.stopPropagation(),this.#l()):h.key==="Enter"&&(h.metaKey||h.ctrlKey)&&h.target===c&&(h.preventDefault(),f()))}),getComputedStyle(s).position==="static"&&(s.setAttribute("data-note-host",""),this.#s=s),s.appendChild(r),typeof e.findHighlightRect=="function"){let h=e.findHighlightRect(t.id);if(h){let et=s.getBoundingClientRect();r.style.top=`${h.top-et.top}px`}}this.#n=r,requestAnimationFrame(()=>{this.#n===r&&(c.focus(),document.addEventListener("pointerdown",this.#p))})}#p=t=>{if(!this.#n||this.#n.contains(t.target))return;this.#l({restoreFocus:!1});let e=this.#a;e&&document.addEventListener("pointerup",()=>{setTimeout(()=>{let n=document.activeElement;(!n||n===document.body)&&e?.()})},{once:!0,capture:!0})};#a=null;#m(){let t=this.#i,e=this.#e?.element,n=this.#u?.id;return()=>{if(t?.isConnected&&(typeof t.checkVisibility!="function"||t.checkVisibility())&&(t.focus({preventScroll:!0}),document.activeElement===t)||!e?.isConnected)return;let r=(n?e.querySelector(`mark[data-hn-id="${CSS.escape(n)}"]`):null)??e;r.tabIndex<0&&!r.hasAttribute("tabindex")&&(r.setAttribute("tabindex","-1"),r.addEventListener("blur",()=>r.removeAttribute("tabindex"),{once:!0})),r.focus({preventScroll:!0})}}#l({restoreFocus:t=!0}={}){if(!this.#n)return;let e=this.#n.contains(document.activeElement)?this.#m():null;document.removeEventListener("pointerdown",this.#p),this.#n.remove(),this.#n=null,this.#s?.removeAttribute("data-note-host"),this.#s=null,this.#a=e,this.#i=null,this.#u=null,this.#e=null,t&&e?.()}};function yt(i){let{highlight:t,controller:e}=i.detail||{};if(!t||!e)return;let n=P.values().next().value;n&&n.openFor(t,e)}I("note-wc",B);
|
|
7
7
|
//# sourceMappingURL=note-wc.js.map
|