vanilla-breeze 0.5.0 → 0.6.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 (263) hide show
  1. package/custom-elements.json +22381 -13213
  2. package/dist/cdn/components/accordion-wc.js +1 -1
  3. package/dist/cdn/components/activity-feed.js +1 -1
  4. package/dist/cdn/components/ai-chat.js +5 -5
  5. package/dist/cdn/components/ai-summary.js +2 -2
  6. package/dist/cdn/components/analytics-panel.js +2 -2
  7. package/dist/cdn/components/audio-player.js +4 -4
  8. package/dist/cdn/components/audio-visualizer.js +2 -2
  9. package/dist/cdn/components/author-index.js +2 -2
  10. package/dist/cdn/components/brand-mark.js +1 -1
  11. package/dist/cdn/components/bread-crumb.js +1 -1
  12. package/dist/cdn/components/calendar-wc.js +2 -2
  13. package/dist/cdn/components/card-list.js +1 -1
  14. package/dist/cdn/components/carousel-wc.js +1 -1
  15. package/dist/cdn/components/change-set.js +1 -1
  16. package/dist/cdn/components/chart-wc.js +6 -6
  17. package/dist/cdn/components/chat-input.js +1 -1
  18. package/dist/cdn/components/chat-window.js +1 -1
  19. package/dist/cdn/components/color-picker.js +1 -1
  20. package/dist/cdn/components/combo-box.js +1 -1
  21. package/dist/cdn/components/command-palette.js +1 -1
  22. package/dist/cdn/components/comment-box.js +51 -50
  23. package/dist/cdn/components/comment-thread.js +50 -49
  24. package/dist/cdn/components/comment-wc.js +1 -1
  25. package/dist/cdn/components/compare-surface.js +1 -1
  26. package/dist/cdn/components/consent-banner.js +1 -1
  27. package/dist/cdn/components/content-lens.js +1 -1
  28. package/dist/cdn/components/content-swap.js +1 -1
  29. package/dist/cdn/components/context-menu.js +1 -1
  30. package/dist/cdn/components/data-table.js +1 -1
  31. package/dist/cdn/components/date-picker.js +1 -1
  32. package/dist/cdn/components/day-view.js +1 -1
  33. package/dist/cdn/components/diagram-wc.js +2 -2
  34. package/dist/cdn/components/drag-surface.js +1 -1
  35. package/dist/cdn/components/drop-down.js +1 -1
  36. package/dist/cdn/components/emoji-picker.js +1 -1
  37. package/dist/cdn/components/flow-diagram.js +1 -1
  38. package/dist/cdn/components/foot-notes.js +1 -1
  39. package/dist/cdn/components/form-field.js +1 -1
  40. package/dist/cdn/components/geo-map.js +170 -54
  41. package/dist/cdn/components/glossary-index.js +1 -1
  42. package/dist/cdn/components/glossary-wc.js +1 -1
  43. package/dist/cdn/components/heading-links.js +1 -1
  44. package/dist/cdn/components/highlight-wc.js +6 -2
  45. package/dist/cdn/components/icon-wc.js +11 -10
  46. package/dist/cdn/components/image-gallery.js +1 -1
  47. package/dist/cdn/components/image-map.js +1 -1
  48. package/dist/cdn/components/include-file.js +1 -1
  49. package/dist/cdn/components/manifest.json +101 -101
  50. package/dist/cdn/components/markdown-editor.js +60 -1
  51. package/dist/cdn/components/markdown-viewer.js +50 -49
  52. package/dist/cdn/components/nav-bar.js +1 -1
  53. package/dist/cdn/components/note-wc.js +6 -2
  54. package/dist/cdn/components/notification-wc.js +33 -32
  55. package/dist/cdn/components/page-info.js +6 -72
  56. package/dist/cdn/components/page-stats.js +1 -1
  57. package/dist/cdn/components/page-toc.js +1 -1
  58. package/dist/cdn/components/page-tools.js +1 -1
  59. package/dist/cdn/components/page-tour.js +1 -38
  60. package/dist/cdn/components/pager-wc.js +1 -1
  61. package/dist/cdn/components/poll-wc.js +1 -1
  62. package/dist/cdn/components/pop-over.js +1 -1
  63. package/dist/cdn/components/popularity-index.js +1 -8
  64. package/dist/cdn/components/print-page.js +1 -1
  65. package/dist/cdn/components/progress-tracker.js +1 -1
  66. package/dist/cdn/components/qr-code.js +1 -1
  67. package/dist/cdn/components/reaction-bar.js +1 -1
  68. package/dist/cdn/components/reader-view.js +25 -25
  69. package/dist/cdn/components/reading-progress.js +1 -1
  70. package/dist/cdn/components/recently-visited.js +1 -26
  71. package/dist/cdn/components/score-card.js +21 -5
  72. package/dist/cdn/components/selection-menu.js +1 -1
  73. package/dist/cdn/components/settings-panel.js +88 -142
  74. package/dist/cdn/components/share-wc.js +2 -2
  75. package/dist/cdn/components/short-cuts.js +1 -1
  76. package/dist/cdn/components/site-index.js +1 -10
  77. package/dist/cdn/components/site-map.js +1 -1
  78. package/dist/cdn/components/site-search.js +1 -51
  79. package/dist/cdn/components/slide-accept.js +1 -1
  80. package/dist/cdn/components/social-embed.js +1 -1
  81. package/dist/cdn/components/split-surface.js +1 -1
  82. package/dist/cdn/components/star-rating.js +1 -1
  83. package/dist/cdn/components/status-wc.js +1 -1
  84. package/dist/cdn/components/stepper-wc.js +1 -1
  85. package/dist/cdn/components/tab-set.js +1 -1
  86. package/dist/cdn/components/text-reader.js +2 -2
  87. package/dist/cdn/components/theme-picker.js +86 -83
  88. package/dist/cdn/components/time-index.js +1 -11
  89. package/dist/cdn/components/time-picker.js +1 -1
  90. package/dist/cdn/components/toast-msg.js +6 -6
  91. package/dist/cdn/components/tool-tip.js +1 -1
  92. package/dist/cdn/components/topic-map.js +6 -3
  93. package/dist/cdn/components/trust-filter.js +1 -3
  94. package/dist/cdn/components/version-switcher.js +5 -5
  95. package/dist/cdn/components/video-player.js +67 -9
  96. package/dist/cdn/components/watch-wc.js +6 -2
  97. package/dist/cdn/components/week-view.js +1 -1
  98. package/dist/cdn/components/youtube-player.js +1 -1
  99. package/dist/cdn/emoji-extended.js +2 -0
  100. package/dist/cdn/fonts/atkinson-hyperlegible-OFL.txt +93 -0
  101. package/dist/cdn/fonts/atkinson-hyperlegible-latin-400-italic.woff2 +0 -0
  102. package/dist/cdn/fonts/atkinson-hyperlegible-latin-400-normal.woff2 +0 -0
  103. package/dist/cdn/fonts/atkinson-hyperlegible-latin-700-italic.woff2 +0 -0
  104. package/dist/cdn/fonts/atkinson-hyperlegible-latin-700-normal.woff2 +0 -0
  105. package/dist/cdn/fonts/atkinson-hyperlegible-latin-ext-400-italic.woff2 +0 -0
  106. package/dist/cdn/fonts/atkinson-hyperlegible-latin-ext-400-normal.woff2 +0 -0
  107. package/dist/cdn/fonts/atkinson-hyperlegible-latin-ext-700-italic.woff2 +0 -0
  108. package/dist/cdn/fonts/atkinson-hyperlegible-latin-ext-700-normal.woff2 +0 -0
  109. package/dist/cdn/fonts/latinmodern-math-GUST-LICENSE.txt +30 -0
  110. package/dist/cdn/fonts/latinmodern-math.woff2 +0 -0
  111. package/dist/cdn/fonts/math-fonts.css +14 -0
  112. package/dist/cdn/packs/effects.full.css +1 -1
  113. package/dist/cdn/packs/effects.full.js +1 -1
  114. package/dist/cdn/packs/fonts-display.full.css +1 -1
  115. package/dist/cdn/packs/fonts-display.theme.css +1 -1
  116. package/dist/cdn/packs/icons.bundle.js +1 -1
  117. package/dist/cdn/packs/icons.full.css +1 -1
  118. package/dist/cdn/packs/icons.theme.css +1 -1
  119. package/dist/cdn/packs/journal.effects.css +1 -1
  120. package/dist/cdn/packs/journal.full.css +1 -1
  121. package/dist/cdn/packs/kawaii.effects.css +1 -1
  122. package/dist/cdn/packs/kawaii.full.css +2 -2
  123. package/dist/cdn/packs/kawaii.full.js +4 -4
  124. package/dist/cdn/packs/kawaii.theme.css +1 -1
  125. package/dist/cdn/packs/manifest.json +17 -17
  126. package/dist/cdn/packs/memphis.full.css +1 -1
  127. package/dist/cdn/packs/memphis.theme.css +1 -1
  128. package/dist/cdn/packs/ui.full.css +1 -1
  129. package/dist/cdn/packs/ui.full.js +89 -86
  130. package/dist/cdn/themes/8bit.css +1 -1
  131. package/dist/cdn/themes/8bit.tokens.json +1 -1
  132. package/dist/cdn/themes/alpha1999-dark.tokens.json +1 -1
  133. package/dist/cdn/themes/alpha1999.css +1 -1
  134. package/dist/cdn/themes/alpha1999.tokens.json +1 -1
  135. package/dist/cdn/themes/art-deco-dark.tokens.json +1 -1
  136. package/dist/cdn/themes/art-deco.css +1 -1
  137. package/dist/cdn/themes/art-deco.tokens.json +1 -1
  138. package/dist/cdn/themes/bauhaus-dark.tokens.json +1 -1
  139. package/dist/cdn/themes/bauhaus.css +1 -1
  140. package/dist/cdn/themes/bauhaus.tokens.json +1 -1
  141. package/dist/cdn/themes/brutalist-dark.tokens.json +1 -1
  142. package/dist/cdn/themes/brutalist.css +1 -1
  143. package/dist/cdn/themes/brutalist.tokens.json +1 -1
  144. package/dist/cdn/themes/catppuccin-frappe.css +1 -1
  145. package/dist/cdn/themes/catppuccin-frappe.tokens.json +1 -1
  146. package/dist/cdn/themes/catppuccin-latte-dark.tokens.json +1 -1
  147. package/dist/cdn/themes/catppuccin-latte.css +1 -1
  148. package/dist/cdn/themes/catppuccin-latte.tokens.json +1 -1
  149. package/dist/cdn/themes/catppuccin-macchiato.css +1 -1
  150. package/dist/cdn/themes/catppuccin-macchiato.tokens.json +1 -1
  151. package/dist/cdn/themes/catppuccin-mocha.css +1 -1
  152. package/dist/cdn/themes/catppuccin-mocha.tokens.json +1 -1
  153. package/dist/cdn/themes/classic-dark.tokens.json +1 -1
  154. package/dist/cdn/themes/classic.css +1 -1
  155. package/dist/cdn/themes/classic.tokens.json +1 -1
  156. package/dist/cdn/themes/claymorphism-dark.tokens.json +1 -1
  157. package/dist/cdn/themes/claymorphism.css +1 -1
  158. package/dist/cdn/themes/claymorphism.tokens.json +2 -1
  159. package/dist/cdn/themes/clinical-dark.tokens.json +1 -1
  160. package/dist/cdn/themes/clinical.css +1 -1
  161. package/dist/cdn/themes/clinical.tokens.json +1 -1
  162. package/dist/cdn/themes/cottagecore-dark.tokens.json +1 -1
  163. package/dist/cdn/themes/cottagecore.css +1 -1
  164. package/dist/cdn/themes/cottagecore.tokens.json +1 -1
  165. package/dist/cdn/themes/cyber.css +1 -1
  166. package/dist/cdn/themes/cyber.tokens.json +1 -1
  167. package/dist/cdn/themes/dawn-dark.tokens.json +1 -1
  168. package/dist/cdn/themes/dawn.css +1 -1
  169. package/dist/cdn/themes/dawn.tokens.json +1 -1
  170. package/dist/cdn/themes/dracula.css +1 -1
  171. package/dist/cdn/themes/dracula.tokens.json +1 -1
  172. package/dist/cdn/themes/dusk.css +1 -1
  173. package/dist/cdn/themes/dusk.tokens.json +1 -1
  174. package/dist/cdn/themes/editorial-dark.tokens.json +1 -1
  175. package/dist/cdn/themes/editorial.css +1 -1
  176. package/dist/cdn/themes/editorial.tokens.json +1 -1
  177. package/dist/cdn/themes/financial-dark.tokens.json +1 -1
  178. package/dist/cdn/themes/financial.css +1 -1
  179. package/dist/cdn/themes/financial.tokens.json +1 -1
  180. package/dist/cdn/themes/genai.css +1 -1
  181. package/dist/cdn/themes/genai.tokens.json +1 -1
  182. package/dist/cdn/themes/glassmorphism-dark.tokens.json +1 -1
  183. package/dist/cdn/themes/glassmorphism.css +1 -1
  184. package/dist/cdn/themes/glassmorphism.tokens.json +1 -1
  185. package/dist/cdn/themes/government-dark.tokens.json +1 -1
  186. package/dist/cdn/themes/government.css +1 -1
  187. package/dist/cdn/themes/government.tokens.json +1 -1
  188. package/dist/cdn/themes/gruvbox-dark.tokens.json +1 -1
  189. package/dist/cdn/themes/gruvbox.css +1 -1
  190. package/dist/cdn/themes/gruvbox.tokens.json +1 -1
  191. package/dist/cdn/themes/high-noon-dark.tokens.json +1 -1
  192. package/dist/cdn/themes/high-noon.css +1 -1
  193. package/dist/cdn/themes/high-noon.tokens.json +1 -1
  194. package/dist/cdn/themes/journal-dark.tokens.json +4 -2
  195. package/dist/cdn/themes/journal.css +1 -1
  196. package/dist/cdn/themes/journal.tokens.json +4 -2
  197. package/dist/cdn/themes/kawaii-dark.tokens.json +1 -1
  198. package/dist/cdn/themes/kawaii.css +1 -1
  199. package/dist/cdn/themes/kawaii.tokens.json +1 -1
  200. package/dist/cdn/themes/magna-dark.tokens.json +1 -1
  201. package/dist/cdn/themes/magna.css +1 -1
  202. package/dist/cdn/themes/magna.tokens.json +1 -1
  203. package/dist/cdn/themes/manifest.json +44 -44
  204. package/dist/cdn/themes/midnight.css +1 -1
  205. package/dist/cdn/themes/midnight.tokens.json +1 -1
  206. package/dist/cdn/themes/minimal-dark.tokens.json +1 -1
  207. package/dist/cdn/themes/minimal.css +1 -1
  208. package/dist/cdn/themes/minimal.tokens.json +1 -1
  209. package/dist/cdn/themes/modern-dark.tokens.json +1 -1
  210. package/dist/cdn/themes/modern.css +1 -1
  211. package/dist/cdn/themes/modern.tokens.json +1 -1
  212. package/dist/cdn/themes/nes-dark.tokens.json +7 -2
  213. package/dist/cdn/themes/nes.css +1 -1
  214. package/dist/cdn/themes/nes.tokens.json +1 -1
  215. package/dist/cdn/themes/neumorphism-dark.tokens.json +1 -1
  216. package/dist/cdn/themes/neumorphism.css +1 -1
  217. package/dist/cdn/themes/neumorphism.tokens.json +1 -1
  218. package/dist/cdn/themes/nord-dark.tokens.json +1 -1
  219. package/dist/cdn/themes/nord.css +1 -1
  220. package/dist/cdn/themes/nord.tokens.json +1 -1
  221. package/dist/cdn/themes/organic-dark.tokens.json +1 -1
  222. package/dist/cdn/themes/organic.css +1 -1
  223. package/dist/cdn/themes/organic.tokens.json +1 -1
  224. package/dist/cdn/themes/rose-pine-dark.tokens.json +1 -1
  225. package/dist/cdn/themes/rose-pine.css +1 -1
  226. package/dist/cdn/themes/rose-pine.tokens.json +1 -1
  227. package/dist/cdn/themes/rough-dark.tokens.json +1 -1
  228. package/dist/cdn/themes/rough.css +1 -1
  229. package/dist/cdn/themes/rough.tokens.json +1 -1
  230. package/dist/cdn/themes/solarized-dark.tokens.json +1 -1
  231. package/dist/cdn/themes/solarized.css +1 -1
  232. package/dist/cdn/themes/solarized.tokens.json +1 -1
  233. package/dist/cdn/themes/startup-dark.tokens.json +1 -1
  234. package/dist/cdn/themes/startup.css +1 -1
  235. package/dist/cdn/themes/startup.tokens.json +1 -1
  236. package/dist/cdn/themes/super2026-dark.tokens.json +1 -1
  237. package/dist/cdn/themes/super2026.css +1 -1
  238. package/dist/cdn/themes/super2026.tokens.json +1 -1
  239. package/dist/cdn/themes/swiss-dark.tokens.json +1 -1
  240. package/dist/cdn/themes/swiss.css +1 -1
  241. package/dist/cdn/themes/swiss.tokens.json +1 -1
  242. package/dist/cdn/themes/terminal.css +1 -1
  243. package/dist/cdn/themes/terminal.tokens.json +1 -1
  244. package/dist/cdn/themes/tokyo-night-dark.tokens.json +1 -1
  245. package/dist/cdn/themes/tokyo-night.css +1 -1
  246. package/dist/cdn/themes/tokyo-night.tokens.json +1 -1
  247. package/dist/cdn/themes/vaporwave-dark.tokens.json +1 -1
  248. package/dist/cdn/themes/vaporwave.css +1 -1
  249. package/dist/cdn/themes/vaporwave.tokens.json +1 -1
  250. package/dist/cdn/themes/win9x-dark.tokens.json +6 -2
  251. package/dist/cdn/themes/win9x.css +1 -1
  252. package/dist/cdn/themes/win9x.tokens.json +3 -1
  253. package/dist/cdn/vanilla-breeze-autoload.js +187 -297
  254. package/dist/cdn/vanilla-breeze-charts.css +1 -1
  255. package/dist/cdn/vanilla-breeze-charts.js +6 -6
  256. package/dist/cdn/vanilla-breeze-core.css +1 -1
  257. package/dist/cdn/vanilla-breeze-core.js +166 -262
  258. package/dist/cdn/vanilla-breeze-dev.js +1 -1
  259. package/dist/cdn/vanilla-breeze-extras.js +272 -130
  260. package/dist/cdn/vanilla-breeze.css +1 -1
  261. package/dist/cdn/vanilla-breeze.js +536 -621
  262. package/dist/cdn/view-transitions.css +2 -0
  263. package/package.json +15 -7
@@ -1,4 +1,4 @@
1
- var _=Object.defineProperty;var A=(l,t)=>()=>(l&&(t=l(l=0)),t);var I=(l,t)=>{for(var e in t)_(l,e,{get:t[e],enumerable:!0})};function C(l,t,e){let i=Math.pow(2,e),r=l*Math.PI/180,o=(t+180)/360*i,a=(1-Math.log(Math.tan(r)+1/Math.cos(r))/Math.PI)/2*i,n=Math.floor(o),s=Math.floor(a),h=Math.round((o-n)*256),c=Math.round((a-s)*256);return{tileX:n,tileY:s,pixelX:h,pixelY:c}}function L(l,t,e){let i=256*Math.pow(2,e),r=l/i*360-180;return{lat:Math.atan(Math.sinh(Math.PI*(1-2*t/i)))*180/Math.PI,lng:r}}function v(l,t,e,i,r){if(r)return r.replace("{z}",String(t)).replace("{x}",String(e)).replace("{y}",String(i));switch(l){case"carto-light":return`https://basemaps.cartocdn.com/light_all/${t}/${e}/${i}.png`;case"carto-dark":return`https://basemaps.cartocdn.com/dark_all/${t}/${e}/${i}.png`;default:return`https://tile.openstreetmap.org/${t}/${e}/${i}.png`}}var M=A(()=>{});var z={};I(z,{MapInteraction:()=>E});var E,P=A(()=>{M();E=class{#i;#e;#t;#f;#m;#g;#o=0;#s=0;#a=15;#u=1;#N=19;#l=0;#n=0;#c=new Map;#r=null;#v=0;#b=0;#y=!1;#w=0;#k=0;constructor({shadow:t,host:e,lat:i,lng:r,zoom:o,provider:a,tileUrl:n,onDeactivate:s}){this.#i=t,this.#e=e,this.#f=a,this.#m=n||"",this.#g=s,this.#a=o,this.#t=t.querySelector('[part="tiles"]'),this.#r=t.querySelector('[part="marker"]');let h=256*Math.pow(2,o),c=i*Math.PI/180;this.#o=(r+180)/360*h,this.#s=(1-Math.log(Math.tan(c)+1/Math.cos(c))/Math.PI)/2*h,this.#v=this.#o,this.#b=this.#s,this.#l=this.#e.offsetWidth||400,this.#n=this.#e.offsetHeight||300,this.#t.innerHTML="",this.#t.style.transform="",this.#r&&(this.#r.style.position="absolute",this.#r.style.top="",this.#r.style.left="",this.#t.appendChild(this.#r)),this.#$(),this.#h()}#$(){this.#t.addEventListener("pointerdown",this.#A),this.#t.addEventListener("wheel",this.#S,{passive:!1}),this.#e.addEventListener("keydown",this.#C)}#A=t=>{t.button===0&&(t.preventDefault(),this.#y=!0,this.#w=t.clientX,this.#k=t.clientY,this.#t.setPointerCapture(t.pointerId),this.#t.setAttribute("data-dragging",""),this.#t.addEventListener("pointermove",this.#x),this.#t.addEventListener("pointerup",this.#M))};#x=t=>{if(!this.#y)return;let e=t.clientX-this.#w,i=t.clientY-this.#k;this.#w=t.clientX,this.#k=t.clientY,this.#o-=e,this.#s-=i,this.#d(),this.#h()};#M=t=>{this.#y=!1,this.#t.releasePointerCapture(t.pointerId),this.#t.removeAttribute("data-dragging"),this.#t.removeEventListener("pointermove",this.#x),this.#t.removeEventListener("pointerup",this.#M),this.#p()};#S=t=>{t.preventDefault();let e=t.ctrlKey?-t.deltaY*.01:-Math.sign(t.deltaY),i=Math.round(Math.max(this.#u,Math.min(this.#N,this.#a+e)));if(i===this.#a)return;let r=this.#e.getBoundingClientRect(),o=t.clientX-r.left,a=t.clientY-r.top;this.#E(i,o,a)};#C=t=>{switch(t.key){case"ArrowLeft":t.preventDefault(),this.#o-=80,this.#d(),this.#h(),this.#p();break;case"ArrowRight":t.preventDefault(),this.#o+=80,this.#d(),this.#h(),this.#p();break;case"ArrowUp":t.preventDefault(),this.#s-=80,this.#d(),this.#h(),this.#p();break;case"ArrowDown":t.preventDefault(),this.#s+=80,this.#d(),this.#h(),this.#p();break;case"+":case"=":t.preventDefault(),this.#E(this.#a+1,this.#l/2,this.#n/2);break;case"-":t.preventDefault(),this.#E(this.#a-1,this.#l/2,this.#n/2);break;case"Escape":t.preventDefault(),this.#g();break}};#E(t,e,i){if(t=Math.max(this.#u,Math.min(this.#N,t)),t===this.#a)return;let r=this.#o-this.#l/2,o=this.#s-this.#n/2,a=r+e,n=o+i,s=Math.pow(2,t-this.#a);this.#o=a*s-e+this.#l/2,this.#s=n*s-i+this.#n/2,this.#v*=s,this.#b*=s,this.#a=t,this.#L(),this.#d(),this.#h(),this.#p()}#d(){let t=256*Math.pow(2,this.#a);this.#o=(this.#o%t+t)%t,this.#s=Math.max(this.#n/2,Math.min(t-this.#n/2,this.#s))}#h(){let t=-(this.#o-this.#l/2),e=-(this.#s-this.#n/2);this.#t.style.transform=`translate(${Math.round(t)}px, ${Math.round(e)}px)`,this.#T(),this.#P(),this.#F()}#T(){let t=this.#a,e=Math.pow(2,t),i=this.#o-this.#l/2,r=this.#s-this.#n/2,o=i+this.#l,a=r+this.#n,n=Math.floor(i/256)-1,s=Math.max(0,Math.floor(r/256)-1),h=Math.ceil(o/256)+1,c=Math.min(e,Math.ceil(a/256)+1);for(let d=s;d<c;d++)for(let u=n;u<h;u++){let f=(u%e+e)%e,b=`${t}/${f}/${d}`;this.#c.has(b)||this.#z(t,u,d,f)}}#z(t,e,i,r){let o=`${t}/${r}/${i}`;if(this.#c.has(o))return;let a=e*256,n=i*256,s=document.createElement("img");s.src=v(this.#f,t,r,i,this.#m),s.alt="",s.draggable=!1,s.style.left=a+"px",s.style.top=n+"px",s.style.width="256px",s.style.height="256px",s._wx=a,s._wy=n,this.#c.set(o,s),this.#t.appendChild(s)}#P(){let t=this.#o-this.#l/2,e=this.#s-this.#n/2,i=512;for(let[r,o]of this.#c){let a=o._wx,n=o._wy;(a+256<t-i||a>t+this.#l+i||n+256<e-i||n>e+this.#n+i)&&(o.remove(),this.#c.delete(r))}}#F(){if(!this.#r)return;let t=this.#r.offsetWidth||32;this.#r.style.left=`${Math.round(this.#v-t/2)}px`,this.#r.style.top=`${Math.round(this.#b-t)}px`,this.#r.style.transform=""}#p(){let{lat:t,lng:e}=L(this.#o,this.#s,this.#a);this.#e.dispatchEvent(new CustomEvent("geo-map:move",{bubbles:!0,detail:{lat:+t.toFixed(6),lng:+e.toFixed(6),zoom:this.#a}}))}#L(){for(let t of this.#c.values())t.remove();this.#c.clear()}destroy(){if(this.#t.removeEventListener("pointerdown",this.#A),this.#t.removeEventListener("wheel",this.#S),this.#e.removeEventListener("keydown",this.#C),this.#t.removeEventListener("pointermove",this.#x),this.#t.removeEventListener("pointerup",this.#M),this.#r&&this.#r.parentNode===this.#t){let t=this.#i.querySelector('[part="container"]');t&&(t.insertBefore(this.#r,this.#t.nextSibling),this.#r.style.position="",this.#r.style.left="",this.#r.style.top="",this.#r.style.transform="")}this.#L(),this.#e.removeAttribute("data-interactive-active")}}});var g=class extends HTMLElement{#i=[];#e;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.#i)t();this.#i=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,r){t.addEventListener(e,i,r),this.#i.push(()=>t.removeEventListener(e,i,r))}_reinit(){for(let t of this.#i)t();this.#i=[],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)}};var S=`
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=`
2
2
  :host {
3
3
  display: block;
4
4
  position: relative;
@@ -22,23 +22,39 @@ var _=Object.defineProperty;var A=(l,t)=>()=>(l&&(t=l(l=0)),t);var I=(l,t)=>{for
22
22
  overflow: hidden;
23
23
  }
24
24
 
25
- /* Tile grid */
25
+ /* Stationary viewport (focus target in interactive mode); the tiles layer
26
+ inside it is translated. Tiles are always physically laid out (a map
27
+ is not mirrored in RTL). */
28
+ [part="viewport"] {
29
+ position: absolute;
30
+ inset: 0;
31
+ overflow: hidden;
32
+ direction: ltr;
33
+ }
34
+
35
+ [part="viewport"]:focus-visible {
36
+ outline: 2px solid var(--color-interactive, var(--color-primary, Highlight));
37
+ outline-offset: -4px;
38
+ }
39
+
26
40
  [part="tiles"] {
27
41
  position: absolute;
28
- display: grid;
29
- grid-template-columns: repeat(3, 256px);
30
- grid-template-rows: repeat(3, 256px);
42
+ top: 0;
43
+ left: 0;
31
44
  }
32
45
 
33
46
  [part="tiles"] img {
47
+ position: absolute;
34
48
  display: block;
35
49
  width: 256px;
36
50
  height: 256px;
51
+ max-width: none;
37
52
  -webkit-user-drag: none;
38
53
  user-select: none;
39
54
  }
40
55
 
41
- /* Marker */
56
+ /* Marker \u2014 fill follows marker-color (validated, set as --_marker-color),
57
+ then --geo-map-marker-color, then the theme's error/danger token. */
42
58
  [part="marker"] {
43
59
  position: absolute;
44
60
  top: 50%;
@@ -46,82 +62,117 @@ var _=Object.defineProperty;var A=(l,t)=>()=>(l&&(t=l(l=0)),t);var I=(l,t)=>{for
46
62
  width: var(--geo-map-marker-size, 32px);
47
63
  height: var(--geo-map-marker-size, 32px);
48
64
  transform: translate(-50%, -100%);
49
- filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
65
+ filter: drop-shadow(0 2px 4px rgb(0 0 0 / 0.3));
50
66
  pointer-events: none;
51
67
  z-index: 2;
52
68
  }
53
69
 
70
+ [part="marker"] svg {
71
+ display: block;
72
+ width: 100%;
73
+ height: 100%;
74
+ }
75
+
76
+ [part="marker"] .pin {
77
+ fill: var(--_marker-color, var(--geo-map-marker-color, var(--color-error, #c0392b)));
78
+ }
79
+
80
+ [part="marker"] .dot {
81
+ fill: var(--geo-map-marker-dot-color, #fff);
82
+ opacity: 0.9;
83
+ }
84
+
54
85
  /* Caption (slot projection). Translucent surface over the map; uses
55
86
  light-dark() so the pair switches automatically with the page's
56
87
  resolved color-scheme (driven by VB tokens). */
57
88
  [part="caption"] {
58
89
  position: absolute;
59
- bottom: 0;
60
- left: 0;
61
- right: 0;
62
- background: var(--geo-map-caption-bg, light-dark(rgba(255, 255, 255, 0.9), rgba(0, 0, 0, 0.75)));
90
+ inset-block-end: 0;
91
+ inset-inline: 0;
92
+ background: var(--geo-map-caption-bg, light-dark(rgb(255 255 255 / 0.9), rgb(0 0 0 / 0.75)));
63
93
  color: var(--geo-map-caption-color, var(--color-text, light-dark(#1a1a1a, #e0e0e0)));
64
94
  padding: var(--geo-map-caption-padding, 0.5rem 0.75rem);
65
95
  font-size: 0.875rem;
66
- z-index: 3;
96
+ /* Above the activation overlay so links in the caption stay usable */
97
+ z-index: 6;
67
98
  }
68
99
 
69
- [part="caption"]:empty,
70
- [part="caption"]:not(:has(*)) {
100
+ [part="container"]:not([data-caption]) [part="caption"] {
71
101
  display: none;
72
102
  }
73
103
 
74
104
  /* Attribution \u2014 translucent surface over the map; same pattern as caption */
75
105
  [part="attribution"] {
76
106
  position: absolute;
77
- bottom: 0;
78
- right: 0;
107
+ inset-block-end: 0;
108
+ inset-inline-end: 0;
79
109
  padding: 2px 5px;
80
110
  font-size: var(--geo-map-attribution-font-size, 0.625rem);
81
- background: var(--geo-map-attribution-bg, light-dark(rgba(255, 255, 255, 0.7), rgba(0, 0, 0, 0.6)));
111
+ background: var(--geo-map-attribution-bg, light-dark(rgb(255 255 255 / 0.7), rgb(0 0 0 / 0.6)));
82
112
  color: var(--geo-map-attribution-color, var(--color-text, light-dark(#333, #ddd)));
83
- z-index: 4;
113
+ z-index: 7;
84
114
  line-height: 1.4;
85
115
  }
86
116
 
117
+ [part="attribution"][hidden] {
118
+ display: none;
119
+ }
120
+
87
121
  [part="attribution"] a {
88
122
  color: inherit;
89
123
  text-decoration: none;
90
124
  }
91
125
 
92
- [part="attribution"] a:hover {
126
+ [part="attribution"] a:hover,
127
+ [part="attribution"] a:focus-visible {
93
128
  text-decoration: underline;
94
129
  }
95
130
 
96
131
  /* When caption is present, shift attribution above it */
97
- :host([data-has-caption]) [part="attribution"] {
98
- bottom: auto;
99
- top: 0;
132
+ [part="container"][data-caption] [part="attribution"] {
133
+ inset-block-end: auto;
134
+ inset-block-start: 0;
100
135
  }
101
136
 
102
- /* Overlay \u2014 full surface, appears on hover/focus */
137
+ /* Overlay \u2014 the whole surface is the activation target; faded in on
138
+ hover/focus for mouse users, always visible on touch (no hover). */
103
139
  [part="overlay"] {
104
140
  position: absolute;
105
141
  inset: 0;
106
142
  z-index: 5;
107
143
  display: flex;
144
+ flex-direction: column;
145
+ gap: 0.5rem;
108
146
  align-items: center;
109
147
  justify-content: center;
110
- background: var(--geo-map-overlay-bg, rgba(0, 0, 0, 0.35));
148
+ padding: 3rem 1rem 1rem;
149
+ text-align: center;
150
+ background: var(--geo-map-overlay-bg, rgb(0 0 0 / 0.35));
111
151
  color: var(--geo-map-overlay-color, var(--color-text-inverted, #fff));
152
+ cursor: pointer;
112
153
  opacity: 0;
113
154
  transition: opacity 0.2s ease;
114
155
  }
115
156
 
116
157
  [part="overlay"]:hover,
117
- [part="overlay"]:focus-within {
158
+ [part="overlay"]:focus-within,
159
+ [part="container"][data-consent] [part="overlay"] {
118
160
  opacity: 1;
119
161
  }
120
162
 
121
- /* Activate button inside overlay */
163
+ @media (hover: none) {
164
+ [part="overlay"] {
165
+ opacity: 1;
166
+ background: transparent;
167
+ }
168
+
169
+ }
170
+
122
171
  [part="activate"] {
123
- background: none;
172
+ background: var(--geo-map-activate-bg, rgb(0 0 0 / 0.6));
124
173
  border: none;
174
+ border-radius: 999px;
175
+ padding: 0.5rem 1rem;
125
176
  color: inherit;
126
177
  font: inherit;
127
178
  font-size: 0.875rem;
@@ -130,32 +181,104 @@ var _=Object.defineProperty;var A=(l,t)=>()=>(l&&(t=l(l=0)),t);var I=(l,t)=>{for
130
181
  }
131
182
 
132
183
  [part="activate"]:focus-visible {
133
- outline: 2px solid var(--color-text-inverted, #fff);
184
+ outline: 2px solid currentColor;
134
185
  outline-offset: 4px;
135
186
  }
136
187
 
137
- /* Interactive mode \u2014 tiles become absolutely positioned for panning */
138
- :host([data-interactive-active]) [part="tiles"] {
139
- display: block;
140
- cursor: grab;
141
- touch-action: none;
188
+ [part="consent-note"] {
189
+ margin: 0;
190
+ font-size: 0.75rem;
142
191
  }
143
192
 
144
- :host([data-interactive-active]) [part="tiles"] img {
193
+ /* Consent placeholder \u2014 no tiles yet; keep the overlay readable */
194
+ [part="container"][data-consent] [part="overlay"] {
195
+ background: var(--geo-map-consent-bg, light-dark(rgb(255 255 255 / 0.6), rgb(0 0 0 / 0.5)));
196
+ color: var(--geo-map-consent-color, var(--color-text, light-dark(#1a1a1a, #e0e0e0)));
197
+ }
198
+
199
+ [part="container"][data-consent] [part="activate"] {
200
+ background: var(--color-interactive, var(--color-primary, #1a5fb4));
201
+ color: var(--color-text-on-primary, var(--color-text-inverted, #fff));
202
+ }
203
+
204
+ [part="container"][data-consent] [part="marker"] {
205
+ display: none;
206
+ }
207
+
208
+ [part="container"][data-consent][data-caption] [part="overlay"] {
209
+ padding-block-end: 4rem;
210
+ }
211
+
212
+ /* On-screen controls (interactive mode) */
213
+ [part="controls"] {
145
214
  position: absolute;
215
+ inset-block-start: 0.5rem;
216
+ inset-inline-start: 0.5rem;
217
+ z-index: 6;
218
+ display: none;
219
+ flex-direction: column;
220
+ gap: 2px;
221
+ }
222
+
223
+ [part="container"][data-active] [part="controls"] {
224
+ display: flex;
225
+ }
226
+
227
+ [part~="control"] {
228
+ min-inline-size: 2.75rem;
229
+ min-block-size: 2.75rem;
230
+ display: grid;
231
+ place-items: center;
232
+ padding: 0 0.5rem;
233
+ border: 1px solid var(--color-border, rgb(0 0 0 / 0.2));
234
+ border-radius: var(--radius-s, 0.25rem);
235
+ background: var(--color-surface, light-dark(#fff, #1e1e1e));
236
+ color: var(--color-text, light-dark(#1a1a1a, #e0e0e0));
237
+ font: inherit;
238
+ font-size: 1rem;
239
+ line-height: 1;
240
+ cursor: pointer;
241
+ }
242
+
243
+ [part~="control"]:hover {
244
+ background: var(--color-surface-raised, light-dark(#f2f2f2, #2a2a2a));
245
+ }
246
+
247
+ [part~="control"]:focus-visible {
248
+ outline: 2px solid var(--color-interactive, var(--color-primary, Highlight));
249
+ outline-offset: 1px;
146
250
  }
147
251
 
148
- :host([data-interactive-active]) [part="tiles"][data-dragging] {
252
+ [part~="control"]:disabled {
253
+ opacity: 0.5;
254
+ cursor: default;
255
+ }
256
+
257
+ /* Interactive mode */
258
+ [part="container"][data-active] [part="viewport"] {
259
+ cursor: grab;
260
+ touch-action: none;
261
+ }
262
+
263
+ [part="container"][data-active] [part="viewport"][data-dragging] {
149
264
  cursor: grabbing;
150
265
  }
151
266
 
152
- :host([data-interactive-active]) [part="overlay"] {
267
+ [part="container"][data-active] [part="overlay"] {
153
268
  display: none;
154
269
  }
155
270
 
156
- /* Static-only \u2014 hide overlay entirely */
157
- :host([static-only]) [part="overlay"] {
158
- display: none;
271
+ /* Visually hidden live region */
272
+ [part="status"] {
273
+ position: absolute;
274
+ inline-size: 1px;
275
+ block-size: 1px;
276
+ margin: -1px;
277
+ padding: 0;
278
+ overflow: hidden;
279
+ clip-path: inset(50%);
280
+ white-space: nowrap;
281
+ border: 0;
159
282
  }
160
283
 
161
284
  /* Reduced motion \u2014 disable transitions */
@@ -182,19 +305,12 @@ var _=Object.defineProperty;var A=(l,t)=>()=>(l&&(t=l(l=0)),t);var I=(l,t)=>{for
182
305
  text-align: center;
183
306
  padding: 1rem;
184
307
  }
185
- `;M();var j=window.matchMedia("(prefers-reduced-motion: reduce)");var $=new Map;function T(l,t,e={}){let i=e.priority??10,r={impl:t,bundle:e.bundle,contract:e.contract,priority:i},o=$.get(l);if(customElements.get(l)){if(!o||o.priority>=i){o&&o.priority===i&&o.impl!==t&&console.warn(`[VB Bundle] Tag <${l}> already registered by "${o.bundle}" (priority ${o.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${l}> defined by "${o.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(o&&o.priority>=i){o.priority===i&&console.warn(`[VB Bundle] Tag <${l}> already registered by "${o.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}$.set(l,r),customElements.define(l,t)}function B(l){return`<svg viewBox="0 0 24 36" fill="none" xmlns="http://www.w3.org/2000/svg">
186
- <path 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" fill="${l}"/>
187
- <circle cx="12" cy="12" r="5" fill="white" opacity="0.9"/>
188
- </svg>`}var N=class extends g{static get observedAttributes(){return["lat","lng","zoom","marker","marker-color","provider","tile-url","interactive","static-only","src","place"]}#i=null;#e=!1;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(){return this.getAttribute("marker-color")||"#e74c3c"}get provider(){return this.getAttribute("provider")||"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")}#t(){let t=parseFloat(this.getAttribute("lat")??""),e=parseFloat(this.getAttribute("lng")??"");if(!isNaN(t)&&!isNaN(e))return{lat:t,lng:e};let i=this.getAttribute("src");if(i){let n=this.#f(i);if(n)return n}let r=this.querySelector("address[data-lat][data-lng]");if(r){let n=parseFloat(r.dataset.lat??""),s=parseFloat(r.dataset.lng??"");if(!isNaN(n)&&!isNaN(s))return{lat:n,lng:s}}let o=this.getAttribute("place");if(o){let n=this.#m(o);if(n)return n}let a=document.querySelector('meta[name="geo.position"]');if(a){let s=(a.getAttribute("content")||"").split(";");if(s.length===2){let h=parseFloat(s[0]),c=parseFloat(s[1]);if(!isNaN(h)&&!isNaN(c))return{lat:h,lng:c}}}return null}#f(t){let e=document.getElementById(t);if(!e)return null;if(e.tagName==="ADDRESS"&&e.dataset.lat&&e.dataset.lng){let i=parseFloat(e.dataset.lat),r=parseFloat(e.dataset.lng);if(!isNaN(i)&&!isNaN(r))return{lat:i,lng:r}}return e.tagName==="SCRIPT"&&e.type==="application/ld+json"?this.#g(e):null}#m(t){let e=document.querySelectorAll('script[type="application/ld+json"]');for(let i of e)try{let r=JSON.parse(i.textContent);if(r.name===t){let o=r.geo;if(o){let a=parseFloat(o.latitude),n=parseFloat(o.longitude);if(!isNaN(a)&&!isNaN(n))return{lat:a,lng:n}}}}catch{}return null}#g(t){try{let i=JSON.parse(t.textContent).geo;if(i){let r=parseFloat(i.latitude),o=parseFloat(i.longitude);if(!isNaN(r)&&!isNaN(o))return{lat:r,lng:o}}}catch{}return null}setup(){this.render(),this.loadTiles(),this.#o()}attributeChangedCallback(t,e,i){e!==i&&this.isConnected&&(this.#i&&this.#u(),this.render(),this.loadTiles(),this.#o())}teardown(){this.#i&&(this.#i.destroy(),this.#i=null)}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;e.lat===t.lat&&e.lng===t.lng&&e.zoom===t.zoom||(t.lat!=null&&this.setAttribute("lat",String(t.lat)),t.lng!=null&&this.setAttribute("lng",String(t.lng)),t.zoom!=null&&this.setAttribute("zoom",String(t.zoom)),t.marker!=null&&this.setAttribute("marker",t.marker?"true":"false"),t.markerColor&&this.setAttribute("marker-color",t.markerColor),this.dispatchEvent(new CustomEvent("geo-map:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0,composed:!0})))}get markers(){let t=this.#t();return t?[{lat:t.lat,lng:t.lng,color:this.markerColor}]:[]}render(){let t=this.#t(),e=t?.lat??NaN,i=t?.lng??NaN,r=!isNaN(e)&&!isNaN(i);this.children.length>0?this.setAttribute("data-has-caption",""):this.removeAttribute("data-has-caption");let a=r?`Map of ${e.toFixed(4)}, ${i.toFixed(4)}`:"Map",n=this.showMarker&&r?`<div part="marker" aria-hidden="true">${B(this.markerColor)}</div>`:"",h=r&&this.interactive!=="none"&&!this.staticOnly?'<div part="overlay"><button part="activate" aria-label="Activate interactive map" tabindex="0">Click to interact</button></div>':"";this.shadowRoot.innerHTML=`
189
- <style>${S}</style>
190
- <div part="container">
191
- <div part="tiles" role="img" aria-label="${a}"></div>
192
- ${n}
193
- ${h}
194
- <div part="caption"><slot></slot></div>
195
- <div part="attribution">
196
- <a href="https://www.openstreetmap.org/copyright" target="_blank" rel="noopener">&copy; OpenStreetMap</a>
197
- </div>
198
- </div>
199
- `}loadTiles(){let t=this.#t(),e=t?.lat??NaN,i=t?.lng??NaN;if(isNaN(e)||isNaN(i)){this.handleError("Missing or invalid lat/lng coordinates");return}let r=this.zoom,o=this.provider,{tileX:a,tileY:n,pixelX:s,pixelY:h}=C(e,i,r),c=this.shadowRoot.querySelector('[part="tiles"]');if(!c)return;c.innerHTML="";let d=this,u=d.offsetWidth||400,f=d.offsetHeight||300,b=Math.round(u/2-256-s),F=Math.round(f/2-256-h);c.style.transform=`translate(${b}px, ${F}px)`;let y=0,m=0,w=9;for(let k=-1;k<=1;k++)for(let x=-1;x<=1;x++){let D=a+x,q=n+k,R=v(o,r,D,q,this.tileUrl),p=document.createElement("img");p.src=R,p.alt="",p.loading="lazy",p.draggable=!1,p.addEventListener("load",()=>{y++,y+m===w&&this.dispatchEvent(new CustomEvent("geo-map:ready",{bubbles:!0,detail:{lat:e,lng:i,zoom:r}}))}),p.addEventListener("error",()=>{m++,m===w?this.handleError("Failed to load map tiles"):y+m===w&&this.dispatchEvent(new CustomEvent("geo-map:ready",{bubbles:!0,detail:{lat:e,lng:i,zoom:r}}))}),c.appendChild(p)}}#o(){let t=this.shadowRoot.querySelector('[part="overlay"]');if(!t)return;let e=t.querySelector('[part="activate"]');t.addEventListener("mouseenter",()=>this.#s(),{once:!0}),e&&e.addEventListener("focus",()=>this.#s(),{once:!0}),e&&e.addEventListener("click",()=>this.#a()),this.interactive==="eager"&&requestAnimationFrame(()=>this.#a())}#s(){if(this.#e)return;let t=this.tileUrl;if(t)try{let o=new URL(t,location.origin);if(o.origin===location.origin){this.#e=!0;return}this.#e=!0;let a=document.createElement("link");a.rel="preconnect",a.href=o.origin,a.crossOrigin="",document.head.appendChild(a);return}catch{}this.#e=!0;let e=this.provider,i;e==="carto-light"||e==="carto-dark"?i="https://basemaps.cartocdn.com":i="https://tile.openstreetmap.org";let r=document.createElement("link");r.rel="preconnect",r.href=i,r.crossOrigin="",document.head.appendChild(r)}async#a(){if(this.#i)return;let t=this.#t(),e=t?.lat??NaN,i=t?.lng??NaN;if(isNaN(e)||isNaN(i))return;let{MapInteraction:r}=await Promise.resolve().then(()=>(P(),z));this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.focus(),this.setAttribute("data-interactive-active",""),this.#i=new r({shadow:this.shadowRoot,host:this,lat:e,lng:i,zoom:this.zoom,provider:this.provider,tileUrl:this.tileUrl,onDeactivate:()=>this.#u()}),this.dispatchEvent(new CustomEvent("geo-map:activate",{bubbles:!0,detail:{lat:e,lng:i,zoom:this.zoom}}))}#u(){this.#i&&(this.#i.destroy(),this.#i=null,this.removeAttribute("data-interactive-active"),this.render(),this.loadTiles(),this.#o())}handleError(t){let e=this.shadowRoot.querySelector('[part="container"]');e&&(e.setAttribute("data-state","error"),e.setAttribute("data-error",t)),this.dispatchEvent(new CustomEvent("geo-map:error",{bubbles:!0,detail:{message:t}}))}};T("geo-map",N);export{N as GeoMap};
308
+
309
+ @media (forced-colors: active) {
310
+ [part~="control"],
311
+ [part="activate"] {
312
+ border: 1px solid ButtonText;
313
+ }
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};
200
316
  //# sourceMappingURL=geo-map.js.map
@@ -1,2 +1,2 @@
1
- var m=window.matchMedia("(prefers-reduced-motion: reduce)");var f=new Map;function h(o,t,e={}){let n=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:n},r=f.get(o);if(customElements.get(o)){if(!r||r.priority>=n){r&&r.priority===n&&r.impl!==t&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=n){r.priority===n&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${r.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}f.set(o,s),customElements.define(o,t)}var a=class extends HTMLElement{#t=[];#e;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,n,s){t.addEventListener(e,n,s),this.#t.push(()=>t.removeEventListener(e,n,s))}_reinit(){for(let t of this.#t)t();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,e){this.#e||(this.#e=this.attachInternals());let n=this.#e.states;try{e?n.add(t):n.delete(t)}catch{let s=`--${t}`;e?n.add(s):n.delete(s)}}_adoptInternals(t){this.#e||(this.#e=t)}};var l=class extends a{#t=null;#e=null;setup(){this.#n(),this.#s()}teardown(){this.#e?.disconnect()}#n(){let t=this.getAttribute("placeholder")||"Filter terms\u2026",e=document.createElement("input");e.type="search",e.placeholder=t,e.setAttribute("aria-label",t),e.setAttribute("data-glossary-search",""),e.addEventListener("input",()=>this.#r(e.value));let n=this.querySelector("main");n?n.prepend(e):this.prepend(e),this.#t=e}#r(t){let e=t.toLowerCase().trim(),n=this.querySelectorAll('.glossary-section, section[id^="glossary-"]');for(let s of n){let r=s.querySelectorAll("dt"),i=!1;for(let c of r){let p=c.textContent?.toLowerCase()||"",d=!e||p.includes(e),u=c.nextElementSibling;c.hidden=!d,u?.tagName==="DD"&&(u.hidden=!d),d&&(i=!0)}s.hidden=!i}}#s(){let t=this.querySelectorAll(".glossary-jump a");if(!t.length)return;let e=this.querySelectorAll('.glossary-section, section[id^="glossary-"]');if(e.length){this.#e=new IntersectionObserver(n=>{for(let s of n)if(s.isIntersecting){let r=s.target.id;for(let i of t){let c=i.getAttribute("href")===`#${r}`;i.setAttribute("aria-current",c?"true":"false")}}},{rootMargin:"-20% 0px -60% 0px"});for(let n of e)this.#e.observe(n)}}};h("glossary-index",l);export{l as GlossaryIndex};
1
+ var U=window.matchMedia("(prefers-reduced-motion: reduce)");var x=new Map;function T(s,e,t={}){let r=t.priority??10,n={impl:e,bundle:t.bundle,contract:t.contract,priority:r},i=x.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}x.set(s,n),customElements.define(s,e)}var m=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 R(s,e){let t=S.get(e);t||S.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=D,e.appendChild(i),r={region:i},t.set(s,r)}return r}function k(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=R(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 p(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 M=1500,F="[data-copy], [data-copy-target], [data-paste-target]",h={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"},A=new WeakMap;function _(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 B(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=M}=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=_(s)}if(n)return y({button:t,duration:r,state:"copied",eventName:"copy:done",eventDetail:{text:s},message:e.announceMessage??p(t,"copied",h.copied)}),!0;let o=B(e.source);return y({button:t,duration:r,state:"failed",eventName:"copy:error",eventDetail:{text:s,error:i},message:e.failureMessage??p(t,"copy-failed",o?h["copy-failed-selected"]:h["copy-failed"])}),!1}function y({button:s,duration:e,message:t,eventDetail:r,state:n,eventName:i}){if(s){s.dataset.state=n;let o=A.get(s);o&&clearTimeout(o),A.set(s,setTimeout(()=>{s.dataset.state===n&&delete s.dataset.state,A.delete(s)},e)),s.dispatchEvent(new CustomEvent(i,{bubbles:!0,detail:r}))}k(t,{politeness:n==="failed"?"assertive":"polite"})}async function P(s,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(i){return y({button:t,duration:r,state:"failed",eventName:"paste:error",eventDetail:{target:s,error:i},message:e.failureMessage??p(t,"paste-failed",h["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}))),y({button:t,duration:r,state:"pasted",eventName:"paste:done",eventDetail:{text:n,target:s},message:e.announceMessage??p(t,"pasted",h.pasted)}),n}function L(s){let e=s.dataset.copyTarget;if(!e)return null;try{return document.querySelector(e)}catch{return null}}function O(s){if(s.dataset.copy)return s.dataset.copy;let e=L(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 j(s){let e=s.target?.closest?.(F);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=O(e);t&&E(t,{button:e,source:L(e)??void 0})}typeof document<"u"&&!document.__vbCopyDelegated&&(document.__vbCopyDelegated=!0,document.addEventListener("click",j));var H=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function w(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:H()?"auto":"smooth",block:"start"})}function N(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(),w(c,o),!0):!1}var $={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"},g='.glossary-section, section[id^="glossary-"]',V=1500;function K(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 m{#r=null;#e=null;#t=null;#i=null;#a=[];#n=new Map;#o="";setup(){this.#o="",this.listen(this,"click",this.#h),this.listen(this,"click",N),this.#f(),this.#p(),this.#y()}teardown(){this.#i?.disconnect(),this.#i=null;for(let e of this.#n.values())clearTimeout(e);this.#n.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=[]}#f(){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.#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.#s("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(g),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(g)){let d=!1;for(let I of a.querySelectorAll("dl"))for(let u of K(I)){if(!u.dts.length)continue;l+=u.dts.length;let q=n(u.dts.map(v=>this.#d(v)).join(" ")),b=!i||q.includes(i);u.wrapper&&(u.wrapper.hidden=!b);for(let v of[...u.dts,...u.dds])v.hidden=!b;b&&(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.#u("matches",c):this.#u("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(${g}) 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()}#h=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.#m(i,n))};async#m(e,t){w(e,e.id);let r=new URL(document.URL);r.hash=e.id,await E(r.href,{announceMessage:this.#s("copied")})&&(t.dataset.state="copied",clearTimeout(this.#n.get(t)),this.#n.set(t,setTimeout(()=>{delete t.dataset.state,this.#n.delete(t)},V)))}#y(){let e=this.querySelectorAll(".glossary-jump a");if(!e.length)return;let t=this.querySelectorAll(g);if(t.length){this.#i=new IntersectionObserver(r=>{for(let n of r)if(n.isIntersecting){let i=n.target.id;for(let o of e){let c=o.getAttribute("href")===`#${i}`;o.setAttribute("aria-current",c?"true":"false")}}},{rootMargin:"-20% 0px -60% 0px"});for(let r of t)this.#i.observe(r)}}#c(){return this.closest("[lang]")?.getAttribute("lang")||void 0}#s(e){return this.getAttribute(`data-label-${e}`)??$[e]??""}#u(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}`)??$[`${e}-${r}`]??this.#s(`${e}-other`)).replaceAll("{count}",n)}};T("glossary-index",C);export{C as GlossaryIndex,K as termGroups};
2
2
  //# sourceMappingURL=glossary-index.js.map
@@ -1,2 +1,2 @@
1
- var y=window.matchMedia("(prefers-reduced-motion: reduce)");var b=new Map;function C(c,t,e={}){let s=e.priority??10,r={impl:t,bundle:e.bundle,contract:e.contract,priority:s},i=b.get(c);if(customElements.get(c)){if(!i||i.priority>=s){i&&i.priority===s&&i.impl!==t&&console.warn(`[VB Bundle] Tag <${c}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${c}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=s){i.priority===s&&console.warn(`[VB Bundle] Tag <${c}> already registered by "${i.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}b.set(c,r),customElements.define(c,t)}var u=class extends HTMLElement{#o=[];#s;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.#o)t();this.#o=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,s,r){t.addEventListener(e,s,r),this.#o.push(()=>t.removeEventListener(e,s,r))}_reinit(){for(let t of this.#o)t();this.#o=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,e){this.#s||(this.#s=this.attachInternals());let s=this.#s.states;try{e?s.add(t):s.delete(t)}catch{let r=`--${t}`;e?s.add(r):s.delete(r)}}_adoptInternals(t){this.#s||(this.#s=t)}};function m(c){return String(c).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var p={user:'<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/>',pencil:'<path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/><path d="m15 5 4 4"/>',check:'<path d="M20 6 9 17l-5-5"/>',target:'<circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="6"/><circle cx="12" cy="12" r="2"/>',alertTriangle:'<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/>',messageCircle:'<path d="M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719"/>',lightbulb:'<path d="M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"/><path d="M9 18h6"/><path d="M10 22h4"/>',wrench:'<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z"/>',heart:'<path d="M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5"/>',mapPin:'<path d="M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0"/><circle cx="12" cy="10" r="3"/>',checkCircle:'<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><path d="m9 11 3 3L22 4"/>',x:'<path d="M18 6 6 18"/><path d="m6 6 12 12"/>',download:'<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/>',send:'<path d="M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"/><path d="m21.854 2.147-10.94 10.939"/>'},v={says:{label:"Says",icon:p.messageCircle,color:"#3b82f6"},thinks:{label:"Thinks",icon:p.lightbulb,color:"#8b5cf6"},does:{label:"Does",icon:p.wrench,color:"#f59e0b"},feels:{label:"Feels",icon:p.heart,color:"#ef4444"}};var g=class c extends u{static get observedAttributes(){return["src","compact","title","searchable"]}static#o=0;#s=null;#r=null;#n=null;#t=null;#i=null;#l="";#c=null;#e=[];#a=[];#h=new Map;#d=new Map;setup(){this.#l=`gloss-${++c.#o}`;let t=this.querySelector(":scope > dl");if(!t)return!1;let e=[...t.querySelectorAll(":scope > div[data-term-id]")];if(e.length===0)return!1;this.#e=e.map(i=>{let o=i.getAttribute("data-term-id")||"",a=i.getAttribute("data-category")||"Uncategorized",l=i.querySelector("dt"),h=i.querySelector("dd"),n=l?l.textContent.trim():"",d=h?h.textContent.trim():"";return i.id=o,{id:o,term:n,definition:d,category:a,el:i}});let s=new Set;this.#a=[];for(let i of this.#e)s.has(i.category)||(s.add(i.category),this.#a.push(i.category));t.remove(),this.#u();let r=this.getAttribute("src");if(r){this._loadSrc(r);return}return this.dispatchEvent(new CustomEvent("glossary-wc:ready",{bubbles:!0,detail:{termCount:this.#e.length,categories:[...this.#a]}})),!0}get terms(){return this.#e.map(t=>({id:t.id,term:t.term,definition:t.definition,category:t.category}))}set terms(t){let e=Array.isArray(t)?t:[];for(;this.firstChild;)this.firstChild.remove();let s=document.createElement("dl");for(let r of e){let i=document.createElement("div");i.setAttribute("data-term-id",r.id||""),r.category&&i.setAttribute("data-category",r.category);let o=document.createElement("dt");o.textContent=r.term||"";let a=document.createElement("dd");a.textContent=r.definition||"",i.appendChild(o),i.appendChild(a),s.appendChild(i)}this.appendChild(s),this.teardown(),this.removeAttribute("data-upgraded"),this.setup(),this.dispatchEvent(new CustomEvent("glossary-wc:terms-changed",{detail:{terms:e,source:"property"},bubbles:!0}))}teardown(){this.#c&&clearTimeout(this.#c);let t=this.querySelector(".gloss-title");t&&t.remove(),this.#s?.parentElement&&this.#s.parentElement.remove(),this.#r&&this.#r.remove(),this.#i&&this.#i.remove(),this.#t&&this.#t.remove(),this.#s=null,this.#r=null,this.#n=null,this.#t=null,this.#i=null,this.#e=[],this.#a=[],this.#h=new Map,this.#d=new Map}#u(){let t=this.getAttribute("title");if(t){let e=document.createElement("h2");e.className="gloss-title",e.textContent=t,this.#n=document.createElement("output"),this.#n.className="gloss-count",this.#n.textContent=String(this.#e.length),e.appendChild(this.#n),this.appendChild(e)}if(this.hasAttribute("searchable")){let e=document.createElement("div");e.className="gloss-search";let s=document.createElement("input");s.type="search",s.className="gloss-search-input",s.setAttribute("placeholder","Search terms\u2026"),s.setAttribute("aria-label","Search glossary terms"),e.appendChild(s),this.appendChild(e),this.#s=s,this.listen(s,"input",this.#f)}this.#p(),this.#i=document.createElement("div"),this.#i.className="gloss-categories",this.#i.setAttribute("role","region"),this.#i.setAttribute("aria-label","Glossary terms"),this.appendChild(this.#i);for(let e of this.#a){let s=this.#e.filter(r=>r.category===e);this.#m(e,s)}this.#t=document.createElement("div"),this.#t.className="gloss-live-region",this.#t.setAttribute("role","status"),this.#t.setAttribute("aria-live","polite"),this.#t.setAttribute("aria-atomic","true"),this.appendChild(this.#t)}#p(){this.#r=document.createElement("nav"),this.#r.className="gloss-jump-bar",this.#r.setAttribute("aria-label","Alphabet navigation");let t=new Set;for(let e of this.#e){let s=e.term.charAt(0).toUpperCase();/[A-Z]/.test(s)&&t.add(s)}for(let e=65;e<=90;e++){let s=String.fromCharCode(e),r=document.createElement("a");r.textContent=s,r.className="gloss-jump-letter",t.has(s)?(r.href=`#${this.#l}-letter-${s}`,r.setAttribute("data-active","")):(r.setAttribute("aria-disabled","true"),r.setAttribute("tabindex","-1")),this.#r.appendChild(r)}this.appendChild(this.#r)}#m(t,e){let s=document.createElement("section");s.className="gloss-category",s.setAttribute("data-category",t);let r=document.createElement("header");r.className="gloss-category-header";let i=document.createElement("button");i.type="button",i.className="gloss-category-toggle",i.setAttribute("aria-expanded","true"),i.innerHTML=`<span class="gloss-category-label">${m(t)}</span><output class="gloss-category-count">${e.length}</output><span class="gloss-chevron" aria-hidden="true"></span>`,r.appendChild(i),s.appendChild(r),this.#h.set(t,i);let o=document.createElement("dl");o.className="gloss-term-list";let a=[...e].sort((n,d)=>n.term.localeCompare(d.term)),l=[],h="";for(let n of a){let d=n.term.charAt(0).toUpperCase();if(/[A-Z]/.test(d)&&d!==h){h=d;let f=document.createElement("span");f.id=`${this.#l}-letter-${d}`,f.className="gloss-letter-anchor",o.appendChild(f)}n.el.className="gloss-term",n.el.id=n.id,o.appendChild(n.el),l.push(n.el)}this.#d.set(t,l),s.appendChild(o),this.#i?.appendChild(s),this.listen(i,"click",()=>{let n=i.getAttribute("aria-expanded")==="true";i.setAttribute("aria-expanded",String(!n)),o.hidden=n})}#f=t=>{this.#c&&clearTimeout(this.#c),this.#c=setTimeout(()=>{let e=t.target.value.toLowerCase().trim();this.#g(e)},150)};#g(t){let e=0;for(let s of this.#e)t===""||s.term.toLowerCase().includes(t)||s.definition.toLowerCase().includes(t)?(s.el.removeAttribute("hidden"),e++):s.el.setAttribute("hidden","");for(let s of this.#a){let r=this.#d.get(s)||[],i=r[0]?.closest(".gloss-category");if(!i)continue;if(r.some(a=>!a.hasAttribute("hidden"))){i.removeAttribute("hidden");let a=r.filter(h=>!h.hasAttribute("hidden")).length,l=i.querySelector(".gloss-category-count");l&&(l.textContent=String(a))}else i.setAttribute("hidden","")}this.#n&&(this.#n.textContent=t===""?String(this.#e.length):`${e} / ${this.#e.length}`),t!==""&&this.#t&&(this.#t.textContent="",requestAnimationFrame(()=>{this.#t&&(this.#t.textContent=`${e} term${e!==1?"s":""} found`)})),this.dispatchEvent(new CustomEvent("glossary-wc:search",{bubbles:!0,detail:{query:t,matchCount:e}}))}attributeChangedCallback(t,e,s){e===s||!this.isConnected||t==="src"&&this._loadSrc(s)}async _loadSrc(t){if(t)try{let e=await fetch(t);if(!e.ok)throw new Error(`HTTP ${e.status}`);let s=await e.json();for(;this.firstChild;)this.firstChild.remove();let r=document.createElement("dl");for(let i of s.terms||[]){let o=document.createElement("div");o.setAttribute("data-term-id",i.id||""),o.setAttribute("data-category",i.category||"Uncategorized");let a=document.createElement("dt");a.textContent=i.term||"";let l=document.createElement("dd"),h=i.definition||"";if(i.seeAlso&&i.seeAlso.length>0){let n=i.seeAlso.map(d=>`<a href="#${m(d)}">${m(this.#b(d))}</a>`).join(", ");h+=` See also: ${n}.`}l.innerHTML=h,o.appendChild(a),o.appendChild(l),r.appendChild(o)}this.appendChild(r),s.title&&!this.getAttribute("title")&&this.setAttribute("title",s.title),this.teardown(),this.removeAttribute("data-upgraded"),this.setup()}catch(e){console.warn(`[glossary-wc] Failed to load src="${t}":`,e)}}#b(t){return t.replace(/[-_]/g," ").replace(/\b\w/g,e=>e.toUpperCase())}};C("glossary-wc",g);export{g as GlossaryWc};
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};
2
2
  //# sourceMappingURL=glossary-wc.js.map