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,4 +1,4 @@
1
- var U=window.matchMedia("(prefers-reduced-motion: reduce)");var v=new Map;function w(i,e,t={}){let n=t.priority??10,r={impl:e,bundle:t.bundle,contract:t.contract,priority:n},a=v.get(i);if(customElements.get(i)){if(!a||a.priority>=n){a&&a.priority===n&&a.impl!==e&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${a.bundle}" (priority ${a.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${a.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(a&&a.priority>=n){a.priority===n&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${a.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}v.set(i,r),customElements.define(i,e)}var h=class extends HTMLElement{#t=[];#i;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,n,r){e.addEventListener(t,n,r),this.#t.push(()=>e.removeEventListener(t,n,r))}_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.#i||(this.#i=this.attachInternals());let n=this.#i.states;try{t?n.add(e):n.delete(e)}catch{let r=`--${e}`;t?n.add(r):n.delete(r)}}_adoptInternals(e){this.#i||(this.#i=e)}#n(){return this.constructor.formAssociated&&this.#i?this.#i:null}get validity(){return this.#n()?.validity}get validationMessage(){return this.#n()?.validationMessage??""}get willValidate(){return this.#n()?.willValidate??!1}get form(){return this.#n()?.form??null}checkValidity(){return this.#n()?.checkValidity()??!0}reportValidity(){return this.#n()?.reportValidity()??!0}};var S=["position:absolute","inline-size:1px","block-size:1px","padding:0","margin:-1px","overflow:hidden","clip-path:inset(50%)","white-space:nowrap","border:0"].join(";"),E=new WeakMap;function T(i,e){let t=E.get(e);t||E.set(e,t=new Map);let n=t.get(i);if(!n||!n.region.isConnected){let a=(e.ownerDocument||document).createElement("span");a.setAttribute("data-vb-announcer",i),a.setAttribute("role",i==="assertive"?"alert":"status"),a.setAttribute("aria-live",i),a.setAttribute("aria-atomic","true"),a.style.cssText=S,e.appendChild(a),n={region:a},t.set(i,n)}return n}function A(i,{politeness:e="polite",root:t}={}){let n=String(i??"").trim();if(!n||typeof document>"u")return null;let r=t||document.body;if(!r)return null;let s=T(e==="assertive"?"assertive":"polite",r);return clearTimeout(s.write),clearTimeout(s.clear),s.region.textContent="",s.write=setTimeout(()=>{s.region.textContent=n,s.clear=setTimeout(()=>{s.region.textContent=""},7e3)},50),s.region}function c(i,e,t,n){let r=`data-label-${e}`,s=i?.closest?.(`[${r}]`)?.getAttribute(r)||t;return n?s.replace(/\{(\w+)\}/g,(l,u)=>u in n?String(n[u]):l):s}var C=1500,k="[data-copy], [data-copy-target], [data-paste-target]",d={copied:"Copied to clipboard",pasted:"Pasted from clipboard","copy-failed":"Copy failed","copy-failed-selected":"Copy failed. Text selected, press Ctrl+C to copy","paste-failed":"Paste failed"},m=new WeakMap;function $(i){if(typeof document.execCommand!="function"||!document.body)return!1;let e=document.activeElement,t=document.createElement("textarea");t.value=i,t.setAttribute("readonly",""),t.setAttribute("aria-hidden","true"),t.style.cssText="position:fixed;inset-block-start:0;inset-inline-start:0;opacity:0;pointer-events:none",document.body.appendChild(t),t.select();let n=!1;try{n=document.execCommand("copy")}catch{n=!1}return t.remove(),e?.focus?.({preventScroll:!0}),n}function L(i){if(!i)return!1;if(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement)return i.focus(),i.select(),!0;let e=window.getSelection?.();if(!e)return!1;let t=document.createRange();return t.selectNodeContents(i),e.removeAllRanges(),e.addRange(t),!e.isCollapsed}async function f(i,e={}){if(i==null||i==="")return!1;let{button:t,duration:n=C}=e,r=!1,a=null;try{if(!navigator.clipboard?.writeText)throw new Error("Clipboard API unavailable");await navigator.clipboard.writeText(i),r=!0}catch(l){a=l,r=$(i)}if(r)return p({button:t,duration:n,state:"copied",eventName:"copy:done",eventDetail:{text:i},message:e.announceMessage??c(t,"copied",d.copied)}),!0;let s=L(e.source);return p({button:t,duration:n,state:"failed",eventName:"copy:error",eventDetail:{text:i,error:a},message:e.failureMessage??c(t,"copy-failed",s?d["copy-failed-selected"]:d["copy-failed"])}),!1}function p({button:i,duration:e,message:t,eventDetail:n,state:r,eventName:a}){if(i){i.dataset.state=r;let s=m.get(i);s&&clearTimeout(s),m.set(i,setTimeout(()=>{i.dataset.state===r&&delete i.dataset.state,m.delete(i)},e)),i.dispatchEvent(new CustomEvent(a,{bubbles:!0,detail:n}))}A(t,{politeness:r==="failed"?"assertive":"polite"})}async function M(i,e={}){let{button:t,duration:n=C}=e,r;try{if(!navigator.clipboard?.readText)throw new Error("Clipboard API unavailable");r=await navigator.clipboard.readText()}catch(a){return p({button:t,duration:n,state:"failed",eventName:"paste:error",eventDetail:{target:i,error:a},message:e.failureMessage??c(t,"paste-failed",d["paste-failed"])}),null}return i&&(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement?i.value=r:i.textContent=r,i.dispatchEvent(new Event("input",{bubbles:!0}))),p({button:t,duration:n,state:"pasted",eventName:"paste:done",eventDetail:{text:r,target:i},message:e.announceMessage??c(t,"pasted",d.pasted)}),r}function x(i){let e=i.dataset.copyTarget;if(!e)return null;try{return document.querySelector(e)}catch{return null}}function N(i){if(i.dataset.copy)return i.dataset.copy;let e=x(i);if(!e)return"";let t=i.dataset.copyAttr;return t?e.getAttribute(t)??"":e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?e.value:e.textContent??""}function q(i){let e=i.target?.closest?.(k);if(!e||e.matches(':disabled, [aria-disabled="true"]'))return;if(e.dataset.pasteTarget){let n=null;try{n=document.querySelector(e.dataset.pasteTarget)}catch{}if(!n)return;M(n,{button:e});return}let t=N(e);t&&f(t,{button:e,source:x(e)??void 0})}typeof document<"u"&&!document.__vbCopyDelegated&&(document.__vbCopyDelegated=!0,document.addEventListener("click",q));var b=new Map([["x",{label:"X",iconName:"twitter",buildUrl:({url:i,title:e})=>`https://x.com/intent/post?url=${o(i)}&text=${o(e)}`}],["twitter",{label:"X",iconName:"twitter",buildUrl:({url:i,title:e})=>`https://x.com/intent/post?url=${o(i)}&text=${o(e)}`}],["facebook",{label:"Facebook",iconName:"facebook",buildUrl:({url:i})=>`https://www.facebook.com/sharer/sharer.php?u=${o(i)}`}],["linkedin",{label:"LinkedIn",iconName:"linkedin",buildUrl:({url:i})=>`https://www.linkedin.com/sharing/share-offsite/?url=${o(i)}`}],["whatsapp",{label:"WhatsApp",iconName:"whatsapp",iconSet:"custom",buildUrl:({url:i,title:e})=>`https://wa.me/?text=${o(`${e} ${i}`)}`}],["telegram",{label:"Telegram",iconName:"telegram",iconSet:"custom",buildUrl:({url:i,title:e})=>`https://t.me/share/url?url=${o(i)}&text=${o(e)}`}],["bluesky",{label:"Bluesky",iconName:"bluesky",iconSet:"custom",buildUrl:({url:i,title:e})=>`https://bsky.app/intent/compose?text=${o(`${e} ${i}`)}`}],["mastodon",{label:"Mastodon",iconName:"mastodon",iconSet:"custom",buildUrl:({url:i,title:e},t="mastodon.social")=>`https://${t}/share?text=${o(`${e} ${i}`)}`}],["email",{label:"Email",iconName:"mail",buildUrl:({url:i,title:e,text:t})=>`mailto:?subject=${o(e)}&body=${o(`${t}
1
+ var U=window.matchMedia("(prefers-reduced-motion: reduce)");var v=new Map;function w(r,e,t={}){let n=t.priority??10,i={impl:e,bundle:t.bundle,contract:t.contract,priority:n},s=v.get(r);if(customElements.get(r)){if(!s||s.priority>=n){s&&s.priority===n&&s.impl!==e&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=n){s.priority===n&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${s.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}v.set(r,i),customElements.define(r,e)}var h=class extends HTMLElement{#e=[];#t;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let e of this.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,n,i){e.addEventListener(t,n,i),this.#e.push(()=>e.removeEventListener(t,n,i))}_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.#t||(this.#t=this.attachInternals());let n=this.#t.states;try{t?n.add(e):n.delete(e)}catch{let i=`--${e}`;t?n.add(i):n.delete(i)}}_adoptInternals(e){this.#t||(this.#t=e)}#n(){return this.constructor.formAssociated&&this.#t?this.#t:null}get validity(){return this.#n()?.validity}get validationMessage(){return this.#n()?.validationMessage??""}get willValidate(){return this.#n()?.willValidate??!1}get form(){return this.#n()?.form??null}checkValidity(){return this.#n()?.checkValidity()??!0}reportValidity(){return this.#n()?.reportValidity()??!0}};var x=["position:absolute","inline-size:1px","block-size:1px","padding:0","margin:-1px","overflow:hidden","clip-path:inset(50%)","white-space:nowrap","border:0"].join(";"),E=new WeakMap;function T(r,e){let t=E.get(e);t||E.set(e,t=new Map);let n=t.get(r);if(!n||!n.region.isConnected){let s=(e.ownerDocument||document).createElement("span");s.setAttribute("data-vb-announcer",r),s.setAttribute("role",r==="assertive"?"alert":"status"),s.setAttribute("aria-live",r),s.setAttribute("aria-atomic","true"),s.style.cssText=x,e.appendChild(s),n={region:s},t.set(r,n)}return n}function A(r,{politeness:e="polite",root:t}={}){let n=String(r??"").trim();if(!n||typeof document>"u")return null;let i=t||document.body;if(!i)return null;let o=T(e==="assertive"?"assertive":"polite",i);return clearTimeout(o.write),clearTimeout(o.clear),o.region.textContent="",o.write=setTimeout(()=>{o.region.textContent=n,o.clear=setTimeout(()=>{o.region.textContent=""},7e3)},50),o.region}function c(r,e,t,n){let i=`data-label-${e}`,o=r?.closest?.(`[${i}]`)?.getAttribute(i)||t;return n?o.replace(/\{(\w+)\}/g,(l,u)=>u in n?String(n[u]):l):o}var C=1500,$="[data-copy], [data-copy-target], [data-paste-target]",d={copied:"Copied to clipboard",pasted:"Pasted from clipboard","copy-failed":"Copy failed","copy-failed-selected":"Copy failed. Text selected, press Ctrl+C to copy","paste-failed":"Paste failed"},m=new WeakMap;function k(r){if(typeof document.execCommand!="function"||!document.body)return!1;let e=document.activeElement,t=document.createElement("textarea");t.value=r,t.setAttribute("readonly",""),t.setAttribute("aria-hidden","true"),t.style.cssText="position:fixed;inset-block-start:0;inset-inline-start:0;opacity:0;pointer-events:none",document.body.appendChild(t),t.select();let n=!1;try{n=document.execCommand("copy")}catch{n=!1}return t.remove(),e?.focus?.({preventScroll:!0}),n}function L(r){if(!r)return!1;if(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement)return r.focus(),r.select(),!0;let e=window.getSelection?.();if(!e)return!1;let t=document.createRange();return t.selectNodeContents(r),e.removeAllRanges(),e.addRange(t),!e.isCollapsed}async function p(r,e={}){if(r==null||r==="")return!1;let{button:t,duration:n=C}=e,i=!1,s=null;try{if(!navigator.clipboard?.writeText)throw new Error("Clipboard API unavailable");await navigator.clipboard.writeText(r),i=!0}catch(l){s=l,i=k(r)}if(i)return f({button:t,duration:n,state:"copied",eventName:"copy:done",eventDetail:{text:r},message:e.announceMessage??c(t,"copied",d.copied)}),!0;let o=L(e.source);return f({button:t,duration:n,state:"failed",eventName:"copy:error",eventDetail:{text:r,error:s},message:e.failureMessage??c(t,"copy-failed",o?d["copy-failed-selected"]:d["copy-failed"])}),!1}function f({button:r,duration:e,message:t,eventDetail:n,state:i,eventName:s}){if(r){r.dataset.state=i;let o=m.get(r);o&&clearTimeout(o),m.set(r,setTimeout(()=>{r.dataset.state===i&&delete r.dataset.state,m.delete(r)},e)),r.dispatchEvent(new CustomEvent(s,{bubbles:!0,detail:n}))}A(t,{politeness:i==="failed"?"assertive":"polite"})}async function M(r,e={}){let{button:t,duration:n=C}=e,i;try{if(!navigator.clipboard?.readText)throw new Error("Clipboard API unavailable");i=await navigator.clipboard.readText()}catch(s){return f({button:t,duration:n,state:"failed",eventName:"paste:error",eventDetail:{target:r,error:s},message:e.failureMessage??c(t,"paste-failed",d["paste-failed"])}),null}return r&&(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement?r.value=i:r.textContent=i,r.dispatchEvent(new Event("input",{bubbles:!0}))),f({button:t,duration:n,state:"pasted",eventName:"paste:done",eventDetail:{text:i,target:r},message:e.announceMessage??c(t,"pasted",d.pasted)}),i}function S(r){let e=r.dataset.copyTarget;if(!e)return null;try{return document.querySelector(e)}catch{return null}}function P(r){if(r.dataset.copy)return r.dataset.copy;let e=S(r);if(!e)return"";let t=r.dataset.copyAttr;return t?e.getAttribute(t)??"":e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?e.value:e.textContent??""}function _(r){let e=r.target?.closest?.($);if(!e||e.matches(':disabled, [aria-disabled="true"]'))return;if(e.dataset.pasteTarget){let n=null;try{n=document.querySelector(e.dataset.pasteTarget)}catch{}if(!n)return;M(n,{button:e});return}let t=P(e);t&&p(t,{button:e,source:S(e)??void 0})}typeof document<"u"&&!document.__vbCopyDelegated&&(document.__vbCopyDelegated=!0,document.addEventListener("click",_));var b=new Map([["x",{label:"X",iconName:"twitter",buildUrl:({url:r,title:e})=>`https://x.com/intent/post?url=${a(r)}&text=${a(e)}`}],["twitter",{label:"X",iconName:"twitter",buildUrl:({url:r,title:e})=>`https://x.com/intent/post?url=${a(r)}&text=${a(e)}`}],["facebook",{label:"Facebook",iconName:"facebook",buildUrl:({url:r})=>`https://www.facebook.com/sharer/sharer.php?u=${a(r)}`}],["linkedin",{label:"LinkedIn",iconName:"linkedin",buildUrl:({url:r})=>`https://www.linkedin.com/sharing/share-offsite/?url=${a(r)}`}],["whatsapp",{label:"WhatsApp",iconName:"whatsapp",iconSet:"custom",buildUrl:({url:r,title:e})=>`https://wa.me/?text=${a(`${e} ${r}`)}`}],["telegram",{label:"Telegram",iconName:"telegram",iconSet:"custom",buildUrl:({url:r,title:e})=>`https://t.me/share/url?url=${a(r)}&text=${a(e)}`}],["bluesky",{label:"Bluesky",iconName:"bluesky",iconSet:"custom",buildUrl:({url:r,title:e})=>`https://bsky.app/intent/compose?text=${a(`${e} ${r}`)}`}],["mastodon",{label:"Mastodon",iconName:"mastodon",iconSet:"custom",buildUrl:({url:r,title:e},t="mastodon.social")=>`https://${t}/share?text=${a(`${e} ${r}`)}`}],["email",{label:"Email",iconName:"mail",buildUrl:({url:r,title:e,text:t})=>`mailto:?subject=${a(e)}&body=${a(`${t}
2
2
 
3
- ${i}`)}`}],["copy",{label:"Copy link",iconName:"link",buildUrl:()=>""}]]),y="x,linkedin,bluesky,mastodon,whatsapp,email,copy";function o(i){return encodeURIComponent(i)}var D={sharePage:"Share this page",shareOn:"Share on {platform}",copy:"Copy link",copied:"Copied!",linkCopied:"Link copied to clipboard",shareSelection:"Share selection",selectionCopied:"Selection copied"},R=/\{(url|title|text)\}/;function I(i,e){let t=a=>encodeURIComponent(a).replace(/-/g,"%2D"),n=e.replace(/\s+/g," ").trim().split(" "),r=n.length>10?`${t(n.slice(0,4).join(" "))},${t(n.slice(-4).join(" "))}`:t(n.join(" "));return`${i.split("#")[0]}#:~:text=${r}`}var g=class extends h{#t;#i;#n;#a={};#m=new WeakMap;#r="";#o=null;#e=null;#c=!1;get url(){return this.#a.url??this.#t}set url(e){this.#d("url",e)}get shareTitle(){return this.#a.title??this.#i??""}set shareTitle(e){this.#d("title",e)}get text(){return this.#a.text??this.#n}set text(e){this.#d("text",e)}#d(e,t){t==null?delete this.#a[e]:this.#a[e]=String(t),this.hasAttribute("data-upgraded")&&(this.#b(),this.#y())}setup(){if(this.#b(),this.#v(),this.closest("selection-menu")){this.#w(),this.setAttribute("data-tier-resolved","selection");return}this.#r==="native"?this.#E():this.#r==="hidden"?this.style.display="none":this.children.length>0?this.#C():this.#A(),this.setAttribute("data-tier-resolved",this.#r)}teardown(){this.removeAttribute("data-tier-resolved"),this.#r==="hidden"&&this.style.removeProperty("display"),this.#o&&(clearTimeout(this.#o),this.#o=null);for(let e of this.querySelectorAll(".share-label[data-original]"))e.textContent=e.dataset.original??"",delete e.dataset.original;this.#e&&(this.#e.removeEventListener("click",this.#p),this.#c&&this.#e.remove(),this.#e=null,this.#c=!1),this.querySelector(":scope > .share-trigger")?.remove(),this.querySelector(":scope > .share-selection")?.remove()}async share(){return this.#r==="native"?this.#g():this.#f()}#s(e){let t=`data-label-${e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}`;return this.getAttribute(t)||D[e]}#b(){this.#t=this.#a.url||this.getAttribute("url")||document.querySelector('link[rel~="canonical" i]')?.href||location.href,this.#i=this.#a.title??(this.getAttribute("title")||document.querySelector('meta[property="og:title"]')?.getAttribute("content")||document.title),this.#n=this.#a.text??(this.getAttribute("text")||document.querySelector('meta[name="description"]')?.getAttribute("content")||document.querySelector('meta[property="og:description"]')?.getAttribute("content")||"")}#u(){return{url:this.#t||"",title:this.#i||"",text:this.#n||""}}#v(){let e=this.getAttribute("tier");if(e==="platforms"||e==="native"){e==="native"&&!navigator.share?this.#r="hidden":this.#r=e;return}if((this.getAttribute("platforms")||y)==="native-only"){this.#r=typeof navigator.share=="function"?"native":"hidden";return}this.#r=typeof navigator.share=="function"?"native":"platforms"}#h(e){let t=document.createElement("span");return t.className="share-label",t.textContent=e,t}#l(e,t){let n=document.createElement("icon-wc");return n.setAttribute("name",e),n.setAttribute("size","sm"),t&&n.setAttribute("set",t),n.setAttribute("aria-hidden","true"),n}#w(){let e=document.createElement("button");e.type="button",e.className="share-selection",e.setAttribute("aria-label",this.#s("shareSelection")),e.appendChild(this.#l("share-2")),e.addEventListener("click",async()=>{let t=this.closest("selection-menu"),r=t?.getSelection?.()?.text||window.getSelection()?.toString().trim()||"";if(!r){t?.dismiss?.();return}let a=I(this.#t||location.href,r),s=`"${r}" \u2014 ${a}`,l=!1;if(typeof navigator.share=="function")try{await navigator.share({text:s}),l=!0}catch(u){u?.name==="AbortError"&&(l=!0)}l||await f(s,{announceMessage:this.#s("selectionCopied")}),t?.dismiss?.()}),this.appendChild(e)}#E(){let e=document.createElement("button");e.type="button",e.className="share-trigger",e.append(this.#l("share-2"),this.#h(this.getAttribute("label")||"Share")),e.addEventListener("click",this.#x),this.appendChild(e)}#A(){let e=(this.getAttribute("platforms")||y).split(",").map(t=>t.trim()).filter(Boolean);this.#e=document.createElement("nav"),this.#e.setAttribute("aria-label",this.#s("sharePage"));for(let t of e){let n=b.get(t);if(!n)continue;let r=document.createElement("button");r.type="button",r.dataset.platform=t,t==="copy"?r.append(this.#l(n.iconName,n.iconSet),this.#h(this.#s("copy"))):(r.setAttribute("aria-label",this.#s("shareOn").replace("{platform}",n.label)),r.append(this.#l(n.iconName,n.iconSet),this.#h(n.label))),this.#e.appendChild(r)}this.#e.addEventListener("click",this.#p),this.appendChild(this.#e),this.#c=!0}#C(){if(this.querySelector("nav"))this.#e=this.querySelector("nav");else{let e=document.createElement("nav");for(e.setAttribute("aria-label",this.#s("sharePage"));this.firstChild;)e.appendChild(this.firstChild);this.appendChild(e),this.#e=e}this.#y(),this.#e.addEventListener("click",this.#p)}#y(){let{url:e,title:t,text:n}=this.#u();for(let r of this.querySelectorAll("a[data-platform]")){let a=this.#m.get(r);if(a==null){let s=r.getAttribute("href")||"";if(!R.test(s))continue;a=s,this.#m.set(r,a)}r.setAttribute("href",a.replace(/\{url\}/g,encodeURIComponent(e)).replace(/\{title\}/g,encodeURIComponent(t)).replace(/\{text\}/g,encodeURIComponent(n)))}}#x=async()=>{await this.#g()};async#g(){let e=this.#u();this.dispatchEvent(new CustomEvent("share-wc:open",{detail:{platform:"native"},bubbles:!0}));try{if(navigator.canShare&&!navigator.canShare(e))throw new Error("Payload not shareable");return await navigator.share(e),this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:"native"},bubbles:!0})),!0}catch(t){return t?.name==="AbortError"?!1:(this.dispatchEvent(new CustomEvent("share-wc:error",{detail:{platform:"native",error:t},bubbles:!0})),this.#f(this.querySelector(":scope > .share-trigger")))}}#p=e=>{let t=e.target.closest("[data-platform]");if(!t)return;let n=t.dataset.platform;if(n==="copy"){t.tagName==="A"&&e.preventDefault(),this.#f(t);return}if(t.tagName==="A"||!n)return;let r=b.get(n);if(!r)return;this.dispatchEvent(new CustomEvent("share-wc:open",{detail:{platform:n},bubbles:!0}));let a=this.#u();if(n==="email")location.href=r.buildUrl(a);else if(n==="mastodon"){let s=this.getAttribute("mastodon-instance")||"mastodon.social",l=r.buildUrl(a,s);window.open(l,"_blank","noopener,noreferrer")}else window.open(r.buildUrl(a),"_blank","noopener,noreferrer");this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:n},bubbles:!0}))};async#f(e=null){let t=e?.isConnected?e:void 0;if(!await f(this.#t||"",{button:t,announceMessage:this.#s("linkCopied"),duration:2e3}))return this.dispatchEvent(new CustomEvent("share-wc:error",{detail:{platform:"copy"},bubbles:!0})),!1;this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:"copy"},bubbles:!0}));let r=t?.dataset.platform==="copy"?t.querySelector(".share-label"):null;if(!r)return!0;let a=r.dataset.original??r.textContent??"";return r.dataset.original=a,r.textContent=this.#s("copied"),this.#o&&clearTimeout(this.#o),this.#o=setTimeout(()=>{r.textContent=a,delete r.dataset.original,this.#o=null},2e3),!0}};w("share-wc",g);export{g as ShareWc};
3
+ ${r}`)}`}],["copy",{label:"Copy link",iconName:"link",buildUrl:()=>""}]]),y="x,linkedin,bluesky,mastodon,whatsapp,email,copy";function a(r){return encodeURIComponent(r)}var q={sharePage:"Share this page",shareOn:"Share on {platform}",copy:"Copy link",copied:"Copied!",linkCopied:"Link copied to clipboard",shareSelection:"Share selection",selectionCopied:"Selection copied"},F=/\{(url|title|text)\}/;function R(r,e){let t=s=>encodeURIComponent(s).replace(/-/g,"%2D"),n=e.replace(/\s+/g," ").trim().split(" "),i=n.length>10?`${t(n.slice(0,4).join(" "))},${t(n.slice(-4).join(" "))}`:t(n.join(" "));return`${r.split("#")[0]}#:~:text=${i}`}var g=class extends h{#e;#t;#n;#s={};#m=new WeakMap;#i="";#o=null;#r=null;#c=!1;get url(){return this.#s.url??this.#e}set url(e){this.#d("url",e)}get shareTitle(){return this.#s.title??this.#t??""}set shareTitle(e){this.#d("title",e)}get text(){return this.#s.text??this.#n}set text(e){this.#d("text",e)}#d(e,t){t==null?delete this.#s[e]:this.#s[e]=String(t),this.hasAttribute("data-upgraded")&&(this.#b(),this.#g())}setup(){if(this.#b(),this.#w(),this.closest("selection-menu")){this.#E(),this.setAttribute("data-tier-resolved","selection");return}this.#i==="native"?this.#A():this.#i==="hidden"?this.style.display="none":this.children.length>0?this.#S():this.#C(),this.setAttribute("data-tier-resolved",this.#i)}teardown(){this.removeAttribute("data-tier-resolved"),this.#i==="hidden"&&this.style.removeProperty("display"),this.#o&&(clearTimeout(this.#o),this.#o=null);for(let e of this.querySelectorAll(".share-label[data-original]"))e.textContent=e.dataset.original??"",delete e.dataset.original;this.#r&&(this.#r.removeEventListener("click",this.#f),this.#c&&this.#r.remove(),this.#r=null,this.#c=!1),this.querySelector(":scope > .share-trigger")?.remove(),this.querySelector(":scope > .share-selection")?.remove()}async share(){return this.#i==="native"?this.#v():this.#p()}#a(e){let t=`data-label-${e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}`;return this.getAttribute(t)||q[e]}#b(){this.#e=this.#s.url||this.getAttribute("url")||document.querySelector('link[rel~="canonical" i]')?.href||location.href,this.#t=this.#s.title??(this.getAttribute("title")||document.querySelector('meta[property="og:title"]')?.getAttribute("content")||document.title),this.#n=this.#s.text??(this.getAttribute("text")||document.querySelector('meta[name="description"]')?.getAttribute("content")||document.querySelector('meta[property="og:description"]')?.getAttribute("content")||"")}#u(){return{url:this.#e||"",title:this.#t||"",text:this.#n||""}}#w(){let e=this.getAttribute("tier");if(e==="platforms"||e==="native"){e==="native"&&!navigator.share?this.#i="hidden":this.#i=e;return}if((this.getAttribute("platforms")||y)==="native-only"){this.#i=typeof navigator.share=="function"?"native":"hidden";return}this.#i=typeof navigator.share=="function"?"native":"platforms"}#h(e){let t=document.createElement("span");return t.className="share-label",t.textContent=e,t}#l(e,t){let n=document.createElement("icon-wc");return n.setAttribute("name",e),n.setAttribute("size","sm"),t&&n.setAttribute("set",t),n.setAttribute("aria-hidden","true"),n}#E(){let e=document.createElement("button");e.type="button",e.className="share-selection",e.setAttribute("aria-label",this.#a("shareSelection")),e.appendChild(this.#l("share-2")),e.addEventListener("click",async()=>{let t=this.closest("selection-menu"),i=t?.getSelection?.()?.text||window.getSelection()?.toString().trim()||"";if(!i){t?.dismiss?.();return}let s=R(this.#e||location.href,i),o=`"${i}" \u2014 ${s}`,l=!1;if(typeof navigator.share=="function")try{await navigator.share({text:o}),l=!0}catch(u){u?.name==="AbortError"&&(l=!0)}l||await p(o,{announceMessage:this.#a("selectionCopied")}),t?.dismiss?.()}),this.appendChild(e)}#A(){let e=document.createElement("button");e.type="button",e.className="share-trigger",e.append(this.#l("share-2"),this.#h(this.getAttribute("label")||"Share")),e.addEventListener("click",this.#x),this.appendChild(e)}#C(){let e=(this.getAttribute("platforms")||y).split(",").map(t=>t.trim()).filter(Boolean);this.#r=this.#y();for(let t of e){let n=b.get(t);if(!n)continue;let i=document.createElement("button");i.type="button",i.dataset.platform=t,t==="copy"?i.append(this.#l(n.iconName,n.iconSet),this.#h(this.#a("copy"))):(i.setAttribute("aria-label",this.#a("shareOn").replace("{platform}",n.label)),i.append(this.#l(n.iconName,n.iconSet),this.#h(n.label))),this.#r.appendChild(i)}this.#r.addEventListener("click",this.#f),this.appendChild(this.#r),this.#c=!0}#y(){let e=document.createElement("div");return e.className="share-group",e.setAttribute("role","group"),e.setAttribute("aria-label",this.#a("sharePage")),e}#S(){let e=this.querySelector(".share-group, nav");if(e)this.#r=e;else{let t=this.#y();for(;this.firstChild;)t.appendChild(this.firstChild);this.appendChild(t),this.#r=t}this.#g(),this.#r.addEventListener("click",this.#f)}#g(){let{url:e,title:t,text:n}=this.#u();for(let i of this.querySelectorAll("a[data-platform]")){let s=this.#m.get(i);if(s==null){let o=i.getAttribute("href")||"";if(!F.test(o))continue;s=o,this.#m.set(i,s)}i.setAttribute("href",s.replace(/\{url\}/g,encodeURIComponent(e)).replace(/\{title\}/g,encodeURIComponent(t)).replace(/\{text\}/g,encodeURIComponent(n)))}}#x=async()=>{await this.#v()};async#v(){let e=this.#u();this.dispatchEvent(new CustomEvent("share-wc:open",{detail:{platform:"native"},bubbles:!0}));try{if(navigator.canShare&&!navigator.canShare(e))throw new Error("Payload not shareable");return await navigator.share(e),this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:"native"},bubbles:!0})),!0}catch(t){return t?.name==="AbortError"?!1:(this.dispatchEvent(new CustomEvent("share-wc:error",{detail:{platform:"native",error:t},bubbles:!0})),this.#p(this.querySelector(":scope > .share-trigger")))}}#f=e=>{let t=e.target.closest("[data-platform]");if(!t)return;let n=t.dataset.platform;if(n==="copy"){t.tagName==="A"&&e.preventDefault(),this.#p(t);return}if(t.tagName==="A"||!n)return;let i=b.get(n);if(!i)return;this.dispatchEvent(new CustomEvent("share-wc:open",{detail:{platform:n},bubbles:!0}));let s=this.#u();if(n==="email")location.href=i.buildUrl(s);else if(n==="mastodon"){let o=this.getAttribute("mastodon-instance")||"mastodon.social",l=i.buildUrl(s,o);window.open(l,"_blank","noopener,noreferrer")}else window.open(i.buildUrl(s),"_blank","noopener,noreferrer");this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:n},bubbles:!0}))};async#p(e=null){let t=e?.isConnected?e:void 0;if(!await p(this.#e||"",{button:t,announceMessage:this.#a("linkCopied"),duration:2e3}))return this.dispatchEvent(new CustomEvent("share-wc:error",{detail:{platform:"copy"},bubbles:!0})),!1;this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:"copy"},bubbles:!0}));let i=t?.dataset.platform==="copy"?t.querySelector(".share-label"):null;if(!i)return!0;let s=i.dataset.original??i.textContent??"";return i.dataset.original=s,i.textContent=this.#a("copied"),this.#o&&clearTimeout(this.#o),this.#o=setTimeout(()=>{i.textContent=s,delete i.dataset.original,this.#o=null},2e3),!0}};w("share-wc",g);export{g as ShareWc};
4
4
  //# sourceMappingURL=share-wc.js.map
@@ -1,2 +1,2 @@
1
- var Y=window.matchMedia("(prefers-reduced-motion: reduce)");var w=new Map;function C(e,t,o={}){let n=o.priority??10,r={impl:t,bundle:o.bundle,contract:o.contract,priority:n},s=w.get(e);if(customElements.get(e)){if(!s||s.priority>=n){s&&s.priority===n&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${e}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${o.bundle}".`);return}console.warn(`[VB Bundle] Tag <${e}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${o.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=n){s.priority===n&&console.warn(`[VB Bundle] Tag <${e}> already registered by "${s.bundle}". Skipping "${o.bundle}" (first wins at equal priority).`);return}w.set(e,r),customElements.define(e,t)}var m=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,o,n,r){t.addEventListener(o,n,r),this.#t.push(()=>t.removeEventListener(o,n,r))}_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,o){this.#e||(this.#e=this.attachInternals());let n=this.#e.states;try{o?n.add(t):n.delete(t)}catch{let r=`--${t}`;o?n.add(r):n.delete(r)}}_adoptInternals(t){this.#e||(this.#e=t)}#o(){return this.constructor.formAssociated&&this.#e?this.#e:null}get validity(){return this.#o()?.validity}get validationMessage(){return this.#o()?.validationMessage??""}get willValidate(){return this.#o()?.willValidate??!1}get form(){return this.#o()?.form??null}checkValidity(){return this.#o()?.checkValidity()??!0}reportValidity(){return this.#o()?.reportValidity()??!0}};var u=/Mac|iPhone|iPad|iPod/.test(navigator.platform??""),A={mac:{meta:"\u2318",cmd:"\u2318",alt:"\u2325",option:"\u2325",shift:"\u21E7",ctrl:"\u2303",control:"\u2303"},other:{meta:"Ctrl",cmd:"Ctrl",alt:"Alt",option:"Alt",shift:"Shift",ctrl:"Ctrl",control:"Ctrl"}},S={mac:{meta:"Command",cmd:"Command",alt:"Option",option:"Option",shift:"Shift",ctrl:"Control",control:"Control"},other:{meta:"Control",cmd:"Control",alt:"Alt",option:"Alt",shift:"Shift",ctrl:"Control",control:"Control"}},L={escape:{label:"Esc",spoken:"Escape"},esc:{label:"Esc",spoken:"Escape"},enter:{label:"Enter",spoken:"Enter"},return:{label:"Enter",spoken:"Enter"},tab:{label:"Tab",spoken:"Tab"},space:{label:"Space",spoken:"Space"},backspace:{label:"Backspace",spoken:"Backspace"},delete:{label:"Del",spoken:"Delete"},del:{label:"Del",spoken:"Delete"},insert:{label:"Ins",spoken:"Insert"},home:{label:"Home",spoken:"Home"},end:{label:"End",spoken:"End"},pageup:{label:"PgUp",spoken:"Page up"},pagedown:{label:"PgDn",spoken:"Page down"},arrowup:{label:"\u2191",spoken:"Up arrow"},up:{label:"\u2191",spoken:"Up arrow"},arrowdown:{label:"\u2193",spoken:"Down arrow"},down:{label:"\u2193",spoken:"Down arrow"},arrowleft:{label:"\u2190",spoken:"Left arrow"},left:{label:"\u2190",spoken:"Left arrow"},arrowright:{label:"\u2192",spoken:"Right arrow"},right:{label:"\u2192",spoken:"Right arrow"},"+":{label:"+",spoken:"Plus"},plus:{label:"+",spoken:"Plus"}};function b(e){return[...String(e??"").trim().toLowerCase().matchAll(/([^+]+|\+)(?:\+|$)/g)].map(o=>o[1].trim()).filter(Boolean).map(o=>o==="plus"?"+":o)}function g(e,t=u){let o=t?A.mac:A.other;if(e in o)return{label:o[e],spoken:(t?S.mac:S.other)[e],modifier:!0};let n=L[e];if(n)return{...n,modifier:!1};let r=e.toUpperCase();return{label:r,spoken:r,modifier:!1}}function T(e){return b(e).map(t=>g(t).label).join(u?"":"+")}var _={esc:"escape",return:"enter",del:"delete",ins:"insert",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",space:" ",spacebar:" ",plus:"+",pgup:"pageup",pgdn:"pagedown"};function K(e){let t=String(e??"").toLowerCase();return _[t]??t}function h(e){let t=b(e);return{key:K(t.pop()??""),meta:t.includes("meta")||t.includes("cmd"),ctrl:t.includes("ctrl")||t.includes("control"),shift:t.includes("shift"),alt:t.includes("alt")||t.includes("option")}}function x(e){return e.length===1&&!/[a-z0-9 ]/.test(e)}function M(e,t){let n=(e.key==="Spacebar"?" ":String(e.key??"").toLowerCase())===t.key;if(!n&&(e.altKey||e.shiftKey)&&/^[a-z0-9]$/.test(t.key)){let i=/\d/.test(t.key)?`Digit${t.key}`:`Key${t.key.toUpperCase()}`;n=e.code===i}if(!n)return!1;let r,s;return u?(r=t.meta,s=t.ctrl):(r=!1,s=t.meta||t.ctrl),!(r!==e.metaKey||s!==e.ctrlKey||!x(t.key)&&t.shift!==e.shiftKey||t.alt!==e.altKey)}function y(e){let t=typeof e=="string"?h(e):e;return!t.meta&&!t.ctrl&&!t.alt&&t.key.length===1}function N(e,t){let o=h(e),n=h(t),r=u?o.ctrl:o.ctrl||o.meta,s=u?n.ctrl:n.ctrl||n.meta,i=u&&o.meta,l=u&&n.meta,a=!x(o.key);return o.key===n.key&&r===s&&i===l&&o.alt===n.alt&&(!a||o.shift===n.shift)}var k="data-char-shortcuts",v="vb:char-shortcuts-change",O="vb:settings:extensions";function f(){return typeof document>"u"?!0:document.documentElement.getAttribute(k)!=="off"}function D(){try{let e=globalThis.localStorage?.getItem(O);if(!e)return null;let t=JSON.parse(e)?.data?.charShortcuts;return typeof t=="boolean"?t:null}catch{return null}}var P=!0;if(typeof document<"u"){let e=D();e===null&&(P=f()),e===!1?document.documentElement.setAttribute(k,"off"):e===!0&&document.documentElement.removeAttribute(k)}var R=new Set(["INPUT","TEXTAREA","SELECT"]),p=[],H=!1;function U(e){let t=e;return!t||!t.tagName?!1:R.has(t.tagName)||t.isContentEditable}function B(e){if(e.repeat||e.isComposing||e.defaultPrevented)return;let t=U(e.target),o=!f(),n=document.activeElement;for(let r of p)if(!(t&&!r.global)&&!(r.scope&&!(r.scope.isConnected&&r.scope.contains(n)))&&!(o&&r.character&&!r.scope)&&!(r.enabled&&!r.enabled())&&M(e,r.descriptor)){e.preventDefault(),r.callback(e);return}}function I(){H||(document.addEventListener("keydown",B),H=!0)}function $(e,t,o={}){I();let n=h(e),r={combo:e,descriptor:n,callback:t,global:o.global===!0,scope:o.scope??null,enabled:typeof o.enabled=="function"?o.enabled:null,character:y(n)},s=p.find(i=>!i.scope&&!r.scope&&N(i.combo,e));return s&&console.warn(`[hotkey-bind] Shortcut "${e}" is already bound as "${s.combo}". Last-bound wins.`),p.unshift(r),function(){let l=p.indexOf(r);l!==-1&&p.splice(l,1)}}var V="shift+?",q={title:"Keyboard shortcuts",general:"General",self:"Show keyboard shortcuts",close:"Close"},j=0,E=class extends m{static get observedAttributes(){return["hotkey"]}#t=null;#e=null;#o=null;#n=null;setup(){this.#a(),this.#i(),this.listen(window,v,()=>{this.#t?.open&&this.#s()})}teardown(){this.#o?.(),this.#o=null,this.#t?.remove(),this.#t=null,this.#e=null}attributeChangedCallback(t,o,n){t==="hotkey"&&o!==n&&this.hasAttribute("data-upgraded")&&this.#i()}show(){this.#t&&(this.#s(),this.#t.open||this.#t.showModal())}close(){this.#t?.open&&this.#t.close()}toggle(){this.#t?.open?this.close():this.show()}get open(){return!!this.#t?.open}get hotkey(){let t=(this.getAttribute("hotkey")??"").trim();return t.toLowerCase()==="none"?null:t||V}get shortcuts(){return this.#n}set shortcuts(t){this.#n=t&&typeof t=="object"?t:null,this.#t?.open&&this.#s(),this.dispatchEvent(new CustomEvent("short-cuts:shortcuts-changed",{detail:{shortcuts:this.#n,source:"property"},bubbles:!0}))}#r(t){return this.getAttribute(`data-label-${t}`)||q[t]}#i(){this.#o?.(),this.#o=null;let t=this.hotkey;t&&(this.#o=$(t,()=>this.toggle()))}#a(){this.querySelector(":scope > dialog.shortcut-dialog")?.remove();let t=`short-cuts-title-${++j}`,o=document.createElement("dialog");o.className="shortcut-dialog",o.setAttribute("aria-labelledby",t);let n=document.createElement("header");n.className="shortcut-header";let r=document.createElement("h2");r.id=t,r.textContent=this.#r("title");let s=document.createElement("button");s.type="button",s.className="shortcut-close",s.setAttribute("aria-label",this.#r("close"));let i=document.createElement("icon-wc");i.setAttribute("name","x"),i.setAttribute("size","sm"),i.setAttribute("aria-hidden","true"),s.appendChild(i),s.addEventListener("click",()=>this.close()),n.append(r,s);let l=document.createElement("section");l.className="shortcut-body",o.append(n,l),o.addEventListener("click",a=>{a.target===o&&o.close()}),this.#t=o,this.#e=l,this.appendChild(o)}#c(){let t=new Map,o=!f(),n=(a,c=!1)=>!(o&&!c&&y(a)),r=this.hotkey;r&&n(r)&&t.set(this.#r("general"),[{label:this.#r("self"),shortcut:r}]);let s=(a,c)=>{if(!c?.shortcut||!n(String(c.shortcut),!!c.scoped))return;let d=t.get(a)||[];d.push({label:String(c.label??""),shortcut:String(c.shortcut)}),t.set(a,d)};if(this.#n){for(let[a,c]of Object.entries(this.#n))Array.isArray(c)&&c.forEach(d=>s(a,d));return t}let{getRegisteredCommands:i}=window.__commandRegistry||{};if(i)for(let[a,c]of i())for(let d of c)s(a,d);let{getHotkeyActions:l}=window.__hotkeyActionRegistry||{};if(l)for(let[a,c]of l())for(let d of c)s(a,d);return t}#l(t){let o=document.createElement("kbd");o.className="shortcut-kbd";let n=document.createElement("span");n.setAttribute("aria-hidden","true"),n.textContent=T(t);let r=document.createElement("span");return r.className="visually-hidden",r.textContent=b(t).map(s=>g(s,u).spoken).join(" "),o.append(n,r),o}#s(){if(this.#e){this.#e.replaceChildren();for(let[t,o]of this.#c()){if(!o.length)continue;let n=document.createElement("section");n.className="shortcut-group";let r=document.createElement("h3");r.className="shortcut-group-header",r.textContent=t;let s=document.createElement("dl");s.className="shortcut-list";for(let i of o){let l=document.createElement("div");l.className="shortcut-row";let a=document.createElement("dt");a.className="shortcut-label",a.textContent=i.label;let c=document.createElement("dd");c.appendChild(this.#l(i.shortcut)),l.append(a,c),s.appendChild(l)}n.append(r,s),this.#e.appendChild(n)}}}};C("short-cuts",E);export{E as ShortCuts};
1
+ var X=window.matchMedia("(prefers-reduced-motion: reduce)");var k=new Map;function S(e,t,n={}){let r=n.priority??10,o={impl:t,bundle:n.bundle,contract:n.contract,priority:r},s=k.get(e);if(customElements.get(e)){if(!s||s.priority>=r){s&&s.priority===r&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${e}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${n.bundle}".`);return}console.warn(`[VB Bundle] Tag <${e}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${n.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=r){s.priority===r&&console.warn(`[VB Bundle] Tag <${e}> already registered by "${s.bundle}". Skipping "${n.bundle}" (first wins at equal priority).`);return}k.set(e,o),customElements.define(e,t)}var m=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,n,r,o){t.addEventListener(n,r,o),this.#t.push(()=>t.removeEventListener(n,r,o))}_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,n){this.#e||(this.#e=this.attachInternals());let r=this.#e.states;try{n?r.add(t):r.delete(t)}catch{let o=`--${t}`;n?r.add(o):r.delete(o)}}_adoptInternals(t){this.#e||(this.#e=t)}#n(){return this.constructor.formAssociated&&this.#e?this.#e:null}get validity(){return this.#n()?.validity}get validationMessage(){return this.#n()?.validationMessage??""}get willValidate(){return this.#n()?.willValidate??!1}get form(){return this.#n()?.form??null}checkValidity(){return this.#n()?.checkValidity()??!0}reportValidity(){return this.#n()?.reportValidity()??!0}};var u=/Mac|iPhone|iPad|iPod/.test(navigator.platform??""),C={mac:{meta:"\u2318",cmd:"\u2318",alt:"\u2325",option:"\u2325",shift:"\u21E7",ctrl:"\u2303",control:"\u2303"},other:{meta:"Ctrl",cmd:"Ctrl",alt:"Alt",option:"Alt",shift:"Shift",ctrl:"Ctrl",control:"Ctrl"}},A={mac:{meta:"Command",cmd:"Command",alt:"Option",option:"Option",shift:"Shift",ctrl:"Control",control:"Control"},other:{meta:"Control",cmd:"Control",alt:"Alt",option:"Alt",shift:"Shift",ctrl:"Control",control:"Control"}},P={escape:{label:"Esc",spoken:"Escape"},esc:{label:"Esc",spoken:"Escape"},enter:{label:"Enter",spoken:"Enter"},return:{label:"Enter",spoken:"Enter"},tab:{label:"Tab",spoken:"Tab"},space:{label:"Space",spoken:"Space"},backspace:{label:"Backspace",spoken:"Backspace"},delete:{label:"Del",spoken:"Delete"},del:{label:"Del",spoken:"Delete"},insert:{label:"Ins",spoken:"Insert"},home:{label:"Home",spoken:"Home"},end:{label:"End",spoken:"End"},pageup:{label:"PgUp",spoken:"Page up"},pagedown:{label:"PgDn",spoken:"Page down"},arrowup:{label:"\u2191",spoken:"Up arrow"},up:{label:"\u2191",spoken:"Up arrow"},arrowdown:{label:"\u2193",spoken:"Down arrow"},down:{label:"\u2193",spoken:"Down arrow"},arrowleft:{label:"\u2190",spoken:"Left arrow"},left:{label:"\u2190",spoken:"Left arrow"},arrowright:{label:"\u2192",spoken:"Right arrow"},right:{label:"\u2192",spoken:"Right arrow"},"+":{label:"+",spoken:"Plus"},plus:{label:"+",spoken:"Plus"}};function b(e){return[...String(e??"").trim().toLowerCase().matchAll(/([^+]+|\+)(?:\+|$)/g)].map(n=>n[1].trim()).filter(Boolean).map(n=>n==="plus"?"+":n)}function g(e,t=u){let n=t?C.mac:C.other;if(e in n)return{label:n[e],spoken:(t?A.mac:A.other)[e],modifier:!0};let r=P[e];if(r)return{...r,modifier:!1};let o=e.toUpperCase();return{label:o,spoken:o,modifier:!1}}function v(e){return b(e).map(t=>g(t).label).join(u?"":"+")}var _={esc:"escape",return:"enter",del:"delete",ins:"insert",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",space:" ",spacebar:" ",plus:"+",pgup:"pageup",pgdn:"pagedown"};function B(e){let t=String(e??"").toLowerCase();return _[t]??t}function f(e){let t=b(e);return{key:B(t.pop()??""),meta:t.includes("meta")||t.includes("cmd"),ctrl:t.includes("ctrl")||t.includes("control"),shift:t.includes("shift"),alt:t.includes("alt")||t.includes("option")}}function $(e){return e.length===1&&!/[a-z0-9 ]/.test(e)}function T(e,t){let r=(e.key==="Spacebar"?" ":String(e.key??"").toLowerCase())===t.key;if(!r&&(e.altKey||e.shiftKey)&&/^[a-z0-9]$/.test(t.key)){let i=/\d/.test(t.key)?`Digit${t.key}`:`Key${t.key.toUpperCase()}`;r=e.code===i}if(!r)return!1;let o,s;return u?(o=t.meta,s=t.ctrl):(o=!1,s=t.meta||t.ctrl),!(o!==e.metaKey||s!==e.ctrlKey||!$(t.key)&&t.shift!==e.shiftKey||t.alt!==e.altKey)}function y(e){let t=typeof e=="string"?f(e):e;return!t.meta&&!t.ctrl&&!t.alt&&t.key.length===1}function x(e,t){let n=f(e),r=f(t),o=u?n.ctrl:n.ctrl||n.meta,s=u?r.ctrl:r.ctrl||r.meta,i=u&&n.meta,l=u&&r.meta,a=!$(n.key);return n.key===r.key&&o===s&&i===l&&n.alt===r.alt&&(!a||n.shift===r.shift)}var E="data-char-shortcuts",M="vb:char-shortcuts-change",O="vb:settings:extensions";function h(){return typeof document>"u"?!0:document.documentElement.getAttribute(E)!=="off"}function K(){try{let e=globalThis.localStorage?.getItem(O);if(!e)return null;let t=JSON.parse(e)?.data?.charShortcuts;return typeof t=="boolean"?t:null}catch{return null}}var D=!0;if(typeof document<"u"){let e=K();e===null&&(D=h()),e===!1?document.documentElement.setAttribute(E,"off"):e===!0&&document.documentElement.removeAttribute(E)}var R=new Set(["INPUT","TEXTAREA","SELECT"]),p=[],H=!1;function U(e){let t=e;return!t||!t.tagName?!1:R.has(t.tagName)||t.isContentEditable}function j(e){if(e.repeat||e.isComposing||e.defaultPrevented)return;let t=U(e.target),n=!h(),r=document.activeElement;for(let o of p)if(!(t&&!o.global)&&!(o.scope&&!(o.scope.isConnected&&o.scope.contains(r)))&&!(n&&o.character&&!o.scope)&&!(o.enabled&&!o.enabled())&&T(e,o.descriptor)){e.preventDefault(),o.callback(e);return}}function q(){H||(document.addEventListener("keydown",j),H=!0)}function L(e,t,n={}){q();let r=f(e),o={combo:e,descriptor:r,callback:t,global:n.global===!0,scope:n.scope??null,enabled:typeof n.enabled=="function"?n.enabled:null,character:y(r)},s=p.find(i=>!i.scope&&!o.scope&&x(i.combo,e));return s&&console.warn(`[hotkey-bind] Shortcut "${e}" is already bound as "${s.combo}". Last-bound wins.`),p.unshift(o),function(){let l=p.indexOf(o);l!==-1&&p.splice(l,1)}}var I="shift+?",V={title:"Keyboard shortcuts",general:"General",self:"Show keyboard shortcuts",close:"Close"},F=0,w=class extends m{static get observedAttributes(){return["hotkey"]}#t=null;#e=null;#n=null;#r=null;setup(){this.#a(),this.#i(),this.listen(window,M,()=>{this.#t?.open&&this.#s()})}teardown(){this.#n?.(),this.#n=null,this.#t?.remove(),this.#t=null,this.#e=null}attributeChangedCallback(t,n,r){t==="hotkey"&&n!==r&&this.hasAttribute("data-upgraded")&&this.#i()}show(){this.#t&&(this.#s(),this.#t.open||this.#t.showModal())}close(){this.#t?.open&&this.#t.close()}toggle(){this.#t?.open?this.close():this.show()}get open(){return!!this.#t?.open}get hotkey(){let t=(this.getAttribute("hotkey")??"").trim();return t.toLowerCase()==="none"?null:t||I}get shortcuts(){return this.#r}set shortcuts(t){this.#r=t&&typeof t=="object"?t:null,this.#t?.open&&this.#s(),this.dispatchEvent(new CustomEvent("short-cuts:shortcuts-changed",{detail:{shortcuts:this.#r,source:"property"},bubbles:!0}))}#o(t){return this.getAttribute(`data-label-${t}`)||V[t]}#i(){this.#n?.(),this.#n=null;let t=this.hotkey;t&&(this.#n=L(t,()=>this.toggle()))}#a(){this.querySelector(":scope > dialog.shortcut-dialog")?.remove();let t=`short-cuts-title-${++F}`,n=document.createElement("dialog");n.className="shortcut-dialog",n.setAttribute("aria-labelledby",t);let r=document.createElement("header");r.className="shortcut-header";let o=document.createElement("h2");o.id=t,o.textContent=this.#o("title");let s=document.createElement("button");s.type="button",s.className="shortcut-close",s.setAttribute("aria-label",this.#o("close"));let i=document.createElement("icon-wc");i.setAttribute("name","x"),i.setAttribute("size","sm"),i.setAttribute("aria-hidden","true"),s.appendChild(i),s.addEventListener("click",()=>this.close()),r.append(o,s);let l=document.createElement("section");l.className="shortcut-body",n.append(r,l),n.addEventListener("click",a=>{a.target===n&&n.close()}),this.#t=n,this.#e=l,this.appendChild(n)}#c(){let t=new Map,n=!h(),r=(a,c=!1)=>!(n&&!c&&y(a)),o=this.hotkey;o&&r(o)&&t.set(this.#o("general"),[{label:this.#o("self"),shortcut:o}]);let s=(a,c)=>{if(!c?.shortcut||!r(String(c.shortcut),!!c.scoped))return;let d=t.get(a)||[];d.push({label:String(c.label??""),shortcut:String(c.shortcut)}),t.set(a,d)};if(this.#r){for(let[a,c]of Object.entries(this.#r))Array.isArray(c)&&c.forEach(d=>s(a,d));return t}let{getRegisteredCommands:i}=window.__commandRegistry||{};if(i)for(let[a,c]of i())for(let d of c)s(a,d);let{getHotkeyActions:l}=window.__hotkeyActionRegistry||{};if(l)for(let[a,c]of l())for(let d of c)s(a,d);return t}#l(t){let n=document.createElement("kbd");n.className="shortcut-kbd";let r=document.createElement("span");r.setAttribute("aria-hidden","true"),r.textContent=v(t);let o=document.createElement("span");return o.className="visually-hidden",o.textContent=b(t).map(s=>g(s,u).spoken).join(" "),n.append(r,o),n}#s(){if(this.#e){this.#e.replaceChildren();for(let[t,n]of this.#c()){if(!n.length)continue;let r=document.createElement("section");r.className="shortcut-group";let o=document.createElement("h3");o.className="shortcut-group-header",o.textContent=t;let s=document.createElement("dl");s.className="shortcut-list";for(let i of n){let l=document.createElement("div");l.className="shortcut-row";let a=document.createElement("dt");a.className="shortcut-label",a.textContent=i.label;let c=document.createElement("dd");c.appendChild(this.#l(i.shortcut)),l.append(a,c),s.appendChild(l)}r.append(o,s),this.#e.appendChild(r)}}}};S("short-cuts",w);export{w as ShortCuts};
2
2
  //# sourceMappingURL=short-cuts.js.map
@@ -1,2 +1,2 @@
1
- var N=window.matchMedia("(prefers-reduced-motion: reduce)");var v=new Map;function C(a,t,n={}){let e=n.priority??10,r={impl:t,bundle:n.bundle,contract:n.contract,priority:e},o=v.get(a);if(customElements.get(a)){if(!o||o.priority>=e){o&&o.priority===e&&o.impl!==t&&console.warn(`[VB Bundle] Tag <${a}> already registered by "${o.bundle}" (priority ${o.priority}). Skipping "${n.bundle}".`);return}console.warn(`[VB Bundle] Tag <${a}> defined by "${o.bundle}" cannot be replaced (customElements.define is permanent). "${n.bundle}" has higher priority but arrived late.`);return}if(o&&o.priority>=e){o.priority===e&&console.warn(`[VB Bundle] Tag <${a}> already registered by "${o.bundle}". Skipping "${n.bundle}" (first wins at equal priority).`);return}v.set(a,r),customElements.define(a,t)}var x=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,n,e,r){t.addEventListener(n,e,r),this.#t.push(()=>t.removeEventListener(n,e,r))}_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,n){this.#e||(this.#e=this.attachInternals());let e=this.#e.states;try{n?e.add(t):e.delete(t)}catch{let r=`--${t}`;n?e.add(r):e.delete(r)}}_adoptInternals(t){this.#e||(this.#e=t)}#n(){return this.constructor.formAssociated&&this.#e?this.#e:null}get validity(){return this.#n()?.validity}get validationMessage(){return this.#n()?.validationMessage??""}get willValidate(){return this.#n()?.willValidate??!1}get form(){return this.#n()?.form??null}checkValidity(){return this.#n()?.checkValidity()??!0}reportValidity(){return this.#n()?.reportValidity()??!0}};var q=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function k(a,t){let e=(()=>{try{return decodeURIComponent(location.hash.slice(1))}catch{return location.hash.slice(1)}})()===t;e||(location.hash=t);let r=a;typeof r.focus=="function"&&(r.tabIndex<0&&!r.hasAttribute("tabindex")&&r.setAttribute("tabindex","-1"),r.focus({preventScroll:!0})),(e||!r.matches?.(":target"))&&r.scrollIntoView({behavior:q()?"auto":"smooth",block:"start"})}function w(a){let t=a;if(t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return!1;let e=(t.target instanceof Element?t.target:null)?.closest('a[href^="#"]');if(!e)return!1;let r=e.getAttribute("target");if(r&&r!=="_self"||e.hasAttribute("download"))return!1;let o=(e.getAttribute("href")??"").slice(1);if(!o)return!1;let s=o;try{s=decodeURIComponent(o)}catch{}let u=e.ownerDocument.getElementById(s);return u?(t.preventDefault(),k(u,s),!0):!1}var L={controls:"Filter the index",jump:"Jump to letter",terms:"{count} terms","terms-one":"1 term",more:"Show {count} more",less:"Show less",matches:"{count} terms match","matches-one":"1 term matches","no-matches":"No matches"},M="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");function $(a){if(typeof a!="string"||!a.trim())return null;try{let t=new URL(a,document.baseURI);return t.protocol==="http:"||t.protocol==="https:"?a:null}catch{return null}}var A=class extends x{#t=null;#e=null;#n=null;setup(){this.listen(this,"click",w);let t=this.getAttribute("src");t?this.#x(t).then(()=>{this.isConnected&&this.#l()}):this.#l()}teardown(){this.#t?.disconnect(),this.#t=null}#r(t,n){let e=this.getAttribute(`data-label-${t}`)??L[t];return n==null?e:e.replace("{count}",String(n))}get#s(){return this.closest("[lang]")?.getAttribute("lang")||document.documentElement.lang||void 0}#i(){return this.querySelector("nav[data-index]")??this.querySelector(":scope > nav:has(> section)")}#o(){let t=this.#i();return t?[...t.querySelectorAll(":scope > section")]:[]}#d(t){let n=t.id?.replace(/^index-/,"");if(!n)return"";let e=n;try{e=decodeURIComponent(n)}catch{}return e.toLocaleUpperCase(this.#s)}#l(){this.#f(),this.#h();let t=this.getAttribute("letters")||"entries";t!=="none"&&this.#p(t==="all"),this.#b(),this.#e?.value&&this.#u(this.#e.value)}#c(t){return t===1?this.#r("terms-one"):this.#r("terms",t)}#a(t){return t.querySelectorAll(":scope > ul > li").length}#f(){for(let t of this.#o()){let n=this.#a(t),e=t.querySelector("h2");if(!e||!n||e.querySelector(".index-count"))continue;let r=document.createElement("span");r.className="index-count",r.textContent=this.#c(n),e.append(" ",r)}}#h(){if(this.querySelector(":scope > [data-index-controls]"))return;let t=document.createElement("search");t.setAttribute("data-index-controls",""),t.setAttribute("aria-label",this.#r("controls"));let n=this.getAttribute("placeholder")||"Filter index\u2026",e=document.createElement("input");e.type="search",e.placeholder=n,e.setAttribute("aria-label",n),e.setAttribute("data-index-search",""),e.addEventListener("input",()=>this.#u(e.value)),this.#e=e,t.append(e);let r=document.createElement("output");r.setAttribute("role","status"),r.setAttribute("data-index-status",""),this.#n=r,t.append(r);let o=this.#i();o?o.before(t):this.prepend(t)}#p(t){let n=this.querySelector(":scope > .index-jump");n&&n.remove();let e=new Map;for(let l of this.#o()){let c=this.#d(l);c&&e.set(c,l.id)}if(e.size===0)return;let r=new Intl.Collator(this.#s,{sensitivity:"base"}),o=t?[...new Set([...M,...e.keys()])]:[...e.keys()];o.sort((l,c)=>r.compare(l,c)||l.localeCompare(c));let s=document.createElement("nav");s.className="index-jump",s.setAttribute("aria-label",this.#r("jump"));let u=document.createElement("ol");u.className="inline";for(let l of o){let c=document.createElement("li"),h=e.get(l);if(h){let f=document.createElement("a");f.setAttribute("href",`#${h}`),f.textContent=l;let p=this.querySelector(`#${CSS.escape(h)}`);p&&(f.title=this.#c(this.#a(p))),c.append(f)}else{let f=document.createElement("span");f.textContent=l,f.setAttribute("aria-disabled","true"),c.append(f)}u.append(c)}s.append(u);let i=this.querySelector(":scope > [data-index-controls]"),d=this.#i();i?i.after(s):d?d.before(s):this.prepend(s),this.#m(s)}#m(t){let n=t.querySelectorAll("a");if(!n.length)return;let e=this.#o();if(e.length){this.#t?.disconnect(),this.#t=new IntersectionObserver(r=>{for(let o of r)if(o.isIntersecting){let s=o.target.id;for(let u of n){let i=u.getAttribute("href")===`#${s}`;u.setAttribute("aria-current",i?"true":"false")}}},{rootMargin:"-20% 0px -60% 0px"});for(let r of e)this.#t.observe(r)}}#b(){let t=this.getAttribute("limit");if(!t)return;let n=parseInt(t,10);if(!(!n||n<1))for(let e of this.#o()){let r=[...e.querySelectorAll(":scope > ul > li")];if(r.length<=n||e.querySelector(":scope > [data-index-expand]"))continue;let o=r.slice(n);for(let i of o)i.hidden=!0,i.setAttribute("data-index-overflow","");let s=document.createElement("button");s.type="button",s.setAttribute("data-index-expand",""),s.setAttribute("aria-expanded","false"),s.textContent=this.#r("more",o.length),s.addEventListener("click",()=>{let i=s.getAttribute("aria-expanded")!=="true";for(let d of o)d.hidden=!i;s.setAttribute("aria-expanded",String(i)),s.textContent=i?this.#r("less"):this.#r("more",o.length)});let u=e.querySelector(":scope > ul");u&&u.after(s)}}#u(t){let n=this.#s,e=t.toLocaleLowerCase(n).trim(),r=this.getAttribute("filter")==="topic"?"topic":"all",o=0;for(let s of this.#o()){let u=s.querySelectorAll(":scope > ul > li"),i=s.querySelector(":scope > [data-index-expand]"),d=i?.getAttribute("aria-expanded")==="true",l=!1,c=0;for(let h of u){let f=h.querySelector(".index-term")?.textContent?.toLocaleLowerCase(n)||"",p=!e||f.includes(e);if(!p&&r==="all"){for(let m of h.querySelectorAll(".index-refs a"))if((m.textContent||"").toLocaleLowerCase(n).includes(e)){p=!0;break}}p&&(l=!0,c++,o++);let y=!e&&h.hasAttribute("data-index-overflow")&&!d;h.hidden=!p||y}s.hidden=!l,this.#y(s,e?c:this.#a(s)),i&&(i.hidden=!!e)}this.#n&&(this.#n.textContent=e?o===0?this.#r("no-matches"):o===1?this.#r("matches-one"):this.#r("matches",o):""),this.#g()}#y(t,n){let e=this.#c(n),r=t.querySelector("h2 > .index-count");if(r&&r.textContent!==e&&(r.textContent=e),!t.id)return;let o=this.querySelector(`:scope > .index-jump a[href="#${CSS.escape(t.id)}"]`);o&&o.setAttribute("title",e)}#g(){let t=this.querySelector(":scope > .index-jump");if(t)for(let n of this.#o()){if(!n.id)continue;let e=[...t.querySelectorAll("a")].find(r=>r.getAttribute("href")===`#${n.id}`)??null;e&&(n.hidden?(e.setAttribute("aria-disabled","true"),e.setAttribute("tabindex","-1")):(e.removeAttribute("aria-disabled"),e.removeAttribute("tabindex")))}}async#x(t){try{let n=await fetch(t);if(!n.ok)return;let e=await n.json();this.#A(e)}catch{}}#A(t){if(!Array.isArray(t))return;let n=this.#s,e=new Map;for(let i of t){if(!i||typeof i!="object")continue;let l=[...String(i.term??"").trim()][0],c=l?l.toLocaleUpperCase(n):"#";e.has(c)||e.set(c,[]),e.get(c)?.push(i)}let r=this.#i(),o=document.createElement("nav");o.setAttribute("data-index",""),o.setAttribute("aria-label",r?.getAttribute("aria-label")||"Site index");let s=new Intl.Collator(n,{sensitivity:"base"}),u=[...e.keys()].sort((i,d)=>s.compare(i,d)||i.localeCompare(d));for(let i of u){let d=document.createElement("section");d.id=`index-${i.toLocaleLowerCase(n)}`;let l=document.createElement("h2");l.textContent=i,d.append(l);let c=document.createElement("ul");for(let h of e.get(i)??[]){let f=document.createElement("li"),p=document.createElement("span");if(p.className="index-term",p.textContent=String(h.term??""),f.append(p),Array.isArray(h.refs)&&h.refs.length){let y=document.createElement("ul");y.className="index-refs";for(let m of h.refs){if(!m||typeof m!="object")continue;let g=document.createElement("li"),S=$(m.href),E=String(m.label??m.href??"");if(S){let b=document.createElement("a");b.setAttribute("href",S),b.textContent=E,g.append(b)}else g.append(E);if(m.type){let b=document.createElement("small");b.textContent=String(m.type),g.append(" ",b)}y.append(g)}f.append(y)}c.append(f)}d.append(c),o.append(d)}r?r.replaceWith(o):this.append(o)}};C("site-index",A);export{A as SiteIndex};
1
+ var P=window.matchMedia("(prefers-reduced-motion: reduce)");var S=new Map;function w(a,t,n={}){let e=n.priority??10,r={impl:t,bundle:n.bundle,contract:n.contract,priority:e},o=S.get(a);if(customElements.get(a)){if(!o||o.priority>=e){o&&o.priority===e&&o.impl!==t&&console.warn(`[VB Bundle] Tag <${a}> already registered by "${o.bundle}" (priority ${o.priority}). Skipping "${n.bundle}".`);return}console.warn(`[VB Bundle] Tag <${a}> defined by "${o.bundle}" cannot be replaced (customElements.define is permanent). "${n.bundle}" has higher priority but arrived late.`);return}if(o&&o.priority>=e){o.priority===e&&console.warn(`[VB Bundle] Tag <${a}> already registered by "${o.bundle}". Skipping "${n.bundle}" (first wins at equal priority).`);return}S.set(a,r),customElements.define(a,t)}var v=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,n,e,r){t.addEventListener(n,e,r),this.#t.push(()=>t.removeEventListener(n,e,r))}_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,n){this.#e||(this.#e=this.attachInternals());let e=this.#e.states;try{n?e.add(t):e.delete(t)}catch{let r=`--${t}`;n?e.add(r):e.delete(r)}}_adoptInternals(t){this.#e||(this.#e=t)}#n(){return this.constructor.formAssociated&&this.#e?this.#e:null}get validity(){return this.#n()?.validity}get validationMessage(){return this.#n()?.validationMessage??""}get willValidate(){return this.#n()?.willValidate??!1}get form(){return this.#n()?.form??null}checkValidity(){return this.#n()?.checkValidity()??!0}reportValidity(){return this.#n()?.reportValidity()??!0}};var $=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function k(a,t){let e=(()=>{try{return decodeURIComponent(location.hash.slice(1))}catch{return location.hash.slice(1)}})()===t;e||(location.hash=t);let r=a;typeof r.focus=="function"&&(r.tabIndex<0&&!r.hasAttribute("tabindex")&&r.setAttribute("tabindex","-1"),r.focus({preventScroll:!0})),(e||!r.matches?.(":target"))&&r.scrollIntoView({behavior:$()?"auto":"smooth",block:"start"})}function C(a){let t=a;if(t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return!1;let e=(t.target instanceof Element?t.target:null)?.closest('a[href^="#"]');if(!e)return!1;let r=e.getAttribute("target");if(r&&r!=="_self"||e.hasAttribute("download"))return!1;let o=(e.getAttribute("href")??"").slice(1);if(!o)return!1;let s=o;try{s=decodeURIComponent(o)}catch{}let d=e.ownerDocument.getElementById(s);return d?(t.preventDefault(),k(d,s),!0):!1}var L={controls:"Filter the index",jump:"Jump to letter",terms:"{count} terms","terms-one":"1 term",more:"Show {count} more",less:"Show less",matches:"{count} terms match","matches-one":"1 term matches","no-matches":"No matches"},q="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");function M(a){if(typeof a!="string"||!a.trim())return null;try{let t=new URL(a,document.baseURI);return t.protocol==="http:"||t.protocol==="https:"?a:null}catch{return null}}var x=class extends v{#t=null;#e=null;#n=null;setup(){this.listen(this,"click",C);let t=this.getAttribute("src");t?this.#v(t).then(()=>{this.isConnected&&this.#l()}):this.#l()}teardown(){this.#t?.disconnect(),this.#t=null}#r(t,n){let e=this.getAttribute(`data-label-${t}`)??L[t];return n==null?e:e.replace("{count}",String(n))}get#s(){return this.closest("[lang]")?.getAttribute("lang")||document.documentElement.lang||void 0}#i(){return this.querySelector("nav[data-index]")??this.querySelector(":scope > nav:has(> section)")}#o(){let t=this.#i();return t?[...t.querySelectorAll(":scope > section")]:[]}#u(t){let n=t.id?.replace(/^index-/,"");if(!n)return"";let e=n;try{e=decodeURIComponent(n)}catch{}return e.toLocaleUpperCase(this.#s)}#l(){this.#f(),this.#h();let t=this.getAttribute("letters")||"entries";t!=="none"&&this.#p(t==="all"),this.#b(),this.#e?.value&&this.#d(this.#e.value)}#c(t){return t===1?this.#r("terms-one"):this.#r("terms",t)}#a(t){return t.querySelectorAll(":scope > ul > li").length}#f(){for(let t of this.#o()){let n=this.#a(t),e=t.querySelector("h2");if(!e||!n||e.querySelector(".index-count"))continue;let r=document.createElement("span");r.className="index-count",r.textContent=this.#c(n),e.append(" ",r)}}#h(){if(this.querySelector(":scope > [data-index-controls]"))return;let t=document.createElement("search");t.setAttribute("data-index-controls",""),t.setAttribute("aria-label",this.#r("controls"));let n=this.getAttribute("placeholder")||"Filter index\u2026",e=document.createElement("input");e.type="search",e.placeholder=n,e.setAttribute("aria-label",n),e.setAttribute("data-index-search",""),e.addEventListener("input",()=>this.#d(e.value)),this.#e=e,t.append(e);let r=document.createElement("output");r.setAttribute("role","status"),r.setAttribute("data-index-status",""),this.#n=r,t.append(r);let o=this.#i();o?o.before(t):this.prepend(t)}#p(t){let n=this.querySelector(":scope > .index-jump");n&&n.remove();let e=new Map;for(let l of this.#o()){let c=this.#u(l);c&&e.set(c,l.id)}if(e.size===0)return;let r=new Intl.Collator(this.#s,{sensitivity:"base"}),o=t?[...new Set([...q,...e.keys()])]:[...e.keys()];o.sort((l,c)=>r.compare(l,c)||l.localeCompare(c));let s=document.createElement("nav");s.className="index-jump",s.setAttribute("aria-label",this.#r("jump"));let d=document.createElement("ol");d.className="inline";for(let l of o){let c=document.createElement("li"),h=e.get(l);if(h){let f=document.createElement("a");f.setAttribute("href",`#${h}`),f.textContent=l;let p=this.querySelector(`#${CSS.escape(h)}`);p&&(f.title=this.#c(this.#a(p))),c.append(f)}else{let f=document.createElement("span");f.textContent=l,f.setAttribute("data-empty",""),c.append(f)}d.append(c)}s.append(d);let i=this.querySelector(":scope > [data-index-controls]"),u=this.#i();i?i.after(s):u?u.before(s):this.prepend(s),this.#m(s)}#m(t){let n=t.querySelectorAll("a");if(!n.length)return;let e=this.#o();if(e.length){this.#t?.disconnect(),this.#t=new IntersectionObserver(r=>{for(let o of r)if(o.isIntersecting){let s=o.target.id;for(let d of n){let i=d.getAttribute("href")===`#${s}`;d.setAttribute("aria-current",i?"true":"false")}}},{rootMargin:"-20% 0px -60% 0px"});for(let r of e)this.#t.observe(r)}}#b(){let t=this.getAttribute("limit");if(!t)return;let n=parseInt(t,10);if(!(!n||n<1))for(let e of this.#o()){let r=[...e.querySelectorAll(":scope > ul > li")];if(r.length<=n||e.querySelector(":scope > [data-index-expand]"))continue;let o=r.slice(n);for(let i of o)i.hidden=!0,i.setAttribute("data-index-overflow","");let s=document.createElement("button");s.type="button",s.setAttribute("data-index-expand",""),s.setAttribute("aria-expanded","false"),s.textContent=this.#r("more",o.length),s.addEventListener("click",()=>{let i=s.getAttribute("aria-expanded")!=="true";for(let u of o)u.hidden=!i;s.setAttribute("aria-expanded",String(i)),s.textContent=i?this.#r("less"):this.#r("more",o.length)});let d=e.querySelector(":scope > ul");d&&d.after(s)}}#d(t){let n=this.#s,e=t.toLocaleLowerCase(n).trim(),r=this.getAttribute("filter")==="topic"?"topic":"all",o=0;for(let s of this.#o()){let d=s.querySelectorAll(":scope > ul > li"),i=s.querySelector(":scope > [data-index-expand]"),u=i?.getAttribute("aria-expanded")==="true",l=!1,c=0;for(let h of d){let f=h.querySelector(".index-term")?.textContent?.toLocaleLowerCase(n)||"",p=!e||f.includes(e);if(!p&&r==="all"){for(let m of h.querySelectorAll(".index-refs a"))if((m.textContent||"").toLocaleLowerCase(n).includes(e)){p=!0;break}}p&&(l=!0,c++,o++);let y=!e&&h.hasAttribute("data-index-overflow")&&!u;h.hidden=!p||y}s.hidden=!l,this.#y(s,e?c:this.#a(s)),i&&(i.hidden=!!e)}this.#n&&(this.#n.textContent=e?o===0?this.#r("no-matches"):o===1?this.#r("matches-one"):this.#r("matches",o):""),this.#g()}#y(t,n){let e=this.#c(n),r=t.querySelector("h2 > .index-count");if(r&&r.textContent!==e&&(r.textContent=e),!t.id)return;let o=this.querySelector(`:scope > .index-jump a[href="#${CSS.escape(t.id)}"]`);o&&o.setAttribute("title",e)}#g(){let t=this.querySelector(":scope > .index-jump");if(t)for(let n of this.#o()){if(!n.id)continue;let e=[...t.querySelectorAll("a")].find(r=>r.getAttribute("href")===`#${n.id}`)??null;e&&(n.hidden?(e.setAttribute("aria-disabled","true"),e.setAttribute("tabindex","-1")):(e.removeAttribute("aria-disabled"),e.removeAttribute("tabindex")))}}async#v(t){try{let n=await fetch(t);if(!n.ok)return;let e=await n.json();this.#x(e)}catch{}}#x(t){if(!Array.isArray(t))return;let n=this.#s,e=new Map;for(let i of t){if(!i||typeof i!="object")continue;let l=[...String(i.term??"").trim()][0],c=l?l.toLocaleUpperCase(n):"#";e.has(c)||e.set(c,[]),e.get(c)?.push(i)}let r=this.#i(),o=document.createElement("nav");o.setAttribute("data-index",""),o.setAttribute("aria-label",r?.getAttribute("aria-label")||"Site index");let s=new Intl.Collator(n,{sensitivity:"base"}),d=[...e.keys()].sort((i,u)=>s.compare(i,u)||i.localeCompare(u));for(let i of d){let u=document.createElement("section");u.id=`index-${i.toLocaleLowerCase(n)}`;let l=document.createElement("h2");l.textContent=i,u.append(l);let c=document.createElement("ul");for(let h of e.get(i)??[]){let f=document.createElement("li"),p=document.createElement("span");if(p.className="index-term",p.textContent=String(h.term??""),f.append(p),Array.isArray(h.refs)&&h.refs.length){let y=document.createElement("ul");y.className="index-refs";for(let m of h.refs){if(!m||typeof m!="object")continue;let g=document.createElement("li"),A=M(m.href),E=String(m.label??m.href??"");if(A){let b=document.createElement("a");b.setAttribute("href",A),b.textContent=E,g.append(b)}else g.append(E);if(m.type){let b=document.createElement("small");b.textContent=String(m.type),g.append(" ",b)}y.append(g)}f.append(y)}c.append(f)}u.append(c),o.append(u)}r?r.replaceWith(o):this.append(o)}};w("site-index",x);export{x as SiteIndex};
2
2
  //# sourceMappingURL=site-index.js.map
@@ -1,2 +1,2 @@
1
- var z=window.matchMedia("(prefers-reduced-motion: reduce)");var k=new Map;function T(l,e,s={}){let t=s.priority??10,i={impl:e,bundle:s.bundle,contract:s.contract,priority:t},r=k.get(l);if(customElements.get(l)){if(!r||r.priority>=t){r&&r.priority===t&&r.impl!==e&&console.warn(`[VB Bundle] Tag <${l}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${s.bundle}".`);return}console.warn(`[VB Bundle] Tag <${l}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${s.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=t){r.priority===t&&console.warn(`[VB Bundle] Tag <${l}> already registered by "${r.bundle}". Skipping "${s.bundle}" (first wins at equal priority).`);return}k.set(l,i),customElements.define(l,e)}var w=class extends HTMLElement{#d=[];#s;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.#d)e();this.#d=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,s,t,i){e.addEventListener(s,t,i),this.#d.push(()=>e.removeEventListener(s,t,i))}_reinit(){for(let e of this.#d)e();this.#d=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,s){this.#s||(this.#s=this.attachInternals());let t=this.#s.states;try{s?t.add(e):t.delete(e)}catch{let i=`--${e}`;s?t.add(i):t.delete(i)}}_adoptInternals(e){this.#s||(this.#s=e)}#i(){return this.constructor.formAssociated&&this.#s?this.#s: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=0;function L(l,e,s="vb-vt"){if(!l?.isConnected||typeof document>"u"||!("startViewTransition"in document)||matchMedia("(prefers-reduced-motion: reduce)").matches)return e(),null;let t=`${s}-${++B}`;l.style.viewTransitionName=t;let i=document.startViewTransition(e);return i.finished.finally(()=>{l.style.viewTransitionName===t&&(l.style.viewTransitionName="")}),i}var x={layout:{label:"Layout",cssClass:"sm-badge--layout"},section:{label:"Section",cssClass:"sm-badge--section"},dashboard:{label:"Dashboard",cssClass:"sm-badge--dashboard"},page:{label:"Page",cssClass:"sm-badge--page"},modal:{label:"Modal",cssClass:"sm-badge--modal"},redirect:{label:"Redirect",cssClass:"sm-badge--redirect"}},S={draft:{label:"Draft",cssClass:"sm-status--draft"},ready:{label:"Ready",cssClass:"sm-status--ready"},live:{label:"Live",cssClass:"sm-status--live"},deprecated:{label:"Deprecated",cssClass:"sm-status--deprecated"}};function M(l){if(typeof l!="string"||!l.trim())return null;try{let e=new URL(l,document.baseURI);return e.protocol==="http:"||e.protocol==="https:"?l:null}catch{return null}}var I=0,q=class l extends w{static get observedAttributes(){return["src","collapsed","title","data-view","data-orientation","data-detail"]}#d=`sm-${++I}`;#s=!1;#i=null;#r=null;#t=null;#u=null;#a=0;#o=0;setup(){if((this.getAttribute("mode")||"nav-enhance")!=="ia-tree"){this.#mt();return}let e=this.getAttribute("src");if(e&&!this.querySelector("nav")){this._loadSrc(e);return}let s=this.querySelector(":scope > nav");if(!s)return;if(this.#a=0,this.#o=0,this.#T(s.querySelector("ul"),0),this.dataset.view==="visual"){this.#M(),this.#ot(s),this.dispatchEvent(new CustomEvent("site-map:ready",{bubbles:!0,detail:{nodeCount:this.#a,depth:this.#o}}));return}this.#L(s.querySelector("ul"),0),this.#M(),s.classList.add("sm-tree"),s.setAttribute("role","tree"),s.setAttribute("aria-label",this.getAttribute("title")||"Site map"),this.#i=s,this.hasAttribute("collapsed")&&this.#B();let t=s.querySelector('a[aria-current="page"]')?.closest('li[role="treeitem"]')??null,i=t&&this.#g().includes(t)?t:s.querySelector('li[role="treeitem"]');i&&(i.setAttribute("tabindex","0"),this.#u=i),this.listen(s,"keydown",r=>this.#it(r)),this.listen(s,"click",r=>this.#st(r)),this.dispatchEvent(new CustomEvent("site-map:ready",{bubbles:!0,detail:{nodeCount:this.#a,depth:this.#o}}))}teardown(){if((this.getAttribute("mode")||"nav-enhance")!=="ia-tree"){this.#ft();return}if(this.#t){this.#t.remove(),this.#t=null;let e=this.querySelector(":scope > nav");e&&(e.hidden=!1,e.removeAttribute("aria-hidden"))}this.#e=null,this.#c=null,this.#r&&(this.#r.remove(),this.#r=null),this.#i&&(this.#i.classList.remove("sm-tree"),this.#i.removeAttribute("role"),this.#i.removeAttribute("aria-label")),this.querySelectorAll(".sm-node-content").forEach(e=>{let s=e.querySelector(":scope > a");s&&(s.removeAttribute("tabindex"),e.before(s)),e.remove()}),this.querySelectorAll(".sm-toggle").forEach(e=>e.remove()),this.querySelectorAll('li[role="treeitem"]').forEach(e=>{e.removeAttribute("role"),e.removeAttribute("aria-expanded"),e.removeAttribute("tabindex")}),this.querySelectorAll('ul[role="group"]').forEach(e=>{e.removeAttribute("role"),e.classList.remove("sm-subtree","sm-collapsed")}),this.#i=null,this.#q=!1,this.#u=null,this.#a=0,this.#o=0}attributeChangedCallback(e,s,t){if(!(s===t||!this.isConnected||!this.hasAttribute("data-upgraded"))){if((this.getAttribute("mode")||"nav-enhance")!=="ia-tree"){e==="src"&&t&&this.#_();return}switch(e){case"src":t&&this._loadSrc(t);break;case"title":case"collapsed":case"data-view":this.#s||this._reinit();break;case"data-orientation":case"data-detail":!this.#s&&this.#e&&(this.#W(),this.#l());break}}}#T(e,s){if(!e)return;let t=e.querySelectorAll(":scope > li");for(let i of t){this.#a++;let r=s+1;r>this.#o&&(this.#o=r);let n=i.querySelector(":scope > ul");n&&this.#T(n,r)}}#L(e,s){if(!e)return;s>0&&(e.setAttribute("role","group"),e.classList.add("sm-subtree"));let t=[...e.querySelectorAll(":scope > li")];for(let i of t){let r=!!i.querySelector(":scope > ul"),n=i.querySelector(":scope > a"),o=i.getAttribute("data-page-type")||"page",u=i.getAttribute("data-template")||"",h=i.getAttribute("data-status")||"";i.setAttribute("role","treeitem"),i.setAttribute("tabindex","-1");let m=document.createElement("span");if(m.className="sm-node-content",r){i.setAttribute("aria-expanded","true");let c=document.createElement("button");c.className="sm-toggle",c.setAttribute("type","button"),c.setAttribute("aria-hidden","true"),c.setAttribute("tabindex","-1"),c.textContent="\u25BE",m.appendChild(c)}else{let c=document.createElement("span");c.className="sm-leaf-marker",c.setAttribute("aria-hidden","true"),m.appendChild(c)}if(h&&S[h]){let c=document.createElement("span");c.className=`sm-status-dot ${S[h].cssClass}`,c.setAttribute("title",S[h].label),c.setAttribute("aria-hidden","true"),m.appendChild(c);let g=document.createElement("span");g.className="visually-hidden",g.textContent=`${S[h].label}: `,m.appendChild(g)}if(n&&(n.setAttribute("tabindex","-1"),m.appendChild(n)),x[o]){let c=document.createElement("span");c.className=`sm-badge ${x[o].cssClass}`,c.textContent=x[o].label,m.appendChild(c)}if(u){let c=document.createElement("span");c.className="sm-badge sm-badge--template",c.textContent=u,m.appendChild(c)}i.insertBefore(m,i.firstChild);let a=i.querySelector(":scope > ul");a&&this.#L(a,s+1)}}#M(){let e=this.getAttribute("title");if(!e&&this.#a===0)return;if(this.#r=document.createElement("div"),this.#r.className="sm-header",e){let i=document.createElement("h2");i.className="sm-title",i.textContent=e,this.#r.appendChild(i)}let s=document.createElement("span");s.className="sm-summary",s.textContent=`${this.#a} pages \xB7 ${this.#o} levels deep`,this.#r.appendChild(s);let t=document.createElement("button");t.className="sm-toggle-all",t.setAttribute("type","button"),t.textContent="Collapse all",t.addEventListener("click",()=>{this.querySelectorAll('li[aria-expanded="true"]').length>0?(this.#B(),t.textContent="Expand all"):(this.#et(),t.textContent="Collapse all")}),this.#r.appendChild(t),this.insertBefore(this.#r,this.firstChild)}#B(){let e=this.querySelectorAll("li[aria-expanded]");for(let s of e){s.setAttribute("aria-expanded","false");let t=s.querySelector(":scope > ul");t&&t.classList.add("sm-collapsed");let i=s.querySelector(":scope > .sm-node-content > .sm-toggle");i&&(i.textContent="\u25B8")}this.#I()}#I(){let e=this.#u;if(!e||!this.#i)return;let s=this.#g();if(s.includes(e))return;let t=e.parentElement?.closest('li[role="treeitem"]');for(;t&&!s.includes(t);)t=t.parentElement?.closest('li[role="treeitem"]');let i=t??s[0]??null;if(!i)return;let r=e.contains(document.activeElement);e.setAttribute("tabindex","-1"),i.setAttribute("tabindex","0"),this.#u=i,r&&i.focus()}#et(){let e=this.querySelectorAll("li[aria-expanded]");for(let s of e){s.setAttribute("aria-expanded","true");let t=s.querySelector(":scope > ul");t&&t.classList.remove("sm-collapsed");let i=s.querySelector(":scope > .sm-node-content > .sm-toggle");i&&(i.textContent="\u25BE")}}#b(e){let s=e.getAttribute("aria-expanded")==="true";e.setAttribute("aria-expanded",s?"false":"true");let t=e.querySelector(":scope > ul");t&&t.classList.toggle("sm-collapsed",s);let i=e.querySelector(":scope > .sm-node-content > .sm-toggle");i&&(i.textContent=s?"\u25B8":"\u25BE"),s&&this.#I()}#st(e){let s=e.target;if(s.closest(".sm-toggle")){e.preventDefault();let r=s.closest('li[role="treeitem"]');r&&this.#b(r);return}let t=s.closest('li[role="treeitem"]');if(!t)return;this.#h(t);let i=s.closest("a");i&&this.dispatchEvent(new CustomEvent("site-map:select",{bubbles:!0,detail:{href:i.getAttribute("href")||"",pageType:t.getAttribute("data-page-type")||"page",template:t.getAttribute("data-template")||""}}))}#it(e){let s=e.target,t=s.closest('li[role="treeitem"]');if(!t||e.key==="Enter"&&s.closest("a")&&s!==t||e.altKey||e.ctrlKey||e.metaKey)return;let i=this.matches(":dir(rtl)"),r=e.key;i&&r==="ArrowRight"?r="ArrowLeft":i&&r==="ArrowLeft"&&(r="ArrowRight");let n=!1;switch(r){case"ArrowDown":n=!0,this.#rt(t);break;case"ArrowUp":n=!0,this.#nt(t);break;case"ArrowRight":if(n=!0,t.getAttribute("aria-expanded")==="false")this.#b(t);else if(t.getAttribute("aria-expanded")==="true"){let o=t.querySelector(':scope > ul > li[role="treeitem"]');o&&this.#h(o)}break;case"ArrowLeft":if(n=!0,t.getAttribute("aria-expanded")==="true")this.#b(t);else{let o=t.parentElement?.closest('li[role="treeitem"]');o&&this.#h(o)}break;case"Enter":{n=!0;let o=t.querySelector(":scope > .sm-node-content > a[href]");o?o.click():t.hasAttribute("aria-expanded")&&this.#b(t);break}case" ":{n=!0,t.hasAttribute("aria-expanded")?this.#b(t):t.querySelector(":scope > .sm-node-content > a[href]")?.click();break}case"Home":n=!0;{let o=this.querySelector('li[role="treeitem"]');o&&this.#h(o)}break;case"End":n=!0;{let o=this.#g();o.length&&this.#h(o[o.length-1])}break}n&&(e.preventDefault(),e.stopPropagation())}#g(){let e=[],s=i=>{if(!i)return;let r=[...i.querySelectorAll(':scope > li[role="treeitem"]')];for(let n of r)if(e.push(n),n.getAttribute("aria-expanded")==="true"){let o=n.querySelector(":scope > ul");o&&s(o)}},t=this.querySelector("nav > ul");return s(t),e}#rt(e){let s=this.#g(),t=s.indexOf(e);t>=0&&t<s.length-1&&this.#h(s[t+1])}#nt(e){let s=this.#g(),t=s.indexOf(e);t>0&&this.#h(s[t-1])}#h(e){this.#u&&this.#u.setAttribute("tabindex","-1"),e.setAttribute("tabindex","0"),e.focus(),this.#u=e}static#v="http://www.w3.org/2000/svg";static#p=150;static#m=70;static#z=30;static#w=50;static#at=20;#D(e){let s=[];for(let t of e.querySelectorAll(":scope > li")){let i=t.querySelector(":scope > a"),r=t.querySelector(":scope > ul");s.push({label:i?.textContent?.trim()||t.firstChild?.textContent?.trim()||"",href:i?.getAttribute("href")||"",pageType:t.getAttribute("data-page-type")||"page",template:t.getAttribute("data-template")||"",status:t.getAttribute("data-status")||"",children:r?this.#D(r):[],x:0,y:0,subtreeWidth:0,collapsed:!1,childCount:0})}return s}#H(e,s=0){let t=l.#p,i=l.#m,r=l.#z,n=l.#w;for(let o of e)o.childCount=this.#P(o),o.children.length>0&&!o.collapsed?(this.#H(o.children,s+1),o.subtreeWidth=o.children.reduce((u,h)=>u+h.subtreeWidth,0)+r*(o.children.length-1)):o.subtreeWidth=t,o.subtreeWidth=Math.max(o.subtreeWidth,t)}#P(e){let s=0;for(let t of e.children)s+=1+this.#P(t);return s}#V(e,s,t){let i=l.#p,r=l.#m,n=l.#z,o=l.#w,u=s;for(let h of e)h.x=u+(h.subtreeWidth-i)/2,h.y=t,h.children.length>0&&!h.collapsed&&this.#V(h.children,u,t+r+o),u+=h.subtreeWidth+n}#ot(e){e.hidden=!0,e.setAttribute("aria-hidden","true");let s=e.querySelector("ul");s&&(this.#e=this.#D(s),this.#l())}#e=null;#n=1;get#S(){return this.dataset.orientation==="horizontal"?"horizontal":"vertical"}get#y(){return Math.min(4,Math.max(0,parseInt(this.dataset.detail||"2",10)))}static#x={zoomIn:'<circle cx="11" cy="11" r="8"/><line x1="21" x2="16.65" y1="21" y2="16.65"/><line x1="11" x2="11" y1="8" y2="14"/><line x1="8" x2="14" y1="11" y2="11"/>',zoomOut:'<circle cx="11" cy="11" r="8"/><line x1="21" x2="16.65" y1="21" y2="16.65"/><line x1="8" x2="14" y1="11" y2="11"/>',reset:'<path d="M15 3h6v6"/><path d="m21 3-7 7"/><path d="m3 21 7-7"/><path d="M9 21H3v-6"/>',flip:'<path d="M21 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v3"/><path d="M21 16v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-3"/><path d="M4 12H2"/><path d="M10 12H8"/><path d="M16 12h-2"/><path d="M22 12h-2"/>'};static#C=["Shape","Shape + Title","Full","Full + Status","Wireframe"];#lt(e){let s=this.#t?.querySelector(".sm-visual-scroll"),t=this.#t?.querySelector('svg[role="tree"]'),i={nodeId:null,rectTop:0,rectLeft:0,focusId:this.#c};if(!s||!t)return i;let r=e||this.#c;if(!r)return i;let o=t.querySelector(`[data-node-id="${r}"]`)?.querySelector("rect");if(!o)return i;let u=o.getBoundingClientRect(),h=s.getBoundingClientRect();return i.nodeId=r,i.rectTop=u.top-h.top,i.rectLeft=u.left-h.left,i}#F(e,s){let t=this.#t?.querySelector(".sm-visual-scroll"),i=this.#t?.querySelector('svg[role="tree"]');if(!t||!i)return;if(e.nodeId){let u=i.querySelector(`[data-node-id="${e.nodeId}"]`)?.querySelector("rect");if(u){let h=u.getBoundingClientRect(),m=t.getBoundingClientRect(),a=h.top-m.top-e.rectTop,c=h.left-m.left-e.rectLeft;t.scrollTop+=a,t.scrollLeft+=c}}let r=e.focusId&&i.querySelector(`[data-node-id="${e.focusId}"]`)?e.focusId:"0",n=i.querySelector(`[data-node-id="${r}"]`);n&&this.#U(n),s&&i.focus({preventScroll:!0})}#l(e={}){if(!this.#e)return;let s=this.#lt(e.anchorId||null),t=this.#t?.querySelector(".sm-visual-scroll")??null,i=!!t&&t.contains(document.activeElement),r=l.#v,n=l.#p,o=l.#m,u=l.#at,h=this.#S==="horizontal";this.#H(this.#e),this.#V(this.#e,u,u);let m=this.#G(this.#e),a=m.maxX+n+u,c=m.maxY+o+u;h&&([a,c]=[c,a]);let g=this.#t?.querySelector(".sm-visual-summary");this.#t||(this.#t=document.createElement("div"),this.#t.className="sm-visual",this.#t.appendChild(this.#ct()),g=document.createElement("div"),g.className="sm-visual-summary",this.#t.appendChild(g),this.appendChild(this.#t));let p=document.createElement("div");p.className="sm-visual-scroll";let b=document.createElementNS(r,"svg");b.setAttribute("viewBox",`0 0 ${a} ${c}`),b.setAttribute("width",String(a)),b.setAttribute("height",String(c)),b.setAttribute("class",`sm-vsvg${this.#y>=4?" sm-vsvg--wireframe":""}`);let y=document.createElement("div");if(y.className="sm-visual-zoom",y.style.width=`${Math.round(a*this.#n)}px`,y.style.height=`${Math.round(c*this.#n)}px`,b.style.transform=`scale(${this.#n})`,b.style.transformOrigin="0 0",h){let v=document.createElementNS(r,"g");v.setAttribute("transform",`rotate(90 0 0) translate(0 -${c})`),this.#N(v,this.#e),this.#$(v,this.#e),b.appendChild(v)}else this.#N(b,this.#e),this.#$(b,this.#e);if(y.appendChild(b),p.appendChild(y),g){let v=Math.round(this.#n*100);g.textContent=`${this.#a} pages \xB7 ${this.#o} levels \xB7 ${v}%`}b.setAttribute("tabindex","0"),b.setAttribute("role","tree"),b.setAttribute("aria-label",`Site map${this.getAttribute("title")?": "+this.getAttribute("title"):""}`),b.addEventListener("keydown",v=>this.#ut(v)),b.addEventListener("click",v=>{let N=v.target,$=N.closest("[data-toggle]");if($){let E=$.getAttribute("data-toggle");E&&this.#X(E);return}let C=N.closest("[data-node-id]");if(C){let E=C.getAttribute("data-node-id");E&&this.#f(E),this.dispatchEvent(new CustomEvent("site-map:select",{bubbles:!0,detail:{href:C.getAttribute("data-href")||"",pageType:C.getAttribute("data-page-type")||"page",template:C.getAttribute("data-template")||""}}))}});let d=this.#t,f=()=>{t&&t.isConnected?t.replaceWith(p):d.insertBefore(p,d.querySelector(".sm-visual-summary"))},A=null;t?.isConnected?A=L(this,f,"sm-vt"):f(),A?A.updateCallbackDone.then(()=>this.#F(s,i)):this.#F(s,i),this.#pt(d,b)}#W(){let e=this.#t?.querySelector(".sm-vtoolbar");if(!e)return;let s=e.querySelector("[data-sm-flip]"),t=this.#S==="horizontal"?"Vertical":"Horizontal";s?.setAttribute("aria-label",t),s?.setAttribute("title",t);let i=e.querySelector(".sm-vtoolbar-slider");i&&(i.value=String(this.#y));let r=e.querySelector(".sm-vtoolbar-detail-label");r&&(r.textContent=l.#C[this.#y])}#R(e,s){this.#s=!0,this.dataset[e]=s,this.#s=!1}#ct(){let e=document.createElement("div");e.className="sm-vtoolbar",e.setAttribute("role","toolbar"),e.setAttribute("aria-label","Site map controls");let s=g=>`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${g}</svg>`,t=this.#E(s(l.#x.zoomIn),"Zoom in",()=>{this.#n=Math.min(3,this.#n+.25),this.#l()});e.appendChild(t);let i=this.#E(s(l.#x.zoomOut),"Zoom out",()=>{this.#n=Math.max(.25,this.#n-.25),this.#l()});e.appendChild(i);let r=this.#E(s(l.#x.reset),"Reset zoom",()=>{this.#n=1,this.#l()});e.appendChild(r);let n=document.createElement("span");n.className="sm-vtoolbar-sep",e.appendChild(n);let o=this.#S==="horizontal"?"Vertical":"Horizontal",u=this.#E(s(l.#x.flip),o,()=>{this.#R("orientation",this.#S==="horizontal"?"vertical":"horizontal"),this.#W(),this.#l()});u.setAttribute("data-sm-flip",""),e.appendChild(u),e.appendChild(n.cloneNode());let h=this.#y,m=document.createElement("label");m.className="sm-vtoolbar-detail",m.textContent="Detail ";let a=document.createElement("input");a.type="range",a.min="0",a.max="4",a.value=String(h),a.setAttribute("aria-label","Detail level"),a.className="sm-vtoolbar-slider",m.appendChild(a);let c=document.createElement("span");return c.className="sm-vtoolbar-detail-label",c.textContent=l.#C[h],m.appendChild(c),a.addEventListener("input",()=>{this.#R("detail",a.value),c.textContent=l.#C[parseInt(a.value,10)],a.setAttribute("aria-valuetext",c.textContent),this.#l()}),a.setAttribute("aria-valuetext",l.#C[h]),e.appendChild(m),e}#E(e,s,t){let i=document.createElement("button");return i.type="button",i.className="sm-vtoolbar-btn",i.innerHTML=e,i.setAttribute("aria-label",s),i.setAttribute("title",s),i.addEventListener("click",t),i}#c=null;#O(e,s=""){let t=[];for(let i=0;i<e.length;i++){let r=e[i],n=s?`${s}-${i}`:String(i);t.push(n),r.children.length>0&&!r.collapsed&&t.push(...this.#O(r.children,n))}return t}#dt(e){let s=e.lastIndexOf("-");return s>0?e.slice(0,s):null}#gt(e){let s=this.#A(e,this.#e);return!s||s.collapsed||s.children.length===0?null:`${e}-0`}#f(e){if(!e||!this.#t)return;let s=this.#t.querySelector('svg[role="tree"]');if(!s)return;let t=s.querySelector(`[data-node-id="${e}"]`);if(!t)return;this.#U(t),this.#c=e;let i=t.querySelector("rect"),r=this.#t?.querySelector(".sm-visual-scroll");if(i&&r){let n=i.getBoundingClientRect(),o=r.getBoundingClientRect();(n.left<o.left||n.right>o.right||n.top<o.top||n.bottom>o.bottom)&&i.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}#U(e){let s=e.closest("svg");if(!s)return;s.querySelectorAll(".sm-vfocus-ring").forEach(r=>r.remove()),s.querySelectorAll('[data-node-id][aria-selected="true"]').forEach(r=>r.setAttribute("aria-selected","false"));let t=l.#v,i=e.querySelector("rect");if(i){let r=document.createElementNS(t,"rect");r.setAttribute("x",String(parseFloat(i.getAttribute("x")??"0")-3)),r.setAttribute("y",String(parseFloat(i.getAttribute("y")??"0")-3)),r.setAttribute("width",String(parseFloat(i.getAttribute("width")??"0")+6)),r.setAttribute("height",String(parseFloat(i.getAttribute("height")??"0")+6)),r.setAttribute("rx","11"),r.setAttribute("class","sm-vfocus-ring"),r.setAttribute("aria-hidden","true"),e.parentNode?.insertBefore(r,e)}e.setAttribute("aria-selected","true"),e.id&&s.setAttribute("aria-activedescendant",e.id),this.#c=e.getAttribute("data-node-id")}#ut(e){if(!this.#e)return;let s=this.#c||"0",t=!1;switch(e.key){case"ArrowDown":{t=!0;let i=this.#A(s,this.#e);i&&i.children.length>0&&!i.collapsed&&this.#f(`${s}-0`);break}case"ArrowUp":{t=!0;let i=this.#dt(s);i&&this.#f(i);break}case"ArrowRight":{t=!0;let i=this.#Y(s,1);i&&this.#f(i);break}case"ArrowLeft":{t=!0;let i=this.#Y(s,-1);i&&this.#f(i);break}case"Enter":case" ":{t=!0;let i=this.#A(s,this.#e);i&&i.children.length>0&&this.#X(s);break}case"Home":{t=!0,this.#f("0");break}case"End":{t=!0;let i=this.#O(this.#e);i.length&&this.#f(i[i.length-1]);break}}t&&(e.preventDefault(),e.stopPropagation())}#Y(e,s){let t=e.split("-").map(Number),i=t[t.length-1]+s;if(i<0)return null;let r=t.length>1?t.slice(0,-1).join("-"):null,n=r?this.#A(r,this.#e):null,o=n?n.children:this.#e;if(!o||i>=o.length)return null;let u=[...t];return u[u.length-1]=i,u.join("-")}#q=!1;#ht={dragging:!1,startX:0,startY:0,scrollLeft:0,scrollTop:0,moved:!1};#pt(e,s){if(s.style.cursor="grab",this.#q)return;this.#q=!0;let t=this.#ht;this.listen(this,"pointerdown",i=>{let r=i;if(r.target.closest("button, [data-toggle], .sm-vtoolbar, input"))return;let n=this.querySelector(".sm-visual-scroll");if(!n)return;t.dragging=!0,t.moved=!1,t.startX=r.clientX,t.startY=r.clientY,t.scrollLeft=n.scrollLeft,t.scrollTop=n.scrollTop;let o=this.querySelector('svg[role="tree"]');o&&(o.style.cursor="grabbing")}),this.listen(window,"pointermove",i=>{if(!t.dragging)return;let r=i,n=r.clientX-t.startX,o=r.clientY-t.startY;(Math.abs(n)>3||Math.abs(o)>3)&&(t.moved=!0);let u=this.querySelector(".sm-visual-scroll");u&&(u.scrollLeft=t.scrollLeft-n,u.scrollTop=t.scrollTop-o)}),this.listen(window,"pointerup",()=>{if(!t.dragging)return;t.dragging=!1;let i=this.querySelector('svg[role="tree"]');i&&(i.style.cursor="grab")}),this.listen(this,"click",i=>{t.moved&&(i.stopPropagation(),t.moved=!1)},{capture:!0})}#G(e){let s=0,t=0;for(let i of e)if(i.x+l.#p>s&&(s=i.x+l.#p),i.y+l.#m>t&&(t=i.y+l.#m),i.children.length>0&&!i.collapsed){let r=this.#G(i.children);r.maxX>s&&(s=r.maxX),r.maxY>t&&(t=r.maxY)}return{maxX:s,maxY:t}}#N(e,s){let t=l.#v,i=l.#p,r=l.#m,n=l.#w;for(let o of s){if(o.children.length===0||o.collapsed)continue;let u=o.x+i/2,h=o.y+r,m=h+n/2;for(let a of o.children){let c=a.x+i/2,g=a.y,p=document.createElementNS(t,"path");p.setAttribute("d",`M ${u} ${h} L ${u} ${m} L ${c} ${m} L ${c} ${g}`),p.setAttribute("class","sm-vedge"),p.setAttribute("aria-hidden","true"),e.appendChild(p)}this.#N(e,o.children)}}#$(e,s,t=""){let i=l.#v,r=l.#p,n=l.#m,o=this.#y,u=o>=4,h=t?t.split("-").length+1:1;for(let m=0;m<s.length;m++){let a=s[m],c=t?`${t}-${m}`:String(m),g=x[a.pageType]?a.pageType:"page",p=document.createElementNS(i,"g");p.setAttribute("class",`sm-vnode sm-vnode--${g}`),p.id=`${this.#d}-n-${c}`,p.setAttribute("role","treeitem"),p.setAttribute("aria-level",String(h)),p.setAttribute("aria-setsize",String(s.length)),p.setAttribute("aria-posinset",String(m+1)),p.setAttribute("aria-selected","false"),a.children.length>0&&p.setAttribute("aria-expanded",a.collapsed?"false":"true");let b=a.status&&S[a.status]?`, ${S[a.status].label}`:"";p.setAttribute("aria-label",`${a.label||a.href||"Untitled"}, ${x[g].label}${a.template?`, ${a.template}`:""}${b}`),p.setAttribute("data-node-id",c),p.setAttribute("data-href",a.href),p.setAttribute("data-page-type",a.pageType),p.setAttribute("data-template",a.template),p.style.cursor="pointer";let y=document.createElementNS(i,"rect");if(y.setAttribute("x",String(a.x)),y.setAttribute("y",String(a.y)),y.setAttribute("width",String(r)),y.setAttribute("height",String(n)),y.setAttribute("rx","8"),y.setAttribute("class","sm-vbox"),(u||a.pageType==="modal")&&y.setAttribute("stroke-dasharray","6 3"),p.appendChild(y),o>=1){let d=document.createElementNS(i,"text");d.setAttribute("x",String(a.x+r/2)),d.setAttribute("y",String(o===1?a.y+n/2+5:a.y+24)),d.setAttribute("text-anchor","middle"),d.setAttribute("font-size","13"),d.setAttribute("font-weight","600"),d.setAttribute("class","sm-vlabel"),d.textContent=a.label.length>18?a.label.slice(0,17)+"\u2026":a.label,p.appendChild(d)}if(o>=2){let d=document.createElementNS(i,"text");if(d.setAttribute("x",String(a.x+r/2)),d.setAttribute("y",String(a.y+40)),d.setAttribute("text-anchor","middle"),d.setAttribute("font-size","9"),d.setAttribute("font-weight","700"),d.setAttribute("class","sm-vtype"),d.textContent=(x[a.pageType]?.label||a.pageType).toUpperCase(),p.appendChild(d),a.template){let f=document.createElementNS(i,"text");f.setAttribute("x",String(a.x+r/2)),f.setAttribute("y",String(a.y+54)),f.setAttribute("text-anchor","middle"),f.setAttribute("font-size","9"),f.setAttribute("class","sm-vtemplate"),f.textContent=a.template,p.appendChild(f)}}if(o>=3&&a.status&&S[a.status]){let d=document.createElementNS(i,"circle");d.setAttribute("cx",String(a.x+r/2)),d.setAttribute("cy",String(a.y+n-8)),d.setAttribute("r","4"),d.setAttribute("class",`sm-vstatus sm-vstatus--${a.status}`),p.appendChild(d)}if(u)for(let d=0;d<2;d++){let f=document.createElementNS(i,"line");f.setAttribute("x1",String(a.x+12)),f.setAttribute("x2",String(a.x+r-12)),f.setAttribute("y1",String(a.y+n-22+d*8)),f.setAttribute("y2",String(a.y+n-22+d*8)),f.setAttribute("class","sm-vwire"),p.appendChild(f)}if(a.children.length>0){let d=document.createElementNS(i,"g");d.setAttribute("data-toggle",c),d.setAttribute("class","sm-vtoggle"),d.setAttribute("aria-hidden","true");let f=document.createElementNS(i,"circle");f.setAttribute("cx",String(a.x+r/2)),f.setAttribute("cy",String(a.y+n+10)),f.setAttribute("r","10"),d.appendChild(f);let A=document.createElementNS(i,"text");A.setAttribute("x",String(a.x+r/2)),A.setAttribute("y",String(a.y+n+14)),A.setAttribute("text-anchor","middle"),A.setAttribute("font-size","11"),A.setAttribute("font-weight","700"),A.textContent=a.collapsed?`+${a.childCount}`:"\u2212",d.appendChild(A),p.appendChild(d)}e.appendChild(p),a.children.length>0&&!a.collapsed&&this.#$(e,a.children,c)}}#X(e){let s=this.#A(e,this.#e);s&&(s.collapsed=!s.collapsed,this.#c||(this.#c=e),this.#l({anchorId:e}))}#A(e,s){if(!s)return null;let t=e.split("-").map(Number),i=s,r=null;for(let n of t){if(!i||n>=i.length)return null;r=i[n],i=r.children}return r}async _loadSrc(e){if(e)try{let s=await fetch(e);if(!s.ok)throw new Error(`HTTP ${s.status}`);let t=await s.json();t.title&&!this.getAttribute("title")&&(this.#s=!0,this.setAttribute("title",String(t.title)),this.#s=!1),this._setPages(t.pages||[])}catch(s){console.warn(`[site-map] Failed to load src="${e}":`,s)}}get pages(){let s=this.querySelector(":scope > nav")?.querySelector("ul");return s?this.#j(s):[]}set pages(e){this._setPages(Array.isArray(e)?e:[]),this.dispatchEvent(new CustomEvent("site-map:pages-changed",{detail:{pages:this.pages,source:"property"},bubbles:!0}))}_setPages(e){for(;this.firstChild;)this.firstChild.remove();let s=document.createElement("nav"),t=document.createElement("ul");this.#K(t,e),s.appendChild(t),this.appendChild(s),this._reinit()}#j(e){let s=[];for(let t of e.querySelectorAll(":scope > li")){let i=t.querySelector(":scope > a, :scope > .sm-node-content > a"),r=t.querySelector(":scope > ul"),n={label:i?.textContent?.trim()||"",href:i?.getAttribute("href")||void 0,pageType:t.getAttribute("data-page-type")||void 0,template:t.getAttribute("data-template")||void 0,status:t.getAttribute("data-status")||void 0};r&&(n.children=this.#j(r)),s.push(n)}return s}#K(e,s){for(let t of s){let i=document.createElement("li");t.pageType&&i.setAttribute("data-page-type",t.pageType),t.template&&i.setAttribute("data-template",t.template),t.status&&i.setAttribute("data-status",t.status);let r=document.createElement("a"),n=M(t.href);if(n&&r.setAttribute("href",n),r.textContent=String(t.label??""),i.appendChild(r),t.children&&t.children.length>0){let o=document.createElement("ul");this.#K(o,t.children),i.appendChild(o)}e.appendChild(i)}}#mt(){this.#Z(),this.#k(),this.#Q(),this.getAttribute("src")&&this.#_()}#J(){return this.querySelector(":scope > nav:not([data-sitemap-controls])")}#ft(){this.querySelector(":scope > [data-sitemap-controls]")?.remove()}#Z(){let e=this.getAttribute("current")||window.location.pathname,s=this.querySelectorAll("a");for(let t of s){if(!t.hasAttribute("href"))continue;new URL(t.href,window.location.origin).pathname===e&&t.setAttribute("aria-current","page")}}#k(){let e=this.querySelector('[aria-current="page"]');if(!e)return;let s=e.parentElement;for(;s&&s!==this;)s.tagName==="DETAILS"&&(s.open=!0),s=s.parentElement}#Q(){if(this.querySelector(":scope > [data-sitemap-controls]")?.remove(),!this.querySelector("details"))return;let e=()=>this.querySelectorAll("details"),s=document.createElement("nav");s.setAttribute("data-sitemap-controls",""),s.setAttribute("aria-label",this.getAttribute("data-label-controls")??"Sitemap controls");let t=document.createElement("button");t.type="button",t.className="small secondary",t.textContent=this.getAttribute("data-label-expand")??"Expand all",this.listen(t,"click",()=>{for(let n of e())n.open=!0});let i=document.createElement("button");i.type="button",i.className="small secondary",i.textContent=this.getAttribute("data-label-collapse")??"Collapse all",this.listen(i,"click",()=>{for(let n of e())n.open=!1;this.#k()}),s.append(t,i);let r=this.#J();r?r.before(s):this.prepend(s)}async#_(){let e=this.getAttribute("src");if(e)try{let s=await fetch(e);if(!s.ok)return;let t=await s.json();this.#bt(t)}catch{}}#bt(e){if(!e||!Array.isArray(e.children))return;let s=this.#J(),t=document.createElement("nav");t.setAttribute("aria-label",s?.getAttribute("aria-label")||"Full site map"),t.append(this.#tt(e.children)),s?s.replaceWith(t):this.append(t),this.#Z(),this.#k(),this.#Q()}#tt(e){let s=document.createElement("ul");for(let t of e){let i=document.createElement("li");if(t.children?.length){let r=document.createElement("details"),n=document.createElement("summary");n.textContent=String(t.title??""),r.append(n),r.append(this.#tt(t.children)),i.append(r)}else{let r=document.createElement("a"),n=M(t.href||t.path);n&&r.setAttribute("href",n),r.textContent=String(t.title??""),i.append(r)}s.append(i)}return s}};T("site-map",q);export{q as SiteMap};
1
+ var D=window.matchMedia("(prefers-reduced-motion: reduce)");var T=new Map;function L(l,e,s={}){let t=s.priority??10,r={impl:e,bundle:s.bundle,contract:s.contract,priority:t},i=T.get(l);if(customElements.get(l)){if(!i||i.priority>=t){i&&i.priority===t&&i.impl!==e&&console.warn(`[VB Bundle] Tag <${l}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${s.bundle}".`);return}console.warn(`[VB Bundle] Tag <${l}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${s.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=t){i.priority===t&&console.warn(`[VB Bundle] Tag <${l}> already registered by "${i.bundle}". Skipping "${s.bundle}" (first wins at equal priority).`);return}T.set(l,r),customElements.define(l,e)}var w=class extends HTMLElement{#d=[];#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.#d)e();this.#d=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,s,t,r){e.addEventListener(s,t,r),this.#d.push(()=>e.removeEventListener(s,t,r))}_reinit(){for(let e of this.#d)e();this.#d=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,s){this.#r||(this.#r=this.attachInternals());let t=this.#r.states;try{s?t.add(e):t.delete(e)}catch{let r=`--${e}`;s?t.add(r):t.delete(r)}}_adoptInternals(e){this.#r||(this.#r=e)}#s(){return this.constructor.formAssociated&&this.#r?this.#r:null}get validity(){return this.#s()?.validity}get validationMessage(){return this.#s()?.validationMessage??""}get willValidate(){return this.#s()?.willValidate??!1}get form(){return this.#s()?.form??null}checkValidity(){return this.#s()?.checkValidity()??!0}reportValidity(){return this.#s()?.reportValidity()??!0}};var N=0;function M(l,e,s="vb-vt"){if(!l?.isConnected||typeof document>"u"||!("startViewTransition"in document)||matchMedia("(prefers-reduced-motion: reduce)").matches)return e(),null;let t=`${s}-${++N}`;l.style.viewTransitionName=t;let r=document.startViewTransition(e);return r.finished.finally(()=>{l.style.viewTransitionName===t&&(l.style.viewTransitionName="")}),r}var x={layout:{label:"Layout",cssClass:"sm-badge--layout"},section:{label:"Section",cssClass:"sm-badge--section"},dashboard:{label:"Dashboard",cssClass:"sm-badge--dashboard"},page:{label:"Page",cssClass:"sm-badge--page"},modal:{label:"Modal",cssClass:"sm-badge--modal"},redirect:{label:"Redirect",cssClass:"sm-badge--redirect"}},S={draft:{label:"Draft",cssClass:"sm-status--draft"},ready:{label:"Ready",cssClass:"sm-status--ready"},live:{label:"Live",cssClass:"sm-status--live"},deprecated:{label:"Deprecated",cssClass:"sm-status--deprecated"}};function B(l){if(typeof l!="string"||!l.trim())return null;try{let e=new URL(l,document.baseURI);return e.protocol==="http:"||e.protocol==="https:"?l:null}catch{return null}}var P=0,$=class l extends w{static get observedAttributes(){return["src","collapsed","title","data-view","data-orientation","data-detail"]}#d=`sm-${++P}`;#r=!1;#s=null;#i=null;#t=null;#u=null;#a=0;#o=0;setup(){if((this.getAttribute("mode")||"nav-enhance")!=="ia-tree"){this.#ft();return}let e=this.getAttribute("src");if(e&&!this.querySelector("nav")){this._loadSrc(e);return}let s=this.querySelector(":scope > nav");if(!s)return;if(this.#a=0,this.#o=0,this.#M(s.querySelector("ul"),0),this.dataset.view==="visual"){this.#N(),this.#ot(s),this.dispatchEvent(new CustomEvent("site-map:ready",{bubbles:!0,detail:{nodeCount:this.#a,depth:this.#o}}));return}this.#B(s.querySelector("ul"),0),this.#N(),s.classList.add("sm-tree");let t=this.getAttribute("title")||"Site map";!s.hasAttribute("aria-label")&&!s.hasAttribute("aria-labelledby")&&(s.setAttribute("aria-label",t),s.setAttribute("data-sm-labelled",""));let r=s.querySelector("ul");r&&(r.setAttribute("role","tree"),r.setAttribute("aria-label",t)),this.#s=s,this.hasAttribute("collapsed")&&this.#P();let i=s.querySelector('a[aria-current="page"]')?.closest('li[role="treeitem"]')??null,n=i&&this.#y().includes(i)?i:s.querySelector('li[role="treeitem"]');n&&(n.setAttribute("tabindex","0"),this.#u=n),this.listen(s,"keydown",a=>this.#rt(a)),this.listen(s,"click",a=>this.#st(a)),this.dispatchEvent(new CustomEvent("site-map:ready",{bubbles:!0,detail:{nodeCount:this.#a,depth:this.#o}}))}teardown(){if((this.getAttribute("mode")||"nav-enhance")!=="ia-tree"){this.#mt();return}if(this.#t){this.#t.remove(),this.#t=null;let e=this.querySelector(":scope > nav");e&&(e.hidden=!1,e.removeAttribute("aria-hidden"))}if(this.#e=null,this.#c=null,this.#i&&(this.#i.remove(),this.#i=null),this.#s){this.#s.classList.remove("sm-tree"),this.#s.hasAttribute("data-sm-labelled")&&(this.#s.removeAttribute("aria-label"),this.#s.removeAttribute("data-sm-labelled"));let e=this.#s.querySelector('ul[role="tree"]');e?.removeAttribute("role"),e?.removeAttribute("aria-label")}this.querySelectorAll(".sm-node-content").forEach(e=>{let s=e.querySelector(":scope > a");s&&(s.removeAttribute("tabindex"),e.before(s)),e.remove()}),this.querySelectorAll(".sm-toggle").forEach(e=>e.remove()),this.querySelectorAll('li[role="treeitem"]').forEach(e=>{e.removeAttribute("role"),e.removeAttribute("aria-expanded"),e.removeAttribute("tabindex")}),this.querySelectorAll('ul[role="group"]').forEach(e=>{e.removeAttribute("role"),e.classList.remove("sm-subtree","sm-collapsed")}),this.#s=null,this.#$=!1,this.#u=null,this.#a=0,this.#o=0}attributeChangedCallback(e,s,t){if(!(s===t||!this.isConnected||!this.hasAttribute("data-upgraded"))){if((this.getAttribute("mode")||"nav-enhance")!=="ia-tree"){e==="src"&&t&&this.#_();return}switch(e){case"src":t&&this._loadSrc(t);break;case"title":case"collapsed":case"data-view":this.#r||this._reinit();break;case"data-orientation":case"data-detail":!this.#r&&this.#e&&(this.#O(),this.#l());break}}}#M(e,s){if(!e)return;let t=e.querySelectorAll(":scope > li");for(let r of t){this.#a++;let i=s+1;i>this.#o&&(this.#o=i);let n=r.querySelector(":scope > ul");n&&this.#M(n,i)}}#B(e,s){if(!e)return;s>0&&(e.setAttribute("role","group"),e.classList.add("sm-subtree"));let t=[...e.querySelectorAll(":scope > li")];for(let r of t){let i=!!r.querySelector(":scope > ul"),n=r.querySelector(":scope > a"),a=r.getAttribute("data-page-type")||"page",u=r.getAttribute("data-template")||"",h=r.getAttribute("data-status")||"";r.setAttribute("role","treeitem"),r.setAttribute("tabindex","-1");let f=document.createElement("span");if(f.className="sm-node-content",i){r.setAttribute("aria-expanded","true");let c=document.createElement("button");c.className="sm-toggle",c.setAttribute("type","button"),c.setAttribute("aria-hidden","true"),c.setAttribute("tabindex","-1"),c.textContent="\u25BE",f.appendChild(c)}else{let c=document.createElement("span");c.className="sm-leaf-marker",c.setAttribute("aria-hidden","true"),f.appendChild(c)}if(h&&S[h]){let c=document.createElement("span");c.className=`sm-status-dot ${S[h].cssClass}`,c.setAttribute("title",S[h].label),c.setAttribute("aria-hidden","true"),f.appendChild(c);let g=document.createElement("span");g.className="visually-hidden",g.textContent=`${S[h].label}: `,f.appendChild(g)}if(n&&(n.setAttribute("tabindex","-1"),f.appendChild(n)),x[a]){let c=document.createElement("span");c.className=`sm-badge ${x[a].cssClass}`,c.textContent=x[a].label,f.appendChild(c)}if(u){let c=document.createElement("span");c.className="sm-badge sm-badge--template",c.textContent=u,f.appendChild(c)}r.insertBefore(f,r.firstChild);let o=r.querySelector(":scope > ul");o&&this.#B(o,s+1)}}#N(){let e=this.getAttribute("title");if(!e&&this.#a===0)return;if(this.#i=document.createElement("div"),this.#i.className="sm-header",e){let r=document.createElement("h2");r.className="sm-title",r.textContent=e,this.#i.appendChild(r)}let s=document.createElement("span");s.className="sm-summary",s.textContent=`${this.#a} pages \xB7 ${this.#o} levels deep`,this.#i.appendChild(s);let t=document.createElement("button");t.className="sm-toggle-all",t.setAttribute("type","button"),t.textContent="Collapse all",t.addEventListener("click",()=>{this.querySelectorAll('li[aria-expanded="true"]').length>0?(this.#P(),t.textContent="Expand all"):(this.#et(),t.textContent="Collapse all")}),this.#i.appendChild(t),this.insertBefore(this.#i,this.firstChild)}#P(){let e=this.querySelectorAll("li[aria-expanded]");for(let s of e){s.setAttribute("aria-expanded","false");let t=s.querySelector(":scope > ul");t&&t.classList.add("sm-collapsed");let r=s.querySelector(":scope > .sm-node-content > .sm-toggle");r&&(r.textContent="\u25B8")}this.#H()}#H(){let e=this.#u;if(!e||!this.#s)return;let s=this.#y();if(s.includes(e))return;let t=e.parentElement?.closest('li[role="treeitem"]');for(;t&&!s.includes(t);)t=t.parentElement?.closest('li[role="treeitem"]');let r=t??s[0]??null;if(!r)return;let i=e.contains(document.activeElement);e.setAttribute("tabindex","-1"),r.setAttribute("tabindex","0"),this.#u=r,i&&r.focus()}#et(){let e=this.querySelectorAll("li[aria-expanded]");for(let s of e){s.setAttribute("aria-expanded","true");let t=s.querySelector(":scope > ul");t&&t.classList.remove("sm-collapsed");let r=s.querySelector(":scope > .sm-node-content > .sm-toggle");r&&(r.textContent="\u25BE")}}#g(e){let s=e.getAttribute("aria-expanded")==="true";e.setAttribute("aria-expanded",s?"false":"true");let t=e.querySelector(":scope > ul");t&&t.classList.toggle("sm-collapsed",s);let r=e.querySelector(":scope > .sm-node-content > .sm-toggle");r&&(r.textContent=s?"\u25B8":"\u25BE"),s&&this.#H()}#st(e){let s=e.target;if(s.closest(".sm-toggle")){e.preventDefault();let i=s.closest('li[role="treeitem"]');i&&this.#g(i);return}let t=s.closest('li[role="treeitem"]');if(!t)return;this.#h(t);let r=s.closest("a");r&&this.dispatchEvent(new CustomEvent("site-map:select",{bubbles:!0,detail:{href:r.getAttribute("href")||"",pageType:t.getAttribute("data-page-type")||"page",template:t.getAttribute("data-template")||""}}))}#rt(e){let s=e.target,t=s.closest('li[role="treeitem"]');if(!t||e.key==="Enter"&&s.closest("a")&&s!==t||e.altKey||e.ctrlKey||e.metaKey)return;let r=this.matches(":dir(rtl)"),i=e.key;r&&i==="ArrowRight"?i="ArrowLeft":r&&i==="ArrowLeft"&&(i="ArrowRight");let n=!1;switch(i){case"ArrowDown":n=!0,this.#it(t);break;case"ArrowUp":n=!0,this.#nt(t);break;case"ArrowRight":if(n=!0,t.getAttribute("aria-expanded")==="false")this.#g(t);else if(t.getAttribute("aria-expanded")==="true"){let a=t.querySelector(':scope > ul > li[role="treeitem"]');a&&this.#h(a)}break;case"ArrowLeft":if(n=!0,t.getAttribute("aria-expanded")==="true")this.#g(t);else{let a=t.parentElement?.closest('li[role="treeitem"]');a&&this.#h(a)}break;case"Enter":{n=!0;let a=t.querySelector(":scope > .sm-node-content > a[href]");a?a.click():t.hasAttribute("aria-expanded")&&this.#g(t);break}case" ":{n=!0,t.hasAttribute("aria-expanded")?this.#g(t):t.querySelector(":scope > .sm-node-content > a[href]")?.click();break}case"Home":n=!0;{let a=this.querySelector('li[role="treeitem"]');a&&this.#h(a)}break;case"End":n=!0;{let a=this.#y();a.length&&this.#h(a[a.length-1])}break}n&&(e.preventDefault(),e.stopPropagation())}#y(){let e=[],s=r=>{if(!r)return;let i=[...r.querySelectorAll(':scope > li[role="treeitem"]')];for(let n of i)if(e.push(n),n.getAttribute("aria-expanded")==="true"){let a=n.querySelector(":scope > ul");a&&s(a)}},t=this.querySelector("nav > ul");return s(t),e}#it(e){let s=this.#y(),t=s.indexOf(e);t>=0&&t<s.length-1&&this.#h(s[t+1])}#nt(e){let s=this.#y(),t=s.indexOf(e);t>0&&this.#h(s[t-1])}#h(e){this.#u&&this.#u.setAttribute("tabindex","-1"),e.setAttribute("tabindex","0"),e.focus(),this.#u=e}static#v="http://www.w3.org/2000/svg";static#p=150;static#f=70;static#I=30;static#w=50;static#at=20;#z(e){let s=[];for(let t of e.querySelectorAll(":scope > li")){let r=t.querySelector(":scope > a"),i=t.querySelector(":scope > ul");s.push({label:r?.textContent?.trim()||t.firstChild?.textContent?.trim()||"",href:r?.getAttribute("href")||"",anchor:r?.hasAttribute("href")?r:null,pageType:t.getAttribute("data-page-type")||"page",template:t.getAttribute("data-template")||"",status:t.getAttribute("data-status")||"",children:i?this.#z(i):[],x:0,y:0,subtreeWidth:0,collapsed:!1,childCount:0})}return s}#D(e,s=0){let t=l.#p,r=l.#f,i=l.#I,n=l.#w;for(let a of e)a.childCount=this.#F(a),a.children.length>0&&!a.collapsed?(this.#D(a.children,s+1),a.subtreeWidth=a.children.reduce((u,h)=>u+h.subtreeWidth,0)+i*(a.children.length-1)):a.subtreeWidth=t,a.subtreeWidth=Math.max(a.subtreeWidth,t)}#F(e){let s=0;for(let t of e.children)s+=1+this.#F(t);return s}#V(e,s,t){let r=l.#p,i=l.#f,n=l.#I,a=l.#w,u=s;for(let h of e)h.x=u+(h.subtreeWidth-r)/2,h.y=t,h.children.length>0&&!h.collapsed&&this.#V(h.children,u,t+i+a),u+=h.subtreeWidth+n}#ot(e){e.hidden=!0,e.setAttribute("aria-hidden","true");let s=e.querySelector("ul");s&&(this.#e=this.#z(s),this.#l())}#e=null;#n=1;get#S(){return this.dataset.orientation==="horizontal"?"horizontal":"vertical"}get#A(){return Math.min(4,Math.max(0,parseInt(this.dataset.detail||"2",10)))}static#x={zoomIn:'<circle cx="11" cy="11" r="8"/><line x1="21" x2="16.65" y1="21" y2="16.65"/><line x1="11" x2="11" y1="8" y2="14"/><line x1="8" x2="14" y1="11" y2="11"/>',zoomOut:'<circle cx="11" cy="11" r="8"/><line x1="21" x2="16.65" y1="21" y2="16.65"/><line x1="8" x2="14" y1="11" y2="11"/>',reset:'<path d="M15 3h6v6"/><path d="m21 3-7 7"/><path d="m3 21 7-7"/><path d="M9 21H3v-6"/>',flip:'<path d="M21 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v3"/><path d="M21 16v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-3"/><path d="M4 12H2"/><path d="M10 12H8"/><path d="M16 12h-2"/><path d="M22 12h-2"/>'};static#E=["Shape","Shape + Title","Full","Full + Status","Wireframe"];#lt(e){let s=this.#t?.querySelector(".sm-visual-scroll"),t=this.#t?.querySelector('svg[role="tree"]'),r={nodeId:null,rectTop:0,rectLeft:0,focusId:this.#c};if(!s||!t)return r;let i=e||this.#c;if(!i)return r;let a=t.querySelector(`[data-node-id="${i}"]`)?.querySelector("rect");if(!a)return r;let u=a.getBoundingClientRect(),h=s.getBoundingClientRect();return r.nodeId=i,r.rectTop=u.top-h.top,r.rectLeft=u.left-h.left,r}#W(e,s){let t=this.#t?.querySelector(".sm-visual-scroll"),r=this.#t?.querySelector('svg[role="tree"]');if(!t||!r)return;if(e.nodeId){let u=r.querySelector(`[data-node-id="${e.nodeId}"]`)?.querySelector("rect");if(u){let h=u.getBoundingClientRect(),f=t.getBoundingClientRect(),o=h.top-f.top-e.rectTop,c=h.left-f.left-e.rectLeft;t.scrollTop+=o,t.scrollLeft+=c}}let i=e.focusId&&r.querySelector(`[data-node-id="${e.focusId}"]`)?e.focusId:"0",n=r.querySelector(`[data-node-id="${i}"]`);n&&this.#j(n),s&&r.focus({preventScroll:!0})}#l(e={}){if(!this.#e)return;let s=this.#lt(e.anchorId||null),t=this.#t?.querySelector(".sm-visual-scroll")??null,r=!!t&&t.contains(document.activeElement),i=l.#v,n=l.#p,a=l.#f,u=l.#at,h=this.#S==="horizontal";this.#D(this.#e),this.#V(this.#e,u,u);let f=this.#G(this.#e),o=f.maxX+n+u,c=f.maxY+a+u;h&&([o,c]=[c,o]);let g=this.#t?.querySelector(".sm-visual-summary");this.#t||(this.#t=document.createElement("div"),this.#t.className="sm-visual",this.#t.appendChild(this.#ct()),g=document.createElement("div"),g.className="sm-visual-summary",this.#t.appendChild(g),this.appendChild(this.#t));let p=document.createElement("div");p.className="sm-visual-scroll";let b=document.createElementNS(i,"svg");b.setAttribute("viewBox",`0 0 ${o} ${c}`),b.setAttribute("width",String(o)),b.setAttribute("height",String(c)),b.setAttribute("class",`sm-vsvg${this.#A>=4?" sm-vsvg--wireframe":""}`);let y=document.createElement("div");if(y.className="sm-visual-zoom",y.style.width=`${Math.round(o*this.#n)}px`,y.style.height=`${Math.round(c*this.#n)}px`,b.style.transform=`scale(${this.#n})`,b.style.transformOrigin="0 0",h){let v=document.createElementNS(i,"g");v.setAttribute("transform",`rotate(90 0 0) translate(0 -${c})`),this.#q(v,this.#e),this.#k(v,this.#e),b.appendChild(v)}else this.#q(b,this.#e),this.#k(b,this.#e);if(y.appendChild(b),p.appendChild(y),g){let v=Math.round(this.#n*100);g.textContent=`${this.#a} pages \xB7 ${this.#o} levels \xB7 ${v}%`}b.setAttribute("tabindex","0"),b.setAttribute("role","tree"),b.setAttribute("aria-label",`Site map${this.getAttribute("title")?": "+this.getAttribute("title"):""}`),b.addEventListener("keydown",v=>this.#ut(v)),b.addEventListener("click",v=>{let q=v.target,k=q.closest("[data-toggle]");if(k){let C=k.getAttribute("data-toggle");C&&this.#T(C);return}let E=q.closest("[data-node-id]");if(E){let C=E.getAttribute("data-node-id");C&&this.#m(C),this.dispatchEvent(new CustomEvent("site-map:select",{bubbles:!0,detail:{href:E.getAttribute("data-href")||"",pageType:E.getAttribute("data-page-type")||"page",template:E.getAttribute("data-template")||""}}))}});let d=this.#t,m=()=>{t&&t.isConnected?t.replaceWith(p):d.insertBefore(p,d.querySelector(".sm-visual-summary"))},A=null;t?.isConnected?A=M(this,m,"sm-vt"):m(),A?A.updateCallbackDone.then(()=>this.#W(s,r)):this.#W(s,r),this.#pt(d,b)}#O(){let e=this.#t?.querySelector(".sm-vtoolbar");if(!e)return;let s=e.querySelector("[data-sm-flip]"),t=this.#S==="horizontal"?"Vertical":"Horizontal";s?.setAttribute("aria-label",t),s?.setAttribute("title",t);let r=e.querySelector(".sm-vtoolbar-slider");r&&(r.value=String(this.#A));let i=e.querySelector(".sm-vtoolbar-detail-label");i&&(i.textContent=l.#E[this.#A])}#R(e,s){this.#r=!0,this.dataset[e]=s,this.#r=!1}#ct(){let e=document.createElement("div");e.className="sm-vtoolbar",e.setAttribute("role","group"),e.setAttribute("aria-label","Site map controls");let s=g=>`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${g}</svg>`,t=this.#C(s(l.#x.zoomIn),"Zoom in",()=>{this.#n=Math.min(3,this.#n+.25),this.#l()});e.appendChild(t);let r=this.#C(s(l.#x.zoomOut),"Zoom out",()=>{this.#n=Math.max(.25,this.#n-.25),this.#l()});e.appendChild(r);let i=this.#C(s(l.#x.reset),"Reset zoom",()=>{this.#n=1,this.#l()});e.appendChild(i);let n=document.createElement("span");n.className="sm-vtoolbar-sep",e.appendChild(n);let a=this.#S==="horizontal"?"Vertical":"Horizontal",u=this.#C(s(l.#x.flip),a,()=>{this.#R("orientation",this.#S==="horizontal"?"vertical":"horizontal"),this.#O(),this.#l()});u.setAttribute("data-sm-flip",""),e.appendChild(u),e.appendChild(n.cloneNode());let h=this.#A,f=document.createElement("label");f.className="sm-vtoolbar-detail",f.textContent="Detail ";let o=document.createElement("input");o.type="range",o.min="0",o.max="4",o.value=String(h),o.setAttribute("aria-label","Detail level"),o.className="sm-vtoolbar-slider",f.appendChild(o);let c=document.createElement("span");return c.className="sm-vtoolbar-detail-label",c.textContent=l.#E[h],f.appendChild(c),o.addEventListener("input",()=>{this.#R("detail",o.value),c.textContent=l.#E[parseInt(o.value,10)],o.setAttribute("aria-valuetext",c.textContent),this.#l()}),o.setAttribute("aria-valuetext",l.#E[h]),e.appendChild(f),e}#C(e,s,t){let r=document.createElement("button");return r.type="button",r.className="sm-vtoolbar-btn",r.innerHTML=e,r.setAttribute("aria-label",s),r.setAttribute("title",s),r.addEventListener("click",t),r}#c=null;#U(e,s=""){let t=[];for(let r=0;r<e.length;r++){let i=e[r],n=s?`${s}-${r}`:String(r);t.push(n),i.children.length>0&&!i.collapsed&&t.push(...this.#U(i.children,n))}return t}#dt(e){let s=e.lastIndexOf("-");return s>0?e.slice(0,s):null}#gt(e){let s=this.#b(e,this.#e);return!s||s.collapsed||s.children.length===0?null:`${e}-0`}#m(e){if(!e||!this.#t)return;let s=this.#t.querySelector('svg[role="tree"]');if(!s)return;let t=s.querySelector(`[data-node-id="${e}"]`);if(!t)return;this.#j(t),this.#c=e;let r=t.querySelector("rect"),i=this.#t?.querySelector(".sm-visual-scroll");if(r&&i){let n=r.getBoundingClientRect(),a=i.getBoundingClientRect();(n.left<a.left||n.right>a.right||n.top<a.top||n.bottom>a.bottom)&&r.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}#j(e){let s=e.closest("svg");if(!s)return;s.querySelectorAll(".sm-vfocus-ring").forEach(i=>i.remove()),s.querySelectorAll('[data-node-id][aria-selected="true"]').forEach(i=>i.setAttribute("aria-selected","false"));let t=l.#v,r=e.querySelector("rect");if(r){let i=document.createElementNS(t,"rect");i.setAttribute("x",String(parseFloat(r.getAttribute("x")??"0")-3)),i.setAttribute("y",String(parseFloat(r.getAttribute("y")??"0")-3)),i.setAttribute("width",String(parseFloat(r.getAttribute("width")??"0")+6)),i.setAttribute("height",String(parseFloat(r.getAttribute("height")??"0")+6)),i.setAttribute("rx","11"),i.setAttribute("class","sm-vfocus-ring"),i.setAttribute("aria-hidden","true"),e.parentNode?.insertBefore(i,e)}e.setAttribute("aria-selected","true"),e.id&&s.setAttribute("aria-activedescendant",e.id),this.#c=e.getAttribute("data-node-id")}#ut(e){if(!this.#e)return;let s=this.#c||"0",t=!1;switch(e.key){case"ArrowDown":{t=!0;let r=this.#b(s,this.#e);r&&r.children.length>0&&!r.collapsed&&this.#m(`${s}-0`);break}case"ArrowUp":{t=!0;let r=this.#dt(s);r&&this.#m(r);break}case"ArrowRight":{t=!0;let r=this.#Y(s,1);r&&this.#m(r);break}case"ArrowLeft":{t=!0;let r=this.#Y(s,-1);r&&this.#m(r);break}case"Enter":{t=!0;let r=this.#b(s,this.#e);r?.anchor?this.dispatchEvent(new CustomEvent("site-map:select",{bubbles:!0,cancelable:!0,detail:{href:r.href,pageType:r.pageType,template:r.template}}))&&r.anchor.click():r&&r.children.length>0&&this.#T(s);break}case" ":{t=!0;let r=this.#b(s,this.#e);r&&r.children.length>0&&this.#T(s);break}case"Home":{t=!0,this.#m("0");break}case"End":{t=!0;let r=this.#U(this.#e);r.length&&this.#m(r[r.length-1]);break}}t&&(e.preventDefault(),e.stopPropagation())}#Y(e,s){let t=e.split("-").map(Number),r=t[t.length-1]+s;if(r<0)return null;let i=t.length>1?t.slice(0,-1).join("-"):null,n=i?this.#b(i,this.#e):null,a=n?n.children:this.#e;if(!a||r>=a.length)return null;let u=[...t];return u[u.length-1]=r,u.join("-")}#$=!1;#ht={dragging:!1,startX:0,startY:0,scrollLeft:0,scrollTop:0,moved:!1};#pt(e,s){if(s.style.cursor="grab",this.#$)return;this.#$=!0;let t=this.#ht;this.listen(this,"pointerdown",r=>{let i=r;if(i.target.closest("button, [data-toggle], .sm-vtoolbar, input"))return;let n=this.querySelector(".sm-visual-scroll");if(!n)return;t.dragging=!0,t.moved=!1,t.startX=i.clientX,t.startY=i.clientY,t.scrollLeft=n.scrollLeft,t.scrollTop=n.scrollTop;let a=this.querySelector('svg[role="tree"]');a&&(a.style.cursor="grabbing")}),this.listen(window,"pointermove",r=>{if(!t.dragging)return;let i=r,n=i.clientX-t.startX,a=i.clientY-t.startY;(Math.abs(n)>3||Math.abs(a)>3)&&(t.moved=!0);let u=this.querySelector(".sm-visual-scroll");u&&(u.scrollLeft=t.scrollLeft-n,u.scrollTop=t.scrollTop-a)}),this.listen(window,"pointerup",()=>{if(!t.dragging)return;t.dragging=!1;let r=this.querySelector('svg[role="tree"]');r&&(r.style.cursor="grab")}),this.listen(this,"click",r=>{t.moved&&(r.stopPropagation(),t.moved=!1)},{capture:!0})}#G(e){let s=0,t=0;for(let r of e)if(r.x+l.#p>s&&(s=r.x+l.#p),r.y+l.#f>t&&(t=r.y+l.#f),r.children.length>0&&!r.collapsed){let i=this.#G(r.children);i.maxX>s&&(s=i.maxX),i.maxY>t&&(t=i.maxY)}return{maxX:s,maxY:t}}#q(e,s){let t=l.#v,r=l.#p,i=l.#f,n=l.#w;for(let a of s){if(a.children.length===0||a.collapsed)continue;let u=a.x+r/2,h=a.y+i,f=h+n/2;for(let o of a.children){let c=o.x+r/2,g=o.y,p=document.createElementNS(t,"path");p.setAttribute("d",`M ${u} ${h} L ${u} ${f} L ${c} ${f} L ${c} ${g}`),p.setAttribute("class","sm-vedge"),p.setAttribute("aria-hidden","true"),e.appendChild(p)}this.#q(e,a.children)}}#k(e,s,t=""){let r=l.#v,i=l.#p,n=l.#f,a=this.#A,u=a>=4,h=t?t.split("-").length+1:1;for(let f=0;f<s.length;f++){let o=s[f],c=t?`${t}-${f}`:String(f),g=x[o.pageType]?o.pageType:"page",p=document.createElementNS(r,"g");p.setAttribute("class",`sm-vnode sm-vnode--${g}`),p.id=`${this.#d}-n-${c}`,p.setAttribute("role","treeitem"),p.setAttribute("aria-level",String(h)),p.setAttribute("aria-setsize",String(s.length)),p.setAttribute("aria-posinset",String(f+1)),p.setAttribute("aria-selected","false"),o.children.length>0&&p.setAttribute("aria-expanded",o.collapsed?"false":"true");let b=o.status&&S[o.status]?`, ${S[o.status].label}`:"";p.setAttribute("aria-label",`${o.label||o.href||"Untitled"}, ${x[g].label}${o.template?`, ${o.template}`:""}${b}`),p.setAttribute("data-node-id",c),p.setAttribute("data-href",o.href),p.setAttribute("data-page-type",o.pageType),p.setAttribute("data-template",o.template),p.style.cursor="pointer";let y=document.createElementNS(r,"rect");if(y.setAttribute("x",String(o.x)),y.setAttribute("y",String(o.y)),y.setAttribute("width",String(i)),y.setAttribute("height",String(n)),y.setAttribute("rx","8"),y.setAttribute("class","sm-vbox"),(u||o.pageType==="modal")&&y.setAttribute("stroke-dasharray","6 3"),p.appendChild(y),a>=1){let d=document.createElementNS(r,"text");d.setAttribute("x",String(o.x+i/2)),d.setAttribute("y",String(a===1?o.y+n/2+5:o.y+24)),d.setAttribute("text-anchor","middle"),d.setAttribute("font-size","13"),d.setAttribute("font-weight","600"),d.setAttribute("class","sm-vlabel"),d.textContent=o.label.length>18?o.label.slice(0,17)+"\u2026":o.label,p.appendChild(d)}if(a>=2){let d=document.createElementNS(r,"text");if(d.setAttribute("x",String(o.x+i/2)),d.setAttribute("y",String(o.y+40)),d.setAttribute("text-anchor","middle"),d.setAttribute("font-size","9"),d.setAttribute("font-weight","700"),d.setAttribute("class","sm-vtype"),d.textContent=(x[o.pageType]?.label||o.pageType).toUpperCase(),p.appendChild(d),o.template){let m=document.createElementNS(r,"text");m.setAttribute("x",String(o.x+i/2)),m.setAttribute("y",String(o.y+54)),m.setAttribute("text-anchor","middle"),m.setAttribute("font-size","9"),m.setAttribute("class","sm-vtemplate"),m.textContent=o.template,p.appendChild(m)}}if(a>=3&&o.status&&S[o.status]){let d=document.createElementNS(r,"circle");d.setAttribute("cx",String(o.x+i/2)),d.setAttribute("cy",String(o.y+n-8)),d.setAttribute("r","4"),d.setAttribute("class",`sm-vstatus sm-vstatus--${o.status}`),p.appendChild(d)}if(u)for(let d=0;d<2;d++){let m=document.createElementNS(r,"line");m.setAttribute("x1",String(o.x+12)),m.setAttribute("x2",String(o.x+i-12)),m.setAttribute("y1",String(o.y+n-22+d*8)),m.setAttribute("y2",String(o.y+n-22+d*8)),m.setAttribute("class","sm-vwire"),p.appendChild(m)}if(o.children.length>0){let d=document.createElementNS(r,"g");d.setAttribute("data-toggle",c),d.setAttribute("class","sm-vtoggle"),d.setAttribute("aria-hidden","true");let m=document.createElementNS(r,"circle");m.setAttribute("cx",String(o.x+i/2)),m.setAttribute("cy",String(o.y+n+10)),m.setAttribute("r","10"),d.appendChild(m);let A=document.createElementNS(r,"text");A.setAttribute("x",String(o.x+i/2)),A.setAttribute("y",String(o.y+n+14)),A.setAttribute("text-anchor","middle"),A.setAttribute("font-size","11"),A.setAttribute("font-weight","700"),A.textContent=o.collapsed?`+${o.childCount}`:"\u2212",d.appendChild(A),p.appendChild(d)}e.appendChild(p),o.children.length>0&&!o.collapsed&&this.#k(e,o.children,c)}}#T(e){let s=this.#b(e,this.#e);s&&(s.collapsed=!s.collapsed,this.#c||(this.#c=e),this.#l({anchorId:e}))}#b(e,s){if(!s)return null;let t=e.split("-").map(Number),r=s,i=null;for(let n of t){if(!r||n>=r.length)return null;i=r[n],r=i.children}return i}async _loadSrc(e){if(e)try{let s=await fetch(e);if(!s.ok)throw new Error(`HTTP ${s.status}`);let t=await s.json();t.title&&!this.getAttribute("title")&&(this.#r=!0,this.setAttribute("title",String(t.title)),this.#r=!1),this._setPages(t.pages||[])}catch(s){console.warn(`[site-map] Failed to load src="${e}":`,s)}}get pages(){let s=this.querySelector(":scope > nav")?.querySelector("ul");return s?this.#X(s):[]}set pages(e){this._setPages(Array.isArray(e)?e:[]),this.dispatchEvent(new CustomEvent("site-map:pages-changed",{detail:{pages:this.pages,source:"property"},bubbles:!0}))}_setPages(e){for(;this.firstChild;)this.firstChild.remove();let s=document.createElement("nav"),t=document.createElement("ul");this.#K(t,e),s.appendChild(t),this.appendChild(s),this._reinit()}#X(e){let s=[];for(let t of e.querySelectorAll(":scope > li")){let r=t.querySelector(":scope > a, :scope > .sm-node-content > a"),i=t.querySelector(":scope > ul"),n={label:r?.textContent?.trim()||"",href:r?.getAttribute("href")||void 0,pageType:t.getAttribute("data-page-type")||void 0,template:t.getAttribute("data-template")||void 0,status:t.getAttribute("data-status")||void 0};i&&(n.children=this.#X(i)),s.push(n)}return s}#K(e,s){for(let t of s){let r=document.createElement("li");t.pageType&&r.setAttribute("data-page-type",t.pageType),t.template&&r.setAttribute("data-template",t.template),t.status&&r.setAttribute("data-status",t.status);let i=document.createElement("a"),n=B(t.href);if(n&&i.setAttribute("href",n),i.textContent=String(t.label??""),r.appendChild(i),t.children&&t.children.length>0){let a=document.createElement("ul");this.#K(a,t.children),r.appendChild(a)}e.appendChild(r)}}#ft(){this.#Z(),this.#L(),this.#Q(),this.getAttribute("src")&&this.#_()}#J(){return this.querySelector(":scope > nav:not([data-sitemap-controls])")}#mt(){this.querySelector(":scope > [data-sitemap-controls]")?.remove()}#Z(){let e=this.getAttribute("current")||window.location.pathname,s=this.querySelectorAll("a");for(let t of s){if(!t.hasAttribute("href"))continue;new URL(t.href,window.location.origin).pathname===e&&t.setAttribute("aria-current","page")}}#L(){let e=this.querySelector('[aria-current="page"]');if(!e)return;let s=e.parentElement;for(;s&&s!==this;)s.tagName==="DETAILS"&&(s.open=!0),s=s.parentElement}#Q(){if(this.querySelector(":scope > [data-sitemap-controls]")?.remove(),!this.querySelector("details"))return;let e=()=>this.querySelectorAll("details"),s=document.createElement("nav");s.setAttribute("data-sitemap-controls",""),s.setAttribute("aria-label",this.getAttribute("data-label-controls")??"Sitemap controls");let t=document.createElement("button");t.type="button",t.className="small secondary",t.textContent=this.getAttribute("data-label-expand")??"Expand all",this.listen(t,"click",()=>{for(let n of e())n.open=!0});let r=document.createElement("button");r.type="button",r.className="small secondary",r.textContent=this.getAttribute("data-label-collapse")??"Collapse all",this.listen(r,"click",()=>{for(let n of e())n.open=!1;this.#L()}),s.append(t,r);let i=this.#J();i?i.before(s):this.prepend(s)}async#_(){let e=this.getAttribute("src");if(e)try{let s=await fetch(e);if(!s.ok)return;let t=await s.json();this.#bt(t)}catch{}}#bt(e){if(!e||!Array.isArray(e.children))return;let s=this.#J(),t=document.createElement("nav");t.setAttribute("aria-label",s?.getAttribute("aria-label")||"Full site map"),t.append(this.#tt(e.children)),s?s.replaceWith(t):this.append(t),this.#Z(),this.#L(),this.#Q()}#tt(e){let s=document.createElement("ul");for(let t of e){let r=document.createElement("li");if(t.children?.length){let i=document.createElement("details"),n=document.createElement("summary");n.textContent=String(t.title??""),i.append(n),i.append(this.#tt(t.children)),r.append(i)}else{let i=document.createElement("a"),n=B(t.href||t.path);n&&i.setAttribute("href",n),i.textContent=String(t.title??""),r.append(i)}s.append(r)}return s}};L("site-map",$);export{$ as SiteMap};
2
2
  //# sourceMappingURL=site-map.js.map
@@ -1,2 +1,2 @@
1
- var u=/Mac|iPhone|iPad|iPod/.test(navigator.platform??"");function $(e){return[...String(e??"").trim().toLowerCase().matchAll(/([^+]+|\+)(?:\+|$)/g)].map(n=>n[1].trim()).filter(Boolean).map(n=>n==="plus"?"+":n)}var L={esc:"escape",return:"enter",del:"delete",ins:"insert",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",space:" ",spacebar:" ",plus:"+",pgup:"pageup",pgdn:"pagedown"};function D(e){let t=String(e??"").toLowerCase();return L[t]??t}function h(e){let t=$(e);return{key:D(t.pop()??""),meta:t.includes("meta")||t.includes("cmd"),ctrl:t.includes("ctrl")||t.includes("control"),shift:t.includes("shift"),alt:t.includes("alt")||t.includes("option")}}function y(e){return e.length===1&&!/[a-z0-9 ]/.test(e)}function w(e,t){let s=(e.key==="Spacebar"?" ":String(e.key??"").toLowerCase())===t.key;if(!s&&(e.altKey||e.shiftKey)&&/^[a-z0-9]$/.test(t.key)){let a=/\d/.test(t.key)?`Digit${t.key}`:`Key${t.key.toUpperCase()}`;s=e.code===a}if(!s)return!1;let i,r;return u?(i=t.meta,r=t.ctrl):(i=!1,r=t.meta||t.ctrl),!(i!==e.metaKey||r!==e.ctrlKey||!y(t.key)&&t.shift!==e.shiftKey||t.alt!==e.altKey)}function k(e){let t=typeof e=="string"?h(e):e;return!t.meta&&!t.ctrl&&!t.alt&&t.key.length===1}function E(e,t){let n=h(e),s=h(t),i=u?n.ctrl:n.ctrl||n.meta,r=u?s.ctrl:s.ctrl||s.meta,a=u&&n.meta,l=u&&s.meta,T=!y(n.key);return n.key===s.key&&i===r&&a===l&&n.alt===s.alt&&(!T||n.shift===s.shift)}var b="data-char-shortcuts";var M="vb:settings:extensions";function m(){return typeof document>"u"?!0:document.documentElement.getAttribute(b)!=="off"}function N(){try{let e=globalThis.localStorage?.getItem(M);if(!e)return null;let t=JSON.parse(e)?.data?.charShortcuts;return typeof t=="boolean"?t:null}catch{return null}}var P=!0;if(typeof document<"u"){let e=N();e===null&&(P=m()),e===!1?document.documentElement.setAttribute(b,"off"):e===!0&&document.documentElement.removeAttribute(b)}var U=new Set(["INPUT","TEXTAREA","SELECT"]),c=[],S=!1;function H(e){let t=e;return!t||!t.tagName?!1:U.has(t.tagName)||t.isContentEditable}function R(e){if(e.repeat||e.isComposing||e.defaultPrevented)return;let t=H(e.target),n=!m(),s=document.activeElement;for(let i of c)if(!(t&&!i.global)&&!(i.scope&&!(i.scope.isConnected&&i.scope.contains(s)))&&!(n&&i.character&&!i.scope)&&!(i.enabled&&!i.enabled())&&w(e,i.descriptor)){e.preventDefault(),i.callback(e);return}}function O(){S||(document.addEventListener("keydown",R),S=!0)}function A(e,t,n={}){O();let s=h(e),i={combo:e,descriptor:s,callback:t,global:n.global===!0,scope:n.scope??null,enabled:typeof n.enabled=="function"?n.enabled:null,character:k(s)},r=c.find(a=>!a.scope&&!i.scope&&E(a.combo,e));return r&&console.warn(`[hotkey-bind] Shortcut "${e}" is already bound as "${r.combo}". Last-bound wins.`),c.unshift(i),function(){let l=c.indexOf(i);l!==-1&&c.splice(l,1)}}function v(){return c.map(e=>e.combo)}var W=window.matchMedia("(prefers-reduced-motion: reduce)");var C=new Map;function x(e,t,n={}){let s=n.priority??10,i={impl:t,bundle:n.bundle,contract:n.contract,priority:s},r=C.get(e);if(customElements.get(e)){if(!r||r.priority>=s){r&&r.priority===s&&r.impl!==t&&console.warn(`[VB Bundle] Tag <${e}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${n.bundle}".`);return}console.warn(`[VB Bundle] Tag <${e}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${n.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=s){r.priority===s&&console.warn(`[VB Bundle] Tag <${e}> already registered by "${r.bundle}". Skipping "${n.bundle}" (first wins at equal priority).`);return}C.set(e,i),customElements.define(e,t)}var f=class extends HTMLElement{#l=[];#i;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.#l)t();this.#l=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,n,s,i){t.addEventListener(n,s,i),this.#l.push(()=>t.removeEventListener(n,s,i))}_reinit(){for(let t of this.#l)t();this.#l=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,n){this.#i||(this.#i=this.attachInternals());let s=this.#i.states;try{n?s.add(t):s.delete(t)}catch{let i=`--${t}`;n?s.add(i):s.delete(i)}}_adoptInternals(t){this.#i||(this.#i=t)}#t(){return this.constructor.formAssociated&&this.#i?this.#i: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}};var K={trigger:"Search",dialog:"Site search",placeholder:"Search documentation...",input:"Search",results:"Search results",searching:"Searching...",empty:"No results found",count:"{count} results","count-one":"1 result","count-more":"{count} of {total} results",unavailable:"Search unavailable",error:"Search error. Please try again.",untitled:"Untitled",navigate:"to navigate",select:"to select",close:"to close",dismiss:"Close search",browse:"Browse instead",powered:"Powered by"},I=0,p=new Set,d=null;function B(e){return typeof e.checkVisibility=="function"?e.checkVisibility():e.getClientRects().length>0}function _(){let e=[...p].filter(s=>s.isConnected),t=e.find(s=>s.isOpen);if(t){t.close();return}(e.find(s=>B(s))??e[0])?.open()}function q(e){p.add(e),!d&&!v().includes("meta+k")&&(d=A("meta+k",_,{global:!0}))}function V(e){p.delete(e),p.size===0&&d&&(d(),d=null)}function o(e,t={},n=[]){let s=document.createElement(e);for(let[i,r]of Object.entries(t))s.setAttribute(i,r);return s.append(...n),s}function Y(e){let t=document.createDocumentFragment();if(!e||typeof e!="string")return t;let n=document.createElement("template");n.innerHTML=e;let s=(i,r)=>{for(let a of i.childNodes)if(a.nodeType===Node.TEXT_NODE)r.appendChild(document.createTextNode(a.textContent??""));else if(a.nodeType===Node.ELEMENT_NODE)if(a.localName==="mark"){let l=document.createElement("mark");s(a,l),r.appendChild(l)}else s(a,r)};return s(n.content,t),t}function j(e){if(typeof e!="string"||!e)return null;try{let t=new URL(e,document.baseURI);return t.protocol!=="http:"&&t.protocol!=="https:"||t.origin!==location.origin?null:t.href}catch{return null}}var g=class e extends f{static#l=150;static#i=8;#t=null;#n=null;#e=null;#c=null;#o=null;#b=null;#h=[];#a=-1;#r=!1;#d=0;#f="";#m=null;#w=!1;#p=null;setup(){this.#f||(this.#f=`site-search-${++I}`),this.#A(),this.#v(),q(this)}teardown(){V(this),this.#r&&(document.body.style.overflow="",this.removeAttribute("open"),this.#t?.setAttribute("aria-expanded","false"),this.#r=!1),this.#y(),this.#d++,this.#h=[],this.#a=-1,this.#o&&this.append(this.#o),this.#o=null,this.#n?.remove(),this.#n=null}#s(t){let n=`data-label-${t}`;return this.getAttribute(n)??K[t]}get value(){return this.#e?.value??""}set value(t){if(!this.#e)return;let n=t==null?"":String(t);this.#e.value!==n&&(this.#e.value=n,this.#e.dispatchEvent(new Event("input",{bubbles:!0})),this.dispatchEvent(new CustomEvent("site-search:change",{detail:{value:n,source:"api"},bubbles:!0})))}get results(){return[...this.#h]}#A(){this.#t=this.querySelector(":scope > [data-trigger]"),this.#t||(this.#t=this.querySelector(":scope > button")),this.#t||(this.#t=o("button",{type:"button","data-trigger":""},[o("icon-wc",{name:"search",label:this.#s("trigger")})]),this.prepend(this.#t));let t=`${this.#f}-dialog`,n=`${this.#f}-results`;this.#t.setAttribute("aria-haspopup","dialog"),this.#t.setAttribute("aria-expanded","false"),this.#t.setAttribute("aria-controls",t),this.#e=o("input",{type:"search",name:"search",class:"input",placeholder:this.#s("placeholder"),autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",role:"combobox","aria-label":this.#s("input"),"aria-autocomplete":"list","aria-controls":n,"aria-expanded":"false"}),this.#c=o("div",{class:"results",id:n,role:"listbox","aria-label":this.#s("results")}),this.#b=o("p",{class:"search-status",role:"status"});let s=i=>o("kbd",{},[i]);if(this.#n=o("dialog",{class:"dialog",id:t,"aria-label":this.#s("dialog")},[o("search",{class:"search"},[o("div",{class:"input-wrapper"},[o("icon-wc",{name:"search",class:"icon"}),this.#e,o("button",{type:"button",class:"shortcut","aria-label":this.#s("dismiss")},[o("kbd",{},["Esc"]),o("icon-wc",{name:"x",size:"sm"})])]),this.#b,this.#c]),o("div",{class:"footer"},[o("span",{class:"hint"},[s("\u2191"),s("\u2193"),` ${this.#s("navigate")} `,s("\u21B5"),` ${this.#s("select")} `,s("esc"),` ${this.#s("close")}`]),o("span",{class:"powered"},[`${this.#s("powered")} `,o("a",{href:"https://pagefind.app",target:"_blank",rel:"noopener"},["Pagefind"])])])]),this.#o=this.querySelector(":scope > nav[data-browse]"),this.#o){let i=this.#o.getAttribute("aria-label")||this.#s("browse");this.#o.setAttribute("aria-label",i);let r=o("p",{class:"browse-title","aria-hidden":"true"},[i]);this.#n.querySelector(".search")?.after(o("div",{class:"browse"},[r,this.#o]))}this.appendChild(this.#n)}#v(){this.listen(this.#t,"click",this.#C),this.#n.addEventListener("close",this.#x),this.#n.addEventListener("click",this.#T),this.#e.addEventListener("input",this.#$),this.#e.addEventListener("keydown",this.#L),this.#c.addEventListener("click",this.#D)}#C=t=>{t.stopPropagation(),this.open()};#x=()=>{this.#r&&!this.#n?.open&&this.#S()};#T=t=>{if(t.target.closest?.(".shortcut")){this.close();return}if(t.target!==this.#n)return;let n=this.#n.getBoundingClientRect();t.clientX>=n.left&&t.clientX<=n.right&&t.clientY>=n.top&&t.clientY<=n.bottom||this.close()};#$=()=>{this.#y(),this.setState("input-debounce-pending",!0),this.#p=setTimeout(()=>{this.#p=null,this.setState("input-debounce-pending",!1),this.#N(this.#e.value)},e.#l)};#L=t=>{switch(t.key){case"ArrowDown":t.preventDefault(),this.#E(this.#a+1);break;case"ArrowUp":t.preventDefault(),this.#E(this.#a-1);break;case"Escape":t.preventDefault(),this.close();break;case"Enter":{t.preventDefault();let n=this.#a>=0?this.#a:0,s=this.#c.querySelector(`[data-result-index="${n}"]`)?.getAttribute("href");s&&(this.close(),window.location.assign(s));break}}};#D=t=>{t.target.closest("[data-result-index]")&&(t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||setTimeout(()=>this.close(),0))};get#M(){let t=this.getAttribute("data-pagefind-path")||"/pagefind/";return t.endsWith("/")?t:`${t}/`}async#k(){if(this.#m||this.#w)return;let t=new URL(this.#M,document.baseURI),n=this.getAttribute("data-base-url")??new URL("..",t).pathname;try{let s=await import(new URL("pagefind.js",t).href);await s.options({excerptLength:20,baseUrl:n}),this.#m=s}catch{this.#w=!0,console.warn(`[site-search] Pagefind not found at ${t.pathname}pagefind.js. Run \`npm run search:index\` after building, or set data-pagefind-path.`)}}#u(t){this.#b&&(this.#b.textContent=t)}async#N(t){let n=++this.#d;if(!t.trim()){this.#g([]);return}if(this.#u(this.#s("searching")),await this.#k(),n===this.#d){if(!this.#m){this.#h=[],this.#g([]),this.#u(this.#s("unavailable"));return}try{let s=await this.#m.search(t),i=await Promise.all((s?.results??[]).slice(0,e.#i).map(r=>r.data()));if(n!==this.#d)return;this.#h=i,this.#g(i,s?.results?.length??i.length)}catch(s){if(n!==this.#d)return;console.error("[site-search] Search error:",s),this.#h=[],this.#g([]),this.#u(this.#s("error"))}}}#g(t,n=t.length){this.#a=-1,this.#e.removeAttribute("aria-activedescendant");let s=[];for(let i of t){let r=j(i?.url);if(!r)continue;let a=o("span",{class:"result-title"});a.textContent=String(i.meta?.title||this.#s("untitled"));let l=o("span",{class:"result-excerpt"});l.append(Y(i.excerpt||"")),s.push(o("a",{id:`${this.#f}-result-${s.length}`,href:r,class:"result",role:"option","aria-selected":"false","data-result-index":String(s.length),tabindex:"-1"},[a,l]))}if(this.#c.replaceChildren(...s),this.#e.setAttribute("aria-expanded",s.length?"true":"false"),!this.#e.value.trim())this.#u("");else if(s.length===0)this.#u(this.#s("empty"));else{let r=n>e.#i&&n>s.length?this.#s("count-more"):s.length===1?this.#s("count-one"):this.#s("count");this.#u(r.replace("{count}",String(s.length)).replace("{total}",String(n)))}}#E(t){let n=this.#c.querySelectorAll("[data-result-index]");if(n.length===0)return;t<0&&(t=n.length-1),t>=n.length&&(t=0);for(let i of n)i.removeAttribute("data-active"),i.setAttribute("aria-selected","false");this.#a=t;let s=n[t];s.setAttribute("data-active",""),s.setAttribute("aria-selected","true"),this.#e.setAttribute("aria-activedescendant",s.id),s.scrollIntoView({block:"nearest"})}#y(){this.#p&&(clearTimeout(this.#p),this.#p=null),this.setState("input-debounce-pending",!1)}open(){if(!(this.#r||!this.#n)){if(this.#r=!0,this.setAttribute("open",""),this.#t?.setAttribute("aria-expanded","true"),document.body.style.overflow="hidden",!this.#n.open)try{this.#n.showModal()}catch{this.#n.setAttribute("open","")}this.#e.focus(),this.#e.select(),this.#k(),this.dispatchEvent(new CustomEvent("site-search:open",{bubbles:!0}))}}close(){this.#r&&(this.#n?.open&&this.#n.close(),this.#r&&this.#S())}#S(){this.#r=!1,this.removeAttribute("open"),this.#t?.setAttribute("aria-expanded","false"),document.body.style.overflow="",this.#y(),this.#d++,this.#h=[],this.#a=-1,this.#e&&(this.#e.value="",this.#e.removeAttribute("aria-activedescendant"),this.#e.setAttribute("aria-expanded","false")),this.#c?.replaceChildren(),this.#u(""),this.#t?.focus(),this.dispatchEvent(new CustomEvent("site-search:close",{bubbles:!0}))}get isOpen(){return this.#r}};x("site-search",g);export{g as SiteSearch};
1
+ var u=/Mac|iPhone|iPad|iPod/.test(navigator.platform??"");function T(e){return[...String(e??"").trim().toLowerCase().matchAll(/([^+]+|\+)(?:\+|$)/g)].map(n=>n[1].trim()).filter(Boolean).map(n=>n==="plus"?"+":n)}var L={esc:"escape",return:"enter",del:"delete",ins:"insert",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",space:" ",spacebar:" ",plus:"+",pgup:"pageup",pgdn:"pagedown"};function P(e){let t=String(e??"").toLowerCase();return L[t]??t}function d(e){let t=T(e);return{key:P(t.pop()??""),meta:t.includes("meta")||t.includes("cmd"),ctrl:t.includes("ctrl")||t.includes("control"),shift:t.includes("shift"),alt:t.includes("alt")||t.includes("option")}}function y(e){return e.length===1&&!/[a-z0-9 ]/.test(e)}function w(e,t){let s=(e.key==="Spacebar"?" ":String(e.key??"").toLowerCase())===t.key;if(!s&&(e.altKey||e.shiftKey)&&/^[a-z0-9]$/.test(t.key)){let a=/\d/.test(t.key)?`Digit${t.key}`:`Key${t.key.toUpperCase()}`;s=e.code===a}if(!s)return!1;let r,i;return u?(r=t.meta,i=t.ctrl):(r=!1,i=t.meta||t.ctrl),!(r!==e.metaKey||i!==e.ctrlKey||!y(t.key)&&t.shift!==e.shiftKey||t.alt!==e.altKey)}function E(e){let t=typeof e=="string"?d(e):e;return!t.meta&&!t.ctrl&&!t.alt&&t.key.length===1}function k(e,t){let n=d(e),s=d(t),r=u?n.ctrl:n.ctrl||n.meta,i=u?s.ctrl:s.ctrl||s.meta,a=u&&n.meta,l=u&&s.meta,x=!y(n.key);return n.key===s.key&&r===i&&a===l&&n.alt===s.alt&&(!x||n.shift===s.shift)}var b="data-char-shortcuts";var M="vb:settings:extensions";function m(){return typeof document>"u"?!0:document.documentElement.getAttribute(b)!=="off"}function H(){try{let e=globalThis.localStorage?.getItem(M);if(!e)return null;let t=JSON.parse(e)?.data?.charShortcuts;return typeof t=="boolean"?t:null}catch{return null}}var D=!0;if(typeof document<"u"){let e=H();e===null&&(D=m()),e===!1?document.documentElement.setAttribute(b,"off"):e===!0&&document.documentElement.removeAttribute(b)}var B=new Set(["INPUT","TEXTAREA","SELECT"]),c=[],v=!1;function O(e){let t=e;return!t||!t.tagName?!1:B.has(t.tagName)||t.isContentEditable}function U(e){if(e.repeat||e.isComposing||e.defaultPrevented)return;let t=O(e.target),n=!m(),s=document.activeElement;for(let r of c)if(!(t&&!r.global)&&!(r.scope&&!(r.scope.isConnected&&r.scope.contains(s)))&&!(n&&r.character&&!r.scope)&&!(r.enabled&&!r.enabled())&&w(e,r.descriptor)){e.preventDefault(),r.callback(e);return}}function R(){v||(document.addEventListener("keydown",U),v=!0)}function S(e,t,n={}){R();let s=d(e),r={combo:e,descriptor:s,callback:t,global:n.global===!0,scope:n.scope??null,enabled:typeof n.enabled=="function"?n.enabled:null,character:E(s)},i=c.find(a=>!a.scope&&!r.scope&&k(a.combo,e));return i&&console.warn(`[hotkey-bind] Shortcut "${e}" is already bound as "${i.combo}". Last-bound wins.`),c.unshift(r),function(){let l=c.indexOf(r);l!==-1&&c.splice(l,1)}}function A(){return c.map(e=>e.combo)}var tt=window.matchMedia("(prefers-reduced-motion: reduce)");var C=new Map;function $(e,t,n={}){let s=n.priority??10,r={impl:t,bundle:n.bundle,contract:n.contract,priority:s},i=C.get(e);if(customElements.get(e)){if(!i||i.priority>=s){i&&i.priority===s&&i.impl!==t&&console.warn(`[VB Bundle] Tag <${e}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${n.bundle}".`);return}console.warn(`[VB Bundle] Tag <${e}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${n.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=s){i.priority===s&&console.warn(`[VB Bundle] Tag <${e}> already registered by "${i.bundle}". Skipping "${n.bundle}" (first wins at equal priority).`);return}C.set(e,r),customElements.define(e,t)}var f=class extends HTMLElement{#l=[];#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 t of this.#l)t();this.#l=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,n,s,r){t.addEventListener(n,s,r),this.#l.push(()=>t.removeEventListener(n,s,r))}_reinit(){for(let t of this.#l)t();this.#l=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,n){this.#r||(this.#r=this.attachInternals());let s=this.#r.states;try{n?s.add(t):s.delete(t)}catch{let r=`--${t}`;n?s.add(r):s.delete(r)}}_adoptInternals(t){this.#r||(this.#r=t)}#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}};var _={trigger:"Search",dialog:"Site search",placeholder:"Search documentation...",input:"Search",results:"Search results",searching:"Searching...",empty:"No results found",count:"{count} results","count-one":"1 result","count-more":"{count} of {total} results",unavailable:"Search unavailable",error:"Search error. Please try again.",untitled:"Untitled",navigate:"to navigate",select:"to select",close:"to close",dismiss:"Close search",browse:"Browse instead",powered:"Powered by"},K=0,p=new Set,h=null;function I(e){return typeof e.checkVisibility=="function"?e.checkVisibility():e.getClientRects().length>0}function q(){let e=[...p].filter(s=>s.isConnected),t=e.find(s=>s.isOpen);if(t){t.close();return}(e.find(s=>I(s))??e[0])?.open()}function V(e){p.add(e),!h&&!A().includes("meta+k")&&(h=S("meta+k",q,{global:!0}))}function j(e){p.delete(e),p.size===0&&h&&(h(),h=null)}function o(e,t={},n=[]){let s=document.createElement(e);for(let[r,i]of Object.entries(t))s.setAttribute(r,i);return s.append(...n),s}function F(e){let t=document.createDocumentFragment();if(!e||typeof e!="string")return t;let n=document.createElement("template");n.innerHTML=e;let s=(r,i)=>{for(let a of r.childNodes)if(a.nodeType===Node.TEXT_NODE)i.appendChild(document.createTextNode(a.textContent??""));else if(a.nodeType===Node.ELEMENT_NODE)if(a.localName==="mark"){let l=document.createElement("mark");s(a,l),i.appendChild(l)}else s(a,i)};return s(n.content,t),t}function Y(e){if(typeof e!="string"||!e)return null;try{let t=new URL(e,document.baseURI);return t.protocol!=="http:"&&t.protocol!=="https:"||t.origin!==location.origin?null:t.href}catch{return null}}var g=class e extends f{static#l=150;static#r=8;#t=null;#n=null;#e=null;#c=null;#o=null;#b=null;#d=[];#a=-1;#i=!1;#h=0;#f="";#m=null;#w=!1;#p=null;setup(){this.#f||(this.#f=`site-search-${++K}`),this.#S(),this.#A(),V(this)}teardown(){j(this),this.#i&&(document.body.style.overflow="",this.removeAttribute("open"),this.#t?.setAttribute("aria-expanded","false"),this.#i=!1),this.#y(),this.#h++,this.#d=[],this.#a=-1,this.#o&&this.append(this.#o),this.#o=null,this.#n?.remove(),this.#n=null}#s(t){let n=`data-label-${t}`;return this.getAttribute(n)??_[t]}get value(){return this.#e?.value??""}set value(t){if(!this.#e)return;let n=t==null?"":String(t);this.#e.value!==n&&(this.#e.value=n,this.#e.dispatchEvent(new Event("input",{bubbles:!0})),this.dispatchEvent(new CustomEvent("site-search:change",{detail:{value:n,source:"api"},bubbles:!0})))}get results(){return[...this.#d]}#S(){this.#t=this.querySelector(":scope > [data-trigger]"),this.#t||(this.#t=this.querySelector(":scope > button")),this.#t||(this.#t=o("button",{type:"button","data-trigger":""},[o("icon-wc",{name:"search",label:this.#s("trigger")})]),this.prepend(this.#t));let t=`${this.#f}-dialog`,n=`${this.#f}-results`;this.#t.setAttribute("aria-haspopup","dialog"),this.#t.setAttribute("aria-expanded","false"),this.#t.setAttribute("aria-controls",t),this.#e=o("input",{type:"search",name:"search",class:"input",placeholder:this.#s("placeholder"),autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",role:"combobox","aria-label":this.#s("input"),"aria-autocomplete":"list","aria-controls":n,"aria-expanded":"false"}),this.#c=o("div",{class:"results",id:n,role:"listbox","aria-label":this.#s("results")}),this.#b=o("p",{class:"search-status",role:"status"});let s=r=>o("kbd",{},[r]);if(this.#n=o("dialog",{class:"dialog",id:t,"aria-label":this.#s("dialog")},[o("search",{class:"search"},[o("div",{class:"input-wrapper"},[o("icon-wc",{name:"search",class:"icon"}),this.#e,o("button",{type:"button",class:"shortcut","aria-label":this.#s("dismiss")},[o("kbd",{},["Esc"]),o("icon-wc",{name:"x",size:"sm"})])]),this.#b,this.#c]),o("div",{class:"footer"},[o("span",{class:"hint"},[s("\u2191"),s("\u2193"),` ${this.#s("navigate")} `,s("\u21B5"),` ${this.#s("select")} `,s("esc"),` ${this.#s("close")}`]),o("span",{class:"powered"},[`${this.#s("powered")} `,o("a",{href:"https://pagefind.app",target:"_blank",rel:"noopener"},["Pagefind"])])])]),this.#o=this.querySelector(":scope > nav[data-browse]"),this.#o){let r=this.#o.getAttribute("aria-label")||this.#s("browse");this.#o.setAttribute("aria-label",r);let i=o("p",{class:"browse-title","aria-hidden":"true"},[r]);this.#n.querySelector(".search")?.after(o("div",{class:"browse"},[i,this.#o]))}this.appendChild(this.#n)}#A(){this.listen(this.#t,"click",this.#C),this.#n.addEventListener("close",this.#$),this.#n.addEventListener("click",this.#x),this.#e.addEventListener("input",this.#T),this.#e.addEventListener("keydown",this.#L),this.#c.addEventListener("click",this.#P)}#C=t=>{t.stopPropagation(),this.open()};#$=()=>{this.#i&&!this.#n?.open&&this.#v()};#x=t=>{if(t.target.closest?.(".shortcut")){this.close();return}if(t.target!==this.#n)return;let n=this.#n.getBoundingClientRect();t.clientX>=n.left&&t.clientX<=n.right&&t.clientY>=n.top&&t.clientY<=n.bottom||this.close()};#T=()=>{this.#y(),this.setState("input-debounce-pending",!0),this.#p=setTimeout(()=>{this.#p=null,this.setState("input-debounce-pending",!1),this.#H(this.#e.value)},e.#l)};#L=t=>{switch(t.key){case"ArrowDown":t.preventDefault(),this.#k(this.#a+1);break;case"ArrowUp":t.preventDefault(),this.#k(this.#a-1);break;case"Escape":t.preventDefault(),this.close();break;case"Enter":{t.preventDefault();let n=this.#a>=0?this.#a:0,s=this.#c.querySelector(`[data-result-index="${n}"]`)?.getAttribute("href");s&&(this.close(),window.location.assign(s));break}}};#P=t=>{t.target.closest("[data-result-index]")&&(t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||setTimeout(()=>this.close(),0))};get#M(){let t=this.getAttribute("data-pagefind-path")||"/pagefind/";return t.endsWith("/")?t:`${t}/`}async#E(){if(this.#m||this.#w)return;let t=new URL(this.#M,document.baseURI),n=this.getAttribute("data-base-url")??new URL("..",t).pathname;try{let s=await import(new URL("pagefind.js",t).href);await s.options({excerptLength:20,baseUrl:n}),this.#m=s}catch{this.#w=!0,console.warn(`[site-search] Pagefind not found at ${t.pathname}pagefind.js. Run \`npm run search:index\` after building, or set data-pagefind-path.`)}}#u(t){this.#b&&(this.#b.textContent=t)}async#H(t){let n=++this.#h;if(!t.trim()){this.#g([]);return}if(this.#u(this.#s("searching")),await this.#E(),n===this.#h){if(!this.#m){this.#d=[],this.#g([]),this.#u(this.#s("unavailable"));return}try{let s=await this.#m.search(t),r=await Promise.all((s?.results??[]).slice(0,e.#r).map(i=>i.data()));if(n!==this.#h)return;this.#d=r,this.#g(r,s?.results?.length??r.length)}catch(s){if(n!==this.#h)return;console.error("[site-search] Search error:",s),this.#d=[],this.#g([]),this.#u(this.#s("error"))}}}#g(t,n=t.length){this.#a=-1,this.#e.removeAttribute("aria-activedescendant");let s=[];for(let r of t){let i=Y(r?.url);if(!i)continue;let a=o("span",{class:"result-title"});a.textContent=String(r.meta?.title||this.#s("untitled"));let l=o("span",{class:"result-excerpt"});l.append(F(r.excerpt||"")),s.push(o("a",{id:`${this.#f}-result-${s.length}`,href:i,class:"result",role:"option","aria-selected":"false","data-result-index":String(s.length),tabindex:"-1"},[a,l]))}if(this.#c.replaceChildren(...s),this.#e.setAttribute("aria-expanded",s.length?"true":"false"),!this.#e.value.trim())this.#u("");else if(s.length===0)this.#u(this.#s("empty"));else{let i=n>e.#r&&n>s.length?this.#s("count-more"):s.length===1?this.#s("count-one"):this.#s("count");this.#u(i.replace("{count}",String(s.length)).replace("{total}",String(n)))}}#k(t){let n=this.#c.querySelectorAll("[data-result-index]");if(n.length===0)return;t<0&&(t=n.length-1),t>=n.length&&(t=0);for(let r of n)r.removeAttribute("data-active"),r.setAttribute("aria-selected","false");this.#a=t;let s=n[t];s.setAttribute("data-active",""),s.setAttribute("aria-selected","true"),this.#e.setAttribute("aria-activedescendant",s.id),s.scrollIntoView({block:"nearest"})}#y(){this.#p&&(clearTimeout(this.#p),this.#p=null),this.setState("input-debounce-pending",!1)}open(){if(!(this.#i||!this.#n)){if(this.#i=!0,this.setAttribute("open",""),this.#t?.setAttribute("aria-expanded","true"),document.body.style.overflow="hidden",!this.#n.open)try{this.#n.showModal()}catch{this.#n.setAttribute("open","")}this.#e.focus(),this.#e.select(),this.#E(),this.dispatchEvent(new CustomEvent("site-search:open",{bubbles:!0}))}}close(){this.#i&&(this.#n?.open&&this.#n.close(),this.#i&&this.#v())}#v(){this.#i=!1,this.removeAttribute("open"),this.#t?.setAttribute("aria-expanded","false"),document.body.style.overflow="",this.#y(),this.#h++,this.#d=[],this.#a=-1,this.#e&&(this.#e.value="",this.#e.removeAttribute("aria-activedescendant"),this.#e.setAttribute("aria-expanded","false")),this.#c?.replaceChildren(),this.#u(""),this.#t?.focus(),this.dispatchEvent(new CustomEvent("site-search:close",{bubbles:!0}))}get isOpen(){return this.#i}};$("site-search",g);export{g as SiteSearch};
2
2
  //# sourceMappingURL=site-search.js.map
@@ -1,2 +1,2 @@
1
- var p=window.matchMedia("(prefers-reduced-motion: reduce)");var l=new Map;function d(n,t,e={}){let i=e.priority??10,r={impl:t,bundle:e.bundle,contract:e.contract,priority:i},s=l.get(n);if(customElements.get(n)){if(!s||s.priority>=i){s&&s.priority===i&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${n}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=i){s.priority===i&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${s.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}l.set(n,r),customElements.define(n,t)}var a=class extends HTMLElement{#s=[];#t;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#s)t();this.#s=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,r){t.addEventListener(e,i,r),this.#s.push(()=>t.removeEventListener(e,i,r))}_reinit(){for(let t of this.#s)t();this.#s=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,e){this.#t||(this.#t=this.attachInternals());let i=this.#t.states;try{e?i.add(t):i.delete(t)}catch{let r=`--${t}`;e?i.add(r):i.delete(r)}}_adoptInternals(t){this.#t||(this.#t=t)}#e(){return this.constructor.formAssociated&&this.#t?this.#t:null}get validity(){return this.#e()?.validity}get validationMessage(){return this.#e()?.validationMessage??""}get willValidate(){return this.#e()?.willValidate??!1}get form(){return this.#e()?.form??null}checkValidity(){return this.#e()?.checkValidity()??!0}reportValidity(){return this.#e()?.reportValidity()??!0}};var f="Slide to confirm",b="Confirmed!",m="Press Enter to confirm",c=6,o=class extends a{static formAssociated=!0;static observedAttributes=["label","activated-label","data-label-hint","required","value"];#s;#t;#e;#h;#a;#o=!1;#n=0;#m=0;#E=0;#l=0;#i=!1;#d=!1;#p=!1;#w="";#c;constructor(){super(),this.#s=this.attachInternals(),this._adoptInternals(this.#s)}get activated(){return this.#i}get#M(){let t=this.getAttribute("threshold"),e=Number(t);return t!==null&&t.trim()!==""&&!isNaN(e)?Math.min(100,Math.max(0,e)):90}get#k(){return this.getAttribute("label")||this.#w||f}get#C(){return this.getAttribute("activated-label")||b}get#v(){return getComputedStyle(this).direction==="rtl"}setup(){this.#p||(this.#D(),this.#p=!0),this.listen(this.#t,"pointerdown",this.#S),this.listen(this.#t,"keydown",this.#N),this.listen(this.#t,"transitionend",this.#P)}teardown(){this.#o&&this.#b(),clearTimeout(this.#c),this.removeAttribute("transitioning")}attributeChangedCallback(t,e,i){e===i||!this.#p||(this.#u(),(t==="required"||t==="value")&&this.#f())}#D(){this.#w=(this.textContent||"").replace(/\s+/g," ").trim(),this.#a=document.createElement("div"),this.#a.className="slide-track",this.#e=document.createElement("span"),this.#e.className="slide-label",this.#e.setAttribute("role","status"),this.#h=document.createElement("span"),this.#h.className="visually-hidden slide-hint",this.#h.id=`slide-hint-${Math.random().toString(36).slice(2,9)}`,this.#t=document.createElement("div"),this.#t.className="slide-handle",this.#t.setAttribute("role","slider"),this.#t.setAttribute("aria-valuemin","0"),this.#t.setAttribute("aria-valuemax","100"),this.#t.setAttribute("aria-describedby",this.#h.id),this.#t.setAttribute("tabindex","0"),this.#t.innerHTML='<icon-wc name="chevrons-right" size="sm"></icon-wc>',this.#a.append(this.#e,this.#t),this.textContent="",this.append(this.#a,this.#h),this.#u(),this.#r(0),this.#f()}#u(){let t=this.#k;this.#e.textContent=this.#i?this.#C:t,this.#t.setAttribute("aria-label",t),this.#h.textContent=this.getAttribute("data-label-hint")||m,this.#T()}#T(){this.#t.setAttribute("aria-valuetext",this.#i?this.#C:`${Math.round(this.#n)}%`)}#f(){let t=this.getAttribute("value")||"on";this.#s.setFormValue(this.#i?t:null),this.hasAttribute("required")&&!this.#i?this.#s.setValidity({valueMissing:!0},`${this.#k} to continue.`,this.#t):this.#s.setValidity({})}reset(){this.#i=!1,this.removeAttribute("data-activated"),this.#t.removeAttribute("aria-disabled"),this.#g(),this.#r(0),this.#u(),this.#f(),this.dispatchEvent(new CustomEvent("slide-accept:reset",{bubbles:!0}))}formResetCallback(){(this.#i||this.#n!==0)&&this.reset()}formDisabledCallback(t){this.#d=t,t&&this.#o&&(this.#b(),this.#A()),this.#g()}#g(){this.#t&&(this.#i||this.#d?this.#t.setAttribute("aria-disabled","true"):this.#t.removeAttribute("aria-disabled"))}#S=t=>{if(!(this.#i||this.#d)&&t.button===0){if(t.preventDefault(),this.#t.focus({preventScroll:!0}),this.hasAttribute("transitioning")){let e=this.#t.getBoundingClientRect(),i=this.#a.getBoundingClientRect(),r=parseFloat(getComputedStyle(this.#a).getPropertyValue("--_handle-inset")||"0"),s=this.#t.offsetWidth,h=i.width-s-r*2,u=this.#v?i.right-e.right-r:e.left-i.left-r;this.removeAttribute("transitioning"),clearTimeout(this.#c),this.#r(h>0?Math.max(0,Math.min(100,u/h*100)):0)}this.#o=!0,this.#m=t.clientX,this.#E=this.#n,this.#l=0;try{this.#t.setPointerCapture(t.pointerId)}catch{}this.setAttribute("data-dragging",""),this.#t.addEventListener("pointermove",this.#x),this.#t.addEventListener("pointerup",this.#L),this.#t.addEventListener("pointercancel",this.#$)}};#x=t=>{if(!this.#o)return;let e=this.#a.getBoundingClientRect().width-this.#t.offsetWidth;if(e<=0)return;let i=t.clientX-this.#m;this.#l=Math.max(this.#l,Math.abs(i));let s=(this.#v?-i:i)/e*100;this.#r(Math.min(100,Math.max(0,this.#E+s)))};#b(t){if(this.#o=!1,this.removeAttribute("data-dragging"),t)try{this.#t.releasePointerCapture(t.pointerId)}catch{}this.#t.removeEventListener("pointermove",this.#x),this.#t.removeEventListener("pointerup",this.#L),this.#t.removeEventListener("pointercancel",this.#$)}#L=t=>{if(!this.#o)return;let e=this.#l<c&&Math.abs(t.clientX-this.#m)<c;this.#b(t),e||this.#n>=this.#M?this.#y():this.#A()};#$=t=>{this.#o&&(this.#b(t),this.#A())};#N=t=>{if(this.#i||this.#d)return;let e=t.shiftKey?20:5,i=this.#v,r=i?"ArrowLeft":"ArrowRight",s=i?"ArrowRight":"ArrowLeft";t.key===r||t.key==="ArrowUp"?(t.preventDefault(),this.#r(Math.min(100,this.#n+e)),this.#n>=this.#M&&this.#y()):t.key===s||t.key==="ArrowDown"?(t.preventDefault(),this.#r(Math.max(0,this.#n-e))):t.key==="End"||t.key==="Enter"||t.key===" "?(t.preventDefault(),this.#y()):t.key==="Home"&&(t.preventDefault(),this.#r(0))};#P=()=>{this.removeAttribute("transitioning")};#y(){this.#i||(this.#i=!0,this.#r(100),this.setAttribute("data-activated",""),this.#g(),this.#u(),this.#f(),this.dispatchEvent(new CustomEvent("slide-accept:accept",{bubbles:!0})))}#A(){this.setAttribute("transitioning",""),this.#r(0),clearTimeout(this.#c),this.#c=setTimeout(()=>{this.removeAttribute("transitioning")},500)}#r(t){this.#n=t,this.style.setProperty("--_slide-position",String(t)),this.#t.setAttribute("aria-valuenow",String(Math.round(t))),this.#T()}};d("slide-accept",o);export{o as SlideAccept};
1
+ var y=window.matchMedia("(prefers-reduced-motion: reduce)");var h=new Map;function c(n,t,e={}){let i=e.priority??10,r={impl:t,bundle:e.bundle,contract:e.contract,priority:i},s=h.get(n);if(customElements.get(n)){if(!s||s.priority>=i){s&&s.priority===i&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${n}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=i){s.priority===i&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${s.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}h.set(n,r),customElements.define(n,t)}var a=class extends HTMLElement{#s=[];#t;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#s)t();this.#s=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,r){t.addEventListener(e,i,r),this.#s.push(()=>t.removeEventListener(e,i,r))}_reinit(){for(let t of this.#s)t();this.#s=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,e){this.#t||(this.#t=this.attachInternals());let i=this.#t.states;try{e?i.add(t):i.delete(t)}catch{let r=`--${t}`;e?i.add(r):i.delete(r)}}_adoptInternals(t){this.#t||(this.#t=t)}#e(){return this.constructor.formAssociated&&this.#t?this.#t:null}get validity(){return this.#e()?.validity}get validationMessage(){return this.#e()?.validationMessage??""}get willValidate(){return this.#e()?.willValidate??!1}get form(){return this.#e()?.form??null}checkValidity(){return this.#e()?.checkValidity()??!0}reportValidity(){return this.#e()?.reportValidity()??!0}};var f="Slide to confirm",b="Confirmed!",p="Press Enter to confirm",l=6,o=class extends a{static formAssociated=!0;static observedAttributes=["label","activated-label","data-label-hint","data-label-required","required","value"];#s;#t;#e;#d;#a;#o=!1;#n=0;#p=0;#E=0;#h=0;#i=!1;#c=!1;#m=!1;#w="";#l;constructor(){super(),this.#s=this.attachInternals(),this._adoptInternals(this.#s)}get activated(){return this.#i}get#C(){let t=this.getAttribute("threshold"),e=Number(t);return t!==null&&t.trim()!==""&&!isNaN(e)?Math.min(100,Math.max(0,e)):90}get#S(){return this.getAttribute("label")||this.#w||f}get#T(){return this.getAttribute("activated-label")||b}get#v(){return getComputedStyle(this).direction==="rtl"}setup(){this.#m||(this.#L(),this.#m=!0),this.listen(this.#t,"pointerdown",this.#P),this.listen(this.#t,"keydown",this.#_),this.listen(this.#t,"transitionend",this.#B)}teardown(){this.#o&&this.#b(),clearTimeout(this.#l),this.removeAttribute("transitioning")}attributeChangedCallback(t,e,i){e===i||!this.#m||(this.#u(),(t==="required"||t==="value"||t==="data-label-required"||t==="label")&&this.#f())}#L(){this.#w=(this.textContent||"").replace(/\s+/g," ").trim(),this.#a=document.createElement("div"),this.#a.className="slide-track",this.#e=document.createElement("span"),this.#e.className="slide-label",this.#e.setAttribute("role","status"),this.#d=document.createElement("span"),this.#d.className="visually-hidden slide-hint",this.#d.id=`slide-hint-${Math.random().toString(36).slice(2,9)}`,this.#t=document.createElement("div"),this.#t.className="slide-handle",this.#t.setAttribute("role","slider"),this.#t.setAttribute("aria-valuemin","0"),this.#t.setAttribute("aria-valuemax","100"),this.#t.setAttribute("aria-describedby",this.#d.id),this.#t.setAttribute("tabindex","0"),this.#t.innerHTML='<icon-wc name="chevrons-right" size="sm"></icon-wc>',this.#a.append(this.#e,this.#t),this.textContent="",this.append(this.#a,this.#d),this.#u(),this.#r(0),this.#f()}#u(){let t=this.#S;this.#e.textContent=this.#i?this.#T:t,this.#t.setAttribute("aria-label",t),this.#d.textContent=this.getAttribute("data-label-hint")||p,this.#$()}#$(){this.#t.setAttribute("aria-valuetext",this.#i?this.#T:`${Math.round(this.#n)}%`)}#f(){let t=this.getAttribute("value")||"on";if(this.#s.setFormValue(this.#i?t:null),this.hasAttribute("required")&&!this.#i){let e=(this.getAttribute("data-label-required")||"{label} to continue.").replace("{label}",this.#S);this.#s.setValidity({valueMissing:!0},e,this.#t)}else this.#s.setValidity({})}reset(){this.#i=!1,this.removeAttribute("data-activated"),this.#t.removeAttribute("aria-disabled"),this.#g(),this.#r(0),this.#u(),this.#f(),this.dispatchEvent(new CustomEvent("slide-accept:reset",{bubbles:!0}))}formResetCallback(){(this.#i||this.#n!==0)&&this.reset()}formDisabledCallback(t){this.#c=t,t&&this.#o&&(this.#b(),this.#A()),this.#g()}#g(){this.#t&&(this.#i||this.#c?this.#t.setAttribute("aria-disabled","true"):this.#t.removeAttribute("aria-disabled"))}#P=t=>{if(!(this.#i||this.#c)&&t.button===0){if(t.preventDefault(),this.#t.focus({preventScroll:!0}),this.hasAttribute("transitioning")){let e=this.#t.getBoundingClientRect(),i=this.#a.getBoundingClientRect(),r=parseFloat(getComputedStyle(this.#a).getPropertyValue("--_handle-inset")||"0"),s=this.#t.offsetWidth,d=i.width-s-r*2,u=this.#v?i.right-e.right-r:e.left-i.left-r;this.removeAttribute("transitioning"),clearTimeout(this.#l),this.#r(d>0?Math.max(0,Math.min(100,u/d*100)):0)}this.#o=!0,this.#p=t.clientX,this.#E=this.#n,this.#h=0;try{this.#t.setPointerCapture(t.pointerId)}catch{}this.setAttribute("data-dragging",""),this.#t.addEventListener("pointermove",this.#M),this.#t.addEventListener("pointerup",this.#k),this.#t.addEventListener("pointercancel",this.#x)}};#M=t=>{if(!this.#o)return;let e=this.#a.getBoundingClientRect().width-this.#t.offsetWidth;if(e<=0)return;let i=t.clientX-this.#p;this.#h=Math.max(this.#h,Math.abs(i));let s=(this.#v?-i:i)/e*100;this.#r(Math.min(100,Math.max(0,this.#E+s)))};#b(t){if(this.#o=!1,this.removeAttribute("data-dragging"),t)try{this.#t.releasePointerCapture(t.pointerId)}catch{}this.#t.removeEventListener("pointermove",this.#M),this.#t.removeEventListener("pointerup",this.#k),this.#t.removeEventListener("pointercancel",this.#x)}#k=t=>{if(!this.#o)return;let e=this.#h<l&&Math.abs(t.clientX-this.#p)<l;this.#b(t),e||this.#n>=this.#C?this.#y():this.#A()};#x=t=>{this.#o&&(this.#b(t),this.#A())};#_=t=>{if(this.#i||this.#c)return;let e=t.shiftKey?20:5,i=this.#v,r=i?"ArrowLeft":"ArrowRight",s=i?"ArrowRight":"ArrowLeft";t.key===r||t.key==="ArrowUp"?(t.preventDefault(),this.#r(Math.min(100,this.#n+e)),this.#n>=this.#C&&this.#y()):t.key===s||t.key==="ArrowDown"?(t.preventDefault(),this.#r(Math.max(0,this.#n-e))):t.key==="End"||t.key==="Enter"||t.key===" "?(t.preventDefault(),this.#y()):t.key==="Home"&&(t.preventDefault(),this.#r(0))};#B=()=>{this.removeAttribute("transitioning")};#y(){this.#i||(this.#i=!0,this.#r(100),this.setAttribute("data-activated",""),this.#g(),this.#u(),this.#f(),this.dispatchEvent(new CustomEvent("slide-accept:accept",{bubbles:!0})))}#A(){this.setAttribute("transitioning",""),this.#r(0),clearTimeout(this.#l),this.#l=setTimeout(()=>{this.removeAttribute("transitioning")},500)}#r(t){this.#n=t,this.style.setProperty("--_slide-position",String(t)),this.#t.setAttribute("aria-valuenow",String(Math.round(t))),this.#$()}};c("slide-accept",o);export{o as SlideAccept};
2
2
  //# sourceMappingURL=slide-accept.js.map