vanilla-breeze 0.6.2 → 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.
Files changed (239) hide show
  1. package/dist/cdn/components/accordion-wc.js +1 -1
  2. package/dist/cdn/components/activity-feed.js +1 -1
  3. package/dist/cdn/components/ai-chat.js +6 -6
  4. package/dist/cdn/components/ai-summary.js +2 -2
  5. package/dist/cdn/components/analytics-panel.js +2 -2
  6. package/dist/cdn/components/audio-player.js +4 -4
  7. package/dist/cdn/components/audio-visualizer.js +2 -2
  8. package/dist/cdn/components/author-index.js +2 -2
  9. package/dist/cdn/components/brand-mark.js +1 -1
  10. package/dist/cdn/components/bread-crumb.js +1 -1
  11. package/dist/cdn/components/calendar-wc.js +2 -2
  12. package/dist/cdn/components/card-list.js +1 -1
  13. package/dist/cdn/components/carousel-wc.js +1 -1
  14. package/dist/cdn/components/change-set.js +1 -1
  15. package/dist/cdn/components/chart-wc.js +13 -13
  16. package/dist/cdn/components/chat-input.js +1 -1
  17. package/dist/cdn/components/chat-window.js +1 -1
  18. package/dist/cdn/components/color-picker.js +1 -1
  19. package/dist/cdn/components/combo-box.js +1 -1
  20. package/dist/cdn/components/command-palette.js +1 -1
  21. package/dist/cdn/components/comment-box.js +35 -35
  22. package/dist/cdn/components/comment-thread.js +38 -38
  23. package/dist/cdn/components/comment-wc.js +1 -1
  24. package/dist/cdn/components/compare-surface.js +1 -1
  25. package/dist/cdn/components/consent-banner.js +1 -1
  26. package/dist/cdn/components/content-lens.js +1 -1
  27. package/dist/cdn/components/content-swap.js +1 -1
  28. package/dist/cdn/components/context-menu.js +1 -1
  29. package/dist/cdn/components/data-table.js +1 -1
  30. package/dist/cdn/components/date-picker.js +1 -1
  31. package/dist/cdn/components/day-view.js +1 -1
  32. package/dist/cdn/components/diagram-wc.js +2 -2
  33. package/dist/cdn/components/drag-surface.js +1 -1
  34. package/dist/cdn/components/drop-down.js +1 -1
  35. package/dist/cdn/components/emoji-picker.js +1 -1
  36. package/dist/cdn/components/flow-diagram.js +1 -1
  37. package/dist/cdn/components/foot-notes.js +1 -1
  38. package/dist/cdn/components/form-field.js +1 -1
  39. package/dist/cdn/components/geo-map.js +3 -3
  40. package/dist/cdn/components/glossary-index.js +1 -1
  41. package/dist/cdn/components/glossary-wc.js +1 -1
  42. package/dist/cdn/components/heading-links.js +1 -1
  43. package/dist/cdn/components/highlight-wc.js +2 -2
  44. package/dist/cdn/components/icon-wc.js +2 -2
  45. package/dist/cdn/components/image-gallery.js +1 -1
  46. package/dist/cdn/components/image-map.js +1 -1
  47. package/dist/cdn/components/include-file.js +1 -1
  48. package/dist/cdn/components/manifest.json +58 -54
  49. package/dist/cdn/components/markdown-editor.js +25 -25
  50. package/dist/cdn/components/markdown-viewer.js +27 -27
  51. package/dist/cdn/components/nav-bar.js +1 -1
  52. package/dist/cdn/components/note-wc.js +2 -2
  53. package/dist/cdn/components/notification-wc.js +23 -23
  54. package/dist/cdn/components/page-info.js +6 -6
  55. package/dist/cdn/components/page-stats.js +1 -1
  56. package/dist/cdn/components/page-toc.js +1 -1
  57. package/dist/cdn/components/page-tools.js +1 -1
  58. package/dist/cdn/components/page-tour.js +1 -1
  59. package/dist/cdn/components/pager-wc.js +1 -1
  60. package/dist/cdn/components/poll-wc.js +1 -1
  61. package/dist/cdn/components/pop-over.js +1 -1
  62. package/dist/cdn/components/popularity-index.js +1 -1
  63. package/dist/cdn/components/print-page.js +1 -1
  64. package/dist/cdn/components/progress-tracker.js +1 -1
  65. package/dist/cdn/components/qr-code.js +1 -1
  66. package/dist/cdn/components/reaction-bar.js +1 -1
  67. package/dist/cdn/components/reading-progress.js +1 -1
  68. package/dist/cdn/components/recently-visited.js +1 -1
  69. package/dist/cdn/components/score-card.js +2 -2
  70. package/dist/cdn/components/selection-menu.js +1 -1
  71. package/dist/cdn/components/settings-panel.js +6 -6
  72. package/dist/cdn/components/share-wc.js +2 -2
  73. package/dist/cdn/components/short-cuts.js +1 -1
  74. package/dist/cdn/components/site-index.js +1 -1
  75. package/dist/cdn/components/site-map.js +1 -1
  76. package/dist/cdn/components/site-search.js +1 -1
  77. package/dist/cdn/components/slide-accept.js +1 -1
  78. package/dist/cdn/components/social-embed.js +1 -1
  79. package/dist/cdn/components/social-links.js +2 -0
  80. package/dist/cdn/components/split-surface.js +1 -1
  81. package/dist/cdn/components/star-rating.js +1 -1
  82. package/dist/cdn/components/status-wc.js +1 -1
  83. package/dist/cdn/components/stepper-wc.js +1 -1
  84. package/dist/cdn/components/tab-set.js +1 -1
  85. package/dist/cdn/components/text-reader.js +2 -2
  86. package/dist/cdn/components/theme-picker.js +20 -20
  87. package/dist/cdn/components/time-index.js +1 -1
  88. package/dist/cdn/components/time-picker.js +1 -1
  89. package/dist/cdn/components/toast-msg.js +2 -2
  90. package/dist/cdn/components/tool-tip.js +1 -1
  91. package/dist/cdn/components/topic-map.js +4 -4
  92. package/dist/cdn/components/trust-filter.js +1 -1
  93. package/dist/cdn/components/version-switcher.js +6 -6
  94. package/dist/cdn/components/video-player.js +4 -4
  95. package/dist/cdn/components/watch-wc.js +2 -2
  96. package/dist/cdn/components/week-view.js +1 -1
  97. package/dist/cdn/components/youtube-player.js +1 -1
  98. package/dist/cdn/fonts/barlow-condensed-latin-400-italic.woff2 +0 -0
  99. package/dist/cdn/fonts/barlow-condensed-latin-700-italic.woff2 +0 -0
  100. package/dist/cdn/fonts/barlow-condensed-latin-ext-400-italic.woff2 +0 -0
  101. package/dist/cdn/fonts/barlow-condensed-latin-ext-700-italic.woff2 +0 -0
  102. package/dist/cdn/fonts/dm-sans-latin-ext-wght-italic.woff2 +0 -0
  103. package/dist/cdn/fonts/dm-sans-latin-wght-italic.woff2 +0 -0
  104. package/dist/cdn/fonts/dm-serif-display-latin-400-italic.woff2 +0 -0
  105. package/dist/cdn/fonts/dm-serif-display-latin-ext-400-italic.woff2 +0 -0
  106. package/dist/cdn/fonts/exo-2-latin-ext-wght-italic.woff2 +0 -0
  107. package/dist/cdn/fonts/exo-2-latin-wght-italic.woff2 +0 -0
  108. package/dist/cdn/fonts/inter-latin-ext-wght-italic.woff2 +0 -0
  109. package/dist/cdn/fonts/inter-latin-wght-italic.woff2 +0 -0
  110. package/dist/cdn/fonts/jetbrains-mono-latin-ext-wght-italic.woff2 +0 -0
  111. package/dist/cdn/fonts/jetbrains-mono-latin-wght-italic.woff2 +0 -0
  112. package/dist/cdn/fonts/josefin-sans-latin-ext-wght-italic.woff2 +0 -0
  113. package/dist/cdn/fonts/josefin-sans-latin-wght-italic.woff2 +0 -0
  114. package/dist/cdn/fonts/lora-latin-ext-wght-italic.woff2 +0 -0
  115. package/dist/cdn/fonts/lora-latin-wght-italic.woff2 +0 -0
  116. package/dist/cdn/fonts/merriweather-latin-ext-wght-italic.woff2 +0 -0
  117. package/dist/cdn/fonts/merriweather-latin-wght-italic.woff2 +0 -0
  118. package/dist/cdn/fonts/nunito-latin-ext-wght-italic.woff2 +0 -0
  119. package/dist/cdn/fonts/nunito-latin-wght-italic.woff2 +0 -0
  120. package/dist/cdn/packs/effects.full.js +1 -1
  121. package/dist/cdn/packs/kawaii/fonts/nunito-latin-ext-wght-italic.woff2 +0 -0
  122. package/dist/cdn/packs/kawaii/fonts/nunito-latin-wght-italic.woff2 +0 -0
  123. package/dist/cdn/packs/kawaii.full.css +1 -1
  124. package/dist/cdn/packs/kawaii.theme.css +1 -1
  125. package/dist/cdn/packs/manifest.json +4 -4
  126. package/dist/cdn/packs/prototype.full.js +1 -1
  127. package/dist/cdn/packs/ui.full.js +19 -19
  128. package/dist/cdn/themes/8bit.tokens.json +8 -37
  129. package/dist/cdn/themes/alpha1999-dark.tokens.json +1 -1
  130. package/dist/cdn/themes/alpha1999.css +1 -1
  131. package/dist/cdn/themes/alpha1999.tokens.json +3 -6
  132. package/dist/cdn/themes/art-deco-dark.tokens.json +3 -27
  133. package/dist/cdn/themes/art-deco.css +1 -1
  134. package/dist/cdn/themes/art-deco.tokens.json +5 -11
  135. package/dist/cdn/themes/bauhaus-dark.tokens.json +1 -1
  136. package/dist/cdn/themes/bauhaus.css +1 -1
  137. package/dist/cdn/themes/bauhaus.tokens.json +13 -7
  138. package/dist/cdn/themes/brutalist-dark.tokens.json +3 -27
  139. package/dist/cdn/themes/brutalist.tokens.json +5 -11
  140. package/dist/cdn/themes/catppuccin-frappe.css +1 -1
  141. package/dist/cdn/themes/catppuccin-frappe.tokens.json +1 -1
  142. package/dist/cdn/themes/catppuccin-latte-dark.tokens.json +1 -1
  143. package/dist/cdn/themes/catppuccin-latte.css +1 -1
  144. package/dist/cdn/themes/catppuccin-latte.tokens.json +1 -1
  145. package/dist/cdn/themes/catppuccin-macchiato.css +1 -1
  146. package/dist/cdn/themes/catppuccin-macchiato.tokens.json +1 -1
  147. package/dist/cdn/themes/catppuccin-mocha.css +1 -1
  148. package/dist/cdn/themes/catppuccin-mocha.tokens.json +1 -1
  149. package/dist/cdn/themes/classic-dark.tokens.json +41 -41
  150. package/dist/cdn/themes/classic.tokens.json +25 -31
  151. package/dist/cdn/themes/claymorphism-dark.tokens.json +533 -161
  152. package/dist/cdn/themes/claymorphism.css +1 -1
  153. package/dist/cdn/themes/claymorphism.tokens.json +531 -135
  154. package/dist/cdn/themes/clinical-dark.tokens.json +1 -1
  155. package/dist/cdn/themes/clinical.tokens.json +1 -1
  156. package/dist/cdn/themes/cottagecore-dark.tokens.json +1 -1
  157. package/dist/cdn/themes/cottagecore.css +1 -1
  158. package/dist/cdn/themes/cottagecore.tokens.json +1 -1
  159. package/dist/cdn/themes/cyber.css +1 -1
  160. package/dist/cdn/themes/cyber.tokens.json +5 -11
  161. package/dist/cdn/themes/dawn-dark.tokens.json +3 -27
  162. package/dist/cdn/themes/dawn.css +1 -1
  163. package/dist/cdn/themes/dawn.tokens.json +1 -1
  164. package/dist/cdn/themes/dracula.tokens.json +1 -1
  165. package/dist/cdn/themes/dusk.tokens.json +1 -1
  166. package/dist/cdn/themes/editorial-dark.tokens.json +1 -1
  167. package/dist/cdn/themes/editorial.tokens.json +19 -16
  168. package/dist/cdn/themes/financial-dark.tokens.json +1 -1
  169. package/dist/cdn/themes/financial.css +1 -1
  170. package/dist/cdn/themes/financial.tokens.json +1 -1
  171. package/dist/cdn/themes/genai.css +1 -1
  172. package/dist/cdn/themes/genai.tokens.json +1 -1
  173. package/dist/cdn/themes/glassmorphism-dark.tokens.json +233 -116
  174. package/dist/cdn/themes/glassmorphism.css +1 -1
  175. package/dist/cdn/themes/glassmorphism.tokens.json +233 -116
  176. package/dist/cdn/themes/government-dark.tokens.json +1 -1
  177. package/dist/cdn/themes/government.tokens.json +1 -1
  178. package/dist/cdn/themes/gruvbox-dark.tokens.json +1 -1
  179. package/dist/cdn/themes/gruvbox.css +1 -1
  180. package/dist/cdn/themes/gruvbox.tokens.json +1 -1
  181. package/dist/cdn/themes/high-noon-dark.tokens.json +1 -1
  182. package/dist/cdn/themes/high-noon.tokens.json +1 -1
  183. package/dist/cdn/themes/journal-dark.tokens.json +3 -27
  184. package/dist/cdn/themes/journal.css +1 -1
  185. package/dist/cdn/themes/journal.tokens.json +21 -21
  186. package/dist/cdn/themes/kawaii-dark.tokens.json +1 -1
  187. package/dist/cdn/themes/kawaii.css +1 -1
  188. package/dist/cdn/themes/kawaii.tokens.json +1 -1
  189. package/dist/cdn/themes/magna-dark.tokens.json +1 -1
  190. package/dist/cdn/themes/magna.css +1 -1
  191. package/dist/cdn/themes/magna.tokens.json +2 -14
  192. package/dist/cdn/themes/manifest.json +25 -25
  193. package/dist/cdn/themes/midnight.tokens.json +1 -1
  194. package/dist/cdn/themes/minimal-dark.tokens.json +1 -1
  195. package/dist/cdn/themes/minimal.tokens.json +25 -27
  196. package/dist/cdn/themes/modern-dark.tokens.json +41 -41
  197. package/dist/cdn/themes/modern.css +1 -1
  198. package/dist/cdn/themes/modern.tokens.json +21 -21
  199. package/dist/cdn/themes/nes-dark.tokens.json +3 -27
  200. package/dist/cdn/themes/nes.tokens.json +10 -39
  201. package/dist/cdn/themes/neumorphism-dark.tokens.json +266 -134
  202. package/dist/cdn/themes/neumorphism.css +1 -1
  203. package/dist/cdn/themes/neumorphism.tokens.json +266 -134
  204. package/dist/cdn/themes/nord-dark.tokens.json +3 -27
  205. package/dist/cdn/themes/nord.css +1 -1
  206. package/dist/cdn/themes/nord.tokens.json +1 -1
  207. package/dist/cdn/themes/organic-dark.tokens.json +1 -1
  208. package/dist/cdn/themes/organic.tokens.json +5 -14
  209. package/dist/cdn/themes/rose-pine-dark.tokens.json +1 -1
  210. package/dist/cdn/themes/rose-pine.css +1 -1
  211. package/dist/cdn/themes/rose-pine.tokens.json +1 -1
  212. package/dist/cdn/themes/rough-dark.tokens.json +1 -1
  213. package/dist/cdn/themes/rough.tokens.json +1 -1
  214. package/dist/cdn/themes/solarized-dark.tokens.json +1 -1
  215. package/dist/cdn/themes/solarized.tokens.json +1 -1
  216. package/dist/cdn/themes/startup-dark.tokens.json +1 -1
  217. package/dist/cdn/themes/startup.css +1 -1
  218. package/dist/cdn/themes/startup.tokens.json +1 -1
  219. package/dist/cdn/themes/super2026-dark.tokens.json +6 -30
  220. package/dist/cdn/themes/super2026.css +1 -1
  221. package/dist/cdn/themes/super2026.tokens.json +1 -1
  222. package/dist/cdn/themes/swiss-dark.tokens.json +4 -40
  223. package/dist/cdn/themes/swiss.tokens.json +34 -68
  224. package/dist/cdn/themes/terminal.tokens.json +286 -120
  225. package/dist/cdn/themes/tokyo-night-dark.tokens.json +3 -27
  226. package/dist/cdn/themes/tokyo-night.css +1 -1
  227. package/dist/cdn/themes/tokyo-night.tokens.json +1 -1
  228. package/dist/cdn/themes/vaporwave-dark.tokens.json +3 -27
  229. package/dist/cdn/themes/vaporwave.tokens.json +1 -1
  230. package/dist/cdn/themes/win9x-dark.tokens.json +5 -29
  231. package/dist/cdn/themes/win9x.tokens.json +9 -9
  232. package/dist/cdn/vanilla-breeze-autoload.js +113 -108
  233. package/dist/cdn/vanilla-breeze-charts.js +13 -13
  234. package/dist/cdn/vanilla-breeze-core.css +1 -1
  235. package/dist/cdn/vanilla-breeze-core.js +80 -75
  236. package/dist/cdn/vanilla-breeze-extras.js +31 -31
  237. package/dist/cdn/vanilla-breeze.css +1 -1
  238. package/dist/cdn/vanilla-breeze.js +133 -133
  239. package/package.json +1 -1
@@ -1,61 +1,61 @@
1
- var Ve=Object.defineProperty;var $=(i,e)=>()=>(i&&(e=i(i=0)),e);var fe=(i,e)=>{for(var t in e)Ve(i,t,{get:e[t],enumerable:!0})};function A(i,e,t={}){let r=t.priority??10,s={impl:e,bundle:t.bundle,contract:t.contract,priority:r},n=me.get(i);if(customElements.get(i)){if(!n||n.priority>=r){n&&n.priority===r&&n.impl!==e&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=r){n.priority===r&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${n.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}me.set(i,s),customElements.define(i,e)}var pr,me,L=$(()=>{pr=window.matchMedia("(prefers-reduced-motion: reduce)"),me=new Map});var w,z=$(()=>{w=class extends HTMLElement{#e=[];#r;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.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,r,s){e.addEventListener(t,r,s),this.#e.push(()=>e.removeEventListener(t,r,s))}_reinit(){for(let e of this.#e)e();this.#e=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,t){this.#r||(this.#r=this.attachInternals());let r=this.#r.states;try{t?r.add(e):r.delete(e)}catch{let s=`--${e}`;t?r.add(s):r.delete(s)}}_adoptInternals(e){this.#r||(this.#r=e)}#t(){return this.constructor.formAssociated&&this.#r?this.#r:null}get validity(){return this.#t()?.validity}get validationMessage(){return this.#t()?.validationMessage??""}get willValidate(){return this.#t()?.willValidate??!1}get form(){return this.#t()?.form??null}checkValidity(){return this.#t()?.checkValidity()??!0}reportValidity(){return this.#t()?.reportValidity()??!0}}});function nt(i){return String(i).replace(/[\u0000- \u007f-\u009f]/g,"").toLowerCase()}function ge(i,e=!1){let t=nt(i);return e?/(^|,)(javascript|vbscript|livescript):/.test(t)?!0:/(^|,)data:/.test(t)?t.split(/(?=data:)/).filter(s=>s.startsWith("data:")).some(s=>!/^data:(image|audio|video|font)\//.test(s)):!1:/^(javascript|vbscript|livescript|data):/.test(t)}function ke(i){let e=String(i).replace(/\/\*[\s\S]*?\*\//g,"").replace(/\\/g,"").replace(/\s+/g,"").toLowerCase();return/expression\(|javascript:|vbscript:|-moz-binding|behavior:|@import|position:fixed/.test(e)}function ot(i,e){if(We.has(e))return!0;let t=i.namespaceURI;return!!(t&&!Qe.has(t)||e==="title"&&t!==j||be.has(e)&&t===j&&i.children?.length||Ge.has(e)&&(i.getAttribute("attributeName")||i.getAttribute("attributename")||"").toLowerCase().includes("href"))}function ct(i,e){for(let t of[...i.attributes]){let r=t.name.toLowerCase();if(r.startsWith("on")||Je.has(r)||!e.keepIds&&Ye.has(r)){i.removeAttribute(t.name);continue}if(r==="style"){(!e.keepStyle||ke(t.value))&&i.removeAttribute(t.name);continue}if((r==="id"||r==="name")&&!e.keepIds){let s=lt(t.value);r==="id"?e.ids.set(t.value,s):e.ids.set(`name:${t.value}`,s),i.setAttribute(t.name,s);continue}if(Ke.has(r)||r.endsWith(":href")){ge(t.value,!1)&&i.removeAttribute(t.name);continue}Xe.has(r)&&ge(t.value,!0)&&i.removeAttribute(t.name)}}function ht(i,e){let t=(i.getAttribute("type")||"").toLowerCase();e==="button"&&t!=="button"&&i.setAttribute("type","button"),e==="input"&&/^(submit|reset|image)$/.test(t)&&i.setAttribute("type","button")}function ut(i,e){for(let t of i)for(let r of[...t.attributes]){let s=r.name.toLowerCase(),n=r.value;if((s==="href"||s.endsWith(":href"))&&n.startsWith("#")){let a=pt(n.slice(1));e.has(a)&&t.setAttribute(r.name,`#${e.get(a)}`)}else if(s==="usemap"&&n.startsWith("#")){let a=e.get(`name:${n.slice(1)}`);a?t.setAttribute(r.name,`#${a}`):t.removeAttribute(r.name)}else if(et.has(s)){let a=n.split(/\s+/).filter(Boolean).map(o=>e.get(o)||(o.startsWith(Q)?o:null)).filter(Boolean);a.length?t.setAttribute(r.name,a.join(" ")):t.removeAttribute(r.name)}else n.includes("url(#")&&t.setAttribute(r.name,n.replace(/url\(#([^)]+)\)/g,(a,o)=>e.has(o)?`url(#${e.get(o)})`:a))}}function pt(i){try{return decodeURIComponent(i)}catch{return i}}function xe(i){let e=i.childNodes;if(e)for(let t of[...e])t.nodeType===8?t.remove():(t.nodeType===1||t.nodeType===11)&&xe(t)}function we(i,e){xe(i);let t=[...i.querySelectorAll("*")];e.includeRoot&&t.unshift(i);let r=new Map,s=[],n={...e,ids:r};for(let a of t){if(!ft(a,i))continue;let o=at(a);if(e.svgOnly&&(be.has(o)||o==="style")){if(o==="style"&&ke(a.textContent||"")){a.remove();continue}}else if(ot(a,o)){a.remove();continue}if(!e.keepIds&&!e.svgOnly&&rt.has(o)){dt(a);continue}if(o==="template"){let h=a.content;h&&we(h,{...e,includeRoot:!1})}ct(a,n),e.keepIds||ht(a,o);let l=tt[o];if(l)for(let h of l)a.removeAttribute(h);if(o==="include-file"&&!e.allowIncludeFile&&a.removeAttribute("src"),!e.keepIds&&!e.svgOnly&&o.includes("-")&&o!=="include-file"&&!it.has(o))for(let h of st)a.removeAttribute(h);s.push(a)}!e.keepIds&&r.size&&ut(s,r)}function dt(i){let e=i.parentNode;if(e){for(let t of[...i.childNodes])e.insertBefore(t,i);i.remove()}}function ft(i,e){let t=i;for(;t;){if(t===e)return!0;t=t.parentNode??t.parent??null}return!1}function q(i,e={}){let t=document.createElement("template");return i&&typeof i=="string"&&(t.innerHTML=i,we(t.content,{allowIncludeFile:!!e.allowIncludeFile,keepIds:!!e.keepIds,keepStyle:!!e.keepStyle})),t.content}var Ze,j,je,Qe,Q,We,be,Ge,Ke,Xe,Je,Ye,et,tt,rt,st,it,at,lt,W=$(()=>{Ze="http://www.w3.org/1999/xhtml",j="http://www.w3.org/2000/svg",je="http://www.w3.org/1998/Math/MathML",Qe=new Set([Ze,j,je]),Q="user-content-",We=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"]),be=new Set(["title","desc"]),Ge=new Set(["animate","set","animatemotion","animatetransform"]),Ke=new Set(["href","xlink:href","action","formaction","data","codebase","cite","background","longdesc","manifest","to","from","values","by"]),Xe=new Set(["src","poster","srcset"]),Je=new Set(["srcdoc","form","formaction","formmethod","formtarget","formenctype","formnovalidate","action","method","ping"]),Ye=new Set(["popovertarget","popovertargetaction","commandfor","command","interestfor","autofocus"]),et=new Set(["for","headers","list","aria-labelledby","aria-describedby","aria-controls","aria-owns","aria-flowto","aria-details","aria-errormessage","aria-activedescendant"]),tt={"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"]),st=["src","src-dark","data-src","url","endpoint","tile-url","data-versions"],it=new Set(["audio-player","video-player","image-map","brand-mark"]);at=i=>String(i.localName||i.tagName||"").toLowerCase(),lt=i=>i.startsWith(Q)?i:Q+i});function J(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function $e(i){T=i}function u(i,e=""){let t=typeof i=="string"?i:i.source,r={replace:(s,n)=>{let a=typeof n=="string"?n:n.source;return a=a.replace(b.caret,"$1"),t=t.replace(s,a),r},getRegex:()=>new RegExp(t,e)};return r}function y(i,e){if(e){if(b.escapeTest.test(i))return i.replace(b.escapeReplace,Ae)}else if(b.escapeTestNoEncode.test(i))return i.replace(b.escapeReplaceNoEncode,Ae);return i}function Se(i){try{i=encodeURI(i).replace(b.percentDecode,"%")}catch{return null}return i}function Ee(i,e){let t=i.replace(b.findPipe,(n,a,o)=>{let l=!1,h=a;for(;--h>=0&&o[h]==="\\";)l=!l;return l?"|":" |"}),r=t.split(b.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(b.slashPipe,"|");return r}function _(i,e,t){let r=i.length;if(r===0)return"";let s=0;for(;s<r;){let n=i.charAt(r-s-1);if(n===e&&!t)s++;else if(n!==e&&t)s++;else break}return i.slice(0,r-s)}function Jt(i,e){if(i.indexOf(e[1])===-1)return-1;let t=0;for(let r=0;r<i.length;r++)if(i[r]==="\\")r++;else if(i[r]===e[0])t++;else if(i[r]===e[1]&&(t--,t<0))return r;return t>0?-2:-1}function Yt(i,e=0){let t=e,r="";for(let s of i)if(s===" "){let n=4-t%4;r+=" ".repeat(n),t+=n}else r+=s,t++;return r}function Te(i,e,t,r,s){let n=e.href,a=e.title||null,o=i[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:i[0].charAt(0)==="!"?"image":"link",raw:t,href:n,title:a,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,l}function er(i,e,t){let r=i.match(t.other.indentCodeCompensation);if(r===null)return e;let s=r[1];return e.split(`
2
- `).map(n=>{let a=n.match(t.other.beginningSpace);if(a===null)return n;let[o]=a;return o.length>=s.length?n.slice(s.length):n}).join(`
3
- `)}function f(i,e){return E.parse(i,e)}var T,S,mt,b,gt,bt,kt,M,xt,Y,Re,Ce,wt,ee,yt,te,vt,At,O,re,St,Le,Et,se,ye,Tt,$t,Rt,Ct,ze,Lt,R,U,ie,zt,Ie,It,_t,Nt,_e,Mt,qt,Ne,Pt,Bt,Dt,Ht,Ot,Ut,Ft,Vt,Zt,jt,B,Qt,Me,qe,Wt,ve,ne,Gt,G,Kt,P,I,Xt,Ae,D,k,H,ae,x,N,le,E,gr,br,kr,xr,wr,yr,vr,Pe=$(()=>{T=J();S={exec:()=>null};mt=(()=>{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:i=>new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}#`),htmlBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}>`)},gt=/^(?:[ \t]*(?:\n|$))+/,bt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,kt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,M=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,xt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Y=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Re=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ce=u(Re).replace(/bull/g,Y).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(),wt=u(Re).replace(/bull/g,Y).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(),ee=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,yt=/^[^\n]+/,te=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,vt=u(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",te).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),At=u(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Y).getRegex(),O="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",re=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,St=u("^ {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",re).replace("tag",O).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Le=u(ee).replace("hr",M).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",O).getRegex(),Et=u(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Le).getRegex(),se={blockquote:Et,code:bt,def:vt,fences:kt,heading:xt,hr:M,html:St,lheading:Ce,list:At,newline:gt,paragraph:Le,table:S,text:yt},ye=u("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",M).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",O).getRegex(),Tt={...se,lheading:wt,table:ye,paragraph:u(ee).replace("hr",M).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ye).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",O).getRegex()},$t={...se,html:u(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",re).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:u(ee).replace("hr",M).replace("heading",` *#{1,6} *[^
4
- ]`).replace("lheading",Ce).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Rt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ct=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ze=/^( {2,}|\\)\n(?!\s*$)/,Lt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,R=/[\p{P}\p{S}]/u,U=/[\s\p{P}\p{S}]/u,ie=/[^\s\p{P}\p{S}]/u,zt=u(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,U).getRegex(),Ie=/(?!~)[\p{P}\p{S}]/u,It=/(?!~)[\s\p{P}\p{S}]/u,_t=/(?:[^\s\p{P}\p{S}]|~)/u,Nt=u(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",mt?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),_e=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Mt=u(_e,"u").replace(/punct/g,R).getRegex(),qt=u(_e,"u").replace(/punct/g,Ie).getRegex(),Ne="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Pt=u(Ne,"gu").replace(/notPunctSpace/g,ie).replace(/punctSpace/g,U).replace(/punct/g,R).getRegex(),Bt=u(Ne,"gu").replace(/notPunctSpace/g,_t).replace(/punctSpace/g,It).replace(/punct/g,Ie).getRegex(),Dt=u("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ie).replace(/punctSpace/g,U).replace(/punct/g,R).getRegex(),Ht=u(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,R).getRegex(),Ot="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Ut=u(Ot,"gu").replace(/notPunctSpace/g,ie).replace(/punctSpace/g,U).replace(/punct/g,R).getRegex(),Ft=u(/\\(punct)/,"gu").replace(/punct/g,R).getRegex(),Vt=u(/^<(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(),Zt=u(re).replace("(?:-->|$)","-->").getRegex(),jt=u("^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",Zt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),B=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Qt=u(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",B).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Me=u(/^!?\[(label)\]\[(ref)\]/).replace("label",B).replace("ref",te).getRegex(),qe=u(/^!?\[(ref)\](?:\[\])?/).replace("ref",te).getRegex(),Wt=u("reflink|nolink(?!\\()","g").replace("reflink",Me).replace("nolink",qe).getRegex(),ve=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ne={_backpedal:S,anyPunctuation:Ft,autolink:Vt,blockSkip:Nt,br:ze,code:Ct,del:S,delLDelim:S,delRDelim:S,emStrongLDelim:Mt,emStrongRDelimAst:Pt,emStrongRDelimUnd:Dt,escape:Rt,link:Qt,nolink:qe,punctuation:zt,reflink:Me,reflinkSearch:Wt,tag:jt,text:Lt,url:S},Gt={...ne,link:u(/^!?\[(label)\]\((.*?)\)/).replace("label",B).getRegex(),reflink:u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",B).getRegex()},G={...ne,emStrongRDelimAst:Bt,emStrongLDelim:qt,delLDelim:Ht,delRDelim:Ut,url:u(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ve).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:u(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ve).getRegex()},Kt={...G,br:u(ze).replace("{2,}","*").getRegex(),text:u(G.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},P={normal:se,gfm:Tt,pedantic:$t},I={normal:ne,gfm:G,breaks:Kt,pedantic:Gt},Xt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ae=i=>Xt[i];D=class{options;rules;lexer;constructor(i){this.options=i||T}space(i){let e=this.rules.block.newline.exec(i);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(i){let e=this.rules.block.code.exec(i);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:_(t,`
5
- `)}}}fences(i){let e=this.rules.block.fences.exec(i);if(e){let t=e[0],r=er(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:r}}}heading(i){let e=this.rules.block.heading.exec(i);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let r=_(t,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(t=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(i){let e=this.rules.block.hr.exec(i);if(e)return{type:"hr",raw:_(e[0],`
6
- `)}}blockquote(i){let e=this.rules.block.blockquote.exec(i);if(e){let t=_(e[0],`
1
+ var je=Object.defineProperty;var S=(n,e)=>()=>(n&&(e=n(n=0)),e);var fe=(n,e)=>{for(var t in e)je(n,t,{get:e[t],enumerable:!0})};var me=S(()=>{});function A(n,e,t={}){let r=t.priority??10,s={impl:e,bundle:t.bundle,contract:t.contract,priority:r},i=be.get(n);if(customElements.get(n)){if(!i||i.priority>=r){i&&i.priority===r&&i.impl!==e&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${n}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=r){i.priority===r&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${i.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}be.set(n,s),customElements.define(n,e)}var br,be,L=S(()=>{me();br=window.matchMedia("(prefers-reduced-motion: reduce)"),be=new Map});var w,_=S(()=>{w=class extends HTMLElement{#e=[];#r;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.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,r,s){e.addEventListener(t,r,s),this.#e.push(()=>e.removeEventListener(t,r,s))}_reinit(){for(let e of this.#e)e();this.#e=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,t){this.#r||(this.#r=this.attachInternals());let r=this.#r.states;try{t?r.add(e):r.delete(e)}catch{let s=`--${e}`;t?r.add(s):r.delete(s)}}_adoptInternals(e){this.#r||(this.#r=e)}#t(){return this.constructor.formAssociated&&this.#r?this.#r:null}get validity(){return this.#t()?.validity}get validationMessage(){return this.#t()?.validationMessage??""}get willValidate(){return this.#t()?.willValidate??!1}get form(){return this.#t()?.form??null}checkValidity(){return this.#t()?.checkValidity()??!0}reportValidity(){return this.#t()?.reportValidity()??!0}}});function at(n){return String(n).replace(/[\u0000- \u007f-\u009f]/g,"").toLowerCase()}function ge(n,e=!1){let t=at(n);return e?/(^|,)(javascript|vbscript|livescript):/.test(t)?!0:/(^|,)data:/.test(t)?t.split(/(?=data:)/).filter(s=>s.startsWith("data:")).some(s=>!/^data:(image|audio|video|font)\//.test(s)):!1:/^(javascript|vbscript|livescript|data):/.test(t)}function xe(n){let e=String(n).replace(/\/\*[\s\S]*?\*\//g,"").replace(/\\/g,"").replace(/\s+/g,"").toLowerCase();return/expression\(|javascript:|vbscript:|-moz-binding|behavior:|@import|position:fixed/.test(e)}function ct(n,e){if(Ge.has(e))return!0;let t=n.namespaceURI;return!!(t&&!We.has(t)||e==="title"&&t!==Z||ke.has(e)&&t===Z&&n.children?.length||Ke.has(e)&&(n.getAttribute("attributeName")||n.getAttribute("attributename")||"").toLowerCase().includes("href"))}function ht(n,e){for(let t of[...n.attributes]){let r=t.name.toLowerCase();if(r.startsWith("on")||Ye.has(r)||!e.keepIds&&et.has(r)){n.removeAttribute(t.name);continue}if(r==="style"){(!e.keepStyle||xe(t.value))&&n.removeAttribute(t.name);continue}if((r==="id"||r==="name")&&!e.keepIds){let s=ot(t.value);r==="id"?e.ids.set(t.value,s):e.ids.set(`name:${t.value}`,s),n.setAttribute(t.name,s);continue}if(Xe.has(r)||r.endsWith(":href")){ge(t.value,!1)&&n.removeAttribute(t.name);continue}Je.has(r)&&ge(t.value,!0)&&n.removeAttribute(t.name)}}function ut(n,e){let t=(n.getAttribute("type")||"").toLowerCase();e==="button"&&t!=="button"&&n.setAttribute("type","button"),e==="input"&&/^(submit|reset|image)$/.test(t)&&n.setAttribute("type","button")}function dt(n,e){for(let t of n)for(let r of[...t.attributes]){let s=r.name.toLowerCase(),i=r.value;if((s==="href"||s.endsWith(":href"))&&i.startsWith("#")){let a=pt(i.slice(1));e.has(a)&&t.setAttribute(r.name,`#${e.get(a)}`)}else if(s==="usemap"&&i.startsWith("#")){let a=e.get(`name:${i.slice(1)}`);a?t.setAttribute(r.name,`#${a}`):t.removeAttribute(r.name)}else if(tt.has(s)){let a=i.split(/\s+/).filter(Boolean).map(o=>e.get(o)||(o.startsWith(Q)?o:null)).filter(Boolean);a.length?t.setAttribute(r.name,a.join(" ")):t.removeAttribute(r.name)}else i.includes("url(#")&&t.setAttribute(r.name,i.replace(/url\(#([^)]+)\)/g,(a,o)=>e.has(o)?`url(#${e.get(o)})`:a))}}function pt(n){try{return decodeURIComponent(n)}catch{return n}}function we(n){let e=n.childNodes;if(e)for(let t of[...e])t.nodeType===8?t.remove():(t.nodeType===1||t.nodeType===11)&&we(t)}function ye(n,e){we(n);let t=[...n.querySelectorAll("*")];e.includeRoot&&t.unshift(n);let r=new Map,s=[],i={...e,ids:r};for(let a of t){if(!mt(a,n))continue;let o=lt(a);if(e.svgOnly&&(ke.has(o)||o==="style")){if(o==="style"&&xe(a.textContent||"")){a.remove();continue}}else if(ct(a,o)){a.remove();continue}if(!e.keepIds&&!e.svgOnly&&st.has(o)){ft(a);continue}if(o==="template"){let h=a.content;h&&ye(h,{...e,includeRoot:!1})}ht(a,i),e.keepIds||ut(a,o);let l=rt[o];if(l)for(let h of l)a.removeAttribute(h);if(o==="include-file"&&!e.allowIncludeFile&&a.removeAttribute("src"),!e.keepIds&&!e.svgOnly&&o.includes("-")&&o!=="include-file"&&!it.has(o))for(let h of nt)a.removeAttribute(h);s.push(a)}!e.keepIds&&r.size&&dt(s,r)}function ft(n){let e=n.parentNode;if(e){for(let t of[...n.childNodes])e.insertBefore(t,n);n.remove()}}function mt(n,e){let t=n;for(;t;){if(t===e)return!0;t=t.parentNode??t.parent??null}return!1}function q(n,e={}){let t=document.createElement("template");return n&&typeof n=="string"&&(t.innerHTML=n,ye(t.content,{allowIncludeFile:!!e.allowIncludeFile,keepIds:!!e.keepIds,keepStyle:!!e.keepStyle})),t.content}var Ze,Z,Qe,We,Q,Ge,ke,Ke,Xe,Je,Ye,et,tt,rt,st,nt,it,lt,ot,W=S(()=>{Ze="http://www.w3.org/1999/xhtml",Z="http://www.w3.org/2000/svg",Qe="http://www.w3.org/1998/Math/MathML",We=new Set([Ze,Z,Qe]),Q="user-content-",Ge=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"]),ke=new Set(["title","desc"]),Ke=new Set(["animate","set","animatemotion","animatetransform"]),Xe=new Set(["href","xlink:href","action","formaction","data","codebase","cite","background","longdesc","manifest","to","from","values","by"]),Je=new Set(["src","poster","srcset"]),Ye=new Set(["srcdoc","form","formaction","formmethod","formtarget","formenctype","formnovalidate","action","method","ping"]),et=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"]),rt={"include-file":["trusted","allow-scripts","allow-cross-origin"],"markdown-viewer":["src","sanitize","ping","allow-cross-origin"]},st=new Set(["social-embed","youtube-player","geo-map"]),nt=["src","src-dark","data-src","url","endpoint","tile-url","data-versions"],it=new Set(["audio-player","video-player","image-map","brand-mark"]);lt=n=>String(n.localName||n.tagName||"").toLowerCase(),ot=n=>n.startsWith(Q)?n:Q+n});function J(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function Ce(n){T=n}function u(n,e=""){let t=typeof n=="string"?n:n.source,r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(g.caret,"$1"),t=t.replace(s,a),r},getRegex:()=>new RegExp(t,e)};return r}function y(n,e){if(e){if(g.escapeTest.test(n))return n.replace(g.escapeReplace,Se)}else if(g.escapeTestNoEncode.test(n))return n.replace(g.escapeReplaceNoEncode,Se);return n}function Ee(n){try{n=encodeURI(n).replace(g.percentDecode,"%")}catch{return null}return n}function $e(n,e){let t=n.replace(g.findPipe,(i,a,o)=>{let l=!1,h=a;for(;--h>=0&&o[h]==="\\";)l=!l;return l?"|":" |"}),r=t.split(g.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(g.slashPipe,"|");return r}function I(n,e,t){let r=n.length;if(r===0)return"";let s=0;for(;s<r;){let i=n.charAt(r-s-1);if(i===e&&!t)s++;else if(i!==e&&t)s++;else break}return n.slice(0,r-s)}function Yt(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let r=0;r<n.length;r++)if(n[r]==="\\")r++;else if(n[r]===e[0])t++;else if(n[r]===e[1]&&(t--,t<0))return r;return t>0?-2:-1}function er(n,e=0){let t=e,r="";for(let s of n)if(s===" "){let i=4-t%4;r+=" ".repeat(i),t+=i}else r+=s,t++;return r}function Te(n,e,t,r,s){let i=e.href,a=e.title||null,o=n[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:i,title:a,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,l}function tr(n,e,t){let r=n.match(t.other.indentCodeCompensation);if(r===null)return e;let s=r[1];return e.split(`
2
+ `).map(i=>{let a=i.match(t.other.beginningSpace);if(a===null)return i;let[o]=a;return o.length>=s.length?i.slice(s.length):i}).join(`
3
+ `)}function f(n,e){return $.parse(n,e)}var T,E,bt,g,gt,kt,xt,M,wt,Y,Re,Le,yt,ee,vt,te,At,St,O,re,Et,_e,$t,se,ve,Tt,Ct,Rt,Lt,ze,_t,C,U,ne,zt,Ie,It,Pt,Mt,Pe,qt,Bt,Me,Dt,Nt,Ht,Ot,Ut,Ft,Vt,jt,Zt,Qt,D,Wt,qe,Be,Gt,Ae,ie,Kt,G,Xt,B,z,Jt,Se,N,k,H,ae,x,P,le,$,wr,yr,vr,Ar,Sr,Er,$r,De=S(()=>{T=J();E={exec:()=>null};bt=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),g={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:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}>`)},gt=/^(?:[ \t]*(?:\n|$))+/,kt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,xt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,M=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,wt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Y=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Re=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Le=u(Re).replace(/bull/g,Y).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(),yt=u(Re).replace(/bull/g,Y).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(),ee=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,vt=/^[^\n]+/,te=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,At=u(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",te).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),St=u(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Y).getRegex(),O="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",re=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Et=u("^ {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",re).replace("tag",O).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),_e=u(ee).replace("hr",M).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",O).getRegex(),$t=u(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",_e).getRegex(),se={blockquote:$t,code:kt,def:At,fences:xt,heading:wt,hr:M,html:Et,lheading:Le,list:St,newline:gt,paragraph:_e,table:E,text:vt},ve=u("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",M).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",O).getRegex(),Tt={...se,lheading:yt,table:ve,paragraph:u(ee).replace("hr",M).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ve).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",O).getRegex()},Ct={...se,html:u(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",re).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:E,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:u(ee).replace("hr",M).replace("heading",` *#{1,6} *[^
4
+ ]`).replace("lheading",Le).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Rt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Lt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ze=/^( {2,}|\\)\n(?!\s*$)/,_t=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,C=/[\p{P}\p{S}]/u,U=/[\s\p{P}\p{S}]/u,ne=/[^\s\p{P}\p{S}]/u,zt=u(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,U).getRegex(),Ie=/(?!~)[\p{P}\p{S}]/u,It=/(?!~)[\s\p{P}\p{S}]/u,Pt=/(?:[^\s\p{P}\p{S}]|~)/u,Mt=u(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",bt?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Pe=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,qt=u(Pe,"u").replace(/punct/g,C).getRegex(),Bt=u(Pe,"u").replace(/punct/g,Ie).getRegex(),Me="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Dt=u(Me,"gu").replace(/notPunctSpace/g,ne).replace(/punctSpace/g,U).replace(/punct/g,C).getRegex(),Nt=u(Me,"gu").replace(/notPunctSpace/g,Pt).replace(/punctSpace/g,It).replace(/punct/g,Ie).getRegex(),Ht=u("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ne).replace(/punctSpace/g,U).replace(/punct/g,C).getRegex(),Ot=u(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,C).getRegex(),Ut="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Ft=u(Ut,"gu").replace(/notPunctSpace/g,ne).replace(/punctSpace/g,U).replace(/punct/g,C).getRegex(),Vt=u(/\\(punct)/,"gu").replace(/punct/g,C).getRegex(),jt=u(/^<(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(),Zt=u(re).replace("(?:-->|$)","-->").getRegex(),Qt=u("^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",Zt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),D=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Wt=u(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",D).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),qe=u(/^!?\[(label)\]\[(ref)\]/).replace("label",D).replace("ref",te).getRegex(),Be=u(/^!?\[(ref)\](?:\[\])?/).replace("ref",te).getRegex(),Gt=u("reflink|nolink(?!\\()","g").replace("reflink",qe).replace("nolink",Be).getRegex(),Ae=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ie={_backpedal:E,anyPunctuation:Vt,autolink:jt,blockSkip:Mt,br:ze,code:Lt,del:E,delLDelim:E,delRDelim:E,emStrongLDelim:qt,emStrongRDelimAst:Dt,emStrongRDelimUnd:Ht,escape:Rt,link:Wt,nolink:Be,punctuation:zt,reflink:qe,reflinkSearch:Gt,tag:Qt,text:_t,url:E},Kt={...ie,link:u(/^!?\[(label)\]\((.*?)\)/).replace("label",D).getRegex(),reflink:u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",D).getRegex()},G={...ie,emStrongRDelimAst:Nt,emStrongLDelim:Bt,delLDelim:Ot,delRDelim:Ft,url:u(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ae).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:u(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Ae).getRegex()},Xt={...G,br:u(ze).replace("{2,}","*").getRegex(),text:u(G.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},B={normal:se,gfm:Tt,pedantic:Ct},z={normal:ie,gfm:G,breaks:Xt,pedantic:Kt},Jt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Se=n=>Jt[n];N=class{options;rules;lexer;constructor(n){this.options=n||T}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:I(t,`
5
+ `)}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let t=e[0],r=tr(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:r}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let r=I(t,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(t=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:I(e[0],`
6
+ `)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let t=I(e[0],`
7
7
  `).split(`
8
- `),r="",s="",n=[];for(;t.length>0;){let a=!1,o=[],l;for(l=0;l<t.length;l++)if(this.rules.other.blockquoteStart.test(t[l]))o.push(t[l]),a=!0;else if(!a)o.push(t[l]);else break;t=t.slice(l);let h=o.join(`
8
+ `),r="",s="",i=[];for(;t.length>0;){let a=!1,o=[],l;for(l=0;l<t.length;l++)if(this.rules.other.blockquoteStart.test(t[l]))o.push(t[l]),a=!0;else if(!a)o.push(t[l]);else break;t=t.slice(l);let h=o.join(`
9
9
  `),c=h.replace(this.rules.other.blockquoteSetextReplace,`
10
10
  $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
11
11
  ${h}`:h,s=s?`${s}
12
- ${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,n,!0),this.lexer.state.top=d,t.length===0)break;let p=n.at(-1);if(p?.type==="code")break;if(p?.type==="blockquote"){let g=p,m=g.raw+`
12
+ ${c}`:c;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=p,t.length===0)break;let d=i.at(-1);if(d?.type==="code")break;if(d?.type==="blockquote"){let b=d,m=b.raw+`
13
13
  `+t.join(`
14
- `),v=this.blockquote(m);n[n.length-1]=v,r=r.substring(0,r.length-g.raw.length)+v.raw,s=s.substring(0,s.length-g.text.length)+v.text;break}else if(p?.type==="list"){let g=p,m=g.raw+`
14
+ `),v=this.blockquote(m);i[i.length-1]=v,r=r.substring(0,r.length-b.raw.length)+v.raw,s=s.substring(0,s.length-b.text.length)+v.text;break}else if(d?.type==="list"){let b=d,m=b.raw+`
15
15
  `+t.join(`
16
- `),v=this.list(m);n[n.length-1]=v,r=r.substring(0,r.length-p.raw.length)+v.raw,s=s.substring(0,s.length-g.raw.length)+v.raw,t=m.substring(n.at(-1).raw.length).split(`
17
- `);continue}}return{type:"blockquote",raw:r,tokens:n,text:s}}}list(i){let e=this.rules.block.list.exec(i);if(e){let t=e[1].trim(),r=t.length>1,s={type:"list",raw:"",ordered:r,start:r?+t.slice(0,-1):"",loose:!1,items:[]};t=r?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=r?t:"[*+-]");let n=this.rules.other.listItemRegex(t),a=!1;for(;i;){let l=!1,h="",c="";if(!(e=n.exec(i))||this.rules.block.hr.test(i))break;h=e[0],i=i.substring(h.length);let d=Yt(e[2].split(`
18
- `,1)[0],e[1].length),p=i.split(`
19
- `,1)[0],g=!d.trim(),m=0;if(this.options.pedantic?(m=2,c=d.trimStart()):g?m=e[1].length+1:(m=d.search(this.rules.other.nonSpaceChar),m=m>4?1:m,c=d.slice(m),m+=e[1].length),g&&this.rules.other.blankLine.test(p)&&(h+=p+`
20
- `,i=i.substring(p.length+1),l=!0),!l){let v=this.rules.other.nextBulletRegex(m),ue=this.rules.other.hrRegex(m),pe=this.rules.other.fencesBeginRegex(m),de=this.rules.other.headingBeginRegex(m),Ue=this.rules.other.htmlBeginRegex(m),Fe=this.rules.other.blockquoteBeginRegex(m);for(;i;){let Z=i.split(`
21
- `,1)[0],C;if(p=Z,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),C=p):C=p.replace(this.rules.other.tabCharGlobal," "),pe.test(p)||de.test(p)||Ue.test(p)||Fe.test(p)||v.test(p)||ue.test(p))break;if(C.search(this.rules.other.nonSpaceChar)>=m||!p.trim())c+=`
22
- `+C.slice(m);else{if(g||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||pe.test(d)||de.test(d)||ue.test(d))break;c+=`
23
- `+p}g=!p.trim(),h+=Z+`
24
- `,i=i.substring(Z.length+1),d=C.slice(m)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(a=!0)),s.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),s.raw+=h}let o=s.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let l of s.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 h=this.rules.other.listTaskCheckbox.exec(l.raw);if(h){let c={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};l.checked=c.checked,s.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(!s.loose){let h=l.tokens.filter(d=>d.type==="space"),c=h.length>0&&h.some(d=>this.rules.other.anyLine.test(d.raw));s.loose=c}}if(s.loose)for(let l of s.items){l.loose=!0;for(let h of l.tokens)h.type==="text"&&(h.type="paragraph")}return s}}html(i){let e=this.rules.block.html.exec(i);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(i){let e=this.rules.block.def.exec(i);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=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:r,title:s}}}table(i){let e=this.rules.block.table.exec(i);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=Ee(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
25
- `):[],n={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===r.length){for(let a of r)this.rules.other.tableAlignRight.test(a)?n.align.push("right"):this.rules.other.tableAlignCenter.test(a)?n.align.push("center"):this.rules.other.tableAlignLeft.test(a)?n.align.push("left"):n.align.push(null);for(let a=0;a<t.length;a++)n.header.push({text:t[a],tokens:this.lexer.inline(t[a]),header:!0,align:n.align[a]});for(let a of s)n.rows.push(Ee(a,n.header.length).map((o,l)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:n.align[l]})));return n}}lheading(i){let e=this.rules.block.lheading.exec(i);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(i){let e=this.rules.block.paragraph.exec(i);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(i){let e=this.rules.block.text.exec(i);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(i){let e=this.rules.inline.escape.exec(i);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(i){let e=this.rules.inline.tag.exec(i);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(i){let e=this.rules.inline.link.exec(i);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 n=_(t.slice(0,-1),"\\");if((t.length-n.length)%2===0)return}else{let n=Jt(e[2],"()");if(n===-2)return;if(n>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+n;e[2]=e[2].substring(0,n),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let r=e[2],s="";if(this.options.pedantic){let n=this.rules.other.pedanticHrefTitle.exec(r);n&&(r=n[1],s=n[3])}else s=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?r=r.slice(1):r=r.slice(1,-1)),Te(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(i,e){let t;if((t=this.rules.inline.reflink.exec(i))||(t=this.rules.inline.nolink.exec(i))){let r=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[r.toLowerCase()];if(!s){let n=t[0].charAt(0);return{type:"text",raw:n,text:n}}return Te(t,s,t[0],this.lexer,this.rules)}}emStrong(i,e,t=""){let r=this.rules.inline.emStrongLDelim.exec(i);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!t||this.rules.inline.punctuation.exec(t))){let s=[...r[0]].length-1,n,a,o=s,l=0,h=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*i.length+s);(r=h.exec(e))!==null;){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n)continue;if(a=[...n].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&s%3&&!((s+a)%3)){l+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+l);let c=[...r[0]][0].length,d=i.slice(0,s+r.index+c+a);if(Math.min(s,a)%2){let g=d.slice(1,-1);return{type:"em",raw:d,text:g,tokens:this.lexer.inlineTokens(g)}}let p=d.slice(2,-2);return{type:"strong",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(i){let e=this.rules.inline.code.exec(i);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(t),s=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return r&&s&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(i){let e=this.rules.inline.br.exec(i);if(e)return{type:"br",raw:e[0]}}del(i,e,t=""){let r=this.rules.inline.delLDelim.exec(i);if(r&&(!r[1]||!t||this.rules.inline.punctuation.exec(t))){let s=[...r[0]].length-1,n,a,o=s,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*i.length+s);(r=l.exec(e))!==null;){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n||(a=[...n].length,a!==s))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let h=[...r[0]][0].length,c=i.slice(0,s+r.index+h+a),d=c.slice(s,-s);return{type:"del",raw:c,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(i){let e=this.rules.inline.autolink.exec(i);if(e){let t,r;return e[2]==="@"?(t=e[1],r="mailto:"+t):(t=e[1],r=t),{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}url(i){let e;if(e=this.rules.inline.url.exec(i)){let t,r;if(e[2]==="@")t=e[0],r="mailto:"+t;else{let s;do s=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(s!==e[0]);t=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(i){let e=this.rules.inline.text.exec(i);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},k=class K{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||T,this.options.tokenizer=this.options.tokenizer||new D,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:P.normal,inline:I.normal};this.options.pedantic?(t.block=P.pedantic,t.inline=I.pedantic):this.options.gfm&&(t.block=P.gfm,this.options.breaks?t.inline=I.breaks:t.inline=I.gfm),this.tokenizer.rules=t}static get rules(){return{block:P,inline:I}}static lex(e,t){return new K(t).lex(e)}static lexInline(e,t){return new K(t).inlineTokens(e)}lex(e){e=e.replace(b.carriageReturn,`
27
- `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let r=this.inlineQueue[t];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(b.tabCharGlobal," ").replace(b.spaceLine,""));e;){let s;if(this.options.extensions?.block?.some(a=>(s=a.call({lexer:this},e,t))?(e=e.substring(s.raw.length),t.push(s),!0):!1))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);let a=t.at(-1);s.raw.length===1&&a!==void 0?a.raw+=`
16
+ `),v=this.list(m);i[i.length-1]=v,r=r.substring(0,r.length-d.raw.length)+v.raw,s=s.substring(0,s.length-b.raw.length)+v.raw,t=m.substring(i.at(-1).raw.length).split(`
17
+ `);continue}}return{type:"blockquote",raw:r,tokens:i,text:s}}}list(n){let e=this.rules.block.list.exec(n);if(e){let t=e[1].trim(),r=t.length>1,s={type:"list",raw:"",ordered:r,start:r?+t.slice(0,-1):"",loose:!1,items:[]};t=r?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=r?t:"[*+-]");let i=this.rules.other.listItemRegex(t),a=!1;for(;n;){let l=!1,h="",c="";if(!(e=i.exec(n))||this.rules.block.hr.test(n))break;h=e[0],n=n.substring(h.length);let p=er(e[2].split(`
18
+ `,1)[0],e[1].length),d=n.split(`
19
+ `,1)[0],b=!p.trim(),m=0;if(this.options.pedantic?(m=2,c=p.trimStart()):b?m=e[1].length+1:(m=p.search(this.rules.other.nonSpaceChar),m=m>4?1:m,c=p.slice(m),m+=e[1].length),b&&this.rules.other.blankLine.test(d)&&(h+=d+`
20
+ `,n=n.substring(d.length+1),l=!0),!l){let v=this.rules.other.nextBulletRegex(m),ue=this.rules.other.hrRegex(m),de=this.rules.other.fencesBeginRegex(m),pe=this.rules.other.headingBeginRegex(m),Fe=this.rules.other.htmlBeginRegex(m),Ve=this.rules.other.blockquoteBeginRegex(m);for(;n;){let j=n.split(`
21
+ `,1)[0],R;if(d=j,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),R=d):R=d.replace(this.rules.other.tabCharGlobal," "),de.test(d)||pe.test(d)||Fe.test(d)||Ve.test(d)||v.test(d)||ue.test(d))break;if(R.search(this.rules.other.nonSpaceChar)>=m||!d.trim())c+=`
22
+ `+R.slice(m);else{if(b||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||de.test(p)||pe.test(p)||ue.test(p))break;c+=`
23
+ `+d}b=!d.trim(),h+=j+`
24
+ `,n=n.substring(j.length+1),p=R.slice(m)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(a=!0)),s.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),s.raw+=h}let o=s.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let l of s.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 h=this.rules.other.listTaskCheckbox.exec(l.raw);if(h){let c={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};l.checked=c.checked,s.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(!s.loose){let h=l.tokens.filter(p=>p.type==="space"),c=h.length>0&&h.some(p=>this.rules.other.anyLine.test(p.raw));s.loose=c}}if(s.loose)for(let l of s.items){l.loose=!0;for(let h of l.tokens)h.type==="text"&&(h.type="paragraph")}return s}}html(n){let e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){let e=this.rules.block.def.exec(n);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=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:r,title:s}}}table(n){let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=$e(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
25
+ `):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===r.length){for(let a of r)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<t.length;a++)i.header.push({text:t[a],tokens:this.lexer.inline(t[a]),header:!0,align:i.align[a]});for(let a of s)i.rows.push($e(a,i.header.length).map((o,l)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:i.align[l]})));return i}}lheading(n){let e=this.rules.block.lheading.exec(n);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(n){let e=this.rules.block.paragraph.exec(n);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(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);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(n){let e=this.rules.inline.link.exec(n);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 i=I(t.slice(0,-1),"\\");if((t.length-i.length)%2===0)return}else{let i=Yt(e[2],"()");if(i===-2)return;if(i>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let r=e[2],s="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],s=i[3])}else s=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?r=r.slice(1):r=r.slice(1,-1)),Te(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){let r=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[r.toLowerCase()];if(!s){let i=t[0].charAt(0);return{type:"text",raw:i,text:i}}return Te(t,s,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let r=this.rules.inline.emStrongLDelim.exec(n);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!t||this.rules.inline.punctuation.exec(t))){let s=[...r[0]].length-1,i,a,o=s,l=0,h=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*n.length+s);(r=h.exec(e))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&s%3&&!((s+a)%3)){l+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+l);let c=[...r[0]][0].length,p=n.slice(0,s+r.index+c+a);if(Math.min(s,a)%2){let b=p.slice(1,-1);return{type:"em",raw:p,text:b,tokens:this.lexer.inlineTokens(b)}}let d=p.slice(2,-2);return{type:"strong",raw:p,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(t),s=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return r&&s&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n,e,t=""){let r=this.rules.inline.delLDelim.exec(n);if(r&&(!r[1]||!t||this.rules.inline.punctuation.exec(t))){let s=[...r[0]].length-1,i,a,o=s,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*n.length+s);(r=l.exec(e))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==s))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let h=[...r[0]][0].length,c=n.slice(0,s+r.index+h+a),p=c.slice(s,-s);return{type:"del",raw:c,text:p,tokens:this.lexer.inlineTokens(p)}}}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let t,r;return e[2]==="@"?(t=e[1],r="mailto:"+t):(t=e[1],r=t),{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}url(n){let e;if(e=this.rules.inline.url.exec(n)){let t,r;if(e[2]==="@")t=e[0],r="mailto:"+t;else{let s;do s=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(s!==e[0]);t=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},k=class K{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||T,this.options.tokenizer=this.options.tokenizer||new N,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:g,block:B.normal,inline:z.normal};this.options.pedantic?(t.block=B.pedantic,t.inline=z.pedantic):this.options.gfm&&(t.block=B.gfm,this.options.breaks?t.inline=z.breaks:t.inline=z.gfm),this.tokenizer.rules=t}static get rules(){return{block:B,inline:z}}static lex(e,t){return new K(t).lex(e)}static lexInline(e,t){return new K(t).inlineTokens(e)}lex(e){e=e.replace(g.carriageReturn,`
27
+ `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let r=this.inlineQueue[t];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(g.tabCharGlobal," ").replace(g.spaceLine,""));e;){let s;if(this.options.extensions?.block?.some(a=>(s=a.call({lexer:this},e,t))?(e=e.substring(s.raw.length),t.push(s),!0):!1))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);let a=t.at(-1);s.raw.length===1&&a!==void 0?a.raw+=`
28
28
  `:t.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);let a=t.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
29
29
  `)?"":`
30
30
  `)+s.raw,a.text+=`
31
31
  `+s.text,this.inlineQueue.at(-1).src=a.text):t.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length);let a=t.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
32
32
  `)?"":`
33
33
  `)+s.raw,a.text+=`
34
- `+s.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},t.push(s));continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),t.push(s);continue}let n=e;if(this.options.extensions?.startBlock){let a=1/0,o=e.slice(1),l;this.options.extensions.startBlock.forEach(h=>{l=h.call({lexer:this},o),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(n=e.substring(0,a+1))}if(this.state.top&&(s=this.tokenizer.paragraph(n))){let a=t.at(-1);r&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
34
+ `+s.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},t.push(s));continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),t.push(s);continue}let i=e;if(this.options.extensions?.startBlock){let a=1/0,o=e.slice(1),l;this.options.extensions.startBlock.forEach(h=>{l=h.call({lexer:this},o),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(i=e.substring(0,a+1))}if(this.state.top&&(s=this.tokenizer.paragraph(i))){let a=t.at(-1);r&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
35
35
  `)?"":`
36
36
  `)+s.raw,a.text+=`
37
- `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(s),r=n.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);let a=t.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
37
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(s),r=i.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);let a=t.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
38
38
  `)?"":`
39
39
  `)+s.raw,a.text+=`
40
- `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(s);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}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 r=e,s=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)l.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let n;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)n=s[2]?s[2].length:0,r=r.slice(0,s.index+n)+"["+"a".repeat(s[0].length-n-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let a=!1,o="";for(;e;){a||(o=""),a=!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,r,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,r,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 h=e;if(this.options.extensions?.startInline){let c=1/0,d=e.slice(1),p;this.options.extensions.startInline.forEach(g=>{p=g.call({lexer:this},d),typeof p=="number"&&p>=0&&(c=Math.min(c,p))}),c<1/0&&c>=0&&(h=e.substring(0,c+1))}if(l=this.tokenizer.inlineText(h)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(o=l.raw.slice(-1)),a=!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}},H=class{options;parser;constructor(i){this.options=i||T}space(i){return""}code({text:i,lang:e,escaped:t}){let r=(e||"").match(b.notSpaceStart)?.[0],s=i.replace(b.endingNewline,"")+`
40
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(s);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}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 r=e,s=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)l.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)i=s[2]?s[2].length:0,r=r.slice(0,s.index+i)+"["+"a".repeat(s[0].length-i-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let a=!1,o="";for(;e;){a||(o=""),a=!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,r,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,r,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 h=e;if(this.options.extensions?.startInline){let c=1/0,p=e.slice(1),d;this.options.extensions.startInline.forEach(b=>{d=b.call({lexer:this},p),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(h=e.substring(0,c+1))}if(l=this.tokenizer.inlineText(h)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(o=l.raw.slice(-1)),a=!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}},H=class{options;parser;constructor(n){this.options=n||T}space(n){return""}code({text:n,lang:e,escaped:t}){let r=(e||"").match(g.notSpaceStart)?.[0],s=n.replace(g.endingNewline,"")+`
41
41
  `;return r?'<pre><code class="language-'+y(r)+'">'+(t?s:y(s,!0))+`</code></pre>
42
42
  `:"<pre><code>"+(t?s:y(s,!0))+`</code></pre>
43
- `}blockquote({tokens:i}){return`<blockquote>
44
- ${this.parser.parse(i)}</blockquote>
45
- `}html({text:i}){return i}def(i){return""}heading({tokens:i,depth:e}){return`<h${e}>${this.parser.parseInline(i)}</h${e}>
46
- `}hr(i){return`<hr>
47
- `}list(i){let e=i.ordered,t=i.start,r="";for(let a=0;a<i.items.length;a++){let o=i.items[a];r+=this.listitem(o)}let s=e?"ol":"ul",n=e&&t!==1?' start="'+t+'"':"";return"<"+s+n+`>
43
+ `}blockquote({tokens:n}){return`<blockquote>
44
+ ${this.parser.parse(n)}</blockquote>
45
+ `}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>
46
+ `}hr(n){return`<hr>
47
+ `}list(n){let e=n.ordered,t=n.start,r="";for(let a=0;a<n.items.length;a++){let o=n.items[a];r+=this.listitem(o)}let s=e?"ol":"ul",i=e&&t!==1?' start="'+t+'"':"";return"<"+s+i+`>
48
48
  `+r+"</"+s+`>
49
- `}listitem(i){return`<li>${this.parser.parse(i.tokens)}</li>
50
- `}checkbox({checked:i}){return"<input "+(i?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:i}){return`<p>${this.parser.parseInline(i)}</p>
51
- `}table(i){let e="",t="";for(let s=0;s<i.header.length;s++)t+=this.tablecell(i.header[s]);e+=this.tablerow({text:t});let r="";for(let s=0;s<i.rows.length;s++){let n=i.rows[s];t="";for(let a=0;a<n.length;a++)t+=this.tablecell(n[a]);r+=this.tablerow({text:t})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
49
+ `}listitem(n){return`<li>${this.parser.parse(n.tokens)}</li>
50
+ `}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
51
+ `}table(n){let e="",t="";for(let s=0;s<n.header.length;s++)t+=this.tablecell(n.header[s]);e+=this.tablerow({text:t});let r="";for(let s=0;s<n.rows.length;s++){let i=n.rows[s];t="";for(let a=0;a<i.length;a++)t+=this.tablecell(i[a]);r+=this.tablerow({text:t})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
52
52
  <thead>
53
53
  `+e+`</thead>
54
54
  `+r+`</table>
55
- `}tablerow({text:i}){return`<tr>
56
- ${i}</tr>
57
- `}tablecell(i){let e=this.parser.parseInline(i.tokens),t=i.header?"th":"td";return(i.align?`<${t} align="${i.align}">`:`<${t}>`)+e+`</${t}>
58
- `}strong({tokens:i}){return`<strong>${this.parser.parseInline(i)}</strong>`}em({tokens:i}){return`<em>${this.parser.parseInline(i)}</em>`}codespan({text:i}){return`<code>${y(i,!0)}</code>`}br(i){return"<br>"}del({tokens:i}){return`<del>${this.parser.parseInline(i)}</del>`}link({href:i,title:e,tokens:t}){let r=this.parser.parseInline(t),s=Se(i);if(s===null)return r;i=s;let n='<a href="'+i+'"';return e&&(n+=' title="'+y(e)+'"'),n+=">"+r+"</a>",n}image({href:i,title:e,text:t,tokens:r}){r&&(t=this.parser.parseInline(r,this.parser.textRenderer));let s=Se(i);if(s===null)return y(t);i=s;let n=`<img src="${i}" alt="${y(t)}"`;return e&&(n+=` title="${y(e)}"`),n+=">",n}text(i){return"tokens"in i&&i.tokens?this.parser.parseInline(i.tokens):"escaped"in i&&i.escaped?i.text:y(i.text)}},ae=class{strong({text:i}){return i}em({text:i}){return i}codespan({text:i}){return i}del({text:i}){return i}html({text:i}){return i}text({text:i}){return i}link({text:i}){return""+i}image({text:i}){return""+i}br(){return""}checkbox({raw:i}){return i}},x=class X{options;renderer;textRenderer;constructor(e){this.options=e||T,this.options.renderer=this.options.renderer||new H,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ae}static parse(e,t){return new X(t).parse(e)}static parseInline(e,t){return new X(t).parseInline(e)}parse(e){this.renderer.parser=this;let t="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let a=s,o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){t+=o||"";continue}}let n=s;switch(n.type){case"space":{t+=this.renderer.space(n);break}case"hr":{t+=this.renderer.hr(n);break}case"heading":{t+=this.renderer.heading(n);break}case"code":{t+=this.renderer.code(n);break}case"table":{t+=this.renderer.table(n);break}case"blockquote":{t+=this.renderer.blockquote(n);break}case"list":{t+=this.renderer.list(n);break}case"checkbox":{t+=this.renderer.checkbox(n);break}case"html":{t+=this.renderer.html(n);break}case"def":{t+=this.renderer.def(n);break}case"paragraph":{t+=this.renderer.paragraph(n);break}case"text":{t+=this.renderer.text(n);break}default:{let a='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let r="";for(let s=0;s<e.length;s++){let n=e[s];if(this.options.extensions?.renderers?.[n.type]){let o=this.options.extensions.renderers[n.type].call({parser:this},n);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){r+=o||"";continue}}let a=n;switch(a.type){case"escape":{r+=t.text(a);break}case"html":{r+=t.html(a);break}case"link":{r+=t.link(a);break}case"image":{r+=t.image(a);break}case"checkbox":{r+=t.checkbox(a);break}case"strong":{r+=t.strong(a);break}case"em":{r+=t.em(a);break}case"codespan":{r+=t.codespan(a);break}case"br":{r+=t.br(a);break}case"del":{r+=t.del(a);break}case"text":{r+=t.text(a);break}default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return r}},N=class{options;block;constructor(i){this.options=i||T}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(i){return i}postprocess(i){return i}processAllTokens(i){return i}emStrongMask(i){return i}provideLexer(i=this.block){return i?k.lex:k.lexInline}provideParser(i=this.block){return i?x.parse:x.parseInline}},le=class{defaults=J();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=x;Renderer=H;TextRenderer=ae;Lexer=k;Tokenizer=D;Hooks=N;constructor(...i){this.use(...i)}walkTokens(i,e){let t=[];for(let r of i)switch(t=t.concat(e.call(this,r)),r.type){case"table":{let s=r;for(let n of s.header)t=t.concat(this.walkTokens(n.tokens,e));for(let n of s.rows)for(let a of n)t=t.concat(this.walkTokens(a.tokens,e));break}case"list":{let s=r;t=t.concat(this.walkTokens(s.items,e));break}default:{let s=r;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(n=>{let a=s[n].flat(1/0);t=t.concat(this.walkTokens(a,e))}):s.tokens&&(t=t.concat(this.walkTokens(s.tokens,e)))}}return t}use(...i){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return i.forEach(t=>{let r={...t};if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let n=e.renderers[s.name];n?e.renderers[s.name]=function(...a){let o=s.renderer.apply(this,a);return o===!1&&(o=n.apply(this,a)),o}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let n=e[s.level];n?n.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),r.extensions=e),t.renderer){let s=this.defaults.renderer||new H(this.defaults);for(let n in t.renderer){if(!(n in s))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let a=n,o=t.renderer[a],l=s[a];s[a]=(...h)=>{let c=o.apply(s,h);return c===!1&&(c=l.apply(s,h)),c||""}}r.renderer=s}if(t.tokenizer){let s=this.defaults.tokenizer||new D(this.defaults);for(let n in t.tokenizer){if(!(n in s))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let a=n,o=t.tokenizer[a],l=s[a];s[a]=(...h)=>{let c=o.apply(s,h);return c===!1&&(c=l.apply(s,h)),c}}r.tokenizer=s}if(t.hooks){let s=this.defaults.hooks||new N;for(let n in t.hooks){if(!(n in s))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let a=n,o=t.hooks[a],l=s[a];N.passThroughHooks.has(n)?s[a]=h=>{if(this.defaults.async&&N.passThroughHooksRespectAsync.has(n))return(async()=>{let d=await o.call(s,h);return l.call(s,d)})();let c=o.call(s,h);return l.call(s,c)}:s[a]=(...h)=>{if(this.defaults.async)return(async()=>{let d=await o.apply(s,h);return d===!1&&(d=await l.apply(s,h)),d})();let c=o.apply(s,h);return c===!1&&(c=l.apply(s,h)),c}}r.hooks=s}if(t.walkTokens){let s=this.defaults.walkTokens,n=t.walkTokens;r.walkTokens=function(a){let o=[];return o.push(n.call(this,a)),s&&(o=o.concat(s.call(this,a))),o}}this.defaults={...this.defaults,...r}}),this}setOptions(i){return this.defaults={...this.defaults,...i},this}lexer(i,e){return k.lex(i,e??this.defaults)}parser(i,e){return x.parse(i,e??this.defaults)}parseMarkdown(i){return(e,t)=>{let r={...t},s={...this.defaults,...r},n=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return n(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 n(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return n(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=i),s.async)return(async()=>{let a=s.hooks?await s.hooks.preprocess(e):e,o=await(s.hooks?await s.hooks.provideLexer(i):i?k.lex:k.lexInline)(a,s),l=s.hooks?await s.hooks.processAllTokens(o):o;s.walkTokens&&await Promise.all(this.walkTokens(l,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser(i):i?x.parse:x.parseInline)(l,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(n);try{s.hooks&&(e=s.hooks.preprocess(e));let a=(s.hooks?s.hooks.provideLexer(i):i?k.lex:k.lexInline)(e,s);s.hooks&&(a=s.hooks.processAllTokens(a)),s.walkTokens&&this.walkTokens(a,s.walkTokens);let o=(s.hooks?s.hooks.provideParser(i):i?x.parse:x.parseInline)(a,s);return s.hooks&&(o=s.hooks.postprocess(o)),o}catch(a){return n(a)}}}onError(i,e){return t=>{if(t.message+=`
59
- Please report this to https://github.com/markedjs/marked.`,i){let r="<p>An error occurred:</p><pre>"+y(t.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(t);throw t}}},E=new le;f.options=f.setOptions=function(i){return E.setOptions(i),f.defaults=E.defaults,$e(f.defaults),f};f.getDefaults=J;f.defaults=T;f.use=function(...i){return E.use(...i),f.defaults=E.defaults,$e(f.defaults),f};f.walkTokens=function(i,e){return E.walkTokens(i,e)};f.parseInline=E.parseInline;f.Parser=x;f.parser=x.parse;f.Renderer=H;f.TextRenderer=ae;f.Lexer=k;f.lexer=k.lex;f.Tokenizer=D;f.Hooks=N;f.parse=f;gr=f.options,br=f.setOptions,kr=f.use,xr=f.walkTokens,wr=f.parseInline,yr=x.parse,vr=k.lex});var Be={};fe(Be,{MarkdownViewer:()=>F});var tr,rr,sr,ir,nr,F,oe=$(()=>{L();z();Pe();W();tr="Failed to load markdown",rr=/^:::[ \t]*(note|info|tip|warning|danger)(?:[ \t]+([^\n]*?))?[ \t]*\n([\s\S]*?)\n?^:::[ \t]*(?:\n+|$)/m,sr=i=>i.replace(/[&<>"']/g,e=>`&#${e.charCodeAt(0)};`),ir={name:"vbCallout",level:"block",start(i){return i.match(/^:::[ \t]*(?:note|info|tip|warning|danger)\b/m)?.index},tokenizer(i){let e=rr.exec(i);if(!e||e.index!==0)return;let t=e[1],r=(e[2]||"").trim()||t[0].toUpperCase()+t.slice(1),s={type:"vbCallout",raw:e[0],kind:t,title:r,tokens:[]};return this.lexer.blockTokens(e[3],s.tokens),s},renderer(i){return`<aside data-callout="${i.kind}" role="note"><p data-callout-title><strong>${sr(i.title)}</strong></p>${this.parser.parse(i.tokens)}</aside>
60
- `}},nr=new le({gfm:!0,extensions:[ir]}),F=class extends w{#e=null;#r=null;#t=null;#l=null;#s=null;#i=null;#a=0;static get observedAttributes(){return["src","sanitize","allow-cross-origin"]}setup(){this.#u()}teardown(){this.#r?.abort(),this.removeAttribute("data-rendered"),this.removeAttribute("data-loading")}attributeChangedCallback(e,t,r){t===r||!this.isConnected||!this.hasAttribute("data-upgraded")||this.#u()}get parser(){return this.#e}set parser(e){this.#e=typeof e=="function"?e:null}get markdown(){return this.#s??this.#i??""}set markdown(e){let t=e==null?null:String(e);this.#s!==t&&(this.#s=t,this.#u())}async render(){await this.#u()}async reload(){this.getAttribute("src")&&await this.#u()}#n(){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 r=this.querySelector(":scope > pre");return r?r.textContent:null}#c(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.#h(t.href),t.href}#h(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#u(){let e=++this.#a,t=this.getAttribute("src"),r;if(this.#r?.abort(),this.#r=null,this.removeAttribute("data-rendered"),this.removeAttribute("data-error"),this.removeAttribute("data-loading"),this.#l?.remove(),this.#l=null,t){let a=new AbortController;this.#r=a,this.setAttribute("data-loading",""),this.#f("markdown-viewer:fetch",{src:t});try{let o=this.#c(t),l=await fetch(o,{signal:a.signal});if(l.url&&this.#h(l.url),!l.ok)throw new Error(`HTTP ${l.status}: ${l.statusText}`);r=await l.text()}catch(o){if(o.name==="AbortError"||e!==this.#a)return;this.#o(o);return}if(e!==this.#a)return;this.removeAttribute("data-loading")}else this.#s!=null?r=this.#s:r=this.#n();if(r==null){this.#t?.replaceChildren();return}this.#i=r;let s;try{s=await(await this.#m())(r)}catch(a){if(e!==this.#a)return;this.#o(a);return}if(e!==this.#a)return;(!this.#t||this.#t.parentNode!==this)&&(this.#t=document.createElement("div"),this.#t.className="md-content",this.#t.setAttribute("part","content"),this.appendChild(this.#t)),this.hasAttribute("dir")?this.#t.removeAttribute("dir"):this.#t.setAttribute("dir","auto"),this.#p()?this.#t.replaceChildren(q(String(s??""))):this.#t.innerHTML=String(s??""),this.#d(),this.setAttribute("data-rendered","");let n=this.getAttribute("ping");if(n&&navigator.sendBeacon?.(n,JSON.stringify({src:t||"inline"})),this.#f("markdown-viewer:rendered",{src:t,node:this.#t}),this.hasAttribute("highlight"))for(let a of this.#t.querySelectorAll('pre > code[class*="language-"]')){let o=a.className.match(/language-(\S+)/)?.[1]||"";this.#f("markdown-viewer:highlight",{node:a,language:o})}}#o(e){if(this.removeAttribute("data-loading"),this.setAttribute("data-error",""),this.#t?.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")||tr,this.append(t),this.#l=t}this.#f("markdown-viewer:error",{error:e.message})}async#m(){return this.#e?this.#e:e=>nr.parse(e)}#p(){let e=this.getAttribute("sanitize");return e==null?!0:!/^(off|false)$/i.test(e.trim())}#d(){if(!this.#t)return;let e=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;e&&(this.#t.dataset.theme=e)}#f(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}};A("markdown-viewer",F)});var He={};fe(He,{MarkdownEditor:()=>V});var De,ar,V,Oe=$(()=>{L();z();oe();De={source:"Markdown source",preview:"Rendered preview",tabHint:"Tab inserts spaces. Press Escape, then Tab, to move focus."},ar=0,V=class extends w{#e=null;#r=null;#t=null;#l=null;#s=null;#i="";#a=null;#n=null;#c=!1;#h={placeholder:null,rows:null};static get observedAttributes(){return["placeholder","rows","highlight","data-label-source","data-label-preview"]}setup(){this.#u()||this.#o(),this.#x(),this.#g()}teardown(){this.#n!==null&&clearTimeout(this.#n),this.#n=null,this.#c=!1,this.removeAttribute("data-editing")}attributeChangedCallback(e,t,r){!this.#e||t===r||(e==="placeholder"?this.#f(this.#e,"placeholder",r??this.#h.placeholder):e==="rows"?this.#m():e==="highlight"?this.#r?.toggleAttribute("highlight",r!=null):this.#p())}get value(){return this.#e?.value??this.#a??""}set value(e){let t=e==null?"":String(e);if(!this.#e){this.#a=t;return}this.#e.value!==t&&(this.#e.value=t,this.#i=t,this.#g(),this.#b("markdown-editor:change",{value:t,source:"api"}))}get textarea(){return this.#e}#u(){return!!(this.#e&&this.#t?.parentNode===this&&this.#l?.parentNode===this&&this.#t.contains(this.#e))}#o(){let e=this.#e&&this.contains(this.#e)?this.#e:this.querySelector("textarea"),t=[...this.childNodes];e||(e=document.createElement("textarea"),t.push(e)),this.#e=e,this.#h={placeholder:e.getAttribute("placeholder"),rows:e.getAttribute("rows")},this.hasAttribute("placeholder")&&(e.placeholder=this.getAttribute("placeholder")??""),this.#m(),e.hasAttribute("dir")||(e.dir="auto"),e.hasAttribute("spellcheck")||(e.spellcheck=!0),this.#t=document.createElement("section"),this.#t.className="md-editor-pane",this.#t.append(...t),this.#l=document.createElement("section"),this.#l.className="md-preview-pane",this.#r=document.createElement("markdown-viewer");let r=e.getAttribute("dir");r&&r!=="auto"&&(this.#l.dir=r),this.#r.dir=r||"auto",this.hasAttribute("highlight")&&this.#r.setAttribute("highlight","");let s=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;if(s&&(this.#r.dataset.theme=s),this.#l.append(this.#r),this.hasAttribute("data-tab-indent")){this.#s=document.createElement("span"),this.#s.className="visually-hidden",this.#s.id=`md-editor-tab-hint-${++ar}`,this.#s.textContent=this.dataset.labelTabHint||De.tabHint,this.#t.append(this.#s);let n=e.getAttribute("aria-describedby");e.setAttribute("aria-describedby",n?`${n} ${this.#s.id}`:this.#s.id)}this.replaceChildren(this.#t,this.#l),this.#p(),!e.hasAttribute("aria-label")&&!e.hasAttribute("aria-labelledby")&&!e.labels?.length&&!e.title&&e.setAttribute("aria-label",this.#d("source")),this.#a!=null&&(e.value=this.#a,this.#a=null),this.#i=e.value}#m(){if(!this.#e)return;let e=this.getAttribute("rows")??this.#h.rows;this.#e.rows=parseInt(e??"",10)||10}#p(){this.#t?.setAttribute("aria-label",this.#d("source")),this.#l?.setAttribute("aria-label",this.#d("preview"))}#d(e){return(e==="source"?this.dataset.labelSource:this.dataset.labelPreview)||De[e]}#f(e,t,r){r==null?e.removeAttribute(t):e.setAttribute(t,r)}#x(){let e=this.#e;e&&(this.listen(e,"input",()=>{this.#b("markdown-editor:input",{value:e.value}),this.#v()}),this.listen(e,"focus",()=>{this.setAttribute("data-editing","")}),this.listen(e,"blur",()=>{this.removeAttribute("data-editing"),this.#c=!1,e.value!==this.#i&&(this.#i=e.value,this.#b("markdown-editor:change",{value:e.value,source:"user"}))}),this.listen(this.getRootNode(),"reset",t=>{!e.form||t.target!==e.form||queueMicrotask(()=>{this.#i=e.value,this.#g()})},{capture:!0}),this.hasAttribute("data-tab-indent")&&this.listen(e,"keydown",t=>{let r=t;if(r.key==="Escape"){this.#c=!0;return}if(r.key!=="Tab"||r.shiftKey||r.ctrlKey||r.metaKey||r.altKey){["Shift","Control","Alt","Meta"].includes(r.key)||(this.#c=!1);return}if(this.#c||e.readOnly||e.disabled){this.#c=!1;return}if(r.preventDefault(),!document.execCommand("insertText",!1," ")){let{selectionStart:s,selectionEnd:n}=e;e.setRangeText(" ",s,n,"end"),e.dispatchEvent(new Event("input",{bubbles:!0}))}}))}#v(){this.#n!==null&&clearTimeout(this.#n),this.#n=setTimeout(()=>this.#g(),150)}#g(){this.#n!==null&&clearTimeout(this.#n),this.#n=null,this.#r&&(this.#r.markdown=this.#e?.value??"")}#b(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}};A("markdown-editor",V)});L();z();W();L();z();var lr=i=>Math.max(10,Math.ceil(i*.1)),ce=class extends w{static formAssociated=!0;static observedAttributes=["value","disabled","placeholder","label","submit-label","cancel-label","data-show-cancel"];#e;#r=null;#t=null;#l=null;#s=null;#i=null;#a=null;#n=null;#c=null;#h=!1;#u=!1;constructor(){super(),this.#e=this.attachInternals(),this._adoptInternals(this.#e)}setup(){Promise.resolve().then(()=>(oe(),Be)).catch(()=>console.warn('[VB] comment-box: markdown-viewer failed to load (missing importmap for "marked"?)')),Promise.resolve().then(()=>(Oe(),He)).catch(()=>console.warn("[VB] comment-box: markdown-editor failed to load"));let e=[...this.querySelectorAll(':scope > [slot="toolbar"]'),...this.querySelectorAll(":scope > .comment-box-actions > .comment-box-toolbar > *")],t=this.querySelector(":scope > markdown-editor");if(!t){t=document.createElement("markdown-editor");let s=document.createElement("textarea");this.hasAttribute("value")&&(s.value=this.getAttribute("value")||""),t.appendChild(s)}this.#r=t,this.hasAttribute("placeholder")&&this.#r.setAttribute("placeholder",this.getAttribute("placeholder")||""),this.#t=document.createElement("div"),this.#t.className="comment-box-actions",this.#l=document.createElement("div"),this.#l.className="comment-box-toolbar",e.forEach(s=>this.#l?.appendChild(s)),e.length&&(this.#l.setAttribute("role","group"),this.#l.setAttribute("aria-label","Comment tools")),this.#t.appendChild(this.#l);let r=document.createElement("div");r.className="comment-box-buttons",this.#i=null,this.hasAttribute("data-show-cancel")&&(this.#i=this.#m(),r.appendChild(this.#i)),this.#s=document.createElement("button"),this.#s.type="button",this.#s.className="comment-box-submit",this.#s.textContent=this.getAttribute("submit-label")||"Comment",r.appendChild(this.#s),this.#t.appendChild(r),this.#a=null,this.#n=null,this.hasAttribute("data-max-length")&&(this.#a=document.createElement("span"),this.#a.className="comment-box-counter",this.#a.setAttribute("aria-hidden","true"),this.#t.appendChild(this.#a),this.#n=document.createElement("span"),this.#n.className="comment-box-status visually-hidden",this.#n.setAttribute("role","status"),this.#t.appendChild(this.#n)),this.replaceChildren(this.#r,this.#t),this.listen(this.#s,"click",this.#v),this.#i&&this.listen(this.#i,"click",this.#g),this.#p(),this.listen(this.#r,"markdown-editor:upgraded",()=>this.#p()),this.#k(),this.#w(),this.#y(),this.#S()}teardown(){this.#c=null}get#o(){return this.#r?.textarea??this.#r?.querySelector("textarea")??null}#m(){let e=document.createElement("button");return e.type="button",e.className="comment-box-cancel",e.textContent=this.getAttribute("cancel-label")||"Cancel",e}#p(){let e=this.#o;e&&(this.#d(e),this.#k(),this.#y(),e!==this.#c&&(this.#c=e,this.listen(e,"input",this.#f),this.listen(e,"keydown",this.#x)))}#d(e=this.#o){if(!e)return;let t=this.#e.labels?.[0],r=this.getAttribute("label")||t?.textContent?.trim()||"Comment";e.setAttribute("aria-label",r)}attributeChangedCallback(e,t,r){!this.isConnected||!this.#r||(e==="value"?this.value=r??"":e==="placeholder"?r==null?this.#r.removeAttribute("placeholder"):this.#r.setAttribute("placeholder",r):e==="label"?this.#d():e==="disabled"?this.#k():e==="submit-label"?this.#s&&(this.#s.textContent=r||"Comment"):e==="cancel-label"?this.#i&&(this.#i.textContent=r||"Cancel"):e==="data-show-cancel"&&(this.hasAttribute("data-show-cancel")&&!this.#i&&this.#s?(this.#i=this.#m(),this.#s.before(this.#i),this.listen(this.#i,"click",this.#g),this.#k()):!this.hasAttribute("data-show-cancel")&&this.#i&&(this.#i.remove(),this.#i=null)))}#f=()=>{this.#w(),this.#y(),this.#S(),this.dispatchEvent(new CustomEvent("comment-box:input",{bubbles:!0,detail:{value:this.value,length:this.value.length}}))};#x=e=>{e.key==="Enter"&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),this.#v())};#v=()=>{if(this.#h||this.#b())return;if(!this.#e.validity.valid){this.#e.reportValidity(),this.#o?.focus();return}let e=this.value,t=[],r=!0,s=new CustomEvent("comment-box:submit",{bubbles:!0,cancelable:!0,detail:{value:e,waitUntil(a){if(!r)throw new DOMException("waitUntil() must be called while comment-box:submit is dispatching","InvalidStateError");t.push(Promise.resolve(a))}}}),n=this.dispatchEvent(s);if(r=!1,!!n){if(!t.length){this.clear();return}this.#A(!0),Promise.all(t).then(()=>{this.#A(!1),this.clear()},()=>{this.#A(!1),this.#o?.focus()})}};#g=()=>{let e=this.value;this.dispatchEvent(new CustomEvent("comment-box:cancel",{bubbles:!0,detail:{value:e}}))};#b(){return this.hasAttribute("disabled")||this.#u}#A(e){this.#h=e,e?this.setAttribute("aria-busy","true"):this.removeAttribute("aria-busy"),this.#k()}#k(){let e=this.#b(),t=this.#o;t&&(t.disabled=e,t.readOnly=this.#h),this.#s&&(this.#s.disabled=e,this.#h?this.#s.setAttribute("aria-disabled","true"):this.#s.removeAttribute("aria-disabled")),this.#i&&(this.#i.disabled=e)}#w(){this.#e.setFormValue(this.value)}#y(){let e=this.value,t=Number(this.getAttribute("data-min-length"))||0,r=Number(this.getAttribute("data-max-length"))||1/0,s=this.hasAttribute("required"),n=this.#o&&this.contains(this.#o)?this.#o:null;if(s&&e.length===0){this.#e.setValidity({valueMissing:!0},"Please add a comment.",n||void 0);return}if(e.length<t){this.#e.setValidity({tooShort:!0},`At least ${t} characters required.`,n||void 0);return}if(e.length>r){this.#e.setValidity({tooLong:!0},`No more than ${r} characters.`,n||void 0);return}this.#e.setValidity({})}#S(){if(!this.#a)return;let e=Number(this.getAttribute("data-max-length"))||0,t=this.value.length;if(this.#a.textContent=e?`${t} / ${e}`:String(t),this.#a.classList.toggle("is-over",e>0&&t>e),!this.#n)return;let r=e-t,s="";e&&r<0?s=`${-r} characters over the limit`:e&&r<=lr(e)&&(s=`${r} characters remaining`),this.#n.textContent!==s&&(this.#n.textContent=s)}get value(){return this.#r?.value??""}set value(e){this.#r&&(this.#r.value=e==null?"":String(e),this.#w(),this.#y(),this.#S())}get busy(){return this.#h}clear(){this.value="",this.dispatchEvent(new CustomEvent("comment-box:input",{bubbles:!0,detail:{value:"",length:0}}))}focus(){this.#o?.focus()}formResetCallback(){this.value=this.getAttribute("value")??""}formStateRestoreCallback(e){e!=null&&(this.value=e)}formDisabledCallback(e){this.#u=e,this.#k()}get form(){return this.#e.form}get name(){return this.getAttribute("name")}get type(){return this.localName}get validity(){return this.#e.validity}get validationMessage(){return this.#e.validationMessage}checkValidity(){return this.#e.checkValidity()}reportValidity(){return this.#e.reportValidity()}};A("comment-box",ce);var or=[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60]];function cr(i){if(!i)return null;try{let e=new URL(i,document.baseURI);return e.protocol==="http:"||e.protocol==="https:"?i:null}catch{return null}}var hr=0,he=class extends w{#e=null;#r=null;#t=0;setup(){this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Comments"),this.#e=this.querySelector(":scope > template[data-reply-form]"),this.#l().forEach(e=>this.#i(e)),this.listen(this,"click",this.#o),this.listen(this,"comment-box:submit",this.#d),this.listen(this,"comment-box:cancel",this.#f),this.#k(),this.#t=setInterval(()=>this.#k(),6e4)}teardown(){clearInterval(this.#t)}#l(){return[...this.querySelectorAll(":scope > article[data-comment]")]}#s(e){return this.querySelector(`:scope > article[data-comment][id="${CSS.escape(e)}"]`)}#i(e){if(e.dataset.decorated==="")return;e.dataset.decorated="";let t=this.#a(e);e.style.setProperty("--comment-depth",String(t)),this.#n(e),e.appendChild(this.#h(e))}#a(e){let t=0,r=e.dataset.parent,s=new Set;for(;r&&!s.has(r);){s.add(r);let n=this.#s(r);if(!n)break;t+=1,r=n.dataset.parent}return t}#n(e){e.querySelector(":scope > .comment-header")?.remove();let t=this.#c(e),r=e.querySelector(":scope > [data-comment-body]");r?e.insertBefore(t,r):e.prepend(t);let s=[...t.querySelectorAll(".comment-author, .comment-time")].map(n=>n.id);e.setAttribute("aria-labelledby",s.join(" "))}#c(e){let t=document.createElement("header");t.className="comment-header";let r=e.id||`comment-thread-${++hr}`,s=e.dataset.author||"Unknown",n=cr(e.dataset.authorHref),a=e.dataset.authorAvatar;if(a){let h=document.createElement("user-avatar"),c=document.createElement("img");c.src=a,c.alt="",c.loading="lazy",c.decoding="async",h.appendChild(c),t.appendChild(h)}let o=document.createElement(n?"a":"span");o.className="comment-author",o.id=`${r}-author`,o.textContent=s,n&&(o.href=n),t.appendChild(o);let l=e.dataset.time;if(l){let h=document.createElement("time");h.className="comment-time",h.id=`${r}-time`,h.setAttribute("datetime",l);let c=this.#w(l);c&&h.setAttribute("title",c),h.textContent=this.#A(l)||l,t.appendChild(h)}if(e.dataset.edited){let h=document.createElement("span");h.className="comment-edited";let c=this.#w(e.dataset.edited);c&&(h.title=`Edited ${c}`),h.textContent="(edited)",t.appendChild(h)}return t}#h(e){let t=document.createElement("footer");if(t.className="comment-footer",this.hasAttribute("data-disabled"))return t;t.setAttribute("role","group"),t.setAttribute("aria-label","Comment actions");let r=document.createElement("button");if(r.type="button",r.className="comment-action comment-reply",r.textContent="Reply",t.appendChild(r),e.hasAttribute("data-mine")){let s=document.createElement("button");s.type="button",s.className="comment-action comment-edit",s.textContent="Edit",t.appendChild(s);let n=document.createElement("button");n.type="button",n.className="comment-action comment-delete",n.textContent="Delete",t.appendChild(n)}return this.#u(e,t),t}#u(e,t=e.querySelector(":scope > .comment-footer")){if(!t)return;let r=e.dataset.author||"Unknown",s=e.dataset.time?this.#w(e.dataset.time):"",n=s?` from ${s}`:"";t.querySelector(".comment-reply")?.setAttribute("aria-label",`Reply to ${r}${n}`),t.querySelector(".comment-edit")?.setAttribute("aria-label",`Edit your comment${n}`),t.querySelector(".comment-delete")?.setAttribute("aria-label",`Delete your comment${n}`)}#o=e=>{let t=e.target.closest?.("button.comment-action");if(!t)return;let r=t.closest("article[data-comment]");!r||r.parentElement!==this||(t.classList.contains("comment-reply")?this.#m(r):t.classList.contains("comment-edit")?this.#v(r):t.classList.contains("comment-delete")&&this.#g(r))};#m(e){if(this.#r&&this.#x(!1),!this.#e)return;let r=this.#e.content.cloneNode(!0).firstElementChild??document.createElement("comment-box");r.hasAttribute("data-show-cancel")||r.setAttribute("data-show-cancel",""),r.localName==="comment-box"&&!r.hasAttribute("label")&&r.setAttribute("label",`Reply to ${e.dataset.author||"comment"}`);let s=document.createElement("div");s.className="comment-reply-form",s.setAttribute("data-parent",e.id||""),s.appendChild(r),e.appendChild(s),this.#r=s,requestAnimationFrame(()=>r.focus?.())}#p(e){let t=e.target.closest?.(".comment-reply-form");return t&&t===this.#r?t:null}#d=e=>{let t=this.#p(e);if(!t)return;let r=e,s=t.parentElement,n=[],a=!0,o=this.dispatchEvent(new CustomEvent("comment-thread:reply",{bubbles:!0,cancelable:!0,detail:{parentId:s.id,value:r.detail.value,waitUntil(h){if(!a)throw new DOMException("waitUntil() must be called while comment-thread:reply is dispatching","InvalidStateError");n.push(Promise.resolve(h))}}}));if(a=!1,!o){r.preventDefault();return}if(!n.length){this.#x(!0);return}let l=Promise.all(n);r.detail.waitUntil?.(l),l.then(()=>{this.#r===t&&this.#x(!0)},()=>{})};#f=e=>{this.#p(e)&&this.#x(!0)};#x(e){let t=this.#r;if(!t)return;let r=t.parentElement,s=t.contains(document.activeElement);t.remove(),this.#r=null,(e||s)&&r?.querySelector(":scope > .comment-footer > .comment-reply")?.focus()}#v(e){let r=e.querySelector(":scope > [data-comment-body]")?.textContent.trim()??"";this.dispatchEvent(new CustomEvent("comment-thread:edit-request",{bubbles:!0,detail:{commentId:e.id,value:r}}))}#g(e){this.dispatchEvent(new CustomEvent("comment-thread:delete-request",{bubbles:!0,detail:{commentId:e.id}}))}#b(){return this.closest("[lang]")?.lang||void 0}#A(e){let t=new Date(e).getTime();if(Number.isNaN(t))return"";let r=(t-Date.now())/1e3,s=new Intl.RelativeTimeFormat(this.#b(),{numeric:"auto"});for(let[n,a]of or)if(Math.abs(r)>=a)return s.format(Math.trunc(r/a),n);return s.format(0,"second")}#k(){for(let e of this.querySelectorAll(":scope > article[data-comment] > .comment-header > time")){let t=e.getAttribute("datetime");if(!t)continue;let r=this.#A(t);r&&(e.textContent=r)}}#w(e){let t=new Date(e);return Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat(this.#b(),{dateStyle:"medium",timeStyle:"short"}).format(t)}#y(e,t){t.bodyText!=null?e.textContent=String(t.bodyText):t.bodyHtml!=null&&e.replaceChildren(q(String(t.bodyHtml))),"body"in t&&console.warn("[VB] comment-thread: `body` was removed \u2014 pass `bodyText` (plain text) or `bodyHtml` (sanitized HTML).")}addComment(e){let t=document.createElement("article");t.setAttribute("data-comment",""),t.id=e.id,t.dataset.author=e.author,e.authorHref&&(t.dataset.authorHref=e.authorHref),e.authorAvatar&&(t.dataset.authorAvatar=e.authorAvatar),t.dataset.time=e.time,e.parentId&&(t.dataset.parent=e.parentId),e.mine&&t.setAttribute("data-mine",""),e.edited&&(t.dataset.edited=e.edited);let r=document.createElement("div");r.setAttribute("data-comment-body",""),this.#y(r,e),t.appendChild(r);let s=e.parentId?this.#S(e.parentId):null;if(s)s.after(t);else if(this.#e?.parentNode===this)this.insertBefore(t,this.#e);else{let n=this.#l(),a=n[n.length-1];a?a.after(t):this.appendChild(t)}return this.#i(t),t}#S(e){let t=this.#s(e);if(!t)return null;let r=new Set([e]),s=t,n=t.nextElementSibling;for(;n instanceof HTMLElement&&n.matches("article[data-comment]")&&r.has(n.dataset.parent??"");)n.id&&r.add(n.id),s=n,n=n.nextElementSibling;return s}updateComment(e,t={}){let r=this.#s(e);if(!r)return;let s=r.querySelector(":scope > [data-comment-body]");s&&this.#y(s,t),t.author!=null&&(r.dataset.author=t.author),t.edited!=null&&(r.dataset.edited=t.edited),this.#n(r),this.#u(r)}removeComment(e){this.#s(e)?.remove()}};A("comment-thread",he);export{he as CommentThread};
55
+ `}tablerow({text:n}){return`<tr>
56
+ ${n}</tr>
57
+ `}tablecell(n){let e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
58
+ `}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${y(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){let r=this.parser.parseInline(t),s=Ee(n);if(s===null)return r;n=s;let i='<a href="'+n+'"';return e&&(i+=' title="'+y(e)+'"'),i+=">"+r+"</a>",i}image({href:n,title:e,text:t,tokens:r}){r&&(t=this.parser.parseInline(r,this.parser.textRenderer));let s=Ee(n);if(s===null)return y(t);n=s;let i=`<img src="${n}" alt="${y(t)}"`;return e&&(i+=` title="${y(e)}"`),i+=">",i}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:y(n.text)}},ae=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},x=class X{options;renderer;textRenderer;constructor(e){this.options=e||T,this.options.renderer=this.options.renderer||new H,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ae}static parse(e,t){return new X(t).parse(e)}static parseInline(e,t){return new X(t).parseInline(e)}parse(e){this.renderer.parser=this;let t="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let a=s,o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){t+=o||"";continue}}let i=s;switch(i.type){case"space":{t+=this.renderer.space(i);break}case"hr":{t+=this.renderer.hr(i);break}case"heading":{t+=this.renderer.heading(i);break}case"code":{t+=this.renderer.code(i);break}case"table":{t+=this.renderer.table(i);break}case"blockquote":{t+=this.renderer.blockquote(i);break}case"list":{t+=this.renderer.list(i);break}case"checkbox":{t+=this.renderer.checkbox(i);break}case"html":{t+=this.renderer.html(i);break}case"def":{t+=this.renderer.def(i);break}case"paragraph":{t+=this.renderer.paragraph(i);break}case"text":{t+=this.renderer.text(i);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let r="";for(let s=0;s<e.length;s++){let i=e[s];if(this.options.extensions?.renderers?.[i.type]){let o=this.options.extensions.renderers[i.type].call({parser:this},i);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=o||"";continue}}let a=i;switch(a.type){case"escape":{r+=t.text(a);break}case"html":{r+=t.html(a);break}case"link":{r+=t.link(a);break}case"image":{r+=t.image(a);break}case"checkbox":{r+=t.checkbox(a);break}case"strong":{r+=t.strong(a);break}case"em":{r+=t.em(a);break}case"codespan":{r+=t.codespan(a);break}case"br":{r+=t.br(a);break}case"del":{r+=t.del(a);break}case"text":{r+=t.text(a);break}default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return r}},P=class{options;block;constructor(n){this.options=n||T}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(n=this.block){return n?k.lex:k.lexInline}provideParser(n=this.block){return n?x.parse:x.parseInline}},le=class{defaults=J();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=x;Renderer=H;TextRenderer=ae;Lexer=k;Tokenizer=N;Hooks=P;constructor(...n){this.use(...n)}walkTokens(n,e){let t=[];for(let r of n)switch(t=t.concat(e.call(this,r)),r.type){case"table":{let s=r;for(let i of s.header)t=t.concat(this.walkTokens(i.tokens,e));for(let i of s.rows)for(let a of i)t=t.concat(this.walkTokens(a.tokens,e));break}case"list":{let s=r;t=t.concat(this.walkTokens(s.items,e));break}default:{let s=r;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(i=>{let a=s[i].flat(1/0);t=t.concat(this.walkTokens(a,e))}):s.tokens&&(t=t.concat(this.walkTokens(s.tokens,e)))}}return t}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{let r={...t};if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let i=e.renderers[s.name];i?e.renderers[s.name]=function(...a){let o=s.renderer.apply(this,a);return o===!1&&(o=i.apply(this,a)),o}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[s.level];i?i.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),r.extensions=e),t.renderer){let s=this.defaults.renderer||new H(this.defaults);for(let i in t.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let a=i,o=t.renderer[a],l=s[a];s[a]=(...h)=>{let c=o.apply(s,h);return c===!1&&(c=l.apply(s,h)),c||""}}r.renderer=s}if(t.tokenizer){let s=this.defaults.tokenizer||new N(this.defaults);for(let i in t.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let a=i,o=t.tokenizer[a],l=s[a];s[a]=(...h)=>{let c=o.apply(s,h);return c===!1&&(c=l.apply(s,h)),c}}r.tokenizer=s}if(t.hooks){let s=this.defaults.hooks||new P;for(let i in t.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let a=i,o=t.hooks[a],l=s[a];P.passThroughHooks.has(i)?s[a]=h=>{if(this.defaults.async&&P.passThroughHooksRespectAsync.has(i))return(async()=>{let p=await o.call(s,h);return l.call(s,p)})();let c=o.call(s,h);return l.call(s,c)}:s[a]=(...h)=>{if(this.defaults.async)return(async()=>{let p=await o.apply(s,h);return p===!1&&(p=await l.apply(s,h)),p})();let c=o.apply(s,h);return c===!1&&(c=l.apply(s,h)),c}}r.hooks=s}if(t.walkTokens){let s=this.defaults.walkTokens,i=t.walkTokens;r.walkTokens=function(a){let o=[];return o.push(i.call(this,a)),s&&(o=o.concat(s.call(this,a))),o}}this.defaults={...this.defaults,...r}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return k.lex(n,e??this.defaults)}parser(n,e){return x.parse(n,e??this.defaults)}parseMarkdown(n){return(e,t)=>{let r={...t},s={...this.defaults,...r},i=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return i(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 i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=n),s.async)return(async()=>{let a=s.hooks?await s.hooks.preprocess(e):e,o=await(s.hooks?await s.hooks.provideLexer(n):n?k.lex:k.lexInline)(a,s),l=s.hooks?await s.hooks.processAllTokens(o):o;s.walkTokens&&await Promise.all(this.walkTokens(l,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser(n):n?x.parse:x.parseInline)(l,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(i);try{s.hooks&&(e=s.hooks.preprocess(e));let a=(s.hooks?s.hooks.provideLexer(n):n?k.lex:k.lexInline)(e,s);s.hooks&&(a=s.hooks.processAllTokens(a)),s.walkTokens&&this.walkTokens(a,s.walkTokens);let o=(s.hooks?s.hooks.provideParser(n):n?x.parse:x.parseInline)(a,s);return s.hooks&&(o=s.hooks.postprocess(o)),o}catch(a){return i(a)}}}onError(n,e){return t=>{if(t.message+=`
59
+ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error occurred:</p><pre>"+y(t.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(t);throw t}}},$=new le;f.options=f.setOptions=function(n){return $.setOptions(n),f.defaults=$.defaults,Ce(f.defaults),f};f.getDefaults=J;f.defaults=T;f.use=function(...n){return $.use(...n),f.defaults=$.defaults,Ce(f.defaults),f};f.walkTokens=function(n,e){return $.walkTokens(n,e)};f.parseInline=$.parseInline;f.Parser=x;f.parser=x.parse;f.Renderer=H;f.TextRenderer=ae;f.Lexer=k;f.lexer=k.lex;f.Tokenizer=N;f.Hooks=P;f.parse=f;wr=f.options,yr=f.setOptions,vr=f.use,Ar=f.walkTokens,Sr=f.parseInline,Er=x.parse,$r=k.lex});var Ne={};fe(Ne,{MarkdownViewer:()=>F});var rr,sr,nr,ir,ar,F,oe=S(()=>{L();_();De();W();rr="Failed to load markdown",sr=/^:::[ \t]*(note|info|tip|warning|danger)(?:[ \t]+([^\n]*?))?[ \t]*\n([\s\S]*?)\n?^:::[ \t]*(?:\n+|$)/m,nr=n=>n.replace(/[&<>"']/g,e=>`&#${e.charCodeAt(0)};`),ir={name:"vbCallout",level:"block",start(n){return n.match(/^:::[ \t]*(?:note|info|tip|warning|danger)\b/m)?.index},tokenizer(n){let e=sr.exec(n);if(!e||e.index!==0)return;let t=e[1],r=(e[2]||"").trim()||t[0].toUpperCase()+t.slice(1),s={type:"vbCallout",raw:e[0],kind:t,title:r,tokens:[]};return this.lexer.blockTokens(e[3],s.tokens),s},renderer(n){return`<aside data-callout="${n.kind}" role="note"><p data-callout-title><strong>${nr(n.title)}</strong></p>${this.parser.parse(n.tokens)}</aside>
60
+ `}},ar=new le({gfm:!0,extensions:[ir]}),F=class extends w{#e=null;#r=null;#t=null;#i=null;#s=null;#n=null;#l=0;static get observedAttributes(){return["src","sanitize","allow-cross-origin"]}setup(){this.#u()}teardown(){this.#r?.abort(),this.removeAttribute("data-rendered"),this.removeAttribute("data-loading")}attributeChangedCallback(e,t,r){t===r||!this.isConnected||!this.hasAttribute("data-upgraded")||this.#u()}get parser(){return this.#e}set parser(e){this.#e=typeof e=="function"?e:null}get markdown(){return this.#s??this.#n??""}set markdown(e){let t=e==null?null:String(e);this.#s!==t&&(this.#s=t,this.#u())}async render(){await this.#u()}async reload(){this.getAttribute("src")&&await this.#u()}#a(){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 r=this.querySelector(":scope > pre");return r?r.textContent:null}#c(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.#h(t.href),t.href}#h(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#u(){let e=++this.#l,t=this.getAttribute("src"),r;if(this.#r?.abort(),this.#r=null,this.removeAttribute("data-rendered"),this.removeAttribute("data-error"),this.removeAttribute("data-loading"),this.#i?.remove(),this.#i=null,t){let a=new AbortController;this.#r=a,this.setAttribute("data-loading",""),this.#f("markdown-viewer:fetch",{src:t});try{let o=this.#c(t),l=await fetch(o,{signal:a.signal});if(l.url&&this.#h(l.url),!l.ok)throw new Error(`HTTP ${l.status}: ${l.statusText}`);r=await l.text()}catch(o){if(o.name==="AbortError"||e!==this.#l)return;this.#o(o);return}if(e!==this.#l)return;this.removeAttribute("data-loading")}else this.#s!=null?r=this.#s:r=this.#a();if(r==null){this.#t?.replaceChildren();return}this.#n=r;let s;try{s=await(await this.#g())(r)}catch(a){if(e!==this.#l)return;this.#o(a);return}if(e!==this.#l)return;(!this.#t||this.#t.parentNode!==this)&&(this.#t=document.createElement("div"),this.#t.className="md-content",this.#t.setAttribute("part","content"),this.appendChild(this.#t)),this.hasAttribute("dir")?this.#t.removeAttribute("dir"):this.#t.setAttribute("dir","auto"),this.#d()?this.#t.replaceChildren(q(String(s??""))):this.#t.innerHTML=String(s??""),this.#p(),this.setAttribute("data-rendered","");let i=this.getAttribute("ping");if(i&&navigator.sendBeacon?.(i,JSON.stringify({src:t||"inline"})),this.#f("markdown-viewer:rendered",{src:t,node:this.#t}),this.hasAttribute("highlight"))for(let a of this.#t.querySelectorAll('pre > code[class*="language-"]')){let o=a.className.match(/language-(\S+)/)?.[1]||"";this.#f("markdown-viewer:highlight",{node:a,language:o})}}#o(e){if(this.removeAttribute("data-loading"),this.setAttribute("data-error",""),this.#t?.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")||rr,this.append(t),this.#i=t}this.#f("markdown-viewer:error",{error:e.message})}async#g(){return this.#e?this.#e:e=>ar.parse(e)}#d(){let e=this.getAttribute("sanitize");return e==null?!0:!/^(off|false)$/i.test(e.trim())}#p(){if(!this.#t)return;let e=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;e&&(this.#t.dataset.theme=e)}#f(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}};A("markdown-viewer",F)});var Oe={};fe(Oe,{MarkdownEditor:()=>V});var He,lr,V,Ue=S(()=>{L();_();oe();He={source:"Markdown source",preview:"Rendered preview",tabHint:"Tab inserts spaces. Press Escape, then Tab, to move focus."},lr=0,V=class extends w{#e=null;#r=null;#t=null;#i=null;#s=null;#n="";#l=null;#a=null;#c=!1;#h={placeholder:null,rows:null};static get observedAttributes(){return["placeholder","rows","highlight","data-label-source","data-label-preview"]}setup(){this.#u()||this.#o(),this.#x(),this.#k()}teardown(){this.#a!==null&&clearTimeout(this.#a),this.#a=null,this.#c=!1,this.removeAttribute("data-editing")}attributeChangedCallback(e,t,r){!this.#e||t===r||(e==="placeholder"?this.#f(this.#e,"placeholder",r??this.#h.placeholder):e==="rows"?this.#g():e==="highlight"?this.#r?.toggleAttribute("highlight",r!=null):this.#d())}get value(){return this.#e?.value??this.#l??""}set value(e){let t=e==null?"":String(e);if(!this.#e){this.#l=t;return}this.#e.value!==t&&(this.#e.value=t,this.#n=t,this.#k(),this.#m("markdown-editor:change",{value:t,source:"api"}))}get textarea(){return this.#e}#u(){return!!(this.#e&&this.#t?.parentNode===this&&this.#i?.parentNode===this&&this.#t.contains(this.#e))}#o(){let e=this.#e&&this.contains(this.#e)?this.#e:this.querySelector("textarea"),t=[...this.childNodes];e||(e=document.createElement("textarea"),t.push(e)),this.#e=e,this.#h={placeholder:e.getAttribute("placeholder"),rows:e.getAttribute("rows")},this.hasAttribute("placeholder")&&(e.placeholder=this.getAttribute("placeholder")??""),this.#g(),e.hasAttribute("dir")||(e.dir="auto"),e.hasAttribute("spellcheck")||(e.spellcheck=!0),this.#t=document.createElement("section"),this.#t.className="md-editor-pane",this.#t.setAttribute("role","group"),this.#t.append(...t),this.#i=document.createElement("section"),this.#i.className="md-preview-pane",this.#i.setAttribute("role","group"),this.#r=document.createElement("markdown-viewer");let r=e.getAttribute("dir");r&&r!=="auto"&&(this.#i.dir=r),this.#r.dir=r||"auto",this.hasAttribute("highlight")&&this.#r.setAttribute("highlight","");let s=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;if(s&&(this.#r.dataset.theme=s),this.#i.append(this.#r),this.hasAttribute("data-tab-indent")){this.#s=document.createElement("span"),this.#s.className="visually-hidden",this.#s.id=`md-editor-tab-hint-${++lr}`,this.#s.textContent=this.dataset.labelTabHint||He.tabHint,this.#t.append(this.#s);let i=e.getAttribute("aria-describedby");e.setAttribute("aria-describedby",i?`${i} ${this.#s.id}`:this.#s.id)}this.replaceChildren(this.#t,this.#i),this.#d(),!e.hasAttribute("aria-label")&&!e.hasAttribute("aria-labelledby")&&!e.labels?.length&&!e.title&&e.setAttribute("aria-label",this.#p("source")),this.#l!=null&&(e.value=this.#l,this.#l=null),this.#n=e.value}#g(){if(!this.#e)return;let e=this.getAttribute("rows")??this.#h.rows;this.#e.rows=parseInt(e??"",10)||10}#d(){this.#t?.setAttribute("aria-label",this.#p("source")),this.#i?.setAttribute("aria-label",this.#p("preview"))}#p(e){return(e==="source"?this.dataset.labelSource:this.dataset.labelPreview)||He[e]}#f(e,t,r){r==null?e.removeAttribute(t):e.setAttribute(t,r)}#x(){let e=this.#e;e&&(this.listen(e,"input",()=>{this.#m("markdown-editor:input",{value:e.value}),this.#A()}),this.listen(e,"focus",()=>{this.setAttribute("data-editing","")}),this.listen(e,"blur",()=>{this.removeAttribute("data-editing"),this.#c=!1,e.value!==this.#n&&(this.#n=e.value,this.#m("markdown-editor:change",{value:e.value,source:"user"}))}),this.listen(this.getRootNode(),"reset",t=>{!e.form||t.target!==e.form||queueMicrotask(()=>{this.#n=e.value,this.#k()})},{capture:!0}),this.hasAttribute("data-tab-indent")&&this.listen(e,"keydown",t=>{let r=t;if(r.key==="Escape"){this.#c=!0;return}if(r.key!=="Tab"||r.shiftKey||r.ctrlKey||r.metaKey||r.altKey){["Shift","Control","Alt","Meta"].includes(r.key)||(this.#c=!1);return}if(this.#c||e.readOnly||e.disabled){this.#c=!1;return}if(r.preventDefault(),!document.execCommand("insertText",!1," ")){let{selectionStart:s,selectionEnd:i}=e;e.setRangeText(" ",s,i,"end"),e.dispatchEvent(new Event("input",{bubbles:!0}))}}))}#A(){this.#a!==null&&clearTimeout(this.#a),this.#a=setTimeout(()=>this.#k(),150)}#k(){this.#a!==null&&clearTimeout(this.#a),this.#a=null,this.#r&&(this.#r.markdown=this.#e?.value??"")}#m(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}};A("markdown-editor",V)});L();_();W();L();_();var or=n=>Math.max(10,Math.ceil(n*.1)),ce=class extends w{static formAssociated=!0;static observedAttributes=["value","disabled","placeholder","label","submit-label","cancel-label","data-show-cancel"];#e;#r=null;#t=null;#i=null;#s=null;#n=null;#l=null;#a=null;#c=null;#h=!1;#u=!1;constructor(){super(),this.#e=this.attachInternals(),this._adoptInternals(this.#e)}setup(){Promise.resolve().then(()=>(oe(),Ne)).catch(()=>console.warn('[VB] comment-box: markdown-viewer failed to load (missing importmap for "marked"?)')),Promise.resolve().then(()=>(Ue(),Oe)).catch(()=>console.warn("[VB] comment-box: markdown-editor failed to load"));let e=[...this.querySelectorAll(':scope > [slot="toolbar"]'),...this.querySelectorAll(":scope > .comment-box-actions > .comment-box-toolbar > *")],t=this.querySelector(":scope > markdown-editor");if(!t){t=document.createElement("markdown-editor");let s=document.createElement("textarea");this.hasAttribute("value")&&(s.value=this.getAttribute("value")||""),t.appendChild(s)}this.#r=t,this.hasAttribute("placeholder")&&this.#r.setAttribute("placeholder",this.getAttribute("placeholder")||""),this.#t=document.createElement("div"),this.#t.className="comment-box-actions",this.#i=document.createElement("div"),this.#i.className="comment-box-toolbar",e.forEach(s=>this.#i?.appendChild(s)),e.length&&(this.#i.setAttribute("role","group"),this.#i.setAttribute("aria-label","Comment tools")),this.#t.appendChild(this.#i);let r=document.createElement("div");r.className="comment-box-buttons",this.#n=null,this.hasAttribute("data-show-cancel")&&(this.#n=this.#g(),r.appendChild(this.#n)),this.#s=document.createElement("button"),this.#s.type="button",this.#s.className="comment-box-submit",this.#s.textContent=this.getAttribute("submit-label")||"Comment",r.appendChild(this.#s),this.#t.appendChild(r),this.#l=null,this.#a=null,this.hasAttribute("data-max-length")&&(this.#l=document.createElement("span"),this.#l.className="comment-box-counter",this.#l.setAttribute("aria-hidden","true"),this.#t.appendChild(this.#l),this.#a=document.createElement("span"),this.#a.className="comment-box-status visually-hidden",this.#a.setAttribute("role","status"),this.#t.appendChild(this.#a)),this.replaceChildren(this.#r,this.#t),this.listen(this.#s,"click",this.#k),this.#n&&this.listen(this.#n,"click",this.#m),this.listen(this,"keydown",this.#A),this.#d(),this.listen(this.#r,"markdown-editor:upgraded",()=>this.#d()),this.#b(),this.#y(),this.#v(),this.#E()}teardown(){this.#c=null}get#o(){return this.#r?.textarea??this.#r?.querySelector("textarea")??null}#g(){let e=document.createElement("button");return e.type="button",e.className="comment-box-cancel",e.textContent=this.getAttribute("cancel-label")||"Cancel",e}#d(){let e=this.#o;e&&(this.#p(e),this.#b(),this.#v(),e!==this.#c&&(this.#c=e,this.listen(e,"input",this.#f),this.listen(e,"keydown",this.#x)))}#p(e=this.#o){if(!e)return;let t=this.#e.labels?.[0],r=this.getAttribute("label")||t?.textContent?.trim()||"Comment";e.setAttribute("aria-label",r)}attributeChangedCallback(e,t,r){!this.isConnected||!this.#r||(e==="value"?this.value=r??"":e==="placeholder"?r==null?this.#r.removeAttribute("placeholder"):this.#r.setAttribute("placeholder",r):e==="label"?this.#p():e==="disabled"?this.#b():e==="submit-label"?this.#s&&(this.#s.textContent=r||"Comment"):e==="cancel-label"?this.#n&&(this.#n.textContent=r||"Cancel"):e==="data-show-cancel"&&(this.hasAttribute("data-show-cancel")&&!this.#n&&this.#s?(this.#n=this.#g(),this.#s.before(this.#n),this.listen(this.#n,"click",this.#m),this.#b()):!this.hasAttribute("data-show-cancel")&&this.#n&&(this.#n.remove(),this.#n=null)))}#f=()=>{this.#y(),this.#v(),this.#E(),this.dispatchEvent(new CustomEvent("comment-box:input",{bubbles:!0,detail:{value:this.value,length:this.value.length}}))};#x=e=>{e.key==="Enter"&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),this.#k())};#A=e=>{if(e.key!=="Escape"||e.defaultPrevented||e.isComposing||!this.#n||this.#n.disabled)return;let t=e.target;t&&this.#i?.contains(t)||t===this.#o&&this.#r?.hasAttribute("data-tab-indent")||(e.preventDefault(),this.#m())};#k=()=>{if(this.#h||this.#S())return;if(!this.#e.validity.valid){this.#e.reportValidity(),this.#o?.focus();return}let e=this.value,t=[],r=!0,s=new CustomEvent("comment-box:submit",{bubbles:!0,cancelable:!0,detail:{value:e,waitUntil(a){if(!r)throw new DOMException("waitUntil() must be called while comment-box:submit is dispatching","InvalidStateError");t.push(Promise.resolve(a))}}}),i=this.dispatchEvent(s);if(r=!1,!!i){if(!t.length){this.clear();return}this.#w(!0),Promise.all(t).then(()=>{this.#w(!1),this.clear()},()=>{this.#w(!1),this.#o?.focus()})}};#m=()=>{let e=this.value;this.dispatchEvent(new CustomEvent("comment-box:cancel",{bubbles:!0,detail:{value:e}}))};#S(){return this.hasAttribute("disabled")||this.#u}#w(e){this.#h=e,e?this.setAttribute("aria-busy","true"):this.removeAttribute("aria-busy"),this.#b()}#b(){let e=this.#S(),t=this.#o;t&&(t.disabled=e,t.readOnly=this.#h),this.#s&&(this.#s.disabled=e,this.#h?this.#s.setAttribute("aria-disabled","true"):this.#s.removeAttribute("aria-disabled")),this.#n&&(this.#n.disabled=e)}#y(){this.#e.setFormValue(this.value)}#v(){let e=this.value,t=Number(this.getAttribute("data-min-length"))||0,r=Number(this.getAttribute("data-max-length"))||1/0,s=this.hasAttribute("required"),i=this.#o&&this.contains(this.#o)?this.#o:null;if(s&&e.length===0){this.#e.setValidity({valueMissing:!0},"Please add a comment.",i||void 0);return}if(e.length<t){this.#e.setValidity({tooShort:!0},`At least ${t} characters required.`,i||void 0);return}if(e.length>r){this.#e.setValidity({tooLong:!0},`No more than ${r} characters.`,i||void 0);return}this.#e.setValidity({})}#E(){if(!this.#l)return;let e=Number(this.getAttribute("data-max-length"))||0,t=this.value.length;if(this.#l.textContent=e?`${t} / ${e}`:String(t),this.#l.classList.toggle("is-over",e>0&&t>e),!this.#a)return;let r=e-t,s="";e&&r<0?s=`${-r} characters over the limit`:e&&r<=or(e)&&(s=`${r} characters remaining`),this.#a.textContent!==s&&(this.#a.textContent=s)}get value(){return this.#r?.value??""}set value(e){this.#r&&(this.#r.value=e==null?"":String(e),this.#y(),this.#v(),this.#E())}get busy(){return this.#h}clear(){this.value="",this.dispatchEvent(new CustomEvent("comment-box:input",{bubbles:!0,detail:{value:"",length:0}}))}focus(){this.#o?.focus()}formResetCallback(){this.value=this.getAttribute("value")??""}formStateRestoreCallback(e){e!=null&&(this.value=e)}formDisabledCallback(e){this.#u=e,this.#b()}get form(){return this.#e.form}get name(){return this.getAttribute("name")}get type(){return this.localName}get validity(){return this.#e.validity}get validationMessage(){return this.#e.validationMessage}checkValidity(){return this.#e.checkValidity()}reportValidity(){return this.#e.reportValidity()}};A("comment-box",ce);var cr=[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60]];function hr(n){if(!n)return null;try{let e=new URL(n,document.baseURI);return e.protocol==="http:"||e.protocol==="https:"?n:null}catch{return null}}var ur=0,he=class extends w{#e=null;#r=null;#t=0;setup(){this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Comments"),this.#e=this.querySelector(":scope > template[data-reply-form]"),this.#i().forEach(e=>this.#n(e)),this.listen(this,"click",this.#o),this.listen(this,"comment-box:submit",this.#p),this.listen(this,"comment-box:cancel",this.#f),this.#w(),this.#t=setInterval(()=>this.#w(),6e4)}teardown(){clearInterval(this.#t)}#i(){return[...this.querySelectorAll(":scope > article[data-comment]")]}#s(e){return this.querySelector(`:scope > article[data-comment][id="${CSS.escape(e)}"]`)}#n(e){if(e.dataset.decorated==="")return;e.dataset.decorated="";let t=this.#l(e);e.style.setProperty("--comment-depth",String(t)),this.#a(e),e.appendChild(this.#h(e))}#l(e){let t=0,r=e.dataset.parent,s=new Set;for(;r&&!s.has(r);){s.add(r);let i=this.#s(r);if(!i)break;t+=1,r=i.dataset.parent}return t}#a(e){e.querySelector(":scope > .comment-header")?.remove();let t=this.#c(e),r=e.querySelector(":scope > [data-comment-body]");r?e.insertBefore(t,r):e.prepend(t);let s=[...t.querySelectorAll(".comment-author, .comment-time")].map(i=>i.id);e.setAttribute("aria-labelledby",s.join(" "))}#c(e){let t=document.createElement("header");t.className="comment-header";let r=e.id||`comment-thread-${++ur}`,s=e.dataset.author||"Unknown",i=hr(e.dataset.authorHref),a=e.dataset.authorAvatar;if(a){let h=document.createElement("user-avatar"),c=document.createElement("img");c.src=a,c.alt="",c.loading="lazy",c.decoding="async",h.appendChild(c),t.appendChild(h)}let o=document.createElement(i?"a":"span");o.className="comment-author",o.id=`${r}-author`,o.textContent=s,i&&(o.href=i),t.appendChild(o);let l=e.dataset.time;if(l){let h=document.createElement("time");h.className="comment-time",h.id=`${r}-time`,h.setAttribute("datetime",l);let c=this.#b(l);c&&h.setAttribute("title",c),h.textContent=this.#S(l)||l,t.appendChild(h)}if(e.dataset.edited){let h=document.createElement("span");h.className="comment-edited";let c=this.#b(e.dataset.edited);c&&(h.title=`Edited ${c}`),h.textContent="(edited)",t.appendChild(h)}return t}#h(e){let t=document.createElement("footer");if(t.className="comment-footer",this.hasAttribute("data-disabled"))return t;t.setAttribute("role","group"),t.setAttribute("aria-label","Comment actions");let r=document.createElement("button");if(r.type="button",r.className="comment-action comment-reply",r.textContent="Reply",t.appendChild(r),e.hasAttribute("data-mine")){let s=document.createElement("button");s.type="button",s.className="comment-action comment-edit",s.textContent="Edit",t.appendChild(s);let i=document.createElement("button");i.type="button",i.className="comment-action comment-delete",i.textContent="Delete",t.appendChild(i)}return this.#u(e,t),t}#u(e,t=e.querySelector(":scope > .comment-footer")){if(!t)return;let r=e.dataset.author||"Unknown",s=e.dataset.time?this.#b(e.dataset.time):"",i=s?` from ${s}`:"";t.querySelector(".comment-reply")?.setAttribute("aria-label",`Reply to ${r}${i}`),t.querySelector(".comment-edit")?.setAttribute("aria-label",`Edit your comment${i}`),t.querySelector(".comment-delete")?.setAttribute("aria-label",`Delete your comment${i}`)}#o=e=>{let t=e.target.closest?.("button.comment-action");if(!t)return;let r=t.closest("article[data-comment]");!r||r.parentElement!==this||(t.classList.contains("comment-reply")?this.#g(r):t.classList.contains("comment-edit")?this.#A(r):t.classList.contains("comment-delete")&&this.#k(r))};#g(e){if(this.#r&&this.#x(!1),!this.#e)return;let r=this.#e.content.cloneNode(!0).firstElementChild??document.createElement("comment-box");r.hasAttribute("data-show-cancel")||r.setAttribute("data-show-cancel",""),r.localName==="comment-box"&&!r.hasAttribute("label")&&r.setAttribute("label",`Reply to ${e.dataset.author||"comment"}`);let s=document.createElement("div");s.className="comment-reply-form",s.setAttribute("data-parent",e.id||""),s.appendChild(r),e.appendChild(s),this.#r=s,requestAnimationFrame(()=>r.focus?.())}#d(e){let t=e.target.closest?.(".comment-reply-form");return t&&t===this.#r?t:null}#p=e=>{let t=this.#d(e);if(!t)return;let r=e,s=t.parentElement,i=[],a=!0,o=this.dispatchEvent(new CustomEvent("comment-thread:reply",{bubbles:!0,cancelable:!0,detail:{parentId:s.id,value:r.detail.value,waitUntil(h){if(!a)throw new DOMException("waitUntil() must be called while comment-thread:reply is dispatching","InvalidStateError");i.push(Promise.resolve(h))}}}));if(a=!1,!o){r.preventDefault();return}if(!i.length){this.#x(!0);return}let l=Promise.all(i);r.detail.waitUntil?.(l),l.then(()=>{this.#r===t&&this.#x(!0)},()=>{})};#f=e=>{this.#d(e)&&this.#x(!0)};#x(e){let t=this.#r;if(!t)return;let r=t.parentElement,s=t.contains(document.activeElement);t.remove(),this.#r=null,(e||s)&&r?.querySelector(":scope > .comment-footer > .comment-reply")?.focus()}#A(e){let r=e.querySelector(":scope > [data-comment-body]")?.textContent.trim()??"";this.dispatchEvent(new CustomEvent("comment-thread:edit-request",{bubbles:!0,detail:{commentId:e.id,value:r}}))}#k(e){this.dispatchEvent(new CustomEvent("comment-thread:delete-request",{bubbles:!0,detail:{commentId:e.id}}))}#m(){return this.closest("[lang]")?.lang||void 0}#S(e){let t=new Date(e).getTime();if(Number.isNaN(t))return"";let r=(t-Date.now())/1e3,s=new Intl.RelativeTimeFormat(this.#m(),{numeric:"auto"});for(let[i,a]of cr)if(Math.abs(r)>=a)return s.format(Math.trunc(r/a),i);return s.format(0,"second")}#w(){for(let e of this.querySelectorAll(":scope > article[data-comment] > .comment-header > time")){let t=e.getAttribute("datetime");if(!t)continue;let r=this.#S(t);r&&(e.textContent=r)}}#b(e){let t=new Date(e);return Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat(this.#m(),{dateStyle:"medium",timeStyle:"short"}).format(t)}#y(e,t){t.bodyText!=null?e.textContent=String(t.bodyText):t.bodyHtml!=null&&e.replaceChildren(q(String(t.bodyHtml))),"body"in t&&console.warn("[VB] comment-thread: `body` was removed \u2014 pass `bodyText` (plain text) or `bodyHtml` (sanitized HTML).")}addComment(e){let t=document.createElement("article");t.setAttribute("data-comment",""),t.id=e.id,t.dataset.author=e.author,e.authorHref&&(t.dataset.authorHref=e.authorHref),e.authorAvatar&&(t.dataset.authorAvatar=e.authorAvatar),t.dataset.time=e.time,e.parentId&&(t.dataset.parent=e.parentId),e.mine&&t.setAttribute("data-mine",""),e.edited&&(t.dataset.edited=e.edited);let r=document.createElement("div");r.setAttribute("data-comment-body",""),this.#y(r,e),t.appendChild(r);let s=e.parentId?this.#v(e.parentId):null;if(s)s.after(t);else if(this.#e?.parentNode===this)this.insertBefore(t,this.#e);else{let i=this.#i(),a=i[i.length-1];a?a.after(t):this.appendChild(t)}return this.#n(t),t}#v(e){let t=this.#s(e);if(!t)return null;let r=new Set([e]),s=t,i=t.nextElementSibling;for(;i instanceof HTMLElement&&i.matches("article[data-comment]")&&r.has(i.dataset.parent??"");)i.id&&r.add(i.id),s=i,i=i.nextElementSibling;return s}updateComment(e,t={}){let r=this.#s(e);if(!r)return;let s=r.querySelector(":scope > [data-comment-body]");s&&this.#y(s,t),t.author!=null&&(r.dataset.author=t.author),t.edited!=null&&(r.dataset.edited=t.edited),this.#a(r),this.#u(r)}removeComment(e){this.#s(e)?.remove()}};A("comment-thread",he);export{he as CommentThread};
61
61
  //# sourceMappingURL=comment-thread.js.map
@@ -1,2 +1,2 @@
1
- var c=class extends HTMLElement{#t=[];#e;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.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,i,n){e.addEventListener(t,i,n),this.#t.push(()=>e.removeEventListener(t,i,n))}_reinit(){for(let e of this.#t)e();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,t){this.#e||(this.#e=this.attachInternals());let i=this.#e.states;try{t?i.add(e):i.delete(e)}catch{let n=`--${e}`;t?i.add(n):i.delete(n)}}_adoptInternals(e){this.#e||(this.#e=e)}#i(){return this.constructor.formAssociated&&this.#e?this.#e: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 b=window.matchMedia("(prefers-reduced-motion: reduce)");var u=new Map;function f(s,e,t={}){let i=t.priority??10,n={impl:e,bundle:t.bundle,contract:t.contract,priority:i},r=u.get(s);if(customElements.get(s)){if(!r||r.priority>=i){r&&r.priority===i&&r.impl!==e&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=i){r.priority===i&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${r.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}u.set(s,n),customElements.define(s,e)}var h=0,a=class extends c{#t=null;#e=null;setup(){if(this.#t=this.querySelector(":scope > button"),this.#e=this.querySelector(":scope > .comment-wc-reason"),!this.#t){let t=document.createElement("button");t.type="button";let i=document.createElement("icon-wc");i.setAttribute("name","message-circle"),i.setAttribute("size","sm"),i.setAttribute("aria-hidden","true"),t.appendChild(i);let n=document.createElement("span");n.className="comment-wc-reason visually-hidden",n.id=`comment-wc-reason-${++h}`,n.textContent="Comments are unavailable: this content has no review surface.",this.append(t,n),this.#t=t,this.#e=n}this.#n(),this.listen(this,"click",this.#r);let e=this.closest("selection-menu");e&&this.listen(e,"toggle",()=>this.#n())}#i(){let e=this.closest("review-surface");if(e)return e;let t=this.closest("selection-menu")?.getAttribute("for");return t?document.querySelector(`review-surface[for="${CSS.escape(t)}"]`):null}#n(){let e=this.#t;if(!e)return;!!this.#i()?(e.removeAttribute("aria-disabled"),e.removeAttribute("aria-describedby"),e.setAttribute("aria-label","Add comment")):(e.setAttribute("aria-disabled","true"),e.setAttribute("aria-label","Add comment"),this.#e&&e.setAttribute("aria-describedby",this.#e.id))}#r=e=>{if(!this.#t?.contains(e.target))return;this.#n();let t=this.#i();if(!t)return;let i=this.closest("selection-menu");if(!i)return;let n=i.getSelection();if(!n)return;let r=n.range.getBoundingClientRect(),o=t.getBoundingClientRect(),d=(r.left+r.width/2-o.left)/o.width*100,l=(r.top-o.top)/o.height*100;typeof t.addPin=="function"&&t.addPin({x:d,y:l,text:n.text}),this.dispatchEvent(new CustomEvent("comment-wc:created",{detail:{text:n.text,x:d,y:l},bubbles:!0})),i.dismiss()}};f("comment-wc",a);
1
+ var a=class extends HTMLElement{#t=[];#e;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.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,r,n){e.addEventListener(t,r,n),this.#t.push(()=>e.removeEventListener(t,r,n))}_reinit(){for(let e of this.#t)e();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,t){this.#e||(this.#e=this.attachInternals());let r=this.#e.states;try{t?r.add(e):r.delete(e)}catch{let n=`--${e}`;t?r.add(n):r.delete(n)}}_adoptInternals(e){this.#e||(this.#e=e)}#r(){return this.constructor.formAssociated&&this.#e?this.#e: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 v=window.matchMedia("(prefers-reduced-motion: reduce)");var l=new Map;function f(i,e,t={}){let r=t.priority??10,n={impl:e,bundle:t.bundle,contract:t.contract,priority:r},s=l.get(i);if(customElements.get(i)){if(!s||s.priority>=r){s&&s.priority===r&&s.impl!==e&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=r){s.priority===r&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${s.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}l.set(i,n),customElements.define(i,e)}var h=0,c=class extends a{#t=null;#e=null;setup(){if(this.#t=this.querySelector(":scope > button"),this.#e=this.querySelector(":scope > .comment-wc-reason"),!this.#t){let t=document.createElement("button");t.type="button";let r=document.createElement("icon-wc");r.setAttribute("name","message-circle"),r.setAttribute("size","sm"),r.setAttribute("aria-hidden","true"),t.appendChild(r);let n=document.createElement("span");n.className="comment-wc-reason visually-hidden",n.id=`comment-wc-reason-${++h}`,n.textContent="Comments are unavailable: this content has no review surface.",this.append(t,n),this.#t=t,this.#e=n}this.#n(),this.listen(this,"click",this.#s);let e=this.closest("selection-menu");e&&this.listen(e,"toggle",()=>this.#n())}#r(){let e=this.closest("review-surface");if(e)return e;let t=this.closest("selection-menu")?.getAttribute("for");return t?document.querySelector(`review-surface[for="${CSS.escape(t)}"]`):null}#n(){let e=this.#t;if(!e)return;!!this.#r()?(e.removeAttribute("aria-disabled"),e.removeAttribute("aria-describedby"),e.setAttribute("aria-label","Add comment")):(e.setAttribute("aria-disabled","true"),e.setAttribute("aria-label","Add comment"),this.#e&&e.setAttribute("aria-describedby",this.#e.id))}#s=e=>{if(!this.#t?.contains(e.target))return;this.#n();let t=this.#r();if(!t)return;let r=this.closest("selection-menu");if(!r)return;let n=r.getSelection();if(!n)return;let s=n.range.getBoundingClientRect(),o=t.getBoundingClientRect(),d=(s.left+s.width/2-o.left)/o.width*100,u=(s.top-o.top)/o.height*100;typeof t.addPin=="function"&&t.addPin({x:d,y:u,text:n.text}),this.dispatchEvent(new CustomEvent("comment-wc:created",{detail:{text:n.text,x:d,y:u},bubbles:!0})),r.dismiss()}};f("comment-wc",c);
2
2
  //# sourceMappingURL=comment-wc.js.map
@@ -1,2 +1,2 @@
1
- var h=window.matchMedia("(prefers-reduced-motion: reduce)");var c=new Map;function u(n,t,e={}){let i=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:i},r=c.get(n);if(customElements.get(n)){if(!r||r.priority>=i){r&&r.priority===i&&r.impl!==t&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${n}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=i){r.priority===i&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${r.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}c.set(n,s),customElements.define(n,t)}var o=class extends HTMLElement{#t=[];#e;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,i,s){t.addEventListener(e,i,s),this.#t.push(()=>t.removeEventListener(e,i,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.#e||(this.#e=this.attachInternals());let i=this.#e.states;try{e?i.add(t):i.delete(t)}catch{let s=`--${t}`;e?i.add(s):i.delete(s)}}_adoptInternals(t){this.#e||(this.#e=t)}#i(){return this.constructor.formAssociated&&this.#e?this.#e: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 d="Comparison slider";function a(n){if(n===null||n.trim()==="")return 50;let t=Number(n);return Number.isNaN(t)?50:Math.min(100,Math.max(0,t))}var l=class extends o{static observedAttributes=["position","label","aria-label"];#t=null;#e=!1;#i=!1;#r=50;setup(){let t=[...this.children].filter(e=>!e.classList.contains("comparison-divider"));return t.length<2?!1:(t.length>2&&console.warn("[compare-surface] Expected exactly 2 children; extra children are hidden."),this.#t=document.createElement("div"),this.#t.className="comparison-divider",this.#t.setAttribute("role","slider"),this.#t.setAttribute("aria-valuemin","0"),this.#t.setAttribute("aria-valuemax","100"),this.#t.setAttribute("aria-orientation","horizontal"),this.#t.setAttribute("tabindex","0"),this.#o(),this.appendChild(this.#t),this.#n(a(this.getAttribute("position"))),this.listen(this.#t,"pointerdown",this.#c),this.listen(this.#t,"pointermove",this.#u),this.listen(this.#t,"pointerup",this.#s),this.listen(this.#t,"pointercancel",this.#s),this.listen(this.#t,"lostpointercapture",this.#s),this.listen(this.#t,"keydown",this.#d),!0)}teardown(){this.#t?.remove(),this.#t=null,this.#e=!1}attributeChangedCallback(t,e,i){if(!(!this.#t||e===i))if(t==="position"){if(this.#i)return;this.#n(a(i))}else this.#o()}#o(){if(!this.#t)return;let t=this.getAttribute("label")||this.getAttribute("aria-label")||d;this.#t.setAttribute("aria-label",t)}get#a(){return getComputedStyle(this).direction==="rtl"}#c=t=>{t.preventDefault(),this.#e=!0,this.#t?.setPointerCapture(t.pointerId)};#u=t=>{if(!this.#e)return;let e=this.getBoundingClientRect();if(!e.width)return;let i=this.#a?e.right-t.clientX:t.clientX-e.left;this.#l(i/e.width*100)};#s=t=>{this.#e&&(this.#e=!1,this.#t?.hasPointerCapture(t.pointerId)&&this.#t.releasePointerCapture(t.pointerId))};#d=t=>{let e=t.shiftKey?10:1,i=this.#a?-1:1,s=this.#r,r;switch(t.key){case"ArrowRight":r=s+e*i;break;case"ArrowLeft":r=s-e*i;break;case"ArrowUp":r=s+e;break;case"ArrowDown":r=s-e;break;case"PageUp":r=s+10;break;case"PageDown":r=s-10;break;case"Home":r=0;break;case"End":r=100;break;default:return}t.preventDefault(),this.#l(r)};#l(t){let e=this.#r;if(this.#n(Math.min(100,Math.max(0,t))),this.#r!==e){this.#i=!0;try{this.setAttribute("position",String(this.#r))}finally{this.#i=!1}this.dispatchEvent(new CustomEvent("compare-surface:change",{detail:{position:this.#r},bubbles:!0}))}}#n(t){this.#r=Math.round(t),this.style.setProperty("--_position",`${t}%`),this.#t&&(this.#t.setAttribute("aria-valuenow",String(this.#r)),this.#t.setAttribute("aria-valuetext",`${this.#r}%`))}get position(){return this.#t?this.#r:Math.round(a(this.getAttribute("position")))}set position(t){let e=Number(t),i=Math.round(Math.min(100,Math.max(0,Number.isNaN(e)?0:e)));this.setAttribute("position",String(i))}};u("compare-surface",l);export{l as CompareSurface};
1
+ var p=window.matchMedia("(prefers-reduced-motion: reduce)");var d=new Map;function l(n,t,e={}){let r=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:r},i=d.get(n);if(customElements.get(n)){if(!i||i.priority>=r){i&&i.priority===r&&i.impl!==t&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${n}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=r){i.priority===r&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${i.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}d.set(n,s),customElements.define(n,t)}var o=class extends HTMLElement{#t=[];#e;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,r,s){t.addEventListener(e,r,s),this.#t.push(()=>t.removeEventListener(e,r,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.#e||(this.#e=this.attachInternals());let r=this.#e.states;try{e?r.add(t):r.delete(t)}catch{let s=`--${t}`;e?r.add(s):r.delete(s)}}_adoptInternals(t){this.#e||(this.#e=t)}#r(){return this.constructor.formAssociated&&this.#e?this.#e: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 u="Comparison slider";function a(n){if(n===null||n.trim()==="")return 50;let t=Number(n);return Number.isNaN(t)?50:Math.min(100,Math.max(0,t))}var c=class extends o{static observedAttributes=["position","label","aria-label","aria-labelledby"];#t=null;#e=!1;#r=!1;#i=50;#s=!1;setup(){let t=[...this.children].filter(e=>!e.classList.contains("comparison-divider"));return t.length<2?!1:(t.length>2&&console.warn("[compare-surface] Expected exactly 2 children; extra children are hidden."),this.#t=document.createElement("div"),this.#t.className="comparison-divider",this.#t.setAttribute("role","slider"),this.#t.setAttribute("aria-valuemin","0"),this.#t.setAttribute("aria-valuemax","100"),this.#t.setAttribute("aria-orientation","horizontal"),this.#t.setAttribute("tabindex","0"),this.#c(),this.#a(),this.appendChild(this.#t),this.#o(a(this.getAttribute("position"))),this.listen(this.#t,"pointerdown",this.#u),this.listen(this.#t,"pointermove",this.#h),this.listen(this.#t,"pointerup",this.#n),this.listen(this.#t,"pointercancel",this.#n),this.listen(this.#t,"lostpointercapture",this.#n),this.listen(this.#t,"keydown",this.#f),!0)}teardown(){this.#t?.remove(),this.#t=null,this.#e=!1,this.#s&&this.removeAttribute("role"),this.#s=!1}attributeChangedCallback(t,e,r){if(!(!this.#t||e===r))if(t==="position"){if(this.#r)return;this.#o(a(r))}else this.#c(),this.#a()}#a(){let t=this.hasAttribute("aria-label")||this.hasAttribute("aria-labelledby");t&&!this.hasAttribute("role")?(this.setAttribute("role","group"),this.#s=!0):!t&&this.#s&&(this.removeAttribute("role"),this.#s=!1)}#c(){if(!this.#t)return;let t=this.getAttribute("label")||this.getAttribute("aria-label")||u;this.#t.setAttribute("aria-label",t)}get#d(){return getComputedStyle(this).direction==="rtl"}#u=t=>{t.preventDefault(),this.#e=!0,this.#t?.setPointerCapture(t.pointerId)};#h=t=>{if(!this.#e)return;let e=this.getBoundingClientRect();if(!e.width)return;let r=this.#d?e.right-t.clientX:t.clientX-e.left;this.#l(r/e.width*100)};#n=t=>{this.#e&&(this.#e=!1,this.#t?.hasPointerCapture(t.pointerId)&&this.#t.releasePointerCapture(t.pointerId))};#f=t=>{let e=t.shiftKey?10:1,r=this.#d?-1:1,s=this.#i,i;switch(t.key){case"ArrowRight":i=s+e*r;break;case"ArrowLeft":i=s-e*r;break;case"ArrowUp":i=s+e;break;case"ArrowDown":i=s-e;break;case"PageUp":i=s+10;break;case"PageDown":i=s-10;break;case"Home":i=0;break;case"End":i=100;break;default:return}t.preventDefault(),this.#l(i)};#l(t){let e=this.#i;if(this.#o(Math.min(100,Math.max(0,t))),this.#i!==e){this.#r=!0;try{this.setAttribute("position",String(this.#i))}finally{this.#r=!1}this.dispatchEvent(new CustomEvent("compare-surface:change",{detail:{position:this.#i},bubbles:!0}))}}#o(t){this.#i=Math.round(t),this.style.setProperty("--_position",`${t}%`),this.#t&&(this.#t.setAttribute("aria-valuenow",String(this.#i)),this.#t.setAttribute("aria-valuetext",`${this.#i}%`))}get position(){return this.#t?this.#i:Math.round(a(this.getAttribute("position")))}set position(t){let e=Number(t),r=Math.round(Math.min(100,Math.max(0,Number.isNaN(e)?0:e)));this.setAttribute("position",String(r))}};l("compare-surface",c);export{c as CompareSurface};
2
2
  //# sourceMappingURL=compare-surface.js.map