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,2 +1,2 @@
1
- var S=window.matchMedia("(prefers-reduced-motion: reduce)");var b=new Map;function u(o,e,i={}){let t=i.priority??10,n={impl:e,bundle:i.bundle,contract:i.contract,priority:t},s=b.get(o);if(customElements.get(o)){if(!s||s.priority>=t){s&&s.priority===t&&s.impl!==e&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${i.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${i.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=t){s.priority===t&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${s.bundle}". Skipping "${i.bundle}" (first wins at equal priority).`);return}b.set(o,n),customElements.define(o,e)}var l=class extends HTMLElement{#i=[];#e;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let e of this.#i)e();this.#i=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,i,t,n){e.addEventListener(i,t,n),this.#i.push(()=>e.removeEventListener(i,t,n))}_reinit(){for(let e of this.#i)e();this.#i=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,i){this.#e||(this.#e=this.attachInternals());let t=this.#e.states;try{i?t.add(e):t.delete(e)}catch{let n=`--${e}`;i?t.add(n):t.delete(n)}}_adoptInternals(e){this.#e||(this.#e=e)}#t(){return this.constructor.formAssociated&&this.#e?this.#e: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 y=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function v(o,e){let t=(()=>{try{return decodeURIComponent(location.hash.slice(1))}catch{return location.hash.slice(1)}})()===e;t||(location.hash=e);let n=o;typeof n.focus=="function"&&(n.tabIndex<0&&!n.hasAttribute("tabindex")&&n.setAttribute("tabindex","-1"),n.focus({preventScroll:!0})),(t||!n.matches?.(":target"))&&n.scrollIntoView({behavior:y()?"auto":"smooth",block:"start"})}function h(o){let e=o;if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return!1;let t=(e.target instanceof Element?e.target:null)?.closest('a[href^="#"]');if(!t)return!1;let n=t.getAttribute("target");if(n&&n!=="_self"||t.hasAttribute("download"))return!1;let s=(t.getAttribute("href")??"").slice(1);if(!s)return!1;let r=s;try{r=decodeURIComponent(s)}catch{}let a=t.ownerDocument.getElementById(r);return a?(e.preventDefault(),v(a,r),!0):!1}var E="Back to content",A="Footnote {n}",w="Notes",g="\u21A9\uFE0E",$=120,C=150,f=o=>String.fromCharCode(97+o%26)+(o>=26?String(Math.floor(o/26)):""),p=class o extends l{static observedAttributes=["data-mode","data-label-back","data-label-ref","data-label-heading","data-preview"];static#i=0;#e=0;#t=[];#a=[];#c=null;#l=!1;#n=null;#s=null;#r;#d;attributeChangedCallback(e,i,t){i===t||!this.hasAttribute("data-upgraded")||this._reinit()}setup(){this.#e||(this.#e=++o.#i),this.listen(this,"click",h),this.listen(document,"keydown",n=>{n.key==="Escape"&&this.#n?.matches(":popover-open")&&this.#o()});let e=this.#m(this.#p());if(e.length===0)return;let i=this.getAttribute("data-mode")==="sidenotes";for(let n of e)n.side=i&&n.source.getAttribute("data-side")!=="false",this.#b(n);let t=e.filter(n=>!n.side);for(let n of e)n.side&&this.#y(n),n.refs.forEach((s,r)=>this.#g(s,n,r));t.length?this.#v(t):this.hidden||(this.hidden=!0,this.#l=!0)}teardown(){clearTimeout(this.#r),clearTimeout(this.#d),this.#o();for(let{ref:e,original:i}of this.#t)e.replaceChildren(...i),e.removeAttribute("data-enhanced");this.#t=[];for(let e of this.#a)e.remove();this.#a=[],this.#n=null,this.#s=null,this.#c&&(this.#c.el.removeAttribute("id"),this.#c=null),this.#l&&(this.hidden=!1,this.#l=!1)}#p(){return[...document.querySelectorAll("foot-note:not([data-enhanced])")].filter(e=>this.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}#m(e){let i=new Set(e),t=new Map,n=[];for(let s of e){let r=s,a=s.getAttribute("data-ref");if(a){let d=document.getElementById(a);d&&i.has(d)&&!d.hasAttribute("data-ref")?r=d:console.warn(`[foot-notes] data-ref="${a}" does not name a <foot-note> collected by this <foot-notes>; rendering it as its own note.`)}let c=t.get(r);if(!c){let d=n.length+1;c={source:r,num:d,noteId:`fn-${this.#e}-${d}`,refs:[],content:[],side:!1},t.set(r,c),n.push(c)}c.refs.push(s)}return n}#b(e){let i=new Set([e.source,...e.refs]);for(let t of i){let n=[...t.childNodes];this.#t.push({ref:t,original:n}),t===e.source&&(e.content=n),t.replaceChildren()}}#u(e,i){return this.getAttribute(e)||i}#g(e,i,t){let n=document.createElement("a");n.id=this.#h(i,t),n.href=`#${i.noteId}`,n.setAttribute("role","doc-noteref"),n.setAttribute("aria-label",this.#u("data-label-ref",A).replaceAll("{n}",String(i.num))),n.textContent=String(i.num),e.setAttribute("data-enhanced",""),i.side&&e===i.source?e.prepend(n):e.append(n),this.listen(n,"click",s=>{this.#o(),h(s)}),!i.side&&this.getAttribute("data-preview")!=="false"&&this.#A(n,i)}#h(e,i){let t=`fnref-${this.#e}-${e.num}`;return i===0?t:`${t}-${f(i)}`}#y(e){let i=document.createElement("aside");i.className="sidenote",i.id=e.noteId,i.setAttribute("role","note");let t=document.createElement("span");t.className="sidenote-number",t.textContent=`${e.num}.`,i.append(t," ",...e.content),e.source.append(i)}#v(e){let i=document.createElement("section");i.setAttribute("role","doc-endnotes");let t=this.querySelector(":scope > :is(h1, h2, h3, h4, h5, h6)");if(t)t.id||(t.id=`fnh-${this.#e}`,this.#c={el:t,id:t.id}),i.setAttribute("aria-labelledby",t.id);else{let s=document.createElement("h2");s.id=`fnh-${this.#e}`,s.className="visually-hidden",s.textContent=this.#u("data-label-heading",w),i.setAttribute("aria-labelledby",s.id),i.append(s)}let n=document.createElement("ol");for(let s of e)n.append(this.#E(s));i.append(n),this.append(i),this.#a.push(i)}#E(e){let i=document.createElement("li");i.id=e.noteId,i.append(...e.content," ");let t=this.#u("data-label-back",E),n=e.refs.length>1;return e.refs.forEach((s,r)=>{let a=document.createElement("a");a.href=`#${this.#h(e,r)}`,a.setAttribute("data-backref",""),a.setAttribute("role","doc-backlink"),n?(a.setAttribute("aria-label",`${t} (${f(r)})`),a.textContent=`${g}${f(r)}`):(a.setAttribute("aria-label",t),a.textContent=g),r>0&&i.append(" "),i.append(a)}),i}#A(e,i){typeof HTMLElement.prototype.showPopover=="function"&&(this.listen(e,"pointerenter",t=>{t.pointerType!=="touch"&&(clearTimeout(this.#d),clearTimeout(this.#r),this.#r=setTimeout(()=>this.#f(e,i),$))}),this.listen(e,"pointerleave",()=>{clearTimeout(this.#r),!(e===document.activeElement&&e.matches(":focus-visible"))&&(this.#d=setTimeout(()=>this.#o(),C))}),this.listen(e,"focus",()=>{e.matches(":focus-visible")&&this.#f(e,i)}),this.listen(e,"blur",()=>this.#o()))}#w(){if(this.#n)return this.#n;let e=document.createElement("aside");return e.className="fn-preview",e.setAttribute("popover","manual"),e.setAttribute("aria-hidden","true"),e.inert=!0,this.append(e),this.#a.push(e),this.#n=e,e}#f(e,i){if(clearTimeout(this.#d),!e.isConnected||this.hidden)return;let t=this.#w(),n=document.createElement("span");n.className="fn-preview-number",n.textContent=`${i.num}.`;let s=i.content.map(r=>r.cloneNode(!0));t.replaceChildren(n," ",...s);for(let r of t.querySelectorAll("[id]"))r.removeAttribute("id");this.#s?.removeAttribute("data-preview-anchor"),e.setAttribute("data-preview-anchor",""),this.#s=e,t.matches(":popover-open")||t.showPopover(),this.#$(t,e)}#o(){clearTimeout(this.#r);let e=this.#n;e?.matches(":popover-open")&&e.hidePopover(),this.#s?.removeAttribute("data-preview-anchor"),this.#s=null}#$(e,i){if(typeof CSS<"u"&&CSS.supports?.("position-area: top"))return;let t=i.getBoundingClientRect(),n=6,s=e.offsetWidth,r=e.offsetHeight,a=t.top-r-n;a<n&&(a=t.bottom+n);let c=Math.max(n,Math.min(t.left+t.width/2-s/2,innerWidth-s-n));e.style.inset="auto",e.style.top=`${a}px`,e.style.left=`${c}px`}},m=class extends HTMLElement{};u("foot-notes",p);u("foot-note",m);export{m as FootNote,p as FootNotes};
1
+ var x=window.matchMedia("(prefers-reduced-motion: reduce)");var b=new Map;function u(i,e,r={}){let t=r.priority??10,n={impl:e,bundle:r.bundle,contract:r.contract,priority:t},s=b.get(i);if(customElements.get(i)){if(!s||s.priority>=t){s&&s.priority===t&&s.impl!==e&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${r.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${r.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=t){s.priority===t&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${s.bundle}". Skipping "${r.bundle}" (first wins at equal priority).`);return}b.set(i,n),customElements.define(i,e)}var l=class extends HTMLElement{#r=[];#e;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let e of this.#r)e();this.#r=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,r,t,n){e.addEventListener(r,t,n),this.#r.push(()=>e.removeEventListener(r,t,n))}_reinit(){for(let e of this.#r)e();this.#r=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,r){this.#e||(this.#e=this.attachInternals());let t=this.#e.states;try{r?t.add(e):t.delete(e)}catch{let n=`--${e}`;r?t.add(n):t.delete(n)}}_adoptInternals(e){this.#e||(this.#e=e)}#t(){return this.constructor.formAssociated&&this.#e?this.#e: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 v=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function g(i,e){let t=(()=>{try{return decodeURIComponent(location.hash.slice(1))}catch{return location.hash.slice(1)}})()===e;t||(location.hash=e);let n=i;typeof n.focus=="function"&&(n.tabIndex<0&&!n.hasAttribute("tabindex")&&n.setAttribute("tabindex","-1"),n.focus({preventScroll:!0})),(t||!n.matches?.(":target"))&&n.scrollIntoView({behavior:v()?"auto":"smooth",block:"start"})}function f(i){let e=i;if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return!1;let t=(e.target instanceof Element?e.target:null)?.closest('a[href^="#"]');if(!t)return!1;let n=t.getAttribute("target");if(n&&n!=="_self"||t.hasAttribute("download"))return!1;let s=(t.getAttribute("href")??"").slice(1);if(!s)return!1;let o=s;try{o=decodeURIComponent(s)}catch{}let a=t.ownerDocument.getElementById(o);return a?(e.preventDefault(),g(a,o),!0):!1}var E="Back to content",w="Footnote {n}",A="Notes",y="\u21A9\uFE0E",$=120,S=150,h=i=>String.fromCharCode(97+i%26)+(i>=26?String(Math.floor(i/26)):""),p=class i extends l{static observedAttributes=["data-mode","data-label-back","data-label-ref","data-label-heading","data-preview"];static#r=0;#e=0;#t=[];#a=[];#c=null;#l=!1;#n=null;#s=null;#o;#d;attributeChangedCallback(e,r,t){r===t||!this.hasAttribute("data-upgraded")||this._reinit()}setup(){this.#e||(this.#e=++i.#r),this.listen(this,"click",f),this.listen(document,"keydown",n=>{n.key==="Escape"&&this.#n?.matches(":popover-open")&&this.#i()});let e=this.#m(this.#p());if(e.length===0)return;let r=this.getAttribute("data-mode")==="sidenotes";for(let n of e)n.side=r&&n.source.getAttribute("data-side")!=="false",this.#b(n);let t=e.filter(n=>!n.side);for(let n of e)n.side&&this.#v(n),n.refs.forEach((s,o)=>this.#y(s,n,o));t.length?this.#g(t):this.hidden||(this.hidden=!0,this.#l=!0)}teardown(){clearTimeout(this.#o),clearTimeout(this.#d),this.#i();for(let{ref:e,original:r}of this.#t)e.replaceChildren(...r),e.removeAttribute("data-enhanced");this.#t=[];for(let e of this.#a)e.remove();this.#a=[],this.#n=null,this.#s=null,this.#c&&(this.#c.el.removeAttribute("id"),this.#c=null),this.#l&&(this.hidden=!1,this.#l=!1)}#p(){return[...document.querySelectorAll("foot-note:not([data-enhanced])")].filter(e=>this.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}#m(e){let r=new Set(e),t=new Map,n=[];for(let s of e){let o=s,a=s.getAttribute("data-ref");if(a){let d=document.getElementById(a);d&&r.has(d)&&!d.hasAttribute("data-ref")?o=d:console.warn(`[foot-notes] data-ref="${a}" does not name a <foot-note> collected by this <foot-notes>; rendering it as its own note.`)}let c=t.get(o);if(!c){let d=n.length+1;c={source:o,num:d,noteId:`fn-${this.#e}-${d}`,refs:[],content:[],side:!1},t.set(o,c),n.push(c)}c.refs.push(s)}return n}#b(e){let r=new Set([e.source,...e.refs]);for(let t of r){let n=[...t.childNodes];this.#t.push({ref:t,original:n}),t===e.source&&(e.content=n),t.replaceChildren()}}#u(e,r){return this.getAttribute(e)||r}#y(e,r,t){let n=document.createElement("a");n.id=this.#f(r,t),n.href=`#${r.noteId}`,n.setAttribute("role","doc-noteref"),n.setAttribute("aria-label",this.#u("data-label-ref",w).replaceAll("{n}",String(r.num))),n.textContent=String(r.num),e.setAttribute("data-enhanced",""),r.side&&e===r.source?e.prepend(n):e.append(n),this.listen(n,"click",s=>{this.#i(),f(s)}),!r.side&&this.getAttribute("data-preview")!=="false"&&this.#w(n,r)}#f(e,r){let t=`fnref-${this.#e}-${e.num}`;return r===0?t:`${t}-${h(r)}`}#v(e){let r=document.createElement("aside");r.className="sidenote",r.id=e.noteId,r.setAttribute("role","note");let t=document.createElement("span");t.className="sidenote-number",t.textContent=`${e.num}.`,r.append(t," ",...e.content),e.source.append(r)}#g(e){let r=document.createElement("section");r.setAttribute("role","doc-endnotes");let t=this.querySelector(":scope > :is(h1, h2, h3, h4, h5, h6)");if(t)t.id||(t.id=`fnh-${this.#e}`,this.#c={el:t,id:t.id}),r.setAttribute("aria-labelledby",t.id);else{let s=document.createElement("h2");s.id=`fnh-${this.#e}`,s.className="visually-hidden",s.textContent=this.#u("data-label-heading",A),r.setAttribute("aria-labelledby",s.id),r.append(s)}let n=document.createElement("ol");for(let s of e)n.append(this.#E(s));r.append(n),this.append(r),this.#a.push(r)}#E(e){let r=document.createElement("li");r.id=e.noteId,r.append(...e.content," ");let t=this.#u("data-label-back",E),n=e.refs.length>1;return e.refs.forEach((s,o)=>{let a=document.createElement("a");a.href=`#${this.#f(e,o)}`,a.setAttribute("data-backref",""),a.setAttribute("role","doc-backlink"),n?(a.setAttribute("aria-label",`${t} (${h(o)})`),a.textContent=`${y}${h(o)}`):(a.setAttribute("aria-label",t),a.textContent=y),o>0&&r.append(" "),r.append(a)}),r}#w(e,r){typeof HTMLElement.prototype.showPopover=="function"&&(this.listen(e,"pointerenter",t=>{t.pointerType!=="touch"&&(clearTimeout(this.#d),clearTimeout(this.#o),this.#o=setTimeout(()=>this.#h(e,r),$))}),this.listen(e,"pointerleave",()=>{clearTimeout(this.#o),!(e===document.activeElement&&e.matches(":focus-visible"))&&(this.#d=setTimeout(()=>this.#i(),S))}),this.listen(e,"focus",()=>{e.matches(":focus-visible")&&this.#h(e,r)}),this.listen(e,"blur",()=>this.#i()))}#A(){if(this.#n)return this.#n;let e=document.createElement("aside");return e.className="fn-preview",e.setAttribute("popover","manual"),e.setAttribute("aria-hidden","true"),e.inert=!0,this.append(e),this.#a.push(e),this.#n=e,e}#h(e,r){if(clearTimeout(this.#d),!e.isConnected||this.hidden)return;let t=this.#A(),n=document.createElement("span");n.className="fn-preview-number",n.textContent=`${r.num}.`;let s=r.content.map(o=>o.cloneNode(!0));t.replaceChildren(n," ",...s);for(let o of t.querySelectorAll("[id]"))o.removeAttribute("id");this.#s?.removeAttribute("data-preview-anchor"),e.setAttribute("data-preview-anchor",""),this.#s=e,t.matches(":popover-open")||t.showPopover(),this.#$(t,e)}#i(){clearTimeout(this.#o);let e=this.#n;e?.matches(":popover-open")&&e.hidePopover(),this.#s?.removeAttribute("data-preview-anchor"),this.#s=null}#$(e,r){if(typeof CSS<"u"&&CSS.supports?.("position-area: top"))return;let t=r.getBoundingClientRect(),n=6,s=e.offsetWidth,o=e.offsetHeight,a=t.top-o-n;a<n&&(a=t.bottom+n);let c=Math.max(n,Math.min(t.left+t.width/2-s/2,innerWidth-s-n));e.style.inset="auto",e.style.top=`${a}px`,e.style.left=`${c}px`}},m=class extends HTMLElement{};u("foot-notes",p);u("foot-note",m);export{m as FootNote,p as FootNotes};
2
2
  //# sourceMappingURL=foot-notes.js.map
@@ -1,2 +1,2 @@
1
- var A=window.matchMedia("(prefers-reduced-motion: reduce)");var f=new Map;function m(n,t,e={}){let i=e.priority??10,r={impl:t,bundle:e.bundle,contract:e.contract,priority:i},s=f.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}f.set(n,r),customElements.define(n,t)}var c=class extends HTMLElement{#t=[];#e;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,r){t.addEventListener(e,i,r),this.#t.push(()=>t.removeEventListener(e,i,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,e){this.#e||(this.#e=this.attachInternals());let i=this.#e.states;try{e?i.add(t):i.delete(t)}catch{let r=`--${t}`;e?i.add(r):i.delete(r)}}_adoptInternals(t){this.#e||(this.#e=t)}#i(){return this.constructor.formAssociated&&this.#e?this.#e:null}get validity(){return this.#i()?.validity}get validationMessage(){return this.#i()?.validationMessage??""}get willValidate(){return this.#i()?.willValidate??!1}get form(){return this.#i()?.form??null}checkValidity(){return this.#i()?.checkValidity()??!0}reportValidity(){return this.#i()?.reportValidity()??!0}};var g=["valueMissing","badInput","typeMismatch","patternMismatch","tooShort","tooLong","rangeUnderflow","rangeOverflow","stepMismatch","customError"],v='input:not([type="hidden"]):not(.otp-digit), textarea, select',y="output.hint, output.textarea-counter",b="Please check this field.",E=0;function p(n){return n.localName.includes("-")?!!customElements.get(n.localName)?.formAssociated:!1}function a(n){return n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement}var u=class extends c{#t=null;#e=[];#i=null;#r=!1;#s="";#n;#d=`ff-${++E}`;setup(){if(this.#y(),this.#t=this.#v(),this.#i=this.querySelector("output.error")??this.querySelector("output:not(.hint):not(.textarea-counter)"),!this.#t)return!1;this.#i&&this.#n===void 0&&(this.#n=this.#i.textContent?.trim()??"",this.hasAttribute("data-invalid")||(this.#i.textContent=""));let t=this.#t;this.#e=[],t instanceof HTMLInputElement&&t.type==="radio"&&(this.#e=this.#b(t));let e=this.#e.length?this.#e:[t];for(let r of e)this.listen(r,"input",this.#o),this.listen(r,"change",this.#o),this.listen(r,"invalid",this.#g);a(t)||this.listen(t,`${t.localName}:change`,this.#o),this.listen(this,"focusout",r=>{let s=r.relatedTarget;s instanceof Node&&this.contains(s)||this.validate()});let i=t.form??this.closest("form");return i instanceof HTMLFormElement&&this.listen(i,"reset",r=>{setTimeout(()=>{!r.defaultPrevented&&this.isConnected&&this.clearError()})}),this.#l(this.hasAttribute("data-invalid")),!0}teardown(){this.#t=null,this.#e=[],this.#i=null}validate({show:t=!0}={}){if(!this.#t)return!0;let{valid:e,message:i}=this.#E();return t&&(e?(this.#c(this.#p()?"valid":null),this.#u("")):(this.#r=!0,this.#c("invalid"),this.#u(i)),this.#l(!e)),e}setError(t){if(!this.#t)return;this.#s=t;let e=this.#h();e&&e.setCustomValidity(t),this.validate()}clearError(){this.#t&&(this.#f(),this.#r=!1,this.#c(null),this.#u(""),this.#l(!1))}get fieldName(){return this.querySelector("label, legend")?.textContent?.trim()||this.#t?.getAttribute?.("aria-label")||this.#t?.getAttribute?.("name")||this.#t?.id||"Field"}get input(){return this.#t}#o=()=>{this.#s&&this.#f(),this.#r&&this.validate()};#a=!1;#g=()=>{if(!this.#a){this.#a=!0;try{this.validate()}finally{this.#a=!1}}};#v(){for(let t of this.querySelectorAll("*"))if(p(t))return t;return this.querySelector(v)}#y(){for(let t of this.querySelectorAll(":not(:defined)"))t.localName.includes("-")&&customElements.whenDefined(t.localName).then(()=>{!this.isConnected||!this.contains(t)||this.#t===t||p(t)&&this._reinit()})}#b(t){return t.name?(t.form?[...t.form.elements]:[...t.getRootNode().querySelectorAll('input[type="radio"]')].filter(i=>!i.form)).filter(i=>i instanceof HTMLInputElement&&i.type==="radio"&&i.name===t.name):[t]}#h(){let t=this.#t;return t&&a(t)?t:null}#f(){let t=this.#h();t&&t.validity.customError&&t.validationMessage===this.#s&&t.setCustomValidity(""),this.#s=""}#E(){let t=this.#t;if(this.#s)return{valid:!1,message:this.#s};let e=t.validity;if(e)return e.valid?{valid:!0,message:""}:{valid:!1,message:this.#m(e)};let i=t.matches(":invalid");return{valid:!i,message:i?this.#m(null):""}}#m(t){let e=this.#t,i=a(e),r=s=>e.getAttribute(`data-message-${s.toLowerCase()}`)??(i?null:this.getAttribute(`data-message-${s.toLowerCase()}`));if(t)for(let s of g){if(!t[s])continue;let o=r(s);if(o)return o;if((s==="customError"||!i)&&e.validationMessage)return e.validationMessage;break}else if(!this.#p()){let s=r("valueMissing");if(s)return s}return this.#n||e.validationMessage||this.getAttribute("data-message-invalid")||b}#p(){let t=this.#t;if(this.#e.length)return this.#e.some(i=>i.checked);if(t instanceof HTMLInputElement&&t.type==="checkbox")return t.checked;let e=t.value;return Array.isArray(e)?e.length>0:!a(t)&&e===0?!1:e!=null&&String(e)!==""}#A(){let t=this.#t,e=this.querySelector('.otp-wrapper[role="group"]');return e?[e]:this.#e.length?this.#e.filter(i=>this.contains(i)):a(t)?[t]:[t.querySelector('[role="combobox"], fieldset, input:not([type="hidden"]):not([aria-hidden="true"]), textarea, select')??t]}#l(t){let e=[...this.querySelectorAll(y)];e.forEach((o,l)=>{o.id||(o.id=`${this.#d}-hint${l?`-${l}`:""}`)});let i=this.#i;i&&!i.id&&(i.id=`${this.#d}-error`);let r=new Set([...e.map(o=>o.id),...i?[i.id]:[]]),s=[...e.map(o=>o.id),...t&&i?[i.id]:[]];for(let o of this.#A()){let l=(o.getAttribute("aria-describedby")??"").split(/\s+/).filter(h=>h&&!r.has(h)),d=[...new Set([...l,...s])];d.length?o.setAttribute("aria-describedby",d.join(" ")):o.removeAttribute("aria-describedby"),t?o.setAttribute("aria-invalid","true"):o.removeAttribute("aria-invalid")}}#c(t){delete this.dataset.valid,delete this.dataset.invalid,t&&(this.dataset[t]="")}#u(t){this.#i&&(this.#i.textContent=t)}};m("form-field",u);export{u as FormField};
1
+ var $=window.matchMedia("(prefers-reduced-motion: reduce)");var h=new Map;function p(s,t,e={}){let r=e.priority??10,n={impl:t,bundle:e.bundle,contract:e.contract,priority:r},i=h.get(s);if(customElements.get(s)){if(!i||i.priority>=r){i&&i.priority===r&&i.impl!==t&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=r){i.priority===r&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${i.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}h.set(s,n),customElements.define(s,t)}var l=class extends HTMLElement{#t=[];#e;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,r,n){t.addEventListener(e,r,n),this.#t.push(()=>t.removeEventListener(e,r,n))}_reinit(){for(let t of this.#t)t();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,e){this.#e||(this.#e=this.attachInternals());let r=this.#e.states;try{e?r.add(t):r.delete(t)}catch{let n=`--${t}`;e?r.add(n):r.delete(n)}}_adoptInternals(t){this.#e||(this.#e=t)}#r(){return this.constructor.formAssociated&&this.#e?this.#e:null}get validity(){return this.#r()?.validity}get validationMessage(){return this.#r()?.validationMessage??""}get willValidate(){return this.#r()?.willValidate??!1}get form(){return this.#r()?.form??null}checkValidity(){return this.#r()?.checkValidity()??!0}reportValidity(){return this.#r()?.reportValidity()??!0}};var b=["valueMissing","badInput","typeMismatch","patternMismatch","tooShort","tooLong","rangeUnderflow","rangeOverflow","stepMismatch","customError"],v='input:not([type="hidden"]):not(.otp-digit), textarea, select',y="output.hint, output.textarea-counter",g="Please check this field.",E=0;function m(s){return s.localName.includes("-")?!!customElements.get(s.localName)?.formAssociated:!1}function a(s){return s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||s instanceof HTMLSelectElement}var d=class extends l{#t=null;#e=[];#r=null;#n=!1;#i="";#s;#u=`ff-${++E}`;setup(){if(this.#y(),this.#t=this.#v(),this.#r=this.querySelector("output.error")??this.querySelector("output:not(.hint):not(.textarea-counter)"),!this.#t)return!1;this.#r&&this.#s===void 0&&(this.#s=this.#r.textContent?.trim()??"",this.hasAttribute("data-invalid")||(this.#r.textContent=""));let t=this.#t;this.#e=[],t instanceof HTMLInputElement&&t.type==="radio"&&(this.#e=this.#g(t));let e=this.#e.length?this.#e:[t];for(let n of e)this.listen(n,"input",this.#o),this.listen(n,"change",this.#o),this.listen(n,"invalid",this.#b);a(t)||this.listen(t,`${t.localName}:change`,this.#o),this.listen(this,"focusout",n=>{let i=n.relatedTarget;i instanceof Node&&this.contains(i)||this.validate()});let r=t.form??this.closest("form");return r instanceof HTMLFormElement&&this.listen(r,"reset",n=>{setTimeout(()=>{!n.defaultPrevented&&this.isConnected&&this.clearError()})}),this.#c(this.hasAttribute("data-invalid")),!0}teardown(){this.#t=null,this.#e=[],this.#r=null}validate({show:t=!0}={}){if(!this.#t)return!0;let{valid:e,message:r}=this.#E();return t&&(e?(this.#l(this.#m()?"valid":null),this.#d("")):(this.#n=!0,this.#l("invalid"),this.#d(r)),this.#c(!e)),e}setError(t){if(!this.#t)return;this.#i=t;let e=this.#f();e&&e.setCustomValidity(t),this.validate()}clearError(){this.#t&&(this.#h(),this.#n=!1,this.#l(null),this.#d(""),this.#c(!1))}get fieldName(){return this.querySelector("label, legend")?.textContent?.trim()||this.#t?.getAttribute?.("aria-label")||this.#t?.getAttribute?.("name")||this.#t?.id||"Field"}get input(){return this.#t}#o=()=>{this.#i&&this.#h(),this.#n&&this.validate()};#a=!1;#b=()=>{if(!this.#a){this.#a=!0;try{this.validate()}finally{this.#a=!1}}};#v(){for(let t of this.querySelectorAll("*"))if(m(t))return t;return this.querySelector(v)}#y(){for(let t of this.querySelectorAll(":not(:defined)"))t.localName.includes("-")&&customElements.whenDefined(t.localName).then(()=>{!this.isConnected||!this.contains(t)||this.#t===t||m(t)&&this._reinit()})}#g(t){return t.name?(t.form?[...t.form.elements]:[...t.getRootNode().querySelectorAll('input[type="radio"]')].filter(r=>!r.form)).filter(r=>r instanceof HTMLInputElement&&r.type==="radio"&&r.name===t.name):[t]}#f(){let t=this.#t;return t&&a(t)?t:null}#h(){let t=this.#f();t&&t.validity.customError&&t.validationMessage===this.#i&&t.setCustomValidity(""),this.#i=""}#E(){let t=this.#t;if(this.#i)return{valid:!1,message:this.#i};let e=t.validity;if(e)return e.valid?{valid:!0,message:""}:{valid:!1,message:this.#p(e)};let r=t.matches(":invalid");return{valid:!r,message:r?this.#p(null):""}}#p(t){let e=this.#t,r=a(e),n=i=>e.getAttribute(`data-message-${i.toLowerCase()}`)??(r?null:this.getAttribute(`data-message-${i.toLowerCase()}`));if(t)for(let i of b){if(!t[i])continue;let o=n(i);if(o)return o;if((i==="customError"||!r)&&e.validationMessage)return e.validationMessage;break}else if(!this.#m()){let i=n("valueMissing");if(i)return i}return this.#s||e.validationMessage||this.getAttribute("data-message-invalid")||g}#m(){let t=this.#t;if(this.#e.length)return this.#e.some(r=>r.checked);if(t instanceof HTMLInputElement&&t.type==="checkbox")return t.checked;let e=t.value;return Array.isArray(e)?e.length>0:!a(t)&&e===0?!1:e!=null&&String(e)!==""}#A(){let t=this.#t,e=this.querySelector('.otp-wrapper[role="group"]');return e?[e]:this.#e.length?this.#e.filter(r=>this.contains(r)):a(t)?[t]:[t.querySelector('[role="combobox"], fieldset, input:not([type="hidden"]):not([aria-hidden="true"]), textarea, select')??t]}#c(t){let e=[...this.querySelectorAll(y)];e.forEach((o,c)=>{o.id||(o.id=`${this.#u}-hint${c?`-${c}`:""}`)});let r=this.#r;r&&!r.id&&(r.id=`${this.#u}-error`);let n=new Set([...e.map(o=>o.id),...r?[r.id]:[]]),i=[...e.map(o=>o.id),...t&&r?[r.id]:[]];for(let o of this.#A()){let c=(o.getAttribute("aria-describedby")??"").split(/\s+/).filter(f=>f&&!n.has(f)),u=[...new Set([...c,...i])];u.length?o.setAttribute("aria-describedby",u.join(" ")):o.removeAttribute("aria-describedby"),t?o.setAttribute("aria-invalid","true"):o.removeAttribute("aria-invalid")}}#l(t){delete this.dataset.valid,delete this.dataset.invalid,t&&(this.dataset[t]="")}#d(t){this.#r&&(this.#r.textContent=t)}};p("form-field",d);export{d as FormField};
2
2
  //# sourceMappingURL=form-field.js.map
@@ -1,4 +1,4 @@
1
- var _=Object.defineProperty;var L=(n,t)=>()=>(n&&(t=n(n=0)),t);var q=(n,t)=>{for(var e in t)_(n,e,{get:t[e],enumerable:!0})};function F(n,t,e){let r=256*Math.pow(2,e),o=n/r*360-180;return{lat:Math.atan(Math.sinh(Math.PI*(1-2*t/r)))*180/Math.PI,lng:o}}function x(n,t,e){let r=256*Math.pow(2,e),o=n*Math.PI/180;return{x:(t+180)/360*r,y:(1-Math.log(Math.tan(o)+1/Math.cos(o))/Math.PI)/2*r}}function V(n,t,e,r,o){let i=o??(typeof devicePixelRatio=="number"?devicePixelRatio:1),s="abc"[Math.abs(e+r)%3];return n.replaceAll("{z}",String(t)).replaceAll("{x}",String(e)).replaceAll("{y}",String(r)).replaceAll("{s}",s).replaceAll("{r}",i>1?"@2x":"")}function S(n,t,e,r,o){let i=o||(v[n]??v.osm).template;return V(i,t,e,r)}var v,z=L(()=>{v={osm:{template:"https://tile.openstreetmap.org/{z}/{x}/{y}.png",origin:"https://tile.openstreetmap.org",credits:[{text:"\xA9 OpenStreetMap contributors",href:"https://www.openstreetmap.org/copyright"}]},"carto-light":{template:"https://basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png",origin:"https://basemaps.cartocdn.com",credits:[{text:"\xA9 OpenStreetMap contributors",href:"https://www.openstreetmap.org/copyright"},{text:"\xA9 CARTO",href:"https://carto.com/attributions"}]},"carto-dark":{template:"https://basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",origin:"https://basemaps.cartocdn.com",credits:[{text:"\xA9 OpenStreetMap contributors",href:"https://www.openstreetmap.org/copyright"},{text:"\xA9 CARTO",href:"https://carto.com/attributions"}]}}});var B={};q(B,{MapInteraction:()=>E});var E,I=L(()=>{z();E=class{#t;#i;#r;#S;#N;#L;#T;#A;#a=0;#e=0;#s=15;#h=1;#b=19;#d=0;#m=0;#v=0;#y=0;#$=15;#c=0;#n=0;#o=new Map;#f=0;#x=0;#l=new Map;#k=0;#p=0;constructor({host:t,viewport:e,tiles:r,marker:o,lat:i,lng:s,zoom:l,provider:c,tileUrl:h,width:a,height:d,onDeactivate:g,onMove:p}){this.#A=t,this.#t=e,this.#i=r,this.#r=o,this.#S=c,this.#N=h||"",this.#L=g,this.#T=p||(()=>{}),this.#s=l,this.#v=this.#f=i,this.#y=this.#x=s,this.#$=l,this.#c=a,this.#n=d;let b=x(i,s,l);this.#a=b.x,this.#e=b.y,this.#z(),this.#i.replaceChildren(),this.#i.style.transform="",this.#r&&this.#i.appendChild(this.#r),this.#t.addEventListener("pointerdown",this.#R),this.#t.addEventListener("pointermove",this.#B),this.#t.addEventListener("pointerup",this.#E),this.#t.addEventListener("pointercancel",this.#E),this.#t.addEventListener("wheel",this.#F,{passive:!1}),this.#t.addEventListener("keydown",this.#O),this.#u()}get zoom(){return this.#s}get minZoom(){return this.#h}get maxZoom(){return this.#b}get center(){let{lat:t,lng:e}=F(this.#a,this.#e,this.#s);return{lat:+t.toFixed(6),lng:+e.toFixed(6),zoom:this.#s}}zoomBy(t){this.#g(this.#s+t,this.#c/2,this.#n/2)}recenter(){this.#s=this.#$;let t=x(this.#v,this.#y,this.#s);this.#a=t.x,this.#e=t.y,this.#M(),this.#z(),this.#w(),this.#u(),this.#C()}panBy(t,e){this.#a+=t,this.#e+=e,this.#w(),this.#u()}resize(t,e){!t||!e||t===this.#c&&e===this.#n||(this.#c=t,this.#n=e,this.#w(),this.#u())}#z(){this.#d=Math.floor(this.#a/256)*256,this.#m=Math.floor(this.#e/256)*256}#R=t=>{if(!(t.pointerType==="mouse"&&t.button!==0)&&!t.target.closest?.("a, button")){t.preventDefault(),this.#t.focus({preventScroll:!0}),this.#l.set(t.pointerId,{x:t.clientX,y:t.clientY});try{this.#t.setPointerCapture(t.pointerId)}catch{}this.#l.size===1?(this.#k=0,this.#t.setAttribute("data-dragging","")):this.#l.size===2&&(this.#p=this.#I(),this.#k=1/0)}};#B=t=>{let e=this.#l.get(t.pointerId);if(!e)return;let r=t.clientX-e.x,o=t.clientY-e.y;if(e.x=t.clientX,e.y=t.clientY,this.#l.size===1){this.#k+=Math.abs(r)+Math.abs(o),this.panBy(-r,-o);return}if(this.#l.size===2){this.panBy(-r/2,-o/2);let i=this.#I();if(!this.#p){this.#p=i;return}let s=i/this.#p;if(s>=1.5||s<=1/1.5){let l=this.#D();this.#g(this.#s+(s>1?1:-1),l.x,l.y),this.#p=i}}};#E=t=>{if(!this.#l.has(t.pointerId))return;let e=this.#l.size===1;this.#l.delete(t.pointerId);try{this.#t.releasePointerCapture(t.pointerId)}catch{}if(this.#l.size<2&&(this.#p=0),!(this.#l.size>0)){if(this.#t.removeAttribute("data-dragging"),e&&t.type==="pointerup"&&this.#k<5){let r=this.#t.getBoundingClientRect();this.panBy(t.clientX-r.left-this.#c/2,t.clientY-r.top-this.#n/2)}this.#C()}};#I(){let[t,e]=[...this.#l.values()];return t&&e?Math.hypot(t.x-e.x,t.y-e.y):0}#D(){let[t,e]=[...this.#l.values()],r=this.#t.getBoundingClientRect();return{x:(t.x+e.x)/2-r.left,y:(t.y+e.y)/2-r.top}}#F=t=>{t.preventDefault();let e=t.ctrlKey?-t.deltaY*.01:-Math.sign(t.deltaY),r=Math.round(Math.max(this.#h,Math.min(this.#b,this.#s+e)));if(r===this.#s)return;let o=this.#t.getBoundingClientRect();this.#g(r,t.clientX-o.left,t.clientY-o.top)};#O=t=>{if(t.target!==this.#t)return;let e=80,r=null;switch(t.key){case"ArrowLeft":r=[-e,0];break;case"ArrowRight":r=[e,0];break;case"ArrowUp":r=[0,-e];break;case"ArrowDown":r=[0,e];break;case"+":case"=":t.preventDefault(),this.zoomBy(1);return;case"-":case"_":t.preventDefault(),this.zoomBy(-1);return;case"Home":case"0":t.preventDefault(),this.recenter();return;case"Escape":t.preventDefault(),this.#L();return;default:return}t.preventDefault(),this.panBy(r[0],r[1]),this.#C()};#g(t,e,r){if(t=Math.max(this.#h,Math.min(this.#b,t)),t===this.#s)return;let o=this.#a-this.#c/2+e,i=this.#e-this.#n/2+r,s=Math.pow(2,t-this.#s);this.#a=o*s-e+this.#c/2,this.#e=i*s-r+this.#n/2,this.#s=t,this.#M(),this.#w(),this.#z(),this.#u(),this.#C()}#w(){let t=256*Math.pow(2,this.#s),e=(this.#a%t+t)%t;e!==this.#a&&(this.#a=e,this.#M(),this.#z());let r=Math.min(this.#n/2,t/2);this.#e=Math.max(r,Math.min(t-r,this.#e))}#u(){let t=-(this.#a-this.#c/2-this.#d),e=-(this.#e-this.#n/2-this.#m);this.#i.style.transform=`translate(${Math.round(t)}px, ${Math.round(e)}px)`,this.#_(),this.#q(),this.#P()}#_(){let t=this.#s,e=Math.pow(2,t),r=this.#a-this.#c/2,o=this.#e-this.#n/2,i=Math.floor(r/256)-1,s=Math.max(0,Math.floor(o/256)-1),l=Math.ceil((r+this.#c)/256)+1,c=Math.min(e,Math.ceil((o+this.#n)/256)+1);for(let h=s;h<c;h++)for(let a=i;a<l;a++){let d=(a%e+e)%e,g=`${t}/${a}/${h}`;if(this.#o.has(g))continue;let p=document.createElement("img");p.src=S(this.#S,t,d,h,this.#N),p.alt="",p.draggable=!1,p.style.left=`${a*256-this.#d}px`,p.style.top=`${h*256-this.#m}px`,p._wx=a*256,p._wy=h*256,this.#o.set(g,p),this.#i.insertBefore(p,this.#r?.parentNode===this.#i?this.#r:null)}}#q(){let t=this.#a-this.#c/2,e=this.#e-this.#n/2,r=512;for(let[o,i]of this.#o){let s=i._wx??0,l=i._wy??0;(s+256<t-r||s>t+this.#c+r||l+256<e-r||l>e+this.#n+r)&&(i.remove(),this.#o.delete(o))}}#P(){if(!this.#r)return;let t=x(this.#f,this.#x,this.#s),e=this.#r.offsetWidth||32,r=256*Math.pow(2,this.#s),o=t.x;for(;o-this.#a>r/2;)o-=r;for(;this.#a-o>r/2;)o+=r;this.#r.style.top=`${Math.round(t.y-this.#m-e)}px`,this.#r.style.left=`${Math.round(o-this.#d-e/2)}px`,this.#r.style.transform="none"}#C(){let t=this.center;this.#A.dispatchEvent(new CustomEvent("geo-map:move",{bubbles:!0,detail:t})),this.#T(t)}#M(){for(let t of this.#o.values())t.remove();this.#o.clear()}destroy(){this.#t.removeEventListener("pointerdown",this.#R),this.#t.removeEventListener("pointermove",this.#B),this.#t.removeEventListener("pointerup",this.#E),this.#t.removeEventListener("pointercancel",this.#E),this.#t.removeEventListener("wheel",this.#F),this.#t.removeEventListener("keydown",this.#O),this.#t.removeAttribute("data-dragging"),this.#l.clear(),this.#M()}}});var M=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 t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,r,o){t.addEventListener(e,r,o),this.#t.push(()=>t.removeEventListener(e,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,e){this.#i||(this.#i=this.attachInternals());let r=this.#i.states;try{e?r.add(t):r.delete(t)}catch{let o=`--${t}`;e?r.add(o):r.delete(o)}}_adoptInternals(t){this.#i||(this.#i=t)}#r(){return this.constructor.formAssociated&&this.#i?this.#i:null}get validity(){return this.#r()?.validity}get validationMessage(){return this.#r()?.validationMessage??""}get willValidate(){return this.#r()?.willValidate??!1}get form(){return this.#r()?.form??null}checkValidity(){return this.#r()?.checkValidity()??!0}reportValidity(){return this.#r()?.reportValidity()??!0}};var T=`
1
+ var q=Object.defineProperty;var $=(s,t)=>()=>(s&&(t=s(s=0)),t);var D=(s,t)=>{for(var e in t)q(s,e,{get:t[e],enumerable:!0})};function F(s,t,e){let r=256*Math.pow(2,e),o=s/r*360-180;return{lat:Math.atan(Math.sinh(Math.PI*(1-2*t/r)))*180/Math.PI,lng:o}}function w(s,t,e){let r=256*Math.pow(2,e),o=s*Math.PI/180;return{x:(t+180)/360*r,y:(1-Math.log(Math.tan(o)+1/Math.cos(o))/Math.PI)/2*r}}function H(s,t,e,r,o){let i=o??(typeof devicePixelRatio=="number"?devicePixelRatio:1),n="abc"[Math.abs(e+r)%3];return s.replaceAll("{z}",String(t)).replaceAll("{x}",String(e)).replaceAll("{y}",String(r)).replaceAll("{s}",n).replaceAll("{r}",i>1?"@2x":"")}function A(s,t,e,r,o){let i=o||(v[s]??v.osm).template;return H(i,t,e,r)}var v,M=$(()=>{v={osm:{template:"https://tile.openstreetmap.org/{z}/{x}/{y}.png",origin:"https://tile.openstreetmap.org",credits:[{text:"\xA9 OpenStreetMap contributors",href:"https://www.openstreetmap.org/copyright"}]},"carto-light":{template:"https://basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png",origin:"https://basemaps.cartocdn.com",credits:[{text:"\xA9 OpenStreetMap contributors",href:"https://www.openstreetmap.org/copyright"},{text:"\xA9 CARTO",href:"https://carto.com/attributions"}]},"carto-dark":{template:"https://basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",origin:"https://basemaps.cartocdn.com",credits:[{text:"\xA9 OpenStreetMap contributors",href:"https://www.openstreetmap.org/copyright"},{text:"\xA9 CARTO",href:"https://carto.com/attributions"}]}}});var _={};D(_,{MapInteraction:()=>C});var C,N=$(()=>{M();C=class{#t;#i;#r;#A;#L;#$;#T;#E;#a=0;#e=0;#n=15;#h=1;#b=19;#d=0;#f=0;#v=0;#y=0;#P=15;#c=0;#s=0;#o=new Map;#m=0;#w=0;#l=new Map;#x=0;#u=0;constructor({host:t,viewport:e,tiles:r,marker:o,lat:i,lng:n,zoom:l,provider:c,tileUrl:h,width:a,height:d,onDeactivate:g,onMove:u}){this.#E=t,this.#t=e,this.#i=r,this.#r=o,this.#A=c,this.#L=h||"",this.#$=g,this.#T=u||(()=>{}),this.#n=l,this.#v=this.#m=i,this.#y=this.#w=n,this.#P=l,this.#c=a,this.#s=d;let b=w(i,n,l);this.#a=b.x,this.#e=b.y,this.#M(),this.#i.replaceChildren(),this.#i.style.transform="",this.#r&&this.#i.appendChild(this.#r),this.#t.addEventListener("pointerdown",this.#R),this.#t.addEventListener("pointermove",this.#_),this.#t.addEventListener("pointerup",this.#C),this.#t.addEventListener("pointercancel",this.#C),this.#t.addEventListener("wheel",this.#F,{passive:!1}),this.#t.addEventListener("keydown",this.#I),this.#p()}get zoom(){return this.#n}get minZoom(){return this.#h}get maxZoom(){return this.#b}get center(){let{lat:t,lng:e}=F(this.#a,this.#e,this.#n);return{lat:+t.toFixed(6),lng:+e.toFixed(6),zoom:this.#n}}zoomBy(t){this.#g(this.#n+t,this.#c/2,this.#s/2)}recenter(){this.#n=this.#P;let t=w(this.#v,this.#y,this.#n);this.#a=t.x,this.#e=t.y,this.#S(),this.#M(),this.#k(),this.#p(),this.#z()}panBy(t,e){this.#a+=t,this.#e+=e,this.#k(),this.#p()}resize(t,e){!t||!e||t===this.#c&&e===this.#s||(this.#c=t,this.#s=e,this.#k(),this.#p())}#M(){this.#d=Math.floor(this.#a/256)*256,this.#f=Math.floor(this.#e/256)*256}#R=t=>{if(!(t.pointerType==="mouse"&&t.button!==0)&&!t.target.closest?.("a, button")){t.preventDefault(),this.#t.focus({preventScroll:!0}),this.#l.set(t.pointerId,{x:t.clientX,y:t.clientY});try{this.#t.setPointerCapture(t.pointerId)}catch{}this.#l.size===1?(this.#x=0,this.#t.setAttribute("data-dragging","")):this.#l.size===2&&(this.#u=this.#N(),this.#x=1/0)}};#_=t=>{let e=this.#l.get(t.pointerId);if(!e)return;let r=t.clientX-e.x,o=t.clientY-e.y;if(e.x=t.clientX,e.y=t.clientY,this.#l.size===1){this.#x+=Math.abs(r)+Math.abs(o),this.panBy(-r,-o);return}if(this.#l.size===2){this.panBy(-r/2,-o/2);let i=this.#N();if(!this.#u){this.#u=i;return}let n=i/this.#u;if(n>=1.5||n<=1/1.5){let l=this.#O();this.#g(this.#n+(n>1?1:-1),l.x,l.y),this.#u=i}}};#C=t=>{if(!this.#l.has(t.pointerId))return;let e=this.#l.size===1;this.#l.delete(t.pointerId);try{this.#t.releasePointerCapture(t.pointerId)}catch{}if(this.#l.size<2&&(this.#u=0),!(this.#l.size>0)){if(this.#t.removeAttribute("data-dragging"),e&&t.type==="pointerup"&&this.#x<5){let r=this.#t.getBoundingClientRect();this.panBy(t.clientX-r.left-this.#c/2,t.clientY-r.top-this.#s/2)}this.#z()}};#N(){let[t,e]=[...this.#l.values()];return t&&e?Math.hypot(t.x-e.x,t.y-e.y):0}#O(){let[t,e]=[...this.#l.values()],r=this.#t.getBoundingClientRect();return{x:(t.x+e.x)/2-r.left,y:(t.y+e.y)/2-r.top}}#F=t=>{t.preventDefault();let e=t.ctrlKey?-t.deltaY*.01:-Math.sign(t.deltaY),r=Math.round(Math.max(this.#h,Math.min(this.#b,this.#n+e)));if(r===this.#n)return;let o=this.#t.getBoundingClientRect();this.#g(r,t.clientX-o.left,t.clientY-o.top)};#I=t=>{if(t.target!==this.#t)return;let e=80,r=null;switch(t.key){case"ArrowLeft":r=[-e,0];break;case"ArrowRight":r=[e,0];break;case"ArrowUp":r=[0,-e];break;case"ArrowDown":r=[0,e];break;case"+":case"=":t.preventDefault(),this.zoomBy(1);return;case"-":case"_":t.preventDefault(),this.zoomBy(-1);return;case"Home":case"0":t.preventDefault(),this.recenter();return;case"Escape":t.preventDefault(),this.#$();return;default:return}t.preventDefault(),this.panBy(r[0],r[1]),this.#z()};#g(t,e,r){if(t=Math.max(this.#h,Math.min(this.#b,t)),t===this.#n)return;let o=this.#a-this.#c/2+e,i=this.#e-this.#s/2+r,n=Math.pow(2,t-this.#n);this.#a=o*n-e+this.#c/2,this.#e=i*n-r+this.#s/2,this.#n=t,this.#S(),this.#k(),this.#M(),this.#p(),this.#z()}#k(){let t=256*Math.pow(2,this.#n),e=(this.#a%t+t)%t;e!==this.#a&&(this.#a=e,this.#S(),this.#M());let r=Math.min(this.#s/2,t/2);this.#e=Math.max(r,Math.min(t-r,this.#e))}#p(){let t=-(this.#a-this.#c/2-this.#d),e=-(this.#e-this.#s/2-this.#f);this.#i.style.transform=`translate(${Math.round(t)}px, ${Math.round(e)}px)`,this.#q(),this.#D(),this.#B()}#q(){let t=this.#n,e=Math.pow(2,t),r=this.#a-this.#c/2,o=this.#e-this.#s/2,i=Math.floor(r/256)-1,n=Math.max(0,Math.floor(o/256)-1),l=Math.ceil((r+this.#c)/256)+1,c=Math.min(e,Math.ceil((o+this.#s)/256)+1);for(let h=n;h<c;h++)for(let a=i;a<l;a++){let d=(a%e+e)%e,g=`${t}/${a}/${h}`;if(this.#o.has(g))continue;let u=document.createElement("img");u.src=A(this.#A,t,d,h,this.#L),u.alt="",u.draggable=!1,u.style.left=`${a*256-this.#d}px`,u.style.top=`${h*256-this.#f}px`,u._wx=a*256,u._wy=h*256,this.#o.set(g,u),this.#i.insertBefore(u,this.#r?.parentNode===this.#i?this.#r:null)}}#D(){let t=this.#a-this.#c/2,e=this.#e-this.#s/2,r=512;for(let[o,i]of this.#o){let n=i._wx??0,l=i._wy??0;(n+256<t-r||n>t+this.#c+r||l+256<e-r||l>e+this.#s+r)&&(i.remove(),this.#o.delete(o))}}#B(){if(!this.#r)return;let t=w(this.#m,this.#w,this.#n),e=this.#r.offsetWidth||32,r=256*Math.pow(2,this.#n),o=t.x;for(;o-this.#a>r/2;)o-=r;for(;this.#a-o>r/2;)o+=r;this.#r.style.top=`${Math.round(t.y-this.#f-e)}px`,this.#r.style.left=`${Math.round(o-this.#d-e/2)}px`,this.#r.style.transform="none"}#z(){let t=this.center;this.#E.dispatchEvent(new CustomEvent("geo-map:move",{bubbles:!0,detail:t})),this.#T(t)}#S(){for(let t of this.#o.values())t.remove();this.#o.clear()}destroy(){this.#t.removeEventListener("pointerdown",this.#R),this.#t.removeEventListener("pointermove",this.#_),this.#t.removeEventListener("pointerup",this.#C),this.#t.removeEventListener("pointercancel",this.#C),this.#t.removeEventListener("wheel",this.#F),this.#t.removeEventListener("keydown",this.#I),this.#t.removeAttribute("data-dragging"),this.#l.clear(),this.#S()}}});var S=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 t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,r,o){t.addEventListener(e,r,o),this.#t.push(()=>t.removeEventListener(e,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,e){this.#i||(this.#i=this.attachInternals());let r=this.#i.states;try{e?r.add(t):r.delete(t)}catch{let o=`--${t}`;e?r.add(o):r.delete(o)}}_adoptInternals(t){this.#i||(this.#i=t)}#r(){return this.constructor.formAssociated&&this.#i?this.#i:null}get validity(){return this.#r()?.validity}get validationMessage(){return this.#r()?.validationMessage??""}get willValidate(){return this.#r()?.willValidate??!1}get form(){return this.#r()?.form??null}checkValidity(){return this.#r()?.checkValidity()??!0}reportValidity(){return this.#r()?.reportValidity()??!0}};var T=`
2
2
  :host {
3
3
  display: block;
4
4
  position: relative;
@@ -198,7 +198,7 @@ var _=Object.defineProperty;var L=(n,t)=>()=>(n&&(t=n(n=0)),t);var q=(n,t)=>{for
198
198
 
199
199
  [part="container"][data-consent] [part="activate"] {
200
200
  background: var(--color-interactive, var(--color-primary, #1a5fb4));
201
- color: var(--color-text-on-primary, var(--color-text-inverted, #fff));
201
+ color: var(--color-text-on-interactive, var(--color-text-inverted, #fff));
202
202
  }
203
203
 
204
204
  [part="container"][data-consent] [part="marker"] {
@@ -312,5 +312,5 @@ var _=Object.defineProperty;var L=(n,t)=>()=>(n&&(t=n(n=0)),t);var q=(n,t)=>{for
312
312
  border: 1px solid ButtonText;
313
313
  }
314
314
  }
315
- `,k=null;function $(n){if("adoptedStyleSheets"in n&&typeof CSSStyleSheet=="function"&&"replaceSync"in CSSStyleSheet.prototype)return k||(k=new CSSStyleSheet,k.replaceSync(T)),n.adoptedStyleSheets.includes(k)||(n.adoptedStyleSheets=[...n.adoptedStyleSheets,k]),null;let t=document.createElement("style");return t.textContent=T,t}z();var Z=window.matchMedia("(prefers-reduced-motion: reduce)");var P=new Map;function R(n,t,e={}){let r=e.priority??10,o={impl:t,bundle:e.bundle,contract:e.contract,priority:r},i=P.get(n);if(customElements.get(n)){if(!i||i.priority>=r){i&&i.priority===r&&i.impl!==t&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${n}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=r){i.priority===r&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${i.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}P.set(n,o),customElements.define(n,t)}var C="http://www.w3.org/2000/svg",U={map:"Map","map-of":"Map of {name}",activate:"Activate interactive map",consent:"Load map","consent-note":"Loads map images from {host}","zoom-in":"Zoom in","zoom-out":"Zoom out",recenter:"Recenter map",exit:"Exit map",controls:"Map controls",instructions:"Drag or use the arrow keys to pan. Click a point to centre on it. Pinch, scroll, or press plus and minus to zoom. Home recentres. Escape exits.",moved:"Map centred on {lat}, {lng}, zoom {zoom}","error-coords":"Map location unavailable","error-tiles":"Map images failed to load"},W=0;function Y(){let n=document.createElement("div");n.setAttribute("part","marker"),n.setAttribute("aria-hidden","true");let t=document.createElementNS(C,"svg");t.setAttribute("viewBox","0 0 24 36"),t.setAttribute("focusable","false");let e=document.createElementNS(C,"path");e.setAttribute("class","pin"),e.setAttribute("d","M12 0C5.373 0 0 5.373 0 12c0 9 12 24 12 24s12-15 12-24C24 5.373 18.627 0 12 0z");let r=document.createElementNS(C,"circle");return r.setAttribute("class","dot"),r.setAttribute("cx","12"),r.setAttribute("cy","12"),r.setAttribute("r","5"),t.append(e,r),n.append(t),n}function u(n,t={},e){let r=document.createElement(n);for(let[o,i]of Object.entries(t))r.setAttribute(o,i);return e!=null&&(r.textContent=e),r}function O(n){return!n||typeof n!="string"?!1:typeof CSS<"u"&&CSS.supports("color",n)}var N=class extends M{static get observedAttributes(){return["lat","lng","zoom","marker","marker-color","provider","tile-url","interactive","static-only","src","place","label","attribution","attribution-href","loading"]}#t=null;#i=null;#r=0;#S=!1;#N=!1;#L=!1;#T=!1;#A=!1;#a=`geo-map-${++W}`;#e=null;#s="";#h=new Map;#b="";#d=null;#m=0;#v=null;#y=null;#$=()=>this.#F();#c=0;#n="osm";constructor(){super(),this.attachShadow({mode:"open"})}get lat(){return parseFloat(this.getAttribute("lat")??"")}get lng(){return parseFloat(this.getAttribute("lng")??"")}get zoom(){let t=parseInt(this.getAttribute("zoom")??"",10);return t>=1&&t<=19?t:15}get showMarker(){return this.getAttribute("marker")!=="false"}get markerColor(){let t=this.getAttribute("marker-color");return O(t)?t:""}get provider(){let t=this.getAttribute("provider");return t&&(t in v||t==="carto-auto")?t:"osm"}get tileUrl(){return this.getAttribute("tile-url")||""}get interactive(){let t=this.getAttribute("interactive");return t==="eager"||t==="none"?t:"click"}get staticOnly(){return this.hasAttribute("static-only")}get loading(){let t=this.getAttribute("loading");return t==="eager"||t==="consent"?t:"lazy"}get active(){return this.#t!==null}#o(t,e={}){return(this.getAttribute(`data-label-${t}`)??U[t]??"").replace(/\{(\w+)\}/g,(o,i)=>i in e?String(e[i]):o)}get#f(){return this.interactive!=="none"&&!this.staticOnly}get#x(){return this.loading==="consent"&&!this.#N}#l(){let t=this.provider;if(t!=="carto-auto")return t;let e=this.closest("[data-mode]")?.getAttribute("data-mode");return e==="dark"?"carto-dark":e==="light"?"carto-light":window.matchMedia?.("(prefers-color-scheme: dark)").matches?"carto-dark":"carto-light"}#k(){if(this.tileUrl)try{return new URL(this.tileUrl.replace(/\{s\}/g,"a"),location.href).origin}catch{return""}return(v[this.#n]??v.osm).origin}#p(){let t=parseFloat(this.getAttribute("lat")??""),e=parseFloat(this.getAttribute("lng")??"");if(!isNaN(t)&&!isNaN(e))return{lat:t,lng:e};let r=this.getAttribute("src");if(r){let l=this.#z(r);if(l)return l}let o=this.querySelector("address[data-lat][data-lng]");if(o){let l=parseFloat(o.dataset.lat??""),c=parseFloat(o.dataset.lng??"");if(!isNaN(l)&&!isNaN(c))return{lat:l,lng:c}}let i=this.getAttribute("place");if(i){let l=this.#R(i);if(l)return l}let s=document.querySelector('meta[name="geo.position"]');if(s){let c=(s.getAttribute("content")||"").split(";");if(c.length===2){let h=parseFloat(c[0]),a=parseFloat(c[1]);if(!isNaN(h)&&!isNaN(a))return{lat:h,lng:a}}}return null}#z(t){let e=document.getElementById(t);if(!e)return null;if(e.tagName==="ADDRESS"&&e.dataset.lat&&e.dataset.lng){let r=parseFloat(e.dataset.lat),o=parseFloat(e.dataset.lng);if(!isNaN(r)&&!isNaN(o))return{lat:r,lng:o}}return e.tagName==="SCRIPT"&&e.type==="application/ld+json"?this.#B(e):null}#R(t){let e=document.querySelectorAll('script[type="application/ld+json"]');for(let r of e)try{let o=JSON.parse(r.textContent);if(o.name===t){let i=o.geo;if(i){let s=parseFloat(i.latitude),l=parseFloat(i.longitude);if(!isNaN(s)&&!isNaN(l))return{lat:s,lng:l}}}}catch{}return null}#B(t){try{let r=JSON.parse(t.textContent).geo;if(r){let o=parseFloat(r.latitude),i=parseFloat(r.longitude);if(!isNaN(o)&&!isNaN(i))return{lat:o,lng:i}}}catch{}return null}#E(){let t=i=>(i||"").replace(/\s+/g," ").trim(),e=t(this.getAttribute("label"));if(e)return e;let r=t(this.querySelector("address")?.textContent),o=this.getAttribute("src");if(!r&&o){let i=document.getElementById(o);if(i?.tagName==="ADDRESS")r=t(i.textContent);else if(i?.tagName==="SCRIPT")try{r=t(JSON.parse(i.textContent||"").name)}catch{}}return r||(r=t(this.getAttribute("place"))),r?this.#o("map-of",{name:r}):this.#o("map")}setup(){if(this.#r++,this.#n=this.#l(),this.render(),this.#I(),this.#D(),this.#w(),this.interactive==="eager"&&!this.#L&&this.#f&&!this.#x&&this.#e){let t=this.#r;requestAnimationFrame(()=>{t===this.#r&&this.#P({focus:!1})})}}attributeChangedCallback(t,e,r){e===r||this.#S||!this.isConnected||!this.hasAttribute("data-upgraded")||this._reinit()}teardown(){this.#r++,this.#i=null,this.#t&&(this.#t.destroy(),this.#t=null,this.setState("active",!1)),this.#d?.disconnect(),this.#d=null,cancelAnimationFrame(this.#m),this.#v?.disconnect(),this.#v=null,this.#y?.removeEventListener("change",this.#$),this.#y=null,clearTimeout(this.#c)}#I(){typeof ResizeObserver=="function"&&(this.#d=new ResizeObserver(()=>{cancelAnimationFrame(this.#m),this.#m=requestAnimationFrame(()=>this.#w())}),this.#d.observe(this))}#D(){this.provider!=="carto-auto"||this.tileUrl||(this.#v=new MutationObserver(()=>this.#F()),this.#v.observe(document.documentElement,{attributes:!0,attributeFilter:["data-mode"]}),this.#y=window.matchMedia?.("(prefers-color-scheme: dark)")??null,this.#y?.addEventListener("change",this.#$))}#F(){this.#l()!==this.#n&&this._reinit()}get data(){return{lat:isNaN(this.lat)?void 0:this.lat,lng:isNaN(this.lng)?void 0:this.lng,zoom:this.zoom,marker:this.showMarker,markerColor:this.markerColor}}set data(t){if(!t||typeof t!="object")return;let e=this.data,r={...e};if(t.lat!=null&&!isNaN(Number(t.lat))&&(r.lat=Number(t.lat)),t.lng!=null&&!isNaN(Number(t.lng))&&(r.lng=Number(t.lng)),t.zoom!=null&&!isNaN(Number(t.zoom))&&(r.zoom=Number(t.zoom)),t.marker!=null&&(r.marker=!!t.marker),"markerColor"in t&&(O(t.markerColor)?r.markerColor=t.markerColor:t.markerColor||(r.markerColor="")),!(r.lat===e.lat&&r.lng===e.lng&&r.zoom===e.zoom&&r.marker===e.marker&&r.markerColor===e.markerColor)){this.#S=!0;try{r.lat!==e.lat&&this.setAttribute("lat",String(r.lat)),r.lng!==e.lng&&this.setAttribute("lng",String(r.lng)),r.zoom!==e.zoom&&this.setAttribute("zoom",String(r.zoom)),r.marker!==e.marker&&this.setAttribute("marker",r.marker?"true":"false"),r.markerColor!==e.markerColor&&(r.markerColor?this.setAttribute("marker-color",r.markerColor):this.removeAttribute("marker-color"))}finally{this.#S=!1}this.hasAttribute("data-upgraded")&&this._reinit(),this.dispatchEvent(new CustomEvent("geo-map:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0,composed:!0}))}}get markers(){let t=this.#p();return t?[{lat:t.lat,lng:t.lng,color:this.markerColor}]:[]}render(){let t=this.shadowRoot,e=$(t);this.removeAttribute("data-ready"),this.#A=!1,this.#h=new Map,this.#b="",this.#e=this.#p(),this.#s=this.#E();let r=this.#e!==null,o=r&&this.#x,i=u("div",{part:"container"}),s=u("div",{part:"viewport",role:"img","aria-label":this.#s});if(s.append(u("div",{part:"tiles"})),this.showMarker&&r){let a=Y();this.markerColor&&a.style.setProperty("--_marker-color",this.markerColor),s.append(a)}if(i.append(s),o){i.setAttribute("data-consent","");let a=u("div",{part:"overlay"}),d=u("button",{part:"activate",type:"button"},this.#o("consent")),g=this.#k().replace(/^https?:\/\//,""),p=u("p",{part:"consent-note"},this.#o("consent-note",{host:g}));a.append(d,p),a.addEventListener("click",()=>this.#_());let b=()=>this.#q();a.addEventListener("pointerenter",b,{once:!0}),d.addEventListener("focus",b,{once:!0}),i.append(a)}else if(r&&this.#f){let a=u("div",{part:"overlay"});a.append(u("button",{part:"activate",type:"button"},this.#o("activate"))),a.addEventListener("click",()=>this.#P({focus:!0})),i.append(a)}if(r&&this.#f){let a=u("div",{part:"controls",role:"group","aria-label":this.#o("controls")}),d=[["zoom-in","+",this.#o("zoom-in"),()=>this.#t?.zoomBy(1)],["zoom-out","\u2212",this.#o("zoom-out"),()=>this.#t?.zoomBy(-1)],["recenter","\u2316",this.#o("recenter"),()=>this.#t?.recenter()],["exit","\u2715",this.#o("exit"),()=>this.#M()]];for(let[g,p,b,w]of d){let f=u("button",{part:`control ${g}`,type:"button","aria-label":b,title:b},p);f.addEventListener("click",w),a.append(f)}i.append(a)}let l=u("div",{part:"caption"}),c=u("slot");l.append(c),i.append(l);let h=()=>{let a=c.assignedNodes().some(d=>d.nodeType===1||(d.textContent||"").trim());i.toggleAttribute("data-caption",a)};c.addEventListener("slotchange",h),i.toggleAttribute("data-caption",[...this.childNodes].some(a=>a.nodeType===1&&!a.hasAttribute("slot")||a.nodeType===3&&(a.textContent||"").trim())),i.append(this.#O()),i.append(u("p",{part:"instructions",id:`${this.#a}-help`,hidden:""},this.#o("instructions"))),i.append(u("p",{part:"status",role:"status","aria-live":"polite"})),t.replaceChildren(...e?[e]:[],i),r||this.handleError("Missing or invalid lat/lng coordinates",this.#o("error-coords"))}#O(){let t=u("div",{part:"attribution"}),e=u("slot",{name:"attribution"}),r;if(this.tileUrl){let i=(this.getAttribute("attribution")||"").trim(),s=this.getAttribute("attribution-href")||"";r=i?[{text:i,href:s}]:[]}else r=(v[this.#n]??v.osm).credits;r.forEach((i,s)=>{s&&e.append(document.createTextNode(" "));let l="";if(i.href)try{let c=new URL(i.href,location.href);(c.protocol==="https:"||c.protocol==="http:")&&(l=c.href)}catch{}e.append(l?u("a",{href:l,target:"_blank",rel:"noopener noreferrer"},i.text):u("span",{},i.text))});let o=()=>{t.hidden=r.length===0&&e.assignedNodes().length===0};return e.addEventListener("slotchange",o),t.hidden=r.length===0&&!this.querySelector(':scope > [slot="attribution"]'),t.append(e),t}#g(){let t=this.shadowRoot;return{container:t.querySelector('[part="container"]'),viewport:t.querySelector('[part="viewport"]'),tiles:t.querySelector('[part="tiles"]'),marker:t.querySelector('[part="marker"]'),status:t.querySelector('[part="status"]')}}#w(){let t=this.clientWidth,e=this.clientHeight;if(this.#t){this.#t.resize(t,e);return}if(!this.#e||this.#x||!t||!e)return;let r=`${t}x${e}`;r!==this.#b&&(this.#b=r,this.loadTiles(t,e))}loadTiles(t=this.clientWidth,e=this.clientHeight){let{tiles:r}=this.#g();if(!r||!this.#e||!t||!e)return;let o=this.zoom,{lat:i,lng:s}=this.#e,l=x(i,s,o),c=Math.pow(2,o),h=l.x-t/2,a=l.y-e/2,d=Math.floor(h/256),g=Math.floor((h+t-1)/256),p=Math.max(0,Math.floor(a/256)),b=Math.min(c-1,Math.floor((a+e-1)/256));r.style.transform=`translate(${Math.round(d*256-h)}px, ${Math.round(p*256-a)}px)`;let w=new Set;for(let f=p;f<=b;f++)for(let y=d;y<=g;y++){let A=`${y}/${f}`;w.add(A);let m=this.#h.get(A);if(!m){let D=(y%c+c)%c;m=document.createElement("img"),m.alt="",m.loading=this.loading==="eager"?"eager":"lazy",m.decoding="async",m.draggable=!1,m.addEventListener("load",()=>this.#u()),m.addEventListener("error",()=>this.#u()),m.src=S(this.#n,o,D,f,this.tileUrl),this.#h.set(A,m),r.append(m)}m.style.left=`${(y-d)*256}px`,m.style.top=`${(f-p)*256}px`}for(let[f,y]of this.#h)w.has(f)||(y.remove(),this.#h.delete(f));this.#u()}#u(){if(this.#A||this.#t||!this.#e||this.#h.size===0)return;let t=[...this.#h.values()];if(t.every(e=>e.complete)){if(this.#A=!0,t.every(e=>e.naturalWidth===0)){this.handleError("Failed to load map tiles",this.#o("error-tiles"));return}this.setAttribute("data-ready",""),this.dispatchEvent(new CustomEvent("geo-map:ready",{bubbles:!0,detail:{lat:this.#e.lat,lng:this.#e.lng,zoom:this.zoom}}))}}#_(){this.#N=!0,this._reinit(),this.#f&&this.#P({focus:!0})}#q(){if(this.#T)return;this.#T=!0;let t=this.#k();if(!t||t===location.origin||document.head.querySelector(`link[rel~="preconnect" i][href="${CSS.escape(t)}"]`))return;let e=document.createElement("link");e.rel="preconnect",e.href=t,document.head.appendChild(e)}#P({focus:t=!0}={}){if(this.#t)return Promise.resolve();if(this.#i)return this.#i;if(!this.#e||!this.#f||this.#x)return Promise.resolve();let e=this.#r,r=(async()=>{let{MapInteraction:o}=await Promise.resolve().then(()=>(I(),B));if(!this.isConnected||e!==this.#r||this.#t||!this.#e)return;let{container:i,viewport:s,tiles:l,marker:c}=this.#g();if(!i||!s||!l)return;for(let d of this.#h.values())d.remove();this.#h.clear(),i.setAttribute("data-active",""),s.setAttribute("role","region"),s.setAttribute("aria-roledescription","map"),s.setAttribute("aria-describedby",`${this.#a}-help`),s.setAttribute("tabindex","0"),this.setState("active",!0);let{lat:h,lng:a}=this.#e;this.#t=new o({host:this,viewport:s,tiles:l,marker:c,lat:h,lng:a,zoom:this.zoom,provider:this.#n,tileUrl:this.tileUrl,width:this.clientWidth,height:this.clientHeight,onDeactivate:()=>this.#M(),onMove:d=>this.#C(d)}),t&&s.focus({preventScroll:!0}),this.dispatchEvent(new CustomEvent("geo-map:activate",{bubbles:!0,detail:{lat:h,lng:a,zoom:this.zoom}}))})();return this.#i=r,r.finally(()=>{this.#i===r&&(this.#i=null)}),r}#C(t){clearTimeout(this.#c),this.#c=window.setTimeout(()=>{let{status:e}=this.#g();e&&(e.textContent=this.#o("moved",{lat:t.lat.toFixed(4),lng:t.lng.toFixed(4),zoom:t.zoom}))},400)}#M(){if(!this.#t)return;let t=!!this.shadowRoot?.activeElement;this.#L=!0,this._reinit(),t&&this.shadowRoot?.querySelector('[part="activate"]')?.focus()}handleError(t,e=t){let{container:r}=this.#g();r&&(r.setAttribute("data-state","error"),r.setAttribute("data-error",e)),this.dispatchEvent(new CustomEvent("geo-map:error",{bubbles:!0,detail:{message:t}}))}};R("geo-map",N);export{N as GeoMap};
315
+ `,x=null;function P(s){if("adoptedStyleSheets"in s&&typeof CSSStyleSheet=="function"&&"replaceSync"in CSSStyleSheet.prototype)return x||(x=new CSSStyleSheet,x.replaceSync(T)),s.adoptedStyleSheets.includes(x)||(s.adoptedStyleSheets=[...s.adoptedStyleSheets,x]),null;let t=document.createElement("style");return t.textContent=T,t}M();var Q=window.matchMedia("(prefers-reduced-motion: reduce)");var B=new Map;function R(s,t,e={}){let r=e.priority??10,o={impl:t,bundle:e.bundle,contract:e.contract,priority:r},i=B.get(s);if(customElements.get(s)){if(!i||i.priority>=r){i&&i.priority===r&&i.impl!==t&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=r){i.priority===r&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${i.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}B.set(s,o),customElements.define(s,t)}var z="http://www.w3.org/2000/svg",V={map:"Map","map-of":"Map of {name}",activate:"Activate interactive map",consent:"Load map","consent-note":"Loads map images from {host}","zoom-in":"Zoom in","zoom-out":"Zoom out",recenter:"Recenter map",exit:"Exit map",controls:"Map controls",instructions:"Drag or use the arrow keys to pan. Click a point to centre on it. Pinch, scroll, or press plus and minus to zoom. Home recentres. Escape exits.",moved:"Map centred on {lat}, {lng}, zoom {zoom}","error-coords":"Map location unavailable","error-tiles":"Map images failed to load"},j=0;function U(){let s=document.createElement("div");s.setAttribute("part","marker"),s.setAttribute("aria-hidden","true");let t=document.createElementNS(z,"svg");t.setAttribute("viewBox","0 0 24 36"),t.setAttribute("focusable","false");let e=document.createElementNS(z,"path");e.setAttribute("class","pin"),e.setAttribute("d","M12 0C5.373 0 0 5.373 0 12c0 9 12 24 12 24s12-15 12-24C24 5.373 18.627 0 12 0z");let r=document.createElementNS(z,"circle");return r.setAttribute("class","dot"),r.setAttribute("cx","12"),r.setAttribute("cy","12"),r.setAttribute("r","5"),t.append(e,r),s.append(t),s}function p(s,t={},e){let r=document.createElement(s);for(let[o,i]of Object.entries(t))r.setAttribute(o,i);return e!=null&&(r.textContent=e),r}function I(s){return!s||typeof s!="string"?!1:typeof CSS<"u"&&CSS.supports("color",s)}var L=class extends S{static get observedAttributes(){return["lat","lng","zoom","marker","marker-color","provider","tile-url","interactive","static-only","src","place","label","attribution","attribution-href","loading"]}#t=null;#i=null;#r=0;#A=!1;#L=!1;#$=!1;#T=!1;#E=!1;#a=`geo-map-${++j}`;#e=null;#n="";#h=new Map;#b="";#d=null;#f=0;#v=null;#y=null;#P=()=>this.#F();#c=0;#s="osm";constructor(){super(),this.attachShadow({mode:"open"})}get lat(){return parseFloat(this.getAttribute("lat")??"")}get lng(){return parseFloat(this.getAttribute("lng")??"")}get zoom(){let t=parseInt(this.getAttribute("zoom")??"",10);return t>=1&&t<=19?t:15}get showMarker(){return this.getAttribute("marker")!=="false"}get markerColor(){let t=this.getAttribute("marker-color");return I(t)?t:""}get provider(){let t=this.getAttribute("provider");return t&&(t in v||t==="carto-auto")?t:"osm"}get tileUrl(){return this.getAttribute("tile-url")||""}get interactive(){let t=this.getAttribute("interactive");return t==="eager"||t==="none"?t:"click"}get staticOnly(){return this.hasAttribute("static-only")}get loading(){let t=this.getAttribute("loading");return t==="eager"||t==="consent"?t:"lazy"}get active(){return this.#t!==null}#o(t,e={}){return(this.getAttribute(`data-label-${t}`)??V[t]??"").replace(/\{(\w+)\}/g,(o,i)=>i in e?String(e[i]):o)}get#m(){return this.interactive!=="none"&&!this.staticOnly}get#w(){return this.loading==="consent"&&!this.#L}#l(){let t=this.provider;if(t!=="carto-auto")return t;let e=this.closest("[data-mode]")?.getAttribute("data-mode");return e==="dark"?"carto-dark":e==="light"?"carto-light":window.matchMedia?.("(prefers-color-scheme: dark)").matches?"carto-dark":"carto-light"}#x(){if(this.tileUrl)try{return new URL(this.tileUrl.replace(/\{s\}/g,"a"),location.href).origin}catch{return""}return(v[this.#s]??v.osm).origin}#u(){let t=parseFloat(this.getAttribute("lat")??""),e=parseFloat(this.getAttribute("lng")??"");if(!isNaN(t)&&!isNaN(e))return{lat:t,lng:e};let r=this.getAttribute("src");if(r){let l=this.#M(r);if(l)return l}let o=this.querySelector("address[data-lat][data-lng]");if(o){let l=parseFloat(o.dataset.lat??""),c=parseFloat(o.dataset.lng??"");if(!isNaN(l)&&!isNaN(c))return{lat:l,lng:c}}let i=this.getAttribute("place");if(i){let l=this.#R(i);if(l)return l}let n=document.querySelector('meta[name="geo.position"]');if(n){let c=(n.getAttribute("content")||"").split(";");if(c.length===2){let h=parseFloat(c[0]),a=parseFloat(c[1]);if(!isNaN(h)&&!isNaN(a))return{lat:h,lng:a}}}return null}#M(t){let e=document.getElementById(t);if(!e)return null;if(e.tagName==="ADDRESS"&&e.dataset.lat&&e.dataset.lng){let r=parseFloat(e.dataset.lat),o=parseFloat(e.dataset.lng);if(!isNaN(r)&&!isNaN(o))return{lat:r,lng:o}}return e.tagName==="SCRIPT"&&e.type==="application/ld+json"?this.#_(e):null}#R(t){let e=document.querySelectorAll('script[type="application/ld+json"]');for(let r of e)try{let o=JSON.parse(r.textContent);if(o.name===t){let i=o.geo;if(i){let n=parseFloat(i.latitude),l=parseFloat(i.longitude);if(!isNaN(n)&&!isNaN(l))return{lat:n,lng:l}}}}catch{}return null}#_(t){try{let r=JSON.parse(t.textContent).geo;if(r){let o=parseFloat(r.latitude),i=parseFloat(r.longitude);if(!isNaN(o)&&!isNaN(i))return{lat:o,lng:i}}}catch{}return null}#C(){let t=i=>(i||"").replace(/\s+/g," ").trim(),e=t(this.getAttribute("label"));if(e)return e;let r=t(this.querySelector("address")?.textContent),o=this.getAttribute("src");if(!r&&o){let i=document.getElementById(o);if(i?.tagName==="ADDRESS")r=t(i.textContent);else if(i?.tagName==="SCRIPT")try{r=t(JSON.parse(i.textContent||"").name)}catch{}}return r||(r=t(this.getAttribute("place"))),r?this.#o("map-of",{name:r}):this.#o("map")}setup(){if(this.#r++,this.#s=this.#l(),this.render(),this.#N(),this.#O(),this.#k(),this.interactive==="eager"&&!this.#$&&this.#m&&!this.#w&&this.#e){let t=this.#r;requestAnimationFrame(()=>{t===this.#r&&this.#B({focus:!1})})}}attributeChangedCallback(t,e,r){e===r||this.#A||!this.isConnected||!this.hasAttribute("data-upgraded")||this._reinit()}teardown(){this.#r++,this.#i=null,this.#t&&(this.#t.destroy(),this.#t=null,this.setState("active",!1)),this.#d?.disconnect(),this.#d=null,cancelAnimationFrame(this.#f),this.#v?.disconnect(),this.#v=null,this.#y?.removeEventListener("change",this.#P),this.#y=null,clearTimeout(this.#c)}#N(){typeof ResizeObserver=="function"&&(this.#d=new ResizeObserver(()=>{cancelAnimationFrame(this.#f),this.#f=requestAnimationFrame(()=>this.#k())}),this.#d.observe(this))}#O(){this.provider!=="carto-auto"||this.tileUrl||(this.#v=new MutationObserver(()=>this.#F()),this.#v.observe(document.documentElement,{attributes:!0,attributeFilter:["data-mode"]}),this.#y=window.matchMedia?.("(prefers-color-scheme: dark)")??null,this.#y?.addEventListener("change",this.#P))}#F(){this.#l()!==this.#s&&this._reinit()}get data(){return{lat:isNaN(this.lat)?void 0:this.lat,lng:isNaN(this.lng)?void 0:this.lng,zoom:this.zoom,marker:this.showMarker,markerColor:this.markerColor}}set data(t){if(!t||typeof t!="object")return;let e=this.data,r={...e};if(t.lat!=null&&!isNaN(Number(t.lat))&&(r.lat=Number(t.lat)),t.lng!=null&&!isNaN(Number(t.lng))&&(r.lng=Number(t.lng)),t.zoom!=null&&!isNaN(Number(t.zoom))&&(r.zoom=Number(t.zoom)),t.marker!=null&&(r.marker=!!t.marker),"markerColor"in t&&(I(t.markerColor)?r.markerColor=t.markerColor:t.markerColor||(r.markerColor="")),!(r.lat===e.lat&&r.lng===e.lng&&r.zoom===e.zoom&&r.marker===e.marker&&r.markerColor===e.markerColor)){this.#A=!0;try{r.lat!==e.lat&&this.setAttribute("lat",String(r.lat)),r.lng!==e.lng&&this.setAttribute("lng",String(r.lng)),r.zoom!==e.zoom&&this.setAttribute("zoom",String(r.zoom)),r.marker!==e.marker&&this.setAttribute("marker",r.marker?"true":"false"),r.markerColor!==e.markerColor&&(r.markerColor?this.setAttribute("marker-color",r.markerColor):this.removeAttribute("marker-color"))}finally{this.#A=!1}this.hasAttribute("data-upgraded")&&this._reinit(),this.dispatchEvent(new CustomEvent("geo-map:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0,composed:!0}))}}get markers(){let t=this.#u();return t?[{lat:t.lat,lng:t.lng,color:this.markerColor}]:[]}render(){let t=this.shadowRoot,e=P(t);this.removeAttribute("data-ready"),this.#E=!1,this.#h=new Map,this.#b="",this.#e=this.#u(),this.#n=this.#C();let r=this.#e!==null,o=r&&this.#w,i=p("div",{part:"container"}),n=p("div",{part:"viewport",role:"img","aria-label":this.#n});if(n.append(p("div",{part:"tiles"})),this.showMarker&&r){let a=U();this.markerColor&&a.style.setProperty("--_marker-color",this.markerColor),n.append(a)}if(i.append(n),o){i.setAttribute("data-consent","");let a=p("div",{part:"overlay"}),d=p("button",{part:"activate",type:"button"},this.#o("consent")),g=this.#x().replace(/^https?:\/\//,""),u=p("p",{part:"consent-note"},this.#o("consent-note",{host:g}));a.append(d,u),a.addEventListener("click",()=>this.#q());let b=()=>this.#D();a.addEventListener("pointerenter",b,{once:!0}),d.addEventListener("focus",b,{once:!0}),i.append(a)}else if(r&&this.#m){let a=p("div",{part:"overlay"});a.append(p("button",{part:"activate",type:"button"},this.#o("activate"))),a.addEventListener("click",()=>this.#B({focus:!0})),i.append(a)}if(r&&this.#m){let a=p("div",{part:"controls",role:"group","aria-label":this.#o("controls")}),d=[["zoom-in","+",this.#o("zoom-in"),()=>this.#t?.zoomBy(1)],["zoom-out","\u2212",this.#o("zoom-out"),()=>this.#t?.zoomBy(-1)],["recenter","\u2316",this.#o("recenter"),()=>this.#t?.recenter()],["exit","\u2715",this.#o("exit"),()=>this.#S()]];for(let[g,u,b,k]of d){let m=p("button",{part:`control ${g}`,type:"button","aria-label":b,title:b},u);m.addEventListener("click",k),a.append(m)}i.append(a)}let l=p("div",{part:"caption"}),c=p("slot");l.append(c),i.append(l);let h=()=>{let a=c.assignedNodes().some(d=>d.nodeType===1||(d.textContent||"").trim());i.toggleAttribute("data-caption",a)};c.addEventListener("slotchange",h),i.toggleAttribute("data-caption",[...this.childNodes].some(a=>a.nodeType===1&&!a.hasAttribute("slot")||a.nodeType===3&&(a.textContent||"").trim())),i.append(this.#I()),i.append(p("p",{part:"instructions",id:`${this.#a}-help`,hidden:""},this.#o("instructions"))),i.append(p("p",{part:"status",role:"status","aria-live":"polite"})),t.replaceChildren(...e?[e]:[],i),r||this.handleError("Missing or invalid lat/lng coordinates",this.#o("error-coords"))}#I(){let t=p("div",{part:"attribution"}),e=p("slot",{name:"attribution"}),r;if(this.tileUrl){let i=(this.getAttribute("attribution")||"").trim(),n=this.getAttribute("attribution-href")||"";r=i?[{text:i,href:n}]:[]}else r=(v[this.#s]??v.osm).credits;r.forEach((i,n)=>{n&&e.append(document.createTextNode(" "));let l="";if(i.href)try{let c=new URL(i.href,location.href);(c.protocol==="https:"||c.protocol==="http:")&&(l=c.href)}catch{}e.append(l?p("a",{href:l,target:"_blank",rel:"noopener noreferrer"},i.text):p("span",{},i.text))});let o=()=>{t.hidden=r.length===0&&e.assignedNodes().length===0};return e.addEventListener("slotchange",o),t.hidden=r.length===0&&!this.querySelector(':scope > [slot="attribution"]'),t.append(e),t}#g(){let t=this.shadowRoot;return{container:t.querySelector('[part="container"]'),viewport:t.querySelector('[part="viewport"]'),tiles:t.querySelector('[part="tiles"]'),marker:t.querySelector('[part="marker"]'),status:t.querySelector('[part="status"]')}}#k(){let t=this.clientWidth,e=this.clientHeight;if(this.#t){this.#t.resize(t,e);return}if(!this.#e||this.#w||!t||!e)return;let r=`${t}x${e}`;r!==this.#b&&(this.#b=r,this.loadTiles(t,e))}loadTiles(t=this.clientWidth,e=this.clientHeight){let{tiles:r}=this.#g();if(!r||!this.#e||!t||!e)return;let o=this.zoom,{lat:i,lng:n}=this.#e,l=w(i,n,o),c=Math.pow(2,o),h=l.x-t/2,a=l.y-e/2,d=Math.floor(h/256),g=Math.floor((h+t-1)/256),u=Math.max(0,Math.floor(a/256)),b=Math.min(c-1,Math.floor((a+e-1)/256));r.style.transform=`translate(${Math.round(d*256-h)}px, ${Math.round(u*256-a)}px)`;let k=new Set;for(let m=u;m<=b;m++)for(let y=d;y<=g;y++){let E=`${y}/${m}`;k.add(E);let f=this.#h.get(E);if(!f){let O=(y%c+c)%c;f=document.createElement("img"),f.alt="",f.loading=this.loading==="eager"?"eager":"lazy",f.decoding="async",f.draggable=!1,f.addEventListener("load",()=>this.#p()),f.addEventListener("error",()=>this.#p()),f.src=A(this.#s,o,O,m,this.tileUrl),this.#h.set(E,f),r.append(f)}f.style.left=`${(y-d)*256}px`,f.style.top=`${(m-u)*256}px`}for(let[m,y]of this.#h)k.has(m)||(y.remove(),this.#h.delete(m));this.#p()}#p(){if(this.#E||this.#t||!this.#e||this.#h.size===0)return;let t=[...this.#h.values()];if(t.every(e=>e.complete)){if(this.#E=!0,t.every(e=>e.naturalWidth===0)){this.handleError("Failed to load map tiles",this.#o("error-tiles"));return}this.setAttribute("data-ready",""),this.dispatchEvent(new CustomEvent("geo-map:ready",{bubbles:!0,detail:{lat:this.#e.lat,lng:this.#e.lng,zoom:this.zoom}}))}}#q(){this.#L=!0,this._reinit(),this.#m&&this.#B({focus:!0})}#D(){if(this.#T)return;this.#T=!0;let t=this.#x();if(!t||t===location.origin||document.head.querySelector(`link[rel~="preconnect" i][href="${CSS.escape(t)}"]`))return;let e=document.createElement("link");e.rel="preconnect",e.href=t,document.head.appendChild(e)}#B({focus:t=!0}={}){if(this.#t)return Promise.resolve();if(this.#i)return this.#i;if(!this.#e||!this.#m||this.#w)return Promise.resolve();let e=this.#r,r=(async()=>{let{MapInteraction:o}=await Promise.resolve().then(()=>(N(),_));if(!this.isConnected||e!==this.#r||this.#t||!this.#e)return;let{container:i,viewport:n,tiles:l,marker:c}=this.#g();if(!i||!n||!l)return;for(let d of this.#h.values())d.remove();this.#h.clear(),i.setAttribute("data-active",""),n.setAttribute("role","region"),n.setAttribute("aria-roledescription","map"),n.setAttribute("aria-describedby",`${this.#a}-help`),n.setAttribute("tabindex","0"),this.setState("active",!0);let{lat:h,lng:a}=this.#e;this.#t=new o({host:this,viewport:n,tiles:l,marker:c,lat:h,lng:a,zoom:this.zoom,provider:this.#s,tileUrl:this.tileUrl,width:this.clientWidth,height:this.clientHeight,onDeactivate:()=>this.#S(),onMove:d=>this.#z(d)}),t&&n.focus({preventScroll:!0}),this.dispatchEvent(new CustomEvent("geo-map:activate",{bubbles:!0,detail:{lat:h,lng:a,zoom:this.zoom}}))})();return this.#i=r,r.finally(()=>{this.#i===r&&(this.#i=null)}),r}#z(t){clearTimeout(this.#c),this.#c=window.setTimeout(()=>{let{status:e}=this.#g();e&&(e.textContent=this.#o("moved",{lat:t.lat.toFixed(4),lng:t.lng.toFixed(4),zoom:t.zoom}))},400)}#S(){if(!this.#t)return;let t=!!this.shadowRoot?.activeElement;this.#$=!0,this._reinit(),t&&this.shadowRoot?.querySelector('[part="activate"]')?.focus()}handleError(t,e=t){let{container:r}=this.#g();r&&(r.setAttribute("data-state","error"),r.setAttribute("data-error",e)),this.dispatchEvent(new CustomEvent("geo-map:error",{bubbles:!0,detail:{message:t}}))}};R("geo-map",L);export{L as GeoMap};
316
316
  //# sourceMappingURL=geo-map.js.map
@@ -1,2 +1,2 @@
1
- var U=window.matchMedia("(prefers-reduced-motion: reduce)");var x=new Map;function T(i,e,t={}){let r=t.priority??10,n={impl:e,bundle:t.bundle,contract:t.contract,priority:r},s=x.get(i);if(customElements.get(i)){if(!s||s.priority>=r){s&&s.priority===r&&s.impl!==e&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=r){s.priority===r&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${s.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}x.set(i,n),customElements.define(i,e)}var y=class extends HTMLElement{#r=[];#e;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let e of this.#r)e();this.#r=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,r,n){e.addEventListener(t,r,n),this.#r.push(()=>e.removeEventListener(t,r,n))}_reinit(){for(let e of this.#r)e();this.#r=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,t){this.#e||(this.#e=this.attachInternals());let r=this.#e.states;try{t?r.add(e):r.delete(e)}catch{let n=`--${e}`;t?r.add(n):r.delete(n)}}_adoptInternals(e){this.#e||(this.#e=e)}#t(){return this.constructor.formAssociated&&this.#e?this.#e: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 D=["position:absolute","inline-size:1px","block-size:1px","padding:0","margin:-1px","overflow:hidden","clip-path:inset(50%)","white-space:nowrap","border:0"].join(";"),S=new WeakMap;function F(i,e){let t=S.get(e);t||S.set(e,t=new Map);let r=t.get(i);if(!r||!r.region.isConnected){let s=(e.ownerDocument||document).createElement("span");s.setAttribute("data-vb-announcer",i),s.setAttribute("role",i==="assertive"?"alert":"status"),s.setAttribute("aria-live",i),s.setAttribute("aria-atomic","true"),s.style.cssText=D,e.appendChild(s),r={region:s},t.set(i,r)}return r}function k(i,{politeness:e="polite",root:t}={}){let r=String(i??"").trim();if(!r||typeof document>"u")return null;let n=t||document.body;if(!n)return null;let o=F(e==="assertive"?"assertive":"polite",n);return clearTimeout(o.write),clearTimeout(o.clear),o.region.textContent="",o.write=setTimeout(()=>{o.region.textContent=r,o.clear=setTimeout(()=>{o.region.textContent=""},7e3)},50),o.region}function h(i,e,t,r){let n=`data-label-${e}`,o=i?.closest?.(`[${n}]`)?.getAttribute(n)||t;return r?o.replace(/\{(\w+)\}/g,(l,c)=>c in r?String(r[c]):l):o}var M=1500,R="[data-copy], [data-copy-target], [data-paste-target]",p={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"},w=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 r=!1;try{r=document.execCommand("copy")}catch{r=!1}return t.remove(),e?.focus?.({preventScroll:!0}),r}function B(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 A(i,e={}){if(i==null||i==="")return!1;let{button:t,duration:r=M}=e,n=!1,s=null;try{if(!navigator.clipboard?.writeText)throw new Error("Clipboard API unavailable");await navigator.clipboard.writeText(i),n=!0}catch(l){s=l,n=_(i)}if(n)return g({button:t,duration:r,state:"copied",eventName:"copy:done",eventDetail:{text:i},message:e.announceMessage??h(t,"copied",p.copied)}),!0;let o=B(e.source);return g({button:t,duration:r,state:"failed",eventName:"copy:error",eventDetail:{text:i,error:s},message:e.failureMessage??h(t,"copy-failed",o?p["copy-failed-selected"]:p["copy-failed"])}),!1}function g({button:i,duration:e,message:t,eventDetail:r,state:n,eventName:s}){if(i){i.dataset.state=n;let o=w.get(i);o&&clearTimeout(o),w.set(i,setTimeout(()=>{i.dataset.state===n&&delete i.dataset.state,w.delete(i)},e)),i.dispatchEvent(new CustomEvent(s,{bubbles:!0,detail:r}))}k(t,{politeness:n==="failed"?"assertive":"polite"})}async function P(i,e={}){let{button:t,duration:r=M}=e,n;try{if(!navigator.clipboard?.readText)throw new Error("Clipboard API unavailable");n=await navigator.clipboard.readText()}catch(s){return g({button:t,duration:r,state:"failed",eventName:"paste:error",eventDetail:{target:i,error:s},message:e.failureMessage??h(t,"paste-failed",p["paste-failed"])}),null}return i&&(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement?i.value=n:i.textContent=n,i.dispatchEvent(new Event("input",{bubbles:!0}))),g({button:t,duration:r,state:"pasted",eventName:"paste:done",eventDetail:{text:n,target:i},message:e.announceMessage??h(t,"pasted",p.pasted)}),n}function L(i){let e=i.dataset.copyTarget;if(!e)return null;try{return document.querySelector(e)}catch{return null}}function j(i){if(i.dataset.copy)return i.dataset.copy;let e=L(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 H(i){let e=i.target?.closest?.(R);if(!e||e.matches(':disabled, [aria-disabled="true"]'))return;if(e.dataset.pasteTarget){let r=null;try{r=document.querySelector(e.dataset.pasteTarget)}catch{}if(!r)return;P(r,{button:e});return}let t=j(e);t&&A(t,{button:e,source:L(e)??void 0})}typeof document<"u"&&!document.__vbCopyDelegated&&(document.__vbCopyDelegated=!0,document.addEventListener("click",H));var O=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function E(i,e){let r=(()=>{try{return decodeURIComponent(location.hash.slice(1))}catch{return location.hash.slice(1)}})()===e;r||(location.hash=e);let n=i;typeof n.focus=="function"&&(n.tabIndex<0&&!n.hasAttribute("tabindex")&&n.setAttribute("tabindex","-1"),n.focus({preventScroll:!0})),(r||!n.matches?.(":target"))&&n.scrollIntoView({behavior:O()?"auto":"smooth",block:"start"})}function q(i){let e=i;if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return!1;let r=(e.target instanceof Element?e.target:null)?.closest('a[href^="#"]');if(!r)return!1;let n=r.getAttribute("target");if(n&&n!=="_self"||r.hasAttribute("download"))return!1;let s=(r.getAttribute("href")??"").slice(1);if(!s)return!1;let o=s;try{o=decodeURIComponent(s)}catch{}let l=r.ownerDocument.getElementById(o);return l?(e.preventDefault(),E(l,o),!0):!1}var N={filter:"Filter glossary terms","matches-one":"{count} term matches","matches-other":"{count} terms match","all-one":"Showing {count} term","all-other":"Showing all {count} terms",empty:"No terms match your filter.",permalink:"Copy link to",copied:"Link copied to clipboard"},m='.glossary-section, section[id^="glossary-"]',V=1500;function K(i){let e=[],t=null;for(let r of[...i.children])if(r.localName==="div"){let n={dts:[],dds:[],wrapper:r};for(let s of[...r.children])s.localName==="dt"?n.dts.push(s):s.localName==="dd"&&n.dds.push(s);e.push(n),t=null}else r.localName==="dt"?((!t||t.dds.length)&&(t={dts:[],dds:[],wrapper:null},e.push(t)),t.dts.push(r)):r.localName==="dd"&&(t||(t={dts:[],dds:[],wrapper:null},e.push(t)),t.dds.push(r));return e}var C=class extends y{#r=null;#e=null;#t=null;#n=0;#a=[];#i=new Map;#o="";setup(){this.#o="",this.listen(this,"click",this.#m),this.listen(this,"click",q),this.#h(),this.hasAttribute("permalinks")&&this.#p(),this.#g()}teardown(){cancelAnimationFrame(this.#n),this.#n=0;for(let e of this.#i.values())clearTimeout(e);this.#i.clear(),this.#o&&this.#c("",{silent:!0}),this.#r?.remove(),this.#e?.remove(),this.#t?.remove();for(let e of this.#a)e.remove();for(let e of this.querySelectorAll(".glossary-jump a[aria-current]"))e.removeAttribute("aria-current");this.#r=null,this.#e=null,this.#t=null,this.#a=[]}#h(){let e=document.createElement("search");e.className="glossary-search";let t=document.createElement("input");t.type="search",t.placeholder=this.getAttribute("placeholder")||"Filter terms\u2026",t.setAttribute("aria-label",this.#s("filter")),e.append(t),this.listen(t,"input",()=>this.#c(t.value));let r=document.createElement("p");r.className="glossary-status",r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),r.setAttribute("aria-atomic","true");let n=document.createElement("p");n.className="glossary-empty",n.textContent=this.#s("empty"),n.hidden=!0;let s=this.querySelector("main"),o=this.querySelector(".glossary-jump"),l=this.querySelector(":scope > :is(h1, h2, h3, h4, h5, h6)");s?s.prepend(e,r):o?.parentElement?o.before(e,r):l?l.after(e,r):this.prepend(e,r);let c=this.querySelectorAll(m),f=c[c.length-1];f?f.after(n):r.after(n),this.#r=e,this.#e=r,this.#t=n}#c(e,{silent:t=!1}={}){let r=this.#l(),n=a=>{try{return a.toLocaleLowerCase(r)}catch{return a.toLowerCase()}},s=n(e.trim()),o=this.#o!=="";this.#o=s;let l=0,c=0,f=new Set;for(let a of this.querySelectorAll(m)){let d=!1;for(let $ of a.querySelectorAll("dl"))for(let u of K($)){if(!u.dts.length)continue;c+=u.dts.length;let I=n(u.dts.map(v=>this.#d(v)).join(" ")),b=!s||I.includes(s);u.wrapper&&(u.wrapper.hidden=!b);for(let v of[...u.dts,...u.dds])v.hidden=!b;b&&(d=!0,l+=u.dts.length)}a.hidden=!d,!d&&a.id&&f.add(a.id)}for(let a of this.querySelectorAll('.glossary-jump a[href^="#"]')){let d=decodeURIComponent((a.getAttribute("href")??"").slice(1));f.has(d)?a.hasAttribute("aria-disabled")||(a.setAttribute("aria-disabled","true"),a.setAttribute("data-glossary-disabled","")):a.hasAttribute("data-glossary-disabled")&&(a.removeAttribute("aria-disabled"),a.removeAttribute("data-glossary-disabled"))}if(this.#t&&(this.#t.hidden=!s||l>0),!t){if(this.#e&&(s||o)){let a=s?this.#f("matches",l):this.#f("all",c),d=this.#e;d.textContent="",requestAnimationFrame(()=>{d.textContent=a})}this.dispatchEvent(new CustomEvent("glossary-index:filter",{bubbles:!0,detail:{query:s,matchCount:l}}))}}#p(){for(let e of this.querySelectorAll(`:is(${m}) dl dt[id]`)){if(e.querySelector(":scope > .glossary-permalink"))continue;let t=document.createElement("a");t.className="glossary-permalink",t.href=`#${encodeURIComponent(e.id)}`,t.setAttribute("aria-label",`${this.#s("permalink")} ${this.#d(e)}`);let r=document.createElement("span");r.setAttribute("aria-hidden","true"),r.textContent="#",t.append(r),e.append(t),this.#a.push(t)}}#d(e){let t=e.querySelector("dfn");if(t)return(t.textContent??"").trim();let r="";for(let n of e.childNodes)n instanceof Element&&n.classList.contains("glossary-permalink")||(r+=n.textContent??"");return r.replace(/\s+/g," ").trim()}#m=e=>{let t=e,n=(t.target instanceof Element?t.target:null)?.closest("a");if(!n||!this.contains(n))return;if(n.getAttribute("aria-disabled")==="true"){t.preventDefault();return}if(!n.classList.contains("glossary-permalink")||t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;let s=n.parentElement;s?.id&&(t.preventDefault(),this.#y(s,n))};async#y(e,t){E(e,e.id);let r=new URL(document.URL);r.hash=e.id,await A(r.href,{announceMessage:this.#s("copied")})&&(t.dataset.state="copied",clearTimeout(this.#i.get(t)),this.#i.set(t,setTimeout(()=>{delete t.dataset.state,this.#i.delete(t)},V)))}#g(){if(!this.querySelector(".glossary-jump a")||!this.querySelector(m))return;let e=()=>{this.#n||(this.#n=requestAnimationFrame(()=>{this.#n=0,this.#u()}))};this.listen(window,"scroll",e,{passive:!0}),this.listen(window,"resize",e,{passive:!0}),this.#u()}#u(){let e=[...this.querySelectorAll(m)].filter(n=>!n.hidden);if(!e.length)return;let t=window.innerHeight/3,r=e[0];for(let n of e)if(n.getBoundingClientRect().top<=t)r=n;else break;for(let n of this.querySelectorAll(".glossary-jump a"))n.setAttribute("aria-current",n.getAttribute("href")===`#${r.id}`?"true":"false")}#l(){return this.closest("[lang]")?.getAttribute("lang")||void 0}#s(e){return this.getAttribute(`data-label-${e}`)??N[e]??""}#f(e,t){let r="other",n=String(t);try{r=new Intl.PluralRules(this.#l()).select(t),n=new Intl.NumberFormat(this.#l()).format(t)}catch{}return(this.getAttribute(`data-label-${e}-${r}`)??N[`${e}-${r}`]??this.#s(`${e}-other`)).replaceAll("{count}",n)}};T("glossary-index",C);export{C as GlossaryIndex,K as termGroups};
1
+ var G=window.matchMedia("(prefers-reduced-motion: reduce)");var S=new Map;function T(s,e,t={}){let r=t.priority??10,n={impl:e,bundle:t.bundle,contract:t.contract,priority:r},i=S.get(s);if(customElements.get(s)){if(!i||i.priority>=r){i&&i.priority===r&&i.impl!==e&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=r){i.priority===r&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${i.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}S.set(s,n),customElements.define(s,e)}var y=class extends HTMLElement{#r=[];#e;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let e of this.#r)e();this.#r=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,r,n){e.addEventListener(t,r,n),this.#r.push(()=>e.removeEventListener(t,r,n))}_reinit(){for(let e of this.#r)e();this.#r=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,t){this.#e||(this.#e=this.attachInternals());let r=this.#e.states;try{t?r.add(e):r.delete(e)}catch{let n=`--${e}`;t?r.add(n):r.delete(n)}}_adoptInternals(e){this.#e||(this.#e=e)}#t(){return this.constructor.formAssociated&&this.#e?this.#e: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 F=["position:absolute","inline-size:1px","block-size:1px","padding:0","margin:-1px","overflow:hidden","clip-path:inset(50%)","white-space:nowrap","border:0"].join(";"),x=new WeakMap;function _(s,e){let t=x.get(e);t||x.set(e,t=new Map);let r=t.get(s);if(!r||!r.region.isConnected){let i=(e.ownerDocument||document).createElement("span");i.setAttribute("data-vb-announcer",s),i.setAttribute("role",s==="assertive"?"alert":"status"),i.setAttribute("aria-live",s),i.setAttribute("aria-atomic","true"),i.style.cssText=F,e.appendChild(i),r={region:i},t.set(s,r)}return r}function $(s,{politeness:e="polite",root:t}={}){let r=String(s??"").trim();if(!r||typeof document>"u")return null;let n=t||document.body;if(!n)return null;let o=_(e==="assertive"?"assertive":"polite",n);return clearTimeout(o.write),clearTimeout(o.clear),o.region.textContent="",o.write=setTimeout(()=>{o.region.textContent=r,o.clear=setTimeout(()=>{o.region.textContent=""},7e3)},50),o.region}function h(s,e,t,r){let n=`data-label-${e}`,o=s?.closest?.(`[${n}]`)?.getAttribute(n)||t;return r?o.replace(/\{(\w+)\}/g,(c,l)=>l in r?String(r[l]):c):o}var k=1500,D="[data-copy], [data-copy-target], [data-paste-target]",p={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"},w=new WeakMap;function B(s){if(typeof document.execCommand!="function"||!document.body)return!1;let e=document.activeElement,t=document.createElement("textarea");t.value=s,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 r=!1;try{r=document.execCommand("copy")}catch{r=!1}return t.remove(),e?.focus?.({preventScroll:!0}),r}function R(s){if(!s)return!1;if(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement)return s.focus(),s.select(),!0;let e=window.getSelection?.();if(!e)return!1;let t=document.createRange();return t.selectNodeContents(s),e.removeAllRanges(),e.addRange(t),!e.isCollapsed}async function E(s,e={}){if(s==null||s==="")return!1;let{button:t,duration:r=k}=e,n=!1,i=null;try{if(!navigator.clipboard?.writeText)throw new Error("Clipboard API unavailable");await navigator.clipboard.writeText(s),n=!0}catch(c){i=c,n=B(s)}if(n)return b({button:t,duration:r,state:"copied",eventName:"copy:done",eventDetail:{text:s},message:e.announceMessage??h(t,"copied",p.copied)}),!0;let o=R(e.source);return b({button:t,duration:r,state:"failed",eventName:"copy:error",eventDetail:{text:s,error:i},message:e.failureMessage??h(t,"copy-failed",o?p["copy-failed-selected"]:p["copy-failed"])}),!1}function b({button:s,duration:e,message:t,eventDetail:r,state:n,eventName:i}){if(s){s.dataset.state=n;let o=w.get(s);o&&clearTimeout(o),w.set(s,setTimeout(()=>{s.dataset.state===n&&delete s.dataset.state,w.delete(s)},e)),s.dispatchEvent(new CustomEvent(i,{bubbles:!0,detail:r}))}$(t,{politeness:n==="failed"?"assertive":"polite"})}async function H(s,e={}){let{button:t,duration:r=k}=e,n;try{if(!navigator.clipboard?.readText)throw new Error("Clipboard API unavailable");n=await navigator.clipboard.readText()}catch(i){return b({button:t,duration:r,state:"failed",eventName:"paste:error",eventDetail:{target:s,error:i},message:e.failureMessage??h(t,"paste-failed",p["paste-failed"])}),null}return s&&(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||s instanceof HTMLSelectElement?s.value=n:s.textContent=n,s.dispatchEvent(new Event("input",{bubbles:!0}))),b({button:t,duration:r,state:"pasted",eventName:"paste:done",eventDetail:{text:n,target:s},message:e.announceMessage??h(t,"pasted",p.pasted)}),n}function M(s){let e=s.dataset.copyTarget;if(!e)return null;try{return document.querySelector(e)}catch{return null}}function j(s){if(s.dataset.copy)return s.dataset.copy;let e=M(s);if(!e)return"";let t=s.dataset.copyAttr;return t?e.getAttribute(t)??"":e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?e.value:e.textContent??""}function O(s){let e=s.target?.closest?.(D);if(!e||e.matches(':disabled, [aria-disabled="true"]'))return;if(e.dataset.pasteTarget){let r=null;try{r=document.querySelector(e.dataset.pasteTarget)}catch{}if(!r)return;H(r,{button:e});return}let t=j(e);t&&E(t,{button:e,source:M(e)??void 0})}typeof document<"u"&&!document.__vbCopyDelegated&&(document.__vbCopyDelegated=!0,document.addEventListener("click",O));var V=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function A(s,e){let r=(()=>{try{return decodeURIComponent(location.hash.slice(1))}catch{return location.hash.slice(1)}})()===e;r||(location.hash=e);let n=s;typeof n.focus=="function"&&(n.tabIndex<0&&!n.hasAttribute("tabindex")&&n.setAttribute("tabindex","-1"),n.focus({preventScroll:!0})),(r||!n.matches?.(":target"))&&n.scrollIntoView({behavior:V()?"auto":"smooth",block:"start"})}function L(s){let e=s;if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return!1;let r=(e.target instanceof Element?e.target:null)?.closest('a[href^="#"]');if(!r)return!1;let n=r.getAttribute("target");if(n&&n!=="_self"||r.hasAttribute("download"))return!1;let i=(r.getAttribute("href")??"").slice(1);if(!i)return!1;let o=i;try{o=decodeURIComponent(i)}catch{}let c=r.ownerDocument.getElementById(o);return c?(e.preventDefault(),A(c,o),!0):!1}var q={filter:"Filter glossary terms","matches-one":"{count} term matches","matches-other":"{count} terms match","all-one":"Showing {count} term","all-other":"Showing all {count} terms",empty:"No terms match your filter.",permalink:"Copy link to",copied:"Link copied to clipboard"},m='.glossary-section, section[id^="glossary-"]',K=1500;function U(s){let e=[],t=null;for(let r of[...s.children])if(r.localName==="div"){let n={dts:[],dds:[],wrapper:r};for(let i of[...r.children])i.localName==="dt"?n.dts.push(i):i.localName==="dd"&&n.dds.push(i);e.push(n),t=null}else r.localName==="dt"?((!t||t.dds.length)&&(t={dts:[],dds:[],wrapper:null},e.push(t)),t.dts.push(r)):r.localName==="dd"&&(t||(t={dts:[],dds:[],wrapper:null},e.push(t)),t.dds.push(r));return e}var C=class extends y{#r=null;#e=null;#t=null;#n=0;#a=[];#s=new Map;#o="";setup(){this.#o="",this.listen(this,"click",this.#m),this.listen(this,"click",L),this.#h(),this.hasAttribute("permalinks")&&this.#p(),this.#b()}teardown(){cancelAnimationFrame(this.#n),this.#n=0;for(let e of this.#s.values())clearTimeout(e);this.#s.clear(),this.#o&&this.#l("",{silent:!0}),this.#r?.remove(),this.#e?.remove(),this.#t?.remove();for(let e of this.#a)e.remove();for(let e of this.querySelectorAll(".glossary-jump a[aria-current]"))e.removeAttribute("aria-current");this.#r=null,this.#e=null,this.#t=null,this.#a=[]}#h(){let e=document.createElement("search");e.className="glossary-search";let t=document.createElement("input");t.type="search",t.placeholder=this.getAttribute("placeholder")||"Filter terms\u2026",t.setAttribute("aria-label",this.#i("filter")),e.append(t),this.listen(t,"input",()=>this.#l(t.value));let r=document.createElement("p");r.className="glossary-status",r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),r.setAttribute("aria-atomic","true");let n=document.createElement("p");n.className="glossary-empty",n.textContent=this.#i("empty"),n.hidden=!0;let i=this.querySelector("main"),o=this.querySelector(".glossary-jump"),c=this.querySelector(":scope > :is(h1, h2, h3, h4, h5, h6)");i?i.prepend(e,r):o?.parentElement?o.before(e,r):c?c.after(e,r):this.prepend(e,r);let l=this.querySelectorAll(m),f=l[l.length-1];f?f.after(n):r.after(n),this.#r=e,this.#e=r,this.#t=n}#l(e,{silent:t=!1}={}){let r=this.#c(),n=a=>{try{return a.toLocaleLowerCase(r)}catch{return a.toLowerCase()}},i=n(e.trim()),o=this.#o!=="";this.#o=i;let c=0,l=0,f=new Set;for(let a of this.querySelectorAll(m)){let d=!1;for(let P of a.querySelectorAll("dl"))for(let u of U(P)){if(!u.dts.length)continue;l+=u.dts.length;let I=n(u.dts.map(v=>this.#d(v)).join(" ")),g=!i||I.includes(i);u.wrapper&&(u.wrapper.hidden=!g);for(let v of[...u.dts,...u.dds])v.hidden=!g;g&&(d=!0,c+=u.dts.length)}a.hidden=!d,!d&&a.id&&f.add(a.id)}for(let a of this.querySelectorAll('.glossary-jump a[href^="#"]')){let d=decodeURIComponent((a.getAttribute("href")??"").slice(1));f.has(d)?a.hasAttribute("aria-disabled")||(a.setAttribute("aria-disabled","true"),a.setAttribute("data-glossary-disabled","")):a.hasAttribute("data-glossary-disabled")&&(a.removeAttribute("aria-disabled"),a.removeAttribute("data-glossary-disabled"))}if(this.#t&&(this.#t.hidden=!i||c>0),!t){if(this.#e&&(i||o)){let a=i?this.#f("matches",c):this.#f("all",l),d=this.#e;d.textContent="",requestAnimationFrame(()=>{d.textContent=a})}this.dispatchEvent(new CustomEvent("glossary-index:filter",{bubbles:!0,detail:{query:i,matchCount:c}}))}}#p(){for(let e of this.querySelectorAll(`:is(${m}) dl dt[id]`)){if(e.querySelector(":scope > .glossary-permalink"))continue;let t=document.createElement("a");t.className="glossary-permalink",t.href=`#${encodeURIComponent(e.id)}`,t.setAttribute("aria-label",`${this.#i("permalink")} ${this.#d(e)}`);let r=document.createElement("span");r.setAttribute("aria-hidden","true"),r.textContent="#",t.append(r),e.append(t),this.#a.push(t)}}#d(e){let t=e.querySelector("dfn");if(t)return(t.textContent??"").trim();let r="";for(let n of e.childNodes)n instanceof Element&&n.classList.contains("glossary-permalink")||(r+=n.textContent??"");return r.replace(/\s+/g," ").trim()}#m=e=>{let t=e,n=(t.target instanceof Element?t.target:null)?.closest("a");if(!n||!this.contains(n))return;if(n.getAttribute("aria-disabled")==="true"){t.preventDefault();return}if(!n.classList.contains("glossary-permalink")||t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;let i=n.parentElement;i?.id&&(t.preventDefault(),this.#y(i,n))};async#y(e,t){A(e,e.id);let r=new URL(document.URL);r.hash=e.id,await E(r.href,{announceMessage:this.#i("copied")})&&(t.dataset.state="copied",clearTimeout(this.#s.get(t)),this.#s.set(t,setTimeout(()=>{delete t.dataset.state,this.#s.delete(t)},K)))}#b(){if(!this.querySelector(".glossary-jump a")||!this.querySelector(m))return;let e=()=>{this.#n||(this.#n=requestAnimationFrame(()=>{this.#n=0,this.#u()}))};this.listen(window,"scroll",e,{passive:!0}),this.listen(window,"resize",e,{passive:!0}),this.#u()}#u(){let e=[...this.querySelectorAll(m)].filter(n=>!n.hidden);if(!e.length)return;let t=window.innerHeight/3,r=e[0];for(let n of e)if(n.getBoundingClientRect().top<=t)r=n;else break;for(let n of this.querySelectorAll(".glossary-jump a"))n.getAttribute("href")===`#${r.id}`?n.setAttribute("aria-current","true"):n.removeAttribute("aria-current")}#c(){return this.closest("[lang]")?.getAttribute("lang")||void 0}#i(e){return this.getAttribute(`data-label-${e}`)??q[e]??""}#f(e,t){let r="other",n=String(t);try{r=new Intl.PluralRules(this.#c()).select(t),n=new Intl.NumberFormat(this.#c()).format(t)}catch{}return(this.getAttribute(`data-label-${e}-${r}`)??q[`${e}-${r}`]??this.#i(`${e}-other`)).replaceAll("{count}",n)}};T("glossary-index",C);export{C as GlossaryIndex,U as termGroups};
2
2
  //# sourceMappingURL=glossary-index.js.map
@@ -1,2 +1,2 @@
1
- var wt=window.matchMedia("(prefers-reduced-motion: reduce)");var $=new Map;function I(s,t,e={}){let n=e.priority??10,r={impl:t,bundle:e.bundle,contract:e.contract,priority:n},i=$.get(s);if(customElements.get(s)){if(!i||i.priority>=n){i&&i.priority===n&&i.impl!==t&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=n){i.priority===n&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${i.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}$.set(s,r),customElements.define(s,t)}var A=class extends HTMLElement{#r=[];#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.#r)t();this.#r=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,n,r){t.addEventListener(e,n,r),this.#r.push(()=>t.removeEventListener(e,n,r))}_reinit(){for(let t of this.#r)t();this.#r=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,e){this.#e||(this.#e=this.attachInternals());let n=this.#e.states;try{e?n.add(t):n.delete(t)}catch{let r=`--${t}`;e?n.add(r):n.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 W="http://www.w3.org/1999/xhtml",v="http://www.w3.org/2000/svg",P="http://www.w3.org/1998/Math/MathML",G=new Set([W,v,P]),E="user-content-",K=new Set(["script","iframe","frame","frameset","object","embed","applet","portal","fencedframe","form","base","link","meta","noscript","foreignobject","style","xmp","noembed","noframes","plaintext","mglyph","malignmark","annotation-xml"]),k=new Set(["title","desc"]),X=new Set(["animate","set","animatemotion","animatetransform"]),Y=new Set(["href","xlink:href","action","formaction","data","codebase","cite","background","longdesc","manifest","to","from","values","by"]),J=new Set(["src","poster","srcset"]),Q=new Set(["srcdoc","form","formaction","formmethod","formtarget","formenctype","formnovalidate","action","method","ping"]),Z=new Set(["popovertarget","popovertargetaction","commandfor","command","interestfor","autofocus"]),tt=new Set(["for","headers","list","aria-labelledby","aria-describedby","aria-controls","aria-owns","aria-flowto","aria-details","aria-errormessage","aria-activedescendant"]),et={"include-file":["trusted","allow-scripts","allow-cross-origin"],"markdown-viewer":["src","sanitize","ping","allow-cross-origin"]},nt=new Set(["social-embed","youtube-player","geo-map"]),rt=["src","src-dark","data-src","url","endpoint","tile-url","data-versions"],st=new Set(["audio-player","video-player","image-map","brand-mark"]);function it(s){return String(s).replace(/[\u0000- \u007f-\u009f]/g,"").toLowerCase()}function L(s,t=!1){let e=it(s);return t?/(^|,)(javascript|vbscript|livescript):/.test(e)?!0:/(^|,)data:/.test(e)?e.split(/(?=data:)/).filter(r=>r.startsWith("data:")).some(r=>!/^data:(image|audio|video|font)\//.test(r)):!1:/^(javascript|vbscript|livescript|data):/.test(e)}function R(s){let t=String(s).replace(/\/\*[\s\S]*?\*\//g,"").replace(/\\/g,"").replace(/\s+/g,"").toLowerCase();return/expression\(|javascript:|vbscript:|-moz-binding|behavior:|@import|position:fixed/.test(t)}var ot=s=>String(s.localName||s.tagName||"").toLowerCase(),at=s=>s.startsWith(E)?s:E+s;function ct(s,t){if(K.has(t))return!0;let e=s.namespaceURI;return!!(e&&!G.has(e)||t==="title"&&e!==v||k.has(t)&&e===v&&s.children?.length||X.has(t)&&(s.getAttribute("attributeName")||s.getAttribute("attributename")||"").toLowerCase().includes("href"))}function lt(s,t){for(let e of[...s.attributes]){let n=e.name.toLowerCase();if(n.startsWith("on")||Q.has(n)||!t.keepIds&&Z.has(n)){s.removeAttribute(e.name);continue}if(n==="style"){(!t.keepStyle||R(e.value))&&s.removeAttribute(e.name);continue}if((n==="id"||n==="name")&&!t.keepIds){let r=at(e.value);n==="id"?t.ids.set(e.value,r):t.ids.set(`name:${e.value}`,r),s.setAttribute(e.name,r);continue}if(Y.has(n)||n.endsWith(":href")){L(e.value,!1)&&s.removeAttribute(e.name);continue}J.has(n)&&L(e.value,!0)&&s.removeAttribute(e.name)}}function ut(s,t){let e=(s.getAttribute("type")||"").toLowerCase();t==="button"&&e!=="button"&&s.setAttribute("type","button"),t==="input"&&/^(submit|reset|image)$/.test(e)&&s.setAttribute("type","button")}function dt(s,t){for(let e of s)for(let n of[...e.attributes]){let r=n.name.toLowerCase(),i=n.value;if((r==="href"||r.endsWith(":href"))&&i.startsWith("#")){let o=ht(i.slice(1));t.has(o)&&e.setAttribute(n.name,`#${t.get(o)}`)}else if(r==="usemap"&&i.startsWith("#")){let o=t.get(`name:${i.slice(1)}`);o?e.setAttribute(n.name,`#${o}`):e.removeAttribute(n.name)}else if(tt.has(r)){let o=i.split(/\s+/).filter(Boolean).map(a=>t.get(a)||(a.startsWith(E)?a:null)).filter(Boolean);o.length?e.setAttribute(n.name,o.join(" ")):e.removeAttribute(n.name)}else i.includes("url(#")&&e.setAttribute(n.name,i.replace(/url\(#([^)]+)\)/g,(o,a)=>t.has(a)?`url(#${t.get(a)})`:o))}}function ht(s){try{return decodeURIComponent(s)}catch{return s}}function _(s){let t=s.childNodes;if(t)for(let e of[...t])e.nodeType===8?e.remove():(e.nodeType===1||e.nodeType===11)&&_(e)}function O(s,t){_(s);let e=[...s.querySelectorAll("*")];t.includeRoot&&e.unshift(s);let n=new Map,r=[],i={...t,ids:n};for(let o of e){if(!mt(o,s))continue;let a=ot(o);if(t.svgOnly&&(k.has(a)||a==="style")){if(a==="style"&&R(o.textContent||"")){o.remove();continue}}else if(ct(o,a)){o.remove();continue}if(!t.keepIds&&!t.svgOnly&&nt.has(a)){ft(o);continue}if(a==="template"){let l=o.content;l&&O(l,{...t,includeRoot:!1})}lt(o,i),t.keepIds||ut(o,a);let d=et[a];if(d)for(let l of d)o.removeAttribute(l);if(a==="include-file"&&!t.allowIncludeFile&&o.removeAttribute("src"),!t.keepIds&&!t.svgOnly&&a.includes("-")&&a!=="include-file"&&!st.has(a))for(let l of rt)o.removeAttribute(l);r.push(o)}!t.keepIds&&n.size&&dt(r,n)}function ft(s){let t=s.parentNode;if(t){for(let e of[...s.childNodes])t.insertBefore(e,s);s.remove()}}function mt(s,t){let e=s;for(;e;){if(e===t)return!0;e=e.parentNode??e.parent??null}return!1}function U(s,t={}){let e=document.createElement("template");return s&&typeof s=="string"&&(e.innerHTML=s,O(e.content,{allowIncludeFile:!!t.allowIncludeFile,keepIds:!!t.keepIds,keepStyle:!!t.keepStyle})),e.content}var pt=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function gt(s,t){let n=(()=>{try{return decodeURIComponent(location.hash.slice(1))}catch{return location.hash.slice(1)}})()===t;n||(location.hash=t);let r=s;typeof r.focus=="function"&&(r.tabIndex<0&&!r.hasAttribute("tabindex")&&r.setAttribute("tabindex","-1"),r.focus({preventScroll:!0})),(n||!r.matches?.(":target"))&&r.scrollIntoView({behavior:pt()?"auto":"smooth",block:"start"})}function D(s){let t=s;if(t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return!1;let n=(t.target instanceof Element?t.target:null)?.closest('a[href^="#"]');if(!n)return!1;let r=n.getAttribute("target");if(r&&r!=="_self"||n.hasAttribute("download"))return!1;let i=(n.getAttribute("href")??"").slice(1);if(!i)return!1;let o=i;try{o=decodeURIComponent(i)}catch{}let a=n.ownerDocument.getElementById(o);return a?(t.preventDefault(),gt(a,o),!0):!1}var q={search:"Search glossary terms","search-placeholder":"Search terms\u2026",terms:"Glossary terms",alphabet:"Alphabet navigation","found-one":"{count} term found","found-other":"{count} terms found","all-one":"Showing {count} term","all-other":"Showing all {count} terms",uncategorized:"Uncategorized","see-also":"See also:",error:"Could not load the glossary terms."},b="#",bt=0;function yt(s,t){let e=s.trim();if(!e)return"";if(typeof Intl.Segmenter=="function")try{for(let{segment:n}of new Intl.Segmenter(t,{granularity:"grapheme"}).segment(e))return n}catch{}return String.fromCodePoint(e.codePointAt(0))}function At(s,t){let e=yt(s,t);if(!e||!/^\p{L}/u.test(e))return b;try{return e.toLocaleUpperCase(t)}catch{return e.toUpperCase()}}function z(s,t){let e=new Map(s.map(r=>[String(r?.id??""),String(r?.term??"")])),n=document.createElement("dl");for(let r of s){if(!r||typeof r!="object")continue;let i=document.createElement("div");i.setAttribute("data-term-id",String(r.id??"")),r.category&&i.setAttribute("data-category",String(r.category));let o=document.createElement("dt");o.textContent=String(r.term??"");let a=document.createElement("dd");typeof r.definitionHtml=="string"&&r.definitionHtml?a.replaceChildren(U(r.definitionHtml)):a.textContent=String(r.definition??"");let d=Array.isArray(r.seeAlso)?r.seeAlso.map(String).filter(Boolean):[];if(d.length){let l=document.createElement("span");l.className="gloss-see-also",l.append(` ${t} `),d.forEach((u,m)=>{m&&l.append(", ");let f=document.createElement("a");f.href=`#${encodeURIComponent(u)}`,f.textContent=e.get(u)||u,l.append(f)}),l.append("."),a.append(l)}i.append(o,a),n.append(i)}return n}var S=class extends A{static get observedAttributes(){return["src","data-title","data-heading-level","searchable","lang"]}#r=`gloss-${++bt}`;#e=null;#n=[];#w=null;#o=null;#i=null;#c=null;#t=[];#l=[];#u=new Map;#b=new Map;#h=new Set;#d=new Set;#f="";#g=null;#y=null;#m=null;#v="";setup(){this.#f="",this.#h=new Set,this.#d=new Set;let t=this.getAttribute("src"),e=!!t&&t!==this.#y&&t!==this.#m;e&&this.#_(t),t?this.setAttribute("data-state",e?"loading":t===this.#m?"error":"ready"):this.removeAttribute("data-state");let n=this.querySelector(":scope > dl"),r=n?[...n.querySelectorAll(":scope > div[data-term-id]")]:[],i=!!t&&t===this.#m;if(r.length===0)return i&&this.#E(null),e||i;this.listen(this,"click",this.#L),this.listen(this,"click",D);let o=this.#p(),a=this.#s("uncategorized");this.#e={dl:n,wasHidden:n.hidden,items:r.map(c=>({el:c,attrs:Object.fromEntries(["id","class","hidden","data-letter"].map(h=>[h,c.getAttribute(h)]))}))};let d=0;this.#t=r.map(c=>{let h=c.getAttribute("data-term-id")||`${this.#r}-term-${++d}`,p=c.querySelector("dt"),y=c.querySelector("dd"),T=p?(p.textContent??"").trim():"",x="",N=[];if(y){let M=y.cloneNode(!0),w=M.querySelector(".gloss-see-also");w&&(N=[...w.querySelectorAll('a[href^="#"]')].map(V=>decodeURIComponent((V.getAttribute("href")??"").slice(1))),w.remove()),x=(M.textContent??"").replace(/\s+/g," ").trim()}return c.id=h,{id:h,term:T,definition:x,seeAlso:N,category:c.getAttribute("data-category")||"",el:c,letter:At(T,o)}});let l=this.#C({sensitivity:"base"}),u=[];for(let c of this.#t){if(c.letter===b)continue;let h=u.findIndex(p=>l.compare(p,c.letter)===0);h===-1?u.push(c.letter):u[h].normalize("NFD")!==u[h]&&c.letter.normalize("NFD")===c.letter&&(u[h]=c.letter)}for(let c of this.#t)c.letter!==b&&(c.letter=u.find(h=>l.compare(h,c.letter)===0)??c.letter);u.sort((c,h)=>l.compare(c,h)),this.#t.some(c=>c.letter===b)&&u.unshift(b);let m=new Set;this.#l=[];for(let c of this.#t)m.has(c.category)||(m.add(c.category),this.#l.push(c.category));let f=n;f.hidden=!0;let B=this.#x(),F=this.hasAttribute("searchable")?this.#N():null,H=this.#M(u),g=document.createElement("div");g.className="gloss-categories",g.id=`${this.#r}-categories`,g.setAttribute("role","region"),g.setAttribute("aria-label",this.#s("terms"));let j=this.#C({numeric:!0});for(let c of this.#l){let h=this.#t.filter(p=>p.category===c).sort((p,y)=>j.compare(p.term,y.term));g.append(this.#$(c,c||a,h))}let C=[B,F,H,g].filter(Boolean);return f.before(...C),this.#n.push(...C),i&&this.#E(f),this.#i=document.createElement("div"),this.#i.className="gloss-live-region",this.#i.setAttribute("role","status"),this.#i.setAttribute("aria-live","polite"),this.#i.setAttribute("aria-atomic","true"),this.append(this.#i),this.#n.push(this.#i),this.#S(),e||this.dispatchEvent(new CustomEvent("glossary-wc:ready",{bubbles:!0,detail:{termCount:this.#t.length,categories:this.#l.map(c=>c||a)}})),!0}teardown(){this.#c&&clearTimeout(this.#c),this.#c=null;let t=this.#e;if(t){for(let{el:e,attrs:n}of t.items){for(let[r,i]of Object.entries(n))i===null?e.removeAttribute(r):e.setAttribute(r,i);t.dl.append(e)}t.dl.hidden=t.wasHidden}for(let e of this.#n)e.remove();this.#e=null,this.#n=[],this.#w=null,this.#o=null,this.#i=null,this.#t=[],this.#l=[],this.#u=new Map,this.#b=new Map}get terms(){return this.#t.map(t=>({id:t.id,term:t.term,definition:t.definition,category:t.category||this.#s("uncategorized"),...t.seeAlso.length?{seeAlso:[...t.seeAlso]}:{}}))}set terms(t){let e=Array.isArray(t)?t:[];this.#e&&this.teardown();let n=z(e,this.#s("see-also")),r=this.querySelector(":scope > dl");r?r.replaceWith(n):this.append(n),this._reinit(),this.dispatchEvent(new CustomEvent("glossary-wc:terms-changed",{detail:{terms:e,source:"property"},bubbles:!0}))}#x(){let t=this.dataset.title||(this.getAttribute("src")===this.#y?this.#v:"");if(!t)return null;let e=Math.min(6,Math.max(1,parseInt(this.dataset.headingLevel||"2",10)||2)),n=document.createElement(`h${e}`);return n.className="gloss-title",n.append(t),this.#o=document.createElement("span"),this.#o.className="gloss-count",this.#o.setAttribute("aria-hidden","true"),this.#o.textContent=this.#a(this.#t.length),n.append(" ",this.#o),n}#N(){let t=document.createElement("search");t.className="gloss-search";let e=document.createElement("input");return e.type="search",e.className="gloss-search-input",e.setAttribute("placeholder",this.#s("search-placeholder")),e.setAttribute("aria-label",this.#s("search")),e.setAttribute("aria-controls",`${this.#r}-categories`),t.append(e),this.#w=e,this.listen(e,"input",this.#k),t}#M(t){let e=document.createElement("nav");e.className="gloss-jump-bar",e.setAttribute("aria-label",this.#s("alphabet"));for(let n of t){let r=document.createElement("a");r.className="gloss-jump-letter",r.textContent=n,r.dataset.letter=n,e.append(r),this.#b.set(n,r)}return e}#$(t,e,n){let r=this.#u.size+1,i=document.createElement("section");i.className="gloss-category",t&&i.setAttribute("data-category",t);let o=document.createElement("header");o.className="gloss-category-header";let a=document.createElement("button");a.type="button",a.className="gloss-category-toggle",a.setAttribute("aria-expanded","true"),a.setAttribute("aria-controls",`${this.#r}-cat-${r}`);let d=document.createElement("span");d.className="gloss-category-label",d.textContent=e;let l=document.createElement("span");l.className="gloss-category-count",l.setAttribute("aria-hidden","true"),l.textContent=this.#a(n.length);let u=document.createElement("span");u.className="gloss-chevron",u.setAttribute("aria-hidden","true"),a.append(d,l,u),o.append(a),i.append(o);let m=document.createElement("dl");m.className="gloss-term-list",m.id=`${this.#r}-cat-${r}`;for(let f of n)f.el.classList.add("gloss-term"),f.el.dataset.letter=f.letter,m.append(f.el);return i.append(m),this.#u.set(t,{section:i,toggle:a,list:m,count:l,els:n.map(f=>f.el)}),this.listen(a,"click",()=>{a.getAttribute("aria-expanded")!=="true"?(this.#h.delete(t),this.#d.delete(t)):(this.#h.add(t),this.#f&&this.#d.add(t)),this.#A(t)}),i}#E(t){let e=document.createElement("p");e.className="gloss-error",e.setAttribute("role","alert"),e.textContent=this.#s("error"),t?t.before(e):this.append(e),this.#n.push(e)}#A(t){let e=this.#u.get(t);if(!e)return;let n=e.els.filter(i=>!i.hidden).length;e.section.hidden=n===0,e.count.textContent=this.#a(n);let r=this.#f?!this.#d.has(t):!this.#h.has(t);e.list.hidden=!r,e.toggle.setAttribute("aria-expanded",String(r))}#S(){let t=this.#I();for(let[e,n]of this.#b){let r=t.find(i=>i.letter===e&&!i.el.hidden);r?(n.href=`#${encodeURIComponent(r.id)}`,n.setAttribute("data-active",""),n.removeAttribute("aria-disabled"),n.removeAttribute("role")):(n.removeAttribute("href"),n.removeAttribute("data-active"),n.setAttribute("role","link"),n.setAttribute("aria-disabled","true"))}}#I(){let t=new Map(this.#t.map(e=>[e.el,e]));return[...this.#u.values()].flatMap(e=>e.els).map(e=>t.get(e))}#L=t=>{let n=(t.target instanceof Element?t.target:null)?.closest("a");if(!n||!this.contains(n))return;if(n.getAttribute("aria-disabled")==="true"){t.preventDefault();return}let r=n.getAttribute("href");if(!r?.startsWith("#"))return;let i=r.slice(1);try{i=decodeURIComponent(i)}catch{}let o=document.getElementById(i);if(!(!o||!this.contains(o)))for(let[a,d]of this.#u)d.list.contains(o)&&d.list.hidden&&(this.#h.delete(a),this.#d.delete(a),this.#A(a))};#k=t=>{this.#c&&clearTimeout(this.#c);let e=t.target;this.#c=setTimeout(()=>this.#R(e.value),150)};#R(t){let e=this.#p(),n=l=>{try{return l.toLocaleLowerCase(e)}catch{return l.toLowerCase()}},r=n(t.trim()),i=r!==this.#f;this.#f=r,i&&(this.#d=new Set);let o=0;for(let l of this.#t){let u=r===""||n(l.term).includes(r)||n(l.definition).includes(r);l.el.hidden=!u,u&&o++}for(let l of this.#l)this.#A(l);this.#S(),this.#o&&(this.#o.textContent=r===""?this.#a(this.#t.length):`${this.#a(o)} / ${this.#a(this.#t.length)}`);let a=r===""?this.#T("all",this.#t.length):this.#T("found",o),d=this.#i;d&&(d.textContent="",requestAnimationFrame(()=>{d.textContent=a})),this.dispatchEvent(new CustomEvent("glossary-wc:search",{bubbles:!0,detail:{query:r,matchCount:o}}))}attributeChangedCallback(t,e,n){e===n||!this.isConnected||(t==="src"||this.hasAttribute("data-upgraded"))&&this._reinit()}async#_(t){if(this.#g===t)return;this.#g=t;let e,n=null;try{let o=await fetch(t);if(!o.ok)throw new Error(`HTTP ${o.status}`);if(e=await o.json(),!e||!Array.isArray(e.terms))throw new Error("Expected { terms: [...] }")}catch(o){n=o}if(this.#g!==t||(this.#g=null,this.getAttribute("src")!==t))return;if(n){console.warn(`[glossary-wc] Failed to load src="${t}":`,n),this.#m=t,this.dispatchEvent(new CustomEvent("glossary-wc:error",{bubbles:!0,detail:{url:t,error:n}})),this._reinit();return}this.#y=t,this.#m=null,this.#e&&this.teardown();let r=z(e.terms,this.#s("see-also")),i=this.querySelector(":scope > dl");i?i.replaceWith(r):this.append(r),this.#v=e.title?String(e.title):"",this._reinit()}#p(){return this.closest("[lang]")?.getAttribute("lang")||void 0}#C(t){try{return new Intl.Collator(this.#p(),t)}catch{return new Intl.Collator(void 0,t)}}#a(t){try{return new Intl.NumberFormat(this.#p()).format(t)}catch{return String(t)}}#s(t){return this.getAttribute(`data-label-${t}`)??q[t]??""}#T(t,e){let n="other";try{n=new Intl.PluralRules(this.#p()).select(e)}catch{}return(this.getAttribute(`data-label-${t}-${n}`)??q[`${t}-${n}`]??this.#s(`${t}-other`)).replaceAll("{count}",this.#a(e))}};I("glossary-wc",S);export{S as GlossaryWc};
1
+ var St=window.matchMedia("(prefers-reduced-motion: reduce)");var L=new Map;function k(s,t,e={}){let n=e.priority??10,r={impl:t,bundle:e.bundle,contract:e.contract,priority:n},i=L.get(s);if(customElements.get(s)){if(!i||i.priority>=n){i&&i.priority===n&&i.impl!==t&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=n){i.priority===n&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${i.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}L.set(s,r),customElements.define(s,t)}var A=class extends HTMLElement{#r=[];#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.#r)t();this.#r=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,n,r){t.addEventListener(e,n,r),this.#r.push(()=>t.removeEventListener(e,n,r))}_reinit(){for(let t of this.#r)t();this.#r=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,e){this.#e||(this.#e=this.attachInternals());let n=this.#e.states;try{e?n.add(t):n.delete(t)}catch{let r=`--${t}`;e?n.add(r):n.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 V="http://www.w3.org/1999/xhtml",v="http://www.w3.org/2000/svg",W="http://www.w3.org/1998/Math/MathML",K=new Set([V,v,W]),E="user-content-",G=new Set(["script","iframe","frame","frameset","object","embed","applet","portal","fencedframe","form","base","link","meta","noscript","foreignobject","style","xmp","noembed","noframes","plaintext","mglyph","malignmark","annotation-xml"]),_=new Set(["title","desc"]),X=new Set(["animate","set","animatemotion","animatetransform"]),Y=new Set(["href","xlink:href","action","formaction","data","codebase","cite","background","longdesc","manifest","to","from","values","by"]),J=new Set(["src","poster","srcset"]),Q=new Set(["srcdoc","form","formaction","formmethod","formtarget","formenctype","formnovalidate","action","method","ping"]),Z=new Set(["popovertarget","popovertargetaction","commandfor","command","interestfor","autofocus"]),tt=new Set(["for","headers","list","aria-labelledby","aria-describedby","aria-controls","aria-owns","aria-flowto","aria-details","aria-errormessage","aria-activedescendant"]),et={"include-file":["trusted","allow-scripts","allow-cross-origin"],"markdown-viewer":["src","sanitize","ping","allow-cross-origin"]},nt=new Set(["social-embed","youtube-player","geo-map"]),rt=["src","src-dark","data-src","url","endpoint","tile-url","data-versions"],st=new Set(["audio-player","video-player","image-map","brand-mark"]);function it(s){return String(s).replace(/[\u0000- \u007f-\u009f]/g,"").toLowerCase()}function I(s,t=!1){let e=it(s);return t?/(^|,)(javascript|vbscript|livescript):/.test(e)?!0:/(^|,)data:/.test(e)?e.split(/(?=data:)/).filter(r=>r.startsWith("data:")).some(r=>!/^data:(image|audio|video|font)\//.test(r)):!1:/^(javascript|vbscript|livescript|data):/.test(e)}function R(s){let t=String(s).replace(/\/\*[\s\S]*?\*\//g,"").replace(/\\/g,"").replace(/\s+/g,"").toLowerCase();return/expression\(|javascript:|vbscript:|-moz-binding|behavior:|@import|position:fixed/.test(t)}var ot=s=>String(s.localName||s.tagName||"").toLowerCase(),at=s=>s.startsWith(E)?s:E+s;function ct(s,t){if(G.has(t))return!0;let e=s.namespaceURI;return!!(e&&!K.has(e)||t==="title"&&e!==v||_.has(t)&&e===v&&s.children?.length||X.has(t)&&(s.getAttribute("attributeName")||s.getAttribute("attributename")||"").toLowerCase().includes("href"))}function lt(s,t){for(let e of[...s.attributes]){let n=e.name.toLowerCase();if(n.startsWith("on")||Q.has(n)||!t.keepIds&&Z.has(n)){s.removeAttribute(e.name);continue}if(n==="style"){(!t.keepStyle||R(e.value))&&s.removeAttribute(e.name);continue}if((n==="id"||n==="name")&&!t.keepIds){let r=at(e.value);n==="id"?t.ids.set(e.value,r):t.ids.set(`name:${e.value}`,r),s.setAttribute(e.name,r);continue}if(Y.has(n)||n.endsWith(":href")){I(e.value,!1)&&s.removeAttribute(e.name);continue}J.has(n)&&I(e.value,!0)&&s.removeAttribute(e.name)}}function ut(s,t){let e=(s.getAttribute("type")||"").toLowerCase();t==="button"&&e!=="button"&&s.setAttribute("type","button"),t==="input"&&/^(submit|reset|image)$/.test(e)&&s.setAttribute("type","button")}function dt(s,t){for(let e of s)for(let n of[...e.attributes]){let r=n.name.toLowerCase(),i=n.value;if((r==="href"||r.endsWith(":href"))&&i.startsWith("#")){let o=ft(i.slice(1));t.has(o)&&e.setAttribute(n.name,`#${t.get(o)}`)}else if(r==="usemap"&&i.startsWith("#")){let o=t.get(`name:${i.slice(1)}`);o?e.setAttribute(n.name,`#${o}`):e.removeAttribute(n.name)}else if(tt.has(r)){let o=i.split(/\s+/).filter(Boolean).map(a=>t.get(a)||(a.startsWith(E)?a:null)).filter(Boolean);o.length?e.setAttribute(n.name,o.join(" ")):e.removeAttribute(n.name)}else i.includes("url(#")&&e.setAttribute(n.name,i.replace(/url\(#([^)]+)\)/g,(o,a)=>t.has(a)?`url(#${t.get(a)})`:o))}}function ft(s){try{return decodeURIComponent(s)}catch{return s}}function H(s){let t=s.childNodes;if(t)for(let e of[...t])e.nodeType===8?e.remove():(e.nodeType===1||e.nodeType===11)&&H(e)}function O(s,t){H(s);let e=[...s.querySelectorAll("*")];t.includeRoot&&e.unshift(s);let n=new Map,r=[],i={...t,ids:n};for(let o of e){if(!mt(o,s))continue;let a=ot(o);if(t.svgOnly&&(_.has(a)||a==="style")){if(a==="style"&&R(o.textContent||"")){o.remove();continue}}else if(ct(o,a)){o.remove();continue}if(!t.keepIds&&!t.svgOnly&&nt.has(a)){ht(o);continue}if(a==="template"){let l=o.content;l&&O(l,{...t,includeRoot:!1})}lt(o,i),t.keepIds||ut(o,a);let d=et[a];if(d)for(let l of d)o.removeAttribute(l);if(a==="include-file"&&!t.allowIncludeFile&&o.removeAttribute("src"),!t.keepIds&&!t.svgOnly&&a.includes("-")&&a!=="include-file"&&!st.has(a))for(let l of rt)o.removeAttribute(l);r.push(o)}!t.keepIds&&n.size&&dt(r,n)}function ht(s){let t=s.parentNode;if(t){for(let e of[...s.childNodes])t.insertBefore(e,s);s.remove()}}function mt(s,t){let e=s;for(;e;){if(e===t)return!0;e=e.parentNode??e.parent??null}return!1}function B(s,t={}){let e=document.createElement("template");return s&&typeof s=="string"&&(e.innerHTML=s,O(e.content,{allowIncludeFile:!!t.allowIncludeFile,keepIds:!!t.keepIds,keepStyle:!!t.keepStyle})),e.content}var pt=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function gt(s,t){let n=(()=>{try{return decodeURIComponent(location.hash.slice(1))}catch{return location.hash.slice(1)}})()===t;n||(location.hash=t);let r=s;typeof r.focus=="function"&&(r.tabIndex<0&&!r.hasAttribute("tabindex")&&r.setAttribute("tabindex","-1"),r.focus({preventScroll:!0})),(n||!r.matches?.(":target"))&&r.scrollIntoView({behavior:pt()?"auto":"smooth",block:"start"})}function P(s){let t=s;if(t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return!1;let n=(t.target instanceof Element?t.target:null)?.closest('a[href^="#"]');if(!n)return!1;let r=n.getAttribute("target");if(r&&r!=="_self"||n.hasAttribute("download"))return!1;let i=(n.getAttribute("href")??"").slice(1);if(!i)return!1;let o=i;try{o=decodeURIComponent(i)}catch{}let a=n.ownerDocument.getElementById(o);return a?(t.preventDefault(),gt(a,o),!0):!1}var q={search:"Search glossary terms","search-placeholder":"Search terms\u2026",terms:"Glossary terms",alphabet:"Alphabet navigation","found-one":"{count} term found","found-other":"{count} terms found","all-one":"Showing {count} term","all-other":"Showing all {count} terms",uncategorized:"Uncategorized","see-also":"See also:",error:"Could not load the glossary terms."},b="#",bt=0;function yt(s,t){let e=s.trim();if(!e)return"";if(typeof Intl.Segmenter=="function")try{for(let{segment:n}of new Intl.Segmenter(t,{granularity:"grapheme"}).segment(e))return n}catch{}return String.fromCodePoint(e.codePointAt(0))}function At(s,t){let e=yt(s,t);if(!e||!/^\p{L}/u.test(e))return b;try{return e.toLocaleUpperCase(t)}catch{return e.toUpperCase()}}function U(s,t){let e=new Map(s.map(r=>[String(r?.id??""),String(r?.term??"")])),n=document.createElement("dl");for(let r of s){if(!r||typeof r!="object")continue;let i=document.createElement("div");i.setAttribute("data-term-id",String(r.id??"")),r.category&&i.setAttribute("data-category",String(r.category));let o=document.createElement("dt");o.textContent=String(r.term??"");let a=document.createElement("dd");typeof r.definitionHtml=="string"&&r.definitionHtml?a.replaceChildren(B(r.definitionHtml)):a.textContent=String(r.definition??"");let d=Array.isArray(r.seeAlso)?r.seeAlso.map(String).filter(Boolean):[];if(d.length){let l=document.createElement("span");l.className="gloss-see-also",l.append(` ${t} `),d.forEach((u,m)=>{m&&l.append(", ");let h=document.createElement("a");h.href=`#${encodeURIComponent(u)}`,h.textContent=e.get(u)||u,l.append(h)}),l.append("."),a.append(l)}i.append(o,a),n.append(i)}return n}var S=class extends A{static get observedAttributes(){return["src","data-title","data-heading-level","searchable","lang"]}#r=`gloss-${++bt}`;#e=null;#n=[];#w=null;#o=null;#i=null;#c=null;#t=[];#l=[];#u=new Map;#b=new Map;#f=new Set;#d=new Set;#h="";#g=null;#y=null;#m=null;#v="";setup(){this.#h="",this.#f=new Set,this.#d=new Set;let t=this.getAttribute("src"),e=!!t&&t!==this.#y&&t!==this.#m;e&&this.#H(t),t?this.setAttribute("data-state",e?"loading":t===this.#m?"error":"ready"):this.removeAttribute("data-state");let n=this.querySelector(":scope > dl"),r=n?[...n.querySelectorAll(":scope > div[data-term-id]")]:[],i=!!t&&t===this.#m;if(r.length===0)return i&&this.#E(null),e||i;this.listen(this,"click",this.#I),this.listen(this,"click",P);let o=this.#p(),a=this.#s("uncategorized");this.#e={dl:n,wasHidden:n.hidden,items:r.map(c=>({el:c,attrs:Object.fromEntries(["id","class","hidden","data-letter"].map(f=>[f,c.getAttribute(f)]))}))};let d=0;this.#t=r.map(c=>{let f=c.getAttribute("data-term-id")||`${this.#r}-term-${++d}`,p=c.querySelector("dt"),y=c.querySelector("dd"),T=p?(p.textContent??"").trim():"",$="",x=[];if(y){let M=y.cloneNode(!0),w=M.querySelector(".gloss-see-also");w&&(x=[...w.querySelectorAll('a[href^="#"]')].map(N=>decodeURIComponent((N.getAttribute("href")??"").slice(1))),w.remove()),$=(M.textContent??"").replace(/\s+/g," ").trim()}return c.id=f,{id:f,term:T,definition:$,seeAlso:x,category:c.getAttribute("data-category")||"",el:c,letter:At(T,o)}});let l=this.#C({sensitivity:"base"}),u=[];for(let c of this.#t){if(c.letter===b)continue;let f=u.findIndex(p=>l.compare(p,c.letter)===0);f===-1?u.push(c.letter):u[f].normalize("NFD")!==u[f]&&c.letter.normalize("NFD")===c.letter&&(u[f]=c.letter)}for(let c of this.#t)c.letter!==b&&(c.letter=u.find(f=>l.compare(f,c.letter)===0)??c.letter);u.sort((c,f)=>l.compare(c,f)),this.#t.some(c=>c.letter===b)&&u.unshift(b);let m=new Set;this.#l=[];for(let c of this.#t)m.has(c.category)||(m.add(c.category),this.#l.push(c.category));let h=n;h.hidden=!0;let j=this.#$(),D=this.hasAttribute("searchable")?this.#x():null,F=this.#M(u),g=document.createElement("div");g.className="gloss-categories",g.id=`${this.#r}-categories`,g.setAttribute("role","region"),g.setAttribute("aria-label",this.#s("terms"));let z=this.#C({numeric:!0});for(let c of this.#l){let f=this.#t.filter(p=>p.category===c).sort((p,y)=>z.compare(p.term,y.term));g.append(this.#L(c,c||a,f))}let C=[j,D,F,g].filter(Boolean);return h.before(...C),this.#n.push(...C),i&&this.#E(h),this.#i=document.createElement("div"),this.#i.className="gloss-live-region",this.#i.setAttribute("role","status"),this.#i.setAttribute("aria-live","polite"),this.#i.setAttribute("aria-atomic","true"),this.append(this.#i),this.#n.push(this.#i),this.#S(),e||this.dispatchEvent(new CustomEvent("glossary-wc:ready",{bubbles:!0,detail:{termCount:this.#t.length,categories:this.#l.map(c=>c||a)}})),!0}teardown(){this.#c&&clearTimeout(this.#c),this.#c=null;let t=this.#e;if(t){for(let{el:e,attrs:n}of t.items){for(let[r,i]of Object.entries(n))i===null?e.removeAttribute(r):e.setAttribute(r,i);t.dl.append(e)}t.dl.hidden=t.wasHidden}for(let e of this.#n)e.remove();this.#e=null,this.#n=[],this.#w=null,this.#o=null,this.#i=null,this.#t=[],this.#l=[],this.#u=new Map,this.#b=new Map}get terms(){return this.#t.map(t=>({id:t.id,term:t.term,definition:t.definition,category:t.category||this.#s("uncategorized"),...t.seeAlso.length?{seeAlso:[...t.seeAlso]}:{}}))}set terms(t){let e=Array.isArray(t)?t:[];this.#e&&this.teardown();let n=U(e,this.#s("see-also")),r=this.querySelector(":scope > dl");r?r.replaceWith(n):this.append(n),this._reinit(),this.dispatchEvent(new CustomEvent("glossary-wc:terms-changed",{detail:{terms:e,source:"property"},bubbles:!0}))}#$(){let t=this.dataset.title||(this.getAttribute("src")===this.#y?this.#v:"");if(!t)return null;let e=Math.min(6,Math.max(1,parseInt(this.dataset.headingLevel||"2",10)||2)),n=document.createElement(`h${e}`);return n.className="gloss-title",n.append(t),this.#o=document.createElement("span"),this.#o.className="gloss-count",this.#o.setAttribute("aria-hidden","true"),this.#o.textContent=this.#a(this.#t.length),n.append(" ",this.#o),n}#x(){let t=document.createElement("search");t.className="gloss-search";let e=document.createElement("input");return e.type="search",e.className="gloss-search-input",e.setAttribute("placeholder",this.#s("search-placeholder")),e.setAttribute("aria-label",this.#s("search")),e.setAttribute("aria-controls",`${this.#r}-categories`),t.append(e),this.#w=e,this.listen(e,"input",this.#_),t}#M(t){let e=document.createElement("nav");e.className="gloss-jump-bar",e.setAttribute("aria-label",this.#s("alphabet"));for(let n of t){let r=document.createElement("a");r.className="gloss-jump-letter",r.textContent=n,r.dataset.letter=n,e.append(r),this.#b.set(n,r)}return e}#L(t,e,n){let r=this.#u.size+1,i=document.createElement("section");i.className="gloss-category",t&&i.setAttribute("data-category",t);let o=document.createElement("header");o.className="gloss-category-header";let a=document.createElement("button");a.type="button",a.className="gloss-category-toggle",a.setAttribute("aria-expanded","true"),a.setAttribute("aria-controls",`${this.#r}-cat-${r}`);let d=document.createElement("span");d.className="gloss-category-label",d.textContent=e;let l=document.createElement("span");l.className="gloss-category-count",l.setAttribute("aria-hidden","true"),l.textContent=this.#a(n.length);let u=document.createElement("span");u.className="gloss-chevron",u.setAttribute("aria-hidden","true"),a.append(d,l,u),o.append(a),i.append(o);let m=document.createElement("dl");m.className="gloss-term-list",m.id=`${this.#r}-cat-${r}`;for(let h of n)h.el.classList.add("gloss-term"),h.el.dataset.letter=h.letter,m.append(h.el);return i.append(m),this.#u.set(t,{section:i,toggle:a,list:m,count:l,els:n.map(h=>h.el)}),this.listen(a,"click",()=>{a.getAttribute("aria-expanded")!=="true"?(this.#f.delete(t),this.#d.delete(t)):(this.#f.add(t),this.#h&&this.#d.add(t)),this.#A(t)}),i}#E(t){let e=document.createElement("p");e.className="gloss-error",e.setAttribute("role","alert"),e.textContent=this.#s("error"),t?t.before(e):this.append(e),this.#n.push(e)}#A(t){let e=this.#u.get(t);if(!e)return;let n=e.els.filter(i=>!i.hidden).length;e.section.hidden=n===0,e.count.textContent=this.#a(n);let r=this.#h?!this.#d.has(t):!this.#f.has(t);e.list.hidden=!r,e.toggle.setAttribute("aria-expanded",String(r))}#S(){let t=this.#k();for(let[e,n]of this.#b){let r=t.find(i=>i.letter===e&&!i.el.hidden);r?(n.href=`#${encodeURIComponent(r.id)}`,n.setAttribute("data-active",""),n.removeAttribute("aria-disabled"),n.removeAttribute("role"),n.removeAttribute("tabindex")):(n.removeAttribute("href"),n.removeAttribute("data-active"),n.setAttribute("role","link"),n.setAttribute("aria-disabled","true"),n.setAttribute("tabindex","0"))}}#k(){let t=new Map(this.#t.map(e=>[e.el,e]));return[...this.#u.values()].flatMap(e=>e.els).map(e=>t.get(e))}#I=t=>{let n=(t.target instanceof Element?t.target:null)?.closest("a");if(!n||!this.contains(n))return;if(n.getAttribute("aria-disabled")==="true"){t.preventDefault();return}let r=n.getAttribute("href");if(!r?.startsWith("#"))return;let i=r.slice(1);try{i=decodeURIComponent(i)}catch{}let o=document.getElementById(i);if(!(!o||!this.contains(o)))for(let[a,d]of this.#u)d.list.contains(o)&&d.list.hidden&&(this.#f.delete(a),this.#d.delete(a),this.#A(a))};#_=t=>{this.#c&&clearTimeout(this.#c);let e=t.target;this.#c=setTimeout(()=>this.#R(e.value),150)};#R(t){let e=this.#p(),n=l=>{try{return l.toLocaleLowerCase(e)}catch{return l.toLowerCase()}},r=n(t.trim()),i=r!==this.#h;this.#h=r,i&&(this.#d=new Set);let o=0;for(let l of this.#t){let u=r===""||n(l.term).includes(r)||n(l.definition).includes(r);l.el.hidden=!u,u&&o++}for(let l of this.#l)this.#A(l);this.#S(),this.#o&&(this.#o.textContent=r===""?this.#a(this.#t.length):`${this.#a(o)} / ${this.#a(this.#t.length)}`);let a=r===""?this.#T("all",this.#t.length):this.#T("found",o),d=this.#i;d&&(d.textContent="",requestAnimationFrame(()=>{d.textContent=a})),this.dispatchEvent(new CustomEvent("glossary-wc:search",{bubbles:!0,detail:{query:r,matchCount:o}}))}attributeChangedCallback(t,e,n){e===n||!this.isConnected||(t==="src"||this.hasAttribute("data-upgraded"))&&this._reinit()}async#H(t){if(this.#g===t)return;this.#g=t;let e,n=null;try{let o=await fetch(t);if(!o.ok)throw new Error(`HTTP ${o.status}`);if(e=await o.json(),!e||!Array.isArray(e.terms))throw new Error("Expected { terms: [...] }")}catch(o){n=o}if(this.#g!==t||(this.#g=null,this.getAttribute("src")!==t))return;if(n){console.warn(`[glossary-wc] Failed to load src="${t}":`,n),this.#m=t,this.dispatchEvent(new CustomEvent("glossary-wc:error",{bubbles:!0,detail:{url:t,error:n}})),this._reinit();return}this.#y=t,this.#m=null,this.#e&&this.teardown();let r=U(e.terms,this.#s("see-also")),i=this.querySelector(":scope > dl");i?i.replaceWith(r):this.append(r),this.#v=e.title?String(e.title):"",this._reinit()}#p(){return this.closest("[lang]")?.getAttribute("lang")||void 0}#C(t){try{return new Intl.Collator(this.#p(),t)}catch{return new Intl.Collator(void 0,t)}}#a(t){try{return new Intl.NumberFormat(this.#p()).format(t)}catch{return String(t)}}#s(t){return this.getAttribute(`data-label-${t}`)??q[t]??""}#T(t,e){let n="other";try{n=new Intl.PluralRules(this.#p()).select(e)}catch{}return(this.getAttribute(`data-label-${t}-${n}`)??q[`${t}-${n}`]??this.#s(`${t}-other`)).replaceAll("{count}",this.#a(e))}};k("glossary-wc",S);export{S as GlossaryWc};
2
2
  //# sourceMappingURL=glossary-wc.js.map
@@ -1,2 +1,2 @@
1
- var B=window.matchMedia("(prefers-reduced-motion: reduce)");var b=new Map;function y(n,e,t={}){let r=t.priority??10,i={impl:e,bundle:t.bundle,contract:t.contract,priority:r},a=b.get(n);if(customElements.get(n)){if(!a||a.priority>=r){a&&a.priority===r&&a.impl!==e&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${a.bundle}" (priority ${a.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${n}> defined by "${a.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(a&&a.priority>=r){a.priority===r&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${a.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}b.set(n,i),customElements.define(n,e)}var l=class extends HTMLElement{#t=[];#e;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,r,i){e.addEventListener(t,r,i),this.#t.push(()=>e.removeEventListener(t,r,i))}_reinit(){for(let e of this.#t)e();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,t){this.#e||(this.#e=this.attachInternals());let r=this.#e.states;try{t?r.add(e):r.delete(e)}catch{let i=`--${e}`;t?r.add(i):r.delete(i)}}_adoptInternals(e){this.#e||(this.#e=e)}#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 k=["position:absolute","inline-size:1px","block-size:1px","padding:0","margin:-1px","overflow:hidden","clip-path:inset(50%)","white-space:nowrap","border:0"].join(";"),g=new WeakMap;function C(n,e){let t=g.get(e);t||g.set(e,t=new Map);let r=t.get(n);if(!r||!r.region.isConnected){let a=(e.ownerDocument||document).createElement("span");a.setAttribute("data-vb-announcer",n),a.setAttribute("role",n==="assertive"?"alert":"status"),a.setAttribute("aria-live",n),a.setAttribute("aria-atomic","true"),a.style.cssText=k,e.appendChild(a),r={region:a},t.set(n,r)}return r}function v(n,{politeness:e="polite",root:t}={}){let r=String(n??"").trim();if(!r||typeof document>"u")return null;let i=t||document.body;if(!i)return null;let o=C(e==="assertive"?"assertive":"polite",i);return clearTimeout(o.write),clearTimeout(o.clear),o.region.textContent="",o.write=setTimeout(()=>{o.region.textContent=r,o.clear=setTimeout(()=>{o.region.textContent=""},7e3)},50),o.region}function s(n,e,t,r){let i=`data-label-${e}`,o=n?.closest?.(`[${i}]`)?.getAttribute(i)||t;return r?o.replace(/\{(\w+)\}/g,(u,m)=>m in r?String(r[m]):u):o}var E=1500,T="[data-copy], [data-copy-target], [data-paste-target]",c={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"},f=new WeakMap;function M(n){if(typeof document.execCommand!="function"||!document.body)return!1;let e=document.activeElement,t=document.createElement("textarea");t.value=n,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 r=!1;try{r=document.execCommand("copy")}catch{r=!1}return t.remove(),e?.focus?.({preventScroll:!0}),r}function L(n){if(!n)return!1;if(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)return n.focus(),n.select(),!0;let e=window.getSelection?.();if(!e)return!1;let t=document.createRange();return t.selectNodeContents(n),e.removeAllRanges(),e.addRange(t),!e.isCollapsed}async function p(n,e={}){if(n==null||n==="")return!1;let{button:t,duration:r=E}=e,i=!1,a=null;try{if(!navigator.clipboard?.writeText)throw new Error("Clipboard API unavailable");await navigator.clipboard.writeText(n),i=!0}catch(u){a=u,i=M(n)}if(i)return d({button:t,duration:r,state:"copied",eventName:"copy:done",eventDetail:{text:n},message:e.announceMessage??s(t,"copied",c.copied)}),!0;let o=L(e.source);return d({button:t,duration:r,state:"failed",eventName:"copy:error",eventDetail:{text:n,error:a},message:e.failureMessage??s(t,"copy-failed",o?c["copy-failed-selected"]:c["copy-failed"])}),!1}function d({button:n,duration:e,message:t,eventDetail:r,state:i,eventName:a}){if(n){n.dataset.state=i;let o=f.get(n);o&&clearTimeout(o),f.set(n,setTimeout(()=>{n.dataset.state===i&&delete n.dataset.state,f.delete(n)},e)),n.dispatchEvent(new CustomEvent(a,{bubbles:!0,detail:r}))}v(t,{politeness:i==="failed"?"assertive":"polite"})}async function S(n,e={}){let{button:t,duration:r=E}=e,i;try{if(!navigator.clipboard?.readText)throw new Error("Clipboard API unavailable");i=await navigator.clipboard.readText()}catch(a){return d({button:t,duration:r,state:"failed",eventName:"paste:error",eventDetail:{target:n,error:a},message:e.failureMessage??s(t,"paste-failed",c["paste-failed"])}),null}return n&&(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement?n.value=i:n.textContent=i,n.dispatchEvent(new Event("input",{bubbles:!0}))),d({button:t,duration:r,state:"pasted",eventName:"paste:done",eventDetail:{text:i,target:n},message:e.announceMessage??s(t,"pasted",c.pasted)}),i}function w(n){let e=n.dataset.copyTarget;if(!e)return null;try{return document.querySelector(e)}catch{return null}}function $(n){if(n.dataset.copy)return n.dataset.copy;let e=w(n);if(!e)return"";let t=n.dataset.copyAttr;return t?e.getAttribute(t)??"":e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?e.value:e.textContent??""}function N(n){let e=n.target?.closest?.(T);if(!e||e.matches(':disabled, [aria-disabled="true"]'))return;if(e.dataset.pasteTarget){let r=null;try{r=document.querySelector(e.dataset.pasteTarget)}catch{}if(!r)return;S(r,{button:e});return}let t=$(e);t&&p(t,{button:e,source:w(e)??void 0})}typeof document<"u"&&!document.__vbCopyDelegated&&(document.__vbCopyDelegated=!0,document.addEventListener("click",N));var D=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function A(n,e){let r=(()=>{try{return decodeURIComponent(location.hash.slice(1))}catch{return location.hash.slice(1)}})()===e;r||(location.hash=e);let i=n;typeof i.focus=="function"&&(i.tabIndex<0&&!i.hasAttribute("tabindex")&&i.setAttribute("tabindex","-1"),i.focus({preventScroll:!0})),(r||!i.matches?.(":target"))&&i.scrollIntoView({behavior:D()?"auto":"smooth",block:"start"})}var I="dialog, [data-toc-ignore], browser-window";function x(n){return!!n.closest(I)}var _=["h2","h3"],R=1500,q=0;function F(n){let e=String(n).normalize("NFC").toLowerCase().trim().replace(/[^\p{L}\p{M}\p{N}\s_-]/gu,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");return Array.from(e).slice(0,50).join("").replace(/-$/,"")||"section"}function V(n,e){let t=n,r=1;for(;e(t);)t=`${n}-${r++}`;return t}function H(n){let e=(n??"").split(",").map(t=>t.trim().toLowerCase()).filter(t=>/^h[1-6]$/.test(t));return e.length?[...new Set(e)]:_}var h=class extends l{static get observedAttributes(){return["levels","data-label-anchor"]}#t;#e=new WeakMap;setup(){this.#r(),this.listen(this,"click",this.#s),this.#t=new MutationObserver(e=>{e.some(t=>t.type==="childList")&&this.#r()}),this.#t.observe(this,{childList:!0,subtree:!0})}teardown(){this.#t?.disconnect(),this.#t=void 0}attributeChangedCallback(e,t,r){t===r||!this.hasAttribute("data-upgraded")||this.#r()}get#n(){return this.getAttribute("data-label-anchor")||"Copy link to"}#i(e){return e.closest("heading-links")!==this?!1:!x(e)}#r(){let e=H(this.getAttribute("levels")).join(","),t=this.#n;for(let r of this.querySelectorAll(".heading-anchor[data-heading-links]")){if(r.closest("heading-links")!==this)continue;let i=r.parentElement;!i||!i.matches(e)||!this.#i(i)?this.#o(i,r):r.getAttribute("aria-label")!==t&&r.setAttribute("aria-label",t)}for(let r of this.querySelectorAll(e))this.#i(r)&&this.#a(r)}#a(e){if(e.id||(e.id=V(F(e.textContent??""),o=>!!document.getElementById(o))),e.querySelector(":scope > .heading-anchor"))return;let t=++q,r=document.createElement("span");r.className="heading-text",r.id=`heading-links-text-${t}`,r.append(...e.childNodes),e.append(r),!e.hasAttribute("aria-label")&&!e.hasAttribute("aria-labelledby")&&(e.setAttribute("aria-labelledby",r.id),e.setAttribute("data-heading-links-labelled",""));let i=document.createElement("a");i.className="heading-anchor",i.id=`heading-links-anchor-${t}`,i.dataset.headingLinks="",i.href=`#${e.id}`,i.setAttribute("aria-label",this.#n),i.setAttribute("aria-labelledby",`${i.id} ${r.id}`);let a=document.createElement("icon-wc");a.setAttribute("name","link"),a.setAttribute("size","sm"),i.append(a),e.append(i),e.hasAttribute("tabindex")||e.setAttribute("tabindex","-1")}#o(e,t){if(t.remove(),!e)return;let r=e.querySelector(":scope > .heading-text");r&&r.replaceWith(...r.childNodes),e.hasAttribute("data-heading-links-labelled")&&(e.removeAttribute("aria-labelledby"),e.removeAttribute("data-heading-links-labelled"))}#s=e=>{let t=e,i=(t.target instanceof Element?t.target:null)?.closest("a.heading-anchor[data-heading-links]");if(!i||i.closest("heading-links")!==this||t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;let a=i.parentElement;a?.id&&(t.preventDefault(),this.#c(a,i))};async#c(e,t){A(e,e.id);let r=new URL(document.URL);if(r.hash=e.id,this.dispatchEvent(new CustomEvent("heading-links:navigate",{bubbles:!0,detail:{id:e.id,url:r.href,heading:e}})),!await p(r.href,{announceMessage:this.getAttribute("data-label-copied")||"Link copied to clipboard"}))return;let a=t.querySelector("icon-wc");t.dataset.state="copied",a?.setAttribute("name","check"),clearTimeout(this.#e.get(t)),this.#e.set(t,setTimeout(()=>{delete t.dataset.state,a?.setAttribute("name","link"),this.#e.delete(t)},R))}};y("heading-links",h);export{h as HeadingLinks,F as headingSlug,H as parseLevels,V as uniqueSlug};
1
+ var K=window.matchMedia("(prefers-reduced-motion: reduce)");var m=new Map;function y(n,e,t={}){let r=t.priority??10,i={impl:e,bundle:t.bundle,contract:t.contract,priority:r},o=m.get(n);if(customElements.get(n)){if(!o||o.priority>=r){o&&o.priority===r&&o.impl!==e&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${o.bundle}" (priority ${o.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${n}> defined by "${o.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(o&&o.priority>=r){o.priority===r&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${o.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}m.set(n,i),customElements.define(n,e)}var l=class extends HTMLElement{#t=[];#e;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,r,i){e.addEventListener(t,r,i),this.#t.push(()=>e.removeEventListener(t,r,i))}_reinit(){for(let e of this.#t)e();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,t){this.#e||(this.#e=this.attachInternals());let r=this.#e.states;try{t?r.add(e):r.delete(e)}catch{let i=`--${e}`;t?r.add(i):r.delete(i)}}_adoptInternals(e){this.#e||(this.#e=e)}#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 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(";"),g=new WeakMap;function T(n,e){let t=g.get(e);t||g.set(e,t=new Map);let r=t.get(n);if(!r||!r.region.isConnected){let o=(e.ownerDocument||document).createElement("span");o.setAttribute("data-vb-announcer",n),o.setAttribute("role",n==="assertive"?"alert":"status"),o.setAttribute("aria-live",n),o.setAttribute("aria-atomic","true"),o.style.cssText=x,e.appendChild(o),r={region:o},t.set(n,r)}return r}function v(n,{politeness:e="polite",root:t}={}){let r=String(n??"").trim();if(!r||typeof document>"u")return null;let i=t||document.body;if(!i)return null;let a=T(e==="assertive"?"assertive":"polite",i);return clearTimeout(a.write),clearTimeout(a.clear),a.region.textContent="",a.write=setTimeout(()=>{a.region.textContent=r,a.clear=setTimeout(()=>{a.region.textContent=""},7e3)},50),a.region}function s(n,e,t,r){let i=`data-label-${e}`,a=n?.closest?.(`[${i}]`)?.getAttribute(i)||t;return r?a.replace(/\{(\w+)\}/g,(u,b)=>b in r?String(r[b]):u):a}var E=1500,k="[data-copy], [data-copy-target], [data-paste-target]",c={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"},f=new WeakMap;function S(n){if(typeof document.execCommand!="function"||!document.body)return!1;let e=document.activeElement,t=document.createElement("textarea");t.value=n,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 r=!1;try{r=document.execCommand("copy")}catch{r=!1}return t.remove(),e?.focus?.({preventScroll:!0}),r}function $(n){if(!n)return!1;if(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)return n.focus(),n.select(),!0;let e=window.getSelection?.();if(!e)return!1;let t=document.createRange();return t.selectNodeContents(n),e.removeAllRanges(),e.addRange(t),!e.isCollapsed}async function p(n,e={}){if(n==null||n==="")return!1;let{button:t,duration:r=E}=e,i=!1,o=null;try{if(!navigator.clipboard?.writeText)throw new Error("Clipboard API unavailable");await navigator.clipboard.writeText(n),i=!0}catch(u){o=u,i=S(n)}if(i)return d({button:t,duration:r,state:"copied",eventName:"copy:done",eventDetail:{text:n},message:e.announceMessage??s(t,"copied",c.copied)}),!0;let a=$(e.source);return d({button:t,duration:r,state:"failed",eventName:"copy:error",eventDetail:{text:n,error:o},message:e.failureMessage??s(t,"copy-failed",a?c["copy-failed-selected"]:c["copy-failed"])}),!1}function d({button:n,duration:e,message:t,eventDetail:r,state:i,eventName:o}){if(n){n.dataset.state=i;let a=f.get(n);a&&clearTimeout(a),f.set(n,setTimeout(()=>{n.dataset.state===i&&delete n.dataset.state,f.delete(n)},e)),n.dispatchEvent(new CustomEvent(o,{bubbles:!0,detail:r}))}v(t,{politeness:i==="failed"?"assertive":"polite"})}async function M(n,e={}){let{button:t,duration:r=E}=e,i;try{if(!navigator.clipboard?.readText)throw new Error("Clipboard API unavailable");i=await navigator.clipboard.readText()}catch(o){return d({button:t,duration:r,state:"failed",eventName:"paste:error",eventDetail:{target:n,error:o},message:e.failureMessage??s(t,"paste-failed",c["paste-failed"])}),null}return n&&(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement?n.value=i:n.textContent=i,n.dispatchEvent(new Event("input",{bubbles:!0}))),d({button:t,duration:r,state:"pasted",eventName:"paste:done",eventDetail:{text:i,target:n},message:e.announceMessage??s(t,"pasted",c.pasted)}),i}function w(n){let e=n.dataset.copyTarget;if(!e)return null;try{return document.querySelector(e)}catch{return null}}function L(n){if(n.dataset.copy)return n.dataset.copy;let e=w(n);if(!e)return"";let t=n.dataset.copyAttr;return t?e.getAttribute(t)??"":e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?e.value:e.textContent??""}function _(n){let e=n.target?.closest?.(k);if(!e||e.matches(':disabled, [aria-disabled="true"]'))return;if(e.dataset.pasteTarget){let r=null;try{r=document.querySelector(e.dataset.pasteTarget)}catch{}if(!r)return;M(r,{button:e});return}let t=L(e);t&&p(t,{button:e,source:w(e)??void 0})}typeof document<"u"&&!document.__vbCopyDelegated&&(document.__vbCopyDelegated=!0,document.addEventListener("click",_));var P=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function A(n,e){let r=(()=>{try{return decodeURIComponent(location.hash.slice(1))}catch{return location.hash.slice(1)}})()===e;r||(location.hash=e);let i=n;typeof i.focus=="function"&&(i.tabIndex<0&&!i.hasAttribute("tabindex")&&i.setAttribute("tabindex","-1"),i.focus({preventScroll:!0})),(r||!i.matches?.(":target"))&&i.scrollIntoView({behavior:P()?"auto":"smooth",block:"start"})}var I="dialog, [data-toc-ignore], browser-window";function C(n){return!!n.closest(I)}var D=["h2","h3"],H=1500,q=0;function B(n){let e=String(n).normalize("NFC").toLowerCase().trim().replace(/[^\p{L}\p{M}\p{N}\s_-]/gu,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");return Array.from(e).slice(0,50).join("").replace(/-$/,"")||"section"}function F(n,e){let t=n,r=1;for(;e(t);)t=`${n}-${r++}`;return t}function R(n){let e=(n??"").split(",").map(t=>t.trim().toLowerCase()).filter(t=>/^h[1-6]$/.test(t));return e.length?[...new Set(e)]:D}var h=class extends l{static get observedAttributes(){return["levels","data-label-anchor"]}#t;#e=new WeakMap;setup(){this.#r(),this.listen(this,"click",this.#s),this.#t=new MutationObserver(e=>{e.some(t=>t.type==="childList")&&this.#r()}),this.#t.observe(this,{childList:!0,subtree:!0})}teardown(){this.#t?.disconnect(),this.#t=void 0}attributeChangedCallback(e,t,r){t===r||!this.hasAttribute("data-upgraded")||this.#r()}get#n(){return this.getAttribute("data-label-anchor")||"Copy link to"}#i(e){return e.closest("heading-links")!==this?!1:!C(e)}#r(){let e=R(this.getAttribute("levels")).join(","),t=this.#n;for(let r of this.querySelectorAll(".heading-anchor[data-heading-links]")){if(r.closest("heading-links")!==this)continue;let i=r.parentElement;!i||!i.matches(e)||!this.#i(i)?this.#a(i,r):r.getAttribute("aria-label")!==t&&r.setAttribute("aria-label",t)}for(let r of this.querySelectorAll(e))this.#i(r)&&this.#o(r)}#o(e){if(e.id||(e.id=F(B(e.textContent??""),a=>!!document.getElementById(a))),e.querySelector(":scope > .heading-anchor"))return;let t=++q,r=document.createElement("span");r.className="heading-text",r.id=`heading-links-text-${t}`,r.append(...e.childNodes),e.append(r),!e.hasAttribute("aria-label")&&!e.hasAttribute("aria-labelledby")&&(e.setAttribute("aria-labelledby",r.id),e.setAttribute("data-heading-links-labelled",""));let i=document.createElement("a");i.className="heading-anchor",i.id=`heading-links-anchor-${t}`,i.dataset.headingLinks="",i.href=`#${e.id}`,i.setAttribute("aria-label",this.#n),i.setAttribute("aria-labelledby",`${i.id} ${r.id}`);let o=document.createElement("icon-wc");o.setAttribute("name","link"),o.setAttribute("size","sm"),i.append(o),e.append(i),e.hasAttribute("tabindex")||e.setAttribute("tabindex","-1")}#a(e,t){if(t.remove(),!e)return;let r=e.querySelector(":scope > .heading-text");r&&r.replaceWith(...r.childNodes),e.hasAttribute("data-heading-links-labelled")&&(e.removeAttribute("aria-labelledby"),e.removeAttribute("data-heading-links-labelled"))}#s=e=>{let t=e,i=(t.target instanceof Element?t.target:null)?.closest("a.heading-anchor[data-heading-links]");if(!i||i.closest("heading-links")!==this||t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;let o=i.parentElement;o?.id&&(t.preventDefault(),this.#c(o,i))};async#c(e,t){A(e,e.id);let r=new URL(document.URL);if(r.hash=e.id,this.dispatchEvent(new CustomEvent("heading-links:navigate",{bubbles:!0,detail:{id:e.id,url:r.href,heading:e}})),!await p(r.href,{announceMessage:this.getAttribute("data-label-copied")||"Link copied to clipboard"}))return;let o=t.querySelector("icon-wc");t.dataset.state="copied",o?.setAttribute("name","check"),clearTimeout(this.#e.get(t)),this.#e.set(t,setTimeout(()=>{delete t.dataset.state,o?.setAttribute("name","link"),this.#e.delete(t)},H))}};y("heading-links",h);export{h as HeadingLinks,B as headingSlug,R as parseLevels,F as uniqueSlug};
2
2
  //# sourceMappingURL=heading-links.js.map