vanilla-breeze 0.6.0 → 0.6.2

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 (248) hide show
  1. package/custom-elements.json +8361 -8408
  2. package/dist/cdn/components/chart-wc.js +56 -32
  3. package/dist/cdn/components/form-field.js +1 -1
  4. package/dist/cdn/components/glossary-index.js +1 -1
  5. package/dist/cdn/components/manifest.json +12 -12
  6. package/dist/cdn/components/nav-bar.js +1 -1
  7. package/dist/cdn/components/notification-wc.js +16 -15
  8. package/dist/cdn/components/page-tools.js +1 -1
  9. package/dist/cdn/components/settings-panel.js +1 -1
  10. package/dist/cdn/components/site-index.js +1 -1
  11. package/dist/cdn/components/site-map.js +1 -1
  12. package/dist/cdn/components/site-search.js +1 -1
  13. package/dist/cdn/components/stepper-wc.js +1 -1
  14. package/dist/cdn/components/theme-picker.js +44 -212
  15. package/dist/cdn/components/time-index.js +1 -1
  16. package/dist/cdn/fonts/barlow-condensed-OFL.txt +93 -0
  17. package/dist/cdn/fonts/barlow-condensed-latin-400-normal.woff2 +0 -0
  18. package/dist/cdn/fonts/barlow-condensed-latin-500-normal.woff2 +0 -0
  19. package/dist/cdn/fonts/barlow-condensed-latin-600-normal.woff2 +0 -0
  20. package/dist/cdn/fonts/barlow-condensed-latin-700-normal.woff2 +0 -0
  21. package/dist/cdn/fonts/barlow-condensed-latin-ext-400-normal.woff2 +0 -0
  22. package/dist/cdn/fonts/barlow-condensed-latin-ext-500-normal.woff2 +0 -0
  23. package/dist/cdn/fonts/barlow-condensed-latin-ext-600-normal.woff2 +0 -0
  24. package/dist/cdn/fonts/barlow-condensed-latin-ext-700-normal.woff2 +0 -0
  25. package/dist/cdn/fonts/big-shoulders-display-OFL.txt +93 -0
  26. package/dist/cdn/fonts/big-shoulders-display-latin-ext-wght-normal.woff2 +0 -0
  27. package/dist/cdn/fonts/big-shoulders-display-latin-wght-normal.woff2 +0 -0
  28. package/dist/cdn/fonts/caveat-OFL.txt +93 -0
  29. package/dist/cdn/fonts/caveat-latin-ext-wght-normal.woff2 +0 -0
  30. package/dist/cdn/fonts/caveat-latin-wght-normal.woff2 +0 -0
  31. package/dist/cdn/fonts/courier-prime-OFL.txt +93 -0
  32. package/dist/cdn/fonts/courier-prime-latin-400-normal.woff2 +0 -0
  33. package/dist/cdn/fonts/courier-prime-latin-700-normal.woff2 +0 -0
  34. package/dist/cdn/fonts/courier-prime-latin-ext-400-normal.woff2 +0 -0
  35. package/dist/cdn/fonts/courier-prime-latin-ext-700-normal.woff2 +0 -0
  36. package/dist/cdn/fonts/dm-sans-OFL.txt +93 -0
  37. package/dist/cdn/fonts/dm-sans-latin-ext-wght-normal.woff2 +0 -0
  38. package/dist/cdn/fonts/dm-sans-latin-wght-normal.woff2 +0 -0
  39. package/dist/cdn/fonts/dm-serif-display-OFL.txt +93 -0
  40. package/dist/cdn/fonts/dm-serif-display-latin-400-normal.woff2 +0 -0
  41. package/dist/cdn/fonts/dm-serif-display-latin-ext-400-normal.woff2 +0 -0
  42. package/dist/cdn/fonts/exo-2-OFL.txt +93 -0
  43. package/dist/cdn/fonts/exo-2-latin-ext-wght-normal.woff2 +0 -0
  44. package/dist/cdn/fonts/exo-2-latin-wght-normal.woff2 +0 -0
  45. package/dist/cdn/fonts/fira-code-OFL.txt +93 -0
  46. package/dist/cdn/fonts/fira-code-latin-ext-wght-normal.woff2 +0 -0
  47. package/dist/cdn/fonts/fira-code-latin-wght-normal.woff2 +0 -0
  48. package/dist/cdn/fonts/flow-block-OFL.txt +93 -0
  49. package/dist/cdn/fonts/flow-block-latin-400-normal.woff2 +0 -0
  50. package/dist/cdn/fonts/flow-block-latin-ext-400-normal.woff2 +0 -0
  51. package/dist/cdn/fonts/fraunces-OFL.txt +93 -0
  52. package/dist/cdn/fonts/fraunces-latin-ext-wght-normal.woff2 +0 -0
  53. package/dist/cdn/fonts/fraunces-latin-wght-normal.woff2 +0 -0
  54. package/dist/cdn/fonts/ibm-plex-mono-OFL.txt +93 -0
  55. package/dist/cdn/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
  56. package/dist/cdn/fonts/ibm-plex-mono-latin-700-normal.woff2 +0 -0
  57. package/dist/cdn/fonts/ibm-plex-mono-latin-ext-400-normal.woff2 +0 -0
  58. package/dist/cdn/fonts/ibm-plex-mono-latin-ext-700-normal.woff2 +0 -0
  59. package/dist/cdn/fonts/inter-OFL.txt +93 -0
  60. package/dist/cdn/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
  61. package/dist/cdn/fonts/inter-latin-wght-normal.woff2 +0 -0
  62. package/dist/cdn/fonts/jetbrains-mono-OFL.txt +93 -0
  63. package/dist/cdn/fonts/jetbrains-mono-latin-ext-wght-normal.woff2 +0 -0
  64. package/dist/cdn/fonts/jetbrains-mono-latin-wght-normal.woff2 +0 -0
  65. package/dist/cdn/fonts/josefin-sans-OFL.txt +93 -0
  66. package/dist/cdn/fonts/josefin-sans-latin-ext-wght-normal.woff2 +0 -0
  67. package/dist/cdn/fonts/josefin-sans-latin-wght-normal.woff2 +0 -0
  68. package/dist/cdn/fonts/lora-OFL.txt +93 -0
  69. package/dist/cdn/fonts/lora-latin-ext-wght-normal.woff2 +0 -0
  70. package/dist/cdn/fonts/lora-latin-wght-normal.woff2 +0 -0
  71. package/dist/cdn/fonts/merriweather-OFL.txt +93 -0
  72. package/dist/cdn/fonts/merriweather-latin-ext-wght-normal.woff2 +0 -0
  73. package/dist/cdn/fonts/merriweather-latin-wght-normal.woff2 +0 -0
  74. package/dist/cdn/fonts/newsreader-OFL.txt +93 -0
  75. package/dist/cdn/fonts/newsreader-latin-ext-wght-italic.woff2 +0 -0
  76. package/dist/cdn/fonts/newsreader-latin-ext-wght-normal.woff2 +0 -0
  77. package/dist/cdn/fonts/newsreader-latin-wght-italic.woff2 +0 -0
  78. package/dist/cdn/fonts/newsreader-latin-wght-normal.woff2 +0 -0
  79. package/dist/cdn/fonts/nunito-OFL.txt +93 -0
  80. package/dist/cdn/fonts/nunito-latin-ext-wght-normal.woff2 +0 -0
  81. package/dist/cdn/fonts/nunito-latin-wght-normal.woff2 +0 -0
  82. package/dist/cdn/fonts/orbitron-OFL.txt +93 -0
  83. package/dist/cdn/fonts/orbitron-latin-wght-normal.woff2 +0 -0
  84. package/dist/cdn/fonts/playfair-display-OFL.txt +93 -0
  85. package/dist/cdn/fonts/playfair-display-latin-ext-wght-normal.woff2 +0 -0
  86. package/dist/cdn/fonts/playfair-display-latin-wght-normal.woff2 +0 -0
  87. package/dist/cdn/fonts/press-start-2p-OFL.txt +93 -0
  88. package/dist/cdn/fonts/press-start-2p-latin-400-normal.woff2 +0 -0
  89. package/dist/cdn/fonts/press-start-2p-latin-ext-400-normal.woff2 +0 -0
  90. package/dist/cdn/fonts/redacted-script-OFL.txt +93 -0
  91. package/dist/cdn/fonts/redacted-script-latin-300-normal.woff2 +0 -0
  92. package/dist/cdn/fonts/redacted-script-latin-400-normal.woff2 +0 -0
  93. package/dist/cdn/fonts/redacted-script-latin-700-normal.woff2 +0 -0
  94. package/dist/cdn/fonts/redacted-script-latin-ext-300-normal.woff2 +0 -0
  95. package/dist/cdn/fonts/redacted-script-latin-ext-400-normal.woff2 +0 -0
  96. package/dist/cdn/fonts/redacted-script-latin-ext-700-normal.woff2 +0 -0
  97. package/dist/cdn/fonts/shantell-sans-OFL.txt +93 -0
  98. package/dist/cdn/fonts/shantell-sans-latin-ext-wght-italic.woff2 +0 -0
  99. package/dist/cdn/fonts/shantell-sans-latin-ext-wght-normal.woff2 +0 -0
  100. package/dist/cdn/fonts/shantell-sans-latin-wght-italic.woff2 +0 -0
  101. package/dist/cdn/fonts/shantell-sans-latin-wght-normal.woff2 +0 -0
  102. package/dist/cdn/fonts/share-tech-mono-OFL.txt +93 -0
  103. package/dist/cdn/fonts/share-tech-mono-latin-400-normal.woff2 +0 -0
  104. package/dist/cdn/fonts/source-code-pro-OFL.txt +93 -0
  105. package/dist/cdn/fonts/source-code-pro-latin-ext-wght-normal.woff2 +0 -0
  106. package/dist/cdn/fonts/source-code-pro-latin-wght-normal.woff2 +0 -0
  107. package/dist/cdn/fonts/space-mono-OFL.txt +93 -0
  108. package/dist/cdn/fonts/space-mono-latin-400-normal.woff2 +0 -0
  109. package/dist/cdn/fonts/space-mono-latin-700-normal.woff2 +0 -0
  110. package/dist/cdn/fonts/space-mono-latin-ext-400-normal.woff2 +0 -0
  111. package/dist/cdn/fonts/space-mono-latin-ext-700-normal.woff2 +0 -0
  112. package/dist/cdn/fonts/vt323-OFL.txt +93 -0
  113. package/dist/cdn/fonts/vt323-latin-400-normal.woff2 +0 -0
  114. package/dist/cdn/fonts/vt323-latin-ext-400-normal.woff2 +0 -0
  115. package/dist/cdn/packs/kawaii/fonts/fira-code-latin-ext-wght-normal.woff2 +0 -0
  116. package/dist/cdn/packs/kawaii/fonts/fira-code-latin-wght-normal.woff2 +0 -0
  117. package/dist/cdn/packs/kawaii/fonts/nunito-latin-ext-wght-normal.woff2 +0 -0
  118. package/dist/cdn/packs/kawaii/fonts/nunito-latin-wght-normal.woff2 +0 -0
  119. package/dist/cdn/packs/kawaii.full.css +1 -1
  120. package/dist/cdn/packs/kawaii.theme.css +1 -1
  121. package/dist/cdn/packs/manifest.json +4 -4
  122. package/dist/cdn/packs/ui.full.css +1 -1
  123. package/dist/cdn/packs/ui.full.js +44 -212
  124. package/dist/cdn/themes/8bit.css +1 -1
  125. package/dist/cdn/themes/8bit.tokens.json +1 -1
  126. package/dist/cdn/themes/alpha1999-dark.tokens.json +1 -1
  127. package/dist/cdn/themes/alpha1999.css +1 -1
  128. package/dist/cdn/themes/alpha1999.tokens.json +1 -1
  129. package/dist/cdn/themes/art-deco-dark.tokens.json +1 -1
  130. package/dist/cdn/themes/art-deco.css +1 -1
  131. package/dist/cdn/themes/art-deco.tokens.json +1 -1
  132. package/dist/cdn/themes/bauhaus-dark.tokens.json +1 -1
  133. package/dist/cdn/themes/bauhaus.css +1 -1
  134. package/dist/cdn/themes/bauhaus.tokens.json +1 -1
  135. package/dist/cdn/themes/brutalist-dark.tokens.json +1 -1
  136. package/dist/cdn/themes/brutalist.tokens.json +1 -1
  137. package/dist/cdn/themes/catppuccin-frappe.css +1 -1
  138. package/dist/cdn/themes/catppuccin-frappe.tokens.json +1 -1
  139. package/dist/cdn/themes/catppuccin-latte-dark.tokens.json +1 -1
  140. package/dist/cdn/themes/catppuccin-latte.css +1 -1
  141. package/dist/cdn/themes/catppuccin-latte.tokens.json +1 -1
  142. package/dist/cdn/themes/catppuccin-macchiato.css +1 -1
  143. package/dist/cdn/themes/catppuccin-macchiato.tokens.json +1 -1
  144. package/dist/cdn/themes/catppuccin-mocha.css +1 -1
  145. package/dist/cdn/themes/catppuccin-mocha.tokens.json +1 -1
  146. package/dist/cdn/themes/classic-dark.tokens.json +1 -1
  147. package/dist/cdn/themes/classic.tokens.json +1 -1
  148. package/dist/cdn/themes/claymorphism-dark.tokens.json +1 -1
  149. package/dist/cdn/themes/claymorphism.css +1 -1
  150. package/dist/cdn/themes/claymorphism.tokens.json +1 -1
  151. package/dist/cdn/themes/clinical-dark.tokens.json +1 -1
  152. package/dist/cdn/themes/clinical.tokens.json +1 -1
  153. package/dist/cdn/themes/cottagecore-dark.tokens.json +1 -1
  154. package/dist/cdn/themes/cottagecore.css +1 -1
  155. package/dist/cdn/themes/cottagecore.tokens.json +1 -1
  156. package/dist/cdn/themes/cyber.css +1 -1
  157. package/dist/cdn/themes/cyber.tokens.json +1 -1
  158. package/dist/cdn/themes/dawn-dark.tokens.json +1 -1
  159. package/dist/cdn/themes/dawn.css +1 -1
  160. package/dist/cdn/themes/dawn.tokens.json +1 -1
  161. package/dist/cdn/themes/dracula.css +1 -1
  162. package/dist/cdn/themes/dracula.tokens.json +1 -1
  163. package/dist/cdn/themes/dusk.css +1 -1
  164. package/dist/cdn/themes/dusk.tokens.json +10 -1
  165. package/dist/cdn/themes/editorial-dark.tokens.json +1 -1
  166. package/dist/cdn/themes/editorial.css +1 -1
  167. package/dist/cdn/themes/editorial.tokens.json +1 -1
  168. package/dist/cdn/themes/financial-dark.tokens.json +1 -1
  169. package/dist/cdn/themes/financial.css +1 -1
  170. package/dist/cdn/themes/financial.tokens.json +1 -1
  171. package/dist/cdn/themes/genai.css +1 -1
  172. package/dist/cdn/themes/genai.tokens.json +1 -1
  173. package/dist/cdn/themes/glassmorphism-dark.tokens.json +1 -1
  174. package/dist/cdn/themes/glassmorphism.css +1 -1
  175. package/dist/cdn/themes/glassmorphism.tokens.json +1 -1
  176. package/dist/cdn/themes/government-dark.tokens.json +1 -1
  177. package/dist/cdn/themes/government.tokens.json +1 -1
  178. package/dist/cdn/themes/gruvbox-dark.tokens.json +1 -1
  179. package/dist/cdn/themes/gruvbox.css +1 -1
  180. package/dist/cdn/themes/gruvbox.tokens.json +3 -2
  181. package/dist/cdn/themes/high-noon-dark.tokens.json +1 -1
  182. package/dist/cdn/themes/high-noon.css +1 -1
  183. package/dist/cdn/themes/high-noon.tokens.json +10 -1
  184. package/dist/cdn/themes/journal-dark.tokens.json +1 -1
  185. package/dist/cdn/themes/journal.css +1 -1
  186. package/dist/cdn/themes/journal.tokens.json +1 -1
  187. package/dist/cdn/themes/kawaii-dark.tokens.json +1 -1
  188. package/dist/cdn/themes/kawaii.css +1 -1
  189. package/dist/cdn/themes/kawaii.tokens.json +1 -1
  190. package/dist/cdn/themes/magna-dark.tokens.json +1 -1
  191. package/dist/cdn/themes/magna.css +1 -1
  192. package/dist/cdn/themes/magna.tokens.json +1 -1
  193. package/dist/cdn/themes/manifest.json +37 -37
  194. package/dist/cdn/themes/midnight.css +1 -1
  195. package/dist/cdn/themes/midnight.tokens.json +9 -1
  196. package/dist/cdn/themes/minimal-dark.tokens.json +1 -1
  197. package/dist/cdn/themes/minimal.tokens.json +1 -1
  198. package/dist/cdn/themes/modern-dark.tokens.json +1 -1
  199. package/dist/cdn/themes/modern.css +1 -1
  200. package/dist/cdn/themes/modern.tokens.json +1 -1
  201. package/dist/cdn/themes/nes-dark.tokens.json +1 -1
  202. package/dist/cdn/themes/nes.css +1 -1
  203. package/dist/cdn/themes/nes.tokens.json +1 -1
  204. package/dist/cdn/themes/neumorphism-dark.tokens.json +1 -1
  205. package/dist/cdn/themes/neumorphism.css +1 -1
  206. package/dist/cdn/themes/neumorphism.tokens.json +1 -1
  207. package/dist/cdn/themes/nord-dark.tokens.json +1 -1
  208. package/dist/cdn/themes/nord.css +1 -1
  209. package/dist/cdn/themes/nord.tokens.json +3 -2
  210. package/dist/cdn/themes/organic-dark.tokens.json +1 -1
  211. package/dist/cdn/themes/organic.css +1 -1
  212. package/dist/cdn/themes/organic.tokens.json +1 -1
  213. package/dist/cdn/themes/rose-pine-dark.tokens.json +1 -1
  214. package/dist/cdn/themes/rose-pine.css +1 -1
  215. package/dist/cdn/themes/rose-pine.tokens.json +3 -2
  216. package/dist/cdn/themes/rough-dark.tokens.json +1 -1
  217. package/dist/cdn/themes/rough.css +1 -1
  218. package/dist/cdn/themes/rough.tokens.json +1 -1
  219. package/dist/cdn/themes/solarized-dark.tokens.json +1 -1
  220. package/dist/cdn/themes/solarized.css +1 -1
  221. package/dist/cdn/themes/solarized.tokens.json +1 -1
  222. package/dist/cdn/themes/startup-dark.tokens.json +1 -1
  223. package/dist/cdn/themes/startup.css +1 -1
  224. package/dist/cdn/themes/startup.tokens.json +1 -1
  225. package/dist/cdn/themes/super2026-dark.tokens.json +1 -1
  226. package/dist/cdn/themes/super2026.css +1 -1
  227. package/dist/cdn/themes/super2026.tokens.json +1 -1
  228. package/dist/cdn/themes/swiss-dark.tokens.json +1 -1
  229. package/dist/cdn/themes/swiss.tokens.json +1 -1
  230. package/dist/cdn/themes/terminal.css +1 -1
  231. package/dist/cdn/themes/terminal.tokens.json +1 -1
  232. package/dist/cdn/themes/tokyo-night-dark.tokens.json +1 -1
  233. package/dist/cdn/themes/tokyo-night.css +1 -1
  234. package/dist/cdn/themes/tokyo-night.tokens.json +3 -2
  235. package/dist/cdn/themes/vaporwave-dark.tokens.json +1 -1
  236. package/dist/cdn/themes/vaporwave.css +1 -1
  237. package/dist/cdn/themes/vaporwave.tokens.json +9 -1
  238. package/dist/cdn/themes/win9x-dark.tokens.json +1 -1
  239. package/dist/cdn/themes/win9x.tokens.json +1 -1
  240. package/dist/cdn/vanilla-breeze-autoload.js +44 -43
  241. package/dist/cdn/vanilla-breeze-charts.js +56 -32
  242. package/dist/cdn/vanilla-breeze-core.css +1 -1
  243. package/dist/cdn/vanilla-breeze-core.js +36 -35
  244. package/dist/cdn/vanilla-breeze-dev.css +1 -1
  245. package/dist/cdn/vanilla-breeze-extras.js +12 -12
  246. package/dist/cdn/vanilla-breeze.css +1 -1
  247. package/dist/cdn/vanilla-breeze.js +130 -297
  248. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
- var Kr=Object.defineProperty;var ae=(r,t)=>()=>(r&&(t=r(r=0)),t);var Hi=(r,t)=>{for(var e in t)Kr(r,e,{get:t[e],enumerable:!0})};function is(r,t,e){let i=256*Math.pow(2,e),s=r/i*360-180;return{lat:Math.atan(Math.sinh(Math.PI*(1-2*t/i)))*180/Math.PI,lng:s}}function st(r,t,e){let i=256*Math.pow(2,e),s=r*Math.PI/180;return{x:(t+180)/360*i,y:(1-Math.log(Math.tan(s)+1/Math.cos(s))/Math.PI)/2*i}}function on(r,t,e,i,s){let n=s??(typeof devicePixelRatio=="number"?devicePixelRatio:1),o="abc"[Math.abs(e+i)%3];return r.replaceAll("{z}",String(t)).replaceAll("{x}",String(e)).replaceAll("{y}",String(i)).replaceAll("{s}",o).replaceAll("{r}",n>1?"@2x":"")}function Nt(r,t,e,i,s){let n=s||(U[r]??U.osm).template;return on(n,t,e,i)}var U,fe=ae(()=>{U={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 ss={};Hi(ss,{MapInteraction:()=>me});var me,rs=ae(()=>{fe();me=class{#t;#e;#i;#s;#r;#n;#a;#c;#h=0;#l=0;#o=15;#u=1;#p=19;#d=0;#f=0;#k=0;#w=0;#m=15;#v=0;#y=0;#g=new Map;#b=0;#T=0;#A=new Map;#x=0;#S=0;constructor({host:t,viewport:e,tiles:i,marker:s,lat:n,lng:o,zoom:a,provider:l,tileUrl:c,width:h,height:u,onDeactivate:p,onMove:d}){this.#c=t,this.#t=e,this.#e=i,this.#i=s,this.#s=l,this.#r=c||"",this.#n=p,this.#a=d||(()=>{}),this.#o=a,this.#k=this.#b=n,this.#w=this.#T=o,this.#m=a,this.#v=h,this.#y=u;let f=st(n,o,a);this.#h=f.x,this.#l=f.y,this.#E(),this.#e.replaceChildren(),this.#e.style.transform="",this.#i&&this.#e.appendChild(this.#i),this.#t.addEventListener("pointerdown",this.#L),this.#t.addEventListener("pointermove",this.#C),this.#t.addEventListener("pointerup",this.#$),this.#t.addEventListener("pointercancel",this.#$),this.#t.addEventListener("wheel",this.#I,{passive:!1}),this.#t.addEventListener("keydown",this.#M),this.#D()}get zoom(){return this.#o}get minZoom(){return this.#u}get maxZoom(){return this.#p}get center(){let{lat:t,lng:e}=is(this.#h,this.#l,this.#o);return{lat:+t.toFixed(6),lng:+e.toFixed(6),zoom:this.#o}}zoomBy(t){this.#R(this.#o+t,this.#v/2,this.#y/2)}recenter(){this.#o=this.#m;let t=st(this.#k,this.#w,this.#o);this.#h=t.x,this.#l=t.y,this.#j(),this.#E(),this.#z(),this.#D(),this.#_()}panBy(t,e){this.#h+=t,this.#l+=e,this.#z(),this.#D()}resize(t,e){!t||!e||t===this.#v&&e===this.#y||(this.#v=t,this.#y=e,this.#z(),this.#D())}#E(){this.#d=Math.floor(this.#h/256)*256,this.#f=Math.floor(this.#l/256)*256}#L=t=>{if(!(t.pointerType==="mouse"&&t.button!==0)&&!t.target.closest?.("a, button")){t.preventDefault(),this.#t.focus({preventScroll:!0}),this.#A.set(t.pointerId,{x:t.clientX,y:t.clientY});try{this.#t.setPointerCapture(t.pointerId)}catch{}this.#A.size===1?(this.#x=0,this.#t.setAttribute("data-dragging","")):this.#A.size===2&&(this.#S=this.#P(),this.#x=1/0)}};#C=t=>{let e=this.#A.get(t.pointerId);if(!e)return;let i=t.clientX-e.x,s=t.clientY-e.y;if(e.x=t.clientX,e.y=t.clientY,this.#A.size===1){this.#x+=Math.abs(i)+Math.abs(s),this.panBy(-i,-s);return}if(this.#A.size===2){this.panBy(-i/2,-s/2);let n=this.#P();if(!this.#S){this.#S=n;return}let o=n/this.#S;if(o>=1.5||o<=1/1.5){let a=this.#N();this.#R(this.#o+(o>1?1:-1),a.x,a.y),this.#S=n}}};#$=t=>{if(!this.#A.has(t.pointerId))return;let e=this.#A.size===1;this.#A.delete(t.pointerId);try{this.#t.releasePointerCapture(t.pointerId)}catch{}if(this.#A.size<2&&(this.#S=0),!(this.#A.size>0)){if(this.#t.removeAttribute("data-dragging"),e&&t.type==="pointerup"&&this.#x<5){let i=this.#t.getBoundingClientRect();this.panBy(t.clientX-i.left-this.#v/2,t.clientY-i.top-this.#y/2)}this.#_()}};#P(){let[t,e]=[...this.#A.values()];return t&&e?Math.hypot(t.x-e.x,t.y-e.y):0}#N(){let[t,e]=[...this.#A.values()],i=this.#t.getBoundingClientRect();return{x:(t.x+e.x)/2-i.left,y:(t.y+e.y)/2-i.top}}#I=t=>{t.preventDefault();let e=t.ctrlKey?-t.deltaY*.01:-Math.sign(t.deltaY),i=Math.round(Math.max(this.#u,Math.min(this.#p,this.#o+e)));if(i===this.#o)return;let s=this.#t.getBoundingClientRect();this.#R(i,t.clientX-s.left,t.clientY-s.top)};#M=t=>{if(t.target!==this.#t)return;let e=80,i=null;switch(t.key){case"ArrowLeft":i=[-e,0];break;case"ArrowRight":i=[e,0];break;case"ArrowUp":i=[0,-e];break;case"ArrowDown":i=[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.#n();return;default:return}t.preventDefault(),this.panBy(i[0],i[1]),this.#_()};#R(t,e,i){if(t=Math.max(this.#u,Math.min(this.#p,t)),t===this.#o)return;let s=this.#h-this.#v/2+e,n=this.#l-this.#y/2+i,o=Math.pow(2,t-this.#o);this.#h=s*o-e+this.#v/2,this.#l=n*o-i+this.#y/2,this.#o=t,this.#j(),this.#z(),this.#E(),this.#D(),this.#_()}#z(){let t=256*Math.pow(2,this.#o),e=(this.#h%t+t)%t;e!==this.#h&&(this.#h=e,this.#j(),this.#E());let i=Math.min(this.#y/2,t/2);this.#l=Math.max(i,Math.min(t-i,this.#l))}#D(){let t=-(this.#h-this.#v/2-this.#d),e=-(this.#l-this.#y/2-this.#f);this.#e.style.transform=`translate(${Math.round(t)}px, ${Math.round(e)}px)`,this.#F(),this.#B(),this.#O()}#F(){let t=this.#o,e=Math.pow(2,t),i=this.#h-this.#v/2,s=this.#l-this.#y/2,n=Math.floor(i/256)-1,o=Math.max(0,Math.floor(s/256)-1),a=Math.ceil((i+this.#v)/256)+1,l=Math.min(e,Math.ceil((s+this.#y)/256)+1);for(let c=o;c<l;c++)for(let h=n;h<a;h++){let u=(h%e+e)%e,p=`${t}/${h}/${c}`;if(this.#g.has(p))continue;let d=document.createElement("img");d.src=Nt(this.#s,t,u,c,this.#r),d.alt="",d.draggable=!1,d.style.left=`${h*256-this.#d}px`,d.style.top=`${c*256-this.#f}px`,d._wx=h*256,d._wy=c*256,this.#g.set(p,d),this.#e.insertBefore(d,this.#i?.parentNode===this.#e?this.#i:null)}}#B(){let t=this.#h-this.#v/2,e=this.#l-this.#y/2,i=512;for(let[s,n]of this.#g){let o=n._wx??0,a=n._wy??0;(o+256<t-i||o>t+this.#v+i||a+256<e-i||a>e+this.#y+i)&&(n.remove(),this.#g.delete(s))}}#O(){if(!this.#i)return;let t=st(this.#b,this.#T,this.#o),e=this.#i.offsetWidth||32,i=256*Math.pow(2,this.#o),s=t.x;for(;s-this.#h>i/2;)s-=i;for(;this.#h-s>i/2;)s+=i;this.#i.style.top=`${Math.round(t.y-this.#f-e)}px`,this.#i.style.left=`${Math.round(s-this.#d-e/2)}px`,this.#i.style.transform="none"}#_(){let t=this.center;this.#c.dispatchEvent(new CustomEvent("geo-map:move",{bubbles:!0,detail:t})),this.#a(t)}#j(){for(let t of this.#g.values())t.remove();this.#g.clear()}destroy(){this.#t.removeEventListener("pointerdown",this.#L),this.#t.removeEventListener("pointermove",this.#C),this.#t.removeEventListener("pointerup",this.#$),this.#t.removeEventListener("pointercancel",this.#$),this.#t.removeEventListener("wheel",this.#I),this.#t.removeEventListener("keydown",this.#M),this.#t.removeAttribute("data-dragging"),this.#A.clear(),this.#j()}}});var ve={};Hi(ve,{EMOJI_ALIASES:()=>cs,EMOJI_GROUPS:()=>hn,EMOJI_GROUP_ICONS:()=>dn,EMOJI_GROUP_LABELS:()=>un,EMOJI_MAP:()=>gt,EXTENDED_EVENT:()=>pn,EXTENDED_REGISTRY:()=>hs,extendedCount:()=>fn,getByGroup:()=>gn,resolveEmoji:()=>mn,searchEmoji:()=>bn});function It(){for(;ls<as.length;){let r=as[ls++];for(let[t,e,i,s]of r){if(gt.has(t))continue;let n={shortcode:t,emoji:e,name:i,keywords:[],group:s};gt.set(t,n),bt.push(n)}}}function fn(){return It(),bt.length}function mn(r){It();let t=gt.get(r);if(t)return t;let e=cs.get(r);return e&&gt.get(e)||null}function gn(r){It();let t=Pt.filter(i=>i.group===r),e=bt.filter(i=>i.group===r);return e.length>0?t.concat(e):t}function bn(r){It();let t=r.toLowerCase().trim(),e=bt.length>0?Pt.concat(bt):Pt;return t?e.filter(i=>i.shortcode.includes(t)||i.name.toLowerCase().includes(t)||i.keywords&&i.keywords.some(s=>s.includes(t))):e}var Pt,gt,cs,hn,un,dn,hs,pn,as,ls,bt,ye=ae(()=>{Pt=[{shortcode:"smile",emoji:"\u{1F604}",name:"Smiling Face with Open Mouth",keywords:["happy","joy","laugh"],group:"smileys"},{shortcode:"grinning",emoji:"\u{1F600}",name:"Grinning Face",keywords:["happy","smile"],group:"smileys"},{shortcode:"laughing",emoji:"\u{1F606}",name:"Grinning Squinting Face",keywords:["happy","laugh"],group:"smileys"},{shortcode:"sweat_smile",emoji:"\u{1F605}",name:"Grinning Face with Sweat",keywords:["hot","relief"],group:"smileys"},{shortcode:"rofl",emoji:"\u{1F923}",name:"Rolling on the Floor Laughing",keywords:["lol","funny"],group:"smileys"},{shortcode:"joy",emoji:"\u{1F602}",name:"Face with Tears of Joy",keywords:["happy","cry","laugh"],group:"smileys"},{shortcode:"slightly_smiling_face",emoji:"\u{1F642}",name:"Slightly Smiling Face",keywords:["smile"],group:"smileys"},{shortcode:"upside_down_face",emoji:"\u{1F643}",name:"Upside-Down Face",keywords:["sarcasm","silly"],group:"smileys"},{shortcode:"wink",emoji:"\u{1F609}",name:"Winking Face",keywords:["flirt","joke"],group:"smileys"},{shortcode:"blush",emoji:"\u{1F60A}",name:"Smiling Face with Smiling Eyes",keywords:["happy","shy"],group:"smileys"},{shortcode:"innocent",emoji:"\u{1F607}",name:"Smiling Face with Halo",keywords:["angel","good"],group:"smileys"},{shortcode:"heart_eyes",emoji:"\u{1F60D}",name:"Smiling Face with Heart-Eyes",keywords:["love","crush"],group:"smileys"},{shortcode:"star_struck",emoji:"\u{1F929}",name:"Star-Struck",keywords:["wow","amazing"],group:"smileys"},{shortcode:"kissing_heart",emoji:"\u{1F618}",name:"Face Blowing a Kiss",keywords:["love","kiss"],group:"smileys"},{shortcode:"yum",emoji:"\u{1F60B}",name:"Face Savoring Food",keywords:["delicious","tasty"],group:"smileys"},{shortcode:"stuck_out_tongue",emoji:"\u{1F61B}",name:"Face with Tongue",keywords:["playful","silly"],group:"smileys"},{shortcode:"stuck_out_tongue_winking_eye",emoji:"\u{1F61C}",name:"Winking Face with Tongue",keywords:["silly","playful"],group:"smileys"},{shortcode:"zany_face",emoji:"\u{1F92A}",name:"Zany Face",keywords:["crazy","wild"],group:"smileys"},{shortcode:"hugs",emoji:"\u{1F917}",name:"Hugging Face",keywords:["hug","warm"],group:"smileys"},{shortcode:"thinking",emoji:"\u{1F914}",name:"Thinking Face",keywords:["hmm","consider"],group:"smileys"},{shortcode:"shushing_face",emoji:"\u{1F92B}",name:"Shushing Face",keywords:["quiet","secret"],group:"smileys"},{shortcode:"smirk",emoji:"\u{1F60F}",name:"Smirking Face",keywords:["sly","suggestive"],group:"smileys"},{shortcode:"unamused",emoji:"\u{1F612}",name:"Unamused Face",keywords:["bored","unimpressed"],group:"smileys"},{shortcode:"roll_eyes",emoji:"\u{1F644}",name:"Face with Rolling Eyes",keywords:["annoyed","whatever"],group:"smileys"},{shortcode:"grimacing",emoji:"\u{1F62C}",name:"Grimacing Face",keywords:["awkward","nervous"],group:"smileys"},{shortcode:"relieved",emoji:"\u{1F60C}",name:"Relieved Face",keywords:["calm","peaceful"],group:"smileys"},{shortcode:"pensive",emoji:"\u{1F614}",name:"Pensive Face",keywords:["sad","thoughtful"],group:"smileys"},{shortcode:"sleepy",emoji:"\u{1F62A}",name:"Sleepy Face",keywords:["tired","sleep"],group:"smileys"},{shortcode:"sleeping",emoji:"\u{1F634}",name:"Sleeping Face",keywords:["zzz","sleep"],group:"smileys"},{shortcode:"mask",emoji:"\u{1F637}",name:"Face with Medical Mask",keywords:["sick","health"],group:"smileys"},{shortcode:"nerd_face",emoji:"\u{1F913}",name:"Nerd Face",keywords:["geek","smart"],group:"smileys"},{shortcode:"sunglasses",emoji:"\u{1F60E}",name:"Smiling Face with Sunglasses",keywords:["cool","chill"],group:"smileys"},{shortcode:"confused",emoji:"\u{1F615}",name:"Confused Face",keywords:["puzzled","unsure"],group:"smileys"},{shortcode:"worried",emoji:"\u{1F61F}",name:"Worried Face",keywords:["anxious","concern"],group:"smileys"},{shortcode:"cry",emoji:"\u{1F622}",name:"Crying Face",keywords:["sad","tear"],group:"smileys"},{shortcode:"sob",emoji:"\u{1F62D}",name:"Loudly Crying Face",keywords:["sad","cry"],group:"smileys"},{shortcode:"angry",emoji:"\u{1F620}",name:"Angry Face",keywords:["mad","annoyed"],group:"smileys"},{shortcode:"rage",emoji:"\u{1F92C}",name:"Face with Symbols on Mouth",keywords:["angry","swear"],group:"smileys"},{shortcode:"exploding_head",emoji:"\u{1F92F}",name:"Exploding Head",keywords:["mind blown","shocked"],group:"smileys"},{shortcode:"flushed",emoji:"\u{1F633}",name:"Flushed Face",keywords:["embarrassed","shocked"],group:"smileys"},{shortcode:"scream",emoji:"\u{1F631}",name:"Face Screaming in Fear",keywords:["scared","horror"],group:"smileys"},{shortcode:"skull",emoji:"\u{1F480}",name:"Skull",keywords:["dead","death"],group:"smileys"},{shortcode:"clown_face",emoji:"\u{1F921}",name:"Clown Face",keywords:["joke","funny"],group:"smileys"},{shortcode:"ghost",emoji:"\u{1F47B}",name:"Ghost",keywords:["halloween","spooky"],group:"smileys"},{shortcode:"wave",emoji:"\u{1F44B}",name:"Waving Hand",keywords:["hello","goodbye"],group:"people"},{shortcode:"raised_hand",emoji:"\u270B",name:"Raised Hand",keywords:["stop","high five"],group:"people"},{shortcode:"ok_hand",emoji:"\u{1F44C}",name:"OK Hand",keywords:["perfect","nice"],group:"people"},{shortcode:"thumbsup",emoji:"\u{1F44D}",name:"Thumbs Up",keywords:["approve","good","yes"],group:"people"},{shortcode:"thumbsdown",emoji:"\u{1F44E}",name:"Thumbs Down",keywords:["disapprove","bad","no"],group:"people"},{shortcode:"clap",emoji:"\u{1F44F}",name:"Clapping Hands",keywords:["applause","bravo"],group:"people"},{shortcode:"raised_hands",emoji:"\u{1F64C}",name:"Raising Hands",keywords:["celebration","hooray"],group:"people"},{shortcode:"pray",emoji:"\u{1F64F}",name:"Folded Hands",keywords:["thanks","please","hope"],group:"people"},{shortcode:"handshake",emoji:"\u{1F91D}",name:"Handshake",keywords:["deal","agreement"],group:"people"},{shortcode:"point_up",emoji:"\u261D\uFE0F",name:"Index Pointing Up",keywords:["attention","important"],group:"people"},{shortcode:"point_right",emoji:"\u{1F449}",name:"Backhand Index Pointing Right",keywords:["direction","this"],group:"people"},{shortcode:"point_left",emoji:"\u{1F448}",name:"Backhand Index Pointing Left",keywords:["direction","that"],group:"people"},{shortcode:"point_down",emoji:"\u{1F447}",name:"Backhand Index Pointing Down",keywords:["direction","below"],group:"people"},{shortcode:"v",emoji:"\u270C\uFE0F",name:"Victory Hand",keywords:["peace","two"],group:"people"},{shortcode:"crossed_fingers",emoji:"\u{1F91E}",name:"Crossed Fingers",keywords:["luck","hope"],group:"people"},{shortcode:"muscle",emoji:"\u{1F4AA}",name:"Flexed Biceps",keywords:["strong","power"],group:"people"},{shortcode:"writing_hand",emoji:"\u270D\uFE0F",name:"Writing Hand",keywords:["write","note"],group:"people"},{shortcode:"eyes",emoji:"\u{1F440}",name:"Eyes",keywords:["look","see","watch"],group:"people"},{shortcode:"brain",emoji:"\u{1F9E0}",name:"Brain",keywords:["smart","think","mind"],group:"people"},{shortcode:"speaking_head",emoji:"\u{1F5E3}\uFE0F",name:"Speaking Head",keywords:["talk","announce"],group:"people"},{shortcode:"baby",emoji:"\u{1F476}",name:"Baby",keywords:["child","newborn"],group:"people"},{shortcode:"person_shrugging",emoji:"\u{1F937}",name:"Person Shrugging",keywords:["dunno","whatever"],group:"people"},{shortcode:"person_facepalming",emoji:"\u{1F926}",name:"Person Facepalming",keywords:["frustration","disbelief"],group:"people"},{shortcode:"person_raising_hand",emoji:"\u{1F64B}",name:"Person Raising Hand",keywords:["question","volunteer"],group:"people"},{shortcode:"ninja",emoji:"\u{1F977}",name:"Ninja",keywords:["stealth","hidden"],group:"people"},{shortcode:"dog",emoji:"\u{1F436}",name:"Dog Face",keywords:["puppy","pet"],group:"animals"},{shortcode:"cat",emoji:"\u{1F431}",name:"Cat Face",keywords:["kitten","pet"],group:"animals"},{shortcode:"mouse",emoji:"\u{1F42D}",name:"Mouse Face",keywords:["rodent"],group:"animals"},{shortcode:"rabbit",emoji:"\u{1F430}",name:"Rabbit Face",keywords:["bunny","easter"],group:"animals"},{shortcode:"fox",emoji:"\u{1F98A}",name:"Fox",keywords:["clever","sly"],group:"animals"},{shortcode:"bear",emoji:"\u{1F43B}",name:"Bear",keywords:["teddy","nature"],group:"animals"},{shortcode:"unicorn",emoji:"\u{1F984}",name:"Unicorn",keywords:["magic","fantasy"],group:"animals"},{shortcode:"bee",emoji:"\u{1F41D}",name:"Honeybee",keywords:["honey","buzz"],group:"animals"},{shortcode:"butterfly",emoji:"\u{1F98B}",name:"Butterfly",keywords:["pretty","nature"],group:"animals"},{shortcode:"turtle",emoji:"\u{1F422}",name:"Turtle",keywords:["slow","shell"],group:"animals"},{shortcode:"snake",emoji:"\u{1F40D}",name:"Snake",keywords:["reptile"],group:"animals"},{shortcode:"whale",emoji:"\u{1F433}",name:"Spouting Whale",keywords:["ocean","sea"],group:"animals"},{shortcode:"dolphin",emoji:"\u{1F42C}",name:"Dolphin",keywords:["ocean","smart"],group:"animals"},{shortcode:"eagle",emoji:"\u{1F985}",name:"Eagle",keywords:["bird","freedom"],group:"animals"},{shortcode:"owl",emoji:"\u{1F989}",name:"Owl",keywords:["wise","night"],group:"animals"},{shortcode:"penguin",emoji:"\u{1F427}",name:"Penguin",keywords:["cold","linux"],group:"animals"},{shortcode:"octopus",emoji:"\u{1F419}",name:"Octopus",keywords:["ocean","tentacle"],group:"animals"},{shortcode:"seedling",emoji:"\u{1F331}",name:"Seedling",keywords:["plant","grow"],group:"animals"},{shortcode:"evergreen_tree",emoji:"\u{1F332}",name:"Evergreen Tree",keywords:["nature","pine"],group:"animals"},{shortcode:"sunflower",emoji:"\u{1F33B}",name:"Sunflower",keywords:["flower","yellow"],group:"animals"},{shortcode:"rose",emoji:"\u{1F339}",name:"Rose",keywords:["flower","love"],group:"animals"},{shortcode:"apple",emoji:"\u{1F34E}",name:"Red Apple",keywords:["fruit","healthy"],group:"food"},{shortcode:"banana",emoji:"\u{1F34C}",name:"Banana",keywords:["fruit","yellow"],group:"food"},{shortcode:"grapes",emoji:"\u{1F347}",name:"Grapes",keywords:["fruit","wine"],group:"food"},{shortcode:"watermelon",emoji:"\u{1F349}",name:"Watermelon",keywords:["fruit","summer"],group:"food"},{shortcode:"avocado",emoji:"\u{1F951}",name:"Avocado",keywords:["guacamole","healthy"],group:"food"},{shortcode:"pizza",emoji:"\u{1F355}",name:"Pizza",keywords:["food","italian"],group:"food"},{shortcode:"hamburger",emoji:"\u{1F354}",name:"Hamburger",keywords:["burger","fast food"],group:"food"},{shortcode:"taco",emoji:"\u{1F32E}",name:"Taco",keywords:["mexican","food"],group:"food"},{shortcode:"sushi",emoji:"\u{1F363}",name:"Sushi",keywords:["japanese","fish"],group:"food"},{shortcode:"cookie",emoji:"\u{1F36A}",name:"Cookie",keywords:["sweet","biscuit"],group:"food"},{shortcode:"cake",emoji:"\u{1F382}",name:"Birthday Cake",keywords:["birthday","celebration"],group:"food"},{shortcode:"ice_cream",emoji:"\u{1F366}",name:"Soft Ice Cream",keywords:["dessert","cold"],group:"food"},{shortcode:"chocolate_bar",emoji:"\u{1F36B}",name:"Chocolate Bar",keywords:["sweet","candy"],group:"food"},{shortcode:"popcorn",emoji:"\u{1F37F}",name:"Popcorn",keywords:["movie","snack"],group:"food"},{shortcode:"coffee",emoji:"\u2615",name:"Hot Beverage",keywords:["tea","drink","morning"],group:"food"},{shortcode:"beer",emoji:"\u{1F37A}",name:"Beer Mug",keywords:["drink","bar"],group:"food"},{shortcode:"wine_glass",emoji:"\u{1F377}",name:"Wine Glass",keywords:["drink","alcohol"],group:"food"},{shortcode:"cocktail",emoji:"\u{1F378}",name:"Cocktail Glass",keywords:["drink","martini"],group:"food"},{shortcode:"hot_pepper",emoji:"\u{1F336}\uFE0F",name:"Hot Pepper",keywords:["spicy","chili"],group:"food"},{shortcode:"egg",emoji:"\u{1F95A}",name:"Egg",keywords:["breakfast","food"],group:"food"},{shortcode:"earth_americas",emoji:"\u{1F30E}",name:"Globe Americas",keywords:["world","planet"],group:"travel"},{shortcode:"earth_europe",emoji:"\u{1F30D}",name:"Globe Europe-Africa",keywords:["world","planet"],group:"travel"},{shortcode:"sun",emoji:"\u2600\uFE0F",name:"Sun",keywords:["weather","bright","warm"],group:"travel"},{shortcode:"moon",emoji:"\u{1F319}",name:"Crescent Moon",keywords:["night","sleep"],group:"travel"},{shortcode:"star",emoji:"\u2B50",name:"Star",keywords:["favorite","rating"],group:"travel"},{shortcode:"star2",emoji:"\u{1F31F}",name:"Glowing Star",keywords:["sparkle","shine"],group:"travel"},{shortcode:"cloud",emoji:"\u2601\uFE0F",name:"Cloud",keywords:["weather","sky"],group:"travel"},{shortcode:"rainbow",emoji:"\u{1F308}",name:"Rainbow",keywords:["colorful","weather"],group:"travel"},{shortcode:"snowflake",emoji:"\u2744\uFE0F",name:"Snowflake",keywords:["cold","winter"],group:"travel"},{shortcode:"zap",emoji:"\u26A1",name:"High Voltage",keywords:["lightning","electric","fast"],group:"travel"},{shortcode:"fire",emoji:"\u{1F525}",name:"Fire",keywords:["hot","flame","lit"],group:"travel"},{shortcode:"ocean",emoji:"\u{1F30A}",name:"Water Wave",keywords:["sea","wave","surf"],group:"travel"},{shortcode:"airplane",emoji:"\u2708\uFE0F",name:"Airplane",keywords:["travel","flight"],group:"travel"},{shortcode:"rocket",emoji:"\u{1F680}",name:"Rocket",keywords:["launch","space","fast"],group:"travel"},{shortcode:"car",emoji:"\u{1F697}",name:"Automobile",keywords:["drive","vehicle"],group:"travel"},{shortcode:"house",emoji:"\u{1F3E0}",name:"House",keywords:["home","building"],group:"travel"},{shortcode:"tent",emoji:"\u26FA",name:"Tent",keywords:["camping","outdoor"],group:"travel"},{shortcode:"mountain",emoji:"\u26F0\uFE0F",name:"Mountain",keywords:["nature","hike"],group:"travel"},{shortcode:"desert_island",emoji:"\u{1F3DD}\uFE0F",name:"Desert Island",keywords:["beach","vacation"],group:"travel"},{shortcode:"volcano",emoji:"\u{1F30B}",name:"Volcano",keywords:["eruption","nature"],group:"travel"},{shortcode:"soccer",emoji:"\u26BD",name:"Soccer Ball",keywords:["football","sport"],group:"activities"},{shortcode:"basketball",emoji:"\u{1F3C0}",name:"Basketball",keywords:["sport","hoop"],group:"activities"},{shortcode:"tennis",emoji:"\u{1F3BE}",name:"Tennis",keywords:["sport","ball"],group:"activities"},{shortcode:"video_game",emoji:"\u{1F3AE}",name:"Video Game",keywords:["gaming","controller"],group:"activities"},{shortcode:"dart",emoji:"\u{1F3AF}",name:"Bullseye",keywords:["target","goal"],group:"activities"},{shortcode:"trophy",emoji:"\u{1F3C6}",name:"Trophy",keywords:["winner","champion"],group:"activities"},{shortcode:"medal",emoji:"\u{1F947}",name:"Gold Medal",keywords:["first","winner"],group:"activities"},{shortcode:"tada",emoji:"\u{1F389}",name:"Party Popper",keywords:["celebration","party"],group:"activities"},{shortcode:"confetti_ball",emoji:"\u{1F38A}",name:"Confetti Ball",keywords:["party","celebration"],group:"activities"},{shortcode:"balloon",emoji:"\u{1F388}",name:"Balloon",keywords:["party","birthday"],group:"activities"},{shortcode:"art",emoji:"\u{1F3A8}",name:"Artist Palette",keywords:["paint","creative"],group:"activities"},{shortcode:"musical_note",emoji:"\u{1F3B5}",name:"Musical Note",keywords:["music","song"],group:"activities"},{shortcode:"microphone",emoji:"\u{1F3A4}",name:"Microphone",keywords:["sing","karaoke"],group:"activities"},{shortcode:"guitar",emoji:"\u{1F3B8}",name:"Guitar",keywords:["music","rock"],group:"activities"},{shortcode:"dice",emoji:"\u{1F3B2}",name:"Game Die",keywords:["chance","random"],group:"activities"},{shortcode:"bulb",emoji:"\u{1F4A1}",name:"Light Bulb",keywords:["idea","bright"],group:"objects"},{shortcode:"computer",emoji:"\u{1F4BB}",name:"Laptop",keywords:["tech","work"],group:"objects"},{shortcode:"keyboard",emoji:"\u2328\uFE0F",name:"Keyboard",keywords:["type","computer"],group:"objects"},{shortcode:"phone",emoji:"\u{1F4F1}",name:"Mobile Phone",keywords:["cell","call"],group:"objects"},{shortcode:"camera",emoji:"\u{1F4F7}",name:"Camera",keywords:["photo","picture"],group:"objects"},{shortcode:"tv",emoji:"\u{1F4FA}",name:"Television",keywords:["watch","screen"],group:"objects"},{shortcode:"battery",emoji:"\u{1F50B}",name:"Battery",keywords:["charge","power"],group:"objects"},{shortcode:"electric_plug",emoji:"\u{1F50C}",name:"Electric Plug",keywords:["power","connect"],group:"objects"},{shortcode:"mag",emoji:"\u{1F50D}",name:"Magnifying Glass Left",keywords:["search","find"],group:"objects"},{shortcode:"lock",emoji:"\u{1F512}",name:"Locked",keywords:["security","private"],group:"objects"},{shortcode:"unlock",emoji:"\u{1F513}",name:"Unlocked",keywords:["open","access"],group:"objects"},{shortcode:"key",emoji:"\u{1F511}",name:"Key",keywords:["access","password"],group:"objects"},{shortcode:"hammer",emoji:"\u{1F528}",name:"Hammer",keywords:["tool","build"],group:"objects"},{shortcode:"wrench",emoji:"\u{1F527}",name:"Wrench",keywords:["tool","fix"],group:"objects"},{shortcode:"gear",emoji:"\u2699\uFE0F",name:"Gear",keywords:["settings","config"],group:"objects"},{shortcode:"link",emoji:"\u{1F517}",name:"Link",keywords:["chain","url"],group:"objects"},{shortcode:"paperclip",emoji:"\u{1F4CE}",name:"Paperclip",keywords:["attach","clip"],group:"objects"},{shortcode:"scissors",emoji:"\u2702\uFE0F",name:"Scissors",keywords:["cut","snip"],group:"objects"},{shortcode:"pen",emoji:"\u{1F58A}\uFE0F",name:"Pen",keywords:["write","sign"],group:"objects"},{shortcode:"pencil",emoji:"\u270F\uFE0F",name:"Pencil",keywords:["write","draw"],group:"objects"},{shortcode:"book",emoji:"\u{1F4D6}",name:"Open Book",keywords:["read","study"],group:"objects"},{shortcode:"memo",emoji:"\u{1F4DD}",name:"Memo",keywords:["note","write"],group:"objects"},{shortcode:"package",emoji:"\u{1F4E6}",name:"Package",keywords:["box","delivery"],group:"objects"},{shortcode:"mailbox",emoji:"\u{1F4EC}",name:"Open Mailbox with Raised Flag",keywords:["mail","letter"],group:"objects"},{shortcode:"bell",emoji:"\u{1F514}",name:"Bell",keywords:["notification","alert"],group:"objects"},{shortcode:"red_heart",emoji:"\u2764\uFE0F",name:"Red Heart",keywords:["love","valentine"],group:"symbols"},{shortcode:"orange_heart",emoji:"\u{1F9E1}",name:"Orange Heart",keywords:["love"],group:"symbols"},{shortcode:"yellow_heart",emoji:"\u{1F49B}",name:"Yellow Heart",keywords:["love","friendship"],group:"symbols"},{shortcode:"green_heart",emoji:"\u{1F49A}",name:"Green Heart",keywords:["love","nature"],group:"symbols"},{shortcode:"blue_heart",emoji:"\u{1F499}",name:"Blue Heart",keywords:["love","trust"],group:"symbols"},{shortcode:"purple_heart",emoji:"\u{1F49C}",name:"Purple Heart",keywords:["love"],group:"symbols"},{shortcode:"broken_heart",emoji:"\u{1F494}",name:"Broken Heart",keywords:["sad","breakup"],group:"symbols"},{shortcode:"sparkles",emoji:"\u2728",name:"Sparkles",keywords:["shine","magic","new"],group:"symbols"},{shortcode:"hundred",emoji:"\u{1F4AF}",name:"Hundred Points",keywords:["perfect","score"],group:"symbols"},{shortcode:"boom",emoji:"\u{1F4A5}",name:"Collision",keywords:["explosion","impact"],group:"symbols"},{shortcode:"speech_balloon",emoji:"\u{1F4AC}",name:"Speech Balloon",keywords:["talk","chat","message"],group:"symbols"},{shortcode:"thought_balloon",emoji:"\u{1F4AD}",name:"Thought Balloon",keywords:["think","dream"],group:"symbols"},{shortcode:"check_mark",emoji:"\u2705",name:"Check Mark Button",keywords:["done","yes","complete"],group:"symbols"},{shortcode:"x",emoji:"\u274C",name:"Cross Mark",keywords:["no","wrong","delete"],group:"symbols"},{shortcode:"warning",emoji:"\u26A0\uFE0F",name:"Warning",keywords:["caution","alert"],group:"symbols"},{shortcode:"no_entry",emoji:"\u26D4",name:"No Entry",keywords:["stop","forbidden"],group:"symbols"},{shortcode:"question",emoji:"\u2753",name:"Question Mark",keywords:["help","what"],group:"symbols"},{shortcode:"exclamation",emoji:"\u2757",name:"Exclamation Mark",keywords:["important","attention"],group:"symbols"},{shortcode:"arrow_right",emoji:"\u27A1\uFE0F",name:"Right Arrow",keywords:["next","forward"],group:"symbols"},{shortcode:"arrow_left",emoji:"\u2B05\uFE0F",name:"Left Arrow",keywords:["back","previous"],group:"symbols"},{shortcode:"arrow_up",emoji:"\u2B06\uFE0F",name:"Up Arrow",keywords:["above"],group:"symbols"},{shortcode:"arrow_down",emoji:"\u2B07\uFE0F",name:"Down Arrow",keywords:["below"],group:"symbols"},{shortcode:"recycle",emoji:"\u267B\uFE0F",name:"Recycling Symbol",keywords:["environment","green"],group:"symbols"},{shortcode:"infinity",emoji:"\u267E\uFE0F",name:"Infinity",keywords:["forever","loop"],group:"symbols"},{shortcode:"checkered_flag",emoji:"\u{1F3C1}",name:"Chequered Flag",keywords:["finish","race"],group:"flags"},{shortcode:"triangular_flag",emoji:"\u{1F6A9}",name:"Triangular Flag",keywords:["red flag","warning"],group:"flags"},{shortcode:"white_flag",emoji:"\u{1F3F3}\uFE0F",name:"White Flag",keywords:["surrender","peace"],group:"flags"},{shortcode:"rainbow_flag",emoji:"\u{1F3F3}\uFE0F\u200D\u{1F308}",name:"Rainbow Flag",keywords:["pride","lgbtq"],group:"flags"},{shortcode:"pirate_flag",emoji:"\u{1F3F4}\u200D\u2620\uFE0F",name:"Pirate Flag",keywords:["jolly roger","skull"],group:"flags"},{shortcode:"flag_us",emoji:"\u{1F1FA}\u{1F1F8}",name:"Flag: United States",keywords:["usa","america"],group:"flags"},{shortcode:"flag_gb",emoji:"\u{1F1EC}\u{1F1E7}",name:"Flag: United Kingdom",keywords:["uk","britain"],group:"flags"},{shortcode:"flag_fr",emoji:"\u{1F1EB}\u{1F1F7}",name:"Flag: France",keywords:["french"],group:"flags"},{shortcode:"flag_de",emoji:"\u{1F1E9}\u{1F1EA}",name:"Flag: Germany",keywords:["german"],group:"flags"},{shortcode:"flag_jp",emoji:"\u{1F1EF}\u{1F1F5}",name:"Flag: Japan",keywords:["japanese"],group:"flags"},{shortcode:"flag_kr",emoji:"\u{1F1F0}\u{1F1F7}",name:"Flag: South Korea",keywords:["korean"],group:"flags"},{shortcode:"flag_br",emoji:"\u{1F1E7}\u{1F1F7}",name:"Flag: Brazil",keywords:["brazilian"],group:"flags"},{shortcode:"flag_in",emoji:"\u{1F1EE}\u{1F1F3}",name:"Flag: India",keywords:["indian"],group:"flags"},{shortcode:"flag_ca",emoji:"\u{1F1E8}\u{1F1E6}",name:"Flag: Canada",keywords:["canadian","maple"],group:"flags"},{shortcode:"flag_au",emoji:"\u{1F1E6}\u{1F1FA}",name:"Flag: Australia",keywords:["australian"],group:"flags"}],gt=new Map(Pt.map(r=>[r.shortcode,r])),cs=new Map([["+1","thumbsup"],["-1","thumbsdown"],["heart","red_heart"],["thumbs_up","thumbsup"],["thumbs_down","thumbsdown"],["grin","grinning"],["laughing_crying","joy"],["lol","rofl"],["smiley","smile"],["cool","sunglasses"],["nerd","nerd_face"],["kiss","kissing_heart"],["hug","hugs"],["think","thinking"],["sad","cry"],["mad","angry"],["shrug","person_shrugging"],["facepalm","person_facepalming"],["pray_hands","pray"],["hi","wave"],["bye","wave"],["lightning","zap"],["flame","fire"],["hot","fire"],["bomb","boom"],["idea","bulb"],["laptop","computer"],["search","mag"],["party","tada"],["celebrate","tada"],["congrats","tada"],["check","check_mark"],["done","check_mark"],["yes","check_mark"],["no","x"],["wrong","x"],["love","red_heart"],["star_eyes","star_struck"],["mindblown","exploding_head"],["memo_pad","memo"],["notes","memo"],["coffee_cup","coffee"],["tea","coffee"]]),hn=["smileys","people","animals","food","travel","activities","objects","symbols","flags"],un={smileys:"Smileys & Emotion",people:"People & Body",animals:"Animals & Nature",food:"Food & Drink",travel:"Travel & Places",activities:"Activities",objects:"Objects",symbols:"Symbols",flags:"Flags"},dn={smileys:"\u{1F600}",people:"\u{1F44B}",animals:"\u{1F436}",food:"\u{1F355}",travel:"\u{1F30D}",activities:"\u{1F389}",objects:"\u{1F4A1}",symbols:"\u2764\uFE0F",flags:"\u{1F3C1}"},hs=Symbol.for("vanilla-breeze.emoji-extended"),pn="vb:emoji-extended",as=globalThis[hs]??=[],ls=0,bt=[]});var mc=window.matchMedia("(prefers-reduced-motion: reduce)");var Ui=new Map;function g(r,t,e={}){let i=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:i},n=Ui.get(r);if(customElements.get(r)){if(!n||n.priority>=i){n&&n.priority===i&&n.impl!==t&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=i){n.priority===i&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${n.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}Ui.set(r,s),customElements.define(r,t)}var b=class extends HTMLElement{#t=[];#e;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,s){t.addEventListener(e,i,s),this.#t.push(()=>t.removeEventListener(e,i,s))}_reinit(){for(let t of this.#t)t();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,e){this.#e||(this.#e=this.attachInternals());let i=this.#e.states;try{e?i.add(t):i.delete(t)}catch{let s=`--${t}`;e?i.add(s):i.delete(s)}}_adoptInternals(t){this.#e||(this.#e=t)}#i(){return this.constructor.formAssociated&&this.#e?this.#e:null}get validity(){return this.#i()?.validity}get validationMessage(){return this.#i()?.validationMessage??""}get willValidate(){return this.#i()?.willValidate??!1}get form(){return this.#i()?.form??null}checkValidity(){return this.#i()?.checkValidity()??!0}reportValidity(){return this.#i()?.reportValidity()??!0}};function Mt(r){return[...r.querySelectorAll("li")].filter(t=>t.querySelector("a[href]"))}function Vi(r){return r.querySelector("li[data-audio-active]")}function Wi(r,t,e){let i=e.querySelector("a[href]");return i?(t.querySelectorAll("li[data-audio-active]").forEach(s=>{s!==e&&s.removeAttribute("data-audio-active")}),e.setAttribute("data-audio-active",""),r.src=i.href,r.play()?.catch(()=>{}),{src:i.href,title:i.textContent?.trim()??""}):null}function Ki(r){let t=Vi(r);return t?.setAttribute("data-audio-played",""),t}function Gi(r,{loop:t=!1}={}){let e=Mt(r);if(!e.length)return null;let i=Vi(r),s=i?e.indexOf(i):-1;return s+1<e.length?e[s+1]:t?e[0]:null}var Gr='input, button, a[href], summary, select, textarea, audio, [contenteditable]:not([contenteditable="false"])',le=class extends b{static get observedAttributes(){return["loop","shuffle"]}#t=null;#e=null;#i=!1;#s=null;#r=null;#n=null;#a=null;#c=null;#h=null;#l=null;#o=null;#u=null;#p=null;#d=!1;#f=new Set;#k=null;#w=!1;setup(){if(this.#t=this.querySelector("audio"),!this.#t)return!1;this.#e=this.querySelector(".track-list"),this.#t.removeAttribute("controls");let t=!this.shadowRoot;this.#v(),t&&(this.#g(),this.#x(),this.#E()),this.#M(),this.#m(),this.#A();let e=this.#t;return(e.error||e.networkState===HTMLMediaElement.NETWORK_NO_SOURCE&&(e.hasAttribute("src")||e.querySelector("source")))&&this.#b(),e.readyState>=HTMLMediaElement.HAVE_METADATA&&(this.#I(),this.#P()),this.hasAttribute("autoplay")&&this.#t.play().catch(()=>{}),this.#k=()=>{let i=this.shadowRoot?.querySelector(".player");i&&(i.style.display="none",i.offsetHeight,i.style.display="")},this.listen(window,"vb:theme-change",this.#k),!0}teardown(){this.#t&&this.#t.setAttribute("controls","")}attributeChangedCallback(t){t==="loop"?this.#m():t==="shuffle"&&this.#f.clear()}#m(){this.#t&&(this.hasAttribute("loop")&&!this.#e?(this.#t.loop=!0,this.#w=!0):this.#w&&(this.#t.loop=!1,this.#w=!1))}get src(){return this.#t?.getAttribute("src")||this.#t?.currentSrc||""}set src(t){if(!this.#t)return;let e=t==null?"":String(t);this.#t.getAttribute("src")!==e&&(this.#t.setAttribute("src",e),this.#t.load?.(),this.#C(),this.#M(),this.dispatchEvent(new CustomEvent("audio-player:src-changed",{detail:{src:e,source:"property"},bubbles:!0})))}get currentTime(){return this.#t?.currentTime??0}set currentTime(t){this.#t&&(this.#t.currentTime=Number(t)||0)}#v(){if(this.shadowRoot)return;let t=this.attachShadow({mode:"open"});t.innerHTML=`
2
- <style>${this.#y()}</style>
1
+ var Kr=Object.defineProperty;var ae=(r,t)=>()=>(r&&(t=r(r=0)),t);var Hi=(r,t)=>{for(var e in t)Kr(r,e,{get:t[e],enumerable:!0})};function is(r,t,e){let i=256*Math.pow(2,e),s=r/i*360-180;return{lat:Math.atan(Math.sinh(Math.PI*(1-2*t/i)))*180/Math.PI,lng:s}}function st(r,t,e){let i=256*Math.pow(2,e),s=r*Math.PI/180;return{x:(t+180)/360*i,y:(1-Math.log(Math.tan(s)+1/Math.cos(s))/Math.PI)/2*i}}function on(r,t,e,i,s){let n=s??(typeof devicePixelRatio=="number"?devicePixelRatio:1),o="abc"[Math.abs(e+i)%3];return r.replaceAll("{z}",String(t)).replaceAll("{x}",String(e)).replaceAll("{y}",String(i)).replaceAll("{s}",o).replaceAll("{r}",n>1?"@2x":"")}function Nt(r,t,e,i,s){let n=s||(U[r]??U.osm).template;return on(n,t,e,i)}var U,fe=ae(()=>{U={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 ss={};Hi(ss,{MapInteraction:()=>me});var me,rs=ae(()=>{fe();me=class{#t;#e;#i;#s;#r;#n;#a;#c;#h=0;#l=0;#o=15;#u=1;#p=19;#d=0;#f=0;#k=0;#y=0;#m=15;#v=0;#w=0;#g=new Map;#b=0;#T=0;#A=new Map;#x=0;#S=0;constructor({host:t,viewport:e,tiles:i,marker:s,lat:n,lng:o,zoom:a,provider:l,tileUrl:c,width:h,height:u,onDeactivate:p,onMove:d}){this.#c=t,this.#t=e,this.#e=i,this.#i=s,this.#s=l,this.#r=c||"",this.#n=p,this.#a=d||(()=>{}),this.#o=a,this.#k=this.#b=n,this.#y=this.#T=o,this.#m=a,this.#v=h,this.#w=u;let f=st(n,o,a);this.#h=f.x,this.#l=f.y,this.#E(),this.#e.replaceChildren(),this.#e.style.transform="",this.#i&&this.#e.appendChild(this.#i),this.#t.addEventListener("pointerdown",this.#L),this.#t.addEventListener("pointermove",this.#C),this.#t.addEventListener("pointerup",this.#$),this.#t.addEventListener("pointercancel",this.#$),this.#t.addEventListener("wheel",this.#I,{passive:!1}),this.#t.addEventListener("keydown",this.#M),this.#D()}get zoom(){return this.#o}get minZoom(){return this.#u}get maxZoom(){return this.#p}get center(){let{lat:t,lng:e}=is(this.#h,this.#l,this.#o);return{lat:+t.toFixed(6),lng:+e.toFixed(6),zoom:this.#o}}zoomBy(t){this.#R(this.#o+t,this.#v/2,this.#w/2)}recenter(){this.#o=this.#m;let t=st(this.#k,this.#y,this.#o);this.#h=t.x,this.#l=t.y,this.#j(),this.#E(),this.#z(),this.#D(),this.#_()}panBy(t,e){this.#h+=t,this.#l+=e,this.#z(),this.#D()}resize(t,e){!t||!e||t===this.#v&&e===this.#w||(this.#v=t,this.#w=e,this.#z(),this.#D())}#E(){this.#d=Math.floor(this.#h/256)*256,this.#f=Math.floor(this.#l/256)*256}#L=t=>{if(!(t.pointerType==="mouse"&&t.button!==0)&&!t.target.closest?.("a, button")){t.preventDefault(),this.#t.focus({preventScroll:!0}),this.#A.set(t.pointerId,{x:t.clientX,y:t.clientY});try{this.#t.setPointerCapture(t.pointerId)}catch{}this.#A.size===1?(this.#x=0,this.#t.setAttribute("data-dragging","")):this.#A.size===2&&(this.#S=this.#P(),this.#x=1/0)}};#C=t=>{let e=this.#A.get(t.pointerId);if(!e)return;let i=t.clientX-e.x,s=t.clientY-e.y;if(e.x=t.clientX,e.y=t.clientY,this.#A.size===1){this.#x+=Math.abs(i)+Math.abs(s),this.panBy(-i,-s);return}if(this.#A.size===2){this.panBy(-i/2,-s/2);let n=this.#P();if(!this.#S){this.#S=n;return}let o=n/this.#S;if(o>=1.5||o<=1/1.5){let a=this.#N();this.#R(this.#o+(o>1?1:-1),a.x,a.y),this.#S=n}}};#$=t=>{if(!this.#A.has(t.pointerId))return;let e=this.#A.size===1;this.#A.delete(t.pointerId);try{this.#t.releasePointerCapture(t.pointerId)}catch{}if(this.#A.size<2&&(this.#S=0),!(this.#A.size>0)){if(this.#t.removeAttribute("data-dragging"),e&&t.type==="pointerup"&&this.#x<5){let i=this.#t.getBoundingClientRect();this.panBy(t.clientX-i.left-this.#v/2,t.clientY-i.top-this.#w/2)}this.#_()}};#P(){let[t,e]=[...this.#A.values()];return t&&e?Math.hypot(t.x-e.x,t.y-e.y):0}#N(){let[t,e]=[...this.#A.values()],i=this.#t.getBoundingClientRect();return{x:(t.x+e.x)/2-i.left,y:(t.y+e.y)/2-i.top}}#I=t=>{t.preventDefault();let e=t.ctrlKey?-t.deltaY*.01:-Math.sign(t.deltaY),i=Math.round(Math.max(this.#u,Math.min(this.#p,this.#o+e)));if(i===this.#o)return;let s=this.#t.getBoundingClientRect();this.#R(i,t.clientX-s.left,t.clientY-s.top)};#M=t=>{if(t.target!==this.#t)return;let e=80,i=null;switch(t.key){case"ArrowLeft":i=[-e,0];break;case"ArrowRight":i=[e,0];break;case"ArrowUp":i=[0,-e];break;case"ArrowDown":i=[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.#n();return;default:return}t.preventDefault(),this.panBy(i[0],i[1]),this.#_()};#R(t,e,i){if(t=Math.max(this.#u,Math.min(this.#p,t)),t===this.#o)return;let s=this.#h-this.#v/2+e,n=this.#l-this.#w/2+i,o=Math.pow(2,t-this.#o);this.#h=s*o-e+this.#v/2,this.#l=n*o-i+this.#w/2,this.#o=t,this.#j(),this.#z(),this.#E(),this.#D(),this.#_()}#z(){let t=256*Math.pow(2,this.#o),e=(this.#h%t+t)%t;e!==this.#h&&(this.#h=e,this.#j(),this.#E());let i=Math.min(this.#w/2,t/2);this.#l=Math.max(i,Math.min(t-i,this.#l))}#D(){let t=-(this.#h-this.#v/2-this.#d),e=-(this.#l-this.#w/2-this.#f);this.#e.style.transform=`translate(${Math.round(t)}px, ${Math.round(e)}px)`,this.#F(),this.#B(),this.#O()}#F(){let t=this.#o,e=Math.pow(2,t),i=this.#h-this.#v/2,s=this.#l-this.#w/2,n=Math.floor(i/256)-1,o=Math.max(0,Math.floor(s/256)-1),a=Math.ceil((i+this.#v)/256)+1,l=Math.min(e,Math.ceil((s+this.#w)/256)+1);for(let c=o;c<l;c++)for(let h=n;h<a;h++){let u=(h%e+e)%e,p=`${t}/${h}/${c}`;if(this.#g.has(p))continue;let d=document.createElement("img");d.src=Nt(this.#s,t,u,c,this.#r),d.alt="",d.draggable=!1,d.style.left=`${h*256-this.#d}px`,d.style.top=`${c*256-this.#f}px`,d._wx=h*256,d._wy=c*256,this.#g.set(p,d),this.#e.insertBefore(d,this.#i?.parentNode===this.#e?this.#i:null)}}#B(){let t=this.#h-this.#v/2,e=this.#l-this.#w/2,i=512;for(let[s,n]of this.#g){let o=n._wx??0,a=n._wy??0;(o+256<t-i||o>t+this.#v+i||a+256<e-i||a>e+this.#w+i)&&(n.remove(),this.#g.delete(s))}}#O(){if(!this.#i)return;let t=st(this.#b,this.#T,this.#o),e=this.#i.offsetWidth||32,i=256*Math.pow(2,this.#o),s=t.x;for(;s-this.#h>i/2;)s-=i;for(;this.#h-s>i/2;)s+=i;this.#i.style.top=`${Math.round(t.y-this.#f-e)}px`,this.#i.style.left=`${Math.round(s-this.#d-e/2)}px`,this.#i.style.transform="none"}#_(){let t=this.center;this.#c.dispatchEvent(new CustomEvent("geo-map:move",{bubbles:!0,detail:t})),this.#a(t)}#j(){for(let t of this.#g.values())t.remove();this.#g.clear()}destroy(){this.#t.removeEventListener("pointerdown",this.#L),this.#t.removeEventListener("pointermove",this.#C),this.#t.removeEventListener("pointerup",this.#$),this.#t.removeEventListener("pointercancel",this.#$),this.#t.removeEventListener("wheel",this.#I),this.#t.removeEventListener("keydown",this.#M),this.#t.removeAttribute("data-dragging"),this.#A.clear(),this.#j()}}});var ve={};Hi(ve,{EMOJI_ALIASES:()=>cs,EMOJI_GROUPS:()=>hn,EMOJI_GROUP_ICONS:()=>dn,EMOJI_GROUP_LABELS:()=>un,EMOJI_MAP:()=>gt,EXTENDED_EVENT:()=>pn,EXTENDED_REGISTRY:()=>hs,extendedCount:()=>fn,getByGroup:()=>gn,resolveEmoji:()=>mn,searchEmoji:()=>bn});function It(){for(;ls<as.length;){let r=as[ls++];for(let[t,e,i,s]of r){if(gt.has(t))continue;let n={shortcode:t,emoji:e,name:i,keywords:[],group:s};gt.set(t,n),bt.push(n)}}}function fn(){return It(),bt.length}function mn(r){It();let t=gt.get(r);if(t)return t;let e=cs.get(r);return e&&gt.get(e)||null}function gn(r){It();let t=Pt.filter(i=>i.group===r),e=bt.filter(i=>i.group===r);return e.length>0?t.concat(e):t}function bn(r){It();let t=r.toLowerCase().trim(),e=bt.length>0?Pt.concat(bt):Pt;return t?e.filter(i=>i.shortcode.includes(t)||i.name.toLowerCase().includes(t)||i.keywords&&i.keywords.some(s=>s.includes(t))):e}var Pt,gt,cs,hn,un,dn,hs,pn,as,ls,bt,ye=ae(()=>{Pt=[{shortcode:"smile",emoji:"\u{1F604}",name:"Smiling Face with Open Mouth",keywords:["happy","joy","laugh"],group:"smileys"},{shortcode:"grinning",emoji:"\u{1F600}",name:"Grinning Face",keywords:["happy","smile"],group:"smileys"},{shortcode:"laughing",emoji:"\u{1F606}",name:"Grinning Squinting Face",keywords:["happy","laugh"],group:"smileys"},{shortcode:"sweat_smile",emoji:"\u{1F605}",name:"Grinning Face with Sweat",keywords:["hot","relief"],group:"smileys"},{shortcode:"rofl",emoji:"\u{1F923}",name:"Rolling on the Floor Laughing",keywords:["lol","funny"],group:"smileys"},{shortcode:"joy",emoji:"\u{1F602}",name:"Face with Tears of Joy",keywords:["happy","cry","laugh"],group:"smileys"},{shortcode:"slightly_smiling_face",emoji:"\u{1F642}",name:"Slightly Smiling Face",keywords:["smile"],group:"smileys"},{shortcode:"upside_down_face",emoji:"\u{1F643}",name:"Upside-Down Face",keywords:["sarcasm","silly"],group:"smileys"},{shortcode:"wink",emoji:"\u{1F609}",name:"Winking Face",keywords:["flirt","joke"],group:"smileys"},{shortcode:"blush",emoji:"\u{1F60A}",name:"Smiling Face with Smiling Eyes",keywords:["happy","shy"],group:"smileys"},{shortcode:"innocent",emoji:"\u{1F607}",name:"Smiling Face with Halo",keywords:["angel","good"],group:"smileys"},{shortcode:"heart_eyes",emoji:"\u{1F60D}",name:"Smiling Face with Heart-Eyes",keywords:["love","crush"],group:"smileys"},{shortcode:"star_struck",emoji:"\u{1F929}",name:"Star-Struck",keywords:["wow","amazing"],group:"smileys"},{shortcode:"kissing_heart",emoji:"\u{1F618}",name:"Face Blowing a Kiss",keywords:["love","kiss"],group:"smileys"},{shortcode:"yum",emoji:"\u{1F60B}",name:"Face Savoring Food",keywords:["delicious","tasty"],group:"smileys"},{shortcode:"stuck_out_tongue",emoji:"\u{1F61B}",name:"Face with Tongue",keywords:["playful","silly"],group:"smileys"},{shortcode:"stuck_out_tongue_winking_eye",emoji:"\u{1F61C}",name:"Winking Face with Tongue",keywords:["silly","playful"],group:"smileys"},{shortcode:"zany_face",emoji:"\u{1F92A}",name:"Zany Face",keywords:["crazy","wild"],group:"smileys"},{shortcode:"hugs",emoji:"\u{1F917}",name:"Hugging Face",keywords:["hug","warm"],group:"smileys"},{shortcode:"thinking",emoji:"\u{1F914}",name:"Thinking Face",keywords:["hmm","consider"],group:"smileys"},{shortcode:"shushing_face",emoji:"\u{1F92B}",name:"Shushing Face",keywords:["quiet","secret"],group:"smileys"},{shortcode:"smirk",emoji:"\u{1F60F}",name:"Smirking Face",keywords:["sly","suggestive"],group:"smileys"},{shortcode:"unamused",emoji:"\u{1F612}",name:"Unamused Face",keywords:["bored","unimpressed"],group:"smileys"},{shortcode:"roll_eyes",emoji:"\u{1F644}",name:"Face with Rolling Eyes",keywords:["annoyed","whatever"],group:"smileys"},{shortcode:"grimacing",emoji:"\u{1F62C}",name:"Grimacing Face",keywords:["awkward","nervous"],group:"smileys"},{shortcode:"relieved",emoji:"\u{1F60C}",name:"Relieved Face",keywords:["calm","peaceful"],group:"smileys"},{shortcode:"pensive",emoji:"\u{1F614}",name:"Pensive Face",keywords:["sad","thoughtful"],group:"smileys"},{shortcode:"sleepy",emoji:"\u{1F62A}",name:"Sleepy Face",keywords:["tired","sleep"],group:"smileys"},{shortcode:"sleeping",emoji:"\u{1F634}",name:"Sleeping Face",keywords:["zzz","sleep"],group:"smileys"},{shortcode:"mask",emoji:"\u{1F637}",name:"Face with Medical Mask",keywords:["sick","health"],group:"smileys"},{shortcode:"nerd_face",emoji:"\u{1F913}",name:"Nerd Face",keywords:["geek","smart"],group:"smileys"},{shortcode:"sunglasses",emoji:"\u{1F60E}",name:"Smiling Face with Sunglasses",keywords:["cool","chill"],group:"smileys"},{shortcode:"confused",emoji:"\u{1F615}",name:"Confused Face",keywords:["puzzled","unsure"],group:"smileys"},{shortcode:"worried",emoji:"\u{1F61F}",name:"Worried Face",keywords:["anxious","concern"],group:"smileys"},{shortcode:"cry",emoji:"\u{1F622}",name:"Crying Face",keywords:["sad","tear"],group:"smileys"},{shortcode:"sob",emoji:"\u{1F62D}",name:"Loudly Crying Face",keywords:["sad","cry"],group:"smileys"},{shortcode:"angry",emoji:"\u{1F620}",name:"Angry Face",keywords:["mad","annoyed"],group:"smileys"},{shortcode:"rage",emoji:"\u{1F92C}",name:"Face with Symbols on Mouth",keywords:["angry","swear"],group:"smileys"},{shortcode:"exploding_head",emoji:"\u{1F92F}",name:"Exploding Head",keywords:["mind blown","shocked"],group:"smileys"},{shortcode:"flushed",emoji:"\u{1F633}",name:"Flushed Face",keywords:["embarrassed","shocked"],group:"smileys"},{shortcode:"scream",emoji:"\u{1F631}",name:"Face Screaming in Fear",keywords:["scared","horror"],group:"smileys"},{shortcode:"skull",emoji:"\u{1F480}",name:"Skull",keywords:["dead","death"],group:"smileys"},{shortcode:"clown_face",emoji:"\u{1F921}",name:"Clown Face",keywords:["joke","funny"],group:"smileys"},{shortcode:"ghost",emoji:"\u{1F47B}",name:"Ghost",keywords:["halloween","spooky"],group:"smileys"},{shortcode:"wave",emoji:"\u{1F44B}",name:"Waving Hand",keywords:["hello","goodbye"],group:"people"},{shortcode:"raised_hand",emoji:"\u270B",name:"Raised Hand",keywords:["stop","high five"],group:"people"},{shortcode:"ok_hand",emoji:"\u{1F44C}",name:"OK Hand",keywords:["perfect","nice"],group:"people"},{shortcode:"thumbsup",emoji:"\u{1F44D}",name:"Thumbs Up",keywords:["approve","good","yes"],group:"people"},{shortcode:"thumbsdown",emoji:"\u{1F44E}",name:"Thumbs Down",keywords:["disapprove","bad","no"],group:"people"},{shortcode:"clap",emoji:"\u{1F44F}",name:"Clapping Hands",keywords:["applause","bravo"],group:"people"},{shortcode:"raised_hands",emoji:"\u{1F64C}",name:"Raising Hands",keywords:["celebration","hooray"],group:"people"},{shortcode:"pray",emoji:"\u{1F64F}",name:"Folded Hands",keywords:["thanks","please","hope"],group:"people"},{shortcode:"handshake",emoji:"\u{1F91D}",name:"Handshake",keywords:["deal","agreement"],group:"people"},{shortcode:"point_up",emoji:"\u261D\uFE0F",name:"Index Pointing Up",keywords:["attention","important"],group:"people"},{shortcode:"point_right",emoji:"\u{1F449}",name:"Backhand Index Pointing Right",keywords:["direction","this"],group:"people"},{shortcode:"point_left",emoji:"\u{1F448}",name:"Backhand Index Pointing Left",keywords:["direction","that"],group:"people"},{shortcode:"point_down",emoji:"\u{1F447}",name:"Backhand Index Pointing Down",keywords:["direction","below"],group:"people"},{shortcode:"v",emoji:"\u270C\uFE0F",name:"Victory Hand",keywords:["peace","two"],group:"people"},{shortcode:"crossed_fingers",emoji:"\u{1F91E}",name:"Crossed Fingers",keywords:["luck","hope"],group:"people"},{shortcode:"muscle",emoji:"\u{1F4AA}",name:"Flexed Biceps",keywords:["strong","power"],group:"people"},{shortcode:"writing_hand",emoji:"\u270D\uFE0F",name:"Writing Hand",keywords:["write","note"],group:"people"},{shortcode:"eyes",emoji:"\u{1F440}",name:"Eyes",keywords:["look","see","watch"],group:"people"},{shortcode:"brain",emoji:"\u{1F9E0}",name:"Brain",keywords:["smart","think","mind"],group:"people"},{shortcode:"speaking_head",emoji:"\u{1F5E3}\uFE0F",name:"Speaking Head",keywords:["talk","announce"],group:"people"},{shortcode:"baby",emoji:"\u{1F476}",name:"Baby",keywords:["child","newborn"],group:"people"},{shortcode:"person_shrugging",emoji:"\u{1F937}",name:"Person Shrugging",keywords:["dunno","whatever"],group:"people"},{shortcode:"person_facepalming",emoji:"\u{1F926}",name:"Person Facepalming",keywords:["frustration","disbelief"],group:"people"},{shortcode:"person_raising_hand",emoji:"\u{1F64B}",name:"Person Raising Hand",keywords:["question","volunteer"],group:"people"},{shortcode:"ninja",emoji:"\u{1F977}",name:"Ninja",keywords:["stealth","hidden"],group:"people"},{shortcode:"dog",emoji:"\u{1F436}",name:"Dog Face",keywords:["puppy","pet"],group:"animals"},{shortcode:"cat",emoji:"\u{1F431}",name:"Cat Face",keywords:["kitten","pet"],group:"animals"},{shortcode:"mouse",emoji:"\u{1F42D}",name:"Mouse Face",keywords:["rodent"],group:"animals"},{shortcode:"rabbit",emoji:"\u{1F430}",name:"Rabbit Face",keywords:["bunny","easter"],group:"animals"},{shortcode:"fox",emoji:"\u{1F98A}",name:"Fox",keywords:["clever","sly"],group:"animals"},{shortcode:"bear",emoji:"\u{1F43B}",name:"Bear",keywords:["teddy","nature"],group:"animals"},{shortcode:"unicorn",emoji:"\u{1F984}",name:"Unicorn",keywords:["magic","fantasy"],group:"animals"},{shortcode:"bee",emoji:"\u{1F41D}",name:"Honeybee",keywords:["honey","buzz"],group:"animals"},{shortcode:"butterfly",emoji:"\u{1F98B}",name:"Butterfly",keywords:["pretty","nature"],group:"animals"},{shortcode:"turtle",emoji:"\u{1F422}",name:"Turtle",keywords:["slow","shell"],group:"animals"},{shortcode:"snake",emoji:"\u{1F40D}",name:"Snake",keywords:["reptile"],group:"animals"},{shortcode:"whale",emoji:"\u{1F433}",name:"Spouting Whale",keywords:["ocean","sea"],group:"animals"},{shortcode:"dolphin",emoji:"\u{1F42C}",name:"Dolphin",keywords:["ocean","smart"],group:"animals"},{shortcode:"eagle",emoji:"\u{1F985}",name:"Eagle",keywords:["bird","freedom"],group:"animals"},{shortcode:"owl",emoji:"\u{1F989}",name:"Owl",keywords:["wise","night"],group:"animals"},{shortcode:"penguin",emoji:"\u{1F427}",name:"Penguin",keywords:["cold","linux"],group:"animals"},{shortcode:"octopus",emoji:"\u{1F419}",name:"Octopus",keywords:["ocean","tentacle"],group:"animals"},{shortcode:"seedling",emoji:"\u{1F331}",name:"Seedling",keywords:["plant","grow"],group:"animals"},{shortcode:"evergreen_tree",emoji:"\u{1F332}",name:"Evergreen Tree",keywords:["nature","pine"],group:"animals"},{shortcode:"sunflower",emoji:"\u{1F33B}",name:"Sunflower",keywords:["flower","yellow"],group:"animals"},{shortcode:"rose",emoji:"\u{1F339}",name:"Rose",keywords:["flower","love"],group:"animals"},{shortcode:"apple",emoji:"\u{1F34E}",name:"Red Apple",keywords:["fruit","healthy"],group:"food"},{shortcode:"banana",emoji:"\u{1F34C}",name:"Banana",keywords:["fruit","yellow"],group:"food"},{shortcode:"grapes",emoji:"\u{1F347}",name:"Grapes",keywords:["fruit","wine"],group:"food"},{shortcode:"watermelon",emoji:"\u{1F349}",name:"Watermelon",keywords:["fruit","summer"],group:"food"},{shortcode:"avocado",emoji:"\u{1F951}",name:"Avocado",keywords:["guacamole","healthy"],group:"food"},{shortcode:"pizza",emoji:"\u{1F355}",name:"Pizza",keywords:["food","italian"],group:"food"},{shortcode:"hamburger",emoji:"\u{1F354}",name:"Hamburger",keywords:["burger","fast food"],group:"food"},{shortcode:"taco",emoji:"\u{1F32E}",name:"Taco",keywords:["mexican","food"],group:"food"},{shortcode:"sushi",emoji:"\u{1F363}",name:"Sushi",keywords:["japanese","fish"],group:"food"},{shortcode:"cookie",emoji:"\u{1F36A}",name:"Cookie",keywords:["sweet","biscuit"],group:"food"},{shortcode:"cake",emoji:"\u{1F382}",name:"Birthday Cake",keywords:["birthday","celebration"],group:"food"},{shortcode:"ice_cream",emoji:"\u{1F366}",name:"Soft Ice Cream",keywords:["dessert","cold"],group:"food"},{shortcode:"chocolate_bar",emoji:"\u{1F36B}",name:"Chocolate Bar",keywords:["sweet","candy"],group:"food"},{shortcode:"popcorn",emoji:"\u{1F37F}",name:"Popcorn",keywords:["movie","snack"],group:"food"},{shortcode:"coffee",emoji:"\u2615",name:"Hot Beverage",keywords:["tea","drink","morning"],group:"food"},{shortcode:"beer",emoji:"\u{1F37A}",name:"Beer Mug",keywords:["drink","bar"],group:"food"},{shortcode:"wine_glass",emoji:"\u{1F377}",name:"Wine Glass",keywords:["drink","alcohol"],group:"food"},{shortcode:"cocktail",emoji:"\u{1F378}",name:"Cocktail Glass",keywords:["drink","martini"],group:"food"},{shortcode:"hot_pepper",emoji:"\u{1F336}\uFE0F",name:"Hot Pepper",keywords:["spicy","chili"],group:"food"},{shortcode:"egg",emoji:"\u{1F95A}",name:"Egg",keywords:["breakfast","food"],group:"food"},{shortcode:"earth_americas",emoji:"\u{1F30E}",name:"Globe Americas",keywords:["world","planet"],group:"travel"},{shortcode:"earth_europe",emoji:"\u{1F30D}",name:"Globe Europe-Africa",keywords:["world","planet"],group:"travel"},{shortcode:"sun",emoji:"\u2600\uFE0F",name:"Sun",keywords:["weather","bright","warm"],group:"travel"},{shortcode:"moon",emoji:"\u{1F319}",name:"Crescent Moon",keywords:["night","sleep"],group:"travel"},{shortcode:"star",emoji:"\u2B50",name:"Star",keywords:["favorite","rating"],group:"travel"},{shortcode:"star2",emoji:"\u{1F31F}",name:"Glowing Star",keywords:["sparkle","shine"],group:"travel"},{shortcode:"cloud",emoji:"\u2601\uFE0F",name:"Cloud",keywords:["weather","sky"],group:"travel"},{shortcode:"rainbow",emoji:"\u{1F308}",name:"Rainbow",keywords:["colorful","weather"],group:"travel"},{shortcode:"snowflake",emoji:"\u2744\uFE0F",name:"Snowflake",keywords:["cold","winter"],group:"travel"},{shortcode:"zap",emoji:"\u26A1",name:"High Voltage",keywords:["lightning","electric","fast"],group:"travel"},{shortcode:"fire",emoji:"\u{1F525}",name:"Fire",keywords:["hot","flame","lit"],group:"travel"},{shortcode:"ocean",emoji:"\u{1F30A}",name:"Water Wave",keywords:["sea","wave","surf"],group:"travel"},{shortcode:"airplane",emoji:"\u2708\uFE0F",name:"Airplane",keywords:["travel","flight"],group:"travel"},{shortcode:"rocket",emoji:"\u{1F680}",name:"Rocket",keywords:["launch","space","fast"],group:"travel"},{shortcode:"car",emoji:"\u{1F697}",name:"Automobile",keywords:["drive","vehicle"],group:"travel"},{shortcode:"house",emoji:"\u{1F3E0}",name:"House",keywords:["home","building"],group:"travel"},{shortcode:"tent",emoji:"\u26FA",name:"Tent",keywords:["camping","outdoor"],group:"travel"},{shortcode:"mountain",emoji:"\u26F0\uFE0F",name:"Mountain",keywords:["nature","hike"],group:"travel"},{shortcode:"desert_island",emoji:"\u{1F3DD}\uFE0F",name:"Desert Island",keywords:["beach","vacation"],group:"travel"},{shortcode:"volcano",emoji:"\u{1F30B}",name:"Volcano",keywords:["eruption","nature"],group:"travel"},{shortcode:"soccer",emoji:"\u26BD",name:"Soccer Ball",keywords:["football","sport"],group:"activities"},{shortcode:"basketball",emoji:"\u{1F3C0}",name:"Basketball",keywords:["sport","hoop"],group:"activities"},{shortcode:"tennis",emoji:"\u{1F3BE}",name:"Tennis",keywords:["sport","ball"],group:"activities"},{shortcode:"video_game",emoji:"\u{1F3AE}",name:"Video Game",keywords:["gaming","controller"],group:"activities"},{shortcode:"dart",emoji:"\u{1F3AF}",name:"Bullseye",keywords:["target","goal"],group:"activities"},{shortcode:"trophy",emoji:"\u{1F3C6}",name:"Trophy",keywords:["winner","champion"],group:"activities"},{shortcode:"medal",emoji:"\u{1F947}",name:"Gold Medal",keywords:["first","winner"],group:"activities"},{shortcode:"tada",emoji:"\u{1F389}",name:"Party Popper",keywords:["celebration","party"],group:"activities"},{shortcode:"confetti_ball",emoji:"\u{1F38A}",name:"Confetti Ball",keywords:["party","celebration"],group:"activities"},{shortcode:"balloon",emoji:"\u{1F388}",name:"Balloon",keywords:["party","birthday"],group:"activities"},{shortcode:"art",emoji:"\u{1F3A8}",name:"Artist Palette",keywords:["paint","creative"],group:"activities"},{shortcode:"musical_note",emoji:"\u{1F3B5}",name:"Musical Note",keywords:["music","song"],group:"activities"},{shortcode:"microphone",emoji:"\u{1F3A4}",name:"Microphone",keywords:["sing","karaoke"],group:"activities"},{shortcode:"guitar",emoji:"\u{1F3B8}",name:"Guitar",keywords:["music","rock"],group:"activities"},{shortcode:"dice",emoji:"\u{1F3B2}",name:"Game Die",keywords:["chance","random"],group:"activities"},{shortcode:"bulb",emoji:"\u{1F4A1}",name:"Light Bulb",keywords:["idea","bright"],group:"objects"},{shortcode:"computer",emoji:"\u{1F4BB}",name:"Laptop",keywords:["tech","work"],group:"objects"},{shortcode:"keyboard",emoji:"\u2328\uFE0F",name:"Keyboard",keywords:["type","computer"],group:"objects"},{shortcode:"phone",emoji:"\u{1F4F1}",name:"Mobile Phone",keywords:["cell","call"],group:"objects"},{shortcode:"camera",emoji:"\u{1F4F7}",name:"Camera",keywords:["photo","picture"],group:"objects"},{shortcode:"tv",emoji:"\u{1F4FA}",name:"Television",keywords:["watch","screen"],group:"objects"},{shortcode:"battery",emoji:"\u{1F50B}",name:"Battery",keywords:["charge","power"],group:"objects"},{shortcode:"electric_plug",emoji:"\u{1F50C}",name:"Electric Plug",keywords:["power","connect"],group:"objects"},{shortcode:"mag",emoji:"\u{1F50D}",name:"Magnifying Glass Left",keywords:["search","find"],group:"objects"},{shortcode:"lock",emoji:"\u{1F512}",name:"Locked",keywords:["security","private"],group:"objects"},{shortcode:"unlock",emoji:"\u{1F513}",name:"Unlocked",keywords:["open","access"],group:"objects"},{shortcode:"key",emoji:"\u{1F511}",name:"Key",keywords:["access","password"],group:"objects"},{shortcode:"hammer",emoji:"\u{1F528}",name:"Hammer",keywords:["tool","build"],group:"objects"},{shortcode:"wrench",emoji:"\u{1F527}",name:"Wrench",keywords:["tool","fix"],group:"objects"},{shortcode:"gear",emoji:"\u2699\uFE0F",name:"Gear",keywords:["settings","config"],group:"objects"},{shortcode:"link",emoji:"\u{1F517}",name:"Link",keywords:["chain","url"],group:"objects"},{shortcode:"paperclip",emoji:"\u{1F4CE}",name:"Paperclip",keywords:["attach","clip"],group:"objects"},{shortcode:"scissors",emoji:"\u2702\uFE0F",name:"Scissors",keywords:["cut","snip"],group:"objects"},{shortcode:"pen",emoji:"\u{1F58A}\uFE0F",name:"Pen",keywords:["write","sign"],group:"objects"},{shortcode:"pencil",emoji:"\u270F\uFE0F",name:"Pencil",keywords:["write","draw"],group:"objects"},{shortcode:"book",emoji:"\u{1F4D6}",name:"Open Book",keywords:["read","study"],group:"objects"},{shortcode:"memo",emoji:"\u{1F4DD}",name:"Memo",keywords:["note","write"],group:"objects"},{shortcode:"package",emoji:"\u{1F4E6}",name:"Package",keywords:["box","delivery"],group:"objects"},{shortcode:"mailbox",emoji:"\u{1F4EC}",name:"Open Mailbox with Raised Flag",keywords:["mail","letter"],group:"objects"},{shortcode:"bell",emoji:"\u{1F514}",name:"Bell",keywords:["notification","alert"],group:"objects"},{shortcode:"red_heart",emoji:"\u2764\uFE0F",name:"Red Heart",keywords:["love","valentine"],group:"symbols"},{shortcode:"orange_heart",emoji:"\u{1F9E1}",name:"Orange Heart",keywords:["love"],group:"symbols"},{shortcode:"yellow_heart",emoji:"\u{1F49B}",name:"Yellow Heart",keywords:["love","friendship"],group:"symbols"},{shortcode:"green_heart",emoji:"\u{1F49A}",name:"Green Heart",keywords:["love","nature"],group:"symbols"},{shortcode:"blue_heart",emoji:"\u{1F499}",name:"Blue Heart",keywords:["love","trust"],group:"symbols"},{shortcode:"purple_heart",emoji:"\u{1F49C}",name:"Purple Heart",keywords:["love"],group:"symbols"},{shortcode:"broken_heart",emoji:"\u{1F494}",name:"Broken Heart",keywords:["sad","breakup"],group:"symbols"},{shortcode:"sparkles",emoji:"\u2728",name:"Sparkles",keywords:["shine","magic","new"],group:"symbols"},{shortcode:"hundred",emoji:"\u{1F4AF}",name:"Hundred Points",keywords:["perfect","score"],group:"symbols"},{shortcode:"boom",emoji:"\u{1F4A5}",name:"Collision",keywords:["explosion","impact"],group:"symbols"},{shortcode:"speech_balloon",emoji:"\u{1F4AC}",name:"Speech Balloon",keywords:["talk","chat","message"],group:"symbols"},{shortcode:"thought_balloon",emoji:"\u{1F4AD}",name:"Thought Balloon",keywords:["think","dream"],group:"symbols"},{shortcode:"check_mark",emoji:"\u2705",name:"Check Mark Button",keywords:["done","yes","complete"],group:"symbols"},{shortcode:"x",emoji:"\u274C",name:"Cross Mark",keywords:["no","wrong","delete"],group:"symbols"},{shortcode:"warning",emoji:"\u26A0\uFE0F",name:"Warning",keywords:["caution","alert"],group:"symbols"},{shortcode:"no_entry",emoji:"\u26D4",name:"No Entry",keywords:["stop","forbidden"],group:"symbols"},{shortcode:"question",emoji:"\u2753",name:"Question Mark",keywords:["help","what"],group:"symbols"},{shortcode:"exclamation",emoji:"\u2757",name:"Exclamation Mark",keywords:["important","attention"],group:"symbols"},{shortcode:"arrow_right",emoji:"\u27A1\uFE0F",name:"Right Arrow",keywords:["next","forward"],group:"symbols"},{shortcode:"arrow_left",emoji:"\u2B05\uFE0F",name:"Left Arrow",keywords:["back","previous"],group:"symbols"},{shortcode:"arrow_up",emoji:"\u2B06\uFE0F",name:"Up Arrow",keywords:["above"],group:"symbols"},{shortcode:"arrow_down",emoji:"\u2B07\uFE0F",name:"Down Arrow",keywords:["below"],group:"symbols"},{shortcode:"recycle",emoji:"\u267B\uFE0F",name:"Recycling Symbol",keywords:["environment","green"],group:"symbols"},{shortcode:"infinity",emoji:"\u267E\uFE0F",name:"Infinity",keywords:["forever","loop"],group:"symbols"},{shortcode:"checkered_flag",emoji:"\u{1F3C1}",name:"Chequered Flag",keywords:["finish","race"],group:"flags"},{shortcode:"triangular_flag",emoji:"\u{1F6A9}",name:"Triangular Flag",keywords:["red flag","warning"],group:"flags"},{shortcode:"white_flag",emoji:"\u{1F3F3}\uFE0F",name:"White Flag",keywords:["surrender","peace"],group:"flags"},{shortcode:"rainbow_flag",emoji:"\u{1F3F3}\uFE0F\u200D\u{1F308}",name:"Rainbow Flag",keywords:["pride","lgbtq"],group:"flags"},{shortcode:"pirate_flag",emoji:"\u{1F3F4}\u200D\u2620\uFE0F",name:"Pirate Flag",keywords:["jolly roger","skull"],group:"flags"},{shortcode:"flag_us",emoji:"\u{1F1FA}\u{1F1F8}",name:"Flag: United States",keywords:["usa","america"],group:"flags"},{shortcode:"flag_gb",emoji:"\u{1F1EC}\u{1F1E7}",name:"Flag: United Kingdom",keywords:["uk","britain"],group:"flags"},{shortcode:"flag_fr",emoji:"\u{1F1EB}\u{1F1F7}",name:"Flag: France",keywords:["french"],group:"flags"},{shortcode:"flag_de",emoji:"\u{1F1E9}\u{1F1EA}",name:"Flag: Germany",keywords:["german"],group:"flags"},{shortcode:"flag_jp",emoji:"\u{1F1EF}\u{1F1F5}",name:"Flag: Japan",keywords:["japanese"],group:"flags"},{shortcode:"flag_kr",emoji:"\u{1F1F0}\u{1F1F7}",name:"Flag: South Korea",keywords:["korean"],group:"flags"},{shortcode:"flag_br",emoji:"\u{1F1E7}\u{1F1F7}",name:"Flag: Brazil",keywords:["brazilian"],group:"flags"},{shortcode:"flag_in",emoji:"\u{1F1EE}\u{1F1F3}",name:"Flag: India",keywords:["indian"],group:"flags"},{shortcode:"flag_ca",emoji:"\u{1F1E8}\u{1F1E6}",name:"Flag: Canada",keywords:["canadian","maple"],group:"flags"},{shortcode:"flag_au",emoji:"\u{1F1E6}\u{1F1FA}",name:"Flag: Australia",keywords:["australian"],group:"flags"}],gt=new Map(Pt.map(r=>[r.shortcode,r])),cs=new Map([["+1","thumbsup"],["-1","thumbsdown"],["heart","red_heart"],["thumbs_up","thumbsup"],["thumbs_down","thumbsdown"],["grin","grinning"],["laughing_crying","joy"],["lol","rofl"],["smiley","smile"],["cool","sunglasses"],["nerd","nerd_face"],["kiss","kissing_heart"],["hug","hugs"],["think","thinking"],["sad","cry"],["mad","angry"],["shrug","person_shrugging"],["facepalm","person_facepalming"],["pray_hands","pray"],["hi","wave"],["bye","wave"],["lightning","zap"],["flame","fire"],["hot","fire"],["bomb","boom"],["idea","bulb"],["laptop","computer"],["search","mag"],["party","tada"],["celebrate","tada"],["congrats","tada"],["check","check_mark"],["done","check_mark"],["yes","check_mark"],["no","x"],["wrong","x"],["love","red_heart"],["star_eyes","star_struck"],["mindblown","exploding_head"],["memo_pad","memo"],["notes","memo"],["coffee_cup","coffee"],["tea","coffee"]]),hn=["smileys","people","animals","food","travel","activities","objects","symbols","flags"],un={smileys:"Smileys & Emotion",people:"People & Body",animals:"Animals & Nature",food:"Food & Drink",travel:"Travel & Places",activities:"Activities",objects:"Objects",symbols:"Symbols",flags:"Flags"},dn={smileys:"\u{1F600}",people:"\u{1F44B}",animals:"\u{1F436}",food:"\u{1F355}",travel:"\u{1F30D}",activities:"\u{1F389}",objects:"\u{1F4A1}",symbols:"\u2764\uFE0F",flags:"\u{1F3C1}"},hs=Symbol.for("vanilla-breeze.emoji-extended"),pn="vb:emoji-extended",as=globalThis[hs]??=[],ls=0,bt=[]});var mc=window.matchMedia("(prefers-reduced-motion: reduce)");var Ui=new Map;function g(r,t,e={}){let i=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:i},n=Ui.get(r);if(customElements.get(r)){if(!n||n.priority>=i){n&&n.priority===i&&n.impl!==t&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=i){n.priority===i&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${n.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}Ui.set(r,s),customElements.define(r,t)}var b=class extends HTMLElement{#t=[];#e;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,s){t.addEventListener(e,i,s),this.#t.push(()=>t.removeEventListener(e,i,s))}_reinit(){for(let t of this.#t)t();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,e){this.#e||(this.#e=this.attachInternals());let i=this.#e.states;try{e?i.add(t):i.delete(t)}catch{let s=`--${t}`;e?i.add(s):i.delete(s)}}_adoptInternals(t){this.#e||(this.#e=t)}#i(){return this.constructor.formAssociated&&this.#e?this.#e:null}get validity(){return this.#i()?.validity}get validationMessage(){return this.#i()?.validationMessage??""}get willValidate(){return this.#i()?.willValidate??!1}get form(){return this.#i()?.form??null}checkValidity(){return this.#i()?.checkValidity()??!0}reportValidity(){return this.#i()?.reportValidity()??!0}};function Mt(r){return[...r.querySelectorAll("li")].filter(t=>t.querySelector("a[href]"))}function Vi(r){return r.querySelector("li[data-audio-active]")}function Wi(r,t,e){let i=e.querySelector("a[href]");return i?(t.querySelectorAll("li[data-audio-active]").forEach(s=>{s!==e&&s.removeAttribute("data-audio-active")}),e.setAttribute("data-audio-active",""),r.src=i.href,r.play()?.catch(()=>{}),{src:i.href,title:i.textContent?.trim()??""}):null}function Ki(r){let t=Vi(r);return t?.setAttribute("data-audio-played",""),t}function Gi(r,{loop:t=!1}={}){let e=Mt(r);if(!e.length)return null;let i=Vi(r),s=i?e.indexOf(i):-1;return s+1<e.length?e[s+1]:t?e[0]:null}var Gr='input, button, a[href], summary, select, textarea, audio, [contenteditable]:not([contenteditable="false"])',le=class extends b{static get observedAttributes(){return["loop","shuffle"]}#t=null;#e=null;#i=!1;#s=null;#r=null;#n=null;#a=null;#c=null;#h=null;#l=null;#o=null;#u=null;#p=null;#d=!1;#f=new Set;#k=null;#y=!1;setup(){if(this.#t=this.querySelector("audio"),!this.#t)return!1;this.#e=this.querySelector(".track-list"),this.#t.removeAttribute("controls");let t=!this.shadowRoot;this.#v(),t&&(this.#g(),this.#x(),this.#E()),this.#M(),this.#m(),this.#A();let e=this.#t;return(e.error||e.networkState===HTMLMediaElement.NETWORK_NO_SOURCE&&(e.hasAttribute("src")||e.querySelector("source")))&&this.#b(),e.readyState>=HTMLMediaElement.HAVE_METADATA&&(this.#I(),this.#P()),this.hasAttribute("autoplay")&&this.#t.play().catch(()=>{}),this.#k=()=>{let i=this.shadowRoot?.querySelector(".player");i&&(i.style.display="none",i.offsetHeight,i.style.display="")},this.listen(window,"vb:theme-change",this.#k),!0}teardown(){this.#t&&this.#t.setAttribute("controls","")}attributeChangedCallback(t){t==="loop"?this.#m():t==="shuffle"&&this.#f.clear()}#m(){this.#t&&(this.hasAttribute("loop")&&!this.#e?(this.#t.loop=!0,this.#y=!0):this.#y&&(this.#t.loop=!1,this.#y=!1))}get src(){return this.#t?.getAttribute("src")||this.#t?.currentSrc||""}set src(t){if(!this.#t)return;let e=t==null?"":String(t);this.#t.getAttribute("src")!==e&&(this.#t.setAttribute("src",e),this.#t.load?.(),this.#C(),this.#M(),this.dispatchEvent(new CustomEvent("audio-player:src-changed",{detail:{src:e,source:"property"},bubbles:!0})))}get currentTime(){return this.#t?.currentTime??0}set currentTime(t){this.#t&&(this.#t.currentTime=Number(t)||0)}#v(){if(this.shadowRoot)return;let t=this.attachShadow({mode:"open"});t.innerHTML=`
2
+ <style>${this.#w()}</style>
3
3
  <div part="player" class="player">
4
4
  <div part="controls" class="controls">
5
5
  <button part="play-button" class="play-btn" type="button" aria-label="Play">
@@ -43,7 +43,7 @@ var Kr=Object.defineProperty;var ae=(r,t)=>()=>(r&&(t=r(r=0)),t);var Hi=(r,t)=>{
43
43
  <p part="error" class="error" role="status" hidden></p>
44
44
  <slot></slot>
45
45
  </div>
46
- `,this.#s=t.querySelector(".controls"),this.#r=t.querySelector(".play-btn"),this.#n=t.querySelector(".timeline"),this.#a=t.querySelector(".timeline-fill"),this.#c=t.querySelector(".volume"),this.#h=t.querySelector(".current-time"),this.#l=t.querySelector(".duration"),this.#o=t.querySelector(".track-title"),this.#u=t.querySelector(".mute-btn"),this.#p=t.querySelector(".error")}#y(){return`
46
+ `,this.#s=t.querySelector(".controls"),this.#r=t.querySelector(".play-btn"),this.#n=t.querySelector(".timeline"),this.#a=t.querySelector(".timeline-fill"),this.#c=t.querySelector(".volume"),this.#h=t.querySelector(".current-time"),this.#l=t.querySelector(".duration"),this.#o=t.querySelector(".track-title"),this.#u=t.querySelector(".mute-btn"),this.#p=t.querySelector(".error")}#w(){return`
47
47
  :host {
48
48
  display: block;
49
49
  --_accent: var(--audio-player-accent, var(--color-primary, oklch(55% 0.2 260)));
@@ -346,7 +346,7 @@ var Kr=Object.defineProperty;var ae=(r,t)=>()=>(r&&(t=r(r=0)),t);var Hi=(r,t)=>{
346
346
  transform: none;
347
347
  }
348
348
  }
349
- `}#g(){this.#t.addEventListener("timeupdate",()=>this.#P()),this.#t.addEventListener("loadedmetadata",()=>{this.#T(),this.#I(),this.#P()}),this.#t.addEventListener("emptied",()=>{this.#I(),this.#P()}),this.#t.addEventListener("volumechange",()=>this.#A()),this.#t.addEventListener("error",t=>{let e=t.target;if(e!==this.#t){if(e.localName!=="source"||this.#t.hasAttribute("src"))return;let i=e.nextElementSibling;for(;i&&i.localName!=="source";)i=i.nextElementSibling;if(i)return}this.#b()},!0),this.#t.addEventListener("play",()=>{this.#i=!0,this.setAttribute("state","playing"),this.#r.setAttribute("aria-label","Pause"),this.#z("audio-player:play",{currentTime:this.#t.currentTime,src:this.#t.currentSrc})}),this.#t.addEventListener("pause",()=>{this.#i=!1,this.setAttribute("state","paused"),this.#r.setAttribute("aria-label","Play"),this.#z("audio-player:pause",{currentTime:this.#t.currentTime})}),this.#t.addEventListener("ended",()=>{this.#i=!1,this.setAttribute("state","ended"),this.#r.setAttribute("aria-label","Play"),this.#e&&(Ki(this.#e),this.#$()),this.#z("audio-player:ended",{src:this.#t.currentSrc})})}#b(){this.setAttribute("data-state","error"),this.#p.textContent=`Audio could not be loaded${this.#o.textContent?`: ${this.#o.textContent}`:""}.`,this.#p.hidden=!1}#T(){this.getAttribute("data-state")==="error"&&this.removeAttribute("data-state"),this.#p.hidden=!0,this.#p.textContent=""}#A(){if(!this.#t||!this.#u)return;let t=this.#t.muted;t?this.setAttribute("muted",""):this.removeAttribute("muted"),this.#u.setAttribute("aria-pressed",String(t)),this.#c.style.setProperty("--_vol",t?"0":this.#c.value)}#x(){this.#r.addEventListener("click",()=>{this.#i?this.#t.pause():this.#t.play().catch(()=>{})}),this.#n.addEventListener("input",()=>{let e=Number(this.#n.value);this.#a.style.width=`${e}%`,this.#t.duration&&(this.#t.currentTime=e/100*this.#t.duration,this.#N(this.#t.currentTime,this.#t.duration))}),this.#n.addEventListener("pointerdown",()=>{this.#d=!0,this.setState("scrub-active",!0)});let t=()=>{this.#d&&(this.#d=!1,this.setState("scrub-active",!1))};this.#n.addEventListener("pointerup",t),this.#n.addEventListener("pointercancel",t),this.#n.addEventListener("change",t),this.#c.addEventListener("input",()=>{this.#t.volume=Number(this.#c.value),this.#t.muted=!1,this.#A()}),this.#u.addEventListener("click",()=>{this.#t.muted=!this.#t.muted,this.#A()}),this.addEventListener("keydown",e=>{if(!(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey)&&!this.#S(e))switch(e.key){case" ":e.preventDefault(),this.#i?this.#t.pause():this.#t.play().catch(()=>{});break;case"ArrowLeft":e.preventDefault(),this.#t.currentTime=Math.max(0,this.#t.currentTime-10);break;case"ArrowRight":e.preventDefault(),this.#t.currentTime=Math.min(this.#t.duration||0,this.#t.currentTime+10);break;case"m":case"M":this.#t.muted=!this.#t.muted,this.#A();break}}),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","group"),!this.hasAttribute("aria-label")&&!this.hasAttribute("aria-labelledby")&&this.setAttribute("aria-label","Audio player"),this.hasAttribute("aria-keyshortcuts")||this.setAttribute("aria-keyshortcuts","Space ArrowLeft ArrowRight M")}#S(t){for(let e of t.composedPath()){if(e===this)return!1;if(e instanceof Element&&e.matches(Gr))return!0}return!1}#E(){this.#e&&this.#e.addEventListener("click",t=>{let i=t.target?.closest("a[href]"),s=i?.closest("li");!i||!s||(t.preventDefault(),this.#L(s))})}#L(t){if(!this.#e)return;let e=Wi(this.#t,this.#e,t);e&&(this.#f.add(t),this.#M(),this.#z("audio-player:track-change",e))}#C(){if(!this.#e)return;let t=this.#t.src,e=Mt(this.#e).find(i=>i.querySelector("a[href]").href===t);this.#e.querySelectorAll("li[data-audio-active]").forEach(i=>{i!==e&&i.removeAttribute("data-audio-active")}),e?.setAttribute("data-audio-active","")}#$(){if(!this.#e)return;let t=this.hasAttribute("loop");if(!this.hasAttribute("shuffle")){let o=Gi(this.#e,{loop:t});o&&this.#L(o);return}let e=Mt(this.#e),i=this.#e.querySelector("li[data-audio-active]");i&&this.#f.add(i);let s=e.filter(o=>!this.#f.has(o));if(!s.length){if(this.#f.clear(),!t)return;s=e.length>1?e.filter(o=>o!==i):e}let n=s[Math.floor(Math.random()*s.length)];n&&this.#L(n)}#P(){let t=this.#t.currentTime,e=this.#t.duration||0,i=e?t/e*100:0;this.#h.textContent=this.#R(t),this.#N(t,e),!this.#d&&(this.#n.value=String(i),this.#a.style.width=`${i}%`)}#N(t,e){this.#n.setAttribute("aria-valuetext",`${this.#R(t)} of ${this.#R(e)}`)}#I(){let t=this.#t.duration||0;this.#l.textContent=this.#R(t)}#M(){if(!this.#o)return;if(this.#e){let i=this.#e.querySelector("li[data-audio-active] a");if(i){this.#o.textContent=i.textContent;return}}let t=this.#t.src||this.#t.currentSrc||this.#t.querySelector("source")?.src||"",e=t?t.split("/").pop().split(/[?#]/)[0]:"";this.#o.textContent=e.replace(/\.[^.]+$/,"").replace(/[-_]/g," ")}#R(t){if(!Number.isFinite(t))return"0:00";let e=Math.floor(t/60),i=Math.floor(t%60).toString().padStart(2,"0");return`${e}:${i}`}#z(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}};g("audio-player",le);var ce=new Map;function Yr(){if(!ce.has("default"))try{ce.set("default",new AudioContext)}catch{return null}return ce.get("default")}var Rt=new WeakMap;function Xr(r,t){if(Rt.has(r))return Rt.get(r);let e=t.createMediaElementSource(r);return e.connect(t.destination),Rt.set(r,e),e}function Yi(r){let t=Number.parseInt(r??"",10);if(!Number.isFinite(t)||t<=0)return 256;let e=2**Math.round(Math.log2(t));return Math.min(32768,Math.max(32,e))}function Jr(r){if(r.crossOrigin!=null)return!1;let t=r.currentSrc||r.src||r.querySelector("source[src]")?.src||"";if(!t)return!1;try{let e=new URL(t,location.href);return e.protocol==="data:"||e.protocol==="blob:"?!1:e.origin!==location.origin}catch{return!1}}var Xi=new WeakSet,Zr=new Set(["bars","waveform","circle"]);function Ji(r){return r&&Zr.has(r)?r:"bars"}var he="oklch(55% 0.2 260)",Qr=new Uint8Array(256).fill(128),tn=new Uint8Array(128),ue=class extends b{#t=null;#e=null;#i=null;#s=null;#r=null;#n=new Uint8Array(0);#a=new Uint8Array(0);#c=he;#h="";#l="bars";#o=null;#u=null;#p=null;#d=!0;#f=!1;#k=!1;#w=null;#m=()=>this.#T();static get observedAttributes(){return["for","data-mode","data-fft-size"]}setup(){if(this.#k=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.#l=Ji(this.getAttribute("data-mode")),this.#v(),this.#y(),this.#g(),this.#N(),this.#I(),this.#M(),this.#f&&this.#r&&this.#s){try{this.#r.connect(this.#s)}catch{}this.#x()}let t=()=>requestAnimationFrame(()=>{this.#y(),this.#o||this.#L()});this.listen(window,"vb:theme-change",t),this.listen(window.matchMedia("(prefers-color-scheme: dark)"),"change",t)}teardown(){this.#S(),this.#u?.disconnect(),this.#p?.disconnect(),this.#w?.removeEventListener("play",this.#m),this.#w=null,this.#b()}attributeChangedCallback(t,e,i){if(e!==i){if(t==="data-mode"){this.#l=Ji(i),this.isConnected&&!this.#o&&this.#L();return}this.isConnected&&(t==="for"?this.#g():t==="data-fft-size"&&this.#s&&(this.#s.fftSize=Yi(i),this.#A(),this.#o||this.#L()))}}#v(){if(this.shadowRoot)return;let t=this.attachShadow({mode:"open"});t.innerHTML=`
349
+ `}#g(){this.#t.addEventListener("timeupdate",()=>this.#P()),this.#t.addEventListener("loadedmetadata",()=>{this.#T(),this.#I(),this.#P()}),this.#t.addEventListener("emptied",()=>{this.#I(),this.#P()}),this.#t.addEventListener("volumechange",()=>this.#A()),this.#t.addEventListener("error",t=>{let e=t.target;if(e!==this.#t){if(e.localName!=="source"||this.#t.hasAttribute("src"))return;let i=e.nextElementSibling;for(;i&&i.localName!=="source";)i=i.nextElementSibling;if(i)return}this.#b()},!0),this.#t.addEventListener("play",()=>{this.#i=!0,this.setAttribute("state","playing"),this.#r.setAttribute("aria-label","Pause"),this.#z("audio-player:play",{currentTime:this.#t.currentTime,src:this.#t.currentSrc})}),this.#t.addEventListener("pause",()=>{this.#i=!1,this.setAttribute("state","paused"),this.#r.setAttribute("aria-label","Play"),this.#z("audio-player:pause",{currentTime:this.#t.currentTime})}),this.#t.addEventListener("ended",()=>{this.#i=!1,this.setAttribute("state","ended"),this.#r.setAttribute("aria-label","Play"),this.#e&&(Ki(this.#e),this.#$()),this.#z("audio-player:ended",{src:this.#t.currentSrc})})}#b(){this.setAttribute("data-state","error"),this.#p.textContent=`Audio could not be loaded${this.#o.textContent?`: ${this.#o.textContent}`:""}.`,this.#p.hidden=!1}#T(){this.getAttribute("data-state")==="error"&&this.removeAttribute("data-state"),this.#p.hidden=!0,this.#p.textContent=""}#A(){if(!this.#t||!this.#u)return;let t=this.#t.muted;t?this.setAttribute("muted",""):this.removeAttribute("muted"),this.#u.setAttribute("aria-pressed",String(t)),this.#c.style.setProperty("--_vol",t?"0":this.#c.value)}#x(){this.#r.addEventListener("click",()=>{this.#i?this.#t.pause():this.#t.play().catch(()=>{})}),this.#n.addEventListener("input",()=>{let e=Number(this.#n.value);this.#a.style.width=`${e}%`,this.#t.duration&&(this.#t.currentTime=e/100*this.#t.duration,this.#N(this.#t.currentTime,this.#t.duration))}),this.#n.addEventListener("pointerdown",()=>{this.#d=!0,this.setState("scrub-active",!0)});let t=()=>{this.#d&&(this.#d=!1,this.setState("scrub-active",!1))};this.#n.addEventListener("pointerup",t),this.#n.addEventListener("pointercancel",t),this.#n.addEventListener("change",t),this.#c.addEventListener("input",()=>{this.#t.volume=Number(this.#c.value),this.#t.muted=!1,this.#A()}),this.#u.addEventListener("click",()=>{this.#t.muted=!this.#t.muted,this.#A()}),this.addEventListener("keydown",e=>{if(!(e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey)&&!this.#S(e))switch(e.key){case" ":e.preventDefault(),this.#i?this.#t.pause():this.#t.play().catch(()=>{});break;case"ArrowLeft":e.preventDefault(),this.#t.currentTime=Math.max(0,this.#t.currentTime-10);break;case"ArrowRight":e.preventDefault(),this.#t.currentTime=Math.min(this.#t.duration||0,this.#t.currentTime+10);break;case"m":case"M":this.#t.muted=!this.#t.muted,this.#A();break}}),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","group"),!this.hasAttribute("aria-label")&&!this.hasAttribute("aria-labelledby")&&this.setAttribute("aria-label","Audio player"),this.hasAttribute("aria-keyshortcuts")||this.setAttribute("aria-keyshortcuts","Space ArrowLeft ArrowRight M")}#S(t){for(let e of t.composedPath()){if(e===this)return!1;if(e instanceof Element&&e.matches(Gr))return!0}return!1}#E(){this.#e&&this.#e.addEventListener("click",t=>{let i=t.target?.closest("a[href]"),s=i?.closest("li");!i||!s||(t.preventDefault(),this.#L(s))})}#L(t){if(!this.#e)return;let e=Wi(this.#t,this.#e,t);e&&(this.#f.add(t),this.#M(),this.#z("audio-player:track-change",e))}#C(){if(!this.#e)return;let t=this.#t.src,e=Mt(this.#e).find(i=>i.querySelector("a[href]").href===t);this.#e.querySelectorAll("li[data-audio-active]").forEach(i=>{i!==e&&i.removeAttribute("data-audio-active")}),e?.setAttribute("data-audio-active","")}#$(){if(!this.#e)return;let t=this.hasAttribute("loop");if(!this.hasAttribute("shuffle")){let o=Gi(this.#e,{loop:t});o&&this.#L(o);return}let e=Mt(this.#e),i=this.#e.querySelector("li[data-audio-active]");i&&this.#f.add(i);let s=e.filter(o=>!this.#f.has(o));if(!s.length){if(this.#f.clear(),!t)return;s=e.length>1?e.filter(o=>o!==i):e}let n=s[Math.floor(Math.random()*s.length)];n&&this.#L(n)}#P(){let t=this.#t.currentTime,e=this.#t.duration||0,i=e?t/e*100:0;this.#h.textContent=this.#R(t),this.#N(t,e),!this.#d&&(this.#n.value=String(i),this.#a.style.width=`${i}%`)}#N(t,e){this.#n.setAttribute("aria-valuetext",`${this.#R(t)} of ${this.#R(e)}`)}#I(){let t=this.#t.duration||0;this.#l.textContent=this.#R(t)}#M(){if(!this.#o)return;if(this.#e){let i=this.#e.querySelector("li[data-audio-active] a");if(i){this.#o.textContent=i.textContent;return}}let t=this.#t.src||this.#t.currentSrc||this.#t.querySelector("source")?.src||"",e=t?t.split("/").pop().split(/[?#]/)[0]:"";this.#o.textContent=e.replace(/\.[^.]+$/,"").replace(/[-_]/g," ")}#R(t){if(!Number.isFinite(t))return"0:00";let e=Math.floor(t/60),i=Math.floor(t%60).toString().padStart(2,"0");return`${e}:${i}`}#z(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}};g("audio-player",le);var ce=new Map;function Yr(){if(!ce.has("default"))try{ce.set("default",new AudioContext)}catch{return null}return ce.get("default")}var Rt=new WeakMap;function Xr(r,t){if(Rt.has(r))return Rt.get(r);let e=t.createMediaElementSource(r);return e.connect(t.destination),Rt.set(r,e),e}function Yi(r){let t=Number.parseInt(r??"",10);if(!Number.isFinite(t)||t<=0)return 256;let e=2**Math.round(Math.log2(t));return Math.min(32768,Math.max(32,e))}function Jr(r){if(r.crossOrigin!=null)return!1;let t=r.currentSrc||r.src||r.querySelector("source[src]")?.src||"";if(!t)return!1;try{let e=new URL(t,location.href);return e.protocol==="data:"||e.protocol==="blob:"?!1:e.origin!==location.origin}catch{return!1}}var Xi=new WeakSet,Zr=new Set(["bars","waveform","circle"]);function Ji(r){return r&&Zr.has(r)?r:"bars"}var he="oklch(55% 0.2 260)",Qr=new Uint8Array(256).fill(128),tn=new Uint8Array(128),ue=class extends b{#t=null;#e=null;#i=null;#s=null;#r=null;#n=new Uint8Array(0);#a=new Uint8Array(0);#c=he;#h="";#l="bars";#o=null;#u=null;#p=null;#d=!0;#f=!1;#k=!1;#y=null;#m=()=>this.#T();static get observedAttributes(){return["for","data-mode","data-fft-size"]}setup(){if(this.#k=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.#l=Ji(this.getAttribute("data-mode")),this.#v(),this.#w(),this.#g(),this.#N(),this.#I(),this.#M(),this.#f&&this.#r&&this.#s){try{this.#r.connect(this.#s)}catch{}this.#x()}let t=()=>requestAnimationFrame(()=>{this.#w(),this.#o||this.#L()});this.listen(window,"vb:theme-change",t),this.listen(window.matchMedia("(prefers-color-scheme: dark)"),"change",t)}teardown(){this.#S(),this.#u?.disconnect(),this.#p?.disconnect(),this.#y?.removeEventListener("play",this.#m),this.#y=null,this.#b()}attributeChangedCallback(t,e,i){if(e!==i){if(t==="data-mode"){this.#l=Ji(i),this.isConnected&&!this.#o&&this.#L();return}this.isConnected&&(t==="for"?this.#g():t==="data-fft-size"&&this.#s&&(this.#s.fftSize=Yi(i),this.#A(),this.#o||this.#L()))}}#v(){if(this.shadowRoot)return;let t=this.attachShadow({mode:"open"});t.innerHTML=`
350
350
  <style>
351
351
  :host {
352
352
  display: block;
@@ -364,7 +364,7 @@ var Kr=Object.defineProperty;var ae=(r,t)=>()=>(r&&(t=r(r=0)),t);var Hi=(r,t)=>{
364
364
  }
365
365
  </style>
366
366
  <canvas aria-hidden="true"></canvas>
367
- `,this.#t=t.querySelector("canvas"),this.#e=this.#t.getContext("2d")}#y(){let t=getComputedStyle(this);this.#c=t.getPropertyValue("--_color").trim()||he,this.#h=t.getPropertyValue("--_bg").trim()}#g(){let t=this.getAttribute("for"),e=t?document.getElementById(t):null,i=e?.tagName==="AUDIO"?e:null;if(this.#i&&this.#i!==i&&(this.#S(),this.#b(),this.#s=null,this.#r=null,this.#f=!1,this.getAttribute("data-state")!==null&&this.removeAttribute("data-state"),this.#L()),this.#i=i,!i){this.#w?.removeEventListener("play",this.#m),this.#w=null;return}this.#f||(this.#w!==i&&(this.#w?.removeEventListener("play",this.#m),i.addEventListener("play",this.#m),this.#w=i),i.paused||this.#T())}#b(){if(this.#r&&this.#s)try{this.#r.disconnect(this.#s)}catch{}}#T(){if(this.#f||!this.#i)return;let t=this.#i;if(!Rt.has(t)&&Jr(t)){this.setAttribute("data-state","cross-origin"),Xi.has(t)||(Xi.add(t),console.warn('<audio-visualizer>: not visualising a cross-origin <audio> without crossorigin="anonymous" and CORS headers \u2014 hooking it would mute playback.',t));return}let e=Yr();if(!e)return;let i,s;try{i=e.createAnalyser(),i.fftSize=Yi(this.getAttribute("data-fft-size")),i.smoothingTimeConstant=.8,s=Xr(t,e),s.connect(i)}catch(n){this.setAttribute("data-state","error"),console.warn("<audio-visualizer>: could not connect to the audio element.",n);return}this.#s=i,this.#r=s,this.#A(),this.#f=!0,this.getAttribute("data-state")!==null&&this.removeAttribute("data-state"),this.#w?.removeEventListener("play",this.#m),this.#w=null,e.state==="suspended"&&e.resume().catch(()=>{}),this.#x()}#A(){this.#s&&(this.#n.length!==this.#s.frequencyBinCount&&(this.#n=new Uint8Array(this.#s.frequencyBinCount)),this.#a.length!==this.#s.fftSize&&(this.#a=new Uint8Array(this.#s.fftSize)))}#x(){if(this.#o)return;if(this.#k){this.#L();return}let t=()=>{if(!this.#d||this.#k){this.#o=null;return}this.#o=requestAnimationFrame(t),this.#L()};this.#o=requestAnimationFrame(t)}#S(){this.#o&&(cancelAnimationFrame(this.#o),this.#o=null)}#E(){let t=window.devicePixelRatio||1,e=Math.round(this.#t.clientWidth*t),i=Math.round(this.#t.clientHeight*t);this.#t.width!==e&&(this.#t.width=e),this.#t.height!==i&&(this.#t.height=i)}#L(){let t=this.#e;if(!t)return;let e=this.#t.width,i=this.#t.height;if(!e||!i)return;t.clearRect(0,0,e,i),this.#h&&this.#h!=="transparent"&&(t.fillStyle=this.#h,t.fillRect(0,0,e,i));let s=this.#f?this.#s:null,n=this.#l;if(n==="waveform"){s&&s.getByteTimeDomainData(this.#a),this.#$(t,e,i,this.#c,s?this.#a:Qr);return}s&&s.getByteFrequencyData(this.#n);let o=s?this.#n:tn;n==="circle"?this.#P(t,e,i,this.#c,o):this.#C(t,e,i,this.#c,o)}#C(t,e,i,s,n){let o=Math.min(n.length,64),a=e/o,l=Math.max(1,a-1),c=Math.max(1,Math.round(i*.03));t.fillStyle=s;for(let h=0;h<o;h++){let u=Math.max(c,n[h]/255*i);t.fillRect(h*a,i-u,l,u)}}#$(t,e,i,s,n){let o=e/Math.max(1,n.length-1);t.strokeStyle=s,t.lineWidth=2*(window.devicePixelRatio||1),t.beginPath();for(let a=0;a<n.length;a++){let l=n[a]/255*i;a===0?t.moveTo(0,l):t.lineTo(a*o,l)}t.stroke()}#P(t,e,i,s,n){let o=e/2,a=i/2,l=Math.min(e,i)*.25,c=n.length;t.strokeStyle=s,t.lineWidth=2*(window.devicePixelRatio||1),t.beginPath();for(let h=0;h<c;h++){let u=h/c*Math.PI*2,p=n[h]/255*(l*.8),d=l+p,f=o+d*Math.cos(u),m=a+d*Math.sin(u);h===0?t.moveTo(f,m):t.lineTo(f,m)}t.closePath(),t.stroke()}#N(){this.#u??=new IntersectionObserver(([t])=>{this.#d=t.isIntersecting,this.#d&&this.#f&&!this.#o&&!this.#k&&this.#x()}),this.#u.observe(this)}#I(){this.#p??=new ResizeObserver(()=>{this.#E(),this.#o||this.#L()}),this.#p.observe(this.#t)}#M(){let t=window.matchMedia("(prefers-reduced-motion: reduce)");this.listen(t,"change",e=>{this.#k=e.matches,this.#k?(this.#S(),this.#L()):this.#f&&this.#d&&!this.#o&&this.#x()})}};g("audio-visualizer",ue);function Zi(r){return en(r&&r.closest("[lang]")?.lang||document.documentElement.lang||navigator.language||"en")}function en(r,t="en-US"){try{if(r)return Intl.getCanonicalLocales(r),r}catch{}try{return Intl.getCanonicalLocales(t),t}catch{return"en-US"}}var de=[.5,.75,1,1.25,1.5,2],Qi=3e3,_t=10,sn=5,rn='input, button, a[href], summary, select, textarea, video[controls], [contenteditable]:not([contenteditable="false"])',nn={player:"Video player",controls:"Video controls","play-video":"Play video",play:"Play",pause:"Pause",seek:"Seek","skip-back":"Skip back 10 seconds","skip-forward":"Skip forward 10 seconds",mute:"Mute",volume:"Volume",speed:"Playback speed {rate}",captions:"Captions",fullscreen:"Fullscreen","exit-fullscreen":"Exit fullscreen",playing:"Playing",paused:"Paused",ended:"Ended",buffering:"Buffering","time-of":"{current} of {duration}"},pe=class extends b{#t=null;#e=null;#i=!1;#s=null;#r=null;#n=null;#a=null;#c=null;#h=null;#l=null;#o=null;#u=null;#p=null;#d=null;#f=null;#k=null;#w=null;#m=null;#v=2;#y=null;#g=null;#b=null;#T=!1;#A="en";#x=null;#S=null;setup(){if(this.#t=this.querySelector("video"),!this.#t)return!1;this.#e=this.querySelector(".track-list"),this.#t.removeAttribute("controls"),this.#E(),this.#$(),this.#M(),this.#z(),this.#K(),this.#B(),this.#P(),this.#L(),this.hasAttribute("muted")&&(this.#t.muted=!0),this.#G(),!this.#e&&this.hasAttribute("loop")&&(this.#t.loop=!0),this.#T||(this.#T=!0,globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches?this.#t.autoplay&&(this.#t.autoplay=!1,this.#t.pause()):this.hasAttribute("autoplay")&&this.#t.play().catch(()=>{})),this.#_(),this.#y=()=>{let e=this.shadowRoot?.querySelector(".player");e&&(e.style.display="none",e.offsetHeight,e.style.display="")},this.listen(window,"vb:theme-change",this.#y),this.#g=()=>{let e=this.#Q();e!==this.hasAttribute("data-fullscreen")&&(this.#rt(e),this.#f.setAttribute("aria-label",this.#C(e?"exit-fullscreen":"fullscreen")),this.#V("video-player:fullscreen",{active:e}))},this.listen(document,"fullscreenchange",this.#g),this.#rt(this.#Q());let t=this.#tt();return t&&this.hasAttribute("captions")&&(t.mode="showing"),this.#st(),this.listen(this.#t.textTracks,"change",()=>this.#st()),this.#i=!this.#t.paused&&!this.#t.ended,this.#R(this.#t.ended?"ended":this.#i?"playing":this.#t.currentTime>0?"paused":"idle"),this.#r.setAttribute("aria-label",this.#C(this.#i?"pause":"play")),this.#Z(),this.#q(),!0}teardown(){this.#t&&this.#t.setAttribute("controls",""),this.#m!=null&&clearTimeout(this.#m),this.#m=null}get src(){return this.#t?.getAttribute("src")||this.#t?.currentSrc||""}set src(t){if(!this.#t)return;let e=t==null?"":String(t);this.#t.getAttribute("src")!==e&&(this.#t.setAttribute("src",e),this.#t.load?.(),this.#V("video-player:src-changed",{src:e,source:"property"}))}get currentTime(){return this.#t?.currentTime??0}set currentTime(t){this.#t&&(this.#t.currentTime=Number(t)||0)}#E(){if(this.shadowRoot)return;let t=this.attachShadow({mode:"open"});t.innerHTML=`
367
+ `,this.#t=t.querySelector("canvas"),this.#e=this.#t.getContext("2d")}#w(){let t=getComputedStyle(this);this.#c=t.getPropertyValue("--_color").trim()||he,this.#h=t.getPropertyValue("--_bg").trim()}#g(){let t=this.getAttribute("for"),e=t?document.getElementById(t):null,i=e?.tagName==="AUDIO"?e:null;if(this.#i&&this.#i!==i&&(this.#S(),this.#b(),this.#s=null,this.#r=null,this.#f=!1,this.getAttribute("data-state")!==null&&this.removeAttribute("data-state"),this.#L()),this.#i=i,!i){this.#y?.removeEventListener("play",this.#m),this.#y=null;return}this.#f||(this.#y!==i&&(this.#y?.removeEventListener("play",this.#m),i.addEventListener("play",this.#m),this.#y=i),i.paused||this.#T())}#b(){if(this.#r&&this.#s)try{this.#r.disconnect(this.#s)}catch{}}#T(){if(this.#f||!this.#i)return;let t=this.#i;if(!Rt.has(t)&&Jr(t)){this.setAttribute("data-state","cross-origin"),Xi.has(t)||(Xi.add(t),console.warn('<audio-visualizer>: not visualising a cross-origin <audio> without crossorigin="anonymous" and CORS headers \u2014 hooking it would mute playback.',t));return}let e=Yr();if(!e)return;let i,s;try{i=e.createAnalyser(),i.fftSize=Yi(this.getAttribute("data-fft-size")),i.smoothingTimeConstant=.8,s=Xr(t,e),s.connect(i)}catch(n){this.setAttribute("data-state","error"),console.warn("<audio-visualizer>: could not connect to the audio element.",n);return}this.#s=i,this.#r=s,this.#A(),this.#f=!0,this.getAttribute("data-state")!==null&&this.removeAttribute("data-state"),this.#y?.removeEventListener("play",this.#m),this.#y=null,e.state==="suspended"&&e.resume().catch(()=>{}),this.#x()}#A(){this.#s&&(this.#n.length!==this.#s.frequencyBinCount&&(this.#n=new Uint8Array(this.#s.frequencyBinCount)),this.#a.length!==this.#s.fftSize&&(this.#a=new Uint8Array(this.#s.fftSize)))}#x(){if(this.#o)return;if(this.#k){this.#L();return}let t=()=>{if(!this.#d||this.#k){this.#o=null;return}this.#o=requestAnimationFrame(t),this.#L()};this.#o=requestAnimationFrame(t)}#S(){this.#o&&(cancelAnimationFrame(this.#o),this.#o=null)}#E(){let t=window.devicePixelRatio||1,e=Math.round(this.#t.clientWidth*t),i=Math.round(this.#t.clientHeight*t);this.#t.width!==e&&(this.#t.width=e),this.#t.height!==i&&(this.#t.height=i)}#L(){let t=this.#e;if(!t)return;let e=this.#t.width,i=this.#t.height;if(!e||!i)return;t.clearRect(0,0,e,i),this.#h&&this.#h!=="transparent"&&(t.fillStyle=this.#h,t.fillRect(0,0,e,i));let s=this.#f?this.#s:null,n=this.#l;if(n==="waveform"){s&&s.getByteTimeDomainData(this.#a),this.#$(t,e,i,this.#c,s?this.#a:Qr);return}s&&s.getByteFrequencyData(this.#n);let o=s?this.#n:tn;n==="circle"?this.#P(t,e,i,this.#c,o):this.#C(t,e,i,this.#c,o)}#C(t,e,i,s,n){let o=Math.min(n.length,64),a=e/o,l=Math.max(1,a-1),c=Math.max(1,Math.round(i*.03));t.fillStyle=s;for(let h=0;h<o;h++){let u=Math.max(c,n[h]/255*i);t.fillRect(h*a,i-u,l,u)}}#$(t,e,i,s,n){let o=e/Math.max(1,n.length-1);t.strokeStyle=s,t.lineWidth=2*(window.devicePixelRatio||1),t.beginPath();for(let a=0;a<n.length;a++){let l=n[a]/255*i;a===0?t.moveTo(0,l):t.lineTo(a*o,l)}t.stroke()}#P(t,e,i,s,n){let o=e/2,a=i/2,l=Math.min(e,i)*.25,c=n.length;t.strokeStyle=s,t.lineWidth=2*(window.devicePixelRatio||1),t.beginPath();for(let h=0;h<c;h++){let u=h/c*Math.PI*2,p=n[h]/255*(l*.8),d=l+p,f=o+d*Math.cos(u),m=a+d*Math.sin(u);h===0?t.moveTo(f,m):t.lineTo(f,m)}t.closePath(),t.stroke()}#N(){this.#u??=new IntersectionObserver(([t])=>{this.#d=t.isIntersecting,this.#d&&this.#f&&!this.#o&&!this.#k&&this.#x()}),this.#u.observe(this)}#I(){this.#p??=new ResizeObserver(()=>{this.#E(),this.#o||this.#L()}),this.#p.observe(this.#t)}#M(){let t=window.matchMedia("(prefers-reduced-motion: reduce)");this.listen(t,"change",e=>{this.#k=e.matches,this.#k?(this.#S(),this.#L()):this.#f&&this.#d&&!this.#o&&this.#x()})}};g("audio-visualizer",ue);function Zi(r){return en(r&&r.closest("[lang]")?.lang||document.documentElement.lang||navigator.language||"en")}function en(r,t="en-US"){try{if(r)return Intl.getCanonicalLocales(r),r}catch{}try{return Intl.getCanonicalLocales(t),t}catch{return"en-US"}}var de=[.5,.75,1,1.25,1.5,2],Qi=3e3,_t=10,sn=5,rn='input, button, a[href], summary, select, textarea, video[controls], [contenteditable]:not([contenteditable="false"])',nn={player:"Video player",controls:"Video controls","play-video":"Play video",play:"Play",pause:"Pause",seek:"Seek","skip-back":"Skip back 10 seconds","skip-forward":"Skip forward 10 seconds",mute:"Mute",volume:"Volume",speed:"Playback speed {rate}",captions:"Captions",fullscreen:"Fullscreen","exit-fullscreen":"Exit fullscreen",playing:"Playing",paused:"Paused",ended:"Ended",buffering:"Buffering","time-of":"{current} of {duration}"},pe=class extends b{#t=null;#e=null;#i=!1;#s=null;#r=null;#n=null;#a=null;#c=null;#h=null;#l=null;#o=null;#u=null;#p=null;#d=null;#f=null;#k=null;#y=null;#m=null;#v=2;#w=null;#g=null;#b=null;#T=!1;#A="en";#x=null;#S=null;setup(){if(this.#t=this.querySelector("video"),!this.#t)return!1;this.#e=this.querySelector(".track-list"),this.#t.removeAttribute("controls"),this.#E(),this.#$(),this.#M(),this.#z(),this.#K(),this.#B(),this.#P(),this.#L(),this.hasAttribute("muted")&&(this.#t.muted=!0),this.#G(),!this.#e&&this.hasAttribute("loop")&&(this.#t.loop=!0),this.#T||(this.#T=!0,globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches?this.#t.autoplay&&(this.#t.autoplay=!1,this.#t.pause()):this.hasAttribute("autoplay")&&this.#t.play().catch(()=>{})),this.#_(),this.#w=()=>{let e=this.shadowRoot?.querySelector(".player");e&&(e.style.display="none",e.offsetHeight,e.style.display="")},this.listen(window,"vb:theme-change",this.#w),this.#g=()=>{let e=this.#Q();e!==this.hasAttribute("data-fullscreen")&&(this.#rt(e),this.#f.setAttribute("aria-label",this.#C(e?"exit-fullscreen":"fullscreen")),this.#V("video-player:fullscreen",{active:e}))},this.listen(document,"fullscreenchange",this.#g),this.#rt(this.#Q());let t=this.#tt();return t&&this.hasAttribute("captions")&&(t.mode="showing"),this.#st(),this.listen(this.#t.textTracks,"change",()=>this.#st()),this.#i=!this.#t.paused&&!this.#t.ended,this.#R(this.#t.ended?"ended":this.#i?"playing":this.#t.currentTime>0?"paused":"idle"),this.#r.setAttribute("aria-label",this.#C(this.#i?"pause":"play")),this.#Z(),this.#q(),!0}teardown(){this.#t&&this.#t.setAttribute("controls",""),this.#m!=null&&clearTimeout(this.#m),this.#m=null}get src(){return this.#t?.getAttribute("src")||this.#t?.currentSrc||""}set src(t){if(!this.#t)return;let e=t==null?"":String(t);this.#t.getAttribute("src")!==e&&(this.#t.setAttribute("src",e),this.#t.load?.(),this.#V("video-player:src-changed",{src:e,source:"property"}))}get currentTime(){return this.#t?.currentTime??0}set currentTime(t){this.#t&&(this.#t.currentTime=Number(t)||0)}#E(){if(this.shadowRoot)return;let t=this.attachShadow({mode:"open"});t.innerHTML=`
368
368
  <style>${this.#I()}</style>
369
369
  <div part="player" class="player">
370
370
  <slot></slot>
@@ -448,7 +448,7 @@ var Kr=Object.defineProperty;var ae=(r,t)=>()=>(r&&(t=r(r=0)),t);var Hi=(r,t)=>{
448
448
  </div>
449
449
  <div class="sr-status" role="status" aria-live="polite"></div>
450
450
  </div>
451
- `,this.#s=t.querySelector(".controls"),this.#r=t.querySelector(".play-btn"),this.#n=t.querySelector(".play-overlay"),this.#a=t.querySelector(".timeline"),this.#c=t.querySelector(".timeline-fill"),this.#h=t.querySelector(".timeline-buffer"),this.#l=t.querySelector(".volume"),this.#o=t.querySelector(".current-time"),this.#u=t.querySelector(".duration"),this.#p=t.querySelector(".speed-btn"),this.#d=t.querySelector(".captions-btn"),this.#f=t.querySelector(".fullscreen-btn"),this.#k=t.querySelector(".buffer-indicator"),this.#w=t.querySelector(".sr-status"),this.#b=t.querySelector(".mute-btn")}#L(){let t=this.#t.querySelector('track[kind="captions"], track[kind="subtitles"]');this.#d.hidden=!t}#C(t,e={}){let i=this.getAttribute(`data-label-${t}`)??nn[t]??t;for(let[s,n]of Object.entries(e))i=i.replaceAll(`{${s}}`,n);return i}#$(){this.#A=Zi(this);try{this.#x=new Intl.NumberFormat(this.#A,{useGrouping:!1})}catch{this.#x=new Intl.NumberFormat("en",{useGrouping:!1})}let t=Intl.DurationFormat;try{this.#S=t?new t(this.#A,{style:"digital",hoursDisplay:"auto"}):null}catch{this.#S=null}}#P(){let t=this.shadowRoot,e=(i,s)=>t.querySelector(i)?.setAttribute("aria-label",this.#C(s));e(".controls","controls"),e(".play-overlay","play-video"),e(".timeline","seek"),e(".skip-back-btn","skip-back"),e(".skip-forward-btn","skip-forward"),e(".mute-btn","mute"),e(".volume","volume"),e(".captions-btn","captions"),this.#f.setAttribute("aria-label",this.#C(this.#Q()?"exit-fullscreen":"fullscreen")),this.#N(),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","group"),!this.hasAttribute("aria-label")&&!this.hasAttribute("aria-labelledby")&&this.setAttribute("aria-label",this.#C("player")),this.hasAttribute("aria-keyshortcuts")||this.setAttribute("aria-keyshortcuts","Space K ArrowLeft ArrowRight ArrowUp ArrowDown M F C")}#N(){let t=de[this.#v],e=`${this.#x?.format(t)??t}x`,i=this.#p.querySelector("span");i.textContent=e,this.#p.setAttribute("aria-label",this.#C("speed",{rate:e}))}#I(){return`
451
+ `,this.#s=t.querySelector(".controls"),this.#r=t.querySelector(".play-btn"),this.#n=t.querySelector(".play-overlay"),this.#a=t.querySelector(".timeline"),this.#c=t.querySelector(".timeline-fill"),this.#h=t.querySelector(".timeline-buffer"),this.#l=t.querySelector(".volume"),this.#o=t.querySelector(".current-time"),this.#u=t.querySelector(".duration"),this.#p=t.querySelector(".speed-btn"),this.#d=t.querySelector(".captions-btn"),this.#f=t.querySelector(".fullscreen-btn"),this.#k=t.querySelector(".buffer-indicator"),this.#y=t.querySelector(".sr-status"),this.#b=t.querySelector(".mute-btn")}#L(){let t=this.#t.querySelector('track[kind="captions"], track[kind="subtitles"]');this.#d.hidden=!t}#C(t,e={}){let i=this.getAttribute(`data-label-${t}`)??nn[t]??t;for(let[s,n]of Object.entries(e))i=i.replaceAll(`{${s}}`,n);return i}#$(){this.#A=Zi(this);try{this.#x=new Intl.NumberFormat(this.#A,{useGrouping:!1})}catch{this.#x=new Intl.NumberFormat("en",{useGrouping:!1})}let t=Intl.DurationFormat;try{this.#S=t?new t(this.#A,{style:"digital",hoursDisplay:"auto"}):null}catch{this.#S=null}}#P(){let t=this.shadowRoot,e=(i,s)=>t.querySelector(i)?.setAttribute("aria-label",this.#C(s));e(".controls","controls"),e(".play-overlay","play-video"),e(".timeline","seek"),e(".skip-back-btn","skip-back"),e(".skip-forward-btn","skip-forward"),e(".mute-btn","mute"),e(".volume","volume"),e(".captions-btn","captions"),this.#f.setAttribute("aria-label",this.#C(this.#Q()?"exit-fullscreen":"fullscreen")),this.#N(),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","group"),!this.hasAttribute("aria-label")&&!this.hasAttribute("aria-labelledby")&&this.setAttribute("aria-label",this.#C("player")),this.hasAttribute("aria-keyshortcuts")||this.setAttribute("aria-keyshortcuts","Space K ArrowLeft ArrowRight ArrowUp ArrowDown M F C")}#N(){let t=de[this.#v],e=`${this.#x?.format(t)??t}x`,i=this.#p.querySelector("span");i.textContent=e,this.#p.setAttribute("aria-label",this.#C("speed",{rate:e}))}#I(){return`
452
452
  :host {
453
453
  display: block;
454
454
  --_accent: var(--video-player-accent, var(--color-primary, oklch(55% 0.2 260)));
@@ -932,7 +932,7 @@ var Kr=Object.defineProperty;var ae=(r,t)=>()=>(r&&(t=r(r=0)),t);var Hi=(r,t)=>{
932
932
  cursor: auto;
933
933
  }
934
934
  }
935
- `}#M(){let t=this.#t;this.listen(t,"timeupdate",()=>this.#q()),this.listen(t,"loadedmetadata",()=>{this.#Z(),this.#q()}),this.listen(t,"durationchange",()=>this.#Z()),this.listen(t,"progress",()=>this.#et()),this.listen(t,"volumechange",()=>this.#G()),this.listen(t,"play",()=>{this.#i=!0,this.#R("playing"),this.#r.setAttribute("aria-label",this.#C("pause")),this.#Y(this.#C("playing")),this.#V("video-player:play",{currentTime:t.currentTime,src:t.currentSrc})}),this.listen(t,"pause",()=>{this.#i=!1,t.ended||this.#R("paused"),this.#r.setAttribute("aria-label",this.#C("play")),this.#_(),this.#Y(this.#C("paused")),this.#V("video-player:pause",{currentTime:t.currentTime})}),this.listen(t,"ended",()=>{this.#i=!1,this.#R("ended"),this.#r.setAttribute("aria-label",this.#C("play")),this.#_();let e=this.#e?.querySelector("li[data-video-active]");e&&e.setAttribute("data-video-played",""),this.#e&&this.#H(),this.#Y(this.#C("ended")),this.#V("video-player:ended",{src:t.currentSrc})}),this.listen(t,"waiting",()=>{this.#i&&(this.#R("buffering"),this.#Y(this.#C("buffering")))}),this.listen(t,"playing",()=>{this.getAttribute("state")==="buffering"&&this.#R("playing")})}#R(t){this.setAttribute("state",t),this.#n&&(this.#n.inert=!(t==="idle"||t==="ended"))}#z(){let t=this.shadowRoot,e=()=>{this.#i?this.#t.pause():this.#t.play().catch(()=>{})};this.listen(this.#n,"click",s=>{s.stopPropagation(),this.#t.play().catch(()=>{})});let i=t.querySelector(".player");this.listen(i,"click",s=>{let n=s.target;n.closest(".controls")||n.closest(".play-overlay")||n!==this.#t&&n!==i||e()}),this.listen(this.#r,"click",e),this.listen(this.#a,"input",()=>{this.#t.duration&&(this.#t.currentTime=Number(this.#a.value)/100*this.#t.duration,this.#J())}),this.listen(this.#a,"keydown",s=>{let n=s;if(n.altKey||n.ctrlKey||n.metaKey)return;let o={ArrowLeft:-1,ArrowDown:-1,ArrowRight:1,ArrowUp:1}[n.key];o&&(n.preventDefault(),this.#F(o*sn))}),this.listen(t.querySelector(".skip-back-btn"),"click",()=>this.#F(-_t)),this.listen(t.querySelector(".skip-forward-btn"),"click",()=>this.#F(_t)),this.listen(this.#l,"input",()=>{this.#t.volume=Number(this.#l.value),this.#t.muted=!1,this.#G()}),this.listen(this.#b,"click",()=>{this.#t.muted=!this.#t.muted,this.#G()}),this.listen(this.#p,"click",()=>{this.#v=(this.#v+1)%de.length;let s=de[this.#v];this.#t.playbackRate=s,this.#N(),this.#V("video-player:speed",{rate:s})}),this.listen(this.#d,"click",()=>{let s=this.#tt();if(!s)return;let n=s.mode==="showing";s.mode=n?"hidden":"showing";let o=!n;this.toggleAttribute("captions",o),this.#d.setAttribute("aria-pressed",String(o)),this.#V("video-player:captions",{active:o,label:s.label})}),this.listen(this.#f,"click",()=>this.#it()),this.listen(this,"keydown",s=>this.#nt(s))}#D(t){for(let e of t.composedPath()){if(e===this)return!1;if(e instanceof Element&&e.matches(rn))return!0}return!1}#F(t){let e=this.#t.duration||0;this.#t.currentTime=Math.min(e,Math.max(0,this.#t.currentTime+t)),this.#_(),this.#q()}#B(){let t=this.shadowRoot?.querySelector(".player"),e=()=>{this.#_(),this.#O(Qi)};this.listen(t,"mousemove",e),this.listen(t,"mouseenter",e),this.listen(t,"mouseleave",()=>this.#O(500)),this.listen(t,"touchstart",()=>{this.hasAttribute("controls")?this.#j():e()},{passive:!0}),this.listen(this.#s,"mouseenter",()=>{this.#m!=null&&clearTimeout(this.#m),this.#_()}),this.listen(this.#s,"focusin",()=>{this.#m!=null&&clearTimeout(this.#m),this.#_()}),this.listen(this.#s,"focusout",()=>this.#O(Qi))}#O(t){this.#m!=null&&clearTimeout(this.#m),this.#m=null,this.#i&&(this.#m=setTimeout(()=>this.#j(),t))}#_(){this.setAttribute("controls","")}#j(){let t=this.shadowRoot?.activeElement;t&&this.#s?.contains(t)||this.removeAttribute("controls")}#K(){this.#e&&this.listen(this.#e,"click",t=>{let e=t.target.closest("a[href]");e&&(t.preventDefault(),this.#U(e.href,e.closest("li"),e))})}#U(t,e,i){this.#e.querySelectorAll("li").forEach(a=>a.removeAttribute("data-video-active")),e&&e.setAttribute("data-video-active",""),this.#t.src=t;let n=i?.getAttribute("data-poster");n&&(this.#t.poster=n);let o=i?.getAttribute("data-captions");this.#W(o),this.#t.play().catch(()=>{}),this.#V("video-player:track-change",{src:t,title:i?.textContent??""})}#W(t){if(this.#t.querySelectorAll("track[data-dynamic]").forEach(i=>i.remove()),t){let i=document.createElement("track");i.kind="captions",i.src=t,i.default=!0,i.setAttribute("data-dynamic",""),this.#t.appendChild(i),this.hasAttribute("captions")&&(i.track.mode="showing")}this.#L()}#H(){if(!this.#e)return;let t=[...this.#e.querySelectorAll("li")],e=t.findIndex(s=>s.hasAttribute("data-video-active"));if(this.hasAttribute("shuffle")){let s=t.filter((n,o)=>o!==e);if(s.length){let n=s[Math.floor(Math.random()*s.length)],o=n.querySelector("a[href]");o&&this.#U(o.href,n,o)}return}let i=e+1;if(i<t.length){let s=t[i].querySelector("a[href]");s&&this.#U(s.href,t[i],s)}else if(this.hasAttribute("loop")){let s=t[0]?.querySelector("a[href]");s&&this.#U(s.href,t[0],s)}}#q(){let t=this.#t.currentTime,e=this.#t.duration||0,i=e?t/e*100:0;this.#o.textContent=this.#X(t),this.#a.value=String(i),this.#J(),this.#c.style.width=`${i}%`}#J(){this.#a.setAttribute("aria-valuetext",this.#C("time-of",{current:this.#X(this.#t.currentTime),duration:this.#X(this.#t.duration||0)}))}#Z(){let t=this.#t.duration||0;this.#u.textContent=this.#X(t),this.#J()}#et(){let t=this.#t.buffered,e=this.#t.duration||0;if(t.length>0&&e){let i=t.end(t.length-1);this.#h.style.width=`${i/e*100}%`}}#Q(){let t=document.fullscreenElement;return!!t&&(t===this||t===this.#t)}#rt(t){t?this.setAttribute("data-fullscreen",""):this.removeAttribute("data-fullscreen")}#it(){this.#Q()?document.exitFullscreen().catch(()=>{}):this.requestFullscreen().catch(()=>{this.#t.requestFullscreen?.().catch(()=>{})})}#st(){let t=this.#tt();if(!t||!this.#d)return;let e=t.mode==="showing";this.toggleAttribute("captions",e),this.#d.setAttribute("aria-pressed",String(e))}#tt(){let t=this.#t.textTracks;for(let e=0;e<t.length;e++)if(t[e].kind==="captions"||t[e].kind==="subtitles")return t[e];return null}#nt(t){if(!(t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey)&&!this.#D(t))switch(t.key){case" ":case"k":case"K":t.preventDefault(),this.#i?this.#t.pause():this.#t.play().catch(()=>{});break;case"ArrowLeft":t.preventDefault(),this.#F(-_t);break;case"ArrowRight":t.preventDefault(),this.#F(_t);break;case"ArrowUp":t.preventDefault(),this.#t.volume=Math.min(1,this.#t.volume+.05),this.#G(),this.#_();break;case"ArrowDown":t.preventDefault(),this.#t.volume=Math.max(0,this.#t.volume-.05),this.#G(),this.#_();break;case"m":case"M":this.#t.muted=!this.#t.muted,this.#G();break;case"f":case"F":this.#it();break;case"c":case"C":this.#d.click();break}}#G(){if(!this.#t||!this.#b)return;let t=this.#t.muted;this.toggleAttribute("muted",t),this.#b.setAttribute("aria-pressed",String(t));let e=this.#t.volume;this.#l.value=String(e),this.#l.style.setProperty("--_vol",t?"0":String(e));let i;try{i=new Intl.NumberFormat(this.#A,{style:"percent"}).format(e)}catch{i=`${Math.round(e*100)}%`}this.#l.setAttribute("aria-valuetext",i)}#X(t){let e=Number.isFinite(t)&&t>0?Math.floor(t):0,i=Math.floor(e/3600),s=Math.floor(e%3600/60),n=e%60,o=this.#x??new Intl.NumberFormat("en",{useGrouping:!1});if(this.#S)try{let l=this.#S.formatToParts({hours:i,minutes:s,seconds:n}),c=!0;return l.map(h=>c&&h.type==="integer"?(c=!1,o.format(h.unit==="hour"?i:s)):h.value).join("")}catch{}let a=l=>o.format(l).padStart(2,o.format(0));return i>0?`${o.format(i)}:${a(s)}:${a(n)}`:`${o.format(s)}:${a(n)}`}#Y(t){this.#w&&(this.#w.textContent=t)}#V(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}};g("video-player",pe);var ts=`
935
+ `}#M(){let t=this.#t;this.listen(t,"timeupdate",()=>this.#q()),this.listen(t,"loadedmetadata",()=>{this.#Z(),this.#q()}),this.listen(t,"durationchange",()=>this.#Z()),this.listen(t,"progress",()=>this.#et()),this.listen(t,"volumechange",()=>this.#G()),this.listen(t,"play",()=>{this.#i=!0,this.#R("playing"),this.#r.setAttribute("aria-label",this.#C("pause")),this.#Y(this.#C("playing")),this.#V("video-player:play",{currentTime:t.currentTime,src:t.currentSrc})}),this.listen(t,"pause",()=>{this.#i=!1,t.ended||this.#R("paused"),this.#r.setAttribute("aria-label",this.#C("play")),this.#_(),this.#Y(this.#C("paused")),this.#V("video-player:pause",{currentTime:t.currentTime})}),this.listen(t,"ended",()=>{this.#i=!1,this.#R("ended"),this.#r.setAttribute("aria-label",this.#C("play")),this.#_();let e=this.#e?.querySelector("li[data-video-active]");e&&e.setAttribute("data-video-played",""),this.#e&&this.#H(),this.#Y(this.#C("ended")),this.#V("video-player:ended",{src:t.currentSrc})}),this.listen(t,"waiting",()=>{this.#i&&(this.#R("buffering"),this.#Y(this.#C("buffering")))}),this.listen(t,"playing",()=>{this.getAttribute("state")==="buffering"&&this.#R("playing")})}#R(t){this.setAttribute("state",t),this.#n&&(this.#n.inert=!(t==="idle"||t==="ended"))}#z(){let t=this.shadowRoot,e=()=>{this.#i?this.#t.pause():this.#t.play().catch(()=>{})};this.listen(this.#n,"click",s=>{s.stopPropagation(),this.#t.play().catch(()=>{})});let i=t.querySelector(".player");this.listen(i,"click",s=>{let n=s.target;n.closest(".controls")||n.closest(".play-overlay")||n!==this.#t&&n!==i||e()}),this.listen(this.#r,"click",e),this.listen(this.#a,"input",()=>{this.#t.duration&&(this.#t.currentTime=Number(this.#a.value)/100*this.#t.duration,this.#J())}),this.listen(this.#a,"keydown",s=>{let n=s;if(n.altKey||n.ctrlKey||n.metaKey)return;let o={ArrowLeft:-1,ArrowDown:-1,ArrowRight:1,ArrowUp:1}[n.key];o&&(n.preventDefault(),this.#F(o*sn))}),this.listen(t.querySelector(".skip-back-btn"),"click",()=>this.#F(-_t)),this.listen(t.querySelector(".skip-forward-btn"),"click",()=>this.#F(_t)),this.listen(this.#l,"input",()=>{this.#t.volume=Number(this.#l.value),this.#t.muted=!1,this.#G()}),this.listen(this.#b,"click",()=>{this.#t.muted=!this.#t.muted,this.#G()}),this.listen(this.#p,"click",()=>{this.#v=(this.#v+1)%de.length;let s=de[this.#v];this.#t.playbackRate=s,this.#N(),this.#V("video-player:speed",{rate:s})}),this.listen(this.#d,"click",()=>{let s=this.#tt();if(!s)return;let n=s.mode==="showing";s.mode=n?"hidden":"showing";let o=!n;this.toggleAttribute("captions",o),this.#d.setAttribute("aria-pressed",String(o)),this.#V("video-player:captions",{active:o,label:s.label})}),this.listen(this.#f,"click",()=>this.#it()),this.listen(this,"keydown",s=>this.#nt(s))}#D(t){for(let e of t.composedPath()){if(e===this)return!1;if(e instanceof Element&&e.matches(rn))return!0}return!1}#F(t){let e=this.#t.duration||0;this.#t.currentTime=Math.min(e,Math.max(0,this.#t.currentTime+t)),this.#_(),this.#q()}#B(){let t=this.shadowRoot?.querySelector(".player"),e=()=>{this.#_(),this.#O(Qi)};this.listen(t,"mousemove",e),this.listen(t,"mouseenter",e),this.listen(t,"mouseleave",()=>this.#O(500)),this.listen(t,"touchstart",()=>{this.hasAttribute("controls")?this.#j():e()},{passive:!0}),this.listen(this.#s,"mouseenter",()=>{this.#m!=null&&clearTimeout(this.#m),this.#_()}),this.listen(this.#s,"focusin",()=>{this.#m!=null&&clearTimeout(this.#m),this.#_()}),this.listen(this.#s,"focusout",()=>this.#O(Qi))}#O(t){this.#m!=null&&clearTimeout(this.#m),this.#m=null,this.#i&&(this.#m=setTimeout(()=>this.#j(),t))}#_(){this.setAttribute("controls","")}#j(){let t=this.shadowRoot?.activeElement;t&&this.#s?.contains(t)||this.removeAttribute("controls")}#K(){this.#e&&this.listen(this.#e,"click",t=>{let e=t.target.closest("a[href]");e&&(t.preventDefault(),this.#U(e.href,e.closest("li"),e))})}#U(t,e,i){this.#e.querySelectorAll("li").forEach(a=>a.removeAttribute("data-video-active")),e&&e.setAttribute("data-video-active",""),this.#t.src=t;let n=i?.getAttribute("data-poster");n&&(this.#t.poster=n);let o=i?.getAttribute("data-captions");this.#W(o),this.#t.play().catch(()=>{}),this.#V("video-player:track-change",{src:t,title:i?.textContent??""})}#W(t){if(this.#t.querySelectorAll("track[data-dynamic]").forEach(i=>i.remove()),t){let i=document.createElement("track");i.kind="captions",i.src=t,i.default=!0,i.setAttribute("data-dynamic",""),this.#t.appendChild(i),this.hasAttribute("captions")&&(i.track.mode="showing")}this.#L()}#H(){if(!this.#e)return;let t=[...this.#e.querySelectorAll("li")],e=t.findIndex(s=>s.hasAttribute("data-video-active"));if(this.hasAttribute("shuffle")){let s=t.filter((n,o)=>o!==e);if(s.length){let n=s[Math.floor(Math.random()*s.length)],o=n.querySelector("a[href]");o&&this.#U(o.href,n,o)}return}let i=e+1;if(i<t.length){let s=t[i].querySelector("a[href]");s&&this.#U(s.href,t[i],s)}else if(this.hasAttribute("loop")){let s=t[0]?.querySelector("a[href]");s&&this.#U(s.href,t[0],s)}}#q(){let t=this.#t.currentTime,e=this.#t.duration||0,i=e?t/e*100:0;this.#o.textContent=this.#X(t),this.#a.value=String(i),this.#J(),this.#c.style.width=`${i}%`}#J(){this.#a.setAttribute("aria-valuetext",this.#C("time-of",{current:this.#X(this.#t.currentTime),duration:this.#X(this.#t.duration||0)}))}#Z(){let t=this.#t.duration||0;this.#u.textContent=this.#X(t),this.#J()}#et(){let t=this.#t.buffered,e=this.#t.duration||0;if(t.length>0&&e){let i=t.end(t.length-1);this.#h.style.width=`${i/e*100}%`}}#Q(){let t=document.fullscreenElement;return!!t&&(t===this||t===this.#t)}#rt(t){t?this.setAttribute("data-fullscreen",""):this.removeAttribute("data-fullscreen")}#it(){this.#Q()?document.exitFullscreen().catch(()=>{}):this.requestFullscreen().catch(()=>{this.#t.requestFullscreen?.().catch(()=>{})})}#st(){let t=this.#tt();if(!t||!this.#d)return;let e=t.mode==="showing";this.toggleAttribute("captions",e),this.#d.setAttribute("aria-pressed",String(e))}#tt(){let t=this.#t.textTracks;for(let e=0;e<t.length;e++)if(t[e].kind==="captions"||t[e].kind==="subtitles")return t[e];return null}#nt(t){if(!(t.defaultPrevented||t.altKey||t.ctrlKey||t.metaKey)&&!this.#D(t))switch(t.key){case" ":case"k":case"K":t.preventDefault(),this.#i?this.#t.pause():this.#t.play().catch(()=>{});break;case"ArrowLeft":t.preventDefault(),this.#F(-_t);break;case"ArrowRight":t.preventDefault(),this.#F(_t);break;case"ArrowUp":t.preventDefault(),this.#t.volume=Math.min(1,this.#t.volume+.05),this.#G(),this.#_();break;case"ArrowDown":t.preventDefault(),this.#t.volume=Math.max(0,this.#t.volume-.05),this.#G(),this.#_();break;case"m":case"M":this.#t.muted=!this.#t.muted,this.#G();break;case"f":case"F":this.#it();break;case"c":case"C":this.#d.click();break}}#G(){if(!this.#t||!this.#b)return;let t=this.#t.muted;this.toggleAttribute("muted",t),this.#b.setAttribute("aria-pressed",String(t));let e=this.#t.volume;this.#l.value=String(e),this.#l.style.setProperty("--_vol",t?"0":String(e));let i;try{i=new Intl.NumberFormat(this.#A,{style:"percent"}).format(e)}catch{i=`${Math.round(e*100)}%`}this.#l.setAttribute("aria-valuetext",i)}#X(t){let e=Number.isFinite(t)&&t>0?Math.floor(t):0,i=Math.floor(e/3600),s=Math.floor(e%3600/60),n=e%60,o=this.#x??new Intl.NumberFormat("en",{useGrouping:!1});if(this.#S)try{let l=this.#S.formatToParts({hours:i,minutes:s,seconds:n}),c=!0;return l.map(h=>c&&h.type==="integer"?(c=!1,o.format(h.unit==="hour"?i:s)):h.value).join("")}catch{}let a=l=>o.format(l).padStart(2,o.format(0));return i>0?`${o.format(i)}:${a(s)}:${a(n)}`:`${o.format(s)}:${a(n)}`}#Y(t){this.#y&&(this.#y.textContent=t)}#V(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}};g("video-player",pe);var ts=`
936
936
  :host {
937
937
  display: block;
938
938
  position: relative;
@@ -1246,12 +1246,12 @@ var Kr=Object.defineProperty;var ae=(r,t)=>()=>(r&&(t=r(r=0)),t);var Hi=(r,t)=>{
1246
1246
  border: 1px solid ButtonText;
1247
1247
  }
1248
1248
  }
1249
- `,mt=null;function es(r){if("adoptedStyleSheets"in r&&typeof CSSStyleSheet=="function"&&"replaceSync"in CSSStyleSheet.prototype)return mt||(mt=new CSSStyleSheet,mt.replaceSync(ts)),r.adoptedStyleSheets.includes(mt)||(r.adoptedStyleSheets=[...r.adoptedStyleSheets,mt]),null;let t=document.createElement("style");return t.textContent=ts,t}fe();var ge="http://www.w3.org/2000/svg",an={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"},ln=0;function cn(){let r=document.createElement("div");r.setAttribute("part","marker"),r.setAttribute("aria-hidden","true");let t=document.createElementNS(ge,"svg");t.setAttribute("viewBox","0 0 24 36"),t.setAttribute("focusable","false");let e=document.createElementNS(ge,"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 i=document.createElementNS(ge,"circle");return i.setAttribute("class","dot"),i.setAttribute("cx","12"),i.setAttribute("cy","12"),i.setAttribute("r","5"),t.append(e,i),r.append(t),r}function S(r,t={},e){let i=document.createElement(r);for(let[s,n]of Object.entries(t))i.setAttribute(s,n);return e!=null&&(i.textContent=e),i}function ns(r){return!r||typeof r!="string"?!1:typeof CSS<"u"&&CSS.supports("color",r)}var be=class extends b{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;#e=null;#i=0;#s=!1;#r=!1;#n=!1;#a=!1;#c=!1;#h=`geo-map-${++ln}`;#l=null;#o="";#u=new Map;#p="";#d=null;#f=0;#k=null;#w=null;#m=()=>this.#I();#v=0;#y="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 ns(t)?t:""}get provider(){let t=this.getAttribute("provider");return t&&(t in U||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}#g(t,e={}){return(this.getAttribute(`data-label-${t}`)??an[t]??"").replace(/\{(\w+)\}/g,(s,n)=>n in e?String(e[n]):s)}get#b(){return this.interactive!=="none"&&!this.staticOnly}get#T(){return this.loading==="consent"&&!this.#r}#A(){let t=this.provider;if(t!=="carto-auto")return t;let e=this.closest("[data-mode]")?.getAttribute("data-mode");return e==="dark"?"carto-dark":e==="light"?"carto-light":window.matchMedia?.("(prefers-color-scheme: dark)").matches?"carto-dark":"carto-light"}#x(){if(this.tileUrl)try{return new URL(this.tileUrl.replace(/\{s\}/g,"a"),location.href).origin}catch{return""}return(U[this.#y]??U.osm).origin}#S(){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 a=this.#E(i);if(a)return a}let s=this.querySelector("address[data-lat][data-lng]");if(s){let a=parseFloat(s.dataset.lat??""),l=parseFloat(s.dataset.lng??"");if(!isNaN(a)&&!isNaN(l))return{lat:a,lng:l}}let n=this.getAttribute("place");if(n){let a=this.#L(n);if(a)return a}let o=document.querySelector('meta[name="geo.position"]');if(o){let l=(o.getAttribute("content")||"").split(";");if(l.length===2){let c=parseFloat(l[0]),h=parseFloat(l[1]);if(!isNaN(c)&&!isNaN(h))return{lat:c,lng:h}}}return null}#E(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),s=parseFloat(e.dataset.lng);if(!isNaN(i)&&!isNaN(s))return{lat:i,lng:s}}return e.tagName==="SCRIPT"&&e.type==="application/ld+json"?this.#C(e):null}#L(t){let e=document.querySelectorAll('script[type="application/ld+json"]');for(let i of e)try{let s=JSON.parse(i.textContent);if(s.name===t){let n=s.geo;if(n){let o=parseFloat(n.latitude),a=parseFloat(n.longitude);if(!isNaN(o)&&!isNaN(a))return{lat:o,lng:a}}}}catch{}return null}#C(t){try{let i=JSON.parse(t.textContent).geo;if(i){let s=parseFloat(i.latitude),n=parseFloat(i.longitude);if(!isNaN(s)&&!isNaN(n))return{lat:s,lng:n}}}catch{}return null}#$(){let t=n=>(n||"").replace(/\s+/g," ").trim(),e=t(this.getAttribute("label"));if(e)return e;let i=t(this.querySelector("address")?.textContent),s=this.getAttribute("src");if(!i&&s){let n=document.getElementById(s);if(n?.tagName==="ADDRESS")i=t(n.textContent);else if(n?.tagName==="SCRIPT")try{i=t(JSON.parse(n.textContent||"").name)}catch{}}return i||(i=t(this.getAttribute("place"))),i?this.#g("map-of",{name:i}):this.#g("map")}setup(){if(this.#i++,this.#y=this.#A(),this.render(),this.#P(),this.#N(),this.#z(),this.interactive==="eager"&&!this.#n&&this.#b&&!this.#T&&this.#l){let t=this.#i;requestAnimationFrame(()=>{t===this.#i&&this.#O({focus:!1})})}}attributeChangedCallback(t,e,i){e===i||this.#s||!this.isConnected||!this.hasAttribute("data-upgraded")||this._reinit()}teardown(){this.#i++,this.#e=null,this.#t&&(this.#t.destroy(),this.#t=null,this.setState("active",!1)),this.#d?.disconnect(),this.#d=null,cancelAnimationFrame(this.#f),this.#k?.disconnect(),this.#k=null,this.#w?.removeEventListener("change",this.#m),this.#w=null,clearTimeout(this.#v)}#P(){typeof ResizeObserver=="function"&&(this.#d=new ResizeObserver(()=>{cancelAnimationFrame(this.#f),this.#f=requestAnimationFrame(()=>this.#z())}),this.#d.observe(this))}#N(){this.provider!=="carto-auto"||this.tileUrl||(this.#k=new MutationObserver(()=>this.#I()),this.#k.observe(document.documentElement,{attributes:!0,attributeFilter:["data-mode"]}),this.#w=window.matchMedia?.("(prefers-color-scheme: dark)")??null,this.#w?.addEventListener("change",this.#m))}#I(){this.#A()!==this.#y&&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,i={...e};if(t.lat!=null&&!isNaN(Number(t.lat))&&(i.lat=Number(t.lat)),t.lng!=null&&!isNaN(Number(t.lng))&&(i.lng=Number(t.lng)),t.zoom!=null&&!isNaN(Number(t.zoom))&&(i.zoom=Number(t.zoom)),t.marker!=null&&(i.marker=!!t.marker),"markerColor"in t&&(ns(t.markerColor)?i.markerColor=t.markerColor:t.markerColor||(i.markerColor="")),!(i.lat===e.lat&&i.lng===e.lng&&i.zoom===e.zoom&&i.marker===e.marker&&i.markerColor===e.markerColor)){this.#s=!0;try{i.lat!==e.lat&&this.setAttribute("lat",String(i.lat)),i.lng!==e.lng&&this.setAttribute("lng",String(i.lng)),i.zoom!==e.zoom&&this.setAttribute("zoom",String(i.zoom)),i.marker!==e.marker&&this.setAttribute("marker",i.marker?"true":"false"),i.markerColor!==e.markerColor&&(i.markerColor?this.setAttribute("marker-color",i.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.#S();return t?[{lat:t.lat,lng:t.lng,color:this.markerColor}]:[]}render(){let t=this.shadowRoot,e=es(t);this.removeAttribute("data-ready"),this.#c=!1,this.#u=new Map,this.#p="",this.#l=this.#S(),this.#o=this.#$();let i=this.#l!==null,s=i&&this.#T,n=S("div",{part:"container"}),o=S("div",{part:"viewport",role:"img","aria-label":this.#o});if(o.append(S("div",{part:"tiles"})),this.showMarker&&i){let h=cn();this.markerColor&&h.style.setProperty("--_marker-color",this.markerColor),o.append(h)}if(n.append(o),s){n.setAttribute("data-consent","");let h=S("div",{part:"overlay"}),u=S("button",{part:"activate",type:"button"},this.#g("consent")),p=this.#x().replace(/^https?:\/\//,""),d=S("p",{part:"consent-note"},this.#g("consent-note",{host:p}));h.append(u,d),h.addEventListener("click",()=>this.#F());let f=()=>this.#B();h.addEventListener("pointerenter",f,{once:!0}),u.addEventListener("focus",f,{once:!0}),n.append(h)}else if(i&&this.#b){let h=S("div",{part:"overlay"});h.append(S("button",{part:"activate",type:"button"},this.#g("activate"))),h.addEventListener("click",()=>this.#O({focus:!0})),n.append(h)}if(i&&this.#b){let h=S("div",{part:"controls",role:"group","aria-label":this.#g("controls")}),u=[["zoom-in","+",this.#g("zoom-in"),()=>this.#t?.zoomBy(1)],["zoom-out","\u2212",this.#g("zoom-out"),()=>this.#t?.zoomBy(-1)],["recenter","\u2316",this.#g("recenter"),()=>this.#t?.recenter()],["exit","\u2715",this.#g("exit"),()=>this.#j()]];for(let[p,d,f,m]of u){let y=S("button",{part:`control ${p}`,type:"button","aria-label":f,title:f},d);y.addEventListener("click",m),h.append(y)}n.append(h)}let a=S("div",{part:"caption"}),l=S("slot");a.append(l),n.append(a);let c=()=>{let h=l.assignedNodes().some(u=>u.nodeType===1||(u.textContent||"").trim());n.toggleAttribute("data-caption",h)};l.addEventListener("slotchange",c),n.toggleAttribute("data-caption",[...this.childNodes].some(h=>h.nodeType===1&&!h.hasAttribute("slot")||h.nodeType===3&&(h.textContent||"").trim())),n.append(this.#M()),n.append(S("p",{part:"instructions",id:`${this.#h}-help`,hidden:""},this.#g("instructions"))),n.append(S("p",{part:"status",role:"status","aria-live":"polite"})),t.replaceChildren(...e?[e]:[],n),i||this.handleError("Missing or invalid lat/lng coordinates",this.#g("error-coords"))}#M(){let t=S("div",{part:"attribution"}),e=S("slot",{name:"attribution"}),i;if(this.tileUrl){let n=(this.getAttribute("attribution")||"").trim(),o=this.getAttribute("attribution-href")||"";i=n?[{text:n,href:o}]:[]}else i=(U[this.#y]??U.osm).credits;i.forEach((n,o)=>{o&&e.append(document.createTextNode(" "));let a="";if(n.href)try{let l=new URL(n.href,location.href);(l.protocol==="https:"||l.protocol==="http:")&&(a=l.href)}catch{}e.append(a?S("a",{href:a,target:"_blank",rel:"noopener noreferrer"},n.text):S("span",{},n.text))});let s=()=>{t.hidden=i.length===0&&e.assignedNodes().length===0};return e.addEventListener("slotchange",s),t.hidden=i.length===0&&!this.querySelector(':scope > [slot="attribution"]'),t.append(e),t}#R(){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"]')}}#z(){let t=this.clientWidth,e=this.clientHeight;if(this.#t){this.#t.resize(t,e);return}if(!this.#l||this.#T||!t||!e)return;let i=`${t}x${e}`;i!==this.#p&&(this.#p=i,this.loadTiles(t,e))}loadTiles(t=this.clientWidth,e=this.clientHeight){let{tiles:i}=this.#R();if(!i||!this.#l||!t||!e)return;let s=this.zoom,{lat:n,lng:o}=this.#l,a=st(n,o,s),l=Math.pow(2,s),c=a.x-t/2,h=a.y-e/2,u=Math.floor(c/256),p=Math.floor((c+t-1)/256),d=Math.max(0,Math.floor(h/256)),f=Math.min(l-1,Math.floor((h+e-1)/256));i.style.transform=`translate(${Math.round(u*256-c)}px, ${Math.round(d*256-h)}px)`;let m=new Set;for(let y=d;y<=f;y++)for(let w=u;w<=p;w++){let k=`${w}/${y}`;m.add(k);let A=this.#u.get(k);if(!A){let T=(w%l+l)%l;A=document.createElement("img"),A.alt="",A.loading=this.loading==="eager"?"eager":"lazy",A.decoding="async",A.draggable=!1,A.addEventListener("load",()=>this.#D()),A.addEventListener("error",()=>this.#D()),A.src=Nt(this.#y,s,T,y,this.tileUrl),this.#u.set(k,A),i.append(A)}A.style.left=`${(w-u)*256}px`,A.style.top=`${(y-d)*256}px`}for(let[y,w]of this.#u)m.has(y)||(w.remove(),this.#u.delete(y));this.#D()}#D(){if(this.#c||this.#t||!this.#l||this.#u.size===0)return;let t=[...this.#u.values()];if(t.every(e=>e.complete)){if(this.#c=!0,t.every(e=>e.naturalWidth===0)){this.handleError("Failed to load map tiles",this.#g("error-tiles"));return}this.setAttribute("data-ready",""),this.dispatchEvent(new CustomEvent("geo-map:ready",{bubbles:!0,detail:{lat:this.#l.lat,lng:this.#l.lng,zoom:this.zoom}}))}}#F(){this.#r=!0,this._reinit(),this.#b&&this.#O({focus:!0})}#B(){if(this.#a)return;this.#a=!0;let t=this.#x();if(!t||t===location.origin||document.head.querySelector(`link[rel~="preconnect" i][href="${CSS.escape(t)}"]`))return;let e=document.createElement("link");e.rel="preconnect",e.href=t,document.head.appendChild(e)}#O({focus:t=!0}={}){if(this.#t)return Promise.resolve();if(this.#e)return this.#e;if(!this.#l||!this.#b||this.#T)return Promise.resolve();let e=this.#i,i=(async()=>{let{MapInteraction:s}=await Promise.resolve().then(()=>(rs(),ss));if(!this.isConnected||e!==this.#i||this.#t||!this.#l)return;let{container:n,viewport:o,tiles:a,marker:l}=this.#R();if(!n||!o||!a)return;for(let u of this.#u.values())u.remove();this.#u.clear(),n.setAttribute("data-active",""),o.setAttribute("role","region"),o.setAttribute("aria-roledescription","map"),o.setAttribute("aria-describedby",`${this.#h}-help`),o.setAttribute("tabindex","0"),this.setState("active",!0);let{lat:c,lng:h}=this.#l;this.#t=new s({host:this,viewport:o,tiles:a,marker:l,lat:c,lng:h,zoom:this.zoom,provider:this.#y,tileUrl:this.tileUrl,width:this.clientWidth,height:this.clientHeight,onDeactivate:()=>this.#j(),onMove:u=>this.#_(u)}),t&&o.focus({preventScroll:!0}),this.dispatchEvent(new CustomEvent("geo-map:activate",{bubbles:!0,detail:{lat:c,lng:h,zoom:this.zoom}}))})();return this.#e=i,i.finally(()=>{this.#e===i&&(this.#e=null)}),i}#_(t){clearTimeout(this.#v),this.#v=window.setTimeout(()=>{let{status:e}=this.#R();e&&(e.textContent=this.#g("moved",{lat:t.lat.toFixed(4),lng:t.lng.toFixed(4),zoom:t.zoom}))},400)}#j(){if(!this.#t)return;let t=!!this.shadowRoot?.activeElement;this.#n=!0,this._reinit(),t&&this.shadowRoot?.querySelector('[part="activate"]')?.focus()}handleError(t,e=t){let{container:i}=this.#R();i&&(i.setAttribute("data-state","error"),i.setAttribute("data-error",e)),this.dispatchEvent(new CustomEvent("geo-map:error",{bubbles:!0,detail:{message:t}}))}};g("geo-map",be);var os="popover"in HTMLElement.prototype;var us=null;function vn(){return us??=Promise.resolve().then(()=>(ye(),ve)),us}var yn=150,ds="vb-emoji-recent",rt=8,ps=4,wn=0,kn={Trigger:"Open emoji picker",Dialog:"Emoji picker",Search:"Search emoji",Placeholder:"Search emoji\u2026",Categories:"Emoji categories",Emoji:"Emoji",Recent:"Recently used",Empty:"No emoji found",Results:"{count} emoji found"},we=class extends b{#t=null;#e;#i;#s;#r;#n;#a;#c;#h=new Map;#l=new WeakMap;#o=null;#u=!1;#p=!1;#d=!1;#f=!1;#k=-1;#w=0;#m=null;#v;#y=()=>{};#g=null;#b="";#T=null;#A=null;#x=new Set;#S=!1;#E=null;#L=null;constructor(){super(),this.#v=new Promise(t=>{this.#y=t})}get ready(){return this.#v}get isOpen(){return this.#u}setup(){if(this.#d)return!1;this.#d=!0,this.#P(),this.listen(this,"click",this.#rt),this.listen(this,"keydown",this.#nt),this.listen(this,"focusout",this.#st),this.listen(this,"focusin",this.#tt);let t=++this.#w;return vn().then(e=>{if(t!==this.#w||!this.isConnected)return;this.#T=e,this.#p||this.#N(),this.listen(document,"click",this.#it),this.listen(document,e.EXTENDED_EVENT,this.#X),this.setAttribute("data-upgraded",""),this.#y(),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent("emoji-picker:upgraded",{bubbles:!0}))});let i=this.#m;this.#m=null,i==="open"&&this.open()}).catch(e=>{console.error("[emoji-picker] failed to load emoji data",e)}),!1}teardown(){this.#w++,this.#d=!1,this.#m=null,this.#g&&(clearTimeout(this.#g),this.#g=null,this.setState("search-pending",!1)),this.#u&&this.close()}#C(t,e){return this.dataset[`label${t}`]||e||kn[t]||""}#$(t){if(t==="recent")return this.#C("Recent");let e=t.charAt(0).toUpperCase()+t.slice(1);return this.#C(e,this.#T.EMOJI_GROUP_LABELS[t]||t)}#P(){let t=this.querySelector(":scope > [data-trigger]")||this.querySelector(":scope > button");t||(t=document.createElement("button"),t.type="button",t.textContent="\u{1F600}",t.setAttribute("data-trigger",""),this.prepend(t)),this.#t=t,t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-expanded",String(this.#u)),!t.hasAttribute("aria-label")&&!/\p{L}/u.test(t.textContent||"")&&t.setAttribute("aria-label",this.#C("Trigger"))}#N(){let t=`emoji-picker-${++wn}`;this.#e=document.createElement("div"),this.#e.className="picker",this.#e.id=`${t}-panel`,this.#e.setAttribute("role","dialog"),this.#e.setAttribute("aria-label",this.#C("Dialog")),this.#e.hidden=!0,this.#S=os,this.#S&&this.#e.setAttribute("popover","manual"),this.#t?.setAttribute("aria-controls",this.#e.id),this.#i=document.createElement("input"),this.#i.type="search",this.#i.placeholder=this.#C("Placeholder"),this.#i.autocomplete="off",this.#i.spellcheck=!1,this.#i.setAttribute("aria-label",this.#C("Search")),this.#i.setAttribute("aria-controls",`${t}-listbox`),this.#i.addEventListener("input",this.#G),this.#s=document.createElement("div"),this.#s.className="categories",this.#s.setAttribute("role","toolbar"),this.#s.setAttribute("aria-label",this.#C("Categories")),this.#T.EMOJI_GROUPS.forEach((e,i)=>{let s=document.createElement("button");s.type="button",s.dataset.group=e,s.tabIndex=i===0?0:-1,s.setAttribute("aria-label",this.#$(e)),s.title=this.#$(e),s.textContent=this.#T.EMOJI_GROUP_ICONS[e],this.#s.appendChild(s)}),this.#r=document.createElement("div"),this.#r.className="grid",this.#r.id=`${t}-listbox`,this.#r.setAttribute("role","listbox"),this.#r.setAttribute("aria-label",this.#C("Emoji")),this.#c=this.#I("recent"),this.#r.appendChild(this.#c);for(let e of this.#T.EMOJI_GROUPS){let i=this.#I(e);this.#h.set(e,i),this.#r.appendChild(i)}this.#n=document.createElement("p"),this.#n.className="no-results",this.#n.textContent=this.#C("Empty"),this.#n.hidden=!0,this.#a=document.createElement("p"),this.#a.className="status",this.#a.setAttribute("role","status"),this.#e.append(this.#i,this.#s,this.#r,this.#n,this.#a),this.appendChild(this.#e),this.#z(),this.#p=!0}#I(t){let e=document.createElement("div");return e.className="group",e.dataset.group=t,e.setAttribute("role","group"),e.setAttribute("aria-label",this.#$(t)),e}#M(t){let e=document.createElement("span");return e.className="group-label",e.setAttribute("aria-hidden","true"),e.textContent=this.#$(t),e}#R(t){let e=document.createElement("button");return e.type="button",e.setAttribute("role","option"),e.tabIndex=-1,e.dataset.shortcode=t.shortcode,e.setAttribute("aria-label",t.name),e.title=`:${t.shortcode}:`,e.textContent=t.emoji,e}#z(){let t=new Map;for(let e of this.#T.EMOJI_GROUPS){let i=this.#h.get(e),s=[this.#M(e)];for(let n of this.#T.getByGroup(e)){let o=t.get(n.emoji);if(o){o.aliases.push(n.shortcode);continue}let a=this.#R(n),l={entry:n,aliases:[]};t.set(n.emoji,l),this.#l.set(a,l),s.push(a)}i.replaceChildren(...s)}this.#k=this.#T.extendedCount(),this.#o=null}#D(){let t=[];for(let e of this.#ct()){let i=this.#T.resolveEmoji(e);if(!i)continue;let s=this.#R(i);this.#l.set(s,{entry:i,aliases:[]}),t.push(s)}t.length&&t.unshift(this.#M("recent")),this.#c.replaceChildren(...t),this.#o=null}#F(t,e){let{entry:i,aliases:s}=t;return i.shortcode.includes(e)||i.name.toLowerCase().includes(e)||(i.keywords?.some(n=>n.includes(e))??!1)||s.some(n=>n.includes(e))}#B(){let t=this.#b.toLowerCase(),e=0;this.#c.hidden=!!t||this.#c.childElementCount===0;for(let i of this.#h.values()){let s=!1;for(let n of i.querySelectorAll('[role="option"]')){let o=this.#l.get(n),a=!t||(o?this.#F(o,t):!1);n.hidden=!a,a&&(s=!0,e++)}i.hidden=!s}this.#n.hidden=e>0,this.#a.textContent=t?e>0?this.#C("Results").replace("{count}",String(e)):this.#C("Empty"):"",(!this.#o||!this.#O(this.#o))&&this.#j(this.#_()[0]??null,!1)}#O(t){return t.isConnected&&!t.hidden&&!t.parentElement.hidden}#_(){return[...this.#r.querySelectorAll('[role="option"]')].filter(t=>this.#O(t))}#j(t,e){this.#o&&this.#o!==t&&(this.#o.tabIndex=-1),this.#o=t,t&&(t.tabIndex=0,e&&(t.focus({preventScroll:!0}),t.scrollIntoView({block:"nearest"})))}#K(t,e){if(t){for(let i of this.#s.querySelectorAll("button"))i.tabIndex=i===t?0:-1;e&&t.focus()}}#U(t){let e;for(let i of this.#s.querySelectorAll("button"))i.dataset.group===t?(i.setAttribute("aria-current","true"),e=i):i.removeAttribute("aria-current");e&&!this.#s.contains(document.activeElement)&&this.#K(e,!1)}#W(){if(this.#A?.disconnect(),this.#x.clear(),!(typeof IntersectionObserver>"u")){this.#A=new IntersectionObserver(t=>{for(let i of t)i.isIntersecting?this.#x.add(i.target):this.#x.delete(i.target);let e=[...this.#r.children].find(i=>this.#x.has(i));this.#U(e?.dataset.group)},{root:this.#r,rootMargin:"-2px 0px -75% 0px"});for(let t of this.#r.children)this.#A.observe(t)}}#H(){return getComputedStyle(this).direction==="rtl"}#q(t,e,i){let s=t[e].getBoundingClientRect(),n=s.left+s.width/2,o=null,a=null,l=1/0;for(let c=e+i;c>=0&&c<t.length;c+=i){let h=t[c].getBoundingClientRect();if(o===null){if(Math.abs(h.top-s.top)<=ps)continue;o=h.top}else if(Math.abs(h.top-o)>ps)break;let u=Math.abs(h.left+h.width/2-n);u<l&&(l=u,a=t[c])}return a}#J(t,e){let i=this.#_(),s=i.indexOf(t);if(s<0)return!1;let n=this.#H(),o=null;switch(e){case"ArrowRight":o=i[n?s-1:s+1];break;case"ArrowLeft":o=i[n?s+1:s-1];break;case"ArrowDown":o=this.#q(i,s,1);break;case"ArrowUp":if(o=this.#q(i,s,-1),!o)return this.#i.focus(),!0;break;case"Home":o=i[0];break;case"End":o=i[i.length-1];break;case"PageDown":{o=i.slice(s+1).find(l=>l.parentElement!==t.parentElement)??i[i.length-1];break}case"PageUp":{let a=i.find(l=>l.parentElement===t.parentElement);if(a&&a!==t)o=a;else{let l=i[s-1]?.parentElement;o=l?i.find(c=>c.parentElement===l):i[0]}break}default:return!1}return o&&this.#j(o,!0),!0}#Z(t,e){let i=[...this.#s.querySelectorAll("button")],s=i.indexOf(t),n=this.#H(),o=-1;if(e==="ArrowRight")o=n?s-1:s+1;else if(e==="ArrowLeft")o=n?s+1:s-1;else if(e==="Home")o=0;else if(e==="End")o=i.length-1;else return!1;return o=(o+i.length)%i.length,this.#K(i[o],!0),!0}#et(){let t=this.getAttribute("for");return t?document.getElementById(t):null}#Q(){let t=this.#et();if(this.#E=null,this.#L=null,!!t){if(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement){let e=null,i=null;try{e=t.selectionStart,i=t.selectionEnd}catch{}e!==null&&i!==null&&(this.#E={start:e,end:i})}else if(t.isContentEditable){let e=window.getSelection();if(e&&e.rangeCount>0){let i=e.getRangeAt(0);t.contains(i.commonAncestorContainer)&&(this.#L=i.cloneRange())}}}}#rt=t=>{let e=t.target.closest?.("button");if(!(!e||!this.contains(e))){if(e===this.#t){this.toggle();return}this.#p&&(e.parentElement===this.#s?this.#Y(e):e.getAttribute("role")==="option"&&this.#V(e))}};#it=t=>{this.#u&&!this.contains(t.target)&&this.close()};#st=t=>{if(!this.#u||this.#f)return;let e=t.relatedTarget;e&&!this.contains(e)&&this.close()};#tt=t=>{let e=t.target;e.getAttribute?.("role")==="option"&&e!==this.#o&&this.#j(e,!1)};#nt=t=>{if(!this.#u)return;if(t.key==="Escape"){t.preventDefault(),t.stopPropagation(),this.close(),this.#t?.focus();return}let e=t.target;if(t.altKey||t.metaKey)return;let i=!1;if(e===this.#i){if(t.key==="ArrowDown"){let s=this.#o&&this.#O(this.#o)?this.#o:this.#_()[0];s&&this.#j(s,!0),i=!0}}else e.parentElement===this.#s?i=this.#Z(e,t.key):e.getAttribute("role")==="option"&&(i=this.#J(e,t.key));i&&t.preventDefault()};#G=()=>{this.#g&&clearTimeout(this.#g),this.setState("search-pending",!0),this.#g=setTimeout(()=>{this.#g=null,this.setState("search-pending",!1),this.#b=this.#i.value.trim(),this.#B(),this.#r.scrollTop=0},yn)};#X=()=>{this.#u&&(this.#z(),this.#B(),this.#W())};#Y(t){let e=t.dataset.group||"";this.#b&&(this.#g&&(clearTimeout(this.#g),this.#g=null),this.setState("search-pending",!1),this.#i.value="",this.#b="",this.#B()),this.#K(t,!1),this.#U(e);let i=this.#h.get(e);if(!i)return;let s=matchMedia("(prefers-reduced-motion: reduce)").matches;this.#r.scrollTo({top:i.offsetTop,behavior:s?"auto":"smooth"});let n=i.querySelector('[role="option"]:not([hidden])');n&&this.#j(n,!1)}#V(t){let e=this.#l.get(t);if(!e)return;let{entry:i}=e;this.#j(t,!1),this.#f=!0;try{this.#ut(i.shortcode);let s=this.#at(i.emoji);this.dispatchEvent(new CustomEvent("emoji-picker:select",{bubbles:!0,detail:{shortcode:i.shortcode,emoji:i.emoji,name:i.name,keywords:i.keywords}})),this.close(),s||this.#t?.focus()}finally{this.#f=!1}}#at(t){let e=this.#et();if(!e)return!1;if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){e.focus();let i=this.#E;if(i)try{e.setSelectionRange(i.start,i.end)}catch{}if(!this.#lt(t)){let s=e.value.length;try{e.setRangeText(t,i?.start??s,i?.end??s,"end")}catch{e.value+=t}e.dispatchEvent(new InputEvent("input",{bubbles:!0,inputType:"insertText",data:t}))}try{let s=e.selectionEnd;this.#E=s===null?null:{start:s,end:s}}catch{this.#E=null}return!0}if(e.isContentEditable){e.focus();let i=window.getSelection();if(!i)return!0;let s=this.#L;if((!s||!e.contains(s.commonAncestorContainer))&&(s=document.createRange(),s.selectNodeContents(e),s.collapse(!1)),i.removeAllRanges(),i.addRange(s),!this.#lt(t)){let n=i.getRangeAt(0);n.deleteContents();let o=document.createTextNode(t);n.insertNode(o),n.setStartAfter(o),n.collapse(!0),i.removeAllRanges(),i.addRange(n),e.dispatchEvent(new InputEvent("input",{bubbles:!0,inputType:"insertText",data:t}))}return this.#L=i.rangeCount?i.getRangeAt(0).cloneRange():null,!0}return!1}#lt(t){try{return document.execCommand("insertText",!1,t)}catch{return!1}}#ct(){try{let t=JSON.parse(localStorage.getItem(ds)||"[]");return Array.isArray(t)?t:[]}catch{return[]}}#ut(t){let e=parseInt(this.getAttribute("recent-limit")??"24",10)||24,i=this.#ct();i=i.filter(s=>s!==t),i.unshift(t),i.length>e&&(i.length=e);try{localStorage.setItem(ds,JSON.stringify(i))}catch{}}#ht(){if(!this.#S||!this.#u||!this.#t)return;let t=this.#t.getBoundingClientRect(),e=this.#e.offsetWidth,i=this.#e.offsetHeight,s=document.documentElement.clientWidth,n=document.documentElement.clientHeight,o=this.#H()?t.right-e:t.left;o=Math.max(rt,Math.min(o,s-e-rt));let a=t.bottom+4;a+i>n-rt&&t.top-i-4>=rt&&(a=t.top-i-4),a=Math.max(rt,Math.min(a,n-i-rt)),this.#e.style.setProperty("--picker-top",`${Math.round(a)}px`),this.#e.style.setProperty("--picker-left",`${Math.round(o)}px`)}#ot=t=>{t.type==="scroll"&&this.#e.contains(t.target)||this.#ht()};open(){if(!this.#p){this.#m="open";return}if(!(this.#u||!this.isConnected)){if(this.#Q(),this.#T.extendedCount()!==this.#k&&this.#z(),this.#D(),this.#i.value="",this.#b="",this.#B(),this.#u=!0,this.setAttribute("open",""),this.#t?.setAttribute("aria-expanded","true"),this.#e.hidden=!1,this.#S){try{this.#e.showPopover()}catch{}this.#ht(),window.addEventListener("scroll",this.#ot,{capture:!0,passive:!0}),window.addEventListener("resize",this.#ot,{passive:!0})}this.#r.scrollTop=0,this.#W(),this.#i.focus(),this.dispatchEvent(new CustomEvent("emoji-picker:open",{bubbles:!0}))}}close(){if(!this.#p){this.#m=null;return}if(this.#u){if(this.#u=!1,this.removeAttribute("open"),this.#t?.setAttribute("aria-expanded","false"),this.#S){try{this.#e.hidePopover()}catch{}window.removeEventListener("scroll",this.#ot,{capture:!0}),window.removeEventListener("resize",this.#ot)}this.#e.hidden=!0,this.#A?.disconnect(),this.#A=null,this.dispatchEvent(new CustomEvent("emoji-picker:close",{bubbles:!0}))}}toggle(){if(!this.#p){this.#m=this.#m==="open"?null:"open";return}this.#u?this.close():this.open()}};g("emoji-picker",we);var nt="data-drag-surface-controls",An="data-drag-surface-live",ke=class r extends b{static observedAttributes=["disabled","data-move-controls","orientation","group","aria-label"];#t=null;#e=null;#i=null;#s=null;#r=null;setup(){this.setAttribute("role","list"),r.#H.add(this),this.#h(),this.#o(),this.#v(),this.listen(this,"click",this.#$.bind(this)),this.#n(),this.#c(),this.#r=new MutationObserver(()=>this.#a()),this.#r.observe(this,{childList:!0}),r.#E()}teardown(){this.#r?.disconnect(),this.#r=null,this.#t&&(this.#t.remove(),this.#t=null),this.#e&&this.#S(this.#e,!1),this.#e=null,this.#i=null,this.removeAttribute("data-reorder-mode"),this.removeAttribute("data-drag-over"),this.#W(),this.#L(),r.#H.delete(this),r.#q?.source===this&&(r.#q=null),r.#E()}attributeChangedCallback(t,e,i){e===i||!this.hasAttribute("data-upgraded")||(t==="disabled"&&this.#c(),r.#E())}get draggableChildren(){return[...this.querySelectorAll(':scope > [draggable="true"]')]}get group(){return this.getAttribute("group")||null}get orientation(){return this.getAttribute("orientation")==="horizontal"?"horizontal":"vertical"}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",!!t)}get sortedOrder(){return this.draggableChildren.map(t=>t.dataset.id)}#n(){for(let t of this.draggableChildren)t.getAttribute("role")||t.setAttribute("role","listitem"),t.hasAttribute("tabindex")||t.setAttribute("tabindex","0")}#a(){this.#n(),this.#e&&this.#e.parentElement!==this&&(this.#S(this.#e,!1),this.#e=null,this.#i=null,this.removeAttribute("data-reorder-mode")),r.#E()}#c(){this.disabled?(this.setAttribute("aria-disabled","true"),this.#e&&this.#x()):this.removeAttribute("aria-disabled")}#h(){let t=document.createElement("span");t.setAttribute(An,""),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),this.after(t),this.#t=t}#l(t){let e=this.#t;e&&(e.textContent="",requestAnimationFrame(()=>{e.textContent=t}))}#o(){this.listen(this,"pointerdown",t=>{this.#s=t.target}),this.listen(this,"dragstart",this.#u.bind(this)),this.listen(this,"dragover",this.#d.bind(this)),this.listen(this,"dragleave",this.#f.bind(this)),this.listen(this,"drop",this.#k.bind(this)),this.listen(this,"dragend",this.#w.bind(this))}#u(t){let e=t.target.closest('[draggable="true"]');if(!e||e.parentElement!==this)return;if(this.disabled){t.preventDefault();return}let i=e.querySelector("[data-drag-handle]");if(i&&!i.contains(this.#s)){t.preventDefault();return}e.setAttribute("data-dragging",""),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e.dataset.id||""),t.dataTransfer.setData("application/x-drag-surface-group",this.group||"");let s=this.#B(e);r.#q={item:e,source:this,originalIndex:s},this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}#p(t){return this.disabled?!1:this.group||t.group?this.group===t.group:t===this}#d(t){let e=r.#q;!e||!this.#p(e.source)||(t.preventDefault(),t.dataTransfer.dropEffect="move",this.setAttribute("data-drag-over",""),this.#U(t.clientX,t.clientY))}#f(t){t.relatedTarget&&!this.contains(t.relatedTarget)&&(this.removeAttribute("data-drag-over"),this.#W())}#k(t){let e=r.#q;if(!e||!this.#p(e.source))return;t.preventDefault();let{item:i,source:s,originalIndex:n}=e,o=this.#K(t.clientX,t.clientY);r.#m(),s===this?(this.#O(i,o),this.#_(),this.#M(i),this.#N(i,n)):(this.#O(i,o),this.#_(),s.#_(),this.#M(i),this.#I(i,s))}#w(){let t=r.#q;r.#m(),r.#q=null,(t?.source??this).dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0}))}static#m(){r.#q?.item.removeAttribute("data-dragging");for(let t of r.#H)t.removeAttribute("data-drag-over"),t.#W()}#v(){this.listen(this,"keydown",this.#g.bind(this)),this.listen(this,"focusout",this.#b.bind(this))}#y(t){let e=t.closest('[draggable="true"]');if(!e||e.parentElement!==this)return null;if(t===e)return e;let i=e.querySelector("[data-drag-handle]");return i&&i===t?e:null}#g(t){let e=this.#y(t.target);if(!e||this.disabled||t.altKey||t.ctrlKey||t.metaKey)return;let i=t.target,s=this.#e===e,n=this.orientation==="horizontal",o=this.#z(),a=n?o?"ArrowRight":"ArrowLeft":"ArrowUp",l=n?o?"ArrowLeft":"ArrowRight":"ArrowDown";if(t.key===" "||t.key==="Enter"){t.preventDefault(),s?this.#A(e):this.#T(e);return}if(t.key===a||t.key===l){t.preventDefault();let u=this.draggableChildren,p=u.indexOf(e),d=t.key===a?Math.max(0,p-1):Math.min(u.length-1,p+1);if(d===p)return;if(!s){u[d].focus();return}this.#O(e,d),i.focus(),this.#l(`Position ${d+1} of ${u.length}`);return}let c=n?"ArrowUp":"ArrowLeft",h=n?"ArrowDown":"ArrowRight";if(s&&(t.key===c||t.key===h)){t.preventDefault();let u=this.#R(t.key===h?1:-1);if(!u)return;this.#e=null,this.#i=null,this.removeAttribute("data-reorder-mode"),this.#P(u,e),i.focus(),u.#e=e,u.#i=u.#B(e),u.setAttribute("data-reorder-mode",""),u.#l(`Moved to ${u.#D()}`);return}t.key==="Escape"&&(t.preventDefault(),s?this.#x():e.blur())}#b(){setTimeout(()=>{let t=this.#e;t&&!t.contains(document.activeElement)&&this.#x()},0)}#T(t){this.#e&&this.#e!==t&&this.#x(),this.#i=this.#B(t),this.#e=t,this.#S(t,!0),this.setAttribute("data-reorder-mode","");let e=this.draggableChildren.length;this.#l(`${this.#F(t)}, grabbed. Position ${this.#i+1} of ${e}. Use arrow keys to move, Enter to drop, Escape to cancel.`),this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}#A(t){let e=this.#i;this.#e=null,this.#i=null,this.#S(t,!1),this.removeAttribute("data-reorder-mode"),this.#_(),this.#M(t);let i=this.#B(t);this.#l(`${this.#F(t)}, dropped at position ${i+1} of ${this.draggableChildren.length}`),this.#N(t,e),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0}))}#x(){let t=this.#e;if(!t)return;let e=this.#i;if(this.#e=null,this.#i=null,this.#S(t,!1),this.removeAttribute("data-reorder-mode"),e!=null&&t.parentElement===this&&this.#B(t)!==e){let i=t.contains(document.activeElement)?document.activeElement:null;this.#O(t,e),i?.focus()}this.#l("Reorder cancelled"),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0}))}#S(t,e){t.toggleAttribute("data-grabbed",e);let i=t.querySelector("[data-drag-handle]");i&&(i.localName==="button"||i.getAttribute("role")==="button")&&i.setAttribute("aria-pressed",String(e)),e?t.hasAttribute("aria-description")||(t.setAttribute("aria-description","Grabbed"),t.setAttribute("data-drag-surface-description","")):t.hasAttribute("data-drag-surface-description")&&(t.removeAttribute("aria-description"),t.removeAttribute("data-drag-surface-description"))}static#E(){for(let t of r.#H)t.#C()}#L(){for(let t of this.querySelectorAll(`:scope > [draggable="true"] > [${nt}]`))t.remove()}#C(){if(!this.isConnected)return;if(!this.hasAttribute("data-move-controls")){this.#L();return}let t=this.draggableChildren,e=this.orientation==="horizontal",i=this.#z(),s=this.disabled,n=this.#R(-1),o=this.#R(1),a=e?i?"right":"left":"up",l=e?i?"left":"right":"down",c={up:"\u2191",down:"\u2193",left:"\u2190",right:"\u2192"},h=e?c.up:c.left,u=e?c.down:c.right;t.forEach((p,d)=>{let f=p.querySelector(`:scope > [${nt}]`);if(!f){f=document.createElement("span"),f.setAttribute(nt,"");for(let w of["prev","next","to-prev","to-next"]){let k=document.createElement("button");k.type="button",k.className="ghost small",k.dataset.move=w,f.append(k)}p.append(f)}let m=this.#F(p),y=(w,k,A,T,j=!1)=>{let R=f.querySelector(`[data-move="${w}"]`);R.textContent!==k&&(R.textContent=k),R.setAttribute("aria-label",A),R.setAttribute("aria-disabled",String(T)),R.hidden=j};y("prev",c[a],`Move ${m} ${a}`,s||d===0),y("next",c[l],`Move ${m} ${l}`,s||d===t.length-1),y("to-prev",h,n?`Move ${m} to ${n.#D()}`:"",s,!n),y("to-next",u,o?`Move ${m} to ${o.#D()}`:"",s,!o)})}#$(t){let e=t.target.closest(`[${nt}] > button[data-move]`);if(!e)return;let i=e.closest('[draggable="true"]');if(!i||i.parentElement!==this||(t.preventDefault(),this.disabled||e.getAttribute("aria-disabled")==="true"))return;this.#e&&(this.#S(this.#e,!1),this.#e=null,this.#i=null,this.removeAttribute("data-reorder-mode"));let s=e.dataset.move,n=this;if(s==="prev"||s==="next"){let a=this.#B(i),l=a+(s==="prev"?-1:1);if(l<0||l>=this.draggableChildren.length)return;this.#O(i,l),this.#_(),this.#M(i),this.#l(`${this.#F(i)}, moved to position ${l+1} of ${this.draggableChildren.length}`),this.#N(i,a)}else{let a=this.#R(s==="to-next"?1:-1);if(!a)return;this.#P(a,i),a.#l(`${a.#F(i)}, moved to ${a.#D()}`),n=a}r.#E();let o=i.querySelector(`[${nt}] > [data-move="${s}"]`);o&&!o.hidden?o.focus():n.isConnected&&i.focus()}#P(t,e){t.appendChild(e),t.#_(),this.#_(),t.#M(e),t.#I(e,this)}#N(t,e){this.dispatchEvent(new CustomEvent("drag-surface:reorder",{bubbles:!0,detail:{item:t,itemId:t.dataset.id,oldIndex:e,newIndex:this.#B(t),order:this.sortedOrder}}))}#I(t,e){this.dispatchEvent(new CustomEvent("drag-surface:transfer",{bubbles:!0,detail:{item:t,itemId:t.dataset.id,fromSurface:e,toSurface:this,newIndex:this.#B(t),fromOrder:e.sortedOrder,toOrder:this.sortedOrder}}))}#M(t){t.setAttribute("data-just-dropped",""),t.addEventListener("animationend",()=>{t.removeAttribute("data-just-dropped")},{once:!0}),setTimeout(()=>t.removeAttribute("data-just-dropped"),500)}#R(t){if(!this.group)return null;let e=[...r.#H].filter(n=>n===this||n.group===this.group&&n.isConnected&&!n.disabled);if(e.length<2)return null;let i=this.orientation==="horizontal",s=new Map(e.map(n=>[n,n.getBoundingClientRect()]));return e.sort((n,o)=>{let a=s.get(n),l=s.get(o);return i?a.top-l.top||a.left-l.left:a.left-l.left||a.top-l.top}),e[e.indexOf(this)+t]||null}#z(){return getComputedStyle(this).direction==="rtl"}#D(){let t=this.getAttribute("aria-label");if(t)return t;let e=this.getAttribute("aria-labelledby");if(e){let i=e.split(/\s+/).map(s=>document.getElementById(s)?.textContent.trim()).filter(Boolean).join(" ");if(i)return i}return"another list"}#F(t){let e=t.getAttribute("aria-label");if(e)return e;let i=t.cloneNode(!0);for(let n of i.querySelectorAll(`[${nt}], [aria-hidden="true"], [data-drag-handle]:not(:has(*))`))n.remove();return i.textContent.replace(/\s+/g," ").trim().slice(0,40)||t.dataset.id||"Item"}#B(t){return this.draggableChildren.indexOf(t)}#O(t,e){let s=this.draggableChildren.filter(n=>n!==t)[e]||null;s?this.insertBefore(t,s):this.appendChild(t)}#_(){this.draggableChildren.forEach((t,e)=>{t.dataset.sortOrder=String(e+1)})}#j(t,e){let i=this.orientation==="horizontal",s=i&&this.#z(),n=this.draggableChildren.filter(o=>!o.hasAttribute("data-dragging"));for(let o=0;o<n.length;o++){let a=n[o].getBoundingClientRect(),l;if(i?s?l=t>a.left+a.width/2:l=t<a.left+a.width/2:l=e<a.top+a.height/2,l)return{index:o,children:n}}return{index:n.length,children:n}}#K(t,e){return this.#j(t,e).index}#U(t,e){this.#W();let{index:i,children:s}=this.#j(t,e);i<s.length?s[i].setAttribute("data-drop-target","before"):s.length>0&&s[s.length-1].setAttribute("data-drop-target","after")}#W(){for(let t of this.querySelectorAll("[data-drop-target]"))t.removeAttribute("data-drop-target")}static#H=new Set;static#q=null};g("drag-surface",ke);var D=/Mac|iPhone|iPad|iPod/.test(navigator.platform??""),fs={mac:{meta:"\u2318",cmd:"\u2318",alt:"\u2325",option:"\u2325",shift:"\u21E7",ctrl:"\u2303",control:"\u2303"},other:{meta:"Ctrl",cmd:"Ctrl",alt:"Alt",option:"Alt",shift:"Shift",ctrl:"Ctrl",control:"Ctrl"}},ms={mac:{meta:"Command",cmd:"Command",alt:"Option",option:"Option",shift:"Shift",ctrl:"Control",control:"Control"},other:{meta:"Control",cmd:"Control",alt:"Alt",option:"Alt",shift:"Shift",ctrl:"Control",control:"Control"}},xn={escape:{label:"Esc",spoken:"Escape"},esc:{label:"Esc",spoken:"Escape"},enter:{label:"Enter",spoken:"Enter"},return:{label:"Enter",spoken:"Enter"},tab:{label:"Tab",spoken:"Tab"},space:{label:"Space",spoken:"Space"},backspace:{label:"Backspace",spoken:"Backspace"},delete:{label:"Del",spoken:"Delete"},del:{label:"Del",spoken:"Delete"},insert:{label:"Ins",spoken:"Insert"},home:{label:"Home",spoken:"Home"},end:{label:"End",spoken:"End"},pageup:{label:"PgUp",spoken:"Page up"},pagedown:{label:"PgDn",spoken:"Page down"},arrowup:{label:"\u2191",spoken:"Up arrow"},up:{label:"\u2191",spoken:"Up arrow"},arrowdown:{label:"\u2193",spoken:"Down arrow"},down:{label:"\u2193",spoken:"Down arrow"},arrowleft:{label:"\u2190",spoken:"Left arrow"},left:{label:"\u2190",spoken:"Left arrow"},arrowright:{label:"\u2192",spoken:"Right arrow"},right:{label:"\u2192",spoken:"Right arrow"},"+":{label:"+",spoken:"Plus"},plus:{label:"+",spoken:"Plus"}};function $t(r){return[...String(r??"").trim().toLowerCase().matchAll(/([^+]+|\+)(?:\+|$)/g)].map(e=>e[1].trim()).filter(Boolean).map(e=>e==="plus"?"+":e)}function Ae(r,t=D){let e=t?fs.mac:fs.other;if(r in e)return{label:e[r],spoken:(t?ms.mac:ms.other)[r],modifier:!0};let i=xn[r];if(i)return{...i,modifier:!1};let s=r.toUpperCase();return{label:s,spoken:s,modifier:!1}}function zt(r){return $t(r).map(t=>Ae(t).label).join(D?"":"+")}var En={esc:"escape",return:"enter",del:"delete",ins:"insert",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",space:" ",spacebar:" ",plus:"+",pgup:"pageup",pgdn:"pagedown"};function Sn(r){let t=String(r??"").toLowerCase();return En[t]??t}function vt(r){let t=$t(r);return{key:Sn(t.pop()??""),meta:t.includes("meta")||t.includes("cmd"),ctrl:t.includes("ctrl")||t.includes("control"),shift:t.includes("shift"),alt:t.includes("alt")||t.includes("option")}}function gs(r){return r.length===1&&!/[a-z0-9 ]/.test(r)}function bs(r,t){let i=(r.key==="Spacebar"?" ":String(r.key??"").toLowerCase())===t.key;if(!i&&(r.altKey||r.shiftKey)&&/^[a-z0-9]$/.test(t.key)){let o=/\d/.test(t.key)?`Digit${t.key}`:`Key${t.key.toUpperCase()}`;i=r.code===o}if(!i)return!1;let s,n;return D?(s=t.meta,n=t.ctrl):(s=!1,n=t.meta||t.ctrl),!(s!==r.metaKey||n!==r.ctrlKey||!gs(t.key)&&t.shift!==r.shiftKey||t.alt!==r.altKey)}function Bt(r){let t=typeof r=="string"?vt(r):r;return!t.meta&&!t.ctrl&&!t.alt&&t.key.length===1}function vs(r,t){let e=vt(r),i=vt(t),s=D?e.ctrl:e.ctrl||e.meta,n=D?i.ctrl:i.ctrl||i.meta,o=D&&e.meta,a=D&&i.meta,l=!gs(e.key);return e.key===i.key&&s===n&&o===a&&e.alt===i.alt&&(!l||e.shift===i.shift)}var xe="data-char-shortcuts",ys="vb:char-shortcuts-change",Cn="vb:settings:extensions";function yt(){return typeof document>"u"?!0:document.documentElement.getAttribute(xe)!=="off"}function Tn(){try{let r=globalThis.localStorage?.getItem(Cn);if(!r)return null;let t=JSON.parse(r)?.data?.charShortcuts;return typeof t=="boolean"?t:null}catch{return null}}var Ln=!0;if(typeof document<"u"){let r=Tn();r===null&&(Ln=yt()),r===!1?document.documentElement.setAttribute(xe,"off"):r===!0&&document.documentElement.removeAttribute(xe)}var Mn=new Set(["INPUT","TEXTAREA","SELECT"]),wt=[],ws=!1;function Rn(r){let t=r;return!t||!t.tagName?!1:Mn.has(t.tagName)||t.isContentEditable}function _n(r){if(r.repeat||r.isComposing||r.defaultPrevented)return;let t=Rn(r.target),e=!yt(),i=document.activeElement;for(let s of wt)if(!(t&&!s.global)&&!(s.scope&&!(s.scope.isConnected&&s.scope.contains(i)))&&!(e&&s.character&&!s.scope)&&!(s.enabled&&!s.enabled())&&bs(r,s.descriptor)){r.preventDefault(),s.callback(r);return}}function Nn(){ws||(document.addEventListener("keydown",_n),ws=!0)}function G(r,t,e={}){Nn();let i=vt(r),s={combo:r,descriptor:i,callback:t,global:e.global===!0,scope:e.scope??null,enabled:typeof e.enabled=="function"?e.enabled:null,character:Bt(i)},n=wt.find(o=>!o.scope&&!s.scope&&vs(o.combo,r));return n&&console.warn(`[hotkey-bind] Shortcut "${r}" is already bound as "${n.combo}". Last-bound wins.`),wt.unshift(s),function(){let a=wt.indexOf(s);a!==-1&&wt.splice(a,1)}}var Pn=0,Ee=class extends b{#t=null;#e;#i;#s=[];#r=-1;#n=[];#a=[];#c=[];#h="";#l=0;setup(){this.#h=`cmdp-${++Pn}`,this.#l=0,this.#o(),this.#p(),this.hasAttribute("discover")&&this.#v()}teardown(){this.#a.forEach(t=>t()),this.#a=[],this.#t?.remove(),this.#t=null,this.#s=[],this.#n=[],this.#c=[],this.#r=-1}get commands(){let t=[];for(let e of this.querySelectorAll("command-group")){let i=e.getAttribute("label")||"";for(let s of e.querySelectorAll("command-item"))t.push({value:s.getAttribute("value")||"",label:s.textContent.trim(),hotkey:s.getAttribute("data-hotkey")||void 0,group:i||void 0})}return t}set commands(t){let e=Array.isArray(t)?t:[],i=new Map;for(let s of e){let n=s.group||"";i.has(n)||i.set(n,[]),i.get(n).push(s)}for(let s of[...this.children])(s.tagName==="COMMAND-GROUP"||s.tagName==="COMMAND-ITEM")&&s.remove();for(let[s,n]of i){let o=document.createElement("command-group");s&&o.setAttribute("label",s);for(let a of n){let l=document.createElement("command-item");if(a.value&&l.setAttribute("value",a.value),a.hotkey&&l.setAttribute("data-hotkey",a.hotkey),a.icon){let c=document.createElement("span");c.setAttribute("slot","icon"),c.innerHTML=a.icon,l.appendChild(c)}l.appendChild(document.createTextNode(a.label||a.value||"")),o.appendChild(l)}this.appendChild(o)}this._reinit(),this.dispatchEvent(new CustomEvent("command-palette:commands-changed",{detail:{commands:e,source:"property"},bubbles:!0}))}#o(){this.#t=document.createElement("dialog"),this.#t.className="command-dialog",this.#t.setAttribute("aria-label",this.getAttribute("label")||"Command palette"),this.#t.addEventListener("click",i=>{i.target===this.#t&&this.close()}),this.#t.addEventListener("close",()=>{this.#e?.setAttribute("aria-expanded","false"),this.#e?.removeAttribute("aria-activedescendant"),this.dispatchEvent(new CustomEvent("command-palette:close",{bubbles:!0}))});let t=document.createElement("div");t.className="command-search",this.#i=document.createElement("div"),this.#i.className="command-list",this.#i.id=`${this.#h}-list`,this.#i.setAttribute("role","listbox"),this.#i.setAttribute("aria-label","Commands"),this.#e=document.createElement("input"),this.#e.type="search",this.#e.placeholder=this.getAttribute("placeholder")||"Type a command...",this.#e.setAttribute("aria-label","Search commands"),this.#e.autocomplete="off",this.#e.setAttribute("role","combobox"),this.#e.setAttribute("aria-autocomplete","list"),this.#e.setAttribute("aria-controls",this.#i.id),this.#e.setAttribute("aria-expanded","false"),this.#e.addEventListener("input",this.#d),this.#e.addEventListener("keydown",this.#f),t.appendChild(this.#e),this.#n=Array.from(this.querySelectorAll("command-group")),this.#n.forEach(i=>{let s=this.#u(i.getAttribute("label")||"");this.#i.appendChild(s),i.querySelectorAll("command-item").forEach(n=>{let o=n.querySelector('[slot="icon"]'),a=this.#b(n.textContent.trim(),o?o.cloneNode(!0):null,n.getAttribute("data-hotkey"));a.dataset.value=n.getAttribute("value")||"",a.addEventListener("click",()=>{this.#m(a.dataset.value)}),s.appendChild(a),this.#s.push({btn:a,group:s,source:n})})});let e=document.createElement("div");e.className="command-empty",e.textContent="No results found.",e.hidden=!0,this.#i.appendChild(e),this.#t.appendChild(t),this.#t.appendChild(this.#i),this.appendChild(this.#t)}#u(t){let e=document.createElement("div");e.className="command-group",e.setAttribute("role","group");let i=document.createElement("div");return i.className="command-group-header",i.id=`${this.#h}-g${++this.#l}`,i.setAttribute("aria-hidden","true"),i.textContent=t,t?e.setAttribute("aria-labelledby",i.id):i.hidden=!0,e.appendChild(i),e}#p(){let t=this.getAttribute("hotkey")||"meta+k";this.#a.push(G(t,()=>{this.#t?.open?this.close():this.open()},{global:!0}));for(let{btn:e,source:i}of this.#s){let s=i?.getAttribute("data-hotkey");if(!s||s.toLowerCase()===t.toLowerCase())continue;let n=e.dataset.value;this.#a.push(G(s,()=>this.#m(n)))}}#d=()=>{let t=this.#e.value.toLowerCase().trim(),e=0,i=new Set;this.#s.forEach(({btn:n,group:o})=>{let a=!t||(n.dataset.searchText??"").includes(t);n.hidden=!a,a&&(e++,i.add(o))}),this.#i.querySelectorAll(":scope > .command-group").forEach(n=>{n.hidden=!i.has(n)});let s=this.#i.querySelector(".command-empty");s&&(s.hidden=e>0),this.#r=-1,this.#s.forEach(({btn:n})=>{n.removeAttribute("data-active"),n.setAttribute("aria-selected","false")}),this.#e.removeAttribute("aria-activedescendant"),e>0&&this.#w(0)};#f=t=>{let e=this.#k();switch(t.key){case"ArrowDown":t.preventDefault(),this.#w(this.#r+1);break;case"ArrowUp":t.preventDefault(),this.#w(this.#r-1);break;case"Enter":t.preventDefault(),this.#r>=0&&e[this.#r]&&e[this.#r].btn.click();break;case"Escape":t.preventDefault(),this.close();break}};#k(){return this.#s.filter(({btn:t})=>!t.hidden)}#w(t){let e=this.#k();if(e.length===0)return;e.forEach(({btn:s})=>{s.removeAttribute("data-active"),s.setAttribute("aria-selected","false")}),t<0&&(t=e.length-1),t>=e.length&&(t=0),this.#r=t;let{btn:i}=e[t];i.setAttribute("data-active",""),i.setAttribute("aria-selected","true"),this.#e.setAttribute("aria-activedescendant",i.id),i.scrollIntoView({block:"nearest"})}#m(t){this.close(),this.dispatchEvent(new CustomEvent("command-palette:select",{bubbles:!0,detail:{value:t}}))}#v(){this.listen(document,"vb:command-registry-change",this.#y)}#y=()=>{this.#t?.open&&(this.#g(),this.#d())};#g(){if(!this.hasAttribute("discover"))return;let{getRegisteredCommands:t,scanAutoDiscoverable:e}=window.__commandRegistry||{};if(!t)return;this.#s=this.#s.filter(n=>!n.discovered),this.#c.forEach(n=>n.remove()),this.#c=[];let i=this.#i.querySelector(".command-empty"),s=t();for(let[n,o]of s){let a=this.#u(n);this.#i.insertBefore(a,i),this.#c.push(a);for(let l of o){if(this.contains(l.element))continue;let c=this.#b(l.label,l.icon,l.shortcut);c.dataset.value=`__discovered:${l.label}`,c.addEventListener("click",()=>{this.close(),l.element.click()}),a.appendChild(c),this.#s.push({btn:c,group:a,source:null,discovered:!0})}}if(this.getAttribute("discover")==="auto"&&e){let n=e(),o=new Map;for(let a of n){let l=o.get(a.group)||[];l.push(a),o.set(a.group,l)}for(let[a,l]of o){let c=this.#u(a);this.#i.insertBefore(c,i),this.#c.push(c);for(let h of l){if(this.contains(h.element))continue;let u=this.#b(h.label,h.icon,h.shortcut);u.dataset.value=`__auto:${h.label}`,u.dataset.auto="",u.addEventListener("click",()=>{this.close(),h.action?h.action():h.element.click()}),c.appendChild(u),this.#s.push({btn:u,group:c,source:null,discovered:!0})}}}}#b(t,e,i){let s=document.createElement("button");if(s.type="button",s.className="command-option",s.id=`${this.#h}-opt-${++this.#l}`,s.setAttribute("role","option"),s.setAttribute("aria-selected","false"),s.tabIndex=-1,s.dataset.searchText=t.toLowerCase(),e){let o=document.createElement("span");if(o.className="command-icon",typeof e=="string"){let a=document.createElement("icon-wc");a.setAttribute("name",e),o.appendChild(a)}else o.appendChild(e);s.appendChild(o)}let n=document.createElement("span");if(n.className="command-label",n.textContent=t,s.appendChild(n),i){let o=document.createElement("kbd");o.className="command-kbd",o.setAttribute("aria-hidden","true"),o.textContent=zt(i),s.appendChild(o),s.setAttribute("aria-keyshortcuts",i)}return s}open(){!this.#t||this.#t.open||(this.#g(),this.#t.showModal(),this.#e.setAttribute("aria-expanded","true"),this.#e.value="",this.#d(),this.#e.focus(),this.dispatchEvent(new CustomEvent("command-palette:open",{bubbles:!0})))}close(){this.#t?.open&&this.#t.close()}get isOpen(){return this.#t?.open??!1}},Se=class extends HTMLElement{},Ce=class extends HTMLElement{};g("command-palette",Ee);g("command-group",Se);g("command-item",Ce);var In="shift+?",$n={title:"Keyboard shortcuts",general:"General",self:"Show keyboard shortcuts",close:"Close"},zn=0,Te=class extends b{static get observedAttributes(){return["hotkey"]}#t=null;#e=null;#i=null;#s=null;setup(){this.#a(),this.#n(),this.listen(window,ys,()=>{this.#t?.open&&this.#l()})}teardown(){this.#i?.(),this.#i=null,this.#t?.remove(),this.#t=null,this.#e=null}attributeChangedCallback(t,e,i){t==="hotkey"&&e!==i&&this.hasAttribute("data-upgraded")&&this.#n()}show(){this.#t&&(this.#l(),this.#t.open||this.#t.showModal())}close(){this.#t?.open&&this.#t.close()}toggle(){this.#t?.open?this.close():this.show()}get open(){return!!this.#t?.open}get hotkey(){let t=(this.getAttribute("hotkey")??"").trim();return t.toLowerCase()==="none"?null:t||In}get shortcuts(){return this.#s}set shortcuts(t){this.#s=t&&typeof t=="object"?t:null,this.#t?.open&&this.#l(),this.dispatchEvent(new CustomEvent("short-cuts:shortcuts-changed",{detail:{shortcuts:this.#s,source:"property"},bubbles:!0}))}#r(t){return this.getAttribute(`data-label-${t}`)||$n[t]}#n(){this.#i?.(),this.#i=null;let t=this.hotkey;t&&(this.#i=G(t,()=>this.toggle()))}#a(){this.querySelector(":scope > dialog.shortcut-dialog")?.remove();let t=`short-cuts-title-${++zn}`,e=document.createElement("dialog");e.className="shortcut-dialog",e.setAttribute("aria-labelledby",t);let i=document.createElement("header");i.className="shortcut-header";let s=document.createElement("h2");s.id=t,s.textContent=this.#r("title");let n=document.createElement("button");n.type="button",n.className="shortcut-close",n.setAttribute("aria-label",this.#r("close"));let o=document.createElement("icon-wc");o.setAttribute("name","x"),o.setAttribute("size","sm"),o.setAttribute("aria-hidden","true"),n.appendChild(o),n.addEventListener("click",()=>this.close()),i.append(s,n);let a=document.createElement("section");a.className="shortcut-body",e.append(i,a),e.addEventListener("click",l=>{l.target===e&&e.close()}),this.#t=e,this.#e=a,this.appendChild(e)}#c(){let t=new Map,e=!yt(),i=(l,c=!1)=>!(e&&!c&&Bt(l)),s=this.hotkey;s&&i(s)&&t.set(this.#r("general"),[{label:this.#r("self"),shortcut:s}]);let n=(l,c)=>{if(!c?.shortcut||!i(String(c.shortcut),!!c.scoped))return;let h=t.get(l)||[];h.push({label:String(c.label??""),shortcut:String(c.shortcut)}),t.set(l,h)};if(this.#s){for(let[l,c]of Object.entries(this.#s))Array.isArray(c)&&c.forEach(h=>n(l,h));return t}let{getRegisteredCommands:o}=window.__commandRegistry||{};if(o)for(let[l,c]of o())for(let h of c)n(l,h);let{getHotkeyActions:a}=window.__hotkeyActionRegistry||{};if(a)for(let[l,c]of a())for(let h of c)n(l,h);return t}#h(t){let e=document.createElement("kbd");e.className="shortcut-kbd";let i=document.createElement("span");i.setAttribute("aria-hidden","true"),i.textContent=zt(t);let s=document.createElement("span");return s.className="visually-hidden",s.textContent=$t(t).map(n=>Ae(n,D).spoken).join(" "),e.append(i,s),e}#l(){if(this.#e){this.#e.replaceChildren();for(let[t,e]of this.#c()){if(!e.length)continue;let i=document.createElement("section");i.className="shortcut-group";let s=document.createElement("h3");s.className="shortcut-group-header",s.textContent=t;let n=document.createElement("dl");n.className="shortcut-list";for(let o of e){let a=document.createElement("div");a.className="shortcut-row";let l=document.createElement("dt");l.className="shortcut-label",l.textContent=o.label;let c=document.createElement("dd");c.appendChild(this.#h(o.shortcut)),a.append(l,c),n.appendChild(a)}i.append(s,n),this.#e.appendChild(i)}}}};g("short-cuts",Te);var Bn="Comparison slider";function Le(r){if(r===null||r.trim()==="")return 50;let t=Number(r);return Number.isNaN(t)?50:Math.min(100,Math.max(0,t))}var Me=class extends b{static observedAttributes=["position","label","aria-label"];#t=null;#e=!1;#i=!1;#s=50;setup(){let t=[...this.children].filter(e=>!e.classList.contains("comparison-divider"));return t.length<2?!1:(t.length>2&&console.warn("[compare-surface] Expected exactly 2 children; extra children are hidden."),this.#t=document.createElement("div"),this.#t.className="comparison-divider",this.#t.setAttribute("role","slider"),this.#t.setAttribute("aria-valuemin","0"),this.#t.setAttribute("aria-valuemax","100"),this.#t.setAttribute("aria-orientation","horizontal"),this.#t.setAttribute("tabindex","0"),this.#r(),this.appendChild(this.#t),this.#u(Le(this.getAttribute("position"))),this.listen(this.#t,"pointerdown",this.#a),this.listen(this.#t,"pointermove",this.#c),this.listen(this.#t,"pointerup",this.#h),this.listen(this.#t,"pointercancel",this.#h),this.listen(this.#t,"lostpointercapture",this.#h),this.listen(this.#t,"keydown",this.#l),!0)}teardown(){this.#t?.remove(),this.#t=null,this.#e=!1}attributeChangedCallback(t,e,i){if(!(!this.#t||e===i))if(t==="position"){if(this.#i)return;this.#u(Le(i))}else this.#r()}#r(){if(!this.#t)return;let t=this.getAttribute("label")||this.getAttribute("aria-label")||Bn;this.#t.setAttribute("aria-label",t)}get#n(){return getComputedStyle(this).direction==="rtl"}#a=t=>{t.preventDefault(),this.#e=!0,this.#t?.setPointerCapture(t.pointerId)};#c=t=>{if(!this.#e)return;let e=this.getBoundingClientRect();if(!e.width)return;let i=this.#n?e.right-t.clientX:t.clientX-e.left;this.#o(i/e.width*100)};#h=t=>{this.#e&&(this.#e=!1,this.#t?.hasPointerCapture(t.pointerId)&&this.#t.releasePointerCapture(t.pointerId))};#l=t=>{let e=t.shiftKey?10:1,i=this.#n?-1:1,s=this.#s,n;switch(t.key){case"ArrowRight":n=s+e*i;break;case"ArrowLeft":n=s-e*i;break;case"ArrowUp":n=s+e;break;case"ArrowDown":n=s-e;break;case"PageUp":n=s+10;break;case"PageDown":n=s-10;break;case"Home":n=0;break;case"End":n=100;break;default:return}t.preventDefault(),this.#o(n)};#o(t){let e=this.#s;if(this.#u(Math.min(100,Math.max(0,t))),this.#s!==e){this.#i=!0;try{this.setAttribute("position",String(this.#s))}finally{this.#i=!1}this.dispatchEvent(new CustomEvent("compare-surface:change",{detail:{position:this.#s},bubbles:!0}))}}#u(t){this.#s=Math.round(t),this.style.setProperty("--_position",`${t}%`),this.#t&&(this.#t.setAttribute("aria-valuenow",String(this.#s)),this.#t.setAttribute("aria-valuetext",`${this.#s}%`))}get position(){return this.#t?this.#s:Math.round(Le(this.getAttribute("position")))}set position(t){let e=Number(t),i=Math.round(Math.min(100,Math.max(0,Number.isNaN(e)?0:e)));this.setAttribute("position",String(i))}};g("compare-surface",Me);function jn(){let r=globalThis.localStorage;if(!r)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(t){return r.getItem(t)},async setRaw(t,e){r.setItem(t,e)},async removeRaw(t){r.removeItem(t)},async keys(t){let e=[];for(let i=0;i<r.length;i++){let s=r.key(i);s&&s.startsWith(t)&&e.push(s)}return e}}}var jt="__vbStoreBackend",Ot=globalThis;function F(){return Ot[jt]||(Ot[jt]=jn()),Ot[jt]}function Re(r,t){if(typeof r!="string"||!r)throw new TypeError("VBStore: namespace must be a non-empty string");if(typeof t!="string"||!t)throw new TypeError("VBStore: key must be a non-empty string");return`vb:${r}:${t}`}function ks(r){if(typeof r!="string"||!r)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${r}:`}function As(r){try{let t=JSON.parse(r);if(t&&typeof t=="object"&&typeof t.timestamp=="number")return t}catch{}return null}var _={configure(r={}){Ot[jt]=r.backend??null},async set(r,t,e){let i={data:e,timestamp:Date.now()};await F().setRaw(Re(r,t),JSON.stringify(i))},async get(r,t,e){let i=await F().getRaw(Re(r,t));if(i==null)return null;let s=As(i);return!s||e?.maxAge!=null&&Date.now()-s.timestamp>e.maxAge?null:s.data},async remove(r,t){await F().removeRaw(Re(r,t))},async list(r){let t=ks(r),e=await F().keys(t),i=[];for(let s of e){let n=await F().getRaw(s);if(n==null)continue;let o=As(n);o&&i.push({key:s.slice(t.length),data:o.data,timestamp:o.timestamp})}return i},async clear(r){let t=ks(r),e=await F().keys(t);for(let i of e)await F().removeRaw(i)},async clearAll(){let r=await F().keys("vb:");for(let t of r)await F().removeRaw(t)},async setMany(r,t){for(let[e,i]of t)await _.set(r,e,i)}};if(typeof window<"u"){let r=window.VB??(window.VB={});r.store??=_}var On=0;function _e(r,t){if(r===null||r.trim()==="")return t;let e=Number(r);return Number.isFinite(e)?e:t}var Ne=class extends b{static observedAttributes=["position","min","max","direction","collapsible","data-label-resize","data-label-collapsed"];#t=null;#e;#i;#s=50;#r=!1;#n=50;#a=!1;#c={};#h=0;get#l(){return this.getAttribute("direction")==="vertical"}get#o(){return getComputedStyle(this).direction==="rtl"}get#u(){return _e(this.getAttribute("min"),10)}get#p(){return _e(this.getAttribute("max"),90)}get#d(){return this.hasAttribute("collapsible")}get#f(){return _e(this.getAttribute("position"),50)}get position(){return this.#t?this.#s:this.#c.position??this.#s}set position(t){let e=Number(t);if(Number.isFinite(e)){if(!this.#t){this.#c.position=e,delete this.#c.reset;return}this.#r&&this.#E(),this.#C(e,"api")}}get collapsed(){return this.#t?this.#r:this.#c.collapsed??this.#r}set collapsed(t){if(!this.#t){this.#c.collapsed=!!t;return}t?this.#x("api"):this.#L("api")}reset(){if(!this.#t){this.#c={reset:!0},this.#N();return}this.#r&&this.#E(),this.#C(this.#f,"api"),this.#N()}setup(){for(let e of this.querySelectorAll(":scope > .split-divider"))e.remove();let t=[...this.children].filter(e=>!e.classList.contains("split-divider"));return t.length<2?!1:(this.#e=t[0],this.#i=t[1],this.#k(++this.#h),!0)}async#k(t){let e=null;if(this.#a||(e=await this.#$()),t!==this.#h||!this.isConnected)return!1;let i=this.#e,s=document.createElement("div");s.className="split-divider",s.setAttribute("role","separator"),i.id||(i.id=`vb-split-panel-${++On}`),s.setAttribute("aria-controls",i.id),s.setAttribute("tabindex","0"),this.#t=s,this.#m(),this.insertBefore(s,this.#i),this.listen(s,"pointerdown",this.#y),this.listen(s,"keydown",this.#T),this.listen(s,"dblclick",this.#A);let n=this.#r?this.#n:this.#s,o=this.#r;this.#a||(n=e?.position??this.#f,o=!!e?.collapsed&&this.#d);let a=this.#c;return this.#c={},a.reset&&(n=this.#f,o=!1),a.position!==void 0&&(n=a.position,o=!1),a.collapsed!==void 0&&(o=a.collapsed),this.#a=!0,this.#E(),o?(this.#n=this.#w(n),this.#S()):this.#C(n,null),!0}teardown(){this.#h++,this.#t&&(this.#t.remove(),this.#t=null)}attributeChangedCallback(t,e,i){if(!(e===i||!this.#t)){if(t==="position"){this.#r?this.#n=this.#w(this.#f):this.#C(this.#f,"attribute");return}t==="collapsible"&&!this.#d&&this.#r&&this.#L("attribute"),this.#m(),!this.#r&&(t==="min"||t==="max")&&this.#C(this.#s,"attribute")}}#w(t){return Math.min(this.#p,Math.max(this.#u,t))}#m(){let t=this.#t;t&&(t.setAttribute("aria-orientation",this.#l?"horizontal":"vertical"),t.setAttribute("aria-valuemin",String(this.#d?0:this.#u)),t.setAttribute("aria-valuemax",String(this.#p)),t.setAttribute("aria-label",this.getAttribute("data-label-resize")||"Resize panels"),this.#v())}#v(){let t=this.#t;if(!t)return;let e=Math.round(this.#s);t.setAttribute("aria-valuenow",String(e)),t.setAttribute("aria-valuetext",this.#r?this.getAttribute("data-label-collapsed")||"Collapsed":`${e}%`)}#y=t=>{if(t.button!==0)return;t.preventDefault();let e=this.#t;this.setState("divider-dragging",!0);try{e.setPointerCapture(t.pointerId)}catch{}e.addEventListener("pointermove",this.#g),e.addEventListener("pointerup",this.#b),e.addEventListener("pointercancel",this.#b),e.addEventListener("lostpointercapture",this.#b)};#g=t=>{if(!this.matches(":state(divider-dragging)"))return;let e=this.getBoundingClientRect(),i;this.#l?i=(t.clientY-e.top)/e.height*100:i=(this.#o?e.right-t.clientX:t.clientX-e.left)/e.width*100,this.#r&&this.#E(),this.#C(i,"pointer")};#b=t=>{if(!this.#t)return;let e=this.matches(":state(divider-dragging)");this.setState("divider-dragging",!1),this.#t.hasPointerCapture(t.pointerId)&&this.#t.releasePointerCapture(t.pointerId),this.#t.removeEventListener("pointermove",this.#g),this.#t.removeEventListener("pointerup",this.#b),this.#t.removeEventListener("pointercancel",this.#b),this.#t.removeEventListener("lostpointercapture",this.#b),e&&this.#P()};#T=t=>{if(t.key==="Enter"){if(!this.#d)return;t.preventDefault(),this.#r?this.#L("keyboard"):this.#x("keyboard"),this.#P();return}let e=t.shiftKey?10:1,i=!this.#l&&this.#o,s=this.#l?"ArrowUp":i?"ArrowRight":"ArrowLeft",n=this.#l?"ArrowDown":i?"ArrowLeft":"ArrowRight",o=null;t.key===s?o=this.#s-e:t.key===n?o=this.#s+e:t.key==="Home"?o=this.#u:t.key==="End"&&(o=this.#p),o!==null&&(t.preventDefault(),this.#r&&(this.#E(),this.dispatchEvent(new CustomEvent("split-surface:collapse",{detail:{collapsed:!1,source:"keyboard"},bubbles:!0}))),this.#C(o,"keyboard"),this.#P())};#A=()=>{this.#d&&(this.#r?this.#L("pointer"):this.#x("pointer"),this.#P())};#x(t){this.#r||!this.#t||(this.#n=this.#s,this.#S(),this.dispatchEvent(new CustomEvent("split-surface:collapse",{detail:{collapsed:!0,source:t},bubbles:!0})))}#S(){let t=this.#e;this.#r=!0,this.#s=0,t.style.flexBasis="0%",t.style.flexGrow="0",t.style.flexShrink="0",t.style.overflow="hidden",t.inert=!0,this.setState("collapsed",!0),this.#v()}#E(){this.#r=!1,this.#e&&(this.#e.inert=!1),this.setState("collapsed",!1)}#L(t){!this.#r||!this.#t||(this.#E(),this.#C(this.#n,null),this.dispatchEvent(new CustomEvent("split-surface:collapse",{detail:{collapsed:!1,source:t},bubbles:!0})))}#C(t,e){if(!Number.isFinite(t)||!this.#e||!this.#i)return;let i=this.#w(t);this.#s=i,this.#e.style.flexBasis=`${i}%`,this.#e.style.flexGrow="0",this.#e.style.flexShrink="0",this.#e.style.overflow="auto",this.#i.style.flexGrow="1",this.#i.style.overflow="auto",this.#v(),e!==null&&this.dispatchEvent(new CustomEvent("split-surface:resize",{detail:{position:i,source:e},bubbles:!0}))}async#$(){let t=this.getAttribute("persist");if(!t)return null;try{let e=await _.get("layout",`split:${t}`);if(e&&typeof e=="object"&&typeof e.position=="number")return e}catch{}return null}#P(){let t=this.getAttribute("persist");if(!t)return;let e=this.#r?{position:Math.round(this.#n),collapsed:!0}:{position:Math.round(this.#s),collapsed:!1};_.set("layout",`split:${t}`,e).catch(()=>{})}#N(){let t=this.getAttribute("persist");t&&_.remove("layout",`split:${t}`).catch(()=>{})}};g("split-surface",Ne);var Dn=["position:absolute","inline-size:1px","block-size:1px","padding:0","margin:-1px","overflow:hidden","clip-path:inset(50%)","white-space:nowrap","border:0"].join(";"),xs=new WeakMap;function Fn(r,t){let e=xs.get(t);e||xs.set(t,e=new Map);let i=e.get(r);if(!i||!i.region.isConnected){let n=(t.ownerDocument||document).createElement("span");n.setAttribute("data-vb-announcer",r),n.setAttribute("role",r==="assertive"?"alert":"status"),n.setAttribute("aria-live",r),n.setAttribute("aria-atomic","true"),n.style.cssText=Dn,t.appendChild(n),i={region:n},e.set(r,i)}return i}function ot(r,{politeness:t="polite",root:e}={}){let i=String(r??"").trim();if(!i||typeof document>"u")return null;let s=e||document.body;if(!s)return null;let o=Fn(t==="assertive"?"assertive":"polite",s);return clearTimeout(o.write),clearTimeout(o.clear),o.region.textContent="",o.write=setTimeout(()=>{o.region.textContent=i,o.clear=setTimeout(()=>{o.region.textContent=""},7e3)},50),o.region}function q(r,t,e,i){let s=`data-label-${t}`,o=r?.closest?.(`[${s}]`)?.getAttribute(s)||e;return i?o.replace(/\{(\w+)\}/g,(a,l)=>l in i?String(i[l]):a):o}var Ie=1500,qn="[data-copy], [data-copy-target], [data-paste-target]",Y={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"},Pe=new WeakMap;function Hn(r){if(typeof document.execCommand!="function"||!document.body)return!1;let t=document.activeElement,e=document.createElement("textarea");e.value=r,e.setAttribute("readonly",""),e.setAttribute("aria-hidden","true"),e.style.cssText="position:fixed;inset-block-start:0;inset-inline-start:0;opacity:0;pointer-events:none",document.body.appendChild(e),e.select();let i=!1;try{i=document.execCommand("copy")}catch{i=!1}return e.remove(),t?.focus?.({preventScroll:!0}),i}function Un(r){if(!r)return!1;if(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement)return r.focus(),r.select(),!0;let t=window.getSelection?.();if(!t)return!1;let e=document.createRange();return e.selectNodeContents(r),t.removeAllRanges(),t.addRange(e),!t.isCollapsed}async function kt(r,t={}){if(r==null||r==="")return!1;let{button:e,duration:i=Ie}=t,s=!1,n=null;try{if(!navigator.clipboard?.writeText)throw new Error("Clipboard API unavailable");await navigator.clipboard.writeText(r),s=!0}catch(a){n=a,s=Hn(r)}if(s)return at({button:e,duration:i,state:"copied",eventName:"copy:done",eventDetail:{text:r},message:t.announceMessage??q(e,"copied",Y.copied)}),!0;let o=Un(t.source);return at({button:e,duration:i,state:"failed",eventName:"copy:error",eventDetail:{text:r,error:n},message:t.failureMessage??q(e,"copy-failed",o?Y["copy-failed-selected"]:Y["copy-failed"])}),!1}async function Es(r,t={}){let{text:e,html:i,blob:s}=r??{};if(!e&&!i&&!s)return!1;let{button:n,duration:o=Ie}=t;if(typeof ClipboardItem<"u"&&typeof navigator.clipboard?.write=="function"){let l={};e&&(l["text/plain"]=new Blob([e],{type:"text/plain"})),i&&(l["text/html"]=new Blob([i],{type:"text/html"})),s&&(l[s.type]=s);try{return await navigator.clipboard.write([new ClipboardItem(l)]),at({button:n,duration:o,state:"copied",eventName:"copy:done",eventDetail:{payload:r},message:t.announceMessage??q(n,"copied",Y.copied)}),!0}catch{}}return e?kt(e,t):(at({button:n,duration:o,state:"failed",eventName:"copy:error",eventDetail:{payload:r,error:null},message:t.failureMessage??q(n,"copy-failed",Y["copy-failed"])}),!1)}function at({button:r,duration:t,message:e,eventDetail:i,state:s,eventName:n}){if(r){r.dataset.state=s;let o=Pe.get(r);o&&clearTimeout(o),Pe.set(r,setTimeout(()=>{r.dataset.state===s&&delete r.dataset.state,Pe.delete(r)},t)),r.dispatchEvent(new CustomEvent(n,{bubbles:!0,detail:i}))}ot(e,{politeness:s==="failed"?"assertive":"polite"})}async function Vn(r,t={}){let{button:e,duration:i=Ie}=t,s;try{if(!navigator.clipboard?.readText)throw new Error("Clipboard API unavailable");s=await navigator.clipboard.readText()}catch(n){return at({button:e,duration:i,state:"failed",eventName:"paste:error",eventDetail:{target:r,error:n},message:t.failureMessage??q(e,"paste-failed",Y["paste-failed"])}),null}return r&&(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement?r.value=s:r.textContent=s,r.dispatchEvent(new Event("input",{bubbles:!0}))),at({button:e,duration:i,state:"pasted",eventName:"paste:done",eventDetail:{text:s,target:r},message:t.announceMessage??q(e,"pasted",Y.pasted)}),s}function Ss(r){let t=r.dataset.copyTarget;if(!t)return null;try{return document.querySelector(t)}catch{return null}}function Wn(r){if(r.dataset.copy)return r.dataset.copy;let t=Ss(r);if(!t)return"";let e=r.dataset.copyAttr;return e?t.getAttribute(e)??"":t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement?t.value:t.textContent??""}function Kn(r){let t=r.target?.closest?.(qn);if(!t||t.matches(':disabled, [aria-disabled="true"]'))return;if(t.dataset.pasteTarget){let i=null;try{i=document.querySelector(t.dataset.pasteTarget)}catch{}if(!i)return;Vn(i,{button:t});return}let e=Wn(t);e&&kt(e,{button:t,source:Ss(t)??void 0})}typeof document<"u"&&!document.__vbCopyDelegated&&(document.__vbCopyDelegated=!0,document.addEventListener("click",Kn));var V;(r=>{class t{constructor(a,l,c,h){if(this.version=a,this.errorCorrectionLevel=l,a<t.MIN_VERSION||a>t.MAX_VERSION)throw new RangeError("Version value out of range");if(h<-1||h>7)throw new RangeError("Mask value out of range");this.size=a*4+17;let u=[];for(let d=0;d<this.size;d++)u.push(!1);for(let d=0;d<this.size;d++)this.modules.push(u.slice()),this.isFunction.push(u.slice());this.drawFunctionPatterns();let p=this.addEccAndInterleave(c);if(this.drawCodewords(p),h==-1){let d=1e9;for(let f=0;f<8;f++){this.applyMask(f),this.drawFormatBits(f);let m=this.getPenaltyScore();m<d&&(h=f,d=m),this.applyMask(f)}}s(0<=h&&h<=7),this.mask=h,this.applyMask(h),this.drawFormatBits(h),this.isFunction=[]}version;errorCorrectionLevel;static encodeText(a,l){let c=r.QrSegment.makeSegments(a);return t.encodeSegments(c,l)}static encodeBinary(a,l){let c=r.QrSegment.makeBytes(a);return t.encodeSegments([c],l)}static encodeSegments(a,l,c=1,h=40,u=-1,p=!0){if(!(t.MIN_VERSION<=c&&c<=h&&h<=t.MAX_VERSION)||u<-1||u>7)throw new RangeError("Invalid value");let d,f;for(d=c;;d++){let k=t.getNumDataCodewords(d,l)*8,A=n.getTotalBits(a,d);if(A<=k){f=A;break}if(d>=h)throw new RangeError("Data too long")}for(let k of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])p&&f<=t.getNumDataCodewords(d,k)*8&&(l=k);let m=[];for(let k of a){e(k.mode.modeBits,4,m),e(k.numChars,k.mode.numCharCountBits(d),m);for(let A of k.getData())m.push(A)}s(m.length==f);let y=t.getNumDataCodewords(d,l)*8;s(m.length<=y),e(0,Math.min(4,y-m.length),m),e(0,(8-m.length%8)%8,m),s(m.length%8==0);for(let k=236;m.length<y;k^=253)e(k,8,m);let w=[];for(;w.length*8<m.length;)w.push(0);return m.forEach((k,A)=>w[A>>>3]|=k<<7-(A&7)),new t(d,l,w,u)}size;mask;modules=[];isFunction=[];getModule(a,l){return 0<=a&&a<this.size&&0<=l&&l<this.size&&this.modules[l][a]}drawFunctionPatterns(){for(let c=0;c<this.size;c++)this.setFunctionModule(6,c,c%2==0),this.setFunctionModule(c,6,c%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let a=this.getAlignmentPatternPositions(),l=a.length;for(let c=0;c<l;c++)for(let h=0;h<l;h++)c==0&&h==0||c==0&&h==l-1||c==l-1&&h==0||this.drawAlignmentPattern(a[c],a[h]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(a){let l=this.errorCorrectionLevel.formatBits<<3|a,c=l;for(let u=0;u<10;u++)c=c<<1^(c>>>9)*1335;let h=(l<<10|c)^21522;s(h>>>15==0);for(let u=0;u<=5;u++)this.setFunctionModule(8,u,i(h,u));this.setFunctionModule(8,7,i(h,6)),this.setFunctionModule(8,8,i(h,7)),this.setFunctionModule(7,8,i(h,8));for(let u=9;u<15;u++)this.setFunctionModule(14-u,8,i(h,u));for(let u=0;u<8;u++)this.setFunctionModule(this.size-1-u,8,i(h,u));for(let u=8;u<15;u++)this.setFunctionModule(8,this.size-15+u,i(h,u));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let a=this.version;for(let c=0;c<12;c++)a=a<<1^(a>>>11)*7973;let l=this.version<<12|a;s(l>>>18==0);for(let c=0;c<18;c++){let h=i(l,c),u=this.size-11+c%3,p=Math.floor(c/3);this.setFunctionModule(u,p,h),this.setFunctionModule(p,u,h)}}drawFinderPattern(a,l){for(let c=-4;c<=4;c++)for(let h=-4;h<=4;h++){let u=Math.max(Math.abs(h),Math.abs(c)),p=a+h,d=l+c;0<=p&&p<this.size&&0<=d&&d<this.size&&this.setFunctionModule(p,d,u!=2&&u!=4)}}drawAlignmentPattern(a,l){for(let c=-2;c<=2;c++)for(let h=-2;h<=2;h++)this.setFunctionModule(a+h,l+c,Math.max(Math.abs(h),Math.abs(c))!=1)}setFunctionModule(a,l,c){this.modules[l][a]=c,this.isFunction[l][a]=!0}addEccAndInterleave(a){let l=this.version,c=this.errorCorrectionLevel;if(a.length!=t.getNumDataCodewords(l,c))throw new RangeError("Invalid argument");let h=t.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][l],u=t.ECC_CODEWORDS_PER_BLOCK[c.ordinal][l],p=Math.floor(t.getNumRawDataModules(l)/8),d=h-p%h,f=Math.floor(p/h),m=[],y=t.reedSolomonComputeDivisor(u);for(let k=0,A=0;k<h;k++){let T=a.slice(A,A+f-u+(k<d?0:1));A+=T.length;let j=t.reedSolomonComputeRemainder(T,y);k<d&&T.push(0),m.push(T.concat(j))}let w=[];for(let k=0;k<m[0].length;k++)m.forEach((A,T)=>{(k!=f-u||T>=d)&&w.push(A[k])});return s(w.length==p),w}drawCodewords(a){if(a.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let h=0;h<this.size;h++)for(let u=0;u<2;u++){let p=c-u,f=(c+1&2)==0?this.size-1-h:h;!this.isFunction[f][p]&&l<a.length*8&&(this.modules[f][p]=i(a[l>>>3],7-(l&7)),l++)}}s(l==a.length*8)}applyMask(a){if(a<0||a>7)throw new RangeError("Mask value out of range");for(let l=0;l<this.size;l++)for(let c=0;c<this.size;c++){let h;switch(a){case 0:h=(c+l)%2==0;break;case 1:h=l%2==0;break;case 2:h=c%3==0;break;case 3:h=(c+l)%3==0;break;case 4:h=(Math.floor(c/3)+Math.floor(l/2))%2==0;break;case 5:h=c*l%2+c*l%3==0;break;case 6:h=(c*l%2+c*l%3)%2==0;break;case 7:h=((c+l)%2+c*l%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[l][c]&&h&&(this.modules[l][c]=!this.modules[l][c])}}getPenaltyScore(){let a=0;for(let u=0;u<this.size;u++){let p=!1,d=0,f=[0,0,0,0,0,0,0];for(let m=0;m<this.size;m++)this.modules[u][m]==p?(d++,d==5?a+=t.PENALTY_N1:d>5&&a++):(this.finderPenaltyAddHistory(d,f),p||(a+=this.finderPenaltyCountPatterns(f)*t.PENALTY_N3),p=this.modules[u][m],d=1);a+=this.finderPenaltyTerminateAndCount(p,d,f)*t.PENALTY_N3}for(let u=0;u<this.size;u++){let p=!1,d=0,f=[0,0,0,0,0,0,0];for(let m=0;m<this.size;m++)this.modules[m][u]==p?(d++,d==5?a+=t.PENALTY_N1:d>5&&a++):(this.finderPenaltyAddHistory(d,f),p||(a+=this.finderPenaltyCountPatterns(f)*t.PENALTY_N3),p=this.modules[m][u],d=1);a+=this.finderPenaltyTerminateAndCount(p,d,f)*t.PENALTY_N3}for(let u=0;u<this.size-1;u++)for(let p=0;p<this.size-1;p++){let d=this.modules[u][p];d==this.modules[u][p+1]&&d==this.modules[u+1][p]&&d==this.modules[u+1][p+1]&&(a+=t.PENALTY_N2)}let l=0;for(let u of this.modules)l=u.reduce((p,d)=>p+(d?1:0),l);let c=this.size*this.size,h=Math.ceil(Math.abs(l*20-c*10)/c)-1;return s(0<=h&&h<=9),a+=h*t.PENALTY_N4,s(0<=a&&a<=2568888),a}getAlignmentPatternPositions(){if(this.version==1)return[];{let a=Math.floor(this.version/7)+2,l=Math.floor((this.version*8+a*3+5)/(a*4-4))*2,c=[6];for(let h=this.size-7;c.length<a;h-=l)c.splice(1,0,h);return c}}static getNumRawDataModules(a){if(a<t.MIN_VERSION||a>t.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*a+128)*a+64;if(a>=2){let c=Math.floor(a/7)+2;l-=(25*c-10)*c-55,a>=7&&(l-=36)}return s(208<=l&&l<=29648),l}static getNumDataCodewords(a,l){return Math.floor(t.getNumRawDataModules(a)/8)-t.ECC_CODEWORDS_PER_BLOCK[l.ordinal][a]*t.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][a]}static reedSolomonComputeDivisor(a){if(a<1||a>255)throw new RangeError("Degree out of range");let l=[];for(let h=0;h<a-1;h++)l.push(0);l.push(1);let c=1;for(let h=0;h<a;h++){for(let u=0;u<l.length;u++)l[u]=t.reedSolomonMultiply(l[u],c),u+1<l.length&&(l[u]^=l[u+1]);c=t.reedSolomonMultiply(c,2)}return l}static reedSolomonComputeRemainder(a,l){let c=l.map(h=>0);for(let h of a){let u=h^c.shift();c.push(0),l.forEach((p,d)=>c[d]^=t.reedSolomonMultiply(p,u))}return c}static reedSolomonMultiply(a,l){if(a>>>8||l>>>8)throw new RangeError("Byte out of range");let c=0;for(let h=7;h>=0;h--)c=c<<1^(c>>>7)*285,c^=(l>>>h&1)*a;return s(c>>>8==0),c}finderPenaltyCountPatterns(a){let l=a[1];s(l<=this.size*3);let c=l>0&&a[2]==l&&a[3]==l*3&&a[4]==l&&a[5]==l;return(c&&a[0]>=l*4&&a[6]>=l?1:0)+(c&&a[6]>=l*4&&a[0]>=l?1:0)}finderPenaltyTerminateAndCount(a,l,c){return a&&(this.finderPenaltyAddHistory(l,c),l=0),l+=this.size,this.finderPenaltyAddHistory(l,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(a,l){l[0]==0&&(a+=this.size),l.pop(),l.unshift(a)}static MIN_VERSION=1;static MAX_VERSION=40;static PENALTY_N1=3;static PENALTY_N2=3;static PENALTY_N3=40;static PENALTY_N4=10;static ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]];static NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]]}r.QrCode=t;function e(o,a,l){if(a<0||a>31||o>>>a)throw new RangeError("Value out of range");for(let c=a-1;c>=0;c--)l.push(o>>>c&1)}function i(o,a){return(o>>>a&1)!=0}function s(o){if(!o)throw new Error("Assertion error")}class n{constructor(a,l,c){if(this.mode=a,this.numChars=l,this.bitData=c,l<0)throw new RangeError("Invalid argument");this.bitData=c.slice()}mode;numChars;bitData;static makeBytes(a){let l=[];for(let c of a)e(c,8,l);return new n(n.Mode.BYTE,a.length,l)}static makeNumeric(a){if(!n.isNumeric(a))throw new RangeError("String contains non-numeric characters");let l=[];for(let c=0;c<a.length;){let h=Math.min(a.length-c,3);e(parseInt(a.substring(c,c+h),10),h*3+1,l),c+=h}return new n(n.Mode.NUMERIC,a.length,l)}static makeAlphanumeric(a){if(!n.isAlphanumeric(a))throw new RangeError("String contains unencodable characters in alphanumeric mode");let l=[],c;for(c=0;c+2<=a.length;c+=2){let h=n.ALPHANUMERIC_CHARSET.indexOf(a.charAt(c))*45;h+=n.ALPHANUMERIC_CHARSET.indexOf(a.charAt(c+1)),e(h,11,l)}return c<a.length&&e(n.ALPHANUMERIC_CHARSET.indexOf(a.charAt(c)),6,l),new n(n.Mode.ALPHANUMERIC,a.length,l)}static makeSegments(a){return a==""?[]:n.isNumeric(a)?[n.makeNumeric(a)]:n.isAlphanumeric(a)?[n.makeAlphanumeric(a)]:[n.makeBytes(n.toUtf8ByteArray(a))]}static makeEci(a){let l=[];if(a<0)throw new RangeError("ECI assignment value out of range");if(a<128)e(a,8,l);else if(a<16384)e(2,2,l),e(a,14,l);else if(a<1e6)e(6,3,l),e(a,21,l);else throw new RangeError("ECI assignment value out of range");return new n(n.Mode.ECI,0,l)}static isNumeric(a){return n.NUMERIC_REGEX.test(a)}static isAlphanumeric(a){return n.ALPHANUMERIC_REGEX.test(a)}getData(){return this.bitData.slice()}static getTotalBits(a,l){let c=0;for(let h of a){let u=h.mode.numCharCountBits(l);if(h.numChars>=1<<u)return 1/0;c+=4+u+h.bitData.length}return c}static toUtf8ByteArray(a){a=encodeURI(a);let l=[];for(let c=0;c<a.length;c++)a.charAt(c)!="%"?l.push(a.charCodeAt(c)):(l.push(parseInt(a.substring(c+1,c+3),16)),c+=2);return l}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}r.QrSegment=n})(V||(V={}));(r=>{let t;(e=>{class i{constructor(n,o){this.ordinal=n,this.formatBits=o}ordinal;formatBits;static LOW=new i(0,1);static MEDIUM=new i(1,0);static QUARTILE=new i(2,3);static HIGH=new i(3,2)}e.Ecc=i})(t=r.QrCode||(r.QrCode={}))})(V||(V={}));(r=>{let t;(e=>{class i{constructor(n,o){this.modeBits=n,this.numBitsCharCount=o}modeBits;numBitsCharCount;static NUMERIC=new i(1,[10,12,14]);static ALPHANUMERIC=new i(2,[9,11,13]);static BYTE=new i(4,[8,16,16]);static KANJI=new i(8,[8,10,12]);static ECI=new i(7,[0,0,0]);numCharCountBits(n){return this.numBitsCharCount[Math.floor((n+7)/17)]}}e.Mode=i})(t=r.QrSegment||(r.QrSegment={}))})(V||(V={}));var lt=V.QrCode,Cs=V.QrSegment;var Gn=4,ze=["L","M","Q","H"],$e=[lt.Ecc.LOW,lt.Ecc.MEDIUM,lt.Ecc.QUARTILE,lt.Ecc.HIGH];function Ls(r){if(r==null||r.trim()==="")return 1;let t=r.trim().toUpperCase(),e=ze.indexOf(t);return e!==-1?e:/^[0-3]$/.test(t)?Number(t):null}function Ms(r,t=1){let e=$e[t]??$e[1],i;try{i=lt.encodeSegments(Cs.makeSegments(r),e,1,40,-1,!1)}catch(n){let o=new RangeError(n instanceof Error?n.message:String(n));throw o.reason=/too long/i.test(o.message)?"capacity":"encoding",o}let s=[];for(let n=0;n<i.size;n++){let o=[];for(let a=0;a<i.size;a++)o.push(i.getModule(a,n));s.push(o)}return{version:i.version,size:i.size,ecl:$e.indexOf(e),modules:s}}function Rs(r,t){let e=r+Gn*2,i=Math.max(1,Math.floor(t/e)),s=Math.max(t,i*e),n=Math.floor((s-i*r)/2);return{cell:i,offset:n,edge:s}}function Ts([r,t,e]){let i=s=>{let n=s/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4};return .2126*i(r)+.7152*i(t)+.0722*i(e)}function _s(r,t){let e=[];(t[3]??1)<1&&e.push("the background is not opaque, so the code takes on whatever is behind it"),(r[3]??1)<1&&e.push("the module colour is not opaque");let i=Ts(r),s=Ts(t);i>s&&e.push("modules are lighter than the background (inverted codes are rejected by many scanners)");let n=(Math.max(i,s)+.05)/(Math.min(i,s)+.05);return n<4&&e.push(`contrast is ${n.toFixed(2)}:1 (aim for at least 4:1)`),e}var Yn=200,Xn="#000",Jn="#fff",Be=class extends b{#t=null;#e=null;#i="";#s=!1;#r="";#n="";static get observedAttributes(){return["value","size","color","background","error-correction","data-label-prefix"]}get value(){return this.getAttribute("value")||this.#i}set value(t){t==null||t===""?this.removeAttribute("value"):this.setAttribute("value",String(t))}setup(){if(!this.#e){this.#i=(this.textContent??"").trim();let t=document.createElement("span");t.setAttribute("data-qr-caption",""),t.append(...this.childNodes),!this.#i&&!t.children.length&&(t.textContent=this.value,this.#s=!0),this.#e=t}return this.#t||(this.#t=document.createElement("canvas"),this.#t.setAttribute("role","img")),this.#t.parentNode!==this&&this.prepend(this.#t),this.#e.parentNode!==this&&this.append(this.#e),this.#c(),this.#a(),!0}#a(){if(typeof window.matchMedia!="function")return;let t=window.matchMedia(`(resolution: ${window.devicePixelRatio||1}dppx)`);this.listen(t,"change",()=>{this.isConnected&&(this.#c(),this.#a())},{once:!0})}attributeChangedCallback(){!this.hasAttribute("data-upgraded")||!this.isConnected||this.#c()}#c(){let t=this.#t,e=this.value;if(t.setAttribute("aria-label",this.getAttribute("data-label-prefix")||"QR code"),this.#s&&this.#e&&this.#e.textContent!==e&&(this.#e.textContent=e),this.removeAttribute("data-error"),!e){this.#h();return}let i=this.getAttribute("error-correction"),s=Ls(i);s===null&&(console.warn(`<qr-code>: error-correction="${i}" is not L, M, Q, H or 0-3; using M.`),s=1);let n;try{n=Ms(e,s)}catch(f){let m=f.reason||"encoding";this.#h(),this.setAttribute("data-error",m),this.dispatchEvent(new CustomEvent("qr-code:error",{bubbles:!0,detail:{reason:m,value:e,errorCorrection:ze[s],message:f.message}}));return}let o=Math.max(1,parseInt(this.getAttribute("size")??"",10)||Yn),a=Math.max(1,window.devicePixelRatio||1),{cell:l,offset:c,edge:h}=Rs(n.size,Math.round(o*a));t.hidden=!1,t.width=h,t.height=h,t.style.inlineSize=`${o}px`;let u=this.#l(this.getAttribute("color"),Xn),p=this.#l(this.getAttribute("background"),Jn);this.#o(u,p);let d=t.getContext("2d");if(d){d.clearRect(0,0,h,h),d.fillStyle=p.css,d.fillRect(0,0,h,h),d.fillStyle=u.css;for(let f=0;f<n.size;f++)for(let m=0;m<n.size;m++)n.modules[f][m]&&d.fillRect(c+m*l,c+f*l,l,l);this.#r=e}}#h(){let t=this.#t;t.hidden=!0,t.width=0,t.height=0,this.#r=""}#l(t,e){let i=this.#t,s=t?.trim()||e,n=i.style.color;i.style.color="",i.style.color=s,i.style.color||(console.warn(`<qr-code>: "${s}" is not a valid colour; using ${e}.`),i.style.color=e);let o=getComputedStyle(i).color;i.style.color=n;let a=(o.match(/[\d.]+/g)||[]).map(Number),l=[a[0]??0,a[1]??0,a[2]??0,a[3]??1];return{css:o,rgba:l}}#o(t,e){if(!this.hasAttribute("color")&&!this.hasAttribute("background"))return;let i=`${t.css}|${e.css}`;if(i===this.#n)return;this.#n=i;let s=_s(t.rgba,e.rgba);s.length&&console.warn(`<qr-code>: color="${t.css}" on background="${e.css}" may not scan: ${s.join("; ")}.`,this)}toDataURL(t="image/png"){return!this.#t||!this.#r?"":this.#t.toDataURL(t)}async copy({button:t}={}){let e=this.#t;if(!e||!this.#r)return!1;let i=this.#r,s=await new Promise(n=>e.toBlob(n,"image/png"));return Es({text:i,blob:s||void 0},{button:t,announceMessage:this.getAttribute("data-label-copied")||"QR code copied"})}};g("qr-code",Be);var Zn="Slide to confirm",Qn="Confirmed!",to="Press Enter to confirm",Ns=6,je=class extends b{static formAssociated=!0;static observedAttributes=["label","activated-label","data-label-hint","required","value"];#t;#e;#i;#s;#r;#n=!1;#a=0;#c=0;#h=0;#l=0;#o=!1;#u=!1;#p=!1;#d="";#f;constructor(){super(),this.#t=this.attachInternals(),this._adoptInternals(this.#t)}get activated(){return this.#o}get#k(){let t=this.getAttribute("threshold"),e=Number(t);return t!==null&&t.trim()!==""&&!isNaN(e)?Math.min(100,Math.max(0,e)):90}get#w(){return this.getAttribute("label")||this.#d||Zn}get#m(){return this.getAttribute("activated-label")||Qn}get#v(){return getComputedStyle(this).direction==="rtl"}setup(){this.#p||(this.#y(),this.#p=!0),this.listen(this.#e,"pointerdown",this.#x),this.listen(this.#e,"keydown",this.#$),this.listen(this.#e,"transitionend",this.#P)}teardown(){this.#n&&this.#E(),clearTimeout(this.#f),this.removeAttribute("transitioning")}attributeChangedCallback(t,e,i){e===i||!this.#p||(this.#g(),(t==="required"||t==="value")&&this.#T())}#y(){this.#d=(this.textContent||"").replace(/\s+/g," ").trim(),this.#r=document.createElement("div"),this.#r.className="slide-track",this.#i=document.createElement("span"),this.#i.className="slide-label",this.#i.setAttribute("role","status"),this.#s=document.createElement("span"),this.#s.className="visually-hidden slide-hint",this.#s.id=`slide-hint-${Math.random().toString(36).slice(2,9)}`,this.#e=document.createElement("div"),this.#e.className="slide-handle",this.#e.setAttribute("role","slider"),this.#e.setAttribute("aria-valuemin","0"),this.#e.setAttribute("aria-valuemax","100"),this.#e.setAttribute("aria-describedby",this.#s.id),this.#e.setAttribute("tabindex","0"),this.#e.innerHTML='<icon-wc name="chevrons-right" size="sm"></icon-wc>',this.#r.append(this.#i,this.#e),this.textContent="",this.append(this.#r,this.#s),this.#g(),this.#M(0),this.#T()}#g(){let t=this.#w;this.#i.textContent=this.#o?this.#m:t,this.#e.setAttribute("aria-label",t),this.#s.textContent=this.getAttribute("data-label-hint")||to,this.#b()}#b(){this.#e.setAttribute("aria-valuetext",this.#o?this.#m:`${Math.round(this.#a)}%`)}#T(){let t=this.getAttribute("value")||"on";this.#t.setFormValue(this.#o?t:null),this.hasAttribute("required")&&!this.#o?this.#t.setValidity({valueMissing:!0},`${this.#w} to continue.`,this.#e):this.#t.setValidity({})}reset(){this.#o=!1,this.removeAttribute("data-activated"),this.#e.removeAttribute("aria-disabled"),this.#A(),this.#M(0),this.#g(),this.#T(),this.dispatchEvent(new CustomEvent("slide-accept:reset",{bubbles:!0}))}formResetCallback(){(this.#o||this.#a!==0)&&this.reset()}formDisabledCallback(t){this.#u=t,t&&this.#n&&(this.#E(),this.#I()),this.#A()}#A(){this.#e&&(this.#o||this.#u?this.#e.setAttribute("aria-disabled","true"):this.#e.removeAttribute("aria-disabled"))}#x=t=>{if(!(this.#o||this.#u)&&t.button===0){if(t.preventDefault(),this.#e.focus({preventScroll:!0}),this.hasAttribute("transitioning")){let e=this.#e.getBoundingClientRect(),i=this.#r.getBoundingClientRect(),s=parseFloat(getComputedStyle(this.#r).getPropertyValue("--_handle-inset")||"0"),n=this.#e.offsetWidth,o=i.width-n-s*2,a=this.#v?i.right-e.right-s:e.left-i.left-s;this.removeAttribute("transitioning"),clearTimeout(this.#f),this.#M(o>0?Math.max(0,Math.min(100,a/o*100)):0)}this.#n=!0,this.#c=t.clientX,this.#h=this.#a,this.#l=0;try{this.#e.setPointerCapture(t.pointerId)}catch{}this.setAttribute("data-dragging",""),this.#e.addEventListener("pointermove",this.#S),this.#e.addEventListener("pointerup",this.#L),this.#e.addEventListener("pointercancel",this.#C)}};#S=t=>{if(!this.#n)return;let e=this.#r.getBoundingClientRect().width-this.#e.offsetWidth;if(e<=0)return;let i=t.clientX-this.#c;this.#l=Math.max(this.#l,Math.abs(i));let n=(this.#v?-i:i)/e*100;this.#M(Math.min(100,Math.max(0,this.#h+n)))};#E(t){if(this.#n=!1,this.removeAttribute("data-dragging"),t)try{this.#e.releasePointerCapture(t.pointerId)}catch{}this.#e.removeEventListener("pointermove",this.#S),this.#e.removeEventListener("pointerup",this.#L),this.#e.removeEventListener("pointercancel",this.#C)}#L=t=>{if(!this.#n)return;let e=this.#l<Ns&&Math.abs(t.clientX-this.#c)<Ns;this.#E(t),e||this.#a>=this.#k?this.#N():this.#I()};#C=t=>{this.#n&&(this.#E(t),this.#I())};#$=t=>{if(this.#o||this.#u)return;let e=t.shiftKey?20:5,i=this.#v,s=i?"ArrowLeft":"ArrowRight",n=i?"ArrowRight":"ArrowLeft";t.key===s||t.key==="ArrowUp"?(t.preventDefault(),this.#M(Math.min(100,this.#a+e)),this.#a>=this.#k&&this.#N()):t.key===n||t.key==="ArrowDown"?(t.preventDefault(),this.#M(Math.max(0,this.#a-e))):t.key==="End"||t.key==="Enter"||t.key===" "?(t.preventDefault(),this.#N()):t.key==="Home"&&(t.preventDefault(),this.#M(0))};#P=()=>{this.removeAttribute("transitioning")};#N(){this.#o||(this.#o=!0,this.#M(100),this.setAttribute("data-activated",""),this.#A(),this.#g(),this.#T(),this.dispatchEvent(new CustomEvent("slide-accept:accept",{bubbles:!0})))}#I(){this.setAttribute("transitioning",""),this.#M(0),clearTimeout(this.#f),this.#f=setTimeout(()=>{this.removeAttribute("transitioning")},500)}#M(t){this.#a=t,this.style.setProperty("--_slide-position",String(t)),this.#e.setAttribute("aria-valuenow",String(Math.round(t))),this.#b()}};g("slide-accept",je);var Dt="banner",Ps=365,Is=864e5;function $s(r){if(r===0||r==="0"||r==="never")return;let t=r==null||r===""?Ps:Number.parseFloat(String(r));return Number.isFinite(t)?t>0?t*Is:void 0:Ps*Is}var eo=0,Oe=class extends b{#t=null;static get observedAttributes(){return["position"]}get#e(){return this.getAttribute("persist")||Dt}get#i(){return $s(this.getAttribute("expires"))}get#s(){return this.getAttribute("position")==="center"}setup(){return this.#t=this.querySelector("dialog"),this.#t?(this.#r(),this.getAttribute("trigger")&&this.listen(document,"click",this.#u),this.listen(this,"click",this.#o),this.listen(this.#t,"cancel",this.#l),this.#n(),!0):!1}attributeChangedCallback(t,e,i){e===i||!this.#t?.open||(this.#t.close(),this.#a())}#r(){let t=this.#t;if(t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby"))return;let e=t.querySelector("h1, h2, h3, h4, h5, h6");e?(e.id||(e.id=`consent-banner-title-${++eo}`),t.setAttribute("aria-labelledby",e.id)):t.setAttribute("aria-label","Cookie consent")}async#n(){if(await this.#p()){this.getAttribute("trigger")?this.hidden=!0:this.remove();return}this.#c()}#a(){this.#s?this.#t.showModal():this.#t.show()}#c(){!this.isConnected||this.#t.open||this.#a()}#h(){this.#t.close(),this.getAttribute("trigger")?this.hidden=!0:this.remove()}#l=t=>{this.#s&&t.preventDefault()};#o=async t=>{if(!this.#t.open)return;let e=t.target.closest("button[value]");if(!e||!this.#t.contains(e))return;let i=e.value;if(!["accept","reject","save"].includes(i))return;let s=[...this.querySelectorAll('input[type="checkbox"]')],n={};i==="accept"?s.forEach(o=>{n[o.name]=!0}):i==="reject"?s.forEach(o=>{n[o.name]=!!o.disabled}):s.forEach(o=>{n[o.name]=o.checked}),await this.#d({preferences:n,action:i}),this.dispatchEvent(new CustomEvent("consent-banner:change",{bubbles:!0,detail:{preferences:n,action:i}})),this.#h()};#u=async t=>{let e=this.getAttribute("trigger");if(!e||!t.target.closest(e))return;t.preventDefault();let s=await this.#p();if(s?.preferences)for(let[n,o]of Object.entries(s.preferences)){let a=this.querySelector(`input[type="checkbox"][name="${CSS.escape(n)}"]`);a&&!a.disabled&&(a.checked=o)}this.hidden=!1,this.#c()};async#p(){let t=this.#i;try{return await _.get("consent",this.#e,t?{maxAge:t}:void 0)}catch{return null}}async#d(t){try{await _.set("consent",this.#e,t)}catch{}}static async reset(t=Dt){try{await _.remove("consent",t)}catch{}}static async getConsent(t=Dt,e={}){let i=e.expires;i===void 0&&typeof document<"u"&&(i=[...document.querySelectorAll("consent-banner")].find(o=>(o.getAttribute("persist")||Dt)===t)?.getAttribute("expires")??void 0);let s=$s(i);try{return await _.get("consent",t,s?{maxAge:s}:void 0)}catch{return null}}};g("consent-banner",Oe);var io={play:"Play",pause:"Pause",stop:"Stop",reader:"Article reader",controls:"Reader controls",voice:"Voice","loading-voices":"Loading voices\u2026",speed:"Speed",slower:"Slower",faster:"Faster"},zs='[aria-hidden="true"], [hidden], script, style, template, text-reader',so=()=>typeof HTMLElement<"u"&&Object.prototype.hasOwnProperty.call(HTMLElement.prototype,"popover"),De=()=>typeof window<"u"&&"speechSynthesis"in window,At=r=>(r||"").toLowerCase().split(/[-_]/)[0],Fe=class extends b{#t=null;#e=null;#i=[];#s="";#r=0;#n=null;#a=null;#c=null;#h=null;#l=!1;#o=!1;#u=0;#p=null;#d=null;#f=null;#k=null;#w=null;#m=null;#v=null;#y=!1;#g=null;#b=null;#T=[];#A=[];static get observedAttributes(){return["speed","voice","for"]}attributeChangedCallback(t,e,i){if(e!==i&&(t==="for"&&e!==null&&this.hasAttribute("data-upgraded")&&(this.#l&&this.stop(),this.#F(),this.#st(this.#A)),(t==="speed"||t==="voice")&&this.#l&&this.#U(),t==="speed")){let s=this.#Y(parseFloat(i)||1);this.#w&&(this.#w.value=String(s)),this.#m&&(this.#m.textContent=`${s}\xD7`)}}setup(){return De()?(this.getAttribute("variant")==="icon"?this.#C():this.#x(),this.#F(),this.#q(),this.#h=this.#it(),this.#h.then(t=>{this.#A=t,this.#st(t)}),this.listen(window,"beforeunload",this.#at),!0):(this.style.display="none",!1)}teardown(){this.#l&&this.stop(),this.#J(),this.#v?.remove(),this.#b?.remove(),this.#g?.remove(),this.#v=null,this.#b=null,this.#g=null,this.#p=this.#d=this.#f=null,this.#k=null,this.#w=null,this.#m=null,this.#y=!1;for(let{icon:t,slot:e}of this.#T)t.setAttribute("slot",e),this.append(t);this.#T=[]}play(){if(De()){if(this.#o){this.resume();return}this.#l||(this.#_(),this.#K(0))}}pause(){!this.#l||this.#o||(speechSynthesis.pause(),this.#o=!0,this.#G(!0),this.#V("text-reader:pause"))}resume(){this.#o&&(speechSynthesis.resume(),this.#o=!1,this.#G(!1),this.#V("text-reader:resume"))}stop(){!De()||!this.#l||(this.#e=null,speechSynthesis.cancel(),this.#X(),this.#V("text-reader:stop"))}get voices(){return this.#h||this.#it()}get speaking(){return this.#l}get paused(){return this.#o}get progress(){return this.#s.length?Math.min(this.#r/this.#s.length,1):0}#x(){let t=document.createElement("div");t.setAttribute("part","controls"),t.setAttribute("role","group"),t.setAttribute("aria-label",this.#E("reader"));let e=this.#S("play",this.#E("play"),"\u25B6");e.addEventListener("click",()=>this.play());let i=this.#S("pause",this.#E("pause"),"\u23F8");i.hidden=!0,i.addEventListener("click",()=>this.pause());let s=this.#S("stop",this.#E("stop"),"\u23F9");s.disabled=!0,s.addEventListener("click",()=>this.stop());let n=document.createElement("select");n.setAttribute("aria-label",this.#E("voice"));let o=document.createElement("option");o.textContent=this.#E("loading-voices"),n.append(o),n.addEventListener("change",()=>{this.#l&&this.#U()});let a=document.createElement("label");a.setAttribute("data-speed-group","");let l=document.createElement("span");l.setAttribute("data-speed-value","");let c=this.#Y(parseFloat(this.getAttribute("speed")??"1")||1);l.textContent=`${c}\xD7`;let h=document.createElement("input");h.type="range",h.min="0.5",h.max="2",h.step="0.1",h.value=String(c),h.setAttribute("aria-label",this.#E("speed")),h.addEventListener("input",()=>{let u=parseFloat(h.value);l.textContent=`${u}\xD7`,this.#l&&this.#U()}),a.append(l,h),this.#L("icon-play",e),this.#L("icon-pause",i),this.#L("icon-stop",s),t.append(e,i,s,n,a),this.prepend(t),this.#v=t,this.#p=e,this.#d=i,this.#f=s,this.#k=n,this.#w=h,this.#m=l}#S(t,e,i){let s=document.createElement("button");return s.type="button",s.setAttribute("part",`button ${t}`),s.setAttribute("aria-label",e),s.textContent=i,s}#E(t){return this.getAttribute(`data-label-${t}`)||io[t]}#L(t,e){let i=this.querySelector(`:scope > [slot="${t}"]`);i&&(i.removeAttribute("slot"),e.textContent="",e.append(i),this.#T.push({icon:i,slot:t}))}#C(){this.#y=!0;for(let i of this.querySelectorAll(':scope > [part="trigger"]'))i.remove();let t=document.createElement("button");t.type="button",t.setAttribute("part","trigger"),t.setAttribute("aria-label",this.#E("reader")),t.setAttribute("aria-pressed","false");let e=this.querySelector(':scope > [slot="icon-trigger"]');if(e)e.removeAttribute("slot"),t.append(e),this.#T.push({icon:e,slot:"icon-trigger"});else{let i=document.createElement("icon-wc");i.setAttribute("name","volume-2"),i.setAttribute("aria-hidden","true"),t.append(i)}t.addEventListener("click",()=>this.#P()),this.append(t),this.#g=t,this.#$()}#$(){let t=document.createElement("div");t.setAttribute("data-text-reader-toolbar",""),t.setAttribute("role","group"),t.setAttribute("aria-label",this.#E("controls")),t.hidden=!0,so()&&(t.popover="manual");let e=this.#S("play",this.#E("play"),"\u25B6");e.addEventListener("click",()=>this.play());let i=this.#S("pause",this.#E("pause"),"\u23F8");i.hidden=!0,i.addEventListener("click",()=>this.pause());let s=this.#S("stop",this.#E("stop"),"\u23F9");s.addEventListener("click",()=>this.stop());let n=this.#S("speed-down",this.#E("slower"),"\u2212");n.addEventListener("click",()=>this.#R(-.1));let o=document.createElement("span");o.setAttribute("data-speed-value","");let a=this.#Y(parseFloat(this.getAttribute("speed")??"1")||1);o.textContent=`${a}\xD7`;let l=this.#S("speed-up",this.#E("faster"),"+");l.addEventListener("click",()=>this.#R(.1)),this.#L("icon-play",e),this.#L("icon-pause",i),this.#L("icon-stop",s),t.append(e,i,s,n,o,l),this.append(t),this.#p=e,this.#d=i,this.#f=s,this.#m=o,this.#b=t,this.listen(document,"pointerdown",this.#z),this.listen(document,"keydown",this.#D)}#P(){if(!this.#l){this.play();return}this.#b?.hidden&&this.#N(),this.#o?this.resume():this.pause()}#N(){if(!this.#b||!this.#g)return;let t=this.#b;t.hidden=!1,t.popover&&!t.matches(":popover-open")&&t.showPopover(),t.style.visibility="hidden",requestAnimationFrame(()=>{this.#M(),t.style.visibility=""})}#I(){let t=this.#b;if(!t||t.hidden)return;let e=t.contains(document.activeElement);t.popover&&t.matches(":popover-open")&&t.hidePopover(),t.hidden=!0,e&&this.#g?.focus()}#M(){let t=this.#b,e=this.#g;if(!t||!e)return;let i=e.getBoundingClientRect(),s=t.offsetWidth,n=t.offsetHeight,o=8,a=8,l=i.top-n-o;l<a&&(l=i.bottom+o);let c=i.left+i.width/2-s/2,h=window.innerWidth-s-a;c=Math.max(a,Math.min(c,h)),t.style.top=`${l}px`,t.style.left=`${c}px`}#R(t){let e=parseFloat(this.getAttribute("speed")??"1")||1,i=this.#Y(e+t);this.setAttribute("speed",String(i))}#z=t=>{!this.#b||this.#b.hidden||this.#b.contains(t.target)||this.#g?.contains(t.target)||this.#I()};#D=t=>{if(t.key==="Escape"&&this.#b&&!this.#b.hidden){let e=this.#b.contains(document.activeElement)||this.#g===document.activeElement;this.#I(),e&&this.#g?.focus()}};#F(){let t=this.getAttribute("for");if(!t){console.warn('<text-reader>: missing "for" attribute'),this.#B();return}if(this.#t=document.getElementById(t),!this.#t){console.warn(`<text-reader>: no element found with id="${t}"`),this.#B();return}this.#_(),this.#O()}#B(){this.#p&&(this.#p.disabled=!0),this.#f&&(this.#f.disabled=!0)}#O(){this.#p&&(this.#p.disabled=!1)}#_(){let t=this.#t;if(!t)return;let e=this.getAttribute("selectors")||"p,li",i=[...t.querySelectorAll(e)],s=o=>o.closest("pre")||o.closest("code")||o.closest(zs);this.#i=[];let n=0;for(let o of i){if(s(o))continue;let a=[],l="",c=document.createTreeWalker(o,NodeFilter.SHOW_TEXT,{acceptNode:h=>h.parentElement?.closest(zs)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(;c.nextNode();){let h=c.currentNode,u=h.data;u&&(a.push({node:h,start:l.length,end:l.length+u.length}),l+=u)}l.trim()&&(this.#i.push({element:o,text:l,speechStart:n,speechEnd:n+l.length,segments:a}),n+=l.length+1)}this.#s=this.#i.map(o=>o.text).join(" ")}#j(){return this.#t?.closest("[lang]")?.getAttribute("lang")||document.documentElement.lang||""}#K(t){if(!this.#s)return;let e=t>0?this.#s.slice(t):this.#s;if(!e.trim())return;let i=e.replace(/[<>]/g," "),s=new SpeechSynthesisUtterance(i),n=this.#j();n&&(s.lang=n),s.rate=this.#Y(parseFloat(this.#w?.value??this.getAttribute("speed")??"1")||1);let o=this.#k?.selectedOptions[0];if(o?.dataset.voiceUri){let a=speechSynthesis.getVoices().find(l=>l.voiceURI===o.dataset.voiceUri);a&&(s.voice=a)}else if(n){let a=At(n),l=speechSynthesis.getVoices(),c=l.find(h=>h.lang.toLowerCase()===n.toLowerCase())||l.find(h=>At(h.lang)===a&&h.default)||l.find(h=>At(h.lang)===a);c&&(s.voice=c)}s.onboundary=a=>{if(this.#e!==s||a.name!=="word")return;let l=t+a.charIndex;this.#r=l;let c=a.charLength;if(!c){let u=this.#s.slice(l).match(/^\S+/);c=u?u[0].length:1}this.#Z(l,c),this.#V("text-reader:word",{word:this.#s.slice(l,l+c),charIndex:l,element:this.#Q(l)?.element})},s.onend=()=>{if(this.#e!==s)return;let a=Date.now()-this.#u;this.#X(),this.#V("text-reader:end",{duration:a})},s.onerror=a=>{if(this.#e===s){if(a.error==="interrupted"||a.error==="canceled"){this.#X(),this.#V("text-reader:stop");return}console.warn("<text-reader>: SpeechSynthesisUtterance error:",a.error),this.#X(),this.#V("text-reader:error",{error:a.error})}},this.#e=s,this.#l=!0,this.#o=!1,this.#u=Date.now(),this.#r=t,this.#nt(!0),speechSynthesis.cancel(),speechSynthesis.speak(s),this.#W(),this.#V("text-reader:play",{voice:s.voice?.name,speed:s.rate})}#U(){let t=this.#r;this.#e=null,speechSynthesis.cancel(),this.#H(),requestAnimationFrame(()=>this.#K(t))}#W(){this.#H(),this.#n=setInterval(()=>{if(!speechSynthesis.speaking){this.#H();return}speechSynthesis.pause(),speechSynthesis.resume()},1e4)}#H(){this.#n&&clearInterval(this.#n),this.#n=null}#q(){if(!CSS.highlights)return;let t=new CSSStyleSheet;t.replaceSync(`
1249
+ `,mt=null;function es(r){if("adoptedStyleSheets"in r&&typeof CSSStyleSheet=="function"&&"replaceSync"in CSSStyleSheet.prototype)return mt||(mt=new CSSStyleSheet,mt.replaceSync(ts)),r.adoptedStyleSheets.includes(mt)||(r.adoptedStyleSheets=[...r.adoptedStyleSheets,mt]),null;let t=document.createElement("style");return t.textContent=ts,t}fe();var ge="http://www.w3.org/2000/svg",an={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"},ln=0;function cn(){let r=document.createElement("div");r.setAttribute("part","marker"),r.setAttribute("aria-hidden","true");let t=document.createElementNS(ge,"svg");t.setAttribute("viewBox","0 0 24 36"),t.setAttribute("focusable","false");let e=document.createElementNS(ge,"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 i=document.createElementNS(ge,"circle");return i.setAttribute("class","dot"),i.setAttribute("cx","12"),i.setAttribute("cy","12"),i.setAttribute("r","5"),t.append(e,i),r.append(t),r}function S(r,t={},e){let i=document.createElement(r);for(let[s,n]of Object.entries(t))i.setAttribute(s,n);return e!=null&&(i.textContent=e),i}function ns(r){return!r||typeof r!="string"?!1:typeof CSS<"u"&&CSS.supports("color",r)}var be=class extends b{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;#e=null;#i=0;#s=!1;#r=!1;#n=!1;#a=!1;#c=!1;#h=`geo-map-${++ln}`;#l=null;#o="";#u=new Map;#p="";#d=null;#f=0;#k=null;#y=null;#m=()=>this.#I();#v=0;#w="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 ns(t)?t:""}get provider(){let t=this.getAttribute("provider");return t&&(t in U||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}#g(t,e={}){return(this.getAttribute(`data-label-${t}`)??an[t]??"").replace(/\{(\w+)\}/g,(s,n)=>n in e?String(e[n]):s)}get#b(){return this.interactive!=="none"&&!this.staticOnly}get#T(){return this.loading==="consent"&&!this.#r}#A(){let t=this.provider;if(t!=="carto-auto")return t;let e=this.closest("[data-mode]")?.getAttribute("data-mode");return e==="dark"?"carto-dark":e==="light"?"carto-light":window.matchMedia?.("(prefers-color-scheme: dark)").matches?"carto-dark":"carto-light"}#x(){if(this.tileUrl)try{return new URL(this.tileUrl.replace(/\{s\}/g,"a"),location.href).origin}catch{return""}return(U[this.#w]??U.osm).origin}#S(){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 a=this.#E(i);if(a)return a}let s=this.querySelector("address[data-lat][data-lng]");if(s){let a=parseFloat(s.dataset.lat??""),l=parseFloat(s.dataset.lng??"");if(!isNaN(a)&&!isNaN(l))return{lat:a,lng:l}}let n=this.getAttribute("place");if(n){let a=this.#L(n);if(a)return a}let o=document.querySelector('meta[name="geo.position"]');if(o){let l=(o.getAttribute("content")||"").split(";");if(l.length===2){let c=parseFloat(l[0]),h=parseFloat(l[1]);if(!isNaN(c)&&!isNaN(h))return{lat:c,lng:h}}}return null}#E(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),s=parseFloat(e.dataset.lng);if(!isNaN(i)&&!isNaN(s))return{lat:i,lng:s}}return e.tagName==="SCRIPT"&&e.type==="application/ld+json"?this.#C(e):null}#L(t){let e=document.querySelectorAll('script[type="application/ld+json"]');for(let i of e)try{let s=JSON.parse(i.textContent);if(s.name===t){let n=s.geo;if(n){let o=parseFloat(n.latitude),a=parseFloat(n.longitude);if(!isNaN(o)&&!isNaN(a))return{lat:o,lng:a}}}}catch{}return null}#C(t){try{let i=JSON.parse(t.textContent).geo;if(i){let s=parseFloat(i.latitude),n=parseFloat(i.longitude);if(!isNaN(s)&&!isNaN(n))return{lat:s,lng:n}}}catch{}return null}#$(){let t=n=>(n||"").replace(/\s+/g," ").trim(),e=t(this.getAttribute("label"));if(e)return e;let i=t(this.querySelector("address")?.textContent),s=this.getAttribute("src");if(!i&&s){let n=document.getElementById(s);if(n?.tagName==="ADDRESS")i=t(n.textContent);else if(n?.tagName==="SCRIPT")try{i=t(JSON.parse(n.textContent||"").name)}catch{}}return i||(i=t(this.getAttribute("place"))),i?this.#g("map-of",{name:i}):this.#g("map")}setup(){if(this.#i++,this.#w=this.#A(),this.render(),this.#P(),this.#N(),this.#z(),this.interactive==="eager"&&!this.#n&&this.#b&&!this.#T&&this.#l){let t=this.#i;requestAnimationFrame(()=>{t===this.#i&&this.#O({focus:!1})})}}attributeChangedCallback(t,e,i){e===i||this.#s||!this.isConnected||!this.hasAttribute("data-upgraded")||this._reinit()}teardown(){this.#i++,this.#e=null,this.#t&&(this.#t.destroy(),this.#t=null,this.setState("active",!1)),this.#d?.disconnect(),this.#d=null,cancelAnimationFrame(this.#f),this.#k?.disconnect(),this.#k=null,this.#y?.removeEventListener("change",this.#m),this.#y=null,clearTimeout(this.#v)}#P(){typeof ResizeObserver=="function"&&(this.#d=new ResizeObserver(()=>{cancelAnimationFrame(this.#f),this.#f=requestAnimationFrame(()=>this.#z())}),this.#d.observe(this))}#N(){this.provider!=="carto-auto"||this.tileUrl||(this.#k=new MutationObserver(()=>this.#I()),this.#k.observe(document.documentElement,{attributes:!0,attributeFilter:["data-mode"]}),this.#y=window.matchMedia?.("(prefers-color-scheme: dark)")??null,this.#y?.addEventListener("change",this.#m))}#I(){this.#A()!==this.#w&&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,i={...e};if(t.lat!=null&&!isNaN(Number(t.lat))&&(i.lat=Number(t.lat)),t.lng!=null&&!isNaN(Number(t.lng))&&(i.lng=Number(t.lng)),t.zoom!=null&&!isNaN(Number(t.zoom))&&(i.zoom=Number(t.zoom)),t.marker!=null&&(i.marker=!!t.marker),"markerColor"in t&&(ns(t.markerColor)?i.markerColor=t.markerColor:t.markerColor||(i.markerColor="")),!(i.lat===e.lat&&i.lng===e.lng&&i.zoom===e.zoom&&i.marker===e.marker&&i.markerColor===e.markerColor)){this.#s=!0;try{i.lat!==e.lat&&this.setAttribute("lat",String(i.lat)),i.lng!==e.lng&&this.setAttribute("lng",String(i.lng)),i.zoom!==e.zoom&&this.setAttribute("zoom",String(i.zoom)),i.marker!==e.marker&&this.setAttribute("marker",i.marker?"true":"false"),i.markerColor!==e.markerColor&&(i.markerColor?this.setAttribute("marker-color",i.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.#S();return t?[{lat:t.lat,lng:t.lng,color:this.markerColor}]:[]}render(){let t=this.shadowRoot,e=es(t);this.removeAttribute("data-ready"),this.#c=!1,this.#u=new Map,this.#p="",this.#l=this.#S(),this.#o=this.#$();let i=this.#l!==null,s=i&&this.#T,n=S("div",{part:"container"}),o=S("div",{part:"viewport",role:"img","aria-label":this.#o});if(o.append(S("div",{part:"tiles"})),this.showMarker&&i){let h=cn();this.markerColor&&h.style.setProperty("--_marker-color",this.markerColor),o.append(h)}if(n.append(o),s){n.setAttribute("data-consent","");let h=S("div",{part:"overlay"}),u=S("button",{part:"activate",type:"button"},this.#g("consent")),p=this.#x().replace(/^https?:\/\//,""),d=S("p",{part:"consent-note"},this.#g("consent-note",{host:p}));h.append(u,d),h.addEventListener("click",()=>this.#F());let f=()=>this.#B();h.addEventListener("pointerenter",f,{once:!0}),u.addEventListener("focus",f,{once:!0}),n.append(h)}else if(i&&this.#b){let h=S("div",{part:"overlay"});h.append(S("button",{part:"activate",type:"button"},this.#g("activate"))),h.addEventListener("click",()=>this.#O({focus:!0})),n.append(h)}if(i&&this.#b){let h=S("div",{part:"controls",role:"group","aria-label":this.#g("controls")}),u=[["zoom-in","+",this.#g("zoom-in"),()=>this.#t?.zoomBy(1)],["zoom-out","\u2212",this.#g("zoom-out"),()=>this.#t?.zoomBy(-1)],["recenter","\u2316",this.#g("recenter"),()=>this.#t?.recenter()],["exit","\u2715",this.#g("exit"),()=>this.#j()]];for(let[p,d,f,m]of u){let y=S("button",{part:`control ${p}`,type:"button","aria-label":f,title:f},d);y.addEventListener("click",m),h.append(y)}n.append(h)}let a=S("div",{part:"caption"}),l=S("slot");a.append(l),n.append(a);let c=()=>{let h=l.assignedNodes().some(u=>u.nodeType===1||(u.textContent||"").trim());n.toggleAttribute("data-caption",h)};l.addEventListener("slotchange",c),n.toggleAttribute("data-caption",[...this.childNodes].some(h=>h.nodeType===1&&!h.hasAttribute("slot")||h.nodeType===3&&(h.textContent||"").trim())),n.append(this.#M()),n.append(S("p",{part:"instructions",id:`${this.#h}-help`,hidden:""},this.#g("instructions"))),n.append(S("p",{part:"status",role:"status","aria-live":"polite"})),t.replaceChildren(...e?[e]:[],n),i||this.handleError("Missing or invalid lat/lng coordinates",this.#g("error-coords"))}#M(){let t=S("div",{part:"attribution"}),e=S("slot",{name:"attribution"}),i;if(this.tileUrl){let n=(this.getAttribute("attribution")||"").trim(),o=this.getAttribute("attribution-href")||"";i=n?[{text:n,href:o}]:[]}else i=(U[this.#w]??U.osm).credits;i.forEach((n,o)=>{o&&e.append(document.createTextNode(" "));let a="";if(n.href)try{let l=new URL(n.href,location.href);(l.protocol==="https:"||l.protocol==="http:")&&(a=l.href)}catch{}e.append(a?S("a",{href:a,target:"_blank",rel:"noopener noreferrer"},n.text):S("span",{},n.text))});let s=()=>{t.hidden=i.length===0&&e.assignedNodes().length===0};return e.addEventListener("slotchange",s),t.hidden=i.length===0&&!this.querySelector(':scope > [slot="attribution"]'),t.append(e),t}#R(){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"]')}}#z(){let t=this.clientWidth,e=this.clientHeight;if(this.#t){this.#t.resize(t,e);return}if(!this.#l||this.#T||!t||!e)return;let i=`${t}x${e}`;i!==this.#p&&(this.#p=i,this.loadTiles(t,e))}loadTiles(t=this.clientWidth,e=this.clientHeight){let{tiles:i}=this.#R();if(!i||!this.#l||!t||!e)return;let s=this.zoom,{lat:n,lng:o}=this.#l,a=st(n,o,s),l=Math.pow(2,s),c=a.x-t/2,h=a.y-e/2,u=Math.floor(c/256),p=Math.floor((c+t-1)/256),d=Math.max(0,Math.floor(h/256)),f=Math.min(l-1,Math.floor((h+e-1)/256));i.style.transform=`translate(${Math.round(u*256-c)}px, ${Math.round(d*256-h)}px)`;let m=new Set;for(let y=d;y<=f;y++)for(let w=u;w<=p;w++){let k=`${w}/${y}`;m.add(k);let A=this.#u.get(k);if(!A){let T=(w%l+l)%l;A=document.createElement("img"),A.alt="",A.loading=this.loading==="eager"?"eager":"lazy",A.decoding="async",A.draggable=!1,A.addEventListener("load",()=>this.#D()),A.addEventListener("error",()=>this.#D()),A.src=Nt(this.#w,s,T,y,this.tileUrl),this.#u.set(k,A),i.append(A)}A.style.left=`${(w-u)*256}px`,A.style.top=`${(y-d)*256}px`}for(let[y,w]of this.#u)m.has(y)||(w.remove(),this.#u.delete(y));this.#D()}#D(){if(this.#c||this.#t||!this.#l||this.#u.size===0)return;let t=[...this.#u.values()];if(t.every(e=>e.complete)){if(this.#c=!0,t.every(e=>e.naturalWidth===0)){this.handleError("Failed to load map tiles",this.#g("error-tiles"));return}this.setAttribute("data-ready",""),this.dispatchEvent(new CustomEvent("geo-map:ready",{bubbles:!0,detail:{lat:this.#l.lat,lng:this.#l.lng,zoom:this.zoom}}))}}#F(){this.#r=!0,this._reinit(),this.#b&&this.#O({focus:!0})}#B(){if(this.#a)return;this.#a=!0;let t=this.#x();if(!t||t===location.origin||document.head.querySelector(`link[rel~="preconnect" i][href="${CSS.escape(t)}"]`))return;let e=document.createElement("link");e.rel="preconnect",e.href=t,document.head.appendChild(e)}#O({focus:t=!0}={}){if(this.#t)return Promise.resolve();if(this.#e)return this.#e;if(!this.#l||!this.#b||this.#T)return Promise.resolve();let e=this.#i,i=(async()=>{let{MapInteraction:s}=await Promise.resolve().then(()=>(rs(),ss));if(!this.isConnected||e!==this.#i||this.#t||!this.#l)return;let{container:n,viewport:o,tiles:a,marker:l}=this.#R();if(!n||!o||!a)return;for(let u of this.#u.values())u.remove();this.#u.clear(),n.setAttribute("data-active",""),o.setAttribute("role","region"),o.setAttribute("aria-roledescription","map"),o.setAttribute("aria-describedby",`${this.#h}-help`),o.setAttribute("tabindex","0"),this.setState("active",!0);let{lat:c,lng:h}=this.#l;this.#t=new s({host:this,viewport:o,tiles:a,marker:l,lat:c,lng:h,zoom:this.zoom,provider:this.#w,tileUrl:this.tileUrl,width:this.clientWidth,height:this.clientHeight,onDeactivate:()=>this.#j(),onMove:u=>this.#_(u)}),t&&o.focus({preventScroll:!0}),this.dispatchEvent(new CustomEvent("geo-map:activate",{bubbles:!0,detail:{lat:c,lng:h,zoom:this.zoom}}))})();return this.#e=i,i.finally(()=>{this.#e===i&&(this.#e=null)}),i}#_(t){clearTimeout(this.#v),this.#v=window.setTimeout(()=>{let{status:e}=this.#R();e&&(e.textContent=this.#g("moved",{lat:t.lat.toFixed(4),lng:t.lng.toFixed(4),zoom:t.zoom}))},400)}#j(){if(!this.#t)return;let t=!!this.shadowRoot?.activeElement;this.#n=!0,this._reinit(),t&&this.shadowRoot?.querySelector('[part="activate"]')?.focus()}handleError(t,e=t){let{container:i}=this.#R();i&&(i.setAttribute("data-state","error"),i.setAttribute("data-error",e)),this.dispatchEvent(new CustomEvent("geo-map:error",{bubbles:!0,detail:{message:t}}))}};g("geo-map",be);var os="popover"in HTMLElement.prototype;var us=null;function vn(){return us??=Promise.resolve().then(()=>(ye(),ve)),us}var yn=150,ds="vb-emoji-recent",rt=8,ps=4,wn=0,kn={Trigger:"Open emoji picker",Dialog:"Emoji picker",Search:"Search emoji",Placeholder:"Search emoji\u2026",Categories:"Emoji categories",Emoji:"Emoji",Recent:"Recently used",Empty:"No emoji found",Results:"{count} emoji found"},we=class extends b{#t=null;#e;#i;#s;#r;#n;#a;#c;#h=new Map;#l=new WeakMap;#o=null;#u=!1;#p=!1;#d=!1;#f=!1;#k=-1;#y=0;#m=null;#v;#w=()=>{};#g=null;#b="";#T=null;#A=null;#x=new Set;#S=!1;#E=null;#L=null;constructor(){super(),this.#v=new Promise(t=>{this.#w=t})}get ready(){return this.#v}get isOpen(){return this.#u}setup(){if(this.#d)return!1;this.#d=!0,this.#P(),this.listen(this,"click",this.#rt),this.listen(this,"keydown",this.#nt),this.listen(this,"focusout",this.#st),this.listen(this,"focusin",this.#tt);let t=++this.#y;return vn().then(e=>{if(t!==this.#y||!this.isConnected)return;this.#T=e,this.#p||this.#N(),this.listen(document,"click",this.#it),this.listen(document,e.EXTENDED_EVENT,this.#X),this.setAttribute("data-upgraded",""),this.#w(),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent("emoji-picker:upgraded",{bubbles:!0}))});let i=this.#m;this.#m=null,i==="open"&&this.open()}).catch(e=>{console.error("[emoji-picker] failed to load emoji data",e)}),!1}teardown(){this.#y++,this.#d=!1,this.#m=null,this.#g&&(clearTimeout(this.#g),this.#g=null,this.setState("search-pending",!1)),this.#u&&this.close()}#C(t,e){return this.dataset[`label${t}`]||e||kn[t]||""}#$(t){if(t==="recent")return this.#C("Recent");let e=t.charAt(0).toUpperCase()+t.slice(1);return this.#C(e,this.#T.EMOJI_GROUP_LABELS[t]||t)}#P(){let t=this.querySelector(":scope > [data-trigger]")||this.querySelector(":scope > button");t||(t=document.createElement("button"),t.type="button",t.textContent="\u{1F600}",t.setAttribute("data-trigger",""),this.prepend(t)),this.#t=t,t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-expanded",String(this.#u)),!t.hasAttribute("aria-label")&&!/\p{L}/u.test(t.textContent||"")&&t.setAttribute("aria-label",this.#C("Trigger"))}#N(){let t=`emoji-picker-${++wn}`;this.#e=document.createElement("div"),this.#e.className="picker",this.#e.id=`${t}-panel`,this.#e.setAttribute("role","dialog"),this.#e.setAttribute("aria-label",this.#C("Dialog")),this.#e.hidden=!0,this.#S=os,this.#S&&this.#e.setAttribute("popover","manual"),this.#t?.setAttribute("aria-controls",this.#e.id),this.#i=document.createElement("input"),this.#i.type="search",this.#i.placeholder=this.#C("Placeholder"),this.#i.autocomplete="off",this.#i.spellcheck=!1,this.#i.setAttribute("aria-label",this.#C("Search")),this.#i.setAttribute("aria-controls",`${t}-listbox`),this.#i.addEventListener("input",this.#G),this.#s=document.createElement("div"),this.#s.className="categories",this.#s.setAttribute("role","toolbar"),this.#s.setAttribute("aria-label",this.#C("Categories")),this.#T.EMOJI_GROUPS.forEach((e,i)=>{let s=document.createElement("button");s.type="button",s.dataset.group=e,s.tabIndex=i===0?0:-1,s.setAttribute("aria-label",this.#$(e)),s.title=this.#$(e),s.textContent=this.#T.EMOJI_GROUP_ICONS[e],this.#s.appendChild(s)}),this.#r=document.createElement("div"),this.#r.className="grid",this.#r.id=`${t}-listbox`,this.#r.setAttribute("role","listbox"),this.#r.setAttribute("aria-label",this.#C("Emoji")),this.#c=this.#I("recent"),this.#r.appendChild(this.#c);for(let e of this.#T.EMOJI_GROUPS){let i=this.#I(e);this.#h.set(e,i),this.#r.appendChild(i)}this.#n=document.createElement("p"),this.#n.className="no-results",this.#n.textContent=this.#C("Empty"),this.#n.hidden=!0,this.#a=document.createElement("p"),this.#a.className="status",this.#a.setAttribute("role","status"),this.#e.append(this.#i,this.#s,this.#r,this.#n,this.#a),this.appendChild(this.#e),this.#z(),this.#p=!0}#I(t){let e=document.createElement("div");return e.className="group",e.dataset.group=t,e.setAttribute("role","group"),e.setAttribute("aria-label",this.#$(t)),e}#M(t){let e=document.createElement("span");return e.className="group-label",e.setAttribute("aria-hidden","true"),e.textContent=this.#$(t),e}#R(t){let e=document.createElement("button");return e.type="button",e.setAttribute("role","option"),e.tabIndex=-1,e.dataset.shortcode=t.shortcode,e.setAttribute("aria-label",t.name),e.title=`:${t.shortcode}:`,e.textContent=t.emoji,e}#z(){let t=new Map;for(let e of this.#T.EMOJI_GROUPS){let i=this.#h.get(e),s=[this.#M(e)];for(let n of this.#T.getByGroup(e)){let o=t.get(n.emoji);if(o){o.aliases.push(n.shortcode);continue}let a=this.#R(n),l={entry:n,aliases:[]};t.set(n.emoji,l),this.#l.set(a,l),s.push(a)}i.replaceChildren(...s)}this.#k=this.#T.extendedCount(),this.#o=null}#D(){let t=[];for(let e of this.#ct()){let i=this.#T.resolveEmoji(e);if(!i)continue;let s=this.#R(i);this.#l.set(s,{entry:i,aliases:[]}),t.push(s)}t.length&&t.unshift(this.#M("recent")),this.#c.replaceChildren(...t),this.#o=null}#F(t,e){let{entry:i,aliases:s}=t;return i.shortcode.includes(e)||i.name.toLowerCase().includes(e)||(i.keywords?.some(n=>n.includes(e))??!1)||s.some(n=>n.includes(e))}#B(){let t=this.#b.toLowerCase(),e=0;this.#c.hidden=!!t||this.#c.childElementCount===0;for(let i of this.#h.values()){let s=!1;for(let n of i.querySelectorAll('[role="option"]')){let o=this.#l.get(n),a=!t||(o?this.#F(o,t):!1);n.hidden=!a,a&&(s=!0,e++)}i.hidden=!s}this.#n.hidden=e>0,this.#a.textContent=t?e>0?this.#C("Results").replace("{count}",String(e)):this.#C("Empty"):"",(!this.#o||!this.#O(this.#o))&&this.#j(this.#_()[0]??null,!1)}#O(t){return t.isConnected&&!t.hidden&&!t.parentElement.hidden}#_(){return[...this.#r.querySelectorAll('[role="option"]')].filter(t=>this.#O(t))}#j(t,e){this.#o&&this.#o!==t&&(this.#o.tabIndex=-1),this.#o=t,t&&(t.tabIndex=0,e&&(t.focus({preventScroll:!0}),t.scrollIntoView({block:"nearest"})))}#K(t,e){if(t){for(let i of this.#s.querySelectorAll("button"))i.tabIndex=i===t?0:-1;e&&t.focus()}}#U(t){let e;for(let i of this.#s.querySelectorAll("button"))i.dataset.group===t?(i.setAttribute("aria-current","true"),e=i):i.removeAttribute("aria-current");e&&!this.#s.contains(document.activeElement)&&this.#K(e,!1)}#W(){if(this.#A?.disconnect(),this.#x.clear(),!(typeof IntersectionObserver>"u")){this.#A=new IntersectionObserver(t=>{for(let i of t)i.isIntersecting?this.#x.add(i.target):this.#x.delete(i.target);let e=[...this.#r.children].find(i=>this.#x.has(i));this.#U(e?.dataset.group)},{root:this.#r,rootMargin:"-2px 0px -75% 0px"});for(let t of this.#r.children)this.#A.observe(t)}}#H(){return getComputedStyle(this).direction==="rtl"}#q(t,e,i){let s=t[e].getBoundingClientRect(),n=s.left+s.width/2,o=null,a=null,l=1/0;for(let c=e+i;c>=0&&c<t.length;c+=i){let h=t[c].getBoundingClientRect();if(o===null){if(Math.abs(h.top-s.top)<=ps)continue;o=h.top}else if(Math.abs(h.top-o)>ps)break;let u=Math.abs(h.left+h.width/2-n);u<l&&(l=u,a=t[c])}return a}#J(t,e){let i=this.#_(),s=i.indexOf(t);if(s<0)return!1;let n=this.#H(),o=null;switch(e){case"ArrowRight":o=i[n?s-1:s+1];break;case"ArrowLeft":o=i[n?s+1:s-1];break;case"ArrowDown":o=this.#q(i,s,1);break;case"ArrowUp":if(o=this.#q(i,s,-1),!o)return this.#i.focus(),!0;break;case"Home":o=i[0];break;case"End":o=i[i.length-1];break;case"PageDown":{o=i.slice(s+1).find(l=>l.parentElement!==t.parentElement)??i[i.length-1];break}case"PageUp":{let a=i.find(l=>l.parentElement===t.parentElement);if(a&&a!==t)o=a;else{let l=i[s-1]?.parentElement;o=l?i.find(c=>c.parentElement===l):i[0]}break}default:return!1}return o&&this.#j(o,!0),!0}#Z(t,e){let i=[...this.#s.querySelectorAll("button")],s=i.indexOf(t),n=this.#H(),o=-1;if(e==="ArrowRight")o=n?s-1:s+1;else if(e==="ArrowLeft")o=n?s+1:s-1;else if(e==="Home")o=0;else if(e==="End")o=i.length-1;else return!1;return o=(o+i.length)%i.length,this.#K(i[o],!0),!0}#et(){let t=this.getAttribute("for");return t?document.getElementById(t):null}#Q(){let t=this.#et();if(this.#E=null,this.#L=null,!!t){if(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement){let e=null,i=null;try{e=t.selectionStart,i=t.selectionEnd}catch{}e!==null&&i!==null&&(this.#E={start:e,end:i})}else if(t.isContentEditable){let e=window.getSelection();if(e&&e.rangeCount>0){let i=e.getRangeAt(0);t.contains(i.commonAncestorContainer)&&(this.#L=i.cloneRange())}}}}#rt=t=>{let e=t.target.closest?.("button");if(!(!e||!this.contains(e))){if(e===this.#t){this.toggle();return}this.#p&&(e.parentElement===this.#s?this.#Y(e):e.getAttribute("role")==="option"&&this.#V(e))}};#it=t=>{this.#u&&!this.contains(t.target)&&this.close()};#st=t=>{if(!this.#u||this.#f)return;let e=t.relatedTarget;e&&!this.contains(e)&&this.close()};#tt=t=>{let e=t.target;e.getAttribute?.("role")==="option"&&e!==this.#o&&this.#j(e,!1)};#nt=t=>{if(!this.#u)return;if(t.key==="Escape"){t.preventDefault(),t.stopPropagation(),this.close(),this.#t?.focus();return}let e=t.target;if(t.altKey||t.metaKey)return;let i=!1;if(e===this.#i){if(t.key==="ArrowDown"){let s=this.#o&&this.#O(this.#o)?this.#o:this.#_()[0];s&&this.#j(s,!0),i=!0}}else e.parentElement===this.#s?i=this.#Z(e,t.key):e.getAttribute("role")==="option"&&(i=this.#J(e,t.key));i&&t.preventDefault()};#G=()=>{this.#g&&clearTimeout(this.#g),this.setState("search-pending",!0),this.#g=setTimeout(()=>{this.#g=null,this.setState("search-pending",!1),this.#b=this.#i.value.trim(),this.#B(),this.#r.scrollTop=0},yn)};#X=()=>{this.#u&&(this.#z(),this.#B(),this.#W())};#Y(t){let e=t.dataset.group||"";this.#b&&(this.#g&&(clearTimeout(this.#g),this.#g=null),this.setState("search-pending",!1),this.#i.value="",this.#b="",this.#B()),this.#K(t,!1),this.#U(e);let i=this.#h.get(e);if(!i)return;let s=matchMedia("(prefers-reduced-motion: reduce)").matches;this.#r.scrollTo({top:i.offsetTop,behavior:s?"auto":"smooth"});let n=i.querySelector('[role="option"]:not([hidden])');n&&this.#j(n,!1)}#V(t){let e=this.#l.get(t);if(!e)return;let{entry:i}=e;this.#j(t,!1),this.#f=!0;try{this.#ut(i.shortcode);let s=this.#at(i.emoji);this.dispatchEvent(new CustomEvent("emoji-picker:select",{bubbles:!0,detail:{shortcode:i.shortcode,emoji:i.emoji,name:i.name,keywords:i.keywords}})),this.close(),s||this.#t?.focus()}finally{this.#f=!1}}#at(t){let e=this.#et();if(!e)return!1;if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){e.focus();let i=this.#E;if(i)try{e.setSelectionRange(i.start,i.end)}catch{}if(!this.#lt(t)){let s=e.value.length;try{e.setRangeText(t,i?.start??s,i?.end??s,"end")}catch{e.value+=t}e.dispatchEvent(new InputEvent("input",{bubbles:!0,inputType:"insertText",data:t}))}try{let s=e.selectionEnd;this.#E=s===null?null:{start:s,end:s}}catch{this.#E=null}return!0}if(e.isContentEditable){e.focus();let i=window.getSelection();if(!i)return!0;let s=this.#L;if((!s||!e.contains(s.commonAncestorContainer))&&(s=document.createRange(),s.selectNodeContents(e),s.collapse(!1)),i.removeAllRanges(),i.addRange(s),!this.#lt(t)){let n=i.getRangeAt(0);n.deleteContents();let o=document.createTextNode(t);n.insertNode(o),n.setStartAfter(o),n.collapse(!0),i.removeAllRanges(),i.addRange(n),e.dispatchEvent(new InputEvent("input",{bubbles:!0,inputType:"insertText",data:t}))}return this.#L=i.rangeCount?i.getRangeAt(0).cloneRange():null,!0}return!1}#lt(t){try{return document.execCommand("insertText",!1,t)}catch{return!1}}#ct(){try{let t=JSON.parse(localStorage.getItem(ds)||"[]");return Array.isArray(t)?t:[]}catch{return[]}}#ut(t){let e=parseInt(this.getAttribute("recent-limit")??"24",10)||24,i=this.#ct();i=i.filter(s=>s!==t),i.unshift(t),i.length>e&&(i.length=e);try{localStorage.setItem(ds,JSON.stringify(i))}catch{}}#ht(){if(!this.#S||!this.#u||!this.#t)return;let t=this.#t.getBoundingClientRect(),e=this.#e.offsetWidth,i=this.#e.offsetHeight,s=document.documentElement.clientWidth,n=document.documentElement.clientHeight,o=this.#H()?t.right-e:t.left;o=Math.max(rt,Math.min(o,s-e-rt));let a=t.bottom+4;a+i>n-rt&&t.top-i-4>=rt&&(a=t.top-i-4),a=Math.max(rt,Math.min(a,n-i-rt)),this.#e.style.setProperty("--picker-top",`${Math.round(a)}px`),this.#e.style.setProperty("--picker-left",`${Math.round(o)}px`)}#ot=t=>{t.type==="scroll"&&this.#e.contains(t.target)||this.#ht()};open(){if(!this.#p){this.#m="open";return}if(!(this.#u||!this.isConnected)){if(this.#Q(),this.#T.extendedCount()!==this.#k&&this.#z(),this.#D(),this.#i.value="",this.#b="",this.#B(),this.#u=!0,this.setAttribute("open",""),this.#t?.setAttribute("aria-expanded","true"),this.#e.hidden=!1,this.#S){try{this.#e.showPopover()}catch{}this.#ht(),window.addEventListener("scroll",this.#ot,{capture:!0,passive:!0}),window.addEventListener("resize",this.#ot,{passive:!0})}this.#r.scrollTop=0,this.#W(),this.#i.focus(),this.dispatchEvent(new CustomEvent("emoji-picker:open",{bubbles:!0}))}}close(){if(!this.#p){this.#m=null;return}if(this.#u){if(this.#u=!1,this.removeAttribute("open"),this.#t?.setAttribute("aria-expanded","false"),this.#S){try{this.#e.hidePopover()}catch{}window.removeEventListener("scroll",this.#ot,{capture:!0}),window.removeEventListener("resize",this.#ot)}this.#e.hidden=!0,this.#A?.disconnect(),this.#A=null,this.dispatchEvent(new CustomEvent("emoji-picker:close",{bubbles:!0}))}}toggle(){if(!this.#p){this.#m=this.#m==="open"?null:"open";return}this.#u?this.close():this.open()}};g("emoji-picker",we);var nt="data-drag-surface-controls",An="data-drag-surface-live",ke=class r extends b{static observedAttributes=["disabled","data-move-controls","orientation","group","aria-label"];#t=null;#e=null;#i=null;#s=null;#r=null;setup(){this.setAttribute("role","list"),r.#H.add(this),this.#h(),this.#o(),this.#v(),this.listen(this,"click",this.#$.bind(this)),this.#n(),this.#c(),this.#r=new MutationObserver(()=>this.#a()),this.#r.observe(this,{childList:!0}),r.#E()}teardown(){this.#r?.disconnect(),this.#r=null,this.#t&&(this.#t.remove(),this.#t=null),this.#e&&this.#S(this.#e,!1),this.#e=null,this.#i=null,this.removeAttribute("data-reorder-mode"),this.removeAttribute("data-drag-over"),this.#W(),this.#L(),r.#H.delete(this),r.#q?.source===this&&(r.#q=null),r.#E()}attributeChangedCallback(t,e,i){e===i||!this.hasAttribute("data-upgraded")||(t==="disabled"&&this.#c(),r.#E())}get draggableChildren(){return[...this.querySelectorAll(':scope > [draggable="true"]')]}get group(){return this.getAttribute("group")||null}get orientation(){return this.getAttribute("orientation")==="horizontal"?"horizontal":"vertical"}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",!!t)}get sortedOrder(){return this.draggableChildren.map(t=>t.dataset.id)}#n(){for(let t of this.draggableChildren)t.getAttribute("role")||t.setAttribute("role","listitem"),t.hasAttribute("tabindex")||t.setAttribute("tabindex","0")}#a(){this.#n(),this.#e&&this.#e.parentElement!==this&&(this.#S(this.#e,!1),this.#e=null,this.#i=null,this.removeAttribute("data-reorder-mode")),r.#E()}#c(){this.disabled?(this.setAttribute("aria-disabled","true"),this.#e&&this.#x()):this.removeAttribute("aria-disabled")}#h(){let t=document.createElement("span");t.setAttribute(An,""),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),this.after(t),this.#t=t}#l(t){let e=this.#t;e&&(e.textContent="",requestAnimationFrame(()=>{e.textContent=t}))}#o(){this.listen(this,"pointerdown",t=>{this.#s=t.target}),this.listen(this,"dragstart",this.#u.bind(this)),this.listen(this,"dragover",this.#d.bind(this)),this.listen(this,"dragleave",this.#f.bind(this)),this.listen(this,"drop",this.#k.bind(this)),this.listen(this,"dragend",this.#y.bind(this))}#u(t){let e=t.target.closest('[draggable="true"]');if(!e||e.parentElement!==this)return;if(this.disabled){t.preventDefault();return}let i=e.querySelector("[data-drag-handle]");if(i&&!i.contains(this.#s)){t.preventDefault();return}e.setAttribute("data-dragging",""),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e.dataset.id||""),t.dataTransfer.setData("application/x-drag-surface-group",this.group||"");let s=this.#B(e);r.#q={item:e,source:this,originalIndex:s},this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}#p(t){return this.disabled?!1:this.group||t.group?this.group===t.group:t===this}#d(t){let e=r.#q;!e||!this.#p(e.source)||(t.preventDefault(),t.dataTransfer.dropEffect="move",this.setAttribute("data-drag-over",""),this.#U(t.clientX,t.clientY))}#f(t){t.relatedTarget&&!this.contains(t.relatedTarget)&&(this.removeAttribute("data-drag-over"),this.#W())}#k(t){let e=r.#q;if(!e||!this.#p(e.source))return;t.preventDefault();let{item:i,source:s,originalIndex:n}=e,o=this.#K(t.clientX,t.clientY);r.#m(),s===this?(this.#O(i,o),this.#_(),this.#M(i),this.#N(i,n)):(this.#O(i,o),this.#_(),s.#_(),this.#M(i),this.#I(i,s))}#y(){let t=r.#q;r.#m(),r.#q=null,(t?.source??this).dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0}))}static#m(){r.#q?.item.removeAttribute("data-dragging");for(let t of r.#H)t.removeAttribute("data-drag-over"),t.#W()}#v(){this.listen(this,"keydown",this.#g.bind(this)),this.listen(this,"focusout",this.#b.bind(this))}#w(t){let e=t.closest('[draggable="true"]');if(!e||e.parentElement!==this)return null;if(t===e)return e;let i=e.querySelector("[data-drag-handle]");return i&&i===t?e:null}#g(t){let e=this.#w(t.target);if(!e||this.disabled||t.altKey||t.ctrlKey||t.metaKey)return;let i=t.target,s=this.#e===e,n=this.orientation==="horizontal",o=this.#z(),a=n?o?"ArrowRight":"ArrowLeft":"ArrowUp",l=n?o?"ArrowLeft":"ArrowRight":"ArrowDown";if(t.key===" "||t.key==="Enter"){t.preventDefault(),s?this.#A(e):this.#T(e);return}if(t.key===a||t.key===l){t.preventDefault();let u=this.draggableChildren,p=u.indexOf(e),d=t.key===a?Math.max(0,p-1):Math.min(u.length-1,p+1);if(d===p)return;if(!s){u[d].focus();return}this.#O(e,d),i.focus(),this.#l(`Position ${d+1} of ${u.length}`);return}let c=n?"ArrowUp":"ArrowLeft",h=n?"ArrowDown":"ArrowRight";if(s&&(t.key===c||t.key===h)){t.preventDefault();let u=this.#R(t.key===h?1:-1);if(!u)return;this.#e=null,this.#i=null,this.removeAttribute("data-reorder-mode"),this.#P(u,e),i.focus(),u.#e=e,u.#i=u.#B(e),u.setAttribute("data-reorder-mode",""),u.#l(`Moved to ${u.#D()}`);return}t.key==="Escape"&&(t.preventDefault(),s?this.#x():e.blur())}#b(){setTimeout(()=>{let t=this.#e;t&&!t.contains(document.activeElement)&&this.#x()},0)}#T(t){this.#e&&this.#e!==t&&this.#x(),this.#i=this.#B(t),this.#e=t,this.#S(t,!0),this.setAttribute("data-reorder-mode","");let e=this.draggableChildren.length;this.#l(`${this.#F(t)}, grabbed. Position ${this.#i+1} of ${e}. Use arrow keys to move, Enter to drop, Escape to cancel.`),this.dispatchEvent(new CustomEvent("drag-surface:reorder-start",{bubbles:!0}))}#A(t){let e=this.#i;this.#e=null,this.#i=null,this.#S(t,!1),this.removeAttribute("data-reorder-mode"),this.#_(),this.#M(t);let i=this.#B(t);this.#l(`${this.#F(t)}, dropped at position ${i+1} of ${this.draggableChildren.length}`),this.#N(t,e),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0}))}#x(){let t=this.#e;if(!t)return;let e=this.#i;if(this.#e=null,this.#i=null,this.#S(t,!1),this.removeAttribute("data-reorder-mode"),e!=null&&t.parentElement===this&&this.#B(t)!==e){let i=t.contains(document.activeElement)?document.activeElement:null;this.#O(t,e),i?.focus()}this.#l("Reorder cancelled"),this.dispatchEvent(new CustomEvent("drag-surface:reorder-end",{bubbles:!0}))}#S(t,e){t.toggleAttribute("data-grabbed",e);let i=t.querySelector("[data-drag-handle]");i&&(i.localName==="button"||i.getAttribute("role")==="button")&&i.setAttribute("aria-pressed",String(e)),e?t.hasAttribute("aria-description")||(t.setAttribute("aria-description","Grabbed"),t.setAttribute("data-drag-surface-description","")):t.hasAttribute("data-drag-surface-description")&&(t.removeAttribute("aria-description"),t.removeAttribute("data-drag-surface-description"))}static#E(){for(let t of r.#H)t.#C()}#L(){for(let t of this.querySelectorAll(`:scope > [draggable="true"] > [${nt}]`))t.remove()}#C(){if(!this.isConnected)return;if(!this.hasAttribute("data-move-controls")){this.#L();return}let t=this.draggableChildren,e=this.orientation==="horizontal",i=this.#z(),s=this.disabled,n=this.#R(-1),o=this.#R(1),a=e?i?"right":"left":"up",l=e?i?"left":"right":"down",c={up:"\u2191",down:"\u2193",left:"\u2190",right:"\u2192"},h=e?c.up:c.left,u=e?c.down:c.right;t.forEach((p,d)=>{let f=p.querySelector(`:scope > [${nt}]`);if(!f){f=document.createElement("span"),f.setAttribute(nt,"");for(let w of["prev","next","to-prev","to-next"]){let k=document.createElement("button");k.type="button",k.className="ghost small",k.dataset.move=w,f.append(k)}p.append(f)}let m=this.#F(p),y=(w,k,A,T,j=!1)=>{let R=f.querySelector(`[data-move="${w}"]`);R.textContent!==k&&(R.textContent=k),R.setAttribute("aria-label",A),R.setAttribute("aria-disabled",String(T)),R.hidden=j};y("prev",c[a],`Move ${m} ${a}`,s||d===0),y("next",c[l],`Move ${m} ${l}`,s||d===t.length-1),y("to-prev",h,n?`Move ${m} to ${n.#D()}`:"",s,!n),y("to-next",u,o?`Move ${m} to ${o.#D()}`:"",s,!o)})}#$(t){let e=t.target.closest(`[${nt}] > button[data-move]`);if(!e)return;let i=e.closest('[draggable="true"]');if(!i||i.parentElement!==this||(t.preventDefault(),this.disabled||e.getAttribute("aria-disabled")==="true"))return;this.#e&&(this.#S(this.#e,!1),this.#e=null,this.#i=null,this.removeAttribute("data-reorder-mode"));let s=e.dataset.move,n=this;if(s==="prev"||s==="next"){let a=this.#B(i),l=a+(s==="prev"?-1:1);if(l<0||l>=this.draggableChildren.length)return;this.#O(i,l),this.#_(),this.#M(i),this.#l(`${this.#F(i)}, moved to position ${l+1} of ${this.draggableChildren.length}`),this.#N(i,a)}else{let a=this.#R(s==="to-next"?1:-1);if(!a)return;this.#P(a,i),a.#l(`${a.#F(i)}, moved to ${a.#D()}`),n=a}r.#E();let o=i.querySelector(`[${nt}] > [data-move="${s}"]`);o&&!o.hidden?o.focus():n.isConnected&&i.focus()}#P(t,e){t.appendChild(e),t.#_(),this.#_(),t.#M(e),t.#I(e,this)}#N(t,e){this.dispatchEvent(new CustomEvent("drag-surface:reorder",{bubbles:!0,detail:{item:t,itemId:t.dataset.id,oldIndex:e,newIndex:this.#B(t),order:this.sortedOrder}}))}#I(t,e){this.dispatchEvent(new CustomEvent("drag-surface:transfer",{bubbles:!0,detail:{item:t,itemId:t.dataset.id,fromSurface:e,toSurface:this,newIndex:this.#B(t),fromOrder:e.sortedOrder,toOrder:this.sortedOrder}}))}#M(t){t.setAttribute("data-just-dropped",""),t.addEventListener("animationend",()=>{t.removeAttribute("data-just-dropped")},{once:!0}),setTimeout(()=>t.removeAttribute("data-just-dropped"),500)}#R(t){if(!this.group)return null;let e=[...r.#H].filter(n=>n===this||n.group===this.group&&n.isConnected&&!n.disabled);if(e.length<2)return null;let i=this.orientation==="horizontal",s=new Map(e.map(n=>[n,n.getBoundingClientRect()]));return e.sort((n,o)=>{let a=s.get(n),l=s.get(o);return i?a.top-l.top||a.left-l.left:a.left-l.left||a.top-l.top}),e[e.indexOf(this)+t]||null}#z(){return getComputedStyle(this).direction==="rtl"}#D(){let t=this.getAttribute("aria-label");if(t)return t;let e=this.getAttribute("aria-labelledby");if(e){let i=e.split(/\s+/).map(s=>document.getElementById(s)?.textContent.trim()).filter(Boolean).join(" ");if(i)return i}return"another list"}#F(t){let e=t.getAttribute("aria-label");if(e)return e;let i=t.cloneNode(!0);for(let n of i.querySelectorAll(`[${nt}], [aria-hidden="true"], [data-drag-handle]:not(:has(*))`))n.remove();return i.textContent.replace(/\s+/g," ").trim().slice(0,40)||t.dataset.id||"Item"}#B(t){return this.draggableChildren.indexOf(t)}#O(t,e){let s=this.draggableChildren.filter(n=>n!==t)[e]||null;s?this.insertBefore(t,s):this.appendChild(t)}#_(){this.draggableChildren.forEach((t,e)=>{t.dataset.sortOrder=String(e+1)})}#j(t,e){let i=this.orientation==="horizontal",s=i&&this.#z(),n=this.draggableChildren.filter(o=>!o.hasAttribute("data-dragging"));for(let o=0;o<n.length;o++){let a=n[o].getBoundingClientRect(),l;if(i?s?l=t>a.left+a.width/2:l=t<a.left+a.width/2:l=e<a.top+a.height/2,l)return{index:o,children:n}}return{index:n.length,children:n}}#K(t,e){return this.#j(t,e).index}#U(t,e){this.#W();let{index:i,children:s}=this.#j(t,e);i<s.length?s[i].setAttribute("data-drop-target","before"):s.length>0&&s[s.length-1].setAttribute("data-drop-target","after")}#W(){for(let t of this.querySelectorAll("[data-drop-target]"))t.removeAttribute("data-drop-target")}static#H=new Set;static#q=null};g("drag-surface",ke);var D=/Mac|iPhone|iPad|iPod/.test(navigator.platform??""),fs={mac:{meta:"\u2318",cmd:"\u2318",alt:"\u2325",option:"\u2325",shift:"\u21E7",ctrl:"\u2303",control:"\u2303"},other:{meta:"Ctrl",cmd:"Ctrl",alt:"Alt",option:"Alt",shift:"Shift",ctrl:"Ctrl",control:"Ctrl"}},ms={mac:{meta:"Command",cmd:"Command",alt:"Option",option:"Option",shift:"Shift",ctrl:"Control",control:"Control"},other:{meta:"Control",cmd:"Control",alt:"Alt",option:"Alt",shift:"Shift",ctrl:"Control",control:"Control"}},xn={escape:{label:"Esc",spoken:"Escape"},esc:{label:"Esc",spoken:"Escape"},enter:{label:"Enter",spoken:"Enter"},return:{label:"Enter",spoken:"Enter"},tab:{label:"Tab",spoken:"Tab"},space:{label:"Space",spoken:"Space"},backspace:{label:"Backspace",spoken:"Backspace"},delete:{label:"Del",spoken:"Delete"},del:{label:"Del",spoken:"Delete"},insert:{label:"Ins",spoken:"Insert"},home:{label:"Home",spoken:"Home"},end:{label:"End",spoken:"End"},pageup:{label:"PgUp",spoken:"Page up"},pagedown:{label:"PgDn",spoken:"Page down"},arrowup:{label:"\u2191",spoken:"Up arrow"},up:{label:"\u2191",spoken:"Up arrow"},arrowdown:{label:"\u2193",spoken:"Down arrow"},down:{label:"\u2193",spoken:"Down arrow"},arrowleft:{label:"\u2190",spoken:"Left arrow"},left:{label:"\u2190",spoken:"Left arrow"},arrowright:{label:"\u2192",spoken:"Right arrow"},right:{label:"\u2192",spoken:"Right arrow"},"+":{label:"+",spoken:"Plus"},plus:{label:"+",spoken:"Plus"}};function $t(r){return[...String(r??"").trim().toLowerCase().matchAll(/([^+]+|\+)(?:\+|$)/g)].map(e=>e[1].trim()).filter(Boolean).map(e=>e==="plus"?"+":e)}function Ae(r,t=D){let e=t?fs.mac:fs.other;if(r in e)return{label:e[r],spoken:(t?ms.mac:ms.other)[r],modifier:!0};let i=xn[r];if(i)return{...i,modifier:!1};let s=r.toUpperCase();return{label:s,spoken:s,modifier:!1}}function zt(r){return $t(r).map(t=>Ae(t).label).join(D?"":"+")}var En={esc:"escape",return:"enter",del:"delete",ins:"insert",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",space:" ",spacebar:" ",plus:"+",pgup:"pageup",pgdn:"pagedown"};function Sn(r){let t=String(r??"").toLowerCase();return En[t]??t}function vt(r){let t=$t(r);return{key:Sn(t.pop()??""),meta:t.includes("meta")||t.includes("cmd"),ctrl:t.includes("ctrl")||t.includes("control"),shift:t.includes("shift"),alt:t.includes("alt")||t.includes("option")}}function gs(r){return r.length===1&&!/[a-z0-9 ]/.test(r)}function bs(r,t){let i=(r.key==="Spacebar"?" ":String(r.key??"").toLowerCase())===t.key;if(!i&&(r.altKey||r.shiftKey)&&/^[a-z0-9]$/.test(t.key)){let o=/\d/.test(t.key)?`Digit${t.key}`:`Key${t.key.toUpperCase()}`;i=r.code===o}if(!i)return!1;let s,n;return D?(s=t.meta,n=t.ctrl):(s=!1,n=t.meta||t.ctrl),!(s!==r.metaKey||n!==r.ctrlKey||!gs(t.key)&&t.shift!==r.shiftKey||t.alt!==r.altKey)}function Bt(r){let t=typeof r=="string"?vt(r):r;return!t.meta&&!t.ctrl&&!t.alt&&t.key.length===1}function vs(r,t){let e=vt(r),i=vt(t),s=D?e.ctrl:e.ctrl||e.meta,n=D?i.ctrl:i.ctrl||i.meta,o=D&&e.meta,a=D&&i.meta,l=!gs(e.key);return e.key===i.key&&s===n&&o===a&&e.alt===i.alt&&(!l||e.shift===i.shift)}var xe="data-char-shortcuts",ys="vb:char-shortcuts-change",Cn="vb:settings:extensions";function yt(){return typeof document>"u"?!0:document.documentElement.getAttribute(xe)!=="off"}function Tn(){try{let r=globalThis.localStorage?.getItem(Cn);if(!r)return null;let t=JSON.parse(r)?.data?.charShortcuts;return typeof t=="boolean"?t:null}catch{return null}}var Ln=!0;if(typeof document<"u"){let r=Tn();r===null&&(Ln=yt()),r===!1?document.documentElement.setAttribute(xe,"off"):r===!0&&document.documentElement.removeAttribute(xe)}var Mn=new Set(["INPUT","TEXTAREA","SELECT"]),wt=[],ws=!1;function Rn(r){let t=r;return!t||!t.tagName?!1:Mn.has(t.tagName)||t.isContentEditable}function _n(r){if(r.repeat||r.isComposing||r.defaultPrevented)return;let t=Rn(r.target),e=!yt(),i=document.activeElement;for(let s of wt)if(!(t&&!s.global)&&!(s.scope&&!(s.scope.isConnected&&s.scope.contains(i)))&&!(e&&s.character&&!s.scope)&&!(s.enabled&&!s.enabled())&&bs(r,s.descriptor)){r.preventDefault(),s.callback(r);return}}function Nn(){ws||(document.addEventListener("keydown",_n),ws=!0)}function G(r,t,e={}){Nn();let i=vt(r),s={combo:r,descriptor:i,callback:t,global:e.global===!0,scope:e.scope??null,enabled:typeof e.enabled=="function"?e.enabled:null,character:Bt(i)},n=wt.find(o=>!o.scope&&!s.scope&&vs(o.combo,r));return n&&console.warn(`[hotkey-bind] Shortcut "${r}" is already bound as "${n.combo}". Last-bound wins.`),wt.unshift(s),function(){let a=wt.indexOf(s);a!==-1&&wt.splice(a,1)}}var Pn=0,Ee=class extends b{#t=null;#e;#i;#s=[];#r=-1;#n=[];#a=[];#c=[];#h="";#l=0;setup(){this.#h=`cmdp-${++Pn}`,this.#l=0,this.#o(),this.#p(),this.hasAttribute("discover")&&this.#v()}teardown(){this.#a.forEach(t=>t()),this.#a=[],this.#t?.remove(),this.#t=null,this.#s=[],this.#n=[],this.#c=[],this.#r=-1}get commands(){let t=[];for(let e of this.querySelectorAll("command-group")){let i=e.getAttribute("label")||"";for(let s of e.querySelectorAll("command-item"))t.push({value:s.getAttribute("value")||"",label:s.textContent.trim(),hotkey:s.getAttribute("data-hotkey")||void 0,group:i||void 0})}return t}set commands(t){let e=Array.isArray(t)?t:[],i=new Map;for(let s of e){let n=s.group||"";i.has(n)||i.set(n,[]),i.get(n).push(s)}for(let s of[...this.children])(s.tagName==="COMMAND-GROUP"||s.tagName==="COMMAND-ITEM")&&s.remove();for(let[s,n]of i){let o=document.createElement("command-group");s&&o.setAttribute("label",s);for(let a of n){let l=document.createElement("command-item");if(a.value&&l.setAttribute("value",a.value),a.hotkey&&l.setAttribute("data-hotkey",a.hotkey),a.icon){let c=document.createElement("span");c.setAttribute("slot","icon"),c.innerHTML=a.icon,l.appendChild(c)}l.appendChild(document.createTextNode(a.label||a.value||"")),o.appendChild(l)}this.appendChild(o)}this._reinit(),this.dispatchEvent(new CustomEvent("command-palette:commands-changed",{detail:{commands:e,source:"property"},bubbles:!0}))}#o(){this.#t=document.createElement("dialog"),this.#t.className="command-dialog",this.#t.setAttribute("aria-label",this.getAttribute("label")||"Command palette"),this.#t.addEventListener("click",i=>{i.target===this.#t&&this.close()}),this.#t.addEventListener("close",()=>{this.#e?.setAttribute("aria-expanded","false"),this.#e?.removeAttribute("aria-activedescendant"),this.dispatchEvent(new CustomEvent("command-palette:close",{bubbles:!0}))});let t=document.createElement("div");t.className="command-search",this.#i=document.createElement("div"),this.#i.className="command-list",this.#i.id=`${this.#h}-list`,this.#i.setAttribute("role","listbox"),this.#i.setAttribute("aria-label","Commands"),this.#e=document.createElement("input"),this.#e.type="search",this.#e.placeholder=this.getAttribute("placeholder")||"Type a command...",this.#e.setAttribute("aria-label","Search commands"),this.#e.autocomplete="off",this.#e.setAttribute("role","combobox"),this.#e.setAttribute("aria-autocomplete","list"),this.#e.setAttribute("aria-controls",this.#i.id),this.#e.setAttribute("aria-expanded","false"),this.#e.addEventListener("input",this.#d),this.#e.addEventListener("keydown",this.#f),t.appendChild(this.#e),this.#n=Array.from(this.querySelectorAll("command-group")),this.#n.forEach(i=>{let s=this.#u(i.getAttribute("label")||"");this.#i.appendChild(s),i.querySelectorAll("command-item").forEach(n=>{let o=n.querySelector('[slot="icon"]'),a=this.#b(n.textContent.trim(),o?o.cloneNode(!0):null,n.getAttribute("data-hotkey"));a.dataset.value=n.getAttribute("value")||"",a.addEventListener("click",()=>{this.#m(a.dataset.value)}),s.appendChild(a),this.#s.push({btn:a,group:s,source:n})})});let e=document.createElement("div");e.className="command-empty",e.textContent="No results found.",e.hidden=!0,this.#i.appendChild(e),this.#t.appendChild(t),this.#t.appendChild(this.#i),this.appendChild(this.#t)}#u(t){let e=document.createElement("div");e.className="command-group",e.setAttribute("role","group");let i=document.createElement("div");return i.className="command-group-header",i.id=`${this.#h}-g${++this.#l}`,i.setAttribute("aria-hidden","true"),i.textContent=t,t?e.setAttribute("aria-labelledby",i.id):i.hidden=!0,e.appendChild(i),e}#p(){let t=this.getAttribute("hotkey")||"meta+k";this.#a.push(G(t,()=>{this.#t?.open?this.close():this.open()},{global:!0}));for(let{btn:e,source:i}of this.#s){let s=i?.getAttribute("data-hotkey");if(!s||s.toLowerCase()===t.toLowerCase())continue;let n=e.dataset.value;this.#a.push(G(s,()=>this.#m(n)))}}#d=()=>{let t=this.#e.value.toLowerCase().trim(),e=0,i=new Set;this.#s.forEach(({btn:n,group:o})=>{let a=!t||(n.dataset.searchText??"").includes(t);n.hidden=!a,a&&(e++,i.add(o))}),this.#i.querySelectorAll(":scope > .command-group").forEach(n=>{n.hidden=!i.has(n)});let s=this.#i.querySelector(".command-empty");s&&(s.hidden=e>0),this.#r=-1,this.#s.forEach(({btn:n})=>{n.removeAttribute("data-active"),n.setAttribute("aria-selected","false")}),this.#e.removeAttribute("aria-activedescendant"),e>0&&this.#y(0)};#f=t=>{let e=this.#k();switch(t.key){case"ArrowDown":t.preventDefault(),this.#y(this.#r+1);break;case"ArrowUp":t.preventDefault(),this.#y(this.#r-1);break;case"Enter":t.preventDefault(),this.#r>=0&&e[this.#r]&&e[this.#r].btn.click();break;case"Escape":t.preventDefault(),this.close();break}};#k(){return this.#s.filter(({btn:t})=>!t.hidden)}#y(t){let e=this.#k();if(e.length===0)return;e.forEach(({btn:s})=>{s.removeAttribute("data-active"),s.setAttribute("aria-selected","false")}),t<0&&(t=e.length-1),t>=e.length&&(t=0),this.#r=t;let{btn:i}=e[t];i.setAttribute("data-active",""),i.setAttribute("aria-selected","true"),this.#e.setAttribute("aria-activedescendant",i.id),i.scrollIntoView({block:"nearest"})}#m(t){this.close(),this.dispatchEvent(new CustomEvent("command-palette:select",{bubbles:!0,detail:{value:t}}))}#v(){this.listen(document,"vb:command-registry-change",this.#w)}#w=()=>{this.#t?.open&&(this.#g(),this.#d())};#g(){if(!this.hasAttribute("discover"))return;let{getRegisteredCommands:t,scanAutoDiscoverable:e}=window.__commandRegistry||{};if(!t)return;this.#s=this.#s.filter(n=>!n.discovered),this.#c.forEach(n=>n.remove()),this.#c=[];let i=this.#i.querySelector(".command-empty"),s=t();for(let[n,o]of s){let a=this.#u(n);this.#i.insertBefore(a,i),this.#c.push(a);for(let l of o){if(this.contains(l.element))continue;let c=this.#b(l.label,l.icon,l.shortcut);c.dataset.value=`__discovered:${l.label}`,c.addEventListener("click",()=>{this.close(),l.element.click()}),a.appendChild(c),this.#s.push({btn:c,group:a,source:null,discovered:!0})}}if(this.getAttribute("discover")==="auto"&&e){let n=e(),o=new Map;for(let a of n){let l=o.get(a.group)||[];l.push(a),o.set(a.group,l)}for(let[a,l]of o){let c=this.#u(a);this.#i.insertBefore(c,i),this.#c.push(c);for(let h of l){if(this.contains(h.element))continue;let u=this.#b(h.label,h.icon,h.shortcut);u.dataset.value=`__auto:${h.label}`,u.dataset.auto="",u.addEventListener("click",()=>{this.close(),h.action?h.action():h.element.click()}),c.appendChild(u),this.#s.push({btn:u,group:c,source:null,discovered:!0})}}}}#b(t,e,i){let s=document.createElement("button");if(s.type="button",s.className="command-option",s.id=`${this.#h}-opt-${++this.#l}`,s.setAttribute("role","option"),s.setAttribute("aria-selected","false"),s.tabIndex=-1,s.dataset.searchText=t.toLowerCase(),e){let o=document.createElement("span");if(o.className="command-icon",typeof e=="string"){let a=document.createElement("icon-wc");a.setAttribute("name",e),o.appendChild(a)}else o.appendChild(e);s.appendChild(o)}let n=document.createElement("span");if(n.className="command-label",n.textContent=t,s.appendChild(n),i){let o=document.createElement("kbd");o.className="command-kbd",o.setAttribute("aria-hidden","true"),o.textContent=zt(i),s.appendChild(o),s.setAttribute("aria-keyshortcuts",i)}return s}open(){!this.#t||this.#t.open||(this.#g(),this.#t.showModal(),this.#e.setAttribute("aria-expanded","true"),this.#e.value="",this.#d(),this.#e.focus(),this.dispatchEvent(new CustomEvent("command-palette:open",{bubbles:!0})))}close(){this.#t?.open&&this.#t.close()}get isOpen(){return this.#t?.open??!1}},Se=class extends HTMLElement{},Ce=class extends HTMLElement{};g("command-palette",Ee);g("command-group",Se);g("command-item",Ce);var In="shift+?",$n={title:"Keyboard shortcuts",general:"General",self:"Show keyboard shortcuts",close:"Close"},zn=0,Te=class extends b{static get observedAttributes(){return["hotkey"]}#t=null;#e=null;#i=null;#s=null;setup(){this.#a(),this.#n(),this.listen(window,ys,()=>{this.#t?.open&&this.#l()})}teardown(){this.#i?.(),this.#i=null,this.#t?.remove(),this.#t=null,this.#e=null}attributeChangedCallback(t,e,i){t==="hotkey"&&e!==i&&this.hasAttribute("data-upgraded")&&this.#n()}show(){this.#t&&(this.#l(),this.#t.open||this.#t.showModal())}close(){this.#t?.open&&this.#t.close()}toggle(){this.#t?.open?this.close():this.show()}get open(){return!!this.#t?.open}get hotkey(){let t=(this.getAttribute("hotkey")??"").trim();return t.toLowerCase()==="none"?null:t||In}get shortcuts(){return this.#s}set shortcuts(t){this.#s=t&&typeof t=="object"?t:null,this.#t?.open&&this.#l(),this.dispatchEvent(new CustomEvent("short-cuts:shortcuts-changed",{detail:{shortcuts:this.#s,source:"property"},bubbles:!0}))}#r(t){return this.getAttribute(`data-label-${t}`)||$n[t]}#n(){this.#i?.(),this.#i=null;let t=this.hotkey;t&&(this.#i=G(t,()=>this.toggle()))}#a(){this.querySelector(":scope > dialog.shortcut-dialog")?.remove();let t=`short-cuts-title-${++zn}`,e=document.createElement("dialog");e.className="shortcut-dialog",e.setAttribute("aria-labelledby",t);let i=document.createElement("header");i.className="shortcut-header";let s=document.createElement("h2");s.id=t,s.textContent=this.#r("title");let n=document.createElement("button");n.type="button",n.className="shortcut-close",n.setAttribute("aria-label",this.#r("close"));let o=document.createElement("icon-wc");o.setAttribute("name","x"),o.setAttribute("size","sm"),o.setAttribute("aria-hidden","true"),n.appendChild(o),n.addEventListener("click",()=>this.close()),i.append(s,n);let a=document.createElement("section");a.className="shortcut-body",e.append(i,a),e.addEventListener("click",l=>{l.target===e&&e.close()}),this.#t=e,this.#e=a,this.appendChild(e)}#c(){let t=new Map,e=!yt(),i=(l,c=!1)=>!(e&&!c&&Bt(l)),s=this.hotkey;s&&i(s)&&t.set(this.#r("general"),[{label:this.#r("self"),shortcut:s}]);let n=(l,c)=>{if(!c?.shortcut||!i(String(c.shortcut),!!c.scoped))return;let h=t.get(l)||[];h.push({label:String(c.label??""),shortcut:String(c.shortcut)}),t.set(l,h)};if(this.#s){for(let[l,c]of Object.entries(this.#s))Array.isArray(c)&&c.forEach(h=>n(l,h));return t}let{getRegisteredCommands:o}=window.__commandRegistry||{};if(o)for(let[l,c]of o())for(let h of c)n(l,h);let{getHotkeyActions:a}=window.__hotkeyActionRegistry||{};if(a)for(let[l,c]of a())for(let h of c)n(l,h);return t}#h(t){let e=document.createElement("kbd");e.className="shortcut-kbd";let i=document.createElement("span");i.setAttribute("aria-hidden","true"),i.textContent=zt(t);let s=document.createElement("span");return s.className="visually-hidden",s.textContent=$t(t).map(n=>Ae(n,D).spoken).join(" "),e.append(i,s),e}#l(){if(this.#e){this.#e.replaceChildren();for(let[t,e]of this.#c()){if(!e.length)continue;let i=document.createElement("section");i.className="shortcut-group";let s=document.createElement("h3");s.className="shortcut-group-header",s.textContent=t;let n=document.createElement("dl");n.className="shortcut-list";for(let o of e){let a=document.createElement("div");a.className="shortcut-row";let l=document.createElement("dt");l.className="shortcut-label",l.textContent=o.label;let c=document.createElement("dd");c.appendChild(this.#h(o.shortcut)),a.append(l,c),n.appendChild(a)}i.append(s,n),this.#e.appendChild(i)}}}};g("short-cuts",Te);var Bn="Comparison slider";function Le(r){if(r===null||r.trim()==="")return 50;let t=Number(r);return Number.isNaN(t)?50:Math.min(100,Math.max(0,t))}var Me=class extends b{static observedAttributes=["position","label","aria-label"];#t=null;#e=!1;#i=!1;#s=50;setup(){let t=[...this.children].filter(e=>!e.classList.contains("comparison-divider"));return t.length<2?!1:(t.length>2&&console.warn("[compare-surface] Expected exactly 2 children; extra children are hidden."),this.#t=document.createElement("div"),this.#t.className="comparison-divider",this.#t.setAttribute("role","slider"),this.#t.setAttribute("aria-valuemin","0"),this.#t.setAttribute("aria-valuemax","100"),this.#t.setAttribute("aria-orientation","horizontal"),this.#t.setAttribute("tabindex","0"),this.#r(),this.appendChild(this.#t),this.#u(Le(this.getAttribute("position"))),this.listen(this.#t,"pointerdown",this.#a),this.listen(this.#t,"pointermove",this.#c),this.listen(this.#t,"pointerup",this.#h),this.listen(this.#t,"pointercancel",this.#h),this.listen(this.#t,"lostpointercapture",this.#h),this.listen(this.#t,"keydown",this.#l),!0)}teardown(){this.#t?.remove(),this.#t=null,this.#e=!1}attributeChangedCallback(t,e,i){if(!(!this.#t||e===i))if(t==="position"){if(this.#i)return;this.#u(Le(i))}else this.#r()}#r(){if(!this.#t)return;let t=this.getAttribute("label")||this.getAttribute("aria-label")||Bn;this.#t.setAttribute("aria-label",t)}get#n(){return getComputedStyle(this).direction==="rtl"}#a=t=>{t.preventDefault(),this.#e=!0,this.#t?.setPointerCapture(t.pointerId)};#c=t=>{if(!this.#e)return;let e=this.getBoundingClientRect();if(!e.width)return;let i=this.#n?e.right-t.clientX:t.clientX-e.left;this.#o(i/e.width*100)};#h=t=>{this.#e&&(this.#e=!1,this.#t?.hasPointerCapture(t.pointerId)&&this.#t.releasePointerCapture(t.pointerId))};#l=t=>{let e=t.shiftKey?10:1,i=this.#n?-1:1,s=this.#s,n;switch(t.key){case"ArrowRight":n=s+e*i;break;case"ArrowLeft":n=s-e*i;break;case"ArrowUp":n=s+e;break;case"ArrowDown":n=s-e;break;case"PageUp":n=s+10;break;case"PageDown":n=s-10;break;case"Home":n=0;break;case"End":n=100;break;default:return}t.preventDefault(),this.#o(n)};#o(t){let e=this.#s;if(this.#u(Math.min(100,Math.max(0,t))),this.#s!==e){this.#i=!0;try{this.setAttribute("position",String(this.#s))}finally{this.#i=!1}this.dispatchEvent(new CustomEvent("compare-surface:change",{detail:{position:this.#s},bubbles:!0}))}}#u(t){this.#s=Math.round(t),this.style.setProperty("--_position",`${t}%`),this.#t&&(this.#t.setAttribute("aria-valuenow",String(this.#s)),this.#t.setAttribute("aria-valuetext",`${this.#s}%`))}get position(){return this.#t?this.#s:Math.round(Le(this.getAttribute("position")))}set position(t){let e=Number(t),i=Math.round(Math.min(100,Math.max(0,Number.isNaN(e)?0:e)));this.setAttribute("position",String(i))}};g("compare-surface",Me);function jn(){let r=globalThis.localStorage;if(!r)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(t){return r.getItem(t)},async setRaw(t,e){r.setItem(t,e)},async removeRaw(t){r.removeItem(t)},async keys(t){let e=[];for(let i=0;i<r.length;i++){let s=r.key(i);s&&s.startsWith(t)&&e.push(s)}return e}}}var jt="__vbStoreBackend",Ot=globalThis;function F(){return Ot[jt]||(Ot[jt]=jn()),Ot[jt]}function Re(r,t){if(typeof r!="string"||!r)throw new TypeError("VBStore: namespace must be a non-empty string");if(typeof t!="string"||!t)throw new TypeError("VBStore: key must be a non-empty string");return`vb:${r}:${t}`}function ks(r){if(typeof r!="string"||!r)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${r}:`}function As(r){try{let t=JSON.parse(r);if(t&&typeof t=="object"&&typeof t.timestamp=="number")return t}catch{}return null}var _={configure(r={}){Ot[jt]=r.backend??null},async set(r,t,e){let i={data:e,timestamp:Date.now()};await F().setRaw(Re(r,t),JSON.stringify(i))},async get(r,t,e){let i=await F().getRaw(Re(r,t));if(i==null)return null;let s=As(i);return!s||e?.maxAge!=null&&Date.now()-s.timestamp>e.maxAge?null:s.data},async remove(r,t){await F().removeRaw(Re(r,t))},async list(r){let t=ks(r),e=await F().keys(t),i=[];for(let s of e){let n=await F().getRaw(s);if(n==null)continue;let o=As(n);o&&i.push({key:s.slice(t.length),data:o.data,timestamp:o.timestamp})}return i},async clear(r){let t=ks(r),e=await F().keys(t);for(let i of e)await F().removeRaw(i)},async clearAll(){let r=await F().keys("vb:");for(let t of r)await F().removeRaw(t)},async setMany(r,t){for(let[e,i]of t)await _.set(r,e,i)}};if(typeof window<"u"){let r=window.VB??(window.VB={});r.store??=_}var On=0;function _e(r,t){if(r===null||r.trim()==="")return t;let e=Number(r);return Number.isFinite(e)?e:t}var Ne=class extends b{static observedAttributes=["position","min","max","direction","collapsible","data-label-resize","data-label-collapsed"];#t=null;#e;#i;#s=50;#r=!1;#n=50;#a=!1;#c={};#h=0;get#l(){return this.getAttribute("direction")==="vertical"}get#o(){return getComputedStyle(this).direction==="rtl"}get#u(){return _e(this.getAttribute("min"),10)}get#p(){return _e(this.getAttribute("max"),90)}get#d(){return this.hasAttribute("collapsible")}get#f(){return _e(this.getAttribute("position"),50)}get position(){return this.#t?this.#s:this.#c.position??this.#s}set position(t){let e=Number(t);if(Number.isFinite(e)){if(!this.#t){this.#c.position=e,delete this.#c.reset;return}this.#r&&this.#E(),this.#C(e,"api")}}get collapsed(){return this.#t?this.#r:this.#c.collapsed??this.#r}set collapsed(t){if(!this.#t){this.#c.collapsed=!!t;return}t?this.#x("api"):this.#L("api")}reset(){if(!this.#t){this.#c={reset:!0},this.#N();return}this.#r&&this.#E(),this.#C(this.#f,"api"),this.#N()}setup(){for(let e of this.querySelectorAll(":scope > .split-divider"))e.remove();let t=[...this.children].filter(e=>!e.classList.contains("split-divider"));return t.length<2?!1:(this.#e=t[0],this.#i=t[1],this.#k(++this.#h),!0)}async#k(t){let e=null;if(this.#a||(e=await this.#$()),t!==this.#h||!this.isConnected)return!1;let i=this.#e,s=document.createElement("div");s.className="split-divider",s.setAttribute("role","separator"),i.id||(i.id=`vb-split-panel-${++On}`),s.setAttribute("aria-controls",i.id),s.setAttribute("tabindex","0"),this.#t=s,this.#m(),this.insertBefore(s,this.#i),this.listen(s,"pointerdown",this.#w),this.listen(s,"keydown",this.#T),this.listen(s,"dblclick",this.#A);let n=this.#r?this.#n:this.#s,o=this.#r;this.#a||(n=e?.position??this.#f,o=!!e?.collapsed&&this.#d);let a=this.#c;return this.#c={},a.reset&&(n=this.#f,o=!1),a.position!==void 0&&(n=a.position,o=!1),a.collapsed!==void 0&&(o=a.collapsed),this.#a=!0,this.#E(),o?(this.#n=this.#y(n),this.#S()):this.#C(n,null),!0}teardown(){this.#h++,this.#t&&(this.#t.remove(),this.#t=null)}attributeChangedCallback(t,e,i){if(!(e===i||!this.#t)){if(t==="position"){this.#r?this.#n=this.#y(this.#f):this.#C(this.#f,"attribute");return}t==="collapsible"&&!this.#d&&this.#r&&this.#L("attribute"),this.#m(),!this.#r&&(t==="min"||t==="max")&&this.#C(this.#s,"attribute")}}#y(t){return Math.min(this.#p,Math.max(this.#u,t))}#m(){let t=this.#t;t&&(t.setAttribute("aria-orientation",this.#l?"horizontal":"vertical"),t.setAttribute("aria-valuemin",String(this.#d?0:this.#u)),t.setAttribute("aria-valuemax",String(this.#p)),t.setAttribute("aria-label",this.getAttribute("data-label-resize")||"Resize panels"),this.#v())}#v(){let t=this.#t;if(!t)return;let e=Math.round(this.#s);t.setAttribute("aria-valuenow",String(e)),t.setAttribute("aria-valuetext",this.#r?this.getAttribute("data-label-collapsed")||"Collapsed":`${e}%`)}#w=t=>{if(t.button!==0)return;t.preventDefault();let e=this.#t;this.setState("divider-dragging",!0);try{e.setPointerCapture(t.pointerId)}catch{}e.addEventListener("pointermove",this.#g),e.addEventListener("pointerup",this.#b),e.addEventListener("pointercancel",this.#b),e.addEventListener("lostpointercapture",this.#b)};#g=t=>{if(!this.matches(":state(divider-dragging)"))return;let e=this.getBoundingClientRect(),i;this.#l?i=(t.clientY-e.top)/e.height*100:i=(this.#o?e.right-t.clientX:t.clientX-e.left)/e.width*100,this.#r&&this.#E(),this.#C(i,"pointer")};#b=t=>{if(!this.#t)return;let e=this.matches(":state(divider-dragging)");this.setState("divider-dragging",!1),this.#t.hasPointerCapture(t.pointerId)&&this.#t.releasePointerCapture(t.pointerId),this.#t.removeEventListener("pointermove",this.#g),this.#t.removeEventListener("pointerup",this.#b),this.#t.removeEventListener("pointercancel",this.#b),this.#t.removeEventListener("lostpointercapture",this.#b),e&&this.#P()};#T=t=>{if(t.key==="Enter"){if(!this.#d)return;t.preventDefault(),this.#r?this.#L("keyboard"):this.#x("keyboard"),this.#P();return}let e=t.shiftKey?10:1,i=!this.#l&&this.#o,s=this.#l?"ArrowUp":i?"ArrowRight":"ArrowLeft",n=this.#l?"ArrowDown":i?"ArrowLeft":"ArrowRight",o=null;t.key===s?o=this.#s-e:t.key===n?o=this.#s+e:t.key==="Home"?o=this.#u:t.key==="End"&&(o=this.#p),o!==null&&(t.preventDefault(),this.#r&&(this.#E(),this.dispatchEvent(new CustomEvent("split-surface:collapse",{detail:{collapsed:!1,source:"keyboard"},bubbles:!0}))),this.#C(o,"keyboard"),this.#P())};#A=()=>{this.#d&&(this.#r?this.#L("pointer"):this.#x("pointer"),this.#P())};#x(t){this.#r||!this.#t||(this.#n=this.#s,this.#S(),this.dispatchEvent(new CustomEvent("split-surface:collapse",{detail:{collapsed:!0,source:t},bubbles:!0})))}#S(){let t=this.#e;this.#r=!0,this.#s=0,t.style.flexBasis="0%",t.style.flexGrow="0",t.style.flexShrink="0",t.style.overflow="hidden",t.inert=!0,this.setState("collapsed",!0),this.#v()}#E(){this.#r=!1,this.#e&&(this.#e.inert=!1),this.setState("collapsed",!1)}#L(t){!this.#r||!this.#t||(this.#E(),this.#C(this.#n,null),this.dispatchEvent(new CustomEvent("split-surface:collapse",{detail:{collapsed:!1,source:t},bubbles:!0})))}#C(t,e){if(!Number.isFinite(t)||!this.#e||!this.#i)return;let i=this.#y(t);this.#s=i,this.#e.style.flexBasis=`${i}%`,this.#e.style.flexGrow="0",this.#e.style.flexShrink="0",this.#e.style.overflow="auto",this.#i.style.flexGrow="1",this.#i.style.overflow="auto",this.#v(),e!==null&&this.dispatchEvent(new CustomEvent("split-surface:resize",{detail:{position:i,source:e},bubbles:!0}))}async#$(){let t=this.getAttribute("persist");if(!t)return null;try{let e=await _.get("layout",`split:${t}`);if(e&&typeof e=="object"&&typeof e.position=="number")return e}catch{}return null}#P(){let t=this.getAttribute("persist");if(!t)return;let e=this.#r?{position:Math.round(this.#n),collapsed:!0}:{position:Math.round(this.#s),collapsed:!1};_.set("layout",`split:${t}`,e).catch(()=>{})}#N(){let t=this.getAttribute("persist");t&&_.remove("layout",`split:${t}`).catch(()=>{})}};g("split-surface",Ne);var Dn=["position:absolute","inline-size:1px","block-size:1px","padding:0","margin:-1px","overflow:hidden","clip-path:inset(50%)","white-space:nowrap","border:0"].join(";"),xs=new WeakMap;function Fn(r,t){let e=xs.get(t);e||xs.set(t,e=new Map);let i=e.get(r);if(!i||!i.region.isConnected){let n=(t.ownerDocument||document).createElement("span");n.setAttribute("data-vb-announcer",r),n.setAttribute("role",r==="assertive"?"alert":"status"),n.setAttribute("aria-live",r),n.setAttribute("aria-atomic","true"),n.style.cssText=Dn,t.appendChild(n),i={region:n},e.set(r,i)}return i}function ot(r,{politeness:t="polite",root:e}={}){let i=String(r??"").trim();if(!i||typeof document>"u")return null;let s=e||document.body;if(!s)return null;let o=Fn(t==="assertive"?"assertive":"polite",s);return clearTimeout(o.write),clearTimeout(o.clear),o.region.textContent="",o.write=setTimeout(()=>{o.region.textContent=i,o.clear=setTimeout(()=>{o.region.textContent=""},7e3)},50),o.region}function q(r,t,e,i){let s=`data-label-${t}`,o=r?.closest?.(`[${s}]`)?.getAttribute(s)||e;return i?o.replace(/\{(\w+)\}/g,(a,l)=>l in i?String(i[l]):a):o}var Ie=1500,qn="[data-copy], [data-copy-target], [data-paste-target]",Y={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"},Pe=new WeakMap;function Hn(r){if(typeof document.execCommand!="function"||!document.body)return!1;let t=document.activeElement,e=document.createElement("textarea");e.value=r,e.setAttribute("readonly",""),e.setAttribute("aria-hidden","true"),e.style.cssText="position:fixed;inset-block-start:0;inset-inline-start:0;opacity:0;pointer-events:none",document.body.appendChild(e),e.select();let i=!1;try{i=document.execCommand("copy")}catch{i=!1}return e.remove(),t?.focus?.({preventScroll:!0}),i}function Un(r){if(!r)return!1;if(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement)return r.focus(),r.select(),!0;let t=window.getSelection?.();if(!t)return!1;let e=document.createRange();return e.selectNodeContents(r),t.removeAllRanges(),t.addRange(e),!t.isCollapsed}async function kt(r,t={}){if(r==null||r==="")return!1;let{button:e,duration:i=Ie}=t,s=!1,n=null;try{if(!navigator.clipboard?.writeText)throw new Error("Clipboard API unavailable");await navigator.clipboard.writeText(r),s=!0}catch(a){n=a,s=Hn(r)}if(s)return at({button:e,duration:i,state:"copied",eventName:"copy:done",eventDetail:{text:r},message:t.announceMessage??q(e,"copied",Y.copied)}),!0;let o=Un(t.source);return at({button:e,duration:i,state:"failed",eventName:"copy:error",eventDetail:{text:r,error:n},message:t.failureMessage??q(e,"copy-failed",o?Y["copy-failed-selected"]:Y["copy-failed"])}),!1}async function Es(r,t={}){let{text:e,html:i,blob:s}=r??{};if(!e&&!i&&!s)return!1;let{button:n,duration:o=Ie}=t;if(typeof ClipboardItem<"u"&&typeof navigator.clipboard?.write=="function"){let l={};e&&(l["text/plain"]=new Blob([e],{type:"text/plain"})),i&&(l["text/html"]=new Blob([i],{type:"text/html"})),s&&(l[s.type]=s);try{return await navigator.clipboard.write([new ClipboardItem(l)]),at({button:n,duration:o,state:"copied",eventName:"copy:done",eventDetail:{payload:r},message:t.announceMessage??q(n,"copied",Y.copied)}),!0}catch{}}return e?kt(e,t):(at({button:n,duration:o,state:"failed",eventName:"copy:error",eventDetail:{payload:r,error:null},message:t.failureMessage??q(n,"copy-failed",Y["copy-failed"])}),!1)}function at({button:r,duration:t,message:e,eventDetail:i,state:s,eventName:n}){if(r){r.dataset.state=s;let o=Pe.get(r);o&&clearTimeout(o),Pe.set(r,setTimeout(()=>{r.dataset.state===s&&delete r.dataset.state,Pe.delete(r)},t)),r.dispatchEvent(new CustomEvent(n,{bubbles:!0,detail:i}))}ot(e,{politeness:s==="failed"?"assertive":"polite"})}async function Vn(r,t={}){let{button:e,duration:i=Ie}=t,s;try{if(!navigator.clipboard?.readText)throw new Error("Clipboard API unavailable");s=await navigator.clipboard.readText()}catch(n){return at({button:e,duration:i,state:"failed",eventName:"paste:error",eventDetail:{target:r,error:n},message:t.failureMessage??q(e,"paste-failed",Y["paste-failed"])}),null}return r&&(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement?r.value=s:r.textContent=s,r.dispatchEvent(new Event("input",{bubbles:!0}))),at({button:e,duration:i,state:"pasted",eventName:"paste:done",eventDetail:{text:s,target:r},message:t.announceMessage??q(e,"pasted",Y.pasted)}),s}function Ss(r){let t=r.dataset.copyTarget;if(!t)return null;try{return document.querySelector(t)}catch{return null}}function Wn(r){if(r.dataset.copy)return r.dataset.copy;let t=Ss(r);if(!t)return"";let e=r.dataset.copyAttr;return e?t.getAttribute(e)??"":t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement?t.value:t.textContent??""}function Kn(r){let t=r.target?.closest?.(qn);if(!t||t.matches(':disabled, [aria-disabled="true"]'))return;if(t.dataset.pasteTarget){let i=null;try{i=document.querySelector(t.dataset.pasteTarget)}catch{}if(!i)return;Vn(i,{button:t});return}let e=Wn(t);e&&kt(e,{button:t,source:Ss(t)??void 0})}typeof document<"u"&&!document.__vbCopyDelegated&&(document.__vbCopyDelegated=!0,document.addEventListener("click",Kn));var V;(r=>{class t{constructor(a,l,c,h){if(this.version=a,this.errorCorrectionLevel=l,a<t.MIN_VERSION||a>t.MAX_VERSION)throw new RangeError("Version value out of range");if(h<-1||h>7)throw new RangeError("Mask value out of range");this.size=a*4+17;let u=[];for(let d=0;d<this.size;d++)u.push(!1);for(let d=0;d<this.size;d++)this.modules.push(u.slice()),this.isFunction.push(u.slice());this.drawFunctionPatterns();let p=this.addEccAndInterleave(c);if(this.drawCodewords(p),h==-1){let d=1e9;for(let f=0;f<8;f++){this.applyMask(f),this.drawFormatBits(f);let m=this.getPenaltyScore();m<d&&(h=f,d=m),this.applyMask(f)}}s(0<=h&&h<=7),this.mask=h,this.applyMask(h),this.drawFormatBits(h),this.isFunction=[]}version;errorCorrectionLevel;static encodeText(a,l){let c=r.QrSegment.makeSegments(a);return t.encodeSegments(c,l)}static encodeBinary(a,l){let c=r.QrSegment.makeBytes(a);return t.encodeSegments([c],l)}static encodeSegments(a,l,c=1,h=40,u=-1,p=!0){if(!(t.MIN_VERSION<=c&&c<=h&&h<=t.MAX_VERSION)||u<-1||u>7)throw new RangeError("Invalid value");let d,f;for(d=c;;d++){let k=t.getNumDataCodewords(d,l)*8,A=n.getTotalBits(a,d);if(A<=k){f=A;break}if(d>=h)throw new RangeError("Data too long")}for(let k of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])p&&f<=t.getNumDataCodewords(d,k)*8&&(l=k);let m=[];for(let k of a){e(k.mode.modeBits,4,m),e(k.numChars,k.mode.numCharCountBits(d),m);for(let A of k.getData())m.push(A)}s(m.length==f);let y=t.getNumDataCodewords(d,l)*8;s(m.length<=y),e(0,Math.min(4,y-m.length),m),e(0,(8-m.length%8)%8,m),s(m.length%8==0);for(let k=236;m.length<y;k^=253)e(k,8,m);let w=[];for(;w.length*8<m.length;)w.push(0);return m.forEach((k,A)=>w[A>>>3]|=k<<7-(A&7)),new t(d,l,w,u)}size;mask;modules=[];isFunction=[];getModule(a,l){return 0<=a&&a<this.size&&0<=l&&l<this.size&&this.modules[l][a]}drawFunctionPatterns(){for(let c=0;c<this.size;c++)this.setFunctionModule(6,c,c%2==0),this.setFunctionModule(c,6,c%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let a=this.getAlignmentPatternPositions(),l=a.length;for(let c=0;c<l;c++)for(let h=0;h<l;h++)c==0&&h==0||c==0&&h==l-1||c==l-1&&h==0||this.drawAlignmentPattern(a[c],a[h]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(a){let l=this.errorCorrectionLevel.formatBits<<3|a,c=l;for(let u=0;u<10;u++)c=c<<1^(c>>>9)*1335;let h=(l<<10|c)^21522;s(h>>>15==0);for(let u=0;u<=5;u++)this.setFunctionModule(8,u,i(h,u));this.setFunctionModule(8,7,i(h,6)),this.setFunctionModule(8,8,i(h,7)),this.setFunctionModule(7,8,i(h,8));for(let u=9;u<15;u++)this.setFunctionModule(14-u,8,i(h,u));for(let u=0;u<8;u++)this.setFunctionModule(this.size-1-u,8,i(h,u));for(let u=8;u<15;u++)this.setFunctionModule(8,this.size-15+u,i(h,u));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let a=this.version;for(let c=0;c<12;c++)a=a<<1^(a>>>11)*7973;let l=this.version<<12|a;s(l>>>18==0);for(let c=0;c<18;c++){let h=i(l,c),u=this.size-11+c%3,p=Math.floor(c/3);this.setFunctionModule(u,p,h),this.setFunctionModule(p,u,h)}}drawFinderPattern(a,l){for(let c=-4;c<=4;c++)for(let h=-4;h<=4;h++){let u=Math.max(Math.abs(h),Math.abs(c)),p=a+h,d=l+c;0<=p&&p<this.size&&0<=d&&d<this.size&&this.setFunctionModule(p,d,u!=2&&u!=4)}}drawAlignmentPattern(a,l){for(let c=-2;c<=2;c++)for(let h=-2;h<=2;h++)this.setFunctionModule(a+h,l+c,Math.max(Math.abs(h),Math.abs(c))!=1)}setFunctionModule(a,l,c){this.modules[l][a]=c,this.isFunction[l][a]=!0}addEccAndInterleave(a){let l=this.version,c=this.errorCorrectionLevel;if(a.length!=t.getNumDataCodewords(l,c))throw new RangeError("Invalid argument");let h=t.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][l],u=t.ECC_CODEWORDS_PER_BLOCK[c.ordinal][l],p=Math.floor(t.getNumRawDataModules(l)/8),d=h-p%h,f=Math.floor(p/h),m=[],y=t.reedSolomonComputeDivisor(u);for(let k=0,A=0;k<h;k++){let T=a.slice(A,A+f-u+(k<d?0:1));A+=T.length;let j=t.reedSolomonComputeRemainder(T,y);k<d&&T.push(0),m.push(T.concat(j))}let w=[];for(let k=0;k<m[0].length;k++)m.forEach((A,T)=>{(k!=f-u||T>=d)&&w.push(A[k])});return s(w.length==p),w}drawCodewords(a){if(a.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let h=0;h<this.size;h++)for(let u=0;u<2;u++){let p=c-u,f=(c+1&2)==0?this.size-1-h:h;!this.isFunction[f][p]&&l<a.length*8&&(this.modules[f][p]=i(a[l>>>3],7-(l&7)),l++)}}s(l==a.length*8)}applyMask(a){if(a<0||a>7)throw new RangeError("Mask value out of range");for(let l=0;l<this.size;l++)for(let c=0;c<this.size;c++){let h;switch(a){case 0:h=(c+l)%2==0;break;case 1:h=l%2==0;break;case 2:h=c%3==0;break;case 3:h=(c+l)%3==0;break;case 4:h=(Math.floor(c/3)+Math.floor(l/2))%2==0;break;case 5:h=c*l%2+c*l%3==0;break;case 6:h=(c*l%2+c*l%3)%2==0;break;case 7:h=((c+l)%2+c*l%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[l][c]&&h&&(this.modules[l][c]=!this.modules[l][c])}}getPenaltyScore(){let a=0;for(let u=0;u<this.size;u++){let p=!1,d=0,f=[0,0,0,0,0,0,0];for(let m=0;m<this.size;m++)this.modules[u][m]==p?(d++,d==5?a+=t.PENALTY_N1:d>5&&a++):(this.finderPenaltyAddHistory(d,f),p||(a+=this.finderPenaltyCountPatterns(f)*t.PENALTY_N3),p=this.modules[u][m],d=1);a+=this.finderPenaltyTerminateAndCount(p,d,f)*t.PENALTY_N3}for(let u=0;u<this.size;u++){let p=!1,d=0,f=[0,0,0,0,0,0,0];for(let m=0;m<this.size;m++)this.modules[m][u]==p?(d++,d==5?a+=t.PENALTY_N1:d>5&&a++):(this.finderPenaltyAddHistory(d,f),p||(a+=this.finderPenaltyCountPatterns(f)*t.PENALTY_N3),p=this.modules[m][u],d=1);a+=this.finderPenaltyTerminateAndCount(p,d,f)*t.PENALTY_N3}for(let u=0;u<this.size-1;u++)for(let p=0;p<this.size-1;p++){let d=this.modules[u][p];d==this.modules[u][p+1]&&d==this.modules[u+1][p]&&d==this.modules[u+1][p+1]&&(a+=t.PENALTY_N2)}let l=0;for(let u of this.modules)l=u.reduce((p,d)=>p+(d?1:0),l);let c=this.size*this.size,h=Math.ceil(Math.abs(l*20-c*10)/c)-1;return s(0<=h&&h<=9),a+=h*t.PENALTY_N4,s(0<=a&&a<=2568888),a}getAlignmentPatternPositions(){if(this.version==1)return[];{let a=Math.floor(this.version/7)+2,l=Math.floor((this.version*8+a*3+5)/(a*4-4))*2,c=[6];for(let h=this.size-7;c.length<a;h-=l)c.splice(1,0,h);return c}}static getNumRawDataModules(a){if(a<t.MIN_VERSION||a>t.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*a+128)*a+64;if(a>=2){let c=Math.floor(a/7)+2;l-=(25*c-10)*c-55,a>=7&&(l-=36)}return s(208<=l&&l<=29648),l}static getNumDataCodewords(a,l){return Math.floor(t.getNumRawDataModules(a)/8)-t.ECC_CODEWORDS_PER_BLOCK[l.ordinal][a]*t.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][a]}static reedSolomonComputeDivisor(a){if(a<1||a>255)throw new RangeError("Degree out of range");let l=[];for(let h=0;h<a-1;h++)l.push(0);l.push(1);let c=1;for(let h=0;h<a;h++){for(let u=0;u<l.length;u++)l[u]=t.reedSolomonMultiply(l[u],c),u+1<l.length&&(l[u]^=l[u+1]);c=t.reedSolomonMultiply(c,2)}return l}static reedSolomonComputeRemainder(a,l){let c=l.map(h=>0);for(let h of a){let u=h^c.shift();c.push(0),l.forEach((p,d)=>c[d]^=t.reedSolomonMultiply(p,u))}return c}static reedSolomonMultiply(a,l){if(a>>>8||l>>>8)throw new RangeError("Byte out of range");let c=0;for(let h=7;h>=0;h--)c=c<<1^(c>>>7)*285,c^=(l>>>h&1)*a;return s(c>>>8==0),c}finderPenaltyCountPatterns(a){let l=a[1];s(l<=this.size*3);let c=l>0&&a[2]==l&&a[3]==l*3&&a[4]==l&&a[5]==l;return(c&&a[0]>=l*4&&a[6]>=l?1:0)+(c&&a[6]>=l*4&&a[0]>=l?1:0)}finderPenaltyTerminateAndCount(a,l,c){return a&&(this.finderPenaltyAddHistory(l,c),l=0),l+=this.size,this.finderPenaltyAddHistory(l,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(a,l){l[0]==0&&(a+=this.size),l.pop(),l.unshift(a)}static MIN_VERSION=1;static MAX_VERSION=40;static PENALTY_N1=3;static PENALTY_N2=3;static PENALTY_N3=40;static PENALTY_N4=10;static ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]];static NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]]}r.QrCode=t;function e(o,a,l){if(a<0||a>31||o>>>a)throw new RangeError("Value out of range");for(let c=a-1;c>=0;c--)l.push(o>>>c&1)}function i(o,a){return(o>>>a&1)!=0}function s(o){if(!o)throw new Error("Assertion error")}class n{constructor(a,l,c){if(this.mode=a,this.numChars=l,this.bitData=c,l<0)throw new RangeError("Invalid argument");this.bitData=c.slice()}mode;numChars;bitData;static makeBytes(a){let l=[];for(let c of a)e(c,8,l);return new n(n.Mode.BYTE,a.length,l)}static makeNumeric(a){if(!n.isNumeric(a))throw new RangeError("String contains non-numeric characters");let l=[];for(let c=0;c<a.length;){let h=Math.min(a.length-c,3);e(parseInt(a.substring(c,c+h),10),h*3+1,l),c+=h}return new n(n.Mode.NUMERIC,a.length,l)}static makeAlphanumeric(a){if(!n.isAlphanumeric(a))throw new RangeError("String contains unencodable characters in alphanumeric mode");let l=[],c;for(c=0;c+2<=a.length;c+=2){let h=n.ALPHANUMERIC_CHARSET.indexOf(a.charAt(c))*45;h+=n.ALPHANUMERIC_CHARSET.indexOf(a.charAt(c+1)),e(h,11,l)}return c<a.length&&e(n.ALPHANUMERIC_CHARSET.indexOf(a.charAt(c)),6,l),new n(n.Mode.ALPHANUMERIC,a.length,l)}static makeSegments(a){return a==""?[]:n.isNumeric(a)?[n.makeNumeric(a)]:n.isAlphanumeric(a)?[n.makeAlphanumeric(a)]:[n.makeBytes(n.toUtf8ByteArray(a))]}static makeEci(a){let l=[];if(a<0)throw new RangeError("ECI assignment value out of range");if(a<128)e(a,8,l);else if(a<16384)e(2,2,l),e(a,14,l);else if(a<1e6)e(6,3,l),e(a,21,l);else throw new RangeError("ECI assignment value out of range");return new n(n.Mode.ECI,0,l)}static isNumeric(a){return n.NUMERIC_REGEX.test(a)}static isAlphanumeric(a){return n.ALPHANUMERIC_REGEX.test(a)}getData(){return this.bitData.slice()}static getTotalBits(a,l){let c=0;for(let h of a){let u=h.mode.numCharCountBits(l);if(h.numChars>=1<<u)return 1/0;c+=4+u+h.bitData.length}return c}static toUtf8ByteArray(a){a=encodeURI(a);let l=[];for(let c=0;c<a.length;c++)a.charAt(c)!="%"?l.push(a.charCodeAt(c)):(l.push(parseInt(a.substring(c+1,c+3),16)),c+=2);return l}static NUMERIC_REGEX=/^[0-9]*$/;static ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/;static ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"}r.QrSegment=n})(V||(V={}));(r=>{let t;(e=>{class i{constructor(n,o){this.ordinal=n,this.formatBits=o}ordinal;formatBits;static LOW=new i(0,1);static MEDIUM=new i(1,0);static QUARTILE=new i(2,3);static HIGH=new i(3,2)}e.Ecc=i})(t=r.QrCode||(r.QrCode={}))})(V||(V={}));(r=>{let t;(e=>{class i{constructor(n,o){this.modeBits=n,this.numBitsCharCount=o}modeBits;numBitsCharCount;static NUMERIC=new i(1,[10,12,14]);static ALPHANUMERIC=new i(2,[9,11,13]);static BYTE=new i(4,[8,16,16]);static KANJI=new i(8,[8,10,12]);static ECI=new i(7,[0,0,0]);numCharCountBits(n){return this.numBitsCharCount[Math.floor((n+7)/17)]}}e.Mode=i})(t=r.QrSegment||(r.QrSegment={}))})(V||(V={}));var lt=V.QrCode,Cs=V.QrSegment;var Gn=4,ze=["L","M","Q","H"],$e=[lt.Ecc.LOW,lt.Ecc.MEDIUM,lt.Ecc.QUARTILE,lt.Ecc.HIGH];function Ls(r){if(r==null||r.trim()==="")return 1;let t=r.trim().toUpperCase(),e=ze.indexOf(t);return e!==-1?e:/^[0-3]$/.test(t)?Number(t):null}function Ms(r,t=1){let e=$e[t]??$e[1],i;try{i=lt.encodeSegments(Cs.makeSegments(r),e,1,40,-1,!1)}catch(n){let o=new RangeError(n instanceof Error?n.message:String(n));throw o.reason=/too long/i.test(o.message)?"capacity":"encoding",o}let s=[];for(let n=0;n<i.size;n++){let o=[];for(let a=0;a<i.size;a++)o.push(i.getModule(a,n));s.push(o)}return{version:i.version,size:i.size,ecl:$e.indexOf(e),modules:s}}function Rs(r,t){let e=r+Gn*2,i=Math.max(1,Math.floor(t/e)),s=Math.max(t,i*e),n=Math.floor((s-i*r)/2);return{cell:i,offset:n,edge:s}}function Ts([r,t,e]){let i=s=>{let n=s/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4};return .2126*i(r)+.7152*i(t)+.0722*i(e)}function _s(r,t){let e=[];(t[3]??1)<1&&e.push("the background is not opaque, so the code takes on whatever is behind it"),(r[3]??1)<1&&e.push("the module colour is not opaque");let i=Ts(r),s=Ts(t);i>s&&e.push("modules are lighter than the background (inverted codes are rejected by many scanners)");let n=(Math.max(i,s)+.05)/(Math.min(i,s)+.05);return n<4&&e.push(`contrast is ${n.toFixed(2)}:1 (aim for at least 4:1)`),e}var Yn=200,Xn="#000",Jn="#fff",Be=class extends b{#t=null;#e=null;#i="";#s=!1;#r="";#n="";static get observedAttributes(){return["value","size","color","background","error-correction","data-label-prefix"]}get value(){return this.getAttribute("value")||this.#i}set value(t){t==null||t===""?this.removeAttribute("value"):this.setAttribute("value",String(t))}setup(){if(!this.#e){this.#i=(this.textContent??"").trim();let t=document.createElement("span");t.setAttribute("data-qr-caption",""),t.append(...this.childNodes),!this.#i&&!t.children.length&&(t.textContent=this.value,this.#s=!0),this.#e=t}return this.#t||(this.#t=document.createElement("canvas"),this.#t.setAttribute("role","img")),this.#t.parentNode!==this&&this.prepend(this.#t),this.#e.parentNode!==this&&this.append(this.#e),this.#c(),this.#a(),!0}#a(){if(typeof window.matchMedia!="function")return;let t=window.matchMedia(`(resolution: ${window.devicePixelRatio||1}dppx)`);this.listen(t,"change",()=>{this.isConnected&&(this.#c(),this.#a())},{once:!0})}attributeChangedCallback(){!this.hasAttribute("data-upgraded")||!this.isConnected||this.#c()}#c(){let t=this.#t,e=this.value;if(t.setAttribute("aria-label",this.getAttribute("data-label-prefix")||"QR code"),this.#s&&this.#e&&this.#e.textContent!==e&&(this.#e.textContent=e),this.removeAttribute("data-error"),!e){this.#h();return}let i=this.getAttribute("error-correction"),s=Ls(i);s===null&&(console.warn(`<qr-code>: error-correction="${i}" is not L, M, Q, H or 0-3; using M.`),s=1);let n;try{n=Ms(e,s)}catch(f){let m=f.reason||"encoding";this.#h(),this.setAttribute("data-error",m),this.dispatchEvent(new CustomEvent("qr-code:error",{bubbles:!0,detail:{reason:m,value:e,errorCorrection:ze[s],message:f.message}}));return}let o=Math.max(1,parseInt(this.getAttribute("size")??"",10)||Yn),a=Math.max(1,window.devicePixelRatio||1),{cell:l,offset:c,edge:h}=Rs(n.size,Math.round(o*a));t.hidden=!1,t.width=h,t.height=h,t.style.inlineSize=`${o}px`;let u=this.#l(this.getAttribute("color"),Xn),p=this.#l(this.getAttribute("background"),Jn);this.#o(u,p);let d=t.getContext("2d");if(d){d.clearRect(0,0,h,h),d.fillStyle=p.css,d.fillRect(0,0,h,h),d.fillStyle=u.css;for(let f=0;f<n.size;f++)for(let m=0;m<n.size;m++)n.modules[f][m]&&d.fillRect(c+m*l,c+f*l,l,l);this.#r=e}}#h(){let t=this.#t;t.hidden=!0,t.width=0,t.height=0,this.#r=""}#l(t,e){let i=this.#t,s=t?.trim()||e,n=i.style.color;i.style.color="",i.style.color=s,i.style.color||(console.warn(`<qr-code>: "${s}" is not a valid colour; using ${e}.`),i.style.color=e);let o=getComputedStyle(i).color;i.style.color=n;let a=(o.match(/[\d.]+/g)||[]).map(Number),l=[a[0]??0,a[1]??0,a[2]??0,a[3]??1];return{css:o,rgba:l}}#o(t,e){if(!this.hasAttribute("color")&&!this.hasAttribute("background"))return;let i=`${t.css}|${e.css}`;if(i===this.#n)return;this.#n=i;let s=_s(t.rgba,e.rgba);s.length&&console.warn(`<qr-code>: color="${t.css}" on background="${e.css}" may not scan: ${s.join("; ")}.`,this)}toDataURL(t="image/png"){return!this.#t||!this.#r?"":this.#t.toDataURL(t)}async copy({button:t}={}){let e=this.#t;if(!e||!this.#r)return!1;let i=this.#r,s=await new Promise(n=>e.toBlob(n,"image/png"));return Es({text:i,blob:s||void 0},{button:t,announceMessage:this.getAttribute("data-label-copied")||"QR code copied"})}};g("qr-code",Be);var Zn="Slide to confirm",Qn="Confirmed!",to="Press Enter to confirm",Ns=6,je=class extends b{static formAssociated=!0;static observedAttributes=["label","activated-label","data-label-hint","required","value"];#t;#e;#i;#s;#r;#n=!1;#a=0;#c=0;#h=0;#l=0;#o=!1;#u=!1;#p=!1;#d="";#f;constructor(){super(),this.#t=this.attachInternals(),this._adoptInternals(this.#t)}get activated(){return this.#o}get#k(){let t=this.getAttribute("threshold"),e=Number(t);return t!==null&&t.trim()!==""&&!isNaN(e)?Math.min(100,Math.max(0,e)):90}get#y(){return this.getAttribute("label")||this.#d||Zn}get#m(){return this.getAttribute("activated-label")||Qn}get#v(){return getComputedStyle(this).direction==="rtl"}setup(){this.#p||(this.#w(),this.#p=!0),this.listen(this.#e,"pointerdown",this.#x),this.listen(this.#e,"keydown",this.#$),this.listen(this.#e,"transitionend",this.#P)}teardown(){this.#n&&this.#E(),clearTimeout(this.#f),this.removeAttribute("transitioning")}attributeChangedCallback(t,e,i){e===i||!this.#p||(this.#g(),(t==="required"||t==="value")&&this.#T())}#w(){this.#d=(this.textContent||"").replace(/\s+/g," ").trim(),this.#r=document.createElement("div"),this.#r.className="slide-track",this.#i=document.createElement("span"),this.#i.className="slide-label",this.#i.setAttribute("role","status"),this.#s=document.createElement("span"),this.#s.className="visually-hidden slide-hint",this.#s.id=`slide-hint-${Math.random().toString(36).slice(2,9)}`,this.#e=document.createElement("div"),this.#e.className="slide-handle",this.#e.setAttribute("role","slider"),this.#e.setAttribute("aria-valuemin","0"),this.#e.setAttribute("aria-valuemax","100"),this.#e.setAttribute("aria-describedby",this.#s.id),this.#e.setAttribute("tabindex","0"),this.#e.innerHTML='<icon-wc name="chevrons-right" size="sm"></icon-wc>',this.#r.append(this.#i,this.#e),this.textContent="",this.append(this.#r,this.#s),this.#g(),this.#M(0),this.#T()}#g(){let t=this.#y;this.#i.textContent=this.#o?this.#m:t,this.#e.setAttribute("aria-label",t),this.#s.textContent=this.getAttribute("data-label-hint")||to,this.#b()}#b(){this.#e.setAttribute("aria-valuetext",this.#o?this.#m:`${Math.round(this.#a)}%`)}#T(){let t=this.getAttribute("value")||"on";this.#t.setFormValue(this.#o?t:null),this.hasAttribute("required")&&!this.#o?this.#t.setValidity({valueMissing:!0},`${this.#y} to continue.`,this.#e):this.#t.setValidity({})}reset(){this.#o=!1,this.removeAttribute("data-activated"),this.#e.removeAttribute("aria-disabled"),this.#A(),this.#M(0),this.#g(),this.#T(),this.dispatchEvent(new CustomEvent("slide-accept:reset",{bubbles:!0}))}formResetCallback(){(this.#o||this.#a!==0)&&this.reset()}formDisabledCallback(t){this.#u=t,t&&this.#n&&(this.#E(),this.#I()),this.#A()}#A(){this.#e&&(this.#o||this.#u?this.#e.setAttribute("aria-disabled","true"):this.#e.removeAttribute("aria-disabled"))}#x=t=>{if(!(this.#o||this.#u)&&t.button===0){if(t.preventDefault(),this.#e.focus({preventScroll:!0}),this.hasAttribute("transitioning")){let e=this.#e.getBoundingClientRect(),i=this.#r.getBoundingClientRect(),s=parseFloat(getComputedStyle(this.#r).getPropertyValue("--_handle-inset")||"0"),n=this.#e.offsetWidth,o=i.width-n-s*2,a=this.#v?i.right-e.right-s:e.left-i.left-s;this.removeAttribute("transitioning"),clearTimeout(this.#f),this.#M(o>0?Math.max(0,Math.min(100,a/o*100)):0)}this.#n=!0,this.#c=t.clientX,this.#h=this.#a,this.#l=0;try{this.#e.setPointerCapture(t.pointerId)}catch{}this.setAttribute("data-dragging",""),this.#e.addEventListener("pointermove",this.#S),this.#e.addEventListener("pointerup",this.#L),this.#e.addEventListener("pointercancel",this.#C)}};#S=t=>{if(!this.#n)return;let e=this.#r.getBoundingClientRect().width-this.#e.offsetWidth;if(e<=0)return;let i=t.clientX-this.#c;this.#l=Math.max(this.#l,Math.abs(i));let n=(this.#v?-i:i)/e*100;this.#M(Math.min(100,Math.max(0,this.#h+n)))};#E(t){if(this.#n=!1,this.removeAttribute("data-dragging"),t)try{this.#e.releasePointerCapture(t.pointerId)}catch{}this.#e.removeEventListener("pointermove",this.#S),this.#e.removeEventListener("pointerup",this.#L),this.#e.removeEventListener("pointercancel",this.#C)}#L=t=>{if(!this.#n)return;let e=this.#l<Ns&&Math.abs(t.clientX-this.#c)<Ns;this.#E(t),e||this.#a>=this.#k?this.#N():this.#I()};#C=t=>{this.#n&&(this.#E(t),this.#I())};#$=t=>{if(this.#o||this.#u)return;let e=t.shiftKey?20:5,i=this.#v,s=i?"ArrowLeft":"ArrowRight",n=i?"ArrowRight":"ArrowLeft";t.key===s||t.key==="ArrowUp"?(t.preventDefault(),this.#M(Math.min(100,this.#a+e)),this.#a>=this.#k&&this.#N()):t.key===n||t.key==="ArrowDown"?(t.preventDefault(),this.#M(Math.max(0,this.#a-e))):t.key==="End"||t.key==="Enter"||t.key===" "?(t.preventDefault(),this.#N()):t.key==="Home"&&(t.preventDefault(),this.#M(0))};#P=()=>{this.removeAttribute("transitioning")};#N(){this.#o||(this.#o=!0,this.#M(100),this.setAttribute("data-activated",""),this.#A(),this.#g(),this.#T(),this.dispatchEvent(new CustomEvent("slide-accept:accept",{bubbles:!0})))}#I(){this.setAttribute("transitioning",""),this.#M(0),clearTimeout(this.#f),this.#f=setTimeout(()=>{this.removeAttribute("transitioning")},500)}#M(t){this.#a=t,this.style.setProperty("--_slide-position",String(t)),this.#e.setAttribute("aria-valuenow",String(Math.round(t))),this.#b()}};g("slide-accept",je);var Dt="banner",Ps=365,Is=864e5;function $s(r){if(r===0||r==="0"||r==="never")return;let t=r==null||r===""?Ps:Number.parseFloat(String(r));return Number.isFinite(t)?t>0?t*Is:void 0:Ps*Is}var eo=0,Oe=class extends b{#t=null;static get observedAttributes(){return["position"]}get#e(){return this.getAttribute("persist")||Dt}get#i(){return $s(this.getAttribute("expires"))}get#s(){return this.getAttribute("position")==="center"}setup(){return this.#t=this.querySelector("dialog"),this.#t?(this.#r(),this.getAttribute("trigger")&&this.listen(document,"click",this.#u),this.listen(this,"click",this.#o),this.listen(this.#t,"cancel",this.#l),this.#n(),!0):!1}attributeChangedCallback(t,e,i){e===i||!this.#t?.open||(this.#t.close(),this.#a())}#r(){let t=this.#t;if(t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby"))return;let e=t.querySelector("h1, h2, h3, h4, h5, h6");e?(e.id||(e.id=`consent-banner-title-${++eo}`),t.setAttribute("aria-labelledby",e.id)):t.setAttribute("aria-label","Cookie consent")}async#n(){if(await this.#p()){this.getAttribute("trigger")?this.hidden=!0:this.remove();return}this.#c()}#a(){this.#s?this.#t.showModal():this.#t.show()}#c(){!this.isConnected||this.#t.open||this.#a()}#h(){this.#t.close(),this.getAttribute("trigger")?this.hidden=!0:this.remove()}#l=t=>{this.#s&&t.preventDefault()};#o=async t=>{if(!this.#t.open)return;let e=t.target.closest("button[value]");if(!e||!this.#t.contains(e))return;let i=e.value;if(!["accept","reject","save"].includes(i))return;let s=[...this.querySelectorAll('input[type="checkbox"]')],n={};i==="accept"?s.forEach(o=>{n[o.name]=!0}):i==="reject"?s.forEach(o=>{n[o.name]=!!o.disabled}):s.forEach(o=>{n[o.name]=o.checked}),await this.#d({preferences:n,action:i}),this.dispatchEvent(new CustomEvent("consent-banner:change",{bubbles:!0,detail:{preferences:n,action:i}})),this.#h()};#u=async t=>{let e=this.getAttribute("trigger");if(!e||!t.target.closest(e))return;t.preventDefault();let s=await this.#p();if(s?.preferences)for(let[n,o]of Object.entries(s.preferences)){let a=this.querySelector(`input[type="checkbox"][name="${CSS.escape(n)}"]`);a&&!a.disabled&&(a.checked=o)}this.hidden=!1,this.#c()};async#p(){let t=this.#i;try{return await _.get("consent",this.#e,t?{maxAge:t}:void 0)}catch{return null}}async#d(t){try{await _.set("consent",this.#e,t)}catch{}}static async reset(t=Dt){try{await _.remove("consent",t)}catch{}}static async getConsent(t=Dt,e={}){let i=e.expires;i===void 0&&typeof document<"u"&&(i=[...document.querySelectorAll("consent-banner")].find(o=>(o.getAttribute("persist")||Dt)===t)?.getAttribute("expires")??void 0);let s=$s(i);try{return await _.get("consent",t,s?{maxAge:s}:void 0)}catch{return null}}};g("consent-banner",Oe);var io={play:"Play",pause:"Pause",stop:"Stop",reader:"Article reader",controls:"Reader controls",voice:"Voice","loading-voices":"Loading voices\u2026",speed:"Speed",slower:"Slower",faster:"Faster"},zs='[aria-hidden="true"], [hidden], script, style, template, text-reader',so=()=>typeof HTMLElement<"u"&&Object.prototype.hasOwnProperty.call(HTMLElement.prototype,"popover"),De=()=>typeof window<"u"&&"speechSynthesis"in window,At=r=>(r||"").toLowerCase().split(/[-_]/)[0],Fe=class extends b{#t=null;#e=null;#i=[];#s="";#r=0;#n=null;#a=null;#c=null;#h=null;#l=!1;#o=!1;#u=0;#p=null;#d=null;#f=null;#k=null;#y=null;#m=null;#v=null;#w=!1;#g=null;#b=null;#T=[];#A=[];static get observedAttributes(){return["speed","voice","for"]}attributeChangedCallback(t,e,i){if(e!==i&&(t==="for"&&e!==null&&this.hasAttribute("data-upgraded")&&(this.#l&&this.stop(),this.#F(),this.#st(this.#A)),(t==="speed"||t==="voice")&&this.#l&&this.#U(),t==="speed")){let s=this.#Y(parseFloat(i)||1);this.#y&&(this.#y.value=String(s)),this.#m&&(this.#m.textContent=`${s}\xD7`)}}setup(){return De()?(this.getAttribute("variant")==="icon"?this.#C():this.#x(),this.#F(),this.#q(),this.#h=this.#it(),this.#h.then(t=>{this.#A=t,this.#st(t)}),this.listen(window,"beforeunload",this.#at),!0):(this.style.display="none",!1)}teardown(){this.#l&&this.stop(),this.#J(),this.#v?.remove(),this.#b?.remove(),this.#g?.remove(),this.#v=null,this.#b=null,this.#g=null,this.#p=this.#d=this.#f=null,this.#k=null,this.#y=null,this.#m=null,this.#w=!1;for(let{icon:t,slot:e}of this.#T)t.setAttribute("slot",e),this.append(t);this.#T=[]}play(){if(De()){if(this.#o){this.resume();return}this.#l||(this.#_(),this.#K(0))}}pause(){!this.#l||this.#o||(speechSynthesis.pause(),this.#o=!0,this.#G(!0),this.#V("text-reader:pause"))}resume(){this.#o&&(speechSynthesis.resume(),this.#o=!1,this.#G(!1),this.#V("text-reader:resume"))}stop(){!De()||!this.#l||(this.#e=null,speechSynthesis.cancel(),this.#X(),this.#V("text-reader:stop"))}get voices(){return this.#h||this.#it()}get speaking(){return this.#l}get paused(){return this.#o}get progress(){return this.#s.length?Math.min(this.#r/this.#s.length,1):0}#x(){let t=document.createElement("div");t.setAttribute("part","controls"),t.setAttribute("role","group"),t.setAttribute("aria-label",this.#E("reader"));let e=this.#S("play",this.#E("play"),"\u25B6");e.addEventListener("click",()=>this.play());let i=this.#S("pause",this.#E("pause"),"\u23F8");i.hidden=!0,i.addEventListener("click",()=>this.pause());let s=this.#S("stop",this.#E("stop"),"\u23F9");s.disabled=!0,s.addEventListener("click",()=>this.stop());let n=document.createElement("select");n.setAttribute("aria-label",this.#E("voice"));let o=document.createElement("option");o.textContent=this.#E("loading-voices"),n.append(o),n.addEventListener("change",()=>{this.#l&&this.#U()});let a=document.createElement("label");a.setAttribute("data-speed-group","");let l=document.createElement("span");l.setAttribute("data-speed-value","");let c=this.#Y(parseFloat(this.getAttribute("speed")??"1")||1);l.textContent=`${c}\xD7`;let h=document.createElement("input");h.type="range",h.min="0.5",h.max="2",h.step="0.1",h.value=String(c),h.setAttribute("aria-label",this.#E("speed")),h.addEventListener("input",()=>{let u=parseFloat(h.value);l.textContent=`${u}\xD7`,this.#l&&this.#U()}),a.append(l,h),this.#L("icon-play",e),this.#L("icon-pause",i),this.#L("icon-stop",s),t.append(e,i,s,n,a),this.prepend(t),this.#v=t,this.#p=e,this.#d=i,this.#f=s,this.#k=n,this.#y=h,this.#m=l}#S(t,e,i){let s=document.createElement("button");return s.type="button",s.setAttribute("part",`button ${t}`),s.setAttribute("aria-label",e),s.textContent=i,s}#E(t){return this.getAttribute(`data-label-${t}`)||io[t]}#L(t,e){let i=this.querySelector(`:scope > [slot="${t}"]`);i&&(i.removeAttribute("slot"),e.textContent="",e.append(i),this.#T.push({icon:i,slot:t}))}#C(){this.#w=!0;for(let i of this.querySelectorAll(':scope > [part="trigger"]'))i.remove();let t=document.createElement("button");t.type="button",t.setAttribute("part","trigger"),t.setAttribute("aria-label",this.#E("reader")),t.setAttribute("aria-pressed","false");let e=this.querySelector(':scope > [slot="icon-trigger"]');if(e)e.removeAttribute("slot"),t.append(e),this.#T.push({icon:e,slot:"icon-trigger"});else{let i=document.createElement("icon-wc");i.setAttribute("name","volume-2"),i.setAttribute("aria-hidden","true"),t.append(i)}t.addEventListener("click",()=>this.#P()),this.append(t),this.#g=t,this.#$()}#$(){let t=document.createElement("div");t.setAttribute("data-text-reader-toolbar",""),t.setAttribute("role","group"),t.setAttribute("aria-label",this.#E("controls")),t.hidden=!0,so()&&(t.popover="manual");let e=this.#S("play",this.#E("play"),"\u25B6");e.addEventListener("click",()=>this.play());let i=this.#S("pause",this.#E("pause"),"\u23F8");i.hidden=!0,i.addEventListener("click",()=>this.pause());let s=this.#S("stop",this.#E("stop"),"\u23F9");s.addEventListener("click",()=>this.stop());let n=this.#S("speed-down",this.#E("slower"),"\u2212");n.addEventListener("click",()=>this.#R(-.1));let o=document.createElement("span");o.setAttribute("data-speed-value","");let a=this.#Y(parseFloat(this.getAttribute("speed")??"1")||1);o.textContent=`${a}\xD7`;let l=this.#S("speed-up",this.#E("faster"),"+");l.addEventListener("click",()=>this.#R(.1)),this.#L("icon-play",e),this.#L("icon-pause",i),this.#L("icon-stop",s),t.append(e,i,s,n,o,l),this.append(t),this.#p=e,this.#d=i,this.#f=s,this.#m=o,this.#b=t,this.listen(document,"pointerdown",this.#z),this.listen(document,"keydown",this.#D)}#P(){if(!this.#l){this.play();return}this.#b?.hidden&&this.#N(),this.#o?this.resume():this.pause()}#N(){if(!this.#b||!this.#g)return;let t=this.#b;t.hidden=!1,t.popover&&!t.matches(":popover-open")&&t.showPopover(),t.style.visibility="hidden",requestAnimationFrame(()=>{this.#M(),t.style.visibility=""})}#I(){let t=this.#b;if(!t||t.hidden)return;let e=t.contains(document.activeElement);t.popover&&t.matches(":popover-open")&&t.hidePopover(),t.hidden=!0,e&&this.#g?.focus()}#M(){let t=this.#b,e=this.#g;if(!t||!e)return;let i=e.getBoundingClientRect(),s=t.offsetWidth,n=t.offsetHeight,o=8,a=8,l=i.top-n-o;l<a&&(l=i.bottom+o);let c=i.left+i.width/2-s/2,h=window.innerWidth-s-a;c=Math.max(a,Math.min(c,h)),t.style.top=`${l}px`,t.style.left=`${c}px`}#R(t){let e=parseFloat(this.getAttribute("speed")??"1")||1,i=this.#Y(e+t);this.setAttribute("speed",String(i))}#z=t=>{!this.#b||this.#b.hidden||this.#b.contains(t.target)||this.#g?.contains(t.target)||this.#I()};#D=t=>{if(t.key==="Escape"&&this.#b&&!this.#b.hidden){let e=this.#b.contains(document.activeElement)||this.#g===document.activeElement;this.#I(),e&&this.#g?.focus()}};#F(){let t=this.getAttribute("for");if(!t){console.warn('<text-reader>: missing "for" attribute'),this.#B();return}if(this.#t=document.getElementById(t),!this.#t){console.warn(`<text-reader>: no element found with id="${t}"`),this.#B();return}this.#_(),this.#O()}#B(){this.#p&&(this.#p.disabled=!0),this.#f&&(this.#f.disabled=!0)}#O(){this.#p&&(this.#p.disabled=!1)}#_(){let t=this.#t;if(!t)return;let e=this.getAttribute("selectors")||"p,li",i=[...t.querySelectorAll(e)],s=o=>o.closest("pre")||o.closest("code")||o.closest(zs);this.#i=[];let n=0;for(let o of i){if(s(o))continue;let a=[],l="",c=document.createTreeWalker(o,NodeFilter.SHOW_TEXT,{acceptNode:h=>h.parentElement?.closest(zs)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(;c.nextNode();){let h=c.currentNode,u=h.data;u&&(a.push({node:h,start:l.length,end:l.length+u.length}),l+=u)}l.trim()&&(this.#i.push({element:o,text:l,speechStart:n,speechEnd:n+l.length,segments:a}),n+=l.length+1)}this.#s=this.#i.map(o=>o.text).join(" ")}#j(){return this.#t?.closest("[lang]")?.getAttribute("lang")||document.documentElement.lang||""}#K(t){if(!this.#s)return;let e=t>0?this.#s.slice(t):this.#s;if(!e.trim())return;let i=e.replace(/[<>]/g," "),s=new SpeechSynthesisUtterance(i),n=this.#j();n&&(s.lang=n),s.rate=this.#Y(parseFloat(this.#y?.value??this.getAttribute("speed")??"1")||1);let o=this.#k?.selectedOptions[0];if(o?.dataset.voiceUri){let a=speechSynthesis.getVoices().find(l=>l.voiceURI===o.dataset.voiceUri);a&&(s.voice=a)}else if(n){let a=At(n),l=speechSynthesis.getVoices(),c=l.find(h=>h.lang.toLowerCase()===n.toLowerCase())||l.find(h=>At(h.lang)===a&&h.default)||l.find(h=>At(h.lang)===a);c&&(s.voice=c)}s.onboundary=a=>{if(this.#e!==s||a.name!=="word")return;let l=t+a.charIndex;this.#r=l;let c=a.charLength;if(!c){let u=this.#s.slice(l).match(/^\S+/);c=u?u[0].length:1}this.#Z(l,c),this.#V("text-reader:word",{word:this.#s.slice(l,l+c),charIndex:l,element:this.#Q(l)?.element})},s.onend=()=>{if(this.#e!==s)return;let a=Date.now()-this.#u;this.#X(),this.#V("text-reader:end",{duration:a})},s.onerror=a=>{if(this.#e===s){if(a.error==="interrupted"||a.error==="canceled"){this.#X(),this.#V("text-reader:stop");return}console.warn("<text-reader>: SpeechSynthesisUtterance error:",a.error),this.#X(),this.#V("text-reader:error",{error:a.error})}},this.#e=s,this.#l=!0,this.#o=!1,this.#u=Date.now(),this.#r=t,this.#nt(!0),speechSynthesis.cancel(),speechSynthesis.speak(s),this.#W(),this.#V("text-reader:play",{voice:s.voice?.name,speed:s.rate})}#U(){let t=this.#r;this.#e=null,speechSynthesis.cancel(),this.#H(),requestAnimationFrame(()=>this.#K(t))}#W(){this.#H(),this.#n=setInterval(()=>{if(!speechSynthesis.speaking){this.#H();return}speechSynthesis.pause(),speechSynthesis.resume()},1e4)}#H(){this.#n&&clearInterval(this.#n),this.#n=null}#q(){if(!CSS.highlights)return;let t=new CSSStyleSheet;t.replaceSync(`
1250
1250
  ::highlight(text-reader-word) {
1251
1251
  background-color: var(--text-reader-highlight, Mark);
1252
1252
  color: var(--text-reader-highlight-text, MarkText);
1253
1253
  }
1254
- `),this.#a=t,document.adoptedStyleSheets=[...document.adoptedStyleSheets,t]}#J(){let t=this.#a;t&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(e=>e!==t),this.#a=null),this.#et()}#Z(t,e){if(!CSS.highlights||this.getAttribute("highlight")==="false")return;let i=this.#Q(t);if(!i)return;let s=t-i.speechStart,n=this.#rt(i,s,e);if(!n)return;let o=new Highlight(n);if(CSS.highlights.set("text-reader-word",o),this.#c=o,this.getAttribute("scroll")!=="false"){let a=n.getBoundingClientRect(),l=window.innerHeight;if(a.top<0||a.bottom>l){let c=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;i.element.scrollIntoView({behavior:c?"auto":"smooth",block:"nearest"})}}}#et(){CSS.highlights&&CSS.highlights.delete("text-reader-word"),this.#c=null}#Q(t){let e=this.#i,i=0,s=e.length-1;for(;i<=s;){let n=i+s>>>1,o=e[n];if(t<o.speechStart)s=n-1;else if(t>=o.speechEnd)i=n+1;else return o}return null}#rt(t,e,i){let s=t.segments,n=e+i,o=s.find(c=>e>=c.start&&e<c.end);if(!o||!o.node.isConnected)return null;let a=s.find(c=>n>c.start&&n<=c.end)||o,l=document.createRange();return l.setStart(o.node,e-o.start),a.node.isConnected&&a.start>=o.start?l.setEnd(a.node,Math.min(n-a.start,a.node.length)):l.setEnd(o.node,o.node.length),l}async#it(){let t=speechSynthesis.getVoices();return t.length>0?t:new Promise(e=>{let i=()=>{speechSynthesis.removeEventListener("voiceschanged",i),e(speechSynthesis.getVoices())};speechSynthesis.addEventListener("voiceschanged",i),setTimeout(()=>{speechSynthesis.removeEventListener("voiceschanged",i),e(speechSynthesis.getVoices())},3e3)})}#st(t){if(!this.#k||!t.length)return;let e=this.#k;e.innerHTML="";let i=At(this.#j()||"en"),s=c=>At(c.lang)===i,n=t.filter(s),o=t.filter(c=>!s(c)),a=[...n,...o],l=this.getAttribute("voice");for(let c of a){let h=document.createElement("option");h.textContent=`${c.name} (${c.lang})`,h.dataset.voiceUri=c.voiceURI,l&&c.voiceURI===l&&(h.selected=!0),e.append(h)}if(!l){let c=n.find(h=>h.default)||n[0];if(c){let h=[...e.options].find(u=>u.dataset.voiceUri===c.voiceURI);h&&(h.selected=!0)}}}#tt(t,e){let i=document.activeElement;t();for(let[s,n]of e)if(s&&n&&i===s&&!n.hidden&&!n.disabled){n.focus();return}}#nt(t){if(!this.#p||!this.#d||!this.#f)return;let e=this.#p,i=this.#d,s=this.#f;this.#tt(()=>{e.hidden=t,i.hidden=!t,s.disabled=!t},t?[[e,i]]:[[i,e],[s,e]]),this.#y&&(this.#g&&this.#g.setAttribute("aria-pressed",String(t)),t?this.#N():this.#I())}#G(t){if(!this.#p||!this.#d)return;let e=this.#p,i=this.#d;this.#tt(()=>{e.hidden=!t,i.hidden=t},t?[[i,e]]:[[e,i]])}#X(){this.#l=!1,this.#o=!1,this.#r=0,this.#e=null,this.#H(),this.#et(),this.#nt(!1)}#Y(t){return Math.round(Math.max(.5,Math.min(2,t))*10)/10}#V(t,e={}){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0}))}#at=()=>{this.#l&&speechSynthesis.cancel()}};g("text-reader",Fe);var ro="http://www.w3.org/1999/xhtml",qe="http://www.w3.org/2000/svg",no="http://www.w3.org/1998/Math/MathML",oo=new Set([ro,qe,no]),He="user-content-",ao=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"]),js=new Set(["title","desc"]),lo=new Set(["animate","set","animatemotion","animatetransform"]),co=new Set(["href","xlink:href","action","formaction","data","codebase","cite","background","longdesc","manifest","to","from","values","by"]),ho=new Set(["src","poster","srcset"]),uo=new Set(["srcdoc","form","formaction","formmethod","formtarget","formenctype","formnovalidate","action","method","ping"]),po=new Set(["popovertarget","popovertargetaction","commandfor","command","interestfor","autofocus"]),fo=new Set(["for","headers","list","aria-labelledby","aria-describedby","aria-controls","aria-owns","aria-flowto","aria-details","aria-errormessage","aria-activedescendant"]),mo={"include-file":["trusted","allow-scripts","allow-cross-origin"],"markdown-viewer":["src","sanitize","ping","allow-cross-origin"]},go=new Set(["social-embed","youtube-player","geo-map"]),bo=["src","src-dark","data-src","url","endpoint","tile-url","data-versions"],vo=new Set(["audio-player","video-player","image-map","brand-mark"]);function yo(r){return String(r).replace(/[\u0000- \u007f-\u009f]/g,"").toLowerCase()}function Bs(r,t=!1){let e=yo(r);return t?/(^|,)(javascript|vbscript|livescript):/.test(e)?!0:/(^|,)data:/.test(e)?e.split(/(?=data:)/).filter(s=>s.startsWith("data:")).some(s=>!/^data:(image|audio|video|font)\//.test(s)):!1:/^(javascript|vbscript|livescript|data):/.test(e)}function Os(r){let t=String(r).replace(/\/\*[\s\S]*?\*\//g,"").replace(/\\/g,"").replace(/\s+/g,"").toLowerCase();return/expression\(|javascript:|vbscript:|-moz-binding|behavior:|@import|position:fixed/.test(t)}var wo=r=>String(r.localName||r.tagName||"").toLowerCase(),ko=r=>r.startsWith(He)?r:He+r;function Ao(r,t){if(ao.has(t))return!0;let e=r.namespaceURI;return!!(e&&!oo.has(e)||t==="title"&&e!==qe||js.has(t)&&e===qe&&r.children?.length||lo.has(t)&&(r.getAttribute("attributeName")||r.getAttribute("attributename")||"").toLowerCase().includes("href"))}function xo(r,t){for(let e of[...r.attributes]){let i=e.name.toLowerCase();if(i.startsWith("on")||uo.has(i)||!t.keepIds&&po.has(i)){r.removeAttribute(e.name);continue}if(i==="style"){(!t.keepStyle||Os(e.value))&&r.removeAttribute(e.name);continue}if((i==="id"||i==="name")&&!t.keepIds){let s=ko(e.value);i==="id"?t.ids.set(e.value,s):t.ids.set(`name:${e.value}`,s),r.setAttribute(e.name,s);continue}if(co.has(i)||i.endsWith(":href")){Bs(e.value,!1)&&r.removeAttribute(e.name);continue}ho.has(i)&&Bs(e.value,!0)&&r.removeAttribute(e.name)}}function Eo(r,t){let e=(r.getAttribute("type")||"").toLowerCase();t==="button"&&e!=="button"&&r.setAttribute("type","button"),t==="input"&&/^(submit|reset|image)$/.test(e)&&r.setAttribute("type","button")}function So(r,t){for(let e of r)for(let i of[...e.attributes]){let s=i.name.toLowerCase(),n=i.value;if((s==="href"||s.endsWith(":href"))&&n.startsWith("#")){let o=Co(n.slice(1));t.has(o)&&e.setAttribute(i.name,`#${t.get(o)}`)}else if(s==="usemap"&&n.startsWith("#")){let o=t.get(`name:${n.slice(1)}`);o?e.setAttribute(i.name,`#${o}`):e.removeAttribute(i.name)}else if(fo.has(s)){let o=n.split(/\s+/).filter(Boolean).map(a=>t.get(a)||(a.startsWith(He)?a:null)).filter(Boolean);o.length?e.setAttribute(i.name,o.join(" ")):e.removeAttribute(i.name)}else n.includes("url(#")&&e.setAttribute(i.name,n.replace(/url\(#([^)]+)\)/g,(o,a)=>t.has(a)?`url(#${t.get(a)})`:o))}}function Co(r){try{return decodeURIComponent(r)}catch{return r}}function Ds(r){let t=r.childNodes;if(t)for(let e of[...t])e.nodeType===8?e.remove():(e.nodeType===1||e.nodeType===11)&&Ds(e)}function Fs(r,t){Ds(r);let e=[...r.querySelectorAll("*")];t.includeRoot&&e.unshift(r);let i=new Map,s=[],n={...t,ids:i};for(let o of e){if(!Lo(o,r))continue;let a=wo(o);if(t.svgOnly&&(js.has(a)||a==="style")){if(a==="style"&&Os(o.textContent||"")){o.remove();continue}}else if(Ao(o,a)){o.remove();continue}if(!t.keepIds&&!t.svgOnly&&go.has(a)){To(o);continue}if(a==="template"){let c=o.content;c&&Fs(c,{...t,includeRoot:!1})}xo(o,n),t.keepIds||Eo(o,a);let l=mo[a];if(l)for(let c of l)o.removeAttribute(c);if(a==="include-file"&&!t.allowIncludeFile&&o.removeAttribute("src"),!t.keepIds&&!t.svgOnly&&a.includes("-")&&a!=="include-file"&&!vo.has(a))for(let c of bo)o.removeAttribute(c);s.push(o)}!t.keepIds&&i.size&&So(s,i)}function To(r){let t=r.parentNode;if(t){for(let e of[...r.childNodes])t.insertBefore(e,r);r.remove()}}function Lo(r,t){let e=r;for(;e;){if(e===t)return!0;e=e.parentNode??e.parent??null}return!1}function Ft(r,t={}){let e=document.createElement("template");return r&&typeof r=="string"&&(e.innerHTML=r,Fs(e.content,{allowIncludeFile:!!t.allowIncludeFile,keepIds:!!t.keepIds,keepStyle:!!t.keepStyle})),e.content}function qs({newItems:r,nodes:t,keyOf:e,renderItem:i,containerFor:s}){let n=[],o=[],a=[],l=new Set;for(let h of r)l.add(e(h));for(let[h,u]of[...t])l.has(h)||(u.remove(),t.delete(h),a.push(h));let c=new Map;for(let h of r){let u=e(h),p=t.get(u)||null,d=s(h,p);c.has(d)||c.set(d,[]),c.get(d)?.push({item:h,key:u,existing:p})}for(let[h,u]of c)for(let p=0;p<u.length;p++){let{item:d,key:f,existing:m}=u[p],y=m;y?(y.parentElement!==h||h.children[p]!==y)&&o.push(f):(y=i(d),t.set(f,y),n.push(f));let w=h.children[p];w!==y&&h.insertBefore(y,w||null)}return{added:n,moved:o,removed:a}}var Ue=class extends b{#t=null;#e=null;#i=null;#s=new Map;#r=null;#n=new Map;#a=new Set;setup(){this.#c(),this.#h(),this.#u(),this.#l(),this.#y(),this.#p()}teardown(){for(let t of this.#a)t.abort();this.#a.clear()}#c(){this.#t=this.querySelector(":scope > chat-thread"),this.#e=this.querySelector(":scope > chat-input"),this.#i=this.querySelector(":scope > header select[data-model-select]")}#h(){let t=this.querySelector(":scope > script[data-participants]");if(t)try{let e=JSON.parse(t.textContent);this.#s=new Map(Object.entries(e))}catch{console.warn("[chat-window] Invalid participant JSON")}}#l(){if(this.#t)for(let t of this.#t.querySelectorAll("chat-message[data-from]"))this.#o(t)}#o(t){let e=t.getAttribute("data-from");if(!e)return;let i=this.#s.get(e);i?.name?t.setAttribute("data-from-label",i.name):t.hasAttribute("data-from-label")||t.setAttribute("data-from-label",e)}#u(){if(!this.#i)return;let t=this.getAttribute("model");t?this.#i.value=t:this.#i.value&&this.setAttribute("model",this.#i.value)}#p(){this.listen(this,"chat-input:send",this.#d),this.#i&&this.listen(this.#i,"change",this.#f)}#d=async t=>{t.stopPropagation();let{message:e}=t.detail;if(!e||!this.#t)return;let i=this.#k("user",e,"user");this.#t.appendChild(i),this.#g(),this.#y();let s=this.#v(),n=this.#m(s);this.#t.appendChild(n),this.#g(),this.#e&&(this.#e.disabled=!0);let o=this.getAttribute("endpoint");if(o){let a=new AbortController;this.#a.add(a);try{let l=await this.#b(o,e,a.signal);this.resolveTyping(n,l)}catch(l){a.signal.aborted?n.remove():(this.resolveTyping(n,"<p>Sorry, something went wrong.</p>",{error:!0}),this.dispatchEvent(new CustomEvent("chat-window:error",{bubbles:!0,detail:{error:l.message,status:l.status??0}})))}finally{this.#a.delete(a)}}else this.dispatchEvent(new CustomEvent("chat-window:send",{bubbles:!0,detail:{message:e,typingElement:n}}));this.#e&&(this.#e.disabled=!1,this.isConnected&&this.#e.focus()),this.#g(),this.#y()};#f=()=>{let t=this.#i.value;this.setAttribute("model",t),this.dispatchEvent(new CustomEvent("chat-window:model-change",{bubbles:!0,detail:{model:t}}))};#k(t,e,i){let s=document.createElement("chat-message");s.setAttribute("data-role",t),i&&(s.setAttribute("data-from",i),this.#o(s));let n=document.createElement("chat-bubble");return this.#w(n,e,{asText:t==="user"}),s.appendChild(n),s}#w(t,e,{asText:i=!1}={}){let s=e==null?"":String(e);if(i||!s.includes("<")){let n=document.createElement("p");n.textContent=s,t.replaceChildren(n)}else t.replaceChildren(Ft(s))}#m(t){let e=document.createElement("chat-message");e.setAttribute("data-role","agent"),e.setAttribute("data-status","typing");let i="Agent";t&&(e.setAttribute("data-from",t),this.#o(e),i=this.#s.get(t)?.name??t);let s=this.getAttribute("model");s&&e.setAttribute("data-model",s);let n=document.createElement("chat-bubble"),o=document.createElement("span");return o.className="visually-hidden",o.setAttribute("data-chat-typing",""),o.textContent=`${i} is typing`,n.appendChild(o),e.appendChild(n),e}#v(){for(let[t,e]of this.#s)if(e.role==="agent")return t;return null}#y(){if(!this.#t)return;if(this.#t.querySelector(":scope > chat-message")!==null){this.#r?.remove(),this.#r=null;return}this.#r||(this.#r=this.#t.querySelector(":scope > [data-chat-empty]")),this.#r||(this.#r=document.createElement("p"),this.#r.setAttribute("data-chat-empty",""),this.#r.textContent=this.getAttribute("empty-message")||"Send a message to start."),this.#r.parentNode!==this.#t&&this.#t.prepend(this.#r)}#g(){this.#t&&requestAnimationFrame(()=>{this.#t.scrollTop=this.#t.scrollHeight})}scrollToBottom(){this.#g()}async#b(t,e,i){let s={message:e,model:this.getAttribute("model")||void 0},n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),signal:i});if(!n.ok){let a=new Error(`Chat request failed: ${n.status}`);throw a.status=n.status,a}let o=await n.json();return o.html??o.message??o.content??""}get model(){return this.getAttribute("model")??""}set model(t){this.setAttribute("model",t),this.#i&&(this.#i.value=t)}get participants(){return this.#s}set participants(t){this.#s=t instanceof Map?t:new Map(Object.entries(t)),this.#l()}clearThread(){if(this.#t){for(;this.#t.firstChild;)this.#t.removeChild(this.#t.firstChild);this.#y()}}appendMessage(t,e,i){if(!this.#t)return;let s=this.#k(t,e,i);return this.#t.appendChild(s),this.#g(),this.#y(),s}resolveTyping(t,e,{error:i=!1}={}){if(!t)return;let s=t.querySelector(":scope > chat-bubble");s||(s=document.createElement("chat-bubble"),t.appendChild(s)),this.#w(s,e),t.removeAttribute("aria-label"),i?t.setAttribute("data-status","error"):t.removeAttribute("data-status"),this.#g()}get messages(){return this.#t?[...this.#t.querySelectorAll(':scope > chat-message:not([data-status="typing"])')].map(t=>{let e=t.getAttribute("data-role")||"user",i=t.querySelector("chat-bubble");return{id:t.id||t.getAttribute("data-id")||void 0,role:e,content:(e==="user"?i?.textContent?.trim():i?.innerHTML)||"",from:t.getAttribute("data-from")||void 0}}):[]}set messages(t){if(!this.#t)return;let e=Array.isArray(t)?t:[];for(let[s,n]of this.#n)n.parentNode!==this.#t&&this.#n.delete(s);let i=new Set(this.#n.values());for(let s of[...this.#t.children])if(!i.has(s)){if(s.localName==="chat-message"&&s.id&&!s.matches('[data-status="typing"]')&&!this.#n.has(s.id)){this.#n.set(s.id,s);continue}s===this.#r&&(this.#r=null),s.remove()}qs({newItems:e,nodes:this.#n,keyOf:s=>s.id??s.role+":"+s.content,renderItem:s=>{let n=this.#k(s.role||"user",s.content||"",s.from);return s.id&&(n.id=s.id),n},containerFor:()=>this.#t}),this.#y(),this.#g(),this.dispatchEvent(new CustomEvent("chat-window:messages-changed",{detail:{messages:e,source:"property"},bubbles:!0}))}};g("chat-window",Ue);var Ve=class extends b{static formAssociated=!0;#t;#e=null;#i=null;#s;#r=!1;constructor(){super(),this.#t=this.attachInternals(),this._adoptInternals(this.#t)}setup(){return this.#e=this.querySelector(":scope > textarea, :scope textarea[data-grow]"),this.#i=this.querySelector("[data-send]"),this.#e?(this.#n(),this.listen(this.#e,"keydown",this.#a),this.listen(this.#e,"input",this.#c),this.#i&&this.listen(this.#i,"click",this.#h),this.form&&this.listen(this.form,"submit",this.#l),this.#f(),this.#p(),this.#d(),this.hasAttribute("autofocus")&&requestAnimationFrame(()=>this.#e?.focus()),!0):!1}teardown(){clearTimeout(this.#s)}#n(){let t=this.#e;t&&(t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby")||t.labels&&t.labels.length||t.hasAttribute("title")||t.setAttribute("aria-label","Message"))}#a=t=>{if(!(t.isComposing||t.keyCode===229))switch(t.key){case"Enter":t.shiftKey||(t.preventDefault(),this.#u());break;case"Escape":t.preventDefault(),this.reset();break}};#c=()=>{this.#p(),this.#d(),clearTimeout(this.#s),this.#s=setTimeout(()=>{this.dispatchEvent(new CustomEvent("chat-input:input",{bubbles:!0,detail:{value:this.value,length:this.value.length}}))},100)};#h=t=>{let e=this.#i;this.form&&e?.type==="submit"&&e.form===this.form&&this.#o()||(t.preventDefault(),this.#u())};#l=t=>{setTimeout(()=>{t.defaultPrevented||this.reset()},0)};#o({report:t=!1}={}){if(this.matches(":disabled"))return!1;let e=this.value.trim(),i=parseInt(this.getAttribute("minlength")??"1",10)||1;return e.length<i?!1:this.#t.validity.valid?!0:(t&&this.#t.reportValidity(),!1)}#u(){if(!this.#o({report:!0}))return;let t=this.form;if(t){let e=this.#i,i=e?.type==="submit"&&e.form===t?e:null;t.requestSubmit(i);return}this.dispatchEvent(new CustomEvent("chat-input:send",{bubbles:!0,detail:{message:this.value.trim()}})),this.reset()}#p(){let t=this.value;this.#t.setFormValue(t||null)}#d(){let t=this.value,e=parseInt(this.getAttribute("maxlength")??"4000",10)||4e3;t.length>e&&this.#e?this.#t.setValidity({tooLong:!0},`Message exceeds ${e} characters`,this.#e):this.#t.setValidity({})}#f(){let t=this.hasAttribute("disabled")||this.#r;this.#e&&(this.#e.disabled=t),this.#i&&(this.#i.disabled=t)}formDisabledCallback(t){this.#r=t,this.#f()}formResetCallback(){this.reset()}formStateRestoreCallback(t){!t||!this.#e||(this.#e.value=t,this.#p(),this.#d())}get form(){return this.#t.form}get name(){return this.getAttribute("name")??""}get validity(){return this.#t.validity}get validationMessage(){return this.#t.validationMessage}checkValidity(){return this.#t.checkValidity()}reportValidity(){return this.#t.reportValidity()}get value(){return this.#e?.value??""}set value(t){if(!this.#e)return;let e=t==null?"":String(t);this.#e.value!==e&&(this.#e.value=e,this.#e.dispatchEvent(new Event("input",{bubbles:!0})),this.#p(),this.#d(),this.dispatchEvent(new CustomEvent("chat-input:change",{bubbles:!0,detail:{value:e,source:"api"}})))}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",!!t)}focus(){this.#e?.focus()}reset(){this.#e&&(this.#e.value="",this.#e.dispatchEvent(new Event("input",{bubbles:!0})),this.#p(),this.#d())}static get observedAttributes(){return["disabled"]}attributeChangedCallback(t){t==="disabled"&&this.#f()}};g("chat-input",Ve);var qt="http://www.w3.org/2000/svg";function Mo(r){return r.trim().split(/[\s,]+/).map(Number)}function Ro(r,t){let e=Mo(t);switch(r){case"rect":{let[i,s,n,o]=e;return{type:"rect",x:i,y:s,width:n-i,height:o-s}}case"circle":{let[i,s,n]=e;return{type:"circle",cx:i,cy:s,r:n}}case"poly":{let i=[];for(let s=0;s<e.length;s+=2)i.push([e[s],e[s+1]]);return{type:"poly",points:i}}default:return null}}function _o(r){if(!r)return null;switch(r.type){case"rect":{let t=document.createElementNS(qt,"rect");return t.setAttribute("x",String(r.x)),t.setAttribute("y",String(r.y)),t.setAttribute("width",String(r.width)),t.setAttribute("height",String(r.height)),t}case"circle":{let t=document.createElementNS(qt,"circle");return t.setAttribute("cx",String(r.cx)),t.setAttribute("cy",String(r.cy)),t.setAttribute("r",String(r.r)),t}case"poly":{let t=document.createElementNS(qt,"polygon");return t.setAttribute("points",r.points.map(e=>e.join(",")).join(" ")),t}default:return null}}function No(r){if(!r)return{x:0,y:0,width:0,height:0};switch(r.type){case"rect":return{x:r.x,y:r.y,width:r.width,height:r.height};case"circle":return{x:r.cx-r.r,y:r.cy-r.r,width:r.r*2,height:r.r*2};case"poly":{let t=100,e=100,i=0,s=0;for(let[n,o]of r.points)n<t&&(t=n),o<e&&(e=o),n>i&&(i=n),o>s&&(s=o);return{x:t,y:e,width:i-t,height:s-e}}default:return{x:0,y:0,width:0,height:0}}}var Hs=0,Po=300,Io='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function $o(r){return r==null||r===""?[]:r instanceof HTMLTemplateElement?[r.content.cloneNode(!0)]:r instanceof Node?[r.cloneNode(!0)]:[document.createTextNode(String(r))]}var We=class extends HTMLElement{get shape(){return this.getAttribute("shape")||"rect"}get coords(){return this.getAttribute("coords")||""}get label(){return this.getAttribute("label")||""}get href(){return this.getAttribute("href")}get target(){return this.getAttribute("target")||""}get tooltipMode(){return this.getAttribute("tooltip")||"hover"}get disabled(){return this.hasAttribute("disabled")}connectedCallback(){this.setAttribute("data-upgraded","")}disconnectedCallback(){this.removeAttribute("data-upgraded")}},Ke=class extends b{#t=null;#e=null;#i=null;#s=[];#r=[];#n=null;#a=null;#c=null;#h=0;#l=0;#o=[];setup(){if(this.#t=this.querySelector(":scope > img"),!this.#t){let t=this.getAttribute("src"),e=this.getAttribute("alt");if(t)this.#t=document.createElement("img"),this.#t.src=t,this.#t.alt=e||"",this.prepend(this.#t);else return!1}return this.#t.classList.add("image-map-img"),this.#t.complete?this.#u():this.listen(this.#t,"load",()=>this.#u(),{once:!0}),!0}teardown(){this.#a?.disconnect(),this.#a=null,this.#m(),clearTimeout(this.#h),cancelAnimationFrame(this.#l),this.#e?.remove(),this.#i?.remove();for(let t of this.#r)t.anchor?.remove();for(let t of this.#o)t.removeAttribute("id");this.#e=null,this.#i=null,this.#r=[],this.#s=[],this.#o=[],this.#c=null}get regions(){return[...this.querySelectorAll(":scope > map-area")].map(t=>{let e;if(t.children.length){let i=document.createDocumentFragment();i.append(...[...t.childNodes].map(s=>s.cloneNode(!0))),e=i}else e=t.textContent?.trim()||void 0;return{shape:t.getAttribute("shape")||void 0,coords:t.getAttribute("coords")||void 0,label:t.getAttribute("label")||t.textContent?.trim().replace(/\s+/g," ")||void 0,href:t.getAttribute("href")||void 0,target:t.getAttribute("target")||void 0,tooltip:t.getAttribute("tooltip")||void 0,disabled:t.hasAttribute("disabled")||void 0,content:e}})}set regions(t){let e=Array.isArray(t)?t:[];for(let i of[...this.querySelectorAll(":scope > map-area")])i.remove();for(let i of e){if(!i)continue;let s=document.createElement("map-area");i.shape&&s.setAttribute("shape",i.shape),i.coords&&s.setAttribute("coords",i.coords),i.label&&s.setAttribute("label",i.label),i.href&&s.setAttribute("href",i.href),i.target&&s.setAttribute("target",i.target),i.tooltip&&s.setAttribute("tooltip",i.tooltip),i.disabled&&s.setAttribute("disabled",""),s.append(...$o(i.content)),this.appendChild(s)}this._reinit(),this.dispatchEvent(new CustomEvent("image-map:regions-changed",{detail:{regions:this.regions,source:"property"},bubbles:!0}))}#u(){if(!this.isConnected||this.#e)return;let t=[...this.querySelectorAll(":scope > map-area")];if(t.length===0)return;let e=document.createElementNS(qt,"svg");e.setAttribute("viewBox","0 0 100 100"),e.setAttribute("preserveAspectRatio","none"),e.setAttribute("aria-hidden","true"),e.classList.add("image-map-overlay"),this.#e=e;let i=document.createElement("div");i.className="image-map-tooltip",i.id=`imap-tip-${++Hs}`,i.hidden=!0,this.#i=i;for(let s of t){let n=s,o=Ro(n.shape,n.coords),a=_o(o);if(!a)continue;let l=No(o),c=s.getAttribute("href"),h=s.getAttribute("target")||"",u=s.getAttribute("tooltip")||"hover",p=s.hasAttribute("disabled"),d=s.textContent?.trim().replace(/\s+/g," ")||"",f=s.getAttribute("label")||d,m=c?document.createElement("a"):document.createElement("button");c?(m.href=c,h&&(m.target=h)):m.type="button",m.className="image-map-anchor",m.textContent=f;let y=u!=="none"&&(s.children.length>0||d&&d!==f);y&&(s.id||(s.id=`imap-area-${++Hs}`,this.#o.push(s)),u==="click"?(m.setAttribute("aria-expanded","false"),m.setAttribute("aria-controls",i.id)):m.setAttribute("aria-describedby",s.id)),m.style.left=`${l.x}%`,m.style.top=`${l.y}%`,m.style.width=`${l.width}%`,m.style.height=`${l.height}%`,p&&(a.setAttribute("data-disabled",""),m.setAttribute("tabindex","-1"),m.setAttribute("aria-disabled","true"));let w={area:s,parsed:o,svgShape:a,anchor:m,href:c,target:h,mode:u,hasContent:y,keyboardOpen:!1};p||this.#p(w),e.appendChild(a),this.#r.push(w),this.#s.push(m)}this.appendChild(e);for(let s of this.#s)this.appendChild(s);this.appendChild(i),this.listen(i,"pointerenter",()=>clearTimeout(this.#h)),this.listen(i,"pointerleave",()=>{this.#n?.mode==="hover"&&!this.#f()&&this.#k()}),this.listen(i,"focusout",s=>{let n=s.relatedTarget;n&&(i.contains(n)||n===this.#n?.anchor)||this.#m()}),this.listen(this,"keydown",this.#g),this.listen(document,"keydown",this.#b),this.listen(document,"pointerdown",this.#T),this.listen(window,"scroll",this.#v,{passive:!0,capture:!0}),this.#a=new ResizeObserver(this.#v),this.#a.observe(this.#t),this.setAttribute("role","group"),!this.hasAttribute("aria-label")&&!this.hasAttribute("aria-labelledby")&&this.setAttribute("aria-label",this.#t.alt||this.dataset.labelMap||"Image map")}#p(t){let{svgShape:e,anchor:i,area:s,mode:n}=t;this.listen(e,"pointerenter",()=>{clearTimeout(this.#h),n==="hover"&&this.#w(t),e.setAttribute("data-hover",""),this.#A("image-map:area-enter",s)}),this.listen(e,"pointerleave",()=>{n==="hover"&&this.#n===t&&!this.#f()&&this.#k(),document.activeElement!==i&&e.removeAttribute("data-hover"),this.#A("image-map:area-leave",s)}),this.listen(e,"click",()=>{let o=this.#d(t,!1);t.href&&n!=="click"&&!o.defaultPrevented&&(t.target==="_blank"?window.open(t.href,"_blank","noopener"):window.location.href=t.href)}),this.listen(e,"touchstart",o=>{n==="hover"&&(this.#c!==t?(o.preventDefault(),this.#c=t,this.#w(t)):this.#c=null)},{passive:!1}),this.listen(i,"click",o=>{let a=o.detail===0,l=this.#d(t,a);(n==="click"||l.defaultPrevented)&&o.preventDefault()}),t.href&&this.listen(i,"keydown",o=>{o.key===" "&&(o.preventDefault(),i.click())}),this.listen(i,"focus",()=>{clearTimeout(this.#h),n==="hover"&&this.#w(t),e.setAttribute("data-hover",""),this.#A("image-map:area-enter",s)}),this.listen(i,"blur",o=>{e.removeAttribute("data-hover"),this.#A("image-map:area-leave",s);let a=o.relatedTarget;this.#n===t&&!(a&&this.#i?.contains(a))&&this.#m()})}#d(t,e){if(t.mode==="click"&&t.hasContent){if(this.#n===t)this.#m();else if(this.#w(t),e){t.keyboardOpen=!0;let i=this.#i?.querySelector(Io);i&&i.focus()}}return this.#A("image-map:area-activate",t.area,!0)}#f(){let t=document.activeElement;return!!(t&&this.#i?.contains(t))}#k(){clearTimeout(this.#h),this.#h=setTimeout(()=>this.#m(),Po)}#w(t){let e=this.#i;!e||t.mode==="none"||!t.hasContent||(clearTimeout(this.#h),this.#n&&this.#n!==t&&this.#m(),this.#n=t,e.replaceChildren(...[...t.area.childNodes].map(i=>i.cloneNode(!0))),t.mode==="click"?(e.removeAttribute("role"),e.setAttribute("role","group"),e.setAttribute("aria-label",t.anchor.textContent||""),t.anchor.setAttribute("aria-expanded","true")):(e.setAttribute("role","tooltip"),e.removeAttribute("aria-label")),t.anchor.nextSibling!==e&&t.anchor.after(e),e.hidden=!1,e.setAttribute("data-state-visible",""),this.#y(t.svgShape))}#m({restoreFocus:t=!1}={}){clearTimeout(this.#h);let e=this.#n,i=this.#i;if(!i||!e)return;let s=this.#f();this.#n=null,e.keyboardOpen=!1,e.mode==="click"&&e.anchor.hasAttribute("aria-expanded")&&e.anchor.setAttribute("aria-expanded","false"),i.removeAttribute("data-state-visible"),i.hidden=!0,i.replaceChildren(),(t||s)&&e.anchor.focus()}#v=()=>{!this.#n||this.#l||(this.#l=requestAnimationFrame(()=>{this.#l=0,this.#n&&this.#y(this.#n.svgShape)}))};#y(t){if(!this.#i||!t)return;let e=t.getBoundingClientRect(),i=this.#i.getBoundingClientRect(),s=8,n=8,o=window.innerWidth,a=window.innerHeight,l,c,h=e.top-i.height-s;h>=n?(l=h,c=e.left+(e.width-i.width)/2):e.bottom+s+i.height<=a-n?(l=e.bottom+s,c=e.left+(e.width-i.width)/2):e.right+s+i.width<=o-n?(l=e.top+(e.height-i.height)/2,c=e.right+s):(l=e.top+(e.height-i.height)/2,c=e.left-i.width-s),c=Math.max(n,Math.min(c,o-i.width-n)),l=Math.max(n,Math.min(l,a-i.height-n)),this.#i.style.top=`${l}px`,this.#i.style.left=`${c}px`}#g=t=>{if(this.#i?.contains(t.target))return;let e=this.#s.filter(s=>!s.hasAttribute("aria-disabled")),i=e.indexOf(document.activeElement);if(i!==-1)switch(t.key){case"ArrowDown":case"ArrowRight":{t.preventDefault(),e[i<e.length-1?i+1:0]?.focus();break}case"ArrowUp":case"ArrowLeft":{t.preventDefault(),e[i>0?i-1:e.length-1]?.focus();break}}};#b=t=>{t.key==="Escape"&&(this.#c=null,this.#n&&(t.preventDefault(),this.#m()))};#T=t=>{if(!this.#n)return;let e=t.target;this.#i?.contains(e)||this.contains(e)&&e!==this&&e!==this.#t||(this.#c=null,this.#m())};#A(t,e,i=!1){let s=new CustomEvent(t,{detail:{area:e},bubbles:!0,cancelable:i});return this.dispatchEvent(s),s}};g("map-area",We);g("image-map",Ke);var zo='<svg viewBox="0 0 68 48" width="68" height="48" aria-hidden="true" focusable="false"><path d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.64 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z" fill="var(--color-error, #f00)"/><path d="M45 24 27 14v20z" fill="#fff"/></svg>',Bo={hq:"hqdefault",mq:"mqdefault",sd:"sddefault",maxres:"maxresdefault"},Us="YouTube video",jo="Play {title}",Oo=/^\d+$/;function Vs(r){return String(r).replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t])}function Do(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches||document.documentElement.hasAttribute("data-motion-reduced")}var Ge=class extends b{#t="";#e=Us;setup(){let t=this.getAttribute("video-id");return this.#e=this.getAttribute("title")||Us,t?/^[A-Za-z0-9_-]{6,20}$/.test(t)?(this.#t=t,this.hasAttribute("autoplay")&&!Do()?this.#c(!1):this.#a(),!0):(console.warn(`youtube-player: invalid video-id ${JSON.stringify(t)}`),!1):(console.warn("youtube-player: missing required video-id attribute"),!1)}#i(t){let e=this.getAttribute(t);return e===null||e===""?null:Oo.test(e.trim())?e.trim():(console.warn(`youtube-player: ${t} must be whole seconds, got ${JSON.stringify(e)}`),null)}#s(){let t=new URLSearchParams({autoplay:"1"}),e=this.#i("start");e&&t.set("start",e);let i=this.#i("end");i&&t.set("end",i);let s=this.getAttribute("list");s&&t.set("list",s);let n=this.getAttribute("params");return n&&new URLSearchParams(n).forEach((o,a)=>t.set(a,o)),`https://www.youtube-nocookie.com/embed/${this.#t}?${t}`}#r(t){return`https://i.ytimg.com/vi/${this.#t}/${Bo[t]??"hqdefault"}.jpg`}#n(){return(this.getAttribute("data-label-play")||jo).replace(/\{title\}/g,this.#e)}#a(){this.setAttribute("state","ready");let t=document.createElement("img");t.alt="",t.loading="lazy",t.decoding="async";let e=this.getAttribute("poster");if(e)t.src=e;else{let s=this.getAttribute("thumbnail")??"hq";if(t.referrerPolicy="no-referrer",t.src=this.#r(s),s==="sd"||s==="maxres"){let n=()=>{t.src=this.#r("hq")};t.addEventListener("error",n,{once:!0}),t.addEventListener("load",()=>{t.naturalWidth<=120&&n()},{once:!0})}}let i=document.createElement("button");i.type="button",i.setAttribute("aria-label",this.#n()),i.innerHTML=zo,i.addEventListener("click",()=>this.#c(!0),{once:!0}),this.replaceChildren(t,i)}#c(t){this.setAttribute("state","active"),this.innerHTML=`<iframe src="${Vs(this.#s())}" title="${Vs(this.#e)}" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen loading="lazy"></iframe>`,t&&this.querySelector("iframe")?.focus(),this.dispatchEvent(new CustomEvent("youtube-player:activate",{bubbles:!0,detail:{videoId:this.#t,fromUser:t}}))}};g("youtube-player",Ge);var xt=CSS.supports("anchor-name","--x")&&CSS.supports("position-area","bottom"),Ws=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,Fo="--tour-target",Ye='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',qo='input, textarea, select, [contenteditable]:not([contenteditable="false"])',Ho={title:"Page Tour",step:"Step {n} of {total}",skip:"Skip tour",close:"Close",prev:"Previous",next:"Next",finish:"Finish",nav:"Tour navigation",ready:"Done. Next is available."},Uo=0,Xe=class extends HTMLElement{get target(){return this.dataset.target??""}get placement(){return this.dataset.placement??"auto"}get action(){return this.dataset.action??"none"}get actionHint(){return this.dataset.actionHint??null}get skippable(){return this.dataset.skippable!=="false"}get scrollBehavior(){return this.dataset.scroll??"smooth"}};function Ks(r){if(!r?.target)return null;try{return document.querySelector(r.target)}catch{return null}}function L(r,t,e){let i=document.createElement(r);return t&&(i.className=t),e!=null&&(i.textContent=e),i}var Je=class r extends b{#t=[];#e=0;#i=!1;#s=null;#r=null;#n=null;#a=null;#c=null;#h=null;#l="";#o=null;#u=null;#p=null;#d=null;#f=null;#k=null;#w=null;static#m=null;static observedAttributes=["data-step"];setup(){if(this.#t=[...this.querySelectorAll("tour-step")],this.#t.length===0)return!1;let t=this.querySelector(".page-tour-start-btn");if(t&&this.listen(t,"click",e=>{e.preventDefault(),this.start()}),this.id&&this.listen(document,"click",e=>{e.target?.closest?.(`[data-tour="${CSS.escape(this.id)}"]`)&&(e.preventDefault(),this.start())}),this.dataset.trigger==="auto"){let e=this.#J();e?.complete||e?.skipped?this.setAttribute("data-complete",""):this.#w=setTimeout(()=>{this.#w=null,this.isConnected&&this.start(e?.step??0)},400)}return!0}teardown(){this.#w&&(clearTimeout(this.#w),this.#w=null),this.#i&&this.stop()}attributeChangedCallback(t,e,i){if(t==="data-step"&&this.#i&&e!==null){let s=parseInt(i,10);!Number.isNaN(s)&&s!==this.#e&&this.goto(s)}}start(t=0){let e=Math.min(Math.max(0,Number(t)||0),this.#t.length-1);if(this.#i){this.goto(e);return}let i=this.#b(e,1,!0);if(i===-1&&(i=this.#b(e-1,-1,!0)),i===-1){console.warn("[page-tour] No step target found on the page; tour not started");return}r.#m&&r.#m!==this&&r.#m.stop(),this.#c=document.activeElement,this.#i=!0,r.#m=this,this.#T(),this.setAttribute("data-active",""),this.removeAttribute("data-complete"),this.#U("tour:start",{step:i}),this.#N(i,"next")}stop(){this.#i&&(this.#j(),this.#i=!1,this.removeAttribute("data-active"),r.#m===this&&(r.#m=null))}next(){if(!this.#i||this.#g())return;let t=this.#b(this.#e+1,1,!0);t===-1?this.#_():this.#N(t,"next")}prev(){if(!this.#i)return;let t=this.#b(this.#e-1,-1,!0);t!==-1&&this.#N(t,"prev")}goto(t){if(!this.#i)return;let e=Number(t);if(!Number.isInteger(e)||e<0||e>=this.#t.length)return;let i=e>=this.#e?"next":"prev",s=i==="next"?1:-1,n=this.#b(e,s,!0);n===-1&&(n=this.#b(e-s,s===1?-1:1,!0)),!(n===-1||n===this.#e)&&this.#N(n,i)}skip(){this.#i&&this.#y(this.#t[this.#e])&&(this.#U("tour:skip",{step:this.#e}),this.#q({skipped:!0}),this.stop(),this.setAttribute("data-complete",""))}reset(){this.#Z(),this.removeAttribute("data-complete"),this.dataset.step="0"}#v(t){return(t==="title"?this.dataset.title:this.getAttribute(`data-label-${t}`))??Ho[t]}#y(t){return(this.dataset.mode??"passive")!=="forced"&&(t?.skippable??!0)}#g(){return!!this.#n?.querySelector(".page-tour-next[data-waiting]")}#b(t,e,i=!1){for(let s=t;s>=0&&s<this.#t.length;s+=e){if(Ks(this.#t[s]))return s;i&&console.warn(`[page-tour] Target "${this.#t[s].target}" not found, skipping step ${s}`)}return-1}#T(){this.#s=L("div","page-tour-backdrop"),this.#s.setAttribute("aria-hidden","true"),this.#s.addEventListener("click",()=>this.skip()),this.#r=L("div","page-tour-spotlight"),this.#r.setAttribute("aria-hidden","true"),this.#n=L("div","page-tour-card"),this.#n.setAttribute("popover","manual"),this.#n.setAttribute("role","dialog"),this.#n.setAttribute("aria-label",this.#v("title")),this.#n.setAttribute("tabindex","-1"),this.#n.toggleAttribute("data-anchored",xt),this.#n.addEventListener("click",e=>this.#D(e));let t=parseFloat(this.dataset.spotlightPadding??"");if(Number.isFinite(t)&&t>=0)for(let e of[this.#r,this.#n])e.style.setProperty("--tour-spotlight-padding",`${t}px`);this.#a=L("div","visually-hidden"),this.#a.setAttribute("aria-live","polite"),this.#a.setAttribute("aria-atomic","true"),this.#a.id=`page-tour-announcer-${++Uo}`,this.append(this.#s,this.#r,this.#n,this.#a),this.#n.showPopover(),this.#u=new AbortController,document.addEventListener("keydown",e=>this.#R(e),{signal:this.#u.signal}),requestAnimationFrame(()=>{this.#s?.setAttribute("data-state-visible","")})}#A(t){this.#h=t;let e=getComputedStyle(t).position==="static";t.setAttribute("data-tour-target",e?"raised":""),xt&&(this.#l=t.style.getPropertyValue("anchor-name"),t.style.setProperty("anchor-name",Fo))}#x(){let t=this.#h;t&&(t.removeAttribute("data-tour-target"),xt&&(this.#l?t.style.setProperty("anchor-name",this.#l):t.style.removeProperty("anchor-name"),t.getAttribute("style")||t.removeAttribute("style")),this.#l="",this.#h=null)}#S(t){if(!this.#r)return;let e=t.getBoundingClientRect();Object.assign(this.#r.style,{top:`${e.top}px`,left:`${e.left}px`,width:`${e.width}px`,height:`${e.height}px`})}#E(t,e){let i=getComputedStyle(this).direction==="rtl";switch(e){case"top":case"bottom":return e;case"inline-start":return i?"right":"left";case"inline-end":return i?"left":"right";default:return this.#$(t)}}#L(t,e){if(!this.#n)return;let i=this.#E(t,e);this.#n.dataset.side=i,xt||this.#C(t,i)}#C(t,e){let i=this.#n;if(!i)return;let s=t.getBoundingClientRect(),n=12,o=8,a=this.#r&&parseFloat(getComputedStyle(this.#r).paddingTop)||0;i.style.visibility="hidden",i.style.top="0",i.style.left="0";let l=i.getBoundingClientRect();i.style.visibility="";let c=0,h=0;switch(e){case"bottom":c=s.bottom+a+n,h=s.left+(s.width-l.width)/2;break;case"top":c=s.top-a-n-l.height,h=s.left+(s.width-l.width)/2;break;case"right":c=s.top+(s.height-l.height)/2,h=s.right+a+n;break;case"left":c=s.top+(s.height-l.height)/2,h=s.left-a-n-l.width;break}h=Math.max(o,Math.min(h,window.innerWidth-l.width-o)),c=Math.max(o,Math.min(c,window.innerHeight-l.height-o)),i.style.top=`${c}px`,i.style.left=`${h}px`}#$(t){let e=t.getBoundingClientRect(),i=window.innerHeight-e.bottom,s=e.top,n=window.innerWidth-e.right,o=e.left,a=Math.max(i,s,n,o);return a===i?"bottom":a===s?"top":a===n?"right":"left"}#P(t,e){let i=this.#n;if(!i)return;let s=this.#t.length,n=this.#b(e+1,1)!==-1,o=this.#b(e-1,-1)!==-1,a=t.action!=="none",l=L("div","page-tour-progress");l.setAttribute("aria-hidden","true"),this.#t.forEach((m,y)=>{let w=L("span","page-tour-pip");y===e&&w.setAttribute("data-active",""),y<e&&w.setAttribute("data-visited",""),l.append(w)});let c=L("p","page-tour-meta");c.append(L("span","page-tour-step-count",this.#v("step").replace("{n}",String(e+1)).replace("{total}",String(s))));let h=L("div","page-tour-content");for(let m of t.childNodes)h.append(m.cloneNode(!0));let u=L("footer","page-tour-footer");if(this.#y(t)){let m=L("button","page-tour-skip",this.#v(n?"skip":"close"));m.type="button",m.dataset.action="skip",u.append(m)}let p=L("nav","page-tour-nav");if(p.setAttribute("aria-label",this.#v("nav")),o){let m=L("button","page-tour-prev",this.#v("prev"));m.type="button",m.dataset.action="prev",p.append(m)}let d=L("button","page-tour-next",this.#v(n?"next":"finish"));d.type="button",d.dataset.action="next",p.append(d),u.append(p);let f=[l,c,h];if(a&&(d.setAttribute("data-waiting",""),d.setAttribute("aria-disabled","true"),t.actionHint)){let m=L("p","page-tour-action-hint",t.actionHint);m.id=`${this.#a?.id??"page-tour"}-hint`,d.setAttribute("aria-describedby",m.id),f.push(m)}f.push(u),i.replaceChildren(...f),a?i.removeAttribute("aria-modal"):i.setAttribute("aria-modal","true")}#N(t,e="next"){let i=this.#t[t],s=Ks(i);if(!i||!s)return;if(this.#d?.abort(),this.#d=null,this.#B(),this.#x(),this.#e=t,this.#A(s),i.scrollBehavior!=="none"){let l=Ws()?"instant":i.scrollBehavior;s.scrollIntoView({block:"nearest",behavior:l})}this.#P(i,t),this.#S(s),this.#L(s,i.placement);let n=this.#n;n?.focus(),requestAnimationFrame(()=>{if(this.#n!==n||this.#e!==t)return;let l=n?.querySelector(".page-tour-content :is(h2, h3, h4)")??null;l?(l.hasAttribute("tabindex")||l.setAttribute("tabindex","-1"),l.focus()):(n?.querySelector(".page-tour-next")??null)?.focus()});let o=i.querySelector("h2, h3, h4"),a=this.#v("step").replace("{n}",String(t+1)).replace("{total}",String(this.#t.length));this.#K(o?.textContent?`${a}: ${o.textContent.trim()}`:a),this.dataset.step=String(t),i.action!=="none"&&this.#I(i,s),this.#F(s),this.#q({step:t}),this.#U("tour:step",{step:t,target:s,direction:e})}#I(t,e){let i=new AbortController;this.#d=i;let n={click:"click",focus:"focus",input:"input",change:"change"}[t.action];n?e.addEventListener(n,()=>{i.abort(),this.#M(),this.#U("tour:action",{step:this.#e,action:t.action})},{signal:i.signal}):t.action==="custom"&&this.addEventListener("tour:action",()=>{i.abort(),this.#M()},{signal:i.signal})}#M(){let t=this.#n?.querySelector(".page-tour-next");t&&(t.removeAttribute("data-waiting"),t.removeAttribute("aria-disabled"),t.removeAttribute("aria-describedby"),this.#n?.querySelector(".page-tour-action-hint")?.remove(),this.#K(this.#v("ready")))}#R(t){if(!this.#i||t.defaultPrevented)return;let i=!!(t.target instanceof Element?t.target:null)?.closest(qo),s=t.altKey||t.ctrlKey||t.metaKey;switch(t.key){case"Escape":this.#y(this.#t[this.#e])&&(t.preventDefault(),this.skip());break;case"ArrowRight":case"ArrowDown":if(i||s)return;t.preventDefault(),this.next();break;case"ArrowLeft":case"ArrowUp":if(i||s)return;t.preventDefault(),this.prev();break;case"Home":if(i||s)return;t.preventDefault(),this.goto(0);break;case"End":if(i||s)return;t.preventDefault(),this.goto(this.#t.length-1);break;case"Tab":this.#z(t);break}}#z(t){if(!this.#n)return;let e=d=>!d.disabled&&(d.checkVisibility?.()??!0),i=[...this.#n.querySelectorAll(Ye)].filter(e),s=[],n=this.#t[this.#e],o=this.#h;n&&n.action!=="none"&&o&&(s=(o.matches(Ye)?[o]:[...o.querySelectorAll(Ye)]).filter(e));let a=[...i,...s];if(a.length===0)return;let l=a[0],c=a[a.length-1],h=document.activeElement,u=!h||!a.includes(h),p=u?-1:a.indexOf(h);t.preventDefault(),t.shiftKey?(u||h===l?c:a[p-1]).focus():(u||h===c?l:a[p+1]).focus()}#D(t){let e=t.target.closest?.("[data-action]")??null;if(e)switch(e.dataset.action){case"next":this.next();break;case"prev":this.prev();break;case"skip":this.skip();break}}#F(t){let e=new AbortController;this.#p=e;let i=()=>this.#O();document.addEventListener("scroll",i,{capture:!0,passive:!0,signal:e.signal}),window.addEventListener("resize",i,{passive:!0,signal:e.signal}),this.#o=new ResizeObserver(i),this.#o.observe(t),this.#k=setTimeout(i,Ws()?0:300)}#B(){this.#p?.abort(),this.#p=null,this.#o?.disconnect(),this.#o=null,this.#k&&(clearTimeout(this.#k),this.#k=null),this.#f&&(cancelAnimationFrame(this.#f),this.#f=null)}#O(){this.#f||(this.#f=requestAnimationFrame(()=>{this.#f=null;let t=this.#h;!this.#i||!t||(this.#S(t),xt||this.#L(t,this.#t[this.#e].placement))}))}#_(){this.#U("tour:complete",{steps:this.#t.length}),this.#q({complete:!0}),this.stop(),this.setAttribute("data-complete","")}#j(){this.#u?.abort(),this.#u=null,this.#d?.abort(),this.#d=null,this.#B(),this.#x();let t=document.activeElement,e=!t||t===document.body||!!this.#n?.contains(t);this.#s?.remove(),this.#r?.remove(),this.#n?.matches(":popover-open")&&this.#n.hidePopover(),this.#n?.remove(),this.#a?.remove(),this.#s=null,this.#r=null,this.#n=null,this.#a=null;let i=this.#c;this.#c=null,e&&i?.isConnected&&typeof i.focus=="function"&&i.focus()}#K(t){let e=this.#a;e&&(e.textContent="",requestAnimationFrame(()=>{this.#a===e&&(e.textContent=t)}))}#U(t,e){let i=t!=="tour:skip";this.dispatchEvent(new CustomEvent(t,{bubbles:!0,cancelable:i,detail:e}))}#W(){let t=this.dataset.persist??"session";return t==="session"?sessionStorage:t==="local"?localStorage:null}#H(){return`vb-tour-${this.dataset.persistKey??window.location.pathname}`}#q(t){let e=this.#W();if(!e)return;let i=this.#H(),s={};try{s=JSON.parse(e.getItem(i)??"null")??{}}catch{}e.setItem(i,JSON.stringify({...s,...t}))}#J(){let t=this.#W();if(!t)return null;try{return JSON.parse(t.getItem(this.#H())??"null")}catch{return null}}#Z(){let t=this.#W();t&&t.removeItem(this.#H())}};g("page-tour",Je);g("tour-step",Xe);function ei(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Z=ei();function tr(r){Z=r}var X={exec:()=>null};function x(r,t=""){let e=typeof r=="string"?r:r.source,i={replace:(s,n)=>{let o=typeof n=="string"?n:n.source;return o=o.replace(M.caret,"$1"),e=e.replace(s,o),i},getRegex:()=>new RegExp(e,t)};return i}var Vo=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),M={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}>`)},Wo=/^(?:[ \t]*(?:\n|$))+/,Ko=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Go=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Tt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Yo=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ii=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,er=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ir=x(er).replace(/bull/g,ii).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Xo=x(er).replace(/bull/g,ii).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),si=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Jo=/^[^\n]+/,ri=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Zo=x(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ri).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Qo=x(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ii).getRegex(),Kt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ni=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ta=x("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ni).replace("tag",Kt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),sr=x(si).replace("hr",Tt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Kt).getRegex(),ea=x(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",sr).getRegex(),oi={blockquote:ea,code:Ko,def:Zo,fences:Go,heading:Yo,hr:Tt,html:ta,lheading:ir,list:Qo,newline:Wo,paragraph:sr,table:X,text:Jo},Gs=x("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Tt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Kt).getRegex(),ia={...oi,lheading:Xo,table:Gs,paragraph:x(si).replace("hr",Tt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Gs).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Kt).getRegex()},sa={...oi,html:x(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ni).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:X,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:x(si).replace("hr",Tt).replace("heading",` *#{1,6} *[^
1254
+ `),this.#a=t,document.adoptedStyleSheets=[...document.adoptedStyleSheets,t]}#J(){let t=this.#a;t&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(e=>e!==t),this.#a=null),this.#et()}#Z(t,e){if(!CSS.highlights||this.getAttribute("highlight")==="false")return;let i=this.#Q(t);if(!i)return;let s=t-i.speechStart,n=this.#rt(i,s,e);if(!n)return;let o=new Highlight(n);if(CSS.highlights.set("text-reader-word",o),this.#c=o,this.getAttribute("scroll")!=="false"){let a=n.getBoundingClientRect(),l=window.innerHeight;if(a.top<0||a.bottom>l){let c=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;i.element.scrollIntoView({behavior:c?"auto":"smooth",block:"nearest"})}}}#et(){CSS.highlights&&CSS.highlights.delete("text-reader-word"),this.#c=null}#Q(t){let e=this.#i,i=0,s=e.length-1;for(;i<=s;){let n=i+s>>>1,o=e[n];if(t<o.speechStart)s=n-1;else if(t>=o.speechEnd)i=n+1;else return o}return null}#rt(t,e,i){let s=t.segments,n=e+i,o=s.find(c=>e>=c.start&&e<c.end);if(!o||!o.node.isConnected)return null;let a=s.find(c=>n>c.start&&n<=c.end)||o,l=document.createRange();return l.setStart(o.node,e-o.start),a.node.isConnected&&a.start>=o.start?l.setEnd(a.node,Math.min(n-a.start,a.node.length)):l.setEnd(o.node,o.node.length),l}async#it(){let t=speechSynthesis.getVoices();return t.length>0?t:new Promise(e=>{let i=()=>{speechSynthesis.removeEventListener("voiceschanged",i),e(speechSynthesis.getVoices())};speechSynthesis.addEventListener("voiceschanged",i),setTimeout(()=>{speechSynthesis.removeEventListener("voiceschanged",i),e(speechSynthesis.getVoices())},3e3)})}#st(t){if(!this.#k||!t.length)return;let e=this.#k;e.innerHTML="";let i=At(this.#j()||"en"),s=c=>At(c.lang)===i,n=t.filter(s),o=t.filter(c=>!s(c)),a=[...n,...o],l=this.getAttribute("voice");for(let c of a){let h=document.createElement("option");h.textContent=`${c.name} (${c.lang})`,h.dataset.voiceUri=c.voiceURI,l&&c.voiceURI===l&&(h.selected=!0),e.append(h)}if(!l){let c=n.find(h=>h.default)||n[0];if(c){let h=[...e.options].find(u=>u.dataset.voiceUri===c.voiceURI);h&&(h.selected=!0)}}}#tt(t,e){let i=document.activeElement;t();for(let[s,n]of e)if(s&&n&&i===s&&!n.hidden&&!n.disabled){n.focus();return}}#nt(t){if(!this.#p||!this.#d||!this.#f)return;let e=this.#p,i=this.#d,s=this.#f;this.#tt(()=>{e.hidden=t,i.hidden=!t,s.disabled=!t},t?[[e,i]]:[[i,e],[s,e]]),this.#w&&(this.#g&&this.#g.setAttribute("aria-pressed",String(t)),t?this.#N():this.#I())}#G(t){if(!this.#p||!this.#d)return;let e=this.#p,i=this.#d;this.#tt(()=>{e.hidden=!t,i.hidden=t},t?[[i,e]]:[[e,i]])}#X(){this.#l=!1,this.#o=!1,this.#r=0,this.#e=null,this.#H(),this.#et(),this.#nt(!1)}#Y(t){return Math.round(Math.max(.5,Math.min(2,t))*10)/10}#V(t,e={}){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0}))}#at=()=>{this.#l&&speechSynthesis.cancel()}};g("text-reader",Fe);var ro="http://www.w3.org/1999/xhtml",qe="http://www.w3.org/2000/svg",no="http://www.w3.org/1998/Math/MathML",oo=new Set([ro,qe,no]),He="user-content-",ao=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"]),js=new Set(["title","desc"]),lo=new Set(["animate","set","animatemotion","animatetransform"]),co=new Set(["href","xlink:href","action","formaction","data","codebase","cite","background","longdesc","manifest","to","from","values","by"]),ho=new Set(["src","poster","srcset"]),uo=new Set(["srcdoc","form","formaction","formmethod","formtarget","formenctype","formnovalidate","action","method","ping"]),po=new Set(["popovertarget","popovertargetaction","commandfor","command","interestfor","autofocus"]),fo=new Set(["for","headers","list","aria-labelledby","aria-describedby","aria-controls","aria-owns","aria-flowto","aria-details","aria-errormessage","aria-activedescendant"]),mo={"include-file":["trusted","allow-scripts","allow-cross-origin"],"markdown-viewer":["src","sanitize","ping","allow-cross-origin"]},go=new Set(["social-embed","youtube-player","geo-map"]),bo=["src","src-dark","data-src","url","endpoint","tile-url","data-versions"],vo=new Set(["audio-player","video-player","image-map","brand-mark"]);function yo(r){return String(r).replace(/[\u0000- \u007f-\u009f]/g,"").toLowerCase()}function Bs(r,t=!1){let e=yo(r);return t?/(^|,)(javascript|vbscript|livescript):/.test(e)?!0:/(^|,)data:/.test(e)?e.split(/(?=data:)/).filter(s=>s.startsWith("data:")).some(s=>!/^data:(image|audio|video|font)\//.test(s)):!1:/^(javascript|vbscript|livescript|data):/.test(e)}function Os(r){let t=String(r).replace(/\/\*[\s\S]*?\*\//g,"").replace(/\\/g,"").replace(/\s+/g,"").toLowerCase();return/expression\(|javascript:|vbscript:|-moz-binding|behavior:|@import|position:fixed/.test(t)}var wo=r=>String(r.localName||r.tagName||"").toLowerCase(),ko=r=>r.startsWith(He)?r:He+r;function Ao(r,t){if(ao.has(t))return!0;let e=r.namespaceURI;return!!(e&&!oo.has(e)||t==="title"&&e!==qe||js.has(t)&&e===qe&&r.children?.length||lo.has(t)&&(r.getAttribute("attributeName")||r.getAttribute("attributename")||"").toLowerCase().includes("href"))}function xo(r,t){for(let e of[...r.attributes]){let i=e.name.toLowerCase();if(i.startsWith("on")||uo.has(i)||!t.keepIds&&po.has(i)){r.removeAttribute(e.name);continue}if(i==="style"){(!t.keepStyle||Os(e.value))&&r.removeAttribute(e.name);continue}if((i==="id"||i==="name")&&!t.keepIds){let s=ko(e.value);i==="id"?t.ids.set(e.value,s):t.ids.set(`name:${e.value}`,s),r.setAttribute(e.name,s);continue}if(co.has(i)||i.endsWith(":href")){Bs(e.value,!1)&&r.removeAttribute(e.name);continue}ho.has(i)&&Bs(e.value,!0)&&r.removeAttribute(e.name)}}function Eo(r,t){let e=(r.getAttribute("type")||"").toLowerCase();t==="button"&&e!=="button"&&r.setAttribute("type","button"),t==="input"&&/^(submit|reset|image)$/.test(e)&&r.setAttribute("type","button")}function So(r,t){for(let e of r)for(let i of[...e.attributes]){let s=i.name.toLowerCase(),n=i.value;if((s==="href"||s.endsWith(":href"))&&n.startsWith("#")){let o=Co(n.slice(1));t.has(o)&&e.setAttribute(i.name,`#${t.get(o)}`)}else if(s==="usemap"&&n.startsWith("#")){let o=t.get(`name:${n.slice(1)}`);o?e.setAttribute(i.name,`#${o}`):e.removeAttribute(i.name)}else if(fo.has(s)){let o=n.split(/\s+/).filter(Boolean).map(a=>t.get(a)||(a.startsWith(He)?a:null)).filter(Boolean);o.length?e.setAttribute(i.name,o.join(" ")):e.removeAttribute(i.name)}else n.includes("url(#")&&e.setAttribute(i.name,n.replace(/url\(#([^)]+)\)/g,(o,a)=>t.has(a)?`url(#${t.get(a)})`:o))}}function Co(r){try{return decodeURIComponent(r)}catch{return r}}function Ds(r){let t=r.childNodes;if(t)for(let e of[...t])e.nodeType===8?e.remove():(e.nodeType===1||e.nodeType===11)&&Ds(e)}function Fs(r,t){Ds(r);let e=[...r.querySelectorAll("*")];t.includeRoot&&e.unshift(r);let i=new Map,s=[],n={...t,ids:i};for(let o of e){if(!Lo(o,r))continue;let a=wo(o);if(t.svgOnly&&(js.has(a)||a==="style")){if(a==="style"&&Os(o.textContent||"")){o.remove();continue}}else if(Ao(o,a)){o.remove();continue}if(!t.keepIds&&!t.svgOnly&&go.has(a)){To(o);continue}if(a==="template"){let c=o.content;c&&Fs(c,{...t,includeRoot:!1})}xo(o,n),t.keepIds||Eo(o,a);let l=mo[a];if(l)for(let c of l)o.removeAttribute(c);if(a==="include-file"&&!t.allowIncludeFile&&o.removeAttribute("src"),!t.keepIds&&!t.svgOnly&&a.includes("-")&&a!=="include-file"&&!vo.has(a))for(let c of bo)o.removeAttribute(c);s.push(o)}!t.keepIds&&i.size&&So(s,i)}function To(r){let t=r.parentNode;if(t){for(let e of[...r.childNodes])t.insertBefore(e,r);r.remove()}}function Lo(r,t){let e=r;for(;e;){if(e===t)return!0;e=e.parentNode??e.parent??null}return!1}function Ft(r,t={}){let e=document.createElement("template");return r&&typeof r=="string"&&(e.innerHTML=r,Fs(e.content,{allowIncludeFile:!!t.allowIncludeFile,keepIds:!!t.keepIds,keepStyle:!!t.keepStyle})),e.content}function qs({newItems:r,nodes:t,keyOf:e,renderItem:i,containerFor:s}){let n=[],o=[],a=[],l=new Set;for(let h of r)l.add(e(h));for(let[h,u]of[...t])l.has(h)||(u.remove(),t.delete(h),a.push(h));let c=new Map;for(let h of r){let u=e(h),p=t.get(u)||null,d=s(h,p);c.has(d)||c.set(d,[]),c.get(d)?.push({item:h,key:u,existing:p})}for(let[h,u]of c)for(let p=0;p<u.length;p++){let{item:d,key:f,existing:m}=u[p],y=m;y?(y.parentElement!==h||h.children[p]!==y)&&o.push(f):(y=i(d),t.set(f,y),n.push(f));let w=h.children[p];w!==y&&h.insertBefore(y,w||null)}return{added:n,moved:o,removed:a}}var Ue=class extends b{#t=null;#e=null;#i=null;#s=new Map;#r=null;#n=new Map;#a=new Set;setup(){this.#c(),this.#h(),this.#u(),this.#l(),this.#w(),this.#p()}teardown(){for(let t of this.#a)t.abort();this.#a.clear()}#c(){this.#t=this.querySelector(":scope > chat-thread"),this.#e=this.querySelector(":scope > chat-input"),this.#i=this.querySelector(":scope > header select[data-model-select]")}#h(){let t=this.querySelector(":scope > script[data-participants]");if(t)try{let e=JSON.parse(t.textContent);this.#s=new Map(Object.entries(e))}catch{console.warn("[chat-window] Invalid participant JSON")}}#l(){if(this.#t)for(let t of this.#t.querySelectorAll("chat-message[data-from]"))this.#o(t)}#o(t){let e=t.getAttribute("data-from");if(!e)return;let i=this.#s.get(e);i?.name?t.setAttribute("data-from-label",i.name):t.hasAttribute("data-from-label")||t.setAttribute("data-from-label",e)}#u(){if(!this.#i)return;let t=this.getAttribute("model");t?this.#i.value=t:this.#i.value&&this.setAttribute("model",this.#i.value)}#p(){this.listen(this,"chat-input:send",this.#d),this.#i&&this.listen(this.#i,"change",this.#f)}#d=async t=>{t.stopPropagation();let{message:e}=t.detail;if(!e||!this.#t)return;let i=this.#k("user",e,"user");this.#t.appendChild(i),this.#g(),this.#w();let s=this.#v(),n=this.#m(s);this.#t.appendChild(n),this.#g(),this.#e&&(this.#e.disabled=!0);let o=this.getAttribute("endpoint");if(o){let a=new AbortController;this.#a.add(a);try{let l=await this.#b(o,e,a.signal);this.resolveTyping(n,l)}catch(l){a.signal.aborted?n.remove():(this.resolveTyping(n,"<p>Sorry, something went wrong.</p>",{error:!0}),this.dispatchEvent(new CustomEvent("chat-window:error",{bubbles:!0,detail:{error:l.message,status:l.status??0}})))}finally{this.#a.delete(a)}}else this.dispatchEvent(new CustomEvent("chat-window:send",{bubbles:!0,detail:{message:e,typingElement:n}}));this.#e&&(this.#e.disabled=!1,this.isConnected&&this.#e.focus()),this.#g(),this.#w()};#f=()=>{let t=this.#i.value;this.setAttribute("model",t),this.dispatchEvent(new CustomEvent("chat-window:model-change",{bubbles:!0,detail:{model:t}}))};#k(t,e,i){let s=document.createElement("chat-message");s.setAttribute("data-role",t),i&&(s.setAttribute("data-from",i),this.#o(s));let n=document.createElement("chat-bubble");return this.#y(n,e,{asText:t==="user"}),s.appendChild(n),s}#y(t,e,{asText:i=!1}={}){let s=e==null?"":String(e);if(i||!s.includes("<")){let n=document.createElement("p");n.textContent=s,t.replaceChildren(n)}else t.replaceChildren(Ft(s))}#m(t){let e=document.createElement("chat-message");e.setAttribute("data-role","agent"),e.setAttribute("data-status","typing");let i="Agent";t&&(e.setAttribute("data-from",t),this.#o(e),i=this.#s.get(t)?.name??t);let s=this.getAttribute("model");s&&e.setAttribute("data-model",s);let n=document.createElement("chat-bubble"),o=document.createElement("span");return o.className="visually-hidden",o.setAttribute("data-chat-typing",""),o.textContent=`${i} is typing`,n.appendChild(o),e.appendChild(n),e}#v(){for(let[t,e]of this.#s)if(e.role==="agent")return t;return null}#w(){if(!this.#t)return;if(this.#t.querySelector(":scope > chat-message")!==null){this.#r?.remove(),this.#r=null;return}this.#r||(this.#r=this.#t.querySelector(":scope > [data-chat-empty]")),this.#r||(this.#r=document.createElement("p"),this.#r.setAttribute("data-chat-empty",""),this.#r.textContent=this.getAttribute("empty-message")||"Send a message to start."),this.#r.parentNode!==this.#t&&this.#t.prepend(this.#r)}#g(){this.#t&&requestAnimationFrame(()=>{this.#t.scrollTop=this.#t.scrollHeight})}scrollToBottom(){this.#g()}async#b(t,e,i){let s={message:e,model:this.getAttribute("model")||void 0},n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),signal:i});if(!n.ok){let a=new Error(`Chat request failed: ${n.status}`);throw a.status=n.status,a}let o=await n.json();return o.html??o.message??o.content??""}get model(){return this.getAttribute("model")??""}set model(t){this.setAttribute("model",t),this.#i&&(this.#i.value=t)}get participants(){return this.#s}set participants(t){this.#s=t instanceof Map?t:new Map(Object.entries(t)),this.#l()}clearThread(){if(this.#t){for(;this.#t.firstChild;)this.#t.removeChild(this.#t.firstChild);this.#w()}}appendMessage(t,e,i){if(!this.#t)return;let s=this.#k(t,e,i);return this.#t.appendChild(s),this.#g(),this.#w(),s}resolveTyping(t,e,{error:i=!1}={}){if(!t)return;let s=t.querySelector(":scope > chat-bubble");s||(s=document.createElement("chat-bubble"),t.appendChild(s)),this.#y(s,e),t.removeAttribute("aria-label"),i?t.setAttribute("data-status","error"):t.removeAttribute("data-status"),this.#g()}get messages(){return this.#t?[...this.#t.querySelectorAll(':scope > chat-message:not([data-status="typing"])')].map(t=>{let e=t.getAttribute("data-role")||"user",i=t.querySelector("chat-bubble");return{id:t.id||t.getAttribute("data-id")||void 0,role:e,content:(e==="user"?i?.textContent?.trim():i?.innerHTML)||"",from:t.getAttribute("data-from")||void 0}}):[]}set messages(t){if(!this.#t)return;let e=Array.isArray(t)?t:[];for(let[s,n]of this.#n)n.parentNode!==this.#t&&this.#n.delete(s);let i=new Set(this.#n.values());for(let s of[...this.#t.children])if(!i.has(s)){if(s.localName==="chat-message"&&s.id&&!s.matches('[data-status="typing"]')&&!this.#n.has(s.id)){this.#n.set(s.id,s);continue}s===this.#r&&(this.#r=null),s.remove()}qs({newItems:e,nodes:this.#n,keyOf:s=>s.id??s.role+":"+s.content,renderItem:s=>{let n=this.#k(s.role||"user",s.content||"",s.from);return s.id&&(n.id=s.id),n},containerFor:()=>this.#t}),this.#w(),this.#g(),this.dispatchEvent(new CustomEvent("chat-window:messages-changed",{detail:{messages:e,source:"property"},bubbles:!0}))}};g("chat-window",Ue);var Ve=class extends b{static formAssociated=!0;#t;#e=null;#i=null;#s;#r=!1;constructor(){super(),this.#t=this.attachInternals(),this._adoptInternals(this.#t)}setup(){return this.#e=this.querySelector(":scope > textarea, :scope textarea[data-grow]"),this.#i=this.querySelector("[data-send]"),this.#e?(this.#n(),this.listen(this.#e,"keydown",this.#a),this.listen(this.#e,"input",this.#c),this.#i&&this.listen(this.#i,"click",this.#h),this.form&&this.listen(this.form,"submit",this.#l),this.#f(),this.#p(),this.#d(),this.hasAttribute("autofocus")&&requestAnimationFrame(()=>this.#e?.focus()),!0):!1}teardown(){clearTimeout(this.#s)}#n(){let t=this.#e;t&&(t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby")||t.labels&&t.labels.length||t.hasAttribute("title")||t.setAttribute("aria-label","Message"))}#a=t=>{if(!(t.isComposing||t.keyCode===229))switch(t.key){case"Enter":t.shiftKey||(t.preventDefault(),this.#u());break;case"Escape":t.preventDefault(),this.reset();break}};#c=()=>{this.#p(),this.#d(),clearTimeout(this.#s),this.#s=setTimeout(()=>{this.dispatchEvent(new CustomEvent("chat-input:input",{bubbles:!0,detail:{value:this.value,length:this.value.length}}))},100)};#h=t=>{let e=this.#i;this.form&&e?.type==="submit"&&e.form===this.form&&this.#o()||(t.preventDefault(),this.#u())};#l=t=>{setTimeout(()=>{t.defaultPrevented||this.reset()},0)};#o({report:t=!1}={}){if(this.matches(":disabled"))return!1;let e=this.value.trim(),i=parseInt(this.getAttribute("minlength")??"1",10)||1;return e.length<i?!1:this.#t.validity.valid?!0:(t&&this.#t.reportValidity(),!1)}#u(){if(!this.#o({report:!0}))return;let t=this.form;if(t){let e=this.#i,i=e?.type==="submit"&&e.form===t?e:null;t.requestSubmit(i);return}this.dispatchEvent(new CustomEvent("chat-input:send",{bubbles:!0,detail:{message:this.value.trim()}})),this.reset()}#p(){let t=this.value;this.#t.setFormValue(t||null)}#d(){let t=this.value,e=parseInt(this.getAttribute("maxlength")??"4000",10)||4e3;t.length>e&&this.#e?this.#t.setValidity({tooLong:!0},`Message exceeds ${e} characters`,this.#e):this.#t.setValidity({})}#f(){let t=this.hasAttribute("disabled")||this.#r;this.#e&&(this.#e.disabled=t),this.#i&&(this.#i.disabled=t)}formDisabledCallback(t){this.#r=t,this.#f()}formResetCallback(){this.reset()}formStateRestoreCallback(t){!t||!this.#e||(this.#e.value=t,this.#p(),this.#d())}get form(){return this.#t.form}get name(){return this.getAttribute("name")??""}get validity(){return this.#t.validity}get validationMessage(){return this.#t.validationMessage}checkValidity(){return this.#t.checkValidity()}reportValidity(){return this.#t.reportValidity()}get value(){return this.#e?.value??""}set value(t){if(!this.#e)return;let e=t==null?"":String(t);this.#e.value!==e&&(this.#e.value=e,this.#e.dispatchEvent(new Event("input",{bubbles:!0})),this.#p(),this.#d(),this.dispatchEvent(new CustomEvent("chat-input:change",{bubbles:!0,detail:{value:e,source:"api"}})))}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",!!t)}focus(){this.#e?.focus()}reset(){this.#e&&(this.#e.value="",this.#e.dispatchEvent(new Event("input",{bubbles:!0})),this.#p(),this.#d())}static get observedAttributes(){return["disabled"]}attributeChangedCallback(t){t==="disabled"&&this.#f()}};g("chat-input",Ve);var qt="http://www.w3.org/2000/svg";function Mo(r){return r.trim().split(/[\s,]+/).map(Number)}function Ro(r,t){let e=Mo(t);switch(r){case"rect":{let[i,s,n,o]=e;return{type:"rect",x:i,y:s,width:n-i,height:o-s}}case"circle":{let[i,s,n]=e;return{type:"circle",cx:i,cy:s,r:n}}case"poly":{let i=[];for(let s=0;s<e.length;s+=2)i.push([e[s],e[s+1]]);return{type:"poly",points:i}}default:return null}}function _o(r){if(!r)return null;switch(r.type){case"rect":{let t=document.createElementNS(qt,"rect");return t.setAttribute("x",String(r.x)),t.setAttribute("y",String(r.y)),t.setAttribute("width",String(r.width)),t.setAttribute("height",String(r.height)),t}case"circle":{let t=document.createElementNS(qt,"circle");return t.setAttribute("cx",String(r.cx)),t.setAttribute("cy",String(r.cy)),t.setAttribute("r",String(r.r)),t}case"poly":{let t=document.createElementNS(qt,"polygon");return t.setAttribute("points",r.points.map(e=>e.join(",")).join(" ")),t}default:return null}}function No(r){if(!r)return{x:0,y:0,width:0,height:0};switch(r.type){case"rect":return{x:r.x,y:r.y,width:r.width,height:r.height};case"circle":return{x:r.cx-r.r,y:r.cy-r.r,width:r.r*2,height:r.r*2};case"poly":{let t=100,e=100,i=0,s=0;for(let[n,o]of r.points)n<t&&(t=n),o<e&&(e=o),n>i&&(i=n),o>s&&(s=o);return{x:t,y:e,width:i-t,height:s-e}}default:return{x:0,y:0,width:0,height:0}}}var Hs=0,Po=300,Io='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function $o(r){return r==null||r===""?[]:r instanceof HTMLTemplateElement?[r.content.cloneNode(!0)]:r instanceof Node?[r.cloneNode(!0)]:[document.createTextNode(String(r))]}var We=class extends HTMLElement{get shape(){return this.getAttribute("shape")||"rect"}get coords(){return this.getAttribute("coords")||""}get label(){return this.getAttribute("label")||""}get href(){return this.getAttribute("href")}get target(){return this.getAttribute("target")||""}get tooltipMode(){return this.getAttribute("tooltip")||"hover"}get disabled(){return this.hasAttribute("disabled")}connectedCallback(){this.setAttribute("data-upgraded","")}disconnectedCallback(){this.removeAttribute("data-upgraded")}},Ke=class extends b{#t=null;#e=null;#i=null;#s=[];#r=[];#n=null;#a=null;#c=null;#h=0;#l=0;#o=[];setup(){if(this.#t=this.querySelector(":scope > img"),!this.#t){let t=this.getAttribute("src"),e=this.getAttribute("alt");if(t)this.#t=document.createElement("img"),this.#t.src=t,this.#t.alt=e||"",this.prepend(this.#t);else return!1}return this.#t.classList.add("image-map-img"),this.#t.complete?this.#u():this.listen(this.#t,"load",()=>this.#u(),{once:!0}),!0}teardown(){this.#a?.disconnect(),this.#a=null,this.#m(),clearTimeout(this.#h),cancelAnimationFrame(this.#l),this.#e?.remove(),this.#i?.remove();for(let t of this.#r)t.anchor?.remove();for(let t of this.#o)t.removeAttribute("id");this.#e=null,this.#i=null,this.#r=[],this.#s=[],this.#o=[],this.#c=null}get regions(){return[...this.querySelectorAll(":scope > map-area")].map(t=>{let e;if(t.children.length){let i=document.createDocumentFragment();i.append(...[...t.childNodes].map(s=>s.cloneNode(!0))),e=i}else e=t.textContent?.trim()||void 0;return{shape:t.getAttribute("shape")||void 0,coords:t.getAttribute("coords")||void 0,label:t.getAttribute("label")||t.textContent?.trim().replace(/\s+/g," ")||void 0,href:t.getAttribute("href")||void 0,target:t.getAttribute("target")||void 0,tooltip:t.getAttribute("tooltip")||void 0,disabled:t.hasAttribute("disabled")||void 0,content:e}})}set regions(t){let e=Array.isArray(t)?t:[];for(let i of[...this.querySelectorAll(":scope > map-area")])i.remove();for(let i of e){if(!i)continue;let s=document.createElement("map-area");i.shape&&s.setAttribute("shape",i.shape),i.coords&&s.setAttribute("coords",i.coords),i.label&&s.setAttribute("label",i.label),i.href&&s.setAttribute("href",i.href),i.target&&s.setAttribute("target",i.target),i.tooltip&&s.setAttribute("tooltip",i.tooltip),i.disabled&&s.setAttribute("disabled",""),s.append(...$o(i.content)),this.appendChild(s)}this._reinit(),this.dispatchEvent(new CustomEvent("image-map:regions-changed",{detail:{regions:this.regions,source:"property"},bubbles:!0}))}#u(){if(!this.isConnected||this.#e)return;let t=[...this.querySelectorAll(":scope > map-area")];if(t.length===0)return;let e=document.createElementNS(qt,"svg");e.setAttribute("viewBox","0 0 100 100"),e.setAttribute("preserveAspectRatio","none"),e.setAttribute("aria-hidden","true"),e.classList.add("image-map-overlay"),this.#e=e;let i=document.createElement("div");i.className="image-map-tooltip",i.id=`imap-tip-${++Hs}`,i.hidden=!0,this.#i=i;for(let s of t){let n=s,o=Ro(n.shape,n.coords),a=_o(o);if(!a)continue;let l=No(o),c=s.getAttribute("href"),h=s.getAttribute("target")||"",u=s.getAttribute("tooltip")||"hover",p=s.hasAttribute("disabled"),d=s.textContent?.trim().replace(/\s+/g," ")||"",f=s.getAttribute("label")||d,m=c?document.createElement("a"):document.createElement("button");c?(m.href=c,h&&(m.target=h)):m.type="button",m.className="image-map-anchor",m.textContent=f;let y=u!=="none"&&(s.children.length>0||d&&d!==f);y&&(s.id||(s.id=`imap-area-${++Hs}`,this.#o.push(s)),u==="click"?(m.setAttribute("aria-expanded","false"),m.setAttribute("aria-controls",i.id)):m.setAttribute("aria-describedby",s.id)),m.style.left=`${l.x}%`,m.style.top=`${l.y}%`,m.style.width=`${l.width}%`,m.style.height=`${l.height}%`,p&&(a.setAttribute("data-disabled",""),m.setAttribute("tabindex","-1"),m.setAttribute("aria-disabled","true"));let w={area:s,parsed:o,svgShape:a,anchor:m,href:c,target:h,mode:u,hasContent:y,keyboardOpen:!1};p||this.#p(w),e.appendChild(a),this.#r.push(w),this.#s.push(m)}this.appendChild(e);for(let s of this.#s)this.appendChild(s);this.appendChild(i),this.listen(i,"pointerenter",()=>clearTimeout(this.#h)),this.listen(i,"pointerleave",()=>{this.#n?.mode==="hover"&&!this.#f()&&this.#k()}),this.listen(i,"focusout",s=>{let n=s.relatedTarget;n&&(i.contains(n)||n===this.#n?.anchor)||this.#m()}),this.listen(this,"keydown",this.#g),this.listen(document,"keydown",this.#b),this.listen(document,"pointerdown",this.#T),this.listen(window,"scroll",this.#v,{passive:!0,capture:!0}),this.#a=new ResizeObserver(this.#v),this.#a.observe(this.#t),this.setAttribute("role","group"),!this.hasAttribute("aria-label")&&!this.hasAttribute("aria-labelledby")&&this.setAttribute("aria-label",this.#t.alt||this.dataset.labelMap||"Image map")}#p(t){let{svgShape:e,anchor:i,area:s,mode:n}=t;this.listen(e,"pointerenter",()=>{clearTimeout(this.#h),n==="hover"&&this.#y(t),e.setAttribute("data-hover",""),this.#A("image-map:area-enter",s)}),this.listen(e,"pointerleave",()=>{n==="hover"&&this.#n===t&&!this.#f()&&this.#k(),document.activeElement!==i&&e.removeAttribute("data-hover"),this.#A("image-map:area-leave",s)}),this.listen(e,"click",()=>{let o=this.#d(t,!1);t.href&&n!=="click"&&!o.defaultPrevented&&(t.target==="_blank"?window.open(t.href,"_blank","noopener"):window.location.href=t.href)}),this.listen(e,"touchstart",o=>{n==="hover"&&(this.#c!==t?(o.preventDefault(),this.#c=t,this.#y(t)):this.#c=null)},{passive:!1}),this.listen(i,"click",o=>{let a=o.detail===0,l=this.#d(t,a);(n==="click"||l.defaultPrevented)&&o.preventDefault()}),t.href&&this.listen(i,"keydown",o=>{o.key===" "&&(o.preventDefault(),i.click())}),this.listen(i,"focus",()=>{clearTimeout(this.#h),n==="hover"&&this.#y(t),e.setAttribute("data-hover",""),this.#A("image-map:area-enter",s)}),this.listen(i,"blur",o=>{e.removeAttribute("data-hover"),this.#A("image-map:area-leave",s);let a=o.relatedTarget;this.#n===t&&!(a&&this.#i?.contains(a))&&this.#m()})}#d(t,e){if(t.mode==="click"&&t.hasContent){if(this.#n===t)this.#m();else if(this.#y(t),e){t.keyboardOpen=!0;let i=this.#i?.querySelector(Io);i&&i.focus()}}return this.#A("image-map:area-activate",t.area,!0)}#f(){let t=document.activeElement;return!!(t&&this.#i?.contains(t))}#k(){clearTimeout(this.#h),this.#h=setTimeout(()=>this.#m(),Po)}#y(t){let e=this.#i;!e||t.mode==="none"||!t.hasContent||(clearTimeout(this.#h),this.#n&&this.#n!==t&&this.#m(),this.#n=t,e.replaceChildren(...[...t.area.childNodes].map(i=>i.cloneNode(!0))),t.mode==="click"?(e.removeAttribute("role"),e.setAttribute("role","group"),e.setAttribute("aria-label",t.anchor.textContent||""),t.anchor.setAttribute("aria-expanded","true")):(e.setAttribute("role","tooltip"),e.removeAttribute("aria-label")),t.anchor.nextSibling!==e&&t.anchor.after(e),e.hidden=!1,e.setAttribute("data-state-visible",""),this.#w(t.svgShape))}#m({restoreFocus:t=!1}={}){clearTimeout(this.#h);let e=this.#n,i=this.#i;if(!i||!e)return;let s=this.#f();this.#n=null,e.keyboardOpen=!1,e.mode==="click"&&e.anchor.hasAttribute("aria-expanded")&&e.anchor.setAttribute("aria-expanded","false"),i.removeAttribute("data-state-visible"),i.hidden=!0,i.replaceChildren(),(t||s)&&e.anchor.focus()}#v=()=>{!this.#n||this.#l||(this.#l=requestAnimationFrame(()=>{this.#l=0,this.#n&&this.#w(this.#n.svgShape)}))};#w(t){if(!this.#i||!t)return;let e=t.getBoundingClientRect(),i=this.#i.getBoundingClientRect(),s=8,n=8,o=window.innerWidth,a=window.innerHeight,l,c,h=e.top-i.height-s;h>=n?(l=h,c=e.left+(e.width-i.width)/2):e.bottom+s+i.height<=a-n?(l=e.bottom+s,c=e.left+(e.width-i.width)/2):e.right+s+i.width<=o-n?(l=e.top+(e.height-i.height)/2,c=e.right+s):(l=e.top+(e.height-i.height)/2,c=e.left-i.width-s),c=Math.max(n,Math.min(c,o-i.width-n)),l=Math.max(n,Math.min(l,a-i.height-n)),this.#i.style.top=`${l}px`,this.#i.style.left=`${c}px`}#g=t=>{if(this.#i?.contains(t.target))return;let e=this.#s.filter(s=>!s.hasAttribute("aria-disabled")),i=e.indexOf(document.activeElement);if(i!==-1)switch(t.key){case"ArrowDown":case"ArrowRight":{t.preventDefault(),e[i<e.length-1?i+1:0]?.focus();break}case"ArrowUp":case"ArrowLeft":{t.preventDefault(),e[i>0?i-1:e.length-1]?.focus();break}}};#b=t=>{t.key==="Escape"&&(this.#c=null,this.#n&&(t.preventDefault(),this.#m()))};#T=t=>{if(!this.#n)return;let e=t.target;this.#i?.contains(e)||this.contains(e)&&e!==this&&e!==this.#t||(this.#c=null,this.#m())};#A(t,e,i=!1){let s=new CustomEvent(t,{detail:{area:e},bubbles:!0,cancelable:i});return this.dispatchEvent(s),s}};g("map-area",We);g("image-map",Ke);var zo='<svg viewBox="0 0 68 48" width="68" height="48" aria-hidden="true" focusable="false"><path d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.64 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z" fill="var(--color-error, #f00)"/><path d="M45 24 27 14v20z" fill="#fff"/></svg>',Bo={hq:"hqdefault",mq:"mqdefault",sd:"sddefault",maxres:"maxresdefault"},Us="YouTube video",jo="Play {title}",Oo=/^\d+$/;function Vs(r){return String(r).replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t])}function Do(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches||document.documentElement.hasAttribute("data-motion-reduced")}var Ge=class extends b{#t="";#e=Us;setup(){let t=this.getAttribute("video-id");return this.#e=this.getAttribute("title")||Us,t?/^[A-Za-z0-9_-]{6,20}$/.test(t)?(this.#t=t,this.hasAttribute("autoplay")&&!Do()?this.#c(!1):this.#a(),!0):(console.warn(`youtube-player: invalid video-id ${JSON.stringify(t)}`),!1):(console.warn("youtube-player: missing required video-id attribute"),!1)}#i(t){let e=this.getAttribute(t);return e===null||e===""?null:Oo.test(e.trim())?e.trim():(console.warn(`youtube-player: ${t} must be whole seconds, got ${JSON.stringify(e)}`),null)}#s(){let t=new URLSearchParams({autoplay:"1"}),e=this.#i("start");e&&t.set("start",e);let i=this.#i("end");i&&t.set("end",i);let s=this.getAttribute("list");s&&t.set("list",s);let n=this.getAttribute("params");return n&&new URLSearchParams(n).forEach((o,a)=>t.set(a,o)),`https://www.youtube-nocookie.com/embed/${this.#t}?${t}`}#r(t){return`https://i.ytimg.com/vi/${this.#t}/${Bo[t]??"hqdefault"}.jpg`}#n(){return(this.getAttribute("data-label-play")||jo).replace(/\{title\}/g,this.#e)}#a(){this.setAttribute("state","ready");let t=document.createElement("img");t.alt="",t.loading="lazy",t.decoding="async";let e=this.getAttribute("poster");if(e)t.src=e;else{let s=this.getAttribute("thumbnail")??"hq";if(t.referrerPolicy="no-referrer",t.src=this.#r(s),s==="sd"||s==="maxres"){let n=()=>{t.src=this.#r("hq")};t.addEventListener("error",n,{once:!0}),t.addEventListener("load",()=>{t.naturalWidth<=120&&n()},{once:!0})}}let i=document.createElement("button");i.type="button",i.setAttribute("aria-label",this.#n()),i.innerHTML=zo,i.addEventListener("click",()=>this.#c(!0),{once:!0}),this.replaceChildren(t,i)}#c(t){this.setAttribute("state","active"),this.innerHTML=`<iframe src="${Vs(this.#s())}" title="${Vs(this.#e)}" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen loading="lazy"></iframe>`,t&&this.querySelector("iframe")?.focus(),this.dispatchEvent(new CustomEvent("youtube-player:activate",{bubbles:!0,detail:{videoId:this.#t,fromUser:t}}))}};g("youtube-player",Ge);var xt=CSS.supports("anchor-name","--x")&&CSS.supports("position-area","bottom"),Ws=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,Fo="--tour-target",Ye='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',qo='input, textarea, select, [contenteditable]:not([contenteditable="false"])',Ho={title:"Page Tour",step:"Step {n} of {total}",skip:"Skip tour",close:"Close",prev:"Previous",next:"Next",finish:"Finish",nav:"Tour navigation",ready:"Done. Next is available."},Uo=0,Xe=class extends HTMLElement{get target(){return this.dataset.target??""}get placement(){return this.dataset.placement??"auto"}get action(){return this.dataset.action??"none"}get actionHint(){return this.dataset.actionHint??null}get skippable(){return this.dataset.skippable!=="false"}get scrollBehavior(){return this.dataset.scroll??"smooth"}};function Ks(r){if(!r?.target)return null;try{return document.querySelector(r.target)}catch{return null}}function L(r,t,e){let i=document.createElement(r);return t&&(i.className=t),e!=null&&(i.textContent=e),i}var Je=class r extends b{#t=[];#e=0;#i=!1;#s=null;#r=null;#n=null;#a=null;#c=null;#h=null;#l="";#o=null;#u=null;#p=null;#d=null;#f=null;#k=null;#y=null;static#m=null;static observedAttributes=["data-step"];setup(){if(this.#t=[...this.querySelectorAll("tour-step")],this.#t.length===0)return!1;let t=this.querySelector(".page-tour-start-btn");if(t&&this.listen(t,"click",e=>{e.preventDefault(),this.start()}),this.id&&this.listen(document,"click",e=>{e.target?.closest?.(`[data-tour="${CSS.escape(this.id)}"]`)&&(e.preventDefault(),this.start())}),this.dataset.trigger==="auto"){let e=this.#J();e?.complete||e?.skipped?this.setAttribute("data-complete",""):this.#y=setTimeout(()=>{this.#y=null,this.isConnected&&this.start(e?.step??0)},400)}return!0}teardown(){this.#y&&(clearTimeout(this.#y),this.#y=null),this.#i&&this.stop()}attributeChangedCallback(t,e,i){if(t==="data-step"&&this.#i&&e!==null){let s=parseInt(i,10);!Number.isNaN(s)&&s!==this.#e&&this.goto(s)}}start(t=0){let e=Math.min(Math.max(0,Number(t)||0),this.#t.length-1);if(this.#i){this.goto(e);return}let i=this.#b(e,1,!0);if(i===-1&&(i=this.#b(e-1,-1,!0)),i===-1){console.warn("[page-tour] No step target found on the page; tour not started");return}r.#m&&r.#m!==this&&r.#m.stop(),this.#c=document.activeElement,this.#i=!0,r.#m=this,this.#T(),this.setAttribute("data-active",""),this.removeAttribute("data-complete"),this.#U("tour:start",{step:i}),this.#N(i,"next")}stop(){this.#i&&(this.#j(),this.#i=!1,this.removeAttribute("data-active"),r.#m===this&&(r.#m=null))}next(){if(!this.#i||this.#g())return;let t=this.#b(this.#e+1,1,!0);t===-1?this.#_():this.#N(t,"next")}prev(){if(!this.#i)return;let t=this.#b(this.#e-1,-1,!0);t!==-1&&this.#N(t,"prev")}goto(t){if(!this.#i)return;let e=Number(t);if(!Number.isInteger(e)||e<0||e>=this.#t.length)return;let i=e>=this.#e?"next":"prev",s=i==="next"?1:-1,n=this.#b(e,s,!0);n===-1&&(n=this.#b(e-s,s===1?-1:1,!0)),!(n===-1||n===this.#e)&&this.#N(n,i)}skip(){this.#i&&this.#w(this.#t[this.#e])&&(this.#U("tour:skip",{step:this.#e}),this.#q({skipped:!0}),this.stop(),this.setAttribute("data-complete",""))}reset(){this.#Z(),this.removeAttribute("data-complete"),this.dataset.step="0"}#v(t){return(t==="title"?this.dataset.title:this.getAttribute(`data-label-${t}`))??Ho[t]}#w(t){return(this.dataset.mode??"passive")!=="forced"&&(t?.skippable??!0)}#g(){return!!this.#n?.querySelector(".page-tour-next[data-waiting]")}#b(t,e,i=!1){for(let s=t;s>=0&&s<this.#t.length;s+=e){if(Ks(this.#t[s]))return s;i&&console.warn(`[page-tour] Target "${this.#t[s].target}" not found, skipping step ${s}`)}return-1}#T(){this.#s=L("div","page-tour-backdrop"),this.#s.setAttribute("aria-hidden","true"),this.#s.addEventListener("click",()=>this.skip()),this.#r=L("div","page-tour-spotlight"),this.#r.setAttribute("aria-hidden","true"),this.#n=L("div","page-tour-card"),this.#n.setAttribute("popover","manual"),this.#n.setAttribute("role","dialog"),this.#n.setAttribute("aria-label",this.#v("title")),this.#n.setAttribute("tabindex","-1"),this.#n.toggleAttribute("data-anchored",xt),this.#n.addEventListener("click",e=>this.#D(e));let t=parseFloat(this.dataset.spotlightPadding??"");if(Number.isFinite(t)&&t>=0)for(let e of[this.#r,this.#n])e.style.setProperty("--tour-spotlight-padding",`${t}px`);this.#a=L("div","visually-hidden"),this.#a.setAttribute("aria-live","polite"),this.#a.setAttribute("aria-atomic","true"),this.#a.id=`page-tour-announcer-${++Uo}`,this.append(this.#s,this.#r,this.#n,this.#a),this.#n.showPopover(),this.#u=new AbortController,document.addEventListener("keydown",e=>this.#R(e),{signal:this.#u.signal}),requestAnimationFrame(()=>{this.#s?.setAttribute("data-state-visible","")})}#A(t){this.#h=t;let e=getComputedStyle(t).position==="static";t.setAttribute("data-tour-target",e?"raised":""),xt&&(this.#l=t.style.getPropertyValue("anchor-name"),t.style.setProperty("anchor-name",Fo))}#x(){let t=this.#h;t&&(t.removeAttribute("data-tour-target"),xt&&(this.#l?t.style.setProperty("anchor-name",this.#l):t.style.removeProperty("anchor-name"),t.getAttribute("style")||t.removeAttribute("style")),this.#l="",this.#h=null)}#S(t){if(!this.#r)return;let e=t.getBoundingClientRect();Object.assign(this.#r.style,{top:`${e.top}px`,left:`${e.left}px`,width:`${e.width}px`,height:`${e.height}px`})}#E(t,e){let i=getComputedStyle(this).direction==="rtl";switch(e){case"top":case"bottom":return e;case"inline-start":return i?"right":"left";case"inline-end":return i?"left":"right";default:return this.#$(t)}}#L(t,e){if(!this.#n)return;let i=this.#E(t,e);this.#n.dataset.side=i,xt||this.#C(t,i)}#C(t,e){let i=this.#n;if(!i)return;let s=t.getBoundingClientRect(),n=12,o=8,a=this.#r&&parseFloat(getComputedStyle(this.#r).paddingTop)||0;i.style.visibility="hidden",i.style.top="0",i.style.left="0";let l=i.getBoundingClientRect();i.style.visibility="";let c=0,h=0;switch(e){case"bottom":c=s.bottom+a+n,h=s.left+(s.width-l.width)/2;break;case"top":c=s.top-a-n-l.height,h=s.left+(s.width-l.width)/2;break;case"right":c=s.top+(s.height-l.height)/2,h=s.right+a+n;break;case"left":c=s.top+(s.height-l.height)/2,h=s.left-a-n-l.width;break}h=Math.max(o,Math.min(h,window.innerWidth-l.width-o)),c=Math.max(o,Math.min(c,window.innerHeight-l.height-o)),i.style.top=`${c}px`,i.style.left=`${h}px`}#$(t){let e=t.getBoundingClientRect(),i=window.innerHeight-e.bottom,s=e.top,n=window.innerWidth-e.right,o=e.left,a=Math.max(i,s,n,o);return a===i?"bottom":a===s?"top":a===n?"right":"left"}#P(t,e){let i=this.#n;if(!i)return;let s=this.#t.length,n=this.#b(e+1,1)!==-1,o=this.#b(e-1,-1)!==-1,a=t.action!=="none",l=L("div","page-tour-progress");l.setAttribute("aria-hidden","true"),this.#t.forEach((m,y)=>{let w=L("span","page-tour-pip");y===e&&w.setAttribute("data-active",""),y<e&&w.setAttribute("data-visited",""),l.append(w)});let c=L("p","page-tour-meta");c.append(L("span","page-tour-step-count",this.#v("step").replace("{n}",String(e+1)).replace("{total}",String(s))));let h=L("div","page-tour-content");for(let m of t.childNodes)h.append(m.cloneNode(!0));let u=L("footer","page-tour-footer");if(this.#w(t)){let m=L("button","page-tour-skip",this.#v(n?"skip":"close"));m.type="button",m.dataset.action="skip",u.append(m)}let p=L("nav","page-tour-nav");if(p.setAttribute("aria-label",this.#v("nav")),o){let m=L("button","page-tour-prev",this.#v("prev"));m.type="button",m.dataset.action="prev",p.append(m)}let d=L("button","page-tour-next",this.#v(n?"next":"finish"));d.type="button",d.dataset.action="next",p.append(d),u.append(p);let f=[l,c,h];if(a&&(d.setAttribute("data-waiting",""),d.setAttribute("aria-disabled","true"),t.actionHint)){let m=L("p","page-tour-action-hint",t.actionHint);m.id=`${this.#a?.id??"page-tour"}-hint`,d.setAttribute("aria-describedby",m.id),f.push(m)}f.push(u),i.replaceChildren(...f),a?i.removeAttribute("aria-modal"):i.setAttribute("aria-modal","true")}#N(t,e="next"){let i=this.#t[t],s=Ks(i);if(!i||!s)return;if(this.#d?.abort(),this.#d=null,this.#B(),this.#x(),this.#e=t,this.#A(s),i.scrollBehavior!=="none"){let l=Ws()?"instant":i.scrollBehavior;s.scrollIntoView({block:"nearest",behavior:l})}this.#P(i,t),this.#S(s),this.#L(s,i.placement);let n=this.#n;n?.focus(),requestAnimationFrame(()=>{if(this.#n!==n||this.#e!==t)return;let l=n?.querySelector(".page-tour-content :is(h2, h3, h4)")??null;l?(l.hasAttribute("tabindex")||l.setAttribute("tabindex","-1"),l.focus()):(n?.querySelector(".page-tour-next")??null)?.focus()});let o=i.querySelector("h2, h3, h4"),a=this.#v("step").replace("{n}",String(t+1)).replace("{total}",String(this.#t.length));this.#K(o?.textContent?`${a}: ${o.textContent.trim()}`:a),this.dataset.step=String(t),i.action!=="none"&&this.#I(i,s),this.#F(s),this.#q({step:t}),this.#U("tour:step",{step:t,target:s,direction:e})}#I(t,e){let i=new AbortController;this.#d=i;let n={click:"click",focus:"focus",input:"input",change:"change"}[t.action];n?e.addEventListener(n,()=>{i.abort(),this.#M(),this.#U("tour:action",{step:this.#e,action:t.action})},{signal:i.signal}):t.action==="custom"&&this.addEventListener("tour:action",()=>{i.abort(),this.#M()},{signal:i.signal})}#M(){let t=this.#n?.querySelector(".page-tour-next");t&&(t.removeAttribute("data-waiting"),t.removeAttribute("aria-disabled"),t.removeAttribute("aria-describedby"),this.#n?.querySelector(".page-tour-action-hint")?.remove(),this.#K(this.#v("ready")))}#R(t){if(!this.#i||t.defaultPrevented)return;let i=!!(t.target instanceof Element?t.target:null)?.closest(qo),s=t.altKey||t.ctrlKey||t.metaKey;switch(t.key){case"Escape":this.#w(this.#t[this.#e])&&(t.preventDefault(),this.skip());break;case"ArrowRight":case"ArrowDown":if(i||s)return;t.preventDefault(),this.next();break;case"ArrowLeft":case"ArrowUp":if(i||s)return;t.preventDefault(),this.prev();break;case"Home":if(i||s)return;t.preventDefault(),this.goto(0);break;case"End":if(i||s)return;t.preventDefault(),this.goto(this.#t.length-1);break;case"Tab":this.#z(t);break}}#z(t){if(!this.#n)return;let e=d=>!d.disabled&&(d.checkVisibility?.()??!0),i=[...this.#n.querySelectorAll(Ye)].filter(e),s=[],n=this.#t[this.#e],o=this.#h;n&&n.action!=="none"&&o&&(s=(o.matches(Ye)?[o]:[...o.querySelectorAll(Ye)]).filter(e));let a=[...i,...s];if(a.length===0)return;let l=a[0],c=a[a.length-1],h=document.activeElement,u=!h||!a.includes(h),p=u?-1:a.indexOf(h);t.preventDefault(),t.shiftKey?(u||h===l?c:a[p-1]).focus():(u||h===c?l:a[p+1]).focus()}#D(t){let e=t.target.closest?.("[data-action]")??null;if(e)switch(e.dataset.action){case"next":this.next();break;case"prev":this.prev();break;case"skip":this.skip();break}}#F(t){let e=new AbortController;this.#p=e;let i=()=>this.#O();document.addEventListener("scroll",i,{capture:!0,passive:!0,signal:e.signal}),window.addEventListener("resize",i,{passive:!0,signal:e.signal}),this.#o=new ResizeObserver(i),this.#o.observe(t),this.#k=setTimeout(i,Ws()?0:300)}#B(){this.#p?.abort(),this.#p=null,this.#o?.disconnect(),this.#o=null,this.#k&&(clearTimeout(this.#k),this.#k=null),this.#f&&(cancelAnimationFrame(this.#f),this.#f=null)}#O(){this.#f||(this.#f=requestAnimationFrame(()=>{this.#f=null;let t=this.#h;!this.#i||!t||(this.#S(t),xt||this.#L(t,this.#t[this.#e].placement))}))}#_(){this.#U("tour:complete",{steps:this.#t.length}),this.#q({complete:!0}),this.stop(),this.setAttribute("data-complete","")}#j(){this.#u?.abort(),this.#u=null,this.#d?.abort(),this.#d=null,this.#B(),this.#x();let t=document.activeElement,e=!t||t===document.body||!!this.#n?.contains(t);this.#s?.remove(),this.#r?.remove(),this.#n?.matches(":popover-open")&&this.#n.hidePopover(),this.#n?.remove(),this.#a?.remove(),this.#s=null,this.#r=null,this.#n=null,this.#a=null;let i=this.#c;this.#c=null,e&&i?.isConnected&&typeof i.focus=="function"&&i.focus()}#K(t){let e=this.#a;e&&(e.textContent="",requestAnimationFrame(()=>{this.#a===e&&(e.textContent=t)}))}#U(t,e){let i=t!=="tour:skip";this.dispatchEvent(new CustomEvent(t,{bubbles:!0,cancelable:i,detail:e}))}#W(){let t=this.dataset.persist??"session";return t==="session"?sessionStorage:t==="local"?localStorage:null}#H(){return`vb-tour-${this.dataset.persistKey??window.location.pathname}`}#q(t){let e=this.#W();if(!e)return;let i=this.#H(),s={};try{s=JSON.parse(e.getItem(i)??"null")??{}}catch{}e.setItem(i,JSON.stringify({...s,...t}))}#J(){let t=this.#W();if(!t)return null;try{return JSON.parse(t.getItem(this.#H())??"null")}catch{return null}}#Z(){let t=this.#W();t&&t.removeItem(this.#H())}};g("page-tour",Je);g("tour-step",Xe);function ei(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Z=ei();function tr(r){Z=r}var X={exec:()=>null};function x(r,t=""){let e=typeof r=="string"?r:r.source,i={replace:(s,n)=>{let o=typeof n=="string"?n:n.source;return o=o.replace(M.caret,"$1"),e=e.replace(s,o),i},getRegex:()=>new RegExp(e,t)};return i}var Vo=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),M={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}>`)},Wo=/^(?:[ \t]*(?:\n|$))+/,Ko=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Go=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Tt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Yo=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ii=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,er=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ir=x(er).replace(/bull/g,ii).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Xo=x(er).replace(/bull/g,ii).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),si=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Jo=/^[^\n]+/,ri=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Zo=x(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ri).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Qo=x(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ii).getRegex(),Kt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ni=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ta=x("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ni).replace("tag",Kt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),sr=x(si).replace("hr",Tt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Kt).getRegex(),ea=x(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",sr).getRegex(),oi={blockquote:ea,code:Ko,def:Zo,fences:Go,heading:Yo,hr:Tt,html:ta,lheading:ir,list:Qo,newline:Wo,paragraph:sr,table:X,text:Jo},Gs=x("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Tt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Kt).getRegex(),ia={...oi,lheading:Xo,table:Gs,paragraph:x(si).replace("hr",Tt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Gs).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Kt).getRegex()},sa={...oi,html:x(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ni).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:X,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:x(si).replace("hr",Tt).replace("heading",` *#{1,6} *[^
1255
1255
  ]`).replace("lheading",ir).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ra=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,na=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,rr=/^( {2,}|\\)\n(?!\s*$)/,oa=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ct=/[\p{P}\p{S}]/u,Gt=/[\s\p{P}\p{S}]/u,ai=/[^\s\p{P}\p{S}]/u,aa=x(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Gt).getRegex(),nr=/(?!~)[\p{P}\p{S}]/u,la=/(?!~)[\s\p{P}\p{S}]/u,ca=/(?:[^\s\p{P}\p{S}]|~)/u,ha=x(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Vo?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),or=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,ua=x(or,"u").replace(/punct/g,ct).getRegex(),da=x(or,"u").replace(/punct/g,nr).getRegex(),ar="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",pa=x(ar,"gu").replace(/notPunctSpace/g,ai).replace(/punctSpace/g,Gt).replace(/punct/g,ct).getRegex(),fa=x(ar,"gu").replace(/notPunctSpace/g,ca).replace(/punctSpace/g,la).replace(/punct/g,nr).getRegex(),ma=x("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ai).replace(/punctSpace/g,Gt).replace(/punct/g,ct).getRegex(),ga=x(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ct).getRegex(),ba="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",va=x(ba,"gu").replace(/notPunctSpace/g,ai).replace(/punctSpace/g,Gt).replace(/punct/g,ct).getRegex(),ya=x(/\\(punct)/,"gu").replace(/punct/g,ct).getRegex(),wa=x(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ka=x(ni).replace("(?:-->|$)","-->").getRegex(),Aa=x("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ka).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ut=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,xa=x(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Ut).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),lr=x(/^!?\[(label)\]\[(ref)\]/).replace("label",Ut).replace("ref",ri).getRegex(),cr=x(/^!?\[(ref)\](?:\[\])?/).replace("ref",ri).getRegex(),Ea=x("reflink|nolink(?!\\()","g").replace("reflink",lr).replace("nolink",cr).getRegex(),Ys=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,li={_backpedal:X,anyPunctuation:ya,autolink:wa,blockSkip:ha,br:rr,code:na,del:X,delLDelim:X,delRDelim:X,emStrongLDelim:ua,emStrongRDelimAst:pa,emStrongRDelimUnd:ma,escape:ra,link:xa,nolink:cr,punctuation:aa,reflink:lr,reflinkSearch:Ea,tag:Aa,text:oa,url:X},Sa={...li,link:x(/^!?\[(label)\]\((.*?)\)/).replace("label",Ut).getRegex(),reflink:x(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ut).getRegex()},Ze={...li,emStrongRDelimAst:fa,emStrongLDelim:da,delLDelim:ga,delRDelim:va,url:x(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ys).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:x(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Ys).getRegex()},Ca={...Ze,br:x(rr).replace("{2,}","*").getRegex(),text:x(Ze.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ht={normal:oi,gfm:ia,pedantic:sa},Et={normal:li,gfm:Ze,breaks:Ca,pedantic:Sa},Ta={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Xs=r=>Ta[r];function O(r,t){if(t){if(M.escapeTest.test(r))return r.replace(M.escapeReplace,Xs)}else if(M.escapeTestNoEncode.test(r))return r.replace(M.escapeReplaceNoEncode,Xs);return r}function Js(r){try{r=encodeURI(r).replace(M.percentDecode,"%")}catch{return null}return r}function Zs(r,t){let e=r.replace(M.findPipe,(n,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),i=e.split(M.splitPipe),s=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;s<i.length;s++)i[s]=i[s].trim().replace(M.slashPipe,"|");return i}function St(r,t,e){let i=r.length;if(i===0)return"";let s=0;for(;s<i;){let n=r.charAt(i-s-1);if(n===t&&!e)s++;else if(n!==t&&e)s++;else break}return r.slice(0,i-s)}function La(r,t){if(r.indexOf(t[1])===-1)return-1;let e=0;for(let i=0;i<r.length;i++)if(r[i]==="\\")i++;else if(r[i]===t[0])e++;else if(r[i]===t[1]&&(e--,e<0))return i;return e>0?-2:-1}function Ma(r,t=0){let e=t,i="";for(let s of r)if(s===" "){let n=4-e%4;i+=" ".repeat(n),e+=n}else i+=s,e++;return i}function Qs(r,t,e,i,s){let n=t.href,o=t.title||null,a=r[1].replace(s.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:r[0].charAt(0)==="!"?"image":"link",raw:e,href:n,title:o,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,l}function Ra(r,t,e){let i=r.match(e.other.indentCodeCompensation);if(i===null)return t;let s=i[1];return t.split(`
1256
1256
  `).map(n=>{let o=n.match(e.other.beginningSpace);if(o===null)return n;let[a]=o;return a.length>=s.length?n.slice(s.length):n}).join(`
1257
1257
  `)}var Vt=class{options;rules;lexer;constructor(r){this.options=r||Z}space(r){let t=this.rules.block.newline.exec(r);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(r){let t=this.rules.block.code.exec(r);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:St(e,`
@@ -1310,12 +1310,12 @@ ${r}</tr>
1310
1310
  `}tablecell(r){let t=this.parser.parseInline(r.tokens),e=r.header?"th":"td";return(r.align?`<${e} align="${r.align}">`:`<${e}>`)+t+`</${e}>
1311
1311
  `}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${O(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:t,tokens:e}){let i=this.parser.parseInline(e),s=Js(r);if(s===null)return i;r=s;let n='<a href="'+r+'"';return t&&(n+=' title="'+O(t)+'"'),n+=">"+i+"</a>",n}image({href:r,title:t,text:e,tokens:i}){i&&(e=this.parser.parseInline(i,this.parser.textRenderer));let s=Js(r);if(s===null)return O(e);r=s;let n=`<img src="${r}" alt="${O(e)}"`;return t&&(n+=` title="${O(t)}"`),n+=">",n}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:O(r.text)}},ci=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}checkbox({raw:r}){return r}},z=class ti{options;renderer;textRenderer;constructor(t){this.options=t||Z,this.options.renderer=this.options.renderer||new Wt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ci}static parse(t,e){return new ti(e).parse(t)}static parseInline(t,e){return new ti(e).parseInline(t)}parse(t){this.renderer.parser=this;let e="";for(let i=0;i<t.length;i++){let s=t[i];if(this.options.extensions?.renderers?.[s.type]){let o=s,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){e+=a||"";continue}}let n=s;switch(n.type){case"space":{e+=this.renderer.space(n);break}case"hr":{e+=this.renderer.hr(n);break}case"heading":{e+=this.renderer.heading(n);break}case"code":{e+=this.renderer.code(n);break}case"table":{e+=this.renderer.table(n);break}case"blockquote":{e+=this.renderer.blockquote(n);break}case"list":{e+=this.renderer.list(n);break}case"checkbox":{e+=this.renderer.checkbox(n);break}case"html":{e+=this.renderer.html(n);break}case"def":{e+=this.renderer.def(n);break}case"paragraph":{e+=this.renderer.paragraph(n);break}case"text":{e+=this.renderer.text(n);break}default:{let o='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return e}parseInline(t,e=this.renderer){this.renderer.parser=this;let i="";for(let s=0;s<t.length;s++){let n=t[s];if(this.options.extensions?.renderers?.[n.type]){let a=this.options.extensions.renderers[n.type].call({parser:this},n);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){i+=a||"";continue}}let o=n;switch(o.type){case"escape":{i+=e.text(o);break}case"html":{i+=e.html(o);break}case"link":{i+=e.link(o);break}case"image":{i+=e.image(o);break}case"checkbox":{i+=e.checkbox(o);break}case"strong":{i+=e.strong(o);break}case"em":{i+=e.em(o);break}case"codespan":{i+=e.codespan(o);break}case"br":{i+=e.br(o);break}case"del":{i+=e.del(o);break}case"text":{i+=e.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return i}},Ct=class{options;block;constructor(r){this.options=r||Z}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}emStrongMask(r){return r}provideLexer(r=this.block){return r?$.lex:$.lexInline}provideParser(r=this.block){return r?z.parse:z.parseInline}},hi=class{defaults=ei();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=z;Renderer=Wt;TextRenderer=ci;Lexer=$;Tokenizer=Vt;Hooks=Ct;constructor(...r){this.use(...r)}walkTokens(r,t){let e=[];for(let i of r)switch(e=e.concat(t.call(this,i)),i.type){case"table":{let s=i;for(let n of s.header)e=e.concat(this.walkTokens(n.tokens,t));for(let n of s.rows)for(let o of n)e=e.concat(this.walkTokens(o.tokens,t));break}case"list":{let s=i;e=e.concat(this.walkTokens(s.items,t));break}default:{let s=i;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(n=>{let o=s[n].flat(1/0);e=e.concat(this.walkTokens(o,t))}):s.tokens&&(e=e.concat(this.walkTokens(s.tokens,t)))}}return e}use(...r){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return r.forEach(e=>{let i={...e};if(i.async=this.defaults.async||i.async||!1,e.extensions&&(e.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let n=t.renderers[s.name];n?t.renderers[s.name]=function(...o){let a=s.renderer.apply(this,o);return a===!1&&(a=n.apply(this,o)),a}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let n=t[s.level];n?n.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),i.extensions=t),e.renderer){let s=this.defaults.renderer||new Wt(this.defaults);for(let n in e.renderer){if(!(n in s))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let o=n,a=e.renderer[o],l=s[o];s[o]=(...c)=>{let h=a.apply(s,c);return h===!1&&(h=l.apply(s,c)),h||""}}i.renderer=s}if(e.tokenizer){let s=this.defaults.tokenizer||new Vt(this.defaults);for(let n in e.tokenizer){if(!(n in s))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let o=n,a=e.tokenizer[o],l=s[o];s[o]=(...c)=>{let h=a.apply(s,c);return h===!1&&(h=l.apply(s,c)),h}}i.tokenizer=s}if(e.hooks){let s=this.defaults.hooks||new Ct;for(let n in e.hooks){if(!(n in s))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let o=n,a=e.hooks[o],l=s[o];Ct.passThroughHooks.has(n)?s[o]=c=>{if(this.defaults.async&&Ct.passThroughHooksRespectAsync.has(n))return(async()=>{let u=await a.call(s,c);return l.call(s,u)})();let h=a.call(s,c);return l.call(s,h)}:s[o]=(...c)=>{if(this.defaults.async)return(async()=>{let u=await a.apply(s,c);return u===!1&&(u=await l.apply(s,c)),u})();let h=a.apply(s,c);return h===!1&&(h=l.apply(s,c)),h}}i.hooks=s}if(e.walkTokens){let s=this.defaults.walkTokens,n=e.walkTokens;i.walkTokens=function(o){let a=[];return a.push(n.call(this,o)),s&&(a=a.concat(s.call(this,o))),a}}this.defaults={...this.defaults,...i}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,t){return $.lex(r,t??this.defaults)}parser(r,t){return z.parse(r,t??this.defaults)}parseMarkdown(r){return(t,e)=>{let i={...e},s={...this.defaults,...i},n=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return n(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return n(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return n(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=r),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(t):t,a=await(s.hooks?await s.hooks.provideLexer(r):r?$.lex:$.lexInline)(o,s),l=s.hooks?await s.hooks.processAllTokens(a):a;s.walkTokens&&await Promise.all(this.walkTokens(l,s.walkTokens));let c=await(s.hooks?await s.hooks.provideParser(r):r?z.parse:z.parseInline)(l,s);return s.hooks?await s.hooks.postprocess(c):c})().catch(n);try{s.hooks&&(t=s.hooks.preprocess(t));let o=(s.hooks?s.hooks.provideLexer(r):r?$.lex:$.lexInline)(t,s);s.hooks&&(o=s.hooks.processAllTokens(o)),s.walkTokens&&this.walkTokens(o,s.walkTokens);let a=(s.hooks?s.hooks.provideParser(r):r?z.parse:z.parseInline)(o,s);return s.hooks&&(a=s.hooks.postprocess(a)),a}catch(o){return n(o)}}}onError(r,t){return e=>{if(e.message+=`
1312
1312
  Please report this to https://github.com/markedjs/marked.`,r){let i="<p>An error occurred:</p><pre>"+O(e.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(e);throw e}}},J=new hi;function E(r,t){return J.parse(r,t)}E.options=E.setOptions=function(r){return J.setOptions(r),E.defaults=J.defaults,tr(E.defaults),E};E.getDefaults=ei;E.defaults=Z;E.use=function(...r){return J.use(...r),E.defaults=J.defaults,tr(E.defaults),E};E.walkTokens=function(r,t){return J.walkTokens(r,t)};E.parseInline=J.parseInline;E.Parser=z;E.parser=z.parse;E.Renderer=Wt;E.TextRenderer=ci;E.Lexer=$;E.lexer=$.lex;E.Tokenizer=Vt;E.Hooks=Ct;E.parse=E;var su=E.options,ru=E.setOptions,nu=E.use,ou=E.walkTokens,au=E.parseInline;var lu=z.parse,cu=$.lex;var _a="Failed to load markdown",Na=/^:::[ \t]*(note|info|tip|warning|danger)(?:[ \t]+([^\n]*?))?[ \t]*\n([\s\S]*?)\n?^:::[ \t]*(?:\n+|$)/m,Pa=r=>r.replace(/[&<>"']/g,t=>`&#${t.charCodeAt(0)};`),Ia={name:"vbCallout",level:"block",start(r){return r.match(/^:::[ \t]*(?:note|info|tip|warning|danger)\b/m)?.index},tokenizer(r){let t=Na.exec(r);if(!t||t.index!==0)return;let e=t[1],i=(t[2]||"").trim()||e[0].toUpperCase()+e.slice(1),s={type:"vbCallout",raw:t[0],kind:e,title:i,tokens:[]};return this.lexer.blockTokens(t[3],s.tokens),s},renderer(r){return`<aside data-callout="${r.kind}" role="note"><p data-callout-title><strong>${Pa(r.title)}</strong></p>${this.parser.parse(r.tokens)}</aside>
1313
- `}},$a=new hi({gfm:!0,extensions:[Ia]}),ui=class extends b{#t=null;#e=null;#i=null;#s=null;#r=null;#n=null;#a=0;static get observedAttributes(){return["src","sanitize","allow-cross-origin"]}setup(){this.#o()}teardown(){this.#e?.abort(),this.removeAttribute("data-rendered"),this.removeAttribute("data-loading")}attributeChangedCallback(t,e,i){e===i||!this.isConnected||!this.hasAttribute("data-upgraded")||this.#o()}get parser(){return this.#t}set parser(t){this.#t=typeof t=="function"?t:null}get markdown(){return this.#r??this.#n??""}set markdown(t){let e=t==null?null:String(t);this.#r!==e&&(this.#r=e,this.#o())}async render(){await this.#o()}async reload(){this.getAttribute("src")&&await this.#o()}#c(){let t=this.querySelector('script[type="text/markdown"]');if(t)return t.textContent;let e=this.querySelector("template[data-md]");if(e)return e.content.textContent;let i=this.querySelector(":scope > pre");return i?i.textContent:null}#h(t){let e;try{e=new URL(t,document.baseURI)}catch{throw new Error(`Invalid URL: ${t}`)}if(e.protocol!=="http:"&&e.protocol!=="https:")throw new Error(`Refused ${e.protocol} URL: only http(s) is allowed`);return this.#l(e.href),e.href}#l(t){if(!this.hasAttribute("allow-cross-origin")&&new URL(t).origin!==location.origin)throw new Error(`Refused cross-origin URL ${t} (add allow-cross-origin to permit)`)}async#o(){let t=++this.#a,e=this.getAttribute("src"),i;if(this.#e?.abort(),this.#e=null,this.removeAttribute("data-rendered"),this.removeAttribute("data-error"),this.removeAttribute("data-loading"),this.#s?.remove(),this.#s=null,e){let o=new AbortController;this.#e=o,this.setAttribute("data-loading",""),this.#k("markdown-viewer:fetch",{src:e});try{let a=this.#h(e),l=await fetch(a,{signal:o.signal});if(l.url&&this.#l(l.url),!l.ok)throw new Error(`HTTP ${l.status}: ${l.statusText}`);i=await l.text()}catch(a){if(a.name==="AbortError"||t!==this.#a)return;this.#u(a);return}if(t!==this.#a)return;this.removeAttribute("data-loading")}else this.#r!=null?i=this.#r:i=this.#c();if(i==null){this.#i?.replaceChildren();return}this.#n=i;let s;try{s=await(await this.#p())(i)}catch(o){if(t!==this.#a)return;this.#u(o);return}if(t!==this.#a)return;(!this.#i||this.#i.parentNode!==this)&&(this.#i=document.createElement("div"),this.#i.className="md-content",this.#i.setAttribute("part","content"),this.appendChild(this.#i)),this.hasAttribute("dir")?this.#i.removeAttribute("dir"):this.#i.setAttribute("dir","auto"),this.#d()?this.#i.replaceChildren(Ft(String(s??""))):this.#i.innerHTML=String(s??""),this.#f(),this.setAttribute("data-rendered","");let n=this.getAttribute("ping");if(n&&navigator.sendBeacon?.(n,JSON.stringify({src:e||"inline"})),this.#k("markdown-viewer:rendered",{src:e,node:this.#i}),this.hasAttribute("highlight"))for(let o of this.#i.querySelectorAll('pre > code[class*="language-"]')){let a=o.className.match(/language-(\S+)/)?.[1]||"";this.#k("markdown-viewer:highlight",{node:o,language:a})}}#u(t){if(this.removeAttribute("data-loading"),this.setAttribute("data-error",""),this.#i?.replaceChildren(),!this.querySelector(":scope > pre")){let e=document.createElement("p");e.setAttribute("role","alert"),e.setAttribute("data-md-error",""),e.textContent=this.getAttribute("data-label-error")||_a,this.append(e),this.#s=e}this.#k("markdown-viewer:error",{error:t.message})}async#p(){return this.#t?this.#t:t=>$a.parse(t)}#d(){let t=this.getAttribute("sanitize");return t==null?!0:!/^(off|false)$/i.test(t.trim())}#f(){if(!this.#i)return;let t=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;t&&(this.#i.dataset.theme=t)}#k(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}};g("markdown-viewer",ui);var hr={source:"Markdown source",preview:"Rendered preview",tabHint:"Tab inserts spaces. Press Escape, then Tab, to move focus."},za=0,di=class extends b{#t=null;#e=null;#i=null;#s=null;#r=null;#n="";#a=null;#c=null;#h=!1;#l={placeholder:null,rows:null};static get observedAttributes(){return["placeholder","rows","highlight","data-label-source","data-label-preview"]}setup(){this.#o()||this.#u(),this.#w(),this.#v()}teardown(){this.#c!==null&&clearTimeout(this.#c),this.#c=null,this.#h=!1,this.removeAttribute("data-editing")}attributeChangedCallback(t,e,i){!this.#t||e===i||(t==="placeholder"?this.#k(this.#t,"placeholder",i??this.#l.placeholder):t==="rows"?this.#p():t==="highlight"?this.#e?.toggleAttribute("highlight",i!=null):this.#d())}get value(){return this.#t?.value??this.#a??""}set value(t){let e=t==null?"":String(t);if(!this.#t){this.#a=e;return}this.#t.value!==e&&(this.#t.value=e,this.#n=e,this.#v(),this.#y("markdown-editor:change",{value:e,source:"api"}))}get textarea(){return this.#t}#o(){return!!(this.#t&&this.#i?.parentNode===this&&this.#s?.parentNode===this&&this.#i.contains(this.#t))}#u(){let t=this.#t&&this.contains(this.#t)?this.#t:this.querySelector("textarea"),e=[...this.childNodes];t||(t=document.createElement("textarea"),e.push(t)),this.#t=t,this.#l={placeholder:t.getAttribute("placeholder"),rows:t.getAttribute("rows")},this.hasAttribute("placeholder")&&(t.placeholder=this.getAttribute("placeholder")??""),this.#p(),t.hasAttribute("dir")||(t.dir="auto"),t.hasAttribute("spellcheck")||(t.spellcheck=!0),this.#i=document.createElement("section"),this.#i.className="md-editor-pane",this.#i.append(...e),this.#s=document.createElement("section"),this.#s.className="md-preview-pane",this.#e=document.createElement("markdown-viewer");let i=t.getAttribute("dir");i&&i!=="auto"&&(this.#s.dir=i),this.#e.dir=i||"auto",this.hasAttribute("highlight")&&this.#e.setAttribute("highlight","");let s=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;if(s&&(this.#e.dataset.theme=s),this.#s.append(this.#e),this.hasAttribute("data-tab-indent")){this.#r=document.createElement("span"),this.#r.className="visually-hidden",this.#r.id=`md-editor-tab-hint-${++za}`,this.#r.textContent=this.dataset.labelTabHint||hr.tabHint,this.#i.append(this.#r);let n=t.getAttribute("aria-describedby");t.setAttribute("aria-describedby",n?`${n} ${this.#r.id}`:this.#r.id)}this.replaceChildren(this.#i,this.#s),this.#d(),!t.hasAttribute("aria-label")&&!t.hasAttribute("aria-labelledby")&&!t.labels?.length&&!t.title&&t.setAttribute("aria-label",this.#f("source")),this.#a!=null&&(t.value=this.#a,this.#a=null),this.#n=t.value}#p(){if(!this.#t)return;let t=this.getAttribute("rows")??this.#l.rows;this.#t.rows=parseInt(t??"",10)||10}#d(){this.#i?.setAttribute("aria-label",this.#f("source")),this.#s?.setAttribute("aria-label",this.#f("preview"))}#f(t){return(t==="source"?this.dataset.labelSource:this.dataset.labelPreview)||hr[t]}#k(t,e,i){i==null?t.removeAttribute(e):t.setAttribute(e,i)}#w(){let t=this.#t;t&&(this.listen(t,"input",()=>{this.#y("markdown-editor:input",{value:t.value}),this.#m()}),this.listen(t,"focus",()=>{this.setAttribute("data-editing","")}),this.listen(t,"blur",()=>{this.removeAttribute("data-editing"),this.#h=!1,t.value!==this.#n&&(this.#n=t.value,this.#y("markdown-editor:change",{value:t.value,source:"user"}))}),this.listen(this.getRootNode(),"reset",e=>{!t.form||e.target!==t.form||queueMicrotask(()=>{this.#n=t.value,this.#v()})},{capture:!0}),this.hasAttribute("data-tab-indent")&&this.listen(t,"keydown",e=>{let i=e;if(i.key==="Escape"){this.#h=!0;return}if(i.key!=="Tab"||i.shiftKey||i.ctrlKey||i.metaKey||i.altKey){["Shift","Control","Alt","Meta"].includes(i.key)||(this.#h=!1);return}if(this.#h||t.readOnly||t.disabled){this.#h=!1;return}if(i.preventDefault(),!document.execCommand("insertText",!1," ")){let{selectionStart:s,selectionEnd:n}=t;t.setRangeText(" ",s,n,"end"),t.dispatchEvent(new Event("input",{bubbles:!0}))}}))}#m(){this.#c!==null&&clearTimeout(this.#c),this.#c=setTimeout(()=>this.#v(),150)}#v(){this.#c!==null&&clearTimeout(this.#c),this.#c=null,this.#e&&(this.#e.markdown=this.#t?.value??"")}#y(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}};g("markdown-editor",di);var Ba=0,ja="button, a[href], input, select, textarea, [tabindex]",Oa='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]), select, textarea, [contenteditable]',pi=class extends b{static get observedAttributes(){return["data-orientation","data-position"]}#t=null;#e=null;#i=null;#s=!1;#r=null;#n=!1;#a=0;#c=null;setup(){this.hasAttribute("role")||this.setAttribute("role","toolbar"),this.getAttribute("aria-label")||this.setAttribute("aria-label","Page tools"),this.#h(),this.#w();let t=this.dataset.breakpoint||"48rem";this.#i=matchMedia(`(max-width: ${t})`),this.#m(this.#i),this.listen(this.#i,"change",e=>this.#m(e)),this.listen(this,"keydown",this.#k),this.listen(this,"focusin",this.#f),this.#r=new MutationObserver(e=>{for(let i of e)i.type==="childList"&&i.target===this&&this.#s&&this.#g();this.#p()}),this.#r.observe(this,{childList:!0,subtree:!0}),this.#p()}teardown(){this.#r?.disconnect(),this.#r=null,cancelAnimationFrame(this.#a),this.#a=0,this.#s&&this.#y(),this.#t?.remove(),this.#e?.remove(),this.#t=null,this.#e=null,this.#c=null}attributeChangedCallback(t,e,i){e===i||!this.hasAttribute("data-upgraded")||this.#h()}get tools(){let t=this.#s&&this.#e?this.#e:this;return Array.from(t.children).filter(e=>!e.hasAttribute("data-page-tools-internal"))}#h(){let t=this.dataset.orientation||"auto",e=this.dataset.position||"sticky",i=t==="horizontal"||t==="vertical"?t:e==="inline"?"horizontal":"vertical";this.setAttribute("data-resolved-orientation",i),this.#o()}#l(){return this.#s?"vertical":this.dataset.resolvedOrientation||"vertical"}#o(){this.setAttribute("aria-orientation",this.#l())}#u(){return Array.from(this.querySelectorAll(ja)).filter(t=>!t.closest("[data-page-tools-internal]:not(.page-tools-popover)")&&!t.matches(":disabled")&&!t.closest("[inert]")&&t.checkVisibility())}#p(){this.#a||(this.#a=requestAnimationFrame(()=>{this.#a=0,this.#d()}))}#d(t=null){let e=this.#u();if(!e.length)return;let i=[t,this.#c].find(s=>s&&e.includes(s))||e[0];this.#c=i;for(let s of e)s.tabIndex=s===i?0:-1}#f=t=>{let e=t.target;e!==this.#t&&this.#u().includes(e)&&this.#d(e)};#k=t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;let e=t.target;if(e===this.#t||e.matches(Oa))return;let i=this.#u(),s=i.indexOf(e);if(s===-1)return;let n=this.#l()==="horizontal",o=getComputedStyle(this).direction==="rtl",a=n?o?"ArrowRight":"ArrowLeft":"ArrowUp",l=n?o?"ArrowLeft":"ArrowRight":"ArrowDown",c=-1;t.key===l?c=(s+1)%i.length:t.key===a?c=(s-1+i.length)%i.length:t.key==="Home"?c=0:t.key==="End"&&(c=i.length-1),c!==-1&&(t.preventDefault(),this.#d(i[c]),i[c].focus())};#w(){let t=`pt-${++Ba}`,e=this.dataset.fabIcon||"ellipsis-vertical",i=this.dataset.fabLabel||"Page tools";this.#t=document.createElement("button"),this.#t.type="button",this.#t.className="page-tools-fab",this.#t.setAttribute("data-page-tools-internal",""),this.#t.setAttribute("popovertarget",t),this.#t.setAttribute("aria-label",i),this.#t.hidden=!0;let s=document.createElement("icon-wc");s.setAttribute("name",e),s.setAttribute("size","md"),s.setAttribute("aria-hidden","true"),this.#t.appendChild(s),this.#e=document.createElement("section"),this.#e.className="page-tools-popover",this.#e.setAttribute("data-page-tools-internal",""),this.#e.id=t,this.#e.setAttribute("popover",""),this.#e.setAttribute("aria-label",i),this.appendChild(this.#t),this.appendChild(this.#e),this.listen(this.#e,"beforetoggle",n=>{n.newState==="closed"&&(this.#n=!!this.#e?.contains(document.activeElement))}),this.listen(this.#e,"toggle",n=>{if(n.newState==="open"){this.#d();return}let a=this.#n&&this.#s;if(this.#n=!1,!a)return;let l=document.activeElement;(!l||l===document.body||this.#e?.contains(l))&&this.#t?.focus()})}#m(t){t.matches??t?this.#v():this.#y()}#v(){if(this.#s||!this.#t||!this.#e)return;let t=this.tools;for(let e of t)this.#e.appendChild(e);this.#s=!0,this.#t.hidden=!1,this.setAttribute("data-collapsed",""),this.#o()}#y(){if(!this.#s||!this.#t||!this.#e)return;this.#s=!1,this.#e.matches(":popover-open")&&this.#e.hidePopover?.();let t=Array.from(this.#e.children);for(let e of t)this.insertBefore(e,this.#t);this.#t.hidden=!0,this.removeAttribute("data-collapsed"),this.#o(),this.#p()}#g(){if(!this.#e)return;let t=Array.from(this.children).filter(e=>!e.hasAttribute("data-page-tools-internal"));for(let e of t)this.#e.appendChild(e)}};g("page-tools",pi);var fi=class extends b{#t;#e;#i=null;setup(){this.#i===null&&(this.#i=this.getAttribute("label")||this.textContent.trim()||"Print this page");let t=this.#i,e=this.hasAttribute("raw-toggle");this.innerHTML="",e&&(this.setAttribute("role","group"),!this.hasAttribute("aria-label")&&!this.hasAttribute("aria-labelledby")&&this.setAttribute("aria-label",t));let i=this.getAttribute("variant")||"icon";this.#t=document.createElement("button"),this.#t.type="button",this.#t.className="print-trigger",this.#t.setAttribute("aria-label",t);let s=i!=="label",n=i!=="icon";if(s){let o=document.createElement("icon-wc");o.setAttribute("name","printer"),o.setAttribute("size","sm"),o.setAttribute("aria-hidden","true"),this.#t.appendChild(o)}if(n){let o=document.createElement("span");o.textContent=t,this.#t.appendChild(o)}if(this.listen(this.#t,"click",this.#s),this.append(this.#t),e){let o=document.createElement("label");this.#e=document.createElement("input"),this.#e.type="checkbox";let a=document.createElement("span");a.textContent=this.dataset.labelRaw||"Print without VB styles",o.append(this.#e,a),this.append(o)}}teardown(){this.#t=null,this.#e=null}#s=()=>{if(this.#e?.checked){document.documentElement.setAttribute("data-print-raw","");let e,i=()=>{document.documentElement.removeAttribute("data-print-raw"),window.removeEventListener("afterprint",i),clearTimeout(e)};window.addEventListener("afterprint",i,{once:!0}),e=setTimeout(i,5e3)}window.print()}};g("print-page",fi);var mi=new Map([["x",{label:"X",iconName:"twitter",buildUrl:({url:r,title:t})=>`https://x.com/intent/post?url=${N(r)}&text=${N(t)}`}],["twitter",{label:"X",iconName:"twitter",buildUrl:({url:r,title:t})=>`https://x.com/intent/post?url=${N(r)}&text=${N(t)}`}],["facebook",{label:"Facebook",iconName:"facebook",buildUrl:({url:r})=>`https://www.facebook.com/sharer/sharer.php?u=${N(r)}`}],["linkedin",{label:"LinkedIn",iconName:"linkedin",buildUrl:({url:r})=>`https://www.linkedin.com/sharing/share-offsite/?url=${N(r)}`}],["whatsapp",{label:"WhatsApp",iconName:"whatsapp",iconSet:"custom",buildUrl:({url:r,title:t})=>`https://wa.me/?text=${N(`${t} ${r}`)}`}],["telegram",{label:"Telegram",iconName:"telegram",iconSet:"custom",buildUrl:({url:r,title:t})=>`https://t.me/share/url?url=${N(r)}&text=${N(t)}`}],["bluesky",{label:"Bluesky",iconName:"bluesky",iconSet:"custom",buildUrl:({url:r,title:t})=>`https://bsky.app/intent/compose?text=${N(`${t} ${r}`)}`}],["mastodon",{label:"Mastodon",iconName:"mastodon",iconSet:"custom",buildUrl:({url:r,title:t},e="mastodon.social")=>`https://${e}/share?text=${N(`${t} ${r}`)}`}],["email",{label:"Email",iconName:"mail",buildUrl:({url:r,title:t,text:e})=>`mailto:?subject=${N(t)}&body=${N(`${e}
1313
+ `}},$a=new hi({gfm:!0,extensions:[Ia]}),ui=class extends b{#t=null;#e=null;#i=null;#s=null;#r=null;#n=null;#a=0;static get observedAttributes(){return["src","sanitize","allow-cross-origin"]}setup(){this.#o()}teardown(){this.#e?.abort(),this.removeAttribute("data-rendered"),this.removeAttribute("data-loading")}attributeChangedCallback(t,e,i){e===i||!this.isConnected||!this.hasAttribute("data-upgraded")||this.#o()}get parser(){return this.#t}set parser(t){this.#t=typeof t=="function"?t:null}get markdown(){return this.#r??this.#n??""}set markdown(t){let e=t==null?null:String(t);this.#r!==e&&(this.#r=e,this.#o())}async render(){await this.#o()}async reload(){this.getAttribute("src")&&await this.#o()}#c(){let t=this.querySelector('script[type="text/markdown"]');if(t)return t.textContent;let e=this.querySelector("template[data-md]");if(e)return e.content.textContent;let i=this.querySelector(":scope > pre");return i?i.textContent:null}#h(t){let e;try{e=new URL(t,document.baseURI)}catch{throw new Error(`Invalid URL: ${t}`)}if(e.protocol!=="http:"&&e.protocol!=="https:")throw new Error(`Refused ${e.protocol} URL: only http(s) is allowed`);return this.#l(e.href),e.href}#l(t){if(!this.hasAttribute("allow-cross-origin")&&new URL(t).origin!==location.origin)throw new Error(`Refused cross-origin URL ${t} (add allow-cross-origin to permit)`)}async#o(){let t=++this.#a,e=this.getAttribute("src"),i;if(this.#e?.abort(),this.#e=null,this.removeAttribute("data-rendered"),this.removeAttribute("data-error"),this.removeAttribute("data-loading"),this.#s?.remove(),this.#s=null,e){let o=new AbortController;this.#e=o,this.setAttribute("data-loading",""),this.#k("markdown-viewer:fetch",{src:e});try{let a=this.#h(e),l=await fetch(a,{signal:o.signal});if(l.url&&this.#l(l.url),!l.ok)throw new Error(`HTTP ${l.status}: ${l.statusText}`);i=await l.text()}catch(a){if(a.name==="AbortError"||t!==this.#a)return;this.#u(a);return}if(t!==this.#a)return;this.removeAttribute("data-loading")}else this.#r!=null?i=this.#r:i=this.#c();if(i==null){this.#i?.replaceChildren();return}this.#n=i;let s;try{s=await(await this.#p())(i)}catch(o){if(t!==this.#a)return;this.#u(o);return}if(t!==this.#a)return;(!this.#i||this.#i.parentNode!==this)&&(this.#i=document.createElement("div"),this.#i.className="md-content",this.#i.setAttribute("part","content"),this.appendChild(this.#i)),this.hasAttribute("dir")?this.#i.removeAttribute("dir"):this.#i.setAttribute("dir","auto"),this.#d()?this.#i.replaceChildren(Ft(String(s??""))):this.#i.innerHTML=String(s??""),this.#f(),this.setAttribute("data-rendered","");let n=this.getAttribute("ping");if(n&&navigator.sendBeacon?.(n,JSON.stringify({src:e||"inline"})),this.#k("markdown-viewer:rendered",{src:e,node:this.#i}),this.hasAttribute("highlight"))for(let o of this.#i.querySelectorAll('pre > code[class*="language-"]')){let a=o.className.match(/language-(\S+)/)?.[1]||"";this.#k("markdown-viewer:highlight",{node:o,language:a})}}#u(t){if(this.removeAttribute("data-loading"),this.setAttribute("data-error",""),this.#i?.replaceChildren(),!this.querySelector(":scope > pre")){let e=document.createElement("p");e.setAttribute("role","alert"),e.setAttribute("data-md-error",""),e.textContent=this.getAttribute("data-label-error")||_a,this.append(e),this.#s=e}this.#k("markdown-viewer:error",{error:t.message})}async#p(){return this.#t?this.#t:t=>$a.parse(t)}#d(){let t=this.getAttribute("sanitize");return t==null?!0:!/^(off|false)$/i.test(t.trim())}#f(){if(!this.#i)return;let t=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;t&&(this.#i.dataset.theme=t)}#k(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}};g("markdown-viewer",ui);var hr={source:"Markdown source",preview:"Rendered preview",tabHint:"Tab inserts spaces. Press Escape, then Tab, to move focus."},za=0,di=class extends b{#t=null;#e=null;#i=null;#s=null;#r=null;#n="";#a=null;#c=null;#h=!1;#l={placeholder:null,rows:null};static get observedAttributes(){return["placeholder","rows","highlight","data-label-source","data-label-preview"]}setup(){this.#o()||this.#u(),this.#y(),this.#v()}teardown(){this.#c!==null&&clearTimeout(this.#c),this.#c=null,this.#h=!1,this.removeAttribute("data-editing")}attributeChangedCallback(t,e,i){!this.#t||e===i||(t==="placeholder"?this.#k(this.#t,"placeholder",i??this.#l.placeholder):t==="rows"?this.#p():t==="highlight"?this.#e?.toggleAttribute("highlight",i!=null):this.#d())}get value(){return this.#t?.value??this.#a??""}set value(t){let e=t==null?"":String(t);if(!this.#t){this.#a=e;return}this.#t.value!==e&&(this.#t.value=e,this.#n=e,this.#v(),this.#w("markdown-editor:change",{value:e,source:"api"}))}get textarea(){return this.#t}#o(){return!!(this.#t&&this.#i?.parentNode===this&&this.#s?.parentNode===this&&this.#i.contains(this.#t))}#u(){let t=this.#t&&this.contains(this.#t)?this.#t:this.querySelector("textarea"),e=[...this.childNodes];t||(t=document.createElement("textarea"),e.push(t)),this.#t=t,this.#l={placeholder:t.getAttribute("placeholder"),rows:t.getAttribute("rows")},this.hasAttribute("placeholder")&&(t.placeholder=this.getAttribute("placeholder")??""),this.#p(),t.hasAttribute("dir")||(t.dir="auto"),t.hasAttribute("spellcheck")||(t.spellcheck=!0),this.#i=document.createElement("section"),this.#i.className="md-editor-pane",this.#i.append(...e),this.#s=document.createElement("section"),this.#s.className="md-preview-pane",this.#e=document.createElement("markdown-viewer");let i=t.getAttribute("dir");i&&i!=="auto"&&(this.#s.dir=i),this.#e.dir=i||"auto",this.hasAttribute("highlight")&&this.#e.setAttribute("highlight","");let s=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;if(s&&(this.#e.dataset.theme=s),this.#s.append(this.#e),this.hasAttribute("data-tab-indent")){this.#r=document.createElement("span"),this.#r.className="visually-hidden",this.#r.id=`md-editor-tab-hint-${++za}`,this.#r.textContent=this.dataset.labelTabHint||hr.tabHint,this.#i.append(this.#r);let n=t.getAttribute("aria-describedby");t.setAttribute("aria-describedby",n?`${n} ${this.#r.id}`:this.#r.id)}this.replaceChildren(this.#i,this.#s),this.#d(),!t.hasAttribute("aria-label")&&!t.hasAttribute("aria-labelledby")&&!t.labels?.length&&!t.title&&t.setAttribute("aria-label",this.#f("source")),this.#a!=null&&(t.value=this.#a,this.#a=null),this.#n=t.value}#p(){if(!this.#t)return;let t=this.getAttribute("rows")??this.#l.rows;this.#t.rows=parseInt(t??"",10)||10}#d(){this.#i?.setAttribute("aria-label",this.#f("source")),this.#s?.setAttribute("aria-label",this.#f("preview"))}#f(t){return(t==="source"?this.dataset.labelSource:this.dataset.labelPreview)||hr[t]}#k(t,e,i){i==null?t.removeAttribute(e):t.setAttribute(e,i)}#y(){let t=this.#t;t&&(this.listen(t,"input",()=>{this.#w("markdown-editor:input",{value:t.value}),this.#m()}),this.listen(t,"focus",()=>{this.setAttribute("data-editing","")}),this.listen(t,"blur",()=>{this.removeAttribute("data-editing"),this.#h=!1,t.value!==this.#n&&(this.#n=t.value,this.#w("markdown-editor:change",{value:t.value,source:"user"}))}),this.listen(this.getRootNode(),"reset",e=>{!t.form||e.target!==t.form||queueMicrotask(()=>{this.#n=t.value,this.#v()})},{capture:!0}),this.hasAttribute("data-tab-indent")&&this.listen(t,"keydown",e=>{let i=e;if(i.key==="Escape"){this.#h=!0;return}if(i.key!=="Tab"||i.shiftKey||i.ctrlKey||i.metaKey||i.altKey){["Shift","Control","Alt","Meta"].includes(i.key)||(this.#h=!1);return}if(this.#h||t.readOnly||t.disabled){this.#h=!1;return}if(i.preventDefault(),!document.execCommand("insertText",!1," ")){let{selectionStart:s,selectionEnd:n}=t;t.setRangeText(" ",s,n,"end"),t.dispatchEvent(new Event("input",{bubbles:!0}))}}))}#m(){this.#c!==null&&clearTimeout(this.#c),this.#c=setTimeout(()=>this.#v(),150)}#v(){this.#c!==null&&clearTimeout(this.#c),this.#c=null,this.#e&&(this.#e.markdown=this.#t?.value??"")}#w(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}};g("markdown-editor",di);var Ba=0,ja="button, a[href], input, select, textarea, [tabindex]",Oa='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]), select, textarea, [contenteditable]',pi=class extends b{static get observedAttributes(){return["data-orientation","data-position"]}#t=null;#e=null;#i=null;#s=!1;#r=null;#n=!1;#a=0;#c=null;setup(){this.hasAttribute("role")||this.setAttribute("role","toolbar"),this.getAttribute("aria-label")||this.setAttribute("aria-label","Page tools"),this.#h(),this.#y();let t=this.dataset.breakpoint||"48rem";this.#i=matchMedia(`(max-width: ${t})`),this.#v(this.#i),this.listen(this.#i,"change",e=>this.#v(e)),this.listen(this,"keydown",this.#k),this.listen(this,"focusin",this.#f),this.#r=new MutationObserver(e=>{for(let i of e)i.type==="childList"&&i.target===this&&this.#s&&this.#b();this.#p()}),this.#r.observe(this,{childList:!0,subtree:!0}),this.#p()}teardown(){this.#r?.disconnect(),this.#r=null,cancelAnimationFrame(this.#a),this.#a=0,this.#s&&this.#g(),this.#t?.remove(),this.#e?.remove(),this.#t=null,this.#e=null,this.#c=null}attributeChangedCallback(t,e,i){e===i||!this.hasAttribute("data-upgraded")||this.#h()}get tools(){let t=this.#s&&this.#e?this.#e:this;return Array.from(t.children).filter(e=>!e.hasAttribute("data-page-tools-internal"))}#h(){let t=this.dataset.orientation||"auto",e=this.dataset.position||"sticky",i=t==="horizontal"||t==="vertical"?t:e==="inline"?"horizontal":"vertical";this.setAttribute("data-resolved-orientation",i),this.#o()}#l(){return this.#s?"vertical":this.dataset.resolvedOrientation||"vertical"}#o(){this.setAttribute("aria-orientation",this.#l())}#u(){return Array.from(this.querySelectorAll(ja)).filter(t=>!t.closest("[data-page-tools-internal]:not(.page-tools-popover)")&&!t.matches(":disabled")&&!t.closest("[inert]")&&t.checkVisibility())}#p(){this.#a||(this.#a=requestAnimationFrame(()=>{this.#a=0,this.#d()}))}#d(t=null){let e=this.#u();if(!e.length)return;let i=[t,this.#c].find(s=>s&&e.includes(s))||e[0];this.#c=i;for(let s of e)s.tabIndex=s===i?0:-1}#f=t=>{let e=t.target;e!==this.#t&&this.#u().includes(e)&&this.#d(e)};#k=t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;let e=t.target;if(e===this.#t||e.matches(Oa))return;let i=this.#u(),s=i.indexOf(e);if(s===-1)return;let n=this.#l()==="horizontal",o=getComputedStyle(this).direction==="rtl",a=n?o?"ArrowRight":"ArrowLeft":"ArrowUp",l=n?o?"ArrowLeft":"ArrowRight":"ArrowDown",c=-1;t.key===l?c=(s+1)%i.length:t.key===a?c=(s-1+i.length)%i.length:t.key==="Home"?c=0:t.key==="End"&&(c=i.length-1),c!==-1&&(t.preventDefault(),this.#d(i[c]),i[c].focus())};#y(){let t=`pt-${++Ba}`,e=this.dataset.fabIcon||"ellipsis-vertical",i=this.dataset.fabLabel||"Page tools";this.#t=document.createElement("button"),this.#t.type="button",this.#t.className="page-tools-fab",this.#t.setAttribute("data-page-tools-internal",""),this.#t.setAttribute("popovertarget",t),this.#t.setAttribute("aria-label",i),this.#t.hidden=!0;let s=document.createElement("icon-wc");s.setAttribute("name",e),s.setAttribute("size","md"),s.setAttribute("aria-hidden","true"),this.#t.appendChild(s),this.#e=document.createElement("section"),this.#e.className="page-tools-popover",this.#e.setAttribute("data-page-tools-internal",""),this.#e.id=t,this.#e.setAttribute("popover",""),this.#e.setAttribute("aria-label",i),this.appendChild(this.#t),this.appendChild(this.#e),this.listen(this.#e,"beforetoggle",n=>{n.newState==="closed"?this.#n=!!this.#e?.contains(document.activeElement):this.#m()}),this.listen(this.#e,"toggle",n=>{if(n.newState==="open"){this.#d();return}let a=this.#n&&this.#s;if(this.#n=!1,!a)return;let l=document.activeElement;(!l||l===document.body||this.#e?.contains(l))&&this.#t?.focus()})}#m(){if(!this.#t||!this.#e)return;if(this.#t.parentElement===this){this.#e.style.removeProperty("--_fab-top"),this.#e.style.removeProperty("--_fab-end");return}let t=this.#t.getBoundingClientRect(),i=getComputedStyle(this.#t).direction==="rtl"?t.left:document.documentElement.clientWidth-t.right;this.#e.style.setProperty("--_fab-top",`${Math.round(window.innerHeight-t.top+8)}px`),this.#e.style.setProperty("--_fab-end",`${Math.max(8,Math.round(i))}px`)}#v(t){t.matches??t?this.#w():this.#g()}#w(){if(this.#s||!this.#t||!this.#e)return;let t=this.tools;for(let e of t)this.#e.appendChild(e);this.#s=!0,this.#t.hidden=!1,document.querySelector("fab-stack")?.append(this.#t),this.setAttribute("data-collapsed",""),this.#o()}#g(){if(!this.#s||!this.#t||!this.#e)return;this.#s=!1,this.#e.matches(":popover-open")&&this.#e.hidePopover?.(),this.#t.parentElement!==this&&this.insertBefore(this.#t,this.#e);let t=Array.from(this.#e.children);for(let e of t)this.insertBefore(e,this.#t);this.#t.hidden=!0,this.removeAttribute("data-collapsed"),this.#o(),this.#p()}#b(){if(!this.#e)return;let t=Array.from(this.children).filter(e=>!e.hasAttribute("data-page-tools-internal"));for(let e of t)this.#e.appendChild(e)}};g("page-tools",pi);var fi=class extends b{#t;#e;#i=null;setup(){this.#i===null&&(this.#i=this.getAttribute("label")||this.textContent.trim()||"Print this page");let t=this.#i,e=this.hasAttribute("raw-toggle");this.innerHTML="",e&&(this.setAttribute("role","group"),!this.hasAttribute("aria-label")&&!this.hasAttribute("aria-labelledby")&&this.setAttribute("aria-label",t));let i=this.getAttribute("variant")||"icon";this.#t=document.createElement("button"),this.#t.type="button",this.#t.className="print-trigger",this.#t.setAttribute("aria-label",t);let s=i!=="label",n=i!=="icon";if(s){let o=document.createElement("icon-wc");o.setAttribute("name","printer"),o.setAttribute("size","sm"),o.setAttribute("aria-hidden","true"),this.#t.appendChild(o)}if(n){let o=document.createElement("span");o.textContent=t,this.#t.appendChild(o)}if(this.listen(this.#t,"click",this.#s),this.append(this.#t),e){let o=document.createElement("label");this.#e=document.createElement("input"),this.#e.type="checkbox";let a=document.createElement("span");a.textContent=this.dataset.labelRaw||"Print without VB styles",o.append(this.#e,a),this.append(o)}}teardown(){this.#t=null,this.#e=null}#s=()=>{if(this.#e?.checked){document.documentElement.setAttribute("data-print-raw","");let e,i=()=>{document.documentElement.removeAttribute("data-print-raw"),window.removeEventListener("afterprint",i),clearTimeout(e)};window.addEventListener("afterprint",i,{once:!0}),e=setTimeout(i,5e3)}window.print()}};g("print-page",fi);var mi=new Map([["x",{label:"X",iconName:"twitter",buildUrl:({url:r,title:t})=>`https://x.com/intent/post?url=${N(r)}&text=${N(t)}`}],["twitter",{label:"X",iconName:"twitter",buildUrl:({url:r,title:t})=>`https://x.com/intent/post?url=${N(r)}&text=${N(t)}`}],["facebook",{label:"Facebook",iconName:"facebook",buildUrl:({url:r})=>`https://www.facebook.com/sharer/sharer.php?u=${N(r)}`}],["linkedin",{label:"LinkedIn",iconName:"linkedin",buildUrl:({url:r})=>`https://www.linkedin.com/sharing/share-offsite/?url=${N(r)}`}],["whatsapp",{label:"WhatsApp",iconName:"whatsapp",iconSet:"custom",buildUrl:({url:r,title:t})=>`https://wa.me/?text=${N(`${t} ${r}`)}`}],["telegram",{label:"Telegram",iconName:"telegram",iconSet:"custom",buildUrl:({url:r,title:t})=>`https://t.me/share/url?url=${N(r)}&text=${N(t)}`}],["bluesky",{label:"Bluesky",iconName:"bluesky",iconSet:"custom",buildUrl:({url:r,title:t})=>`https://bsky.app/intent/compose?text=${N(`${t} ${r}`)}`}],["mastodon",{label:"Mastodon",iconName:"mastodon",iconSet:"custom",buildUrl:({url:r,title:t},e="mastodon.social")=>`https://${e}/share?text=${N(`${t} ${r}`)}`}],["email",{label:"Email",iconName:"mail",buildUrl:({url:r,title:t,text:e})=>`mailto:?subject=${N(t)}&body=${N(`${e}
1314
1314
 
1315
- ${r}`)}`}],["copy",{label:"Copy link",iconName:"link",buildUrl:()=>""}]]),gi="x,linkedin,bluesky,mastodon,whatsapp,email,copy";function N(r){return encodeURIComponent(r)}var Da={sharePage:"Share this page",shareOn:"Share on {platform}",copy:"Copy link",copied:"Copied!",linkCopied:"Link copied to clipboard",shareSelection:"Share selection",selectionCopied:"Selection copied"},Fa=/\{(url|title|text)\}/;function qa(r,t){let e=n=>encodeURIComponent(n).replace(/-/g,"%2D"),i=t.replace(/\s+/g," ").trim().split(" "),s=i.length>10?`${e(i.slice(0,4).join(" "))},${e(i.slice(-4).join(" "))}`:e(i.join(" "));return`${r.split("#")[0]}#:~:text=${s}`}var bi=class extends b{#t;#e;#i;#s={};#r=new WeakMap;#n="";#a=null;#c=null;#h=!1;get url(){return this.#s.url??this.#t}set url(t){this.#l("url",t)}get shareTitle(){return this.#s.title??this.#e??""}set shareTitle(t){this.#l("title",t)}get text(){return this.#s.text??this.#i}set text(t){this.#l("text",t)}#l(t,e){e==null?delete this.#s[t]:this.#s[t]=String(e),this.hasAttribute("data-upgraded")&&(this.#u(),this.#g())}setup(){if(this.#u(),this.#d(),this.closest("selection-menu")){this.#w(),this.setAttribute("data-tier-resolved","selection");return}this.#n==="native"?this.#m():this.#n==="hidden"?this.style.display="none":this.children.length>0?this.#y():this.#v(),this.setAttribute("data-tier-resolved",this.#n)}teardown(){this.removeAttribute("data-tier-resolved"),this.#n==="hidden"&&this.style.removeProperty("display"),this.#a&&(clearTimeout(this.#a),this.#a=null);for(let t of this.querySelectorAll(".share-label[data-original]"))t.textContent=t.dataset.original??"",delete t.dataset.original;this.#c&&(this.#c.removeEventListener("click",this.#A),this.#h&&this.#c.remove(),this.#c=null,this.#h=!1),this.querySelector(":scope > .share-trigger")?.remove(),this.querySelector(":scope > .share-selection")?.remove()}async share(){return this.#n==="native"?this.#T():this.#x()}#o(t){let e=`data-label-${t.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`)}`;return this.getAttribute(e)||Da[t]}#u(){this.#t=this.#s.url||this.getAttribute("url")||document.querySelector('link[rel~="canonical" i]')?.href||location.href,this.#e=this.#s.title??(this.getAttribute("title")||document.querySelector('meta[property="og:title"]')?.getAttribute("content")||document.title),this.#i=this.#s.text??(this.getAttribute("text")||document.querySelector('meta[name="description"]')?.getAttribute("content")||document.querySelector('meta[property="og:description"]')?.getAttribute("content")||"")}#p(){return{url:this.#t||"",title:this.#e||"",text:this.#i||""}}#d(){let t=this.getAttribute("tier");if(t==="platforms"||t==="native"){t==="native"&&!navigator.share?this.#n="hidden":this.#n=t;return}if((this.getAttribute("platforms")||gi)==="native-only"){this.#n=typeof navigator.share=="function"?"native":"hidden";return}this.#n=typeof navigator.share=="function"?"native":"platforms"}#f(t){let e=document.createElement("span");return e.className="share-label",e.textContent=t,e}#k(t,e){let i=document.createElement("icon-wc");return i.setAttribute("name",t),i.setAttribute("size","sm"),e&&i.setAttribute("set",e),i.setAttribute("aria-hidden","true"),i}#w(){let t=document.createElement("button");t.type="button",t.className="share-selection",t.setAttribute("aria-label",this.#o("shareSelection")),t.appendChild(this.#k("share-2")),t.addEventListener("click",async()=>{let e=this.closest("selection-menu"),s=e?.getSelection?.()?.text||window.getSelection()?.toString().trim()||"";if(!s){e?.dismiss?.();return}let n=qa(this.#t||location.href,s),o=`"${s}" \u2014 ${n}`,a=!1;if(typeof navigator.share=="function")try{await navigator.share({text:o}),a=!0}catch(l){l?.name==="AbortError"&&(a=!0)}a||await kt(o,{announceMessage:this.#o("selectionCopied")}),e?.dismiss?.()}),this.appendChild(t)}#m(){let t=document.createElement("button");t.type="button",t.className="share-trigger",t.append(this.#k("share-2"),this.#f(this.getAttribute("label")||"Share")),t.addEventListener("click",this.#b),this.appendChild(t)}#v(){let t=(this.getAttribute("platforms")||gi).split(",").map(e=>e.trim()).filter(Boolean);this.#c=document.createElement("nav"),this.#c.setAttribute("aria-label",this.#o("sharePage"));for(let e of t){let i=mi.get(e);if(!i)continue;let s=document.createElement("button");s.type="button",s.dataset.platform=e,e==="copy"?s.append(this.#k(i.iconName,i.iconSet),this.#f(this.#o("copy"))):(s.setAttribute("aria-label",this.#o("shareOn").replace("{platform}",i.label)),s.append(this.#k(i.iconName,i.iconSet),this.#f(i.label))),this.#c.appendChild(s)}this.#c.addEventListener("click",this.#A),this.appendChild(this.#c),this.#h=!0}#y(){if(this.querySelector("nav"))this.#c=this.querySelector("nav");else{let t=document.createElement("nav");for(t.setAttribute("aria-label",this.#o("sharePage"));this.firstChild;)t.appendChild(this.firstChild);this.appendChild(t),this.#c=t}this.#g(),this.#c.addEventListener("click",this.#A)}#g(){let{url:t,title:e,text:i}=this.#p();for(let s of this.querySelectorAll("a[data-platform]")){let n=this.#r.get(s);if(n==null){let o=s.getAttribute("href")||"";if(!Fa.test(o))continue;n=o,this.#r.set(s,n)}s.setAttribute("href",n.replace(/\{url\}/g,encodeURIComponent(t)).replace(/\{title\}/g,encodeURIComponent(e)).replace(/\{text\}/g,encodeURIComponent(i)))}}#b=async()=>{await this.#T()};async#T(){let t=this.#p();this.dispatchEvent(new CustomEvent("share-wc:open",{detail:{platform:"native"},bubbles:!0}));try{if(navigator.canShare&&!navigator.canShare(t))throw new Error("Payload not shareable");return await navigator.share(t),this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:"native"},bubbles:!0})),!0}catch(e){return e?.name==="AbortError"?!1:(this.dispatchEvent(new CustomEvent("share-wc:error",{detail:{platform:"native",error:e},bubbles:!0})),this.#x(this.querySelector(":scope > .share-trigger")))}}#A=t=>{let e=t.target.closest("[data-platform]");if(!e)return;let i=e.dataset.platform;if(i==="copy"){e.tagName==="A"&&t.preventDefault(),this.#x(e);return}if(e.tagName==="A"||!i)return;let s=mi.get(i);if(!s)return;this.dispatchEvent(new CustomEvent("share-wc:open",{detail:{platform:i},bubbles:!0}));let n=this.#p();if(i==="email")location.href=s.buildUrl(n);else if(i==="mastodon"){let o=this.getAttribute("mastodon-instance")||"mastodon.social",a=s.buildUrl(n,o);window.open(a,"_blank","noopener,noreferrer")}else window.open(s.buildUrl(n),"_blank","noopener,noreferrer");this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:i},bubbles:!0}))};async#x(t=null){let e=t?.isConnected?t:void 0;if(!await kt(this.#t||"",{button:e,announceMessage:this.#o("linkCopied"),duration:2e3}))return this.dispatchEvent(new CustomEvent("share-wc:error",{detail:{platform:"copy"},bubbles:!0})),!1;this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:"copy"},bubbles:!0}));let s=e?.dataset.platform==="copy"?e.querySelector(".share-label"):null;if(!s)return!0;let n=s.dataset.original??s.textContent??"";return s.dataset.original=n,s.textContent=this.#o("copied"),this.#a&&clearTimeout(this.#a),this.#a=setTimeout(()=>{s.textContent=n,delete s.dataset.original,this.#a=null},2e3),!0}};g("share-wc",bi);var Ha="Home",Ua="Show full path",vi=":scope > ol > li:not([data-crumb-toggle])",Va=4;function ur(r){try{return decodeURIComponent(r)}catch{return r}}var yi=class extends b{#t={};#e=!1;#i=!1;static get observedAttributes(){return["data-collapsed"]}setup(){this.#s(),this.hasAttribute("data-from-pathname")?this.#r():this.#a(),this.#c(),this.#h(),this.#l(),this.listen(this,"click",t=>{let i=(t.target instanceof Element?t.target:null)?.closest("[data-crumb-toggle] > button");if(!i||!this.contains(i))return;let s=i.getAttribute("aria-expanded")!=="true";i.setAttribute("aria-expanded",String(s)),this.dispatchEvent(new CustomEvent("bread-crumb:toggle",{bubbles:!0,detail:{expanded:s}}))})}attributeChangedCallback(t,e,i){e===i||!this.hasAttribute("data-upgraded")||t==="data-collapsed"&&this.#h()}get labels(){return{...this.#t}}set labels(t){!t||typeof t!="object"||(this.#t={...t},this.isConnected&&this.hasAttribute("data-from-pathname")&&(this.#r(),this.#c(),this.#h(),this.#l()))}#s(){if(!!this.parentElement?.closest('nav, [role="navigation"]')){this.#e&&this.removeAttribute("role"),this.#i&&this.removeAttribute("aria-label"),this.#e=!1,this.#i=!1;return}this.hasAttribute("role")||(this.setAttribute("role","navigation"),this.#e=!0),!this.hasAttribute("aria-label")&&!this.hasAttribute("aria-labelledby")&&(this.setAttribute("aria-label","Breadcrumb"),this.#i=!0)}#r(){let e=window.location.pathname.split("/").filter(Boolean),i=document.createElement("ol"),s=document.createElement("li"),n=document.createElement("a");n.href="/",n.textContent=this.#t["/"]||this.#t.home||Ha,s.appendChild(n),i.appendChild(s);let o=this.dataset.currentLabel,a="";e.forEach((c,h)=>{a+=`/${c}`;let u=h===e.length-1,p=document.createElement("li"),d=`${a}/`,f=ur(c),m=u&&o||this.#t[d]||this.#t[a]||this.#t[ur(d)]||this.#t[f]||this.#t[c]||this.#n(f);if(u){let y=document.createElement("span");y.setAttribute("aria-current","page"),y.textContent=m,p.appendChild(y)}else{let y=document.createElement("a");y.href=d,y.textContent=m,p.appendChild(y)}i.appendChild(p)});let l=this.querySelector(":scope > ol");l?l.replaceWith(i):this.prepend(i)}#n(t){return t.replace(/[-_]+/g," ").replace(/\S+/g,e=>e[0].toUpperCase()+e.slice(1))}#a(){if(this.querySelector(":scope > ol"))return;let e=Array.from(this.querySelectorAll(":scope > a, :scope > span"));if(e.length===0)return;let i=document.createElement("ol");e.forEach(s=>{let n=document.createElement("li");n.appendChild(s),i.appendChild(n)}),this.prepend(i)}#c(){let t=this.querySelectorAll(vi);t.length!==0&&t.forEach((e,i)=>{let s=i===t.length-1,n=e.querySelector("a, span");n&&(s?n.setAttribute("aria-current","page"):n.removeAttribute("aria-current"))})}#h(){let t=this.querySelector(":scope > ol"),e=t?.querySelector(":scope > li[data-crumb-toggle]"),i=this.querySelectorAll(vi);if(!(!!t&&this.hasAttribute("data-collapsed")&&i.length>=Va)){e?.remove();return}let n=e||document.createElement("li");if(!e){n.setAttribute("data-crumb-toggle","");let o=document.createElement("button");o.type="button",o.setAttribute("aria-expanded","false"),o.setAttribute("aria-label",Ua),o.textContent="\u2026",n.appendChild(o)}i[0].nextElementSibling!==n&&i[0].after(n)}#l(){if(this.dataset.jsonld==="off")return;let t=Array.from(this.querySelectorAll(vi));if(t.length===0)return;let i={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:t.map((n,o)=>{let a=n.querySelector("a, span"),l=a?.textContent?.trim()||"",c=a instanceof HTMLAnchorElement&&a.hasAttribute("href")?a.href:void 0;return{"@type":"ListItem",position:o+1,name:l,...c?{item:c}:{}}})},s=this.querySelector(':scope > script[type="application/ld+json"]');s||(s=document.createElement("script"),s.type="application/ld+json",this.appendChild(s)),s.textContent=JSON.stringify(i)}};g("bread-crumb",yi);var wi="[data-highlights]",dr="highlights",Wa=["yellow","green","blue","pink"];var Ka=typeof CSS<"u"&&"highlights"in CSS,Jt=new WeakMap;function pr(r){let t=2166136261;for(let e=0;e<r.length;e++)t^=r.charCodeAt(e),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function vr(){return"hn-"+crypto.randomUUID().slice(0,8)}var Ga=/^[a-z0-9_-]+$/i,fr=["solid","double","dotted","dashed","wavy"],Ya={annotation:"You highlighted",added:"Highlight added",removed:"Highlight removed",noteSaved:"Note saved"};function Yt(r,t){let e="highlightsLabel"+t[0].toUpperCase()+t.slice(1);return r.dataset[e]||Ya[t]}function Xa(r,{textLength:t,colors:e}){if(!r||typeof r!="object")return null;let i=r,{startOffset:s,endOffset:n,color:o}=i;if(!Number.isInteger(s)||!Number.isInteger(n))return null;let a=s,l=n;return a<0||l<=a||l>t||!ki(o)||!e.includes(o)||i.id!=null&&(typeof i.id!="string"||!/^[\w-]{1,64}$/.test(i.id))||i.text!=null&&typeof i.text!="string"||i.note!=null&&typeof i.note!="string"?null:{id:i.id||vr(),startOffset:a,endOffset:l,text:i.text??"",color:o,note:i.note??"",created:Number.isFinite(i.created)?i.created:Date.now()}}function ki(r){return typeof r=="string"&&Ga.test(r)}var Q=null,tt=new Map,Lt=new Map;function yr(){if(tt.size===0){Q&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(i=>i!==Q),Q=null);return}Q||(Q=new CSSStyleSheet,document.adoptedStyleSheets=[...document.adoptedStyleSheets,Q]);let r=[...tt.keys()],t=r.map(i=>`::highlight(hn-${i}) { background-color: var(--highlight-${i}); color: var(--highlight-${i}-ink, var(--highlight-ink, CanvasText)); text-decoration-line: underline; text-decoration-color: var(--highlight-${i}); text-underline-offset: 2px; }`),e=r.map((i,s)=>`::highlight(hn-${i}) { background-color: Mark; color: MarkText; text-decoration-line: underline; text-decoration-color: MarkText; text-decoration-style: ${fr[s%fr.length]}; text-decoration-thickness: 2px; }`);Q.replaceSync(`${t.join(`
1315
+ ${r}`)}`}],["copy",{label:"Copy link",iconName:"link",buildUrl:()=>""}]]),gi="x,linkedin,bluesky,mastodon,whatsapp,email,copy";function N(r){return encodeURIComponent(r)}var Da={sharePage:"Share this page",shareOn:"Share on {platform}",copy:"Copy link",copied:"Copied!",linkCopied:"Link copied to clipboard",shareSelection:"Share selection",selectionCopied:"Selection copied"},Fa=/\{(url|title|text)\}/;function qa(r,t){let e=n=>encodeURIComponent(n).replace(/-/g,"%2D"),i=t.replace(/\s+/g," ").trim().split(" "),s=i.length>10?`${e(i.slice(0,4).join(" "))},${e(i.slice(-4).join(" "))}`:e(i.join(" "));return`${r.split("#")[0]}#:~:text=${s}`}var bi=class extends b{#t;#e;#i;#s={};#r=new WeakMap;#n="";#a=null;#c=null;#h=!1;get url(){return this.#s.url??this.#t}set url(t){this.#l("url",t)}get shareTitle(){return this.#s.title??this.#e??""}set shareTitle(t){this.#l("title",t)}get text(){return this.#s.text??this.#i}set text(t){this.#l("text",t)}#l(t,e){e==null?delete this.#s[t]:this.#s[t]=String(e),this.hasAttribute("data-upgraded")&&(this.#u(),this.#g())}setup(){if(this.#u(),this.#d(),this.closest("selection-menu")){this.#y(),this.setAttribute("data-tier-resolved","selection");return}this.#n==="native"?this.#m():this.#n==="hidden"?this.style.display="none":this.children.length>0?this.#w():this.#v(),this.setAttribute("data-tier-resolved",this.#n)}teardown(){this.removeAttribute("data-tier-resolved"),this.#n==="hidden"&&this.style.removeProperty("display"),this.#a&&(clearTimeout(this.#a),this.#a=null);for(let t of this.querySelectorAll(".share-label[data-original]"))t.textContent=t.dataset.original??"",delete t.dataset.original;this.#c&&(this.#c.removeEventListener("click",this.#A),this.#h&&this.#c.remove(),this.#c=null,this.#h=!1),this.querySelector(":scope > .share-trigger")?.remove(),this.querySelector(":scope > .share-selection")?.remove()}async share(){return this.#n==="native"?this.#T():this.#x()}#o(t){let e=`data-label-${t.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`)}`;return this.getAttribute(e)||Da[t]}#u(){this.#t=this.#s.url||this.getAttribute("url")||document.querySelector('link[rel~="canonical" i]')?.href||location.href,this.#e=this.#s.title??(this.getAttribute("title")||document.querySelector('meta[property="og:title"]')?.getAttribute("content")||document.title),this.#i=this.#s.text??(this.getAttribute("text")||document.querySelector('meta[name="description"]')?.getAttribute("content")||document.querySelector('meta[property="og:description"]')?.getAttribute("content")||"")}#p(){return{url:this.#t||"",title:this.#e||"",text:this.#i||""}}#d(){let t=this.getAttribute("tier");if(t==="platforms"||t==="native"){t==="native"&&!navigator.share?this.#n="hidden":this.#n=t;return}if((this.getAttribute("platforms")||gi)==="native-only"){this.#n=typeof navigator.share=="function"?"native":"hidden";return}this.#n=typeof navigator.share=="function"?"native":"platforms"}#f(t){let e=document.createElement("span");return e.className="share-label",e.textContent=t,e}#k(t,e){let i=document.createElement("icon-wc");return i.setAttribute("name",t),i.setAttribute("size","sm"),e&&i.setAttribute("set",e),i.setAttribute("aria-hidden","true"),i}#y(){let t=document.createElement("button");t.type="button",t.className="share-selection",t.setAttribute("aria-label",this.#o("shareSelection")),t.appendChild(this.#k("share-2")),t.addEventListener("click",async()=>{let e=this.closest("selection-menu"),s=e?.getSelection?.()?.text||window.getSelection()?.toString().trim()||"";if(!s){e?.dismiss?.();return}let n=qa(this.#t||location.href,s),o=`"${s}" \u2014 ${n}`,a=!1;if(typeof navigator.share=="function")try{await navigator.share({text:o}),a=!0}catch(l){l?.name==="AbortError"&&(a=!0)}a||await kt(o,{announceMessage:this.#o("selectionCopied")}),e?.dismiss?.()}),this.appendChild(t)}#m(){let t=document.createElement("button");t.type="button",t.className="share-trigger",t.append(this.#k("share-2"),this.#f(this.getAttribute("label")||"Share")),t.addEventListener("click",this.#b),this.appendChild(t)}#v(){let t=(this.getAttribute("platforms")||gi).split(",").map(e=>e.trim()).filter(Boolean);this.#c=document.createElement("nav"),this.#c.setAttribute("aria-label",this.#o("sharePage"));for(let e of t){let i=mi.get(e);if(!i)continue;let s=document.createElement("button");s.type="button",s.dataset.platform=e,e==="copy"?s.append(this.#k(i.iconName,i.iconSet),this.#f(this.#o("copy"))):(s.setAttribute("aria-label",this.#o("shareOn").replace("{platform}",i.label)),s.append(this.#k(i.iconName,i.iconSet),this.#f(i.label))),this.#c.appendChild(s)}this.#c.addEventListener("click",this.#A),this.appendChild(this.#c),this.#h=!0}#w(){if(this.querySelector("nav"))this.#c=this.querySelector("nav");else{let t=document.createElement("nav");for(t.setAttribute("aria-label",this.#o("sharePage"));this.firstChild;)t.appendChild(this.firstChild);this.appendChild(t),this.#c=t}this.#g(),this.#c.addEventListener("click",this.#A)}#g(){let{url:t,title:e,text:i}=this.#p();for(let s of this.querySelectorAll("a[data-platform]")){let n=this.#r.get(s);if(n==null){let o=s.getAttribute("href")||"";if(!Fa.test(o))continue;n=o,this.#r.set(s,n)}s.setAttribute("href",n.replace(/\{url\}/g,encodeURIComponent(t)).replace(/\{title\}/g,encodeURIComponent(e)).replace(/\{text\}/g,encodeURIComponent(i)))}}#b=async()=>{await this.#T()};async#T(){let t=this.#p();this.dispatchEvent(new CustomEvent("share-wc:open",{detail:{platform:"native"},bubbles:!0}));try{if(navigator.canShare&&!navigator.canShare(t))throw new Error("Payload not shareable");return await navigator.share(t),this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:"native"},bubbles:!0})),!0}catch(e){return e?.name==="AbortError"?!1:(this.dispatchEvent(new CustomEvent("share-wc:error",{detail:{platform:"native",error:e},bubbles:!0})),this.#x(this.querySelector(":scope > .share-trigger")))}}#A=t=>{let e=t.target.closest("[data-platform]");if(!e)return;let i=e.dataset.platform;if(i==="copy"){e.tagName==="A"&&t.preventDefault(),this.#x(e);return}if(e.tagName==="A"||!i)return;let s=mi.get(i);if(!s)return;this.dispatchEvent(new CustomEvent("share-wc:open",{detail:{platform:i},bubbles:!0}));let n=this.#p();if(i==="email")location.href=s.buildUrl(n);else if(i==="mastodon"){let o=this.getAttribute("mastodon-instance")||"mastodon.social",a=s.buildUrl(n,o);window.open(a,"_blank","noopener,noreferrer")}else window.open(s.buildUrl(n),"_blank","noopener,noreferrer");this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:i},bubbles:!0}))};async#x(t=null){let e=t?.isConnected?t:void 0;if(!await kt(this.#t||"",{button:e,announceMessage:this.#o("linkCopied"),duration:2e3}))return this.dispatchEvent(new CustomEvent("share-wc:error",{detail:{platform:"copy"},bubbles:!0})),!1;this.dispatchEvent(new CustomEvent("share-wc:success",{detail:{platform:"copy"},bubbles:!0}));let s=e?.dataset.platform==="copy"?e.querySelector(".share-label"):null;if(!s)return!0;let n=s.dataset.original??s.textContent??"";return s.dataset.original=n,s.textContent=this.#o("copied"),this.#a&&clearTimeout(this.#a),this.#a=setTimeout(()=>{s.textContent=n,delete s.dataset.original,this.#a=null},2e3),!0}};g("share-wc",bi);var Ha="Home",Ua="Show full path",vi=":scope > ol > li:not([data-crumb-toggle])",Va=4;function ur(r){try{return decodeURIComponent(r)}catch{return r}}var yi=class extends b{#t={};#e=!1;#i=!1;static get observedAttributes(){return["data-collapsed"]}setup(){this.#s(),this.hasAttribute("data-from-pathname")?this.#r():this.#a(),this.#c(),this.#h(),this.#l(),this.listen(this,"click",t=>{let i=(t.target instanceof Element?t.target:null)?.closest("[data-crumb-toggle] > button");if(!i||!this.contains(i))return;let s=i.getAttribute("aria-expanded")!=="true";i.setAttribute("aria-expanded",String(s)),this.dispatchEvent(new CustomEvent("bread-crumb:toggle",{bubbles:!0,detail:{expanded:s}}))})}attributeChangedCallback(t,e,i){e===i||!this.hasAttribute("data-upgraded")||t==="data-collapsed"&&this.#h()}get labels(){return{...this.#t}}set labels(t){!t||typeof t!="object"||(this.#t={...t},this.isConnected&&this.hasAttribute("data-from-pathname")&&(this.#r(),this.#c(),this.#h(),this.#l()))}#s(){if(!!this.parentElement?.closest('nav, [role="navigation"]')){this.#e&&this.removeAttribute("role"),this.#i&&this.removeAttribute("aria-label"),this.#e=!1,this.#i=!1;return}this.hasAttribute("role")||(this.setAttribute("role","navigation"),this.#e=!0),!this.hasAttribute("aria-label")&&!this.hasAttribute("aria-labelledby")&&(this.setAttribute("aria-label","Breadcrumb"),this.#i=!0)}#r(){let e=window.location.pathname.split("/").filter(Boolean),i=document.createElement("ol"),s=document.createElement("li"),n=document.createElement("a");n.href="/",n.textContent=this.#t["/"]||this.#t.home||Ha,s.appendChild(n),i.appendChild(s);let o=this.dataset.currentLabel,a="";e.forEach((c,h)=>{a+=`/${c}`;let u=h===e.length-1,p=document.createElement("li"),d=`${a}/`,f=ur(c),m=u&&o||this.#t[d]||this.#t[a]||this.#t[ur(d)]||this.#t[f]||this.#t[c]||this.#n(f);if(u){let y=document.createElement("span");y.setAttribute("aria-current","page"),y.textContent=m,p.appendChild(y)}else{let y=document.createElement("a");y.href=d,y.textContent=m,p.appendChild(y)}i.appendChild(p)});let l=this.querySelector(":scope > ol");l?l.replaceWith(i):this.prepend(i)}#n(t){return t.replace(/[-_]+/g," ").replace(/\S+/g,e=>e[0].toUpperCase()+e.slice(1))}#a(){if(this.querySelector(":scope > ol"))return;let e=Array.from(this.querySelectorAll(":scope > a, :scope > span"));if(e.length===0)return;let i=document.createElement("ol");e.forEach(s=>{let n=document.createElement("li");n.appendChild(s),i.appendChild(n)}),this.prepend(i)}#c(){let t=this.querySelectorAll(vi);t.length!==0&&t.forEach((e,i)=>{let s=i===t.length-1,n=e.querySelector("a, span");n&&(s?n.setAttribute("aria-current","page"):n.removeAttribute("aria-current"))})}#h(){let t=this.querySelector(":scope > ol"),e=t?.querySelector(":scope > li[data-crumb-toggle]"),i=this.querySelectorAll(vi);if(!(!!t&&this.hasAttribute("data-collapsed")&&i.length>=Va)){e?.remove();return}let n=e||document.createElement("li");if(!e){n.setAttribute("data-crumb-toggle","");let o=document.createElement("button");o.type="button",o.setAttribute("aria-expanded","false"),o.setAttribute("aria-label",Ua),o.textContent="\u2026",n.appendChild(o)}i[0].nextElementSibling!==n&&i[0].after(n)}#l(){if(this.dataset.jsonld==="off")return;let t=Array.from(this.querySelectorAll(vi));if(t.length===0)return;let i={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:t.map((n,o)=>{let a=n.querySelector("a, span"),l=a?.textContent?.trim()||"",c=a instanceof HTMLAnchorElement&&a.hasAttribute("href")?a.href:void 0;return{"@type":"ListItem",position:o+1,name:l,...c?{item:c}:{}}})},s=this.querySelector(':scope > script[type="application/ld+json"]');s||(s=document.createElement("script"),s.type="application/ld+json",this.appendChild(s)),s.textContent=JSON.stringify(i)}};g("bread-crumb",yi);var wi="[data-highlights]",dr="highlights",Wa=["yellow","green","blue","pink"];var Ka=typeof CSS<"u"&&"highlights"in CSS,Jt=new WeakMap;function pr(r){let t=2166136261;for(let e=0;e<r.length;e++)t^=r.charCodeAt(e),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function vr(){return"hn-"+crypto.randomUUID().slice(0,8)}var Ga=/^[a-z0-9_-]+$/i,fr=["solid","double","dotted","dashed","wavy"],Ya={annotation:"You highlighted",added:"Highlight added",removed:"Highlight removed",noteSaved:"Note saved"};function Yt(r,t){let e="highlightsLabel"+t[0].toUpperCase()+t.slice(1);return r.dataset[e]||Ya[t]}function Xa(r,{textLength:t,colors:e}){if(!r||typeof r!="object")return null;let i=r,{startOffset:s,endOffset:n,color:o}=i;if(!Number.isInteger(s)||!Number.isInteger(n))return null;let a=s,l=n;return a<0||l<=a||l>t||!ki(o)||!e.includes(o)||i.id!=null&&(typeof i.id!="string"||!/^[\w-]{1,64}$/.test(i.id))||i.text!=null&&typeof i.text!="string"||i.note!=null&&typeof i.note!="string"?null:{id:i.id||vr(),startOffset:a,endOffset:l,text:i.text??"",color:o,note:i.note??"",created:Number.isFinite(i.created)?i.created:Date.now()}}function ki(r){return typeof r=="string"&&Ga.test(r)}var Q=null,tt=new Map,Lt=new Map;function yr(){if(tt.size===0){Q&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(i=>i!==Q),Q=null);return}Q||(Q=new CSSStyleSheet,document.adoptedStyleSheets=[...document.adoptedStyleSheets,Q]);let r=[...tt.keys()],t=r.map(i=>`::highlight(hn-${i}) { background-color: var(--highlight-${i}); color: var(--highlight-${i}-ink, var(--highlight-ink, CanvasText)); text-decoration-line: underline; text-decoration-color: var(--highlight-${i}); text-underline-offset: 2px; }`),e=r.map((i,s)=>`::highlight(hn-${i}) { background-color: Mark; color: MarkText; text-decoration-line: underline; text-decoration-color: MarkText; text-decoration-style: ${fr[s%fr.length]}; text-decoration-thickness: 2px; }`);Q.replaceSync(`${t.join(`
1316
1316
  `)}
1317
1317
  @media (forced-colors: active) {
1318
1318
  ${e.join(`
1319
1319
  `)}
1320
- }`)}function Ja(r){for(let t of r)tt.set(t,(tt.get(t)??0)+1);yr()}function Za(r){for(let t of r){let e=(tt.get(t)??0)-1;e>0?tt.set(t,e):tt.delete(t)}yr()}function Qa(r){let t=Lt.get(r),e=t?[...t.values()].flat():[];e.length===0?(CSS.highlights.delete(`hn-${r}`),Lt.delete(r)):CSS.highlights.set(`hn-${r}`,new Highlight(...e))}function mr(r,t){let e=new Set(t.keys());for(let[i,s]of Lt)s.has(r)&&e.add(i);for(let i of e){let s=t.get(i)??[],n=Lt.get(i);s.length?(n||Lt.set(i,n=new Map),n.set(r,s)):n?.delete(r),Qa(i)}}function gr(r,t,e){let i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT),s=0;for(;i.nextNode();){if(i.currentNode===t)return s+e;s+=(i.currentNode.textContent??"").length}return-1}function Xt(r,t,e){let i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT),s=0,n=null,o=0,a=null,l=0;for(;i.nextNode();){let c=i.currentNode,h=(c.textContent??"").length;if(!n&&s+h>t&&(n=c,o=t-s),s+h>=e){a=c,l=e-s;break}s+=h}if(!n||!a)return null;try{let c=document.createRange();return c.setStart(n,Math.min(o,(n.textContent??"").length)),c.setEnd(a,Math.min(l,(a.textContent??"").length)),c}catch{return null}}var Ai=class{#t;#e;#i;#s;#r=[];#n=!Ka;#a;#c;#h=!1;#l=[];#o=new Map;constructor(t){this.#t=t,this.#s=t.hasAttribute("data-highlights-readonly");let e=t.dataset.highlights;this.#e=e&&e!==""?e:location.pathname;let i=t.dataset.highlightsColors,s=i?i.split(",").map(n=>n.trim()).filter(ki):[...Wa];this.#i=[...new Set(s)],this.#n||Ja(this.#i),this.#y(),this.#s||(this.#a=this.#p.bind(this),this.#c=this.#d.bind(this),t.addEventListener("pointerup",this.#a),t.addEventListener("click",this.#c)),t.setAttribute("data-highlights-init",""),this.#m().then(()=>{this.#h||this.#y()})}get colors(){return[...this.#i]}get destroyed(){return this.#h}get element(){return this.#t}getHighlights(){return this.#r.map(t=>({...t}))}removeHighlight(t){let e=this.#r.findIndex(i=>i.id===t);e<0||(this.#r.splice(e,1),this.#v(),this.#y(),this.#x("highlights:removed",{id:t}),ot(Yt(this.#t,"removed")))}clearAll(){this.#r=[],this.#v(),this.#y()}exportHighlights(){return JSON.stringify({version:1,highlights:this.#r})}importHighlights(t){let e;try{e=typeof t=="string"?JSON.parse(t):t}catch{return{imported:0,rejected:0}}if(!e||!Array.isArray(e.highlights))return{imported:0,rejected:0};let i=this.#u(e.highlights);return this.#r=i,this.#v(),this.#y(),{imported:i.length,rejected:e.highlights.length-i.length}}#u(t){let e={textLength:(this.#t.textContent??"").length,colors:this.#i},i=new Set,s=[];for(let n of t){let o=Xa(n,e);!o||i.has(o.id)||(i.add(o.id),s.push(o))}return s}destroy(){this.#h||(this.#h=!0,this.#a&&this.#t.removeEventListener("pointerup",this.#a),this.#c&&this.#t.removeEventListener("click",this.#c),this.#n?this.#t.querySelectorAll("mark[data-hn-id]").forEach(t=>{let e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t),e.normalize()}):(mr(this,new Map),Za(this.#i)),this.#T(),this.#o.clear(),this.#t.removeAttribute("data-highlights-init"),Jt.get(this.#t)===this&&Jt.delete(this.#t))}#p(){requestAnimationFrame(()=>{if(this.#h)return;let t=window.getSelection();if(!t||t.isCollapsed||!t.toString().trim())return;let e=t.getRangeAt(0);this.#t.contains(e.commonAncestorContainer)&&this.#x("highlights:selected",{text:t.toString().trim(),rect:e.getBoundingClientRect()})})}#d(t){let e=t.target.closest?.(".hn-margin-annotation");if(e){let s=e.dataset.hnId,n=this.#r.find(o=>o.id===s);if(n){this.#x("highlights:clicked",{id:s,highlight:{...n}}),this.#x("highlights:request-note",{id:s,highlight:{...n},controller:this});return}}let i=t.target.closest?.("mark[data-hn-id]");if(i){let s=i.dataset.hnId,n=this.#r.find(o=>o.id===s);if(n){this.#x("highlights:clicked",{id:s,highlight:{...n}});return}}if(!this.#n){let s=this.#w(t.clientX,t.clientY);s&&this.#x("highlights:clicked",{id:s.id,highlight:{...s}})}}findHighlightRect(t){let e=this.#r.find(n=>n.id===t);if(!e)return null;let i=this.#f(e);if(!i)return null;let s=i.getClientRects();return s.length?s[0]:null}#f(t){return this.#o.get(t.id)??Xt(this.#t,t.startOffset,t.endOffset)}#k(){this.#o.clear();for(let t of this.#r){let e=Xt(this.#t,t.startOffset,t.endOffset);e&&this.#o.set(t.id,e)}}#w(t,e){for(let i of this.#r){let s=this.#o.get(i.id);if(!s)continue;let n=s.getClientRects();for(let o of n)if(t>=o.left&&t<=o.right&&e>=o.top&&e<=o.bottom)return i}return null}_createFromSelection(t){let e=window.getSelection();if(!e||e.isCollapsed)return;let i=e.getRangeAt(0);if(!this.#t.contains(i.commonAncestorContainer))return;let s=gr(this.#t,i.startContainer,i.startOffset),n=gr(this.#t,i.endContainer,i.endOffset);if(s<0||n<0||s>=n)return;let o=e.toString().trim(),a={id:vr(),startOffset:s,endOffset:n,text:o,color:t,note:"",created:Date.now()};this.#r.push(a),this.#v(),this.#y(),e.removeAllRanges(),this.#x("highlights:added",{id:a.id,text:o,color:t,note:""}),ot(Yt(this.#t,"added"))}_changeColor(t,e){let i=this.#r.find(s=>s.id===t);i&&(i.color=e,this.#v(),this.#y())}_updateNote(t,e){let i=this.#r.find(s=>s.id===t);i&&(i.note=e,this.#v(),this.#A(),this.#x("highlights:note-changed",{id:t,note:e}),ot(Yt(this.#t,"noteSaved")))}async#m(){let t=await _.get(dr,this.#e);if(!t||!Array.isArray(t.highlights)||this.#h)return;let e=this.#u(t.highlights),i=pr(this.#t.textContent);t.contentHash&&t.contentHash!==i?(this.#r=e.filter(s=>{let n=Xt(this.#t,s.startOffset,s.endOffset);return n?n.toString().trim()===s.text:!1}),this.#v()):this.#r=e}#v(){let t={version:1,contentHash:pr(this.#t.textContent),highlights:this.#r};_.set(dr,this.#e,t).catch(()=>{})}#y(){this.#n?(this.#b(),this.#k()):(this.#k(),this.#g()),this.#A()}#g(){let t=new Map;for(let e of this.#i)t.set(e,[]);for(let e of this.#r){let i=this.#o.get(e.id);i&&t.has(e.color)&&t.get(e.color).push(i)}mr(this,t)}#b(){this.#t.querySelectorAll("mark[data-hn-id]").forEach(e=>{let i=e.parentNode;for(;e.firstChild;)i.insertBefore(e.firstChild,e);i.removeChild(e)}),this.#t.normalize();let t=[...this.#r].sort((e,i)=>i.startOffset-e.startOffset);for(let e of t){let i=Xt(this.#t,e.startOffset,e.endOffset);if(!i)continue;let s=document.createElement("mark");s.dataset.hnId=e.id,ki(e.color)&&(s.dataset.hnColor=e.color,s.style.setProperty("--_hn-color",`var(--highlight-${e.color})`),s.style.setProperty("--_hn-ink",`var(--highlight-${e.color}-ink, var(--highlight-ink))`));try{i.surroundContents(s)}catch{let n=i.extractContents();s.appendChild(n),i.insertNode(s)}}}#T(){for(let t of this.#l)t.remove();this.#l=[]}#A(){if(this.#T(),this.#r.length===0)return;getComputedStyle(this.#t).position==="static"&&(this.#t.style.position="relative");let e=this.#t.getBoundingClientRect(),i=Yt(this.#t,"annotation");for(let s of this.#r){let n=this.#o.get(s.id);if(!n)continue;let o=n.getClientRects();if(o.length===0)continue;let a=o[0].top-e.top,l=document.createElement("span");if(l.className="hn-margin-annotation",l.dataset.hnId=s.id,l.setAttribute("aria-hidden","true"),l.style.insetBlockStart=`${a}px`,s.note){let c=document.createElement("span");c.className="hn-note-indicator",c.textContent="*",l.append(c,` ${i}`),l.classList.add("hn-has-note")}else l.textContent=i;this.#t.appendChild(l),this.#l.push(l)}}#x(t,e={}){this.#t.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0}))}};function H(r){let t=Jt.get(r);if(t&&!t.destroyed)return t;let e=new Ai(r);return Jt.set(r,e),e}function br(r=document){r.querySelectorAll(wi).forEach(t=>{t.hasAttribute("data-highlights-init")||H(t)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>br()):br();var tl=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches(wi)&&H(i),i.querySelectorAll(wi).forEach(s=>{s.hasAttribute("data-highlights-init")||H(s)})}});tl.observe(document.documentElement,{childList:!0,subtree:!0});var el=["yellow","green","blue","pink"],il=/^[a-z0-9_-]+$/i,sl=["annotation","added","removed"],rl=0,xi=class extends b{#t=null;#e=null;#i="yellow";#s=null;#r=null;#n=!1;#a=null;setup(){this.#s=this.closest("selection-menu");let t=this.#w();t.includes(this.#i)||(this.#i=t[0]??"yellow"),this.#s?this.#c():this.#f()}teardown(){this.#t?.destroy(),this.#t=null,this.#a?.remove(),this.#a=null,this.#n?this.#r?.remove():this.#r?.removeAttribute("aria-expanded"),this.#r=null,this.#n=!1,this.#s=null}#c(){let t=this.hasAttribute("readonly");for(let n of this.#p())this.#d(n);if(t)return;let e=this.#w(),i=this.querySelector(":scope > button");if(this.#n=!i,!i){i=document.createElement("button"),i.type="button",i.setAttribute("aria-label",this.dataset.labelButton||"Highlight selection");let n=document.createElement("icon-wc");n.setAttribute("name","highlighter"),n.setAttribute("size","sm"),n.setAttribute("aria-hidden","true"),i.appendChild(n),this.appendChild(i)}this.#r=i;let s=document.createElement("div");s.className="highlight-color-dropdown",s.id=`highlight-palette-${++rl}`,s.setAttribute("role","group"),s.setAttribute("aria-label",this.dataset.labelPalette||"Highlight color"),s.hidden=!0;for(let n of e){let o=document.createElement("button");o.type="button",o.className="highlight-color-swatch",o.dataset.color=n,o.title=n,o.setAttribute("aria-label",n),o.setAttribute("aria-pressed",String(n===this.#i)),o.style.setProperty("--_swatch",`var(--highlight-${n})`),s.appendChild(o)}this.appendChild(s),this.#a=s,i.setAttribute("aria-expanded","false"),i.setAttribute("aria-controls",s.id),this.listen(i,"click",n=>{n.stopPropagation(),this.#h(s.hidden)}),this.listen(s,"click",n=>{let o=n.target.closest?.(".highlight-color-swatch");o&&(n.stopPropagation(),this.#o(o.dataset.color??this.#i),this.#h(!1),this.#u(this.#i))}),this.listen(this,"keydown",n=>{let o=n;o.key!=="Escape"||s.hidden||(o.stopPropagation(),this.#h(!1),i.focus())}),this.listen(document,"pointerdown",n=>{!s.hidden&&!this.contains(n.target)&&this.#h(!1)}),this.listen(this.#s,"selection-menu:dismiss",()=>this.#h(!1))}#h(t){!this.#a||!this.#r||(this.#a.hidden=!t,this.#r.setAttribute("aria-expanded",String(t)),t&&(this.#l(),(this.#a.querySelector('[aria-pressed="true"]')??this.#a.firstElementChild)?.focus({preventScroll:!0})))}#l(){let t=this.#a;if(!t)return;t.style.removeProperty("--_hn-shift");let{left:e,right:i}=t.getBoundingClientRect(),s=8,n=e<s?s-e:i>window.innerWidth-s?window.innerWidth-s-i:0;n&&t.style.setProperty("--_hn-shift",`${n}px`)}#o(t){this.#i=t,this.#a?.querySelectorAll(".highlight-color-swatch").forEach(e=>e.setAttribute("aria-pressed",String(e.dataset.color===t)))}#u(t){let e=this.#s,i=e?.getSelection?.();if(!i?.target)return;let s=this.#d(i.target);if(!s)return;let n=window.getSelection();n&&(n.isCollapsed||!n.rangeCount)&&i.range&&(n.removeAllRanges(),n.addRange(i.range)),s._createFromSelection(t),this.#e=i.target,e.dismiss?.()}#p(){let t=this.#s;if(!t)return[];let e=new Set,i=t.getAttribute("for"),s=i&&document.getElementById(i);return s&&e.add(s),t.id&&document.querySelectorAll(`[data-selection-menu="${CSS.escape(t.id)}"]`).forEach(n=>e.add(n)),[...e]}#d(t){t.hasAttribute("data-highlights-init")||(t.setAttribute("data-highlights",this.getAttribute("storage-key")||""),this.hasAttribute("colors")&&t.setAttribute("data-highlights-colors",this.getAttribute("colors")??""));for(let i of sl){let s=this.getAttribute(`data-label-${i}`);s&&t.setAttribute(`data-highlights-label-${i}`,s)}let e=H(t);return this.hasAttribute("readonly")&&!t.hasAttribute("data-highlights-readonly")&&(t.setAttribute("data-highlights-readonly",""),e.destroy(),e=H(t)),e}#f(){let t=this.#k();t&&(this.#t=this.#d(t))}#k(){let t=this.getAttribute("for");return t?document.getElementById(t):this.firstElementChild}#w(){let t=this.getAttribute("colors"),e=t?t.split(",").map(i=>i.trim()).filter(i=>il.test(i)):[];return e.length?[...new Set(e)]:[...el]}#m(){if(this.#t&&!this.#t.destroyed)return this.#t;let t=this.#e?.isConnected?this.#e:this.#p()[0];return t?this.#d(t):null}highlightSelection(t=this.#i){this.hasAttribute("readonly")||!this.#w().includes(t)||(this.#o(t),this.#s?this.#u(t):this.#t?._createFromSelection(t))}getHighlights(){return this.#m()?.getHighlights()??[]}removeHighlight(t){this.#m()?.removeHighlight(t)}clearAll(){this.#m()?.clearAll()}exportHighlights(){return this.#m()?.exportHighlights()??'{"version":1,"highlights":[]}'}importHighlights(t){return this.#m()?.importHighlights(t)??{imported:0,rejected:0}}};g("highlight-wc",xi);var Zt=CSS.supports("anchor-name","--x"),nl=CSS.supports("position-area","bottom"),ol=(()=>{let r=document.createElement("span");return r.setAttribute("popover","hint"),r.popover==="hint"})(),al=["auto","manual","hint"];function ll(r){let t=al.includes(r||"")?r:"auto";return t==="hint"&&!ol?"auto":t}var cl=["top","bottom","left","right","inset-inline-start","inset-inline-end"],hl=["position","top","left","right","bottom","margin"],wr=8,ul=0,dl=0;function kr(r){return!r||r==="none"?[]:r.split(",").map(t=>t.trim()).filter(Boolean)}var Ei=class extends b{static get observedAttributes(){return["data-mode","data-anchor","data-position"]}#t=null;#e=null;#i=`--pop-over-anchor-${++dl}`;#s=!1;#r=!1;#n=!1;setup(){if(this.id||(this.id=`pop-over-${++ul}`),(!this.hasAttribute("popover")||this.#s)&&this.#a(),this.#c(),this.#h(),this.listen(this,"beforetoggle",t=>{let e=t.newState==="open"?"show":"hide";this.dispatchEvent(new CustomEvent(`pop-over:${e}`,{detail:{state:t.newState},bubbles:!0,composed:!0})),!Zt&&t.newState==="open"&&this.#t&&queueMicrotask(()=>{this.matches(":popover-open")&&this.#u()})}),!Zt){let t=()=>{this.matches(":popover-open")&&this.#t&&this.#u()};this.listen(window,"resize",t),this.listen(window,"scroll",t,{capture:!0,passive:!0})}}teardown(){this.#l(),this.#r&&(cl.forEach(t=>this.style.removeProperty(t)),this.#r=!1),this.#n&&(hl.forEach(t=>this.style.removeProperty(t)),this.#n=!1),this.#t=null}attributeChangedCallback(t,e,i){if(e!==i){if(!this.hasAttribute("data-upgraded")){t==="data-mode"&&this.hasAttribute("popover")&&!this.isConnected&&(this.#s=!0);return}if(t==="data-mode"){this.#a();return}this._reinit()}}#a(){let t=ll(this.dataset.mode);this.getAttribute("popover")!==t&&this.setAttribute("popover",t),this.#s=!0}show(){this.matches(":popover-open")||(this.showPopover(),!Zt&&this.#t&&this.matches(":popover-open")&&this.#u())}hide(){this.matches(":popover-open")&&this.hidePopover()}toggle(){this.matches(":popover-open")?this.hide():this.show()}get open(){return this.matches(":popover-open")}#c(){let t=this.dataset.anchor;if(t){let e=document.getElementById(t);if(!e)try{e=document.querySelector(t)}catch{e=null}this.#t=e}else this.#t=document.querySelector(`[popovertarget="${CSS.escape(this.id)}"]`)}#h(){if(!this.#t||!Zt)return;let t=this.#t,e=t.style.getPropertyValue("anchor-name"),i=kr(e||getComputedStyle(t).getPropertyValue("anchor-name"));i.includes(this.#i)||i.push(this.#i),t.style.setProperty("anchor-name",i.join(", ")),this.#e=this.#i,this.style.setProperty("position-anchor",this.#i),this.setAttribute("data-anchor-name",this.#i),nl||this.#o(this.dataset.position||"bottom")}#l(){if(this.#t&&this.#e){let t=kr(this.#t.style.getPropertyValue("anchor-name")).filter(e=>e!==this.#e);t.length?this.#t.style.setProperty("anchor-name",t.join(", ")):this.#t.style.removeProperty("anchor-name")}this.#e=null,this.style.getPropertyValue("position-anchor")&&this.style.removeProperty("position-anchor"),this.hasAttribute("data-anchor-name")&&this.removeAttribute("data-anchor-name")}#o(t){let e="var(--_pop-over-offset, var(--size-xs))",i=t.endsWith("-end")?{"inset-inline-end":"anchor(end)"}:{"inset-inline-start":"anchor(start)"},s={top:{bottom:`calc(anchor(top) + ${e})`,...i},bottom:{top:`calc(anchor(bottom) + ${e})`,...i},left:{right:`calc(anchor(left) + ${e})`,top:"anchor(top)"},right:{left:`calc(anchor(right) + ${e})`,top:"anchor(top)"}},n=t.split("-")[0],o=s[n]||s.bottom;Object.entries(o).forEach(([a,l])=>this.style.setProperty(a,l)),this.#r=!0}#u(){if(!this.#t)return;let t=this.#t.getBoundingClientRect(),e=this.dataset.position||"bottom",i=this.#p(),s=document.documentElement.clientWidth,n=document.documentElement.clientHeight;this.style.position="fixed",this.style.margin="0",this.style.right="auto",this.style.bottom="auto",this.#n=!0;let o=this.offsetWidth,a=this.offsetHeight,l=e.split("-")[0];["top","bottom","left","right"].includes(l)||(l="bottom");let c={top:t.top-i,bottom:n-t.bottom-i,left:t.left-i,right:s-t.right-i},h={top:"bottom",bottom:"top",left:"right",right:"left"},u=l==="top"||l==="bottom"?a:o;c[l]<u&&c[h[l]]>c[l]&&(l=h[l]);let p,d;switch(l){case"top":p=t.top-a-i,d=t.left;break;case"left":p=t.top,d=t.left-o-i;break;case"right":p=t.top,d=t.right+i;break;default:p=t.bottom+i,d=t.left;break}if(l==="top"||l==="bottom"){let m=getComputedStyle(this).direction==="rtl";d=e.endsWith("-end")!==m?t.right-o:t.left}else e.endsWith("-end")&&(p=t.bottom-a);let f=(m,y,w)=>Math.max(wr,Math.min(m,w-y-wr));d=f(d,o,s),p=f(p,a,n),this.style.top=`${Math.round(p)}px`,this.style.left=`${Math.round(d)}px`}#p(){let t={none:0,xs:4,s:8,m:16,l:24};return t[this.dataset.offset||""]??t.xs}};g("pop-over",Ei);var Ar=8,Qt=8,pl=300,fl="Text selection actions",xr="F10",ml='button:not([disabled]), a[href], [role="button"]:not([aria-disabled="true"])',gl='[role="group"], [role="menu"], [role="listbox"], [role="radiogroup"], dialog, [popover]:not([data-selection-menu-host])',bl=0,Si=class extends b{#t=null;#e=new Set;#i=!1;#s;#r=null;#n=null;#a=null;#c=0;#h=!1;#l="mouse";#o="pointer";#u=!1;#p=new Set;setup(){let t=this.querySelector(":scope > pop-over[data-selection-menu-host]");if(t)this.#s=t;else{this.#s=document.createElement("pop-over"),this.#s.setAttribute("data-selection-menu-host",""),this.#s.dataset.mode="manual",this.#s.id=`selection-menu-${++bl}`;let e=[...this.children];for(let i of e)i!==this.#s&&this.#s.appendChild(i);this.appendChild(this.#s)}this.#s.setAttribute("role","toolbar"),this.#s.setAttribute("aria-orientation","horizontal"),this.#s.setAttribute("aria-label",this.dataset.label||fl),this.#s.setAttribute("aria-keyshortcuts",`Alt+${xr}`),this.hidden=!1,this.#d(),this.listen(document,"pointerup",this.#f),this.listen(document,"pointerdown",this.#T),this.listen(document,"keydown",this.#A),this.listen(document,"keyup",this.#k),this.listen(document,"selectionchange",this.#w),this.listen(window,"scroll",this.#g,{capture:!0,passive:!0}),this.listen(window,"resize",this.#g),this.listen(this.#s,"keydown",this.#L),this.id&&(this.#r=new MutationObserver(()=>this.#d()),this.#r.observe(document.body,{childList:!0,subtree:!0,attributeFilter:["data-selection-menu"]}))}teardown(){this.#r?.disconnect(),this.#r=null,this.#a&&clearTimeout(this.#a),this.#a=null,cancelAnimationFrame(this.#c),this.#n?.getAttribute("data-selection-menu")===this.id&&this.#n.removeAttribute("data-selection-menu"),this.#n=null;for(let t of this.#p)t.removeAttribute("tabindex");this.#p.clear(),this.#i=!1,this.#t=null,this.#h=!1}getSelection(){return this.#t?{...this.#t}:null}dismiss(){this.#i&&this.#b({restoreFocus:!0})}get actions(){return[...(this.#s||this).children].map(e=>({tag:e.tagName.toLowerCase(),attrs:Object.fromEntries([...e.attributes].map(i=>[i.name,i.value])),html:e.innerHTML||void 0}))}set actions(t){let e=Array.isArray(t)?t:[],i=this.#s||this;for(;i.firstChild;)i.firstChild.remove();this.#p.clear();for(let s of e){if(s instanceof Element){i.appendChild(s);continue}if(!s?.tag)continue;let n=document.createElement(s.tag);if(s.attrs)for(let[o,a]of Object.entries(s.attrs))a==null||a===!1||n.setAttribute(o,a===!0?"":String(a));s.html&&(n.innerHTML=s.html),i.appendChild(n)}this.dispatchEvent(new CustomEvent("selection-menu:actions-changed",{detail:{actions:this.actions,source:"property"},bubbles:!0}))}#d(){this.#e.clear();let t=this.getAttribute("for");if(t){let e=document.getElementById(t);e&&(this.#e.add(e),this.id&&!e.hasAttribute("data-selection-menu")&&(e.setAttribute("data-selection-menu",this.id),this.#n=e))}this.id&&document.querySelectorAll(`[data-selection-menu="${CSS.escape(this.id)}"]`).forEach(e=>{this.#e.add(e)})}#f=t=>{this.#h=!1,this.#l=t.pointerType||"mouse",requestAnimationFrame(()=>{this.isConnected&&this.#m()})};#k=t=>{!t.shiftKey&&t.key!=="Shift"||this.#s?.contains(document.activeElement)||(this.#l="keyboard",this.#m())};#w=()=>{this.#h||this.#u||(this.#a&&clearTimeout(this.#a),this.#a=setTimeout(()=>{if(this.#a=null,!this.isConnected||this.#h||this.#u||this.#s?.contains(document.activeElement))return;let t=window.getSelection();if(!t||t.isCollapsed||!t.toString().trim()){this.#i&&this.#o==="keyboard"&&this.#b({restoreFocus:!1});return}this.#o==="keyboard"&&(this.#l="keyboard"),this.#m()},pl))};#m(){let t=window.getSelection();if(!t||t.rangeCount===0||t.isCollapsed||!t.toString().trim())return!1;let e=t.getRangeAt(0),i=e.commonAncestorContainer,s=i.nodeType===Node.ELEMENT_NODE?i:i.parentElement,n=null;for(let c of this.#e)if(c.contains(s)){n=c;break}if(!n)return!1;let o=t.toString().trim(),a=this.#t,l=this.#i&&a&&a.target===n&&a.text===o&&a.range.compareBoundaryPoints(Range.START_TO_START,e)===0&&a.range.compareBoundaryPoints(Range.END_TO_END,e)===0;return this.#t={range:e.cloneRange(),text:o,target:n},l||this.dispatchEvent(new CustomEvent("selection-menu:select",{detail:{range:this.#t.range,text:o,target:n},bubbles:!0})),this.#v(),!0}#v(){this.#s&&(this.#s.show(),this.#i=!0,this.#S(),cancelAnimationFrame(this.#c),this.#c=requestAnimationFrame(()=>this.#y()))}#y(){if(!this.#i||!this.#t||!this.#s)return;let t=this.#t.range.getBoundingClientRect();if(t.bottom<0||t.top>window.innerHeight||t.width===0&&t.height===0){this.#b({restoreFocus:!0});return}let i=this.#s.getBoundingClientRect(),s=i.width||200,n=i.height||40,o=t.top-n-Ar,a=t.bottom+Ar,l;this.#l==="touch"?l=a+n+Qt<=window.innerHeight?a:o:l=o<Qt?a:o;let c=t.left+t.width/2-s/2,h=window.innerWidth-s-Qt;c=Math.max(Qt,Math.min(c,h)),this.#s.style.top=`${l}px`,this.#s.style.left=`${c}px`}#g=()=>{this.#i&&(cancelAnimationFrame(this.#c),this.#c=requestAnimationFrame(()=>this.#y()))};#b({restoreFocus:t=!1,restoreRange:e=!1}={}){let i=this.#t,s=!!this.#s?.contains(document.activeElement);if(this.#s&&this.#s.hide(),this.#i=!1,this.#t=null,cancelAnimationFrame(this.#c),this.#u=!0,this.dispatchEvent(new CustomEvent("selection-menu:dismiss",{bubbles:!0})),t&&s&&i?.target?.isConnected){let n=i.target;if(n.hasAttribute("tabindex")||(n.setAttribute("tabindex","-1"),n.addEventListener("blur",()=>{n.getAttribute("tabindex")==="-1"&&n.removeAttribute("tabindex")},{once:!0})),n.focus({preventScroll:!0}),e){let o=window.getSelection();o&&(o.removeAllRanges(),o.addRange(i.range))}}}#T=t=>{if(this.#h=!0,this.#o="pointer",this.#u=!1,!this.#i)return;let e=t.target;this.#s?.contains(e)||this.contains(e)||this.#b()};#A=t=>{if(["Shift","Alt","Control","Meta"].includes(t.key)||(this.#u=!1),this.#o="keyboard",!t.defaultPrevented){if(t.key==="Escape"&&this.#i){t.preventDefault(),this.#b({restoreFocus:!0,restoreRange:!0});return}if(t.key===xr&&t.altKey&&!t.ctrlKey&&!t.metaKey){if(!this.#i&&(this.#l="keyboard",!this.#m()))return;t.preventDefault(),this.#E(0)}}};#x(){return this.#s?[...this.#s.querySelectorAll(ml)].filter(t=>{let e=t.closest(gl);if(e&&this.#s.contains(e))return!1;let i=t.closest("[hidden]");return!(i&&this.#s.contains(i))}):[]}#S(){let t=this.#x(),e=t.find(i=>i===document.activeElement)??t.find(i=>i.getAttribute("tabindex")==="0")??t[0];for(let i of t)i.setAttribute("tabindex",i===e?"0":"-1"),this.#p.add(i)}#E(t){this.#S();let e=this.#x();if(!e.length)return;let i=(t%e.length+e.length)%e.length;for(let s of e)s.setAttribute("tabindex",s===e[i]?"0":"-1");e[i].focus()}#L=t=>{let e=t.target;if(e.matches('input, textarea, select, [contenteditable]:not([contenteditable="false"])'))return;let i=this.#x(),s=i.indexOf(e);if(s===-1)return;let n=getComputedStyle(this.#s).direction==="rtl",o=n?"ArrowLeft":"ArrowRight",a=n?"ArrowRight":"ArrowLeft",l=-1;if(t.key===o)l=s+1;else if(t.key===a)l=s-1;else if(t.key==="Home")l=0;else if(t.key==="End")l=i.length-1;else return;t.preventDefault(),this.#E(l)}};g("selection-menu",Si);var vl={add:"Add private note",view:"View notes",dialog:"Private note",heading:"Private note",placeholder:"Add a note\u2026",textarea:"Note for highlighted text",save:"Save",cancel:"Cancel"},Er=!1,Ci=new Set;function Sr(r,t,e){if(!r.contains(t))return-1;let i=document.createRange();return i.setStart(r,0),i.setEnd(t,e),i.toString().length}var Ti=class extends b{#t=!1;#e=null;#i=null;#s=null;#r=null;#n=null;setup(){this.#t=!!this.closest("selection-menu");let t=this.hasAttribute("for");Ci.add(this),Er||(Er=!0,document.addEventListener("highlights:request-note",yl));let e=this.querySelector(":scope > button[data-note-action]");if(!this.#t&&!t){e?.remove();return}if(!e){e=document.createElement("button"),e.type="button",e.setAttribute("data-note-action","");let i=document.createElement("icon-wc");i.setAttribute("name","sticky-note"),i.setAttribute("size","sm"),i.setAttribute("aria-hidden","true"),e.appendChild(i),this.appendChild(e)}e.setAttribute("aria-label",this.#a(this.#t?"add":"view")),this.listen(e,"click",this.#t?()=>this.#c():()=>this.#h())}teardown(){Ci.delete(this),this.#d({restoreFocus:!1})}#a(t){return this.getAttribute(`data-label-${t}`)??vl[t]??t}openFor(t,e,i){this.#l(t,e,i??document.activeElement)}#c(){let t=this.closest("selection-menu");if(!t)return;let e=t.getSelection();if(!e)return;let i=e.target,s=document.activeElement;i.hasAttribute("data-highlights-init")||i.setAttribute("data-highlights","");let n=H(i),o=e.range,a=Sr(i,o.startContainer,o.startOffset),l=Sr(i,o.endContainer,o.endOffset),c=null;if(a>=0&&l>a&&(c=n.getHighlights().find(h=>h.startOffset<=a&&h.endOffset>=l)??null),!c){let h=window.getSelection();h&&(h.isCollapsed||h.rangeCount===0)&&(h.removeAllRanges(),h.addRange(o)),n._createFromSelection("yellow");let u=n.getHighlights();c=u.find(p=>p.startOffset===a&&p.endOffset===l)??u[u.length-1]??null}t.dismiss(),c&&this.#l(c,n,s)}#h(){let t=this.getAttribute("for"),e=t?document.getElementById(t):null;if(!e)return;e.hasAttribute("data-highlights-init")||e.setAttribute("data-highlights","");let i=H(e),s=i.getHighlights(),n=s.find(o=>o.note)??s[0];n&&this.#l(n,i,document.activeElement)}#l(t,e,i){this.#d({restoreFocus:!1});let s=e.element;this.#i=i&&i!==document.body?i:null,this.#s=t,this.#r=e;let n=document.createElement("div");n.className="hn-note-panel",n.setAttribute("role","dialog"),n.setAttribute("aria-label",this.#a("dialog"));let o=document.createElement("header");o.className="hn-note-header";let a=document.createElement("small");a.textContent=this.#a("heading"),o.appendChild(a),n.appendChild(o);let l=document.createElement("blockquote");l.className="hn-note-quote",l.textContent=t.text.length>80?t.text.slice(0,80)+"\u2026":t.text,n.appendChild(l);let c=document.createElement("textarea");c.className="hn-note-textarea",c.placeholder=this.#a("placeholder"),c.value=t.note||"",c.rows=3,c.setAttribute("aria-label",this.#a("textarea")),n.appendChild(c);let h=document.createElement("footer");h.className="hn-note-actions";let u=()=>{e._updateNote(t.id,c.value.trim()),this.#d()},p=document.createElement("button");p.type="button",p.className="hn-action hn-action-save",p.textContent=this.#a("save"),p.addEventListener("click",u);let d=document.createElement("button");if(d.type="button",d.className="hn-action",d.textContent=this.#a("cancel"),d.addEventListener("click",()=>this.#d()),h.append(p,d),n.appendChild(h),n.addEventListener("keydown",f=>{f.key==="Escape"?(f.preventDefault(),f.stopPropagation(),this.#d()):f.key==="Enter"&&(f.metaKey||f.ctrlKey)&&f.target===c&&(f.preventDefault(),u())}),getComputedStyle(s).position==="static"&&(s.setAttribute("data-note-host",""),this.#n=s),s.appendChild(n),typeof e.findHighlightRect=="function"){let f=e.findHighlightRect(t.id);if(f){let m=s.getBoundingClientRect();n.style.top=`${f.top-m.top}px`}}this.#e=n,requestAnimationFrame(()=>{this.#e===n&&(c.focus(),document.addEventListener("pointerdown",this.#o))})}#o=t=>{if(!this.#e||this.#e.contains(t.target))return;this.#d({restoreFocus:!1});let e=this.#u;document.addEventListener("pointerup",()=>{setTimeout(()=>{let i=document.activeElement;(!i||i===document.body)&&e?.()})},{once:!0,capture:!0})};#u=null;#p(){let t=this.#i,e=this.#r?.element,i=this.#s?.id;return()=>{if(t?.isConnected&&(typeof t.checkVisibility!="function"||t.checkVisibility())&&(t.focus({preventScroll:!0}),document.activeElement===t)||!e?.isConnected)return;let n=(i?e.querySelector(`mark[data-hn-id="${CSS.escape(i)}"]`):null)??e;n.tabIndex<0&&!n.hasAttribute("tabindex")&&(n.setAttribute("tabindex","-1"),n.addEventListener("blur",()=>n.removeAttribute("tabindex"),{once:!0})),n.focus({preventScroll:!0})}}#d({restoreFocus:t=!0}={}){if(!this.#e)return;let e=this.#p();document.removeEventListener("pointerdown",this.#o),this.#e.remove(),this.#e=null,this.#n?.removeAttribute("data-note-host"),this.#n=null,this.#u=e,this.#i=null,this.#s=null,this.#r=null,t&&e()}};function yl(r){let{highlight:t,controller:e}=r.detail||{};if(!t||!e)return;let i=Ci.values().next().value;i&&i.openFor(t,e)}g("note-wc",Ti);var wl=0,Li=class extends b{#t=null;#e=null;setup(){if(this.#t=this.querySelector(":scope > button"),this.#e=this.querySelector(":scope > .comment-wc-reason"),!this.#t){let e=document.createElement("button");e.type="button";let i=document.createElement("icon-wc");i.setAttribute("name","message-circle"),i.setAttribute("size","sm"),i.setAttribute("aria-hidden","true"),e.appendChild(i);let s=document.createElement("span");s.className="comment-wc-reason visually-hidden",s.id=`comment-wc-reason-${++wl}`,s.textContent="Comments are unavailable: this content has no review surface.",this.append(e,s),this.#t=e,this.#e=s}this.#s(),this.listen(this,"click",this.#r);let t=this.closest("selection-menu");t&&this.listen(t,"toggle",()=>this.#s())}#i(){let t=this.closest("review-surface");if(t)return t;let e=this.closest("selection-menu")?.getAttribute("for");return e?document.querySelector(`review-surface[for="${CSS.escape(e)}"]`):null}#s(){let t=this.#t;if(!t)return;!!this.#i()?(t.removeAttribute("aria-disabled"),t.removeAttribute("aria-describedby"),t.setAttribute("aria-label","Add comment")):(t.setAttribute("aria-disabled","true"),t.setAttribute("aria-label","Add comment"),this.#e&&t.setAttribute("aria-describedby",this.#e.id))}#r=t=>{if(!this.#t?.contains(t.target))return;this.#s();let e=this.#i();if(!e)return;let i=this.closest("selection-menu");if(!i)return;let s=i.getSelection();if(!s)return;let n=s.range.getBoundingClientRect(),o=e.getBoundingClientRect(),a=(n.left+n.width/2-o.left)/o.width*100,l=(n.top-o.top)/o.height*100;typeof e.addPin=="function"&&e.addPin({x:a,y:l,text:s.text}),this.dispatchEvent(new CustomEvent("comment-wc:created",{detail:{text:s.text,x:a,y:l},bubbles:!0})),i.dismiss()}};g("comment-wc",Li);var Mi='track[kind="chapters"][data-chapter-list]';function Cr(r=document){r.querySelectorAll(Mi).forEach(t=>Ri(t))}function Ri(r){if(r.hasAttribute("data-chapter-list-init"))return;r.setAttribute("data-chapter-list-init","");let t=r.parentElement;if(!t||t.tagName!=="VIDEO")return;let e=r.track;e.mode==="disabled"&&(e.mode="hidden"),r.readyState>=2?Tr(t,e,r):r.addEventListener("load",()=>Tr(t,e,r),{once:!0})}function Tr(r,t,e){let i=t.cues;if(!i||i.length===0)return;let s=document.createElement("nav");s.setAttribute("aria-label",e.getAttribute("data-label")||"Video chapters"),s.classList.add("chapter-list");let n=document.createElement("ol");for(let a of i){let l=document.createElement("li"),c=document.createElement("button");c.type="button";let h=document.createElement("span");h.textContent=a.text;let u=document.createElement("time");u.textContent=kl(a.startTime),u.setAttribute("datetime",Al(a.startTime)),c.appendChild(h),c.appendChild(u),c.addEventListener("click",()=>{r.currentTime=a.startTime,r.paused&&r.play()?.catch(()=>{})}),l.appendChild(c),n.appendChild(l)}s.appendChild(n),r.insertAdjacentElement("afterend",s);let o=null;r.addEventListener("timeupdate",()=>{let a=r.currentTime,l=-1;for(let h=0;h<i.length;h++)if(a>=i[h].startTime&&a<i[h].endTime){l=h;break}let c=l>=0?n.children[l]:null;c!==o&&(o&&(o.removeAttribute("data-active"),o.querySelector("button")?.removeAttribute("aria-current")),o=c,o&&(o.setAttribute("data-active",""),o.querySelector("button")?.setAttribute("aria-current","true")))})}function kl(r){let t=Math.floor(r/3600),e=Math.floor(r%3600/60),i=Math.floor(r%60);return t>0?`${t}:${String(e).padStart(2,"0")}:${String(i).padStart(2,"0")}`:`${e}:${String(i).padStart(2,"0")}`}function Al(r){let t=Math.floor(r/3600),e=Math.floor(r%3600/60),i=Math.floor(r%60);return`PT${t?t+"H":""}${e?e+"M":""}${i}S`}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Cr()):Cr();var xl=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches?.(Mi)&&Ri(i),i.querySelectorAll?.(Mi).forEach(s=>Ri(s))}});xl.observe(document.documentElement,{childList:!0,subtree:!0});var ht="[data-command], [commandfor]",El="Page Actions",B=new Map;function te(r){if(B.has(r)||r.hasAttribute("data-command-init"))return;r.setAttribute("data-command-init","");let t=r.getAttribute("data-command")||r.textContent.trim();if(!t)return;let e=r.getAttribute("data-command-group")||El,i=r.getAttribute("data-command-icon")||null,s=r.getAttribute("data-shortcut")||null,n=null;s&&(n=G(s,()=>r.click()));let o={element:r,label:t,group:e,icon:i,shortcut:s,unbind:n};B.set(r,o),document.dispatchEvent(new CustomEvent("vb:command-registry-change",{detail:{action:"add",entry:o}}))}function _i(r){let t=B.get(r);t&&(t.unbind?.(),B.delete(r),r.removeAttribute("data-command-init"),document.dispatchEvent(new CustomEvent("vb:command-registry-change",{detail:{action:"remove",element:r}})))}function Sl(){let r=new Map;for(let t of B.values()){if(t.element.hidden||t.element.closest("[hidden]"))continue;let e=r.get(t.group)||[];e.push(t),r.set(t.group,e)}return r}function Lr(r=document){r.querySelectorAll(ht).forEach(te)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Lr()):Lr();var Cl=new MutationObserver(r=>{for(let t of r){for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches(ht)&&te(i),i.querySelectorAll(ht).forEach(te)}for(let e of t.removedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;B.has(i)&&_i(i),i.querySelectorAll(ht).forEach(s=>{B.has(s)&&_i(s)})}if(t.type==="attributes"&&t.target.nodeType===Node.ELEMENT_NODE){let e=t.target;e.matches(ht)&&!B.has(e)?te(e):!e.matches(ht)&&B.has(e)&&_i(e)}}});Cl.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-command","commandfor"]});function Tl(){let r='footer, aside, dialog, [hidden], [aria-hidden="true"]',e=[];return document.querySelectorAll("nav a[href]").forEach(i=>{if(i.closest(r)||B.has(i))return;let s=i.textContent.trim();!s||e.length>=50||e.push({element:i,label:s,group:"Navigation",icon:null,shortcut:null,auto:!0,action:null})}),document.querySelectorAll("h2[id], h3[id]").forEach(i=>{if(i.closest(r)||B.has(i))return;let s=i.textContent.trim();!s||e.length>=50||e.push({element:i,label:`Jump to: ${s}`,group:"On This Page",icon:null,shortcut:null,auto:!0,action:()=>i.scrollIntoView({behavior:"smooth"})})}),e}window.__commandRegistry={getRegisteredCommands:Sl,scanAutoDiscoverable:Tl};var Ll=window.matchMedia("(prefers-reduced-motion: reduce)");function Ml(){return Ll.matches||document.documentElement.hasAttribute("data-motion-reduced")}var Mr=0,Rl=new Map([["vb-fade-in","entrance"],["vb-slide-up","entrance"],["vb-pop","entrance"],["vb-slide-in-ltr","entrance"],["vb-slide-in-rtl","entrance"],["vb-fade-slide-up","entrance"],["vb-shadow-lift","entrance"],["vb-fade-out","exit"],["vb-collapse","exit"],["vb-slide-out-ltr","exit"],["vb-slide-out-rtl","exit"],["vb-shake","attention"],["vb-pulse","attention"],["vb-bounce","attention"],["vb-blink","attention"],["vb-neon-pulse","decoration"],["vb-3d-shift","decoration"],["vb-outline-glow-pulse","decoration"],["vb-rainbow","decoration"],["vb-gradient-flow","decoration"],["vb-shimmer","decoration"],["vb-shimmer-gradient","decoration"],["vb-glow","decoration"],["vb-float","decoration"]]),Rr="__vbEffectsRuntime",_r=globalThis,v=_r[Rr]??{_effects:new Map,_triggers:new Map,_transitions:new Map,_instances:new WeakMap,_triggerCleanups:new WeakMap,_wiredTriggers:new WeakMap,_transitionCleanups:new WeakMap,_transitionFallback:new WeakSet,_processed:new WeakSet,_transitionProcessed:new WeakSet,_staggerTime:new WeakSet,_unresolved:new Set,_warnedTriggers:new Set,_unresolvedTimer:null,_keyframePhase:Rl,_observer:null,_animationEndHandler:null,_autoBooted:!1,effect(r,t){this._effects.set(r,t),document.querySelectorAll("[data-effect]").forEach(e=>{if(!(e.getAttribute("data-effect")||"").split(/\s+/).includes(r))return;let s=!this._instances.get(e)?.has(r);this._initEffect(e,r),s&&e.hasAttribute("data-effect-active")&&this._instances.get(e)?.get(r)?.activate?.()})},trigger(r,t){this._triggers.set(r,t),document.querySelectorAll("[data-effect][data-trigger]").forEach(e=>{if(!this._processed.has(e))return;let i=e.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];this._wireTrigger(e,i)})},transition(r,t){this._transitions.set(r,t),document.querySelectorAll("[data-transition]").forEach(e=>{if(!this._transitionProcessed.has(e)||!this._transitionFallback.has(e))return;let i=e.getAttribute("data-transition")||"",s=i.indexOf(":");if((s>-1?i.slice(0,s):i)!==r)return;this._transitionFallback.delete(e);let n=e;n.style.viewTransitionName="";let o=t(e,s>-1?i.slice(s+1):null);o&&this._transitionCleanups.set(e,o)})},uid(r){return r.id?r.id:(r._vbUid||(Mr++,r._vbUid=`vb-${Mr}`),r._vbUid)},theme(r,t){this._themes=this._themes||new Map,this._themes.set(r,t)},applyTheme(r,t=document.documentElement){let e=this._themes?.get(r);if(e)for(let[i,s]of Object.entries(e))t.style.setProperty(i,s)},swap(r){if(!document.startViewTransition){r(),queueMicrotask(()=>this._dispatchVtDone(document.body));return}let t=document.startViewTransition(r);return t.updateCallbackDone.then(()=>{this._dispatchVtDone(document.body)}).catch(()=>{}),t},_dispatchVtDone(r){r.querySelectorAll('[data-trigger~="vt"]').forEach(t=>{this.emit(t,"vb:vt-update-done",{})})},activate(r){this._activateEffects(r)},deactivate(r){r.hasAttribute("data-effect-active")&&(r.removeAttribute("data-effect-active"),this.emit(r,"vb:phase-change",{active:!1}))},onPhaseEnd(r,t,e){let i=s=>{s.detail?.phase===t&&e(s.detail)};return r.addEventListener("vb:effect-phase-end",i),()=>r.removeEventListener("vb:effect-phase-end",i)},registerKeyframe(r,t){this._keyframePhase.set(r,t)},observe(r=document){if(r.querySelectorAll("[data-effect]").forEach(e=>this._processElement(e)),r.querySelectorAll("[data-stagger]").forEach(e=>this._processStagger(e)),r.querySelectorAll("[data-transition]").forEach(e=>this._processTransition(e)),this._observer)return;this._observer=new MutationObserver(e=>{let i=new Set;for(let s of e){if(s.type==="childList"){let n=s.target;n.hasAttribute?.("data-stagger")&&i.add(n);for(let o of s.addedNodes)o.nodeType===Node.ELEMENT_NODE&&this._processTree(o);for(let o of s.removedNodes)o.nodeType===Node.ELEMENT_NODE&&(o.isConnected||this._cleanupTree(o))}if(s.type==="attributes"){let n=s.target;s.attributeName==="data-effect"&&this._reconcileEffects(n),s.attributeName==="data-trigger"&&this._reconcileTrigger(n),s.attributeName==="data-stagger"&&(n.hasAttribute("data-stagger")?i.add(n):this._cleanupStagger(n)),s.attributeName==="data-transition"&&this._reconcileTransition(n)}}for(let s of i)s.isConnected&&this._processStagger(s)});let t=r===document?document.body:r;this._observer.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-effect","data-trigger","data-stagger","data-transition"]}),this._animationEndHandler||(this._animationEndHandler=e=>{let i=e.target;if(!(i instanceof Element)||!i.hasAttribute("data-effect"))return;let s=this._keyframePhase.get(e.animationName);s&&this.emit(i,"vb:effect-phase-end",{phase:s,animationName:e.animationName})},document.addEventListener("animationend",this._animationEndHandler))},disconnect(){this._observer&&(this._observer.disconnect(),this._observer=null),this._animationEndHandler&&(document.removeEventListener("animationend",this._animationEndHandler),this._animationEndHandler=null)},params(r){let t=getComputedStyle(r);return{get(e){return t.getPropertyValue(`--vb-${e}`).trim()},getNumber(e,i=0){let s=t.getPropertyValue(`--vb-${e}`).trim();return s?parseFloat(s):i},getTime(e,i=0){let s=t.getPropertyValue(`--vb-${e}`).trim();if(!s)return i;let n=parseFloat(s);return Number.isFinite(n)?/s\s*$/.test(s)&&!/ms\s*$/.test(s)?n*1e3:n:i},hasClass(e){return r.classList.contains(e)}}},emit(r,t,e={}){r.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:e}))},prefersReducedMotion:Ml,_processTree(r){r.hasAttribute?.("data-effect")&&this._processElement(r),r.hasAttribute?.("data-stagger")&&this._processStagger(r),r.hasAttribute?.("data-transition")&&this._processTransition(r),r.querySelectorAll?.("[data-effect]").forEach(t=>this._processElement(t)),r.querySelectorAll?.("[data-stagger]").forEach(t=>this._processStagger(t)),r.querySelectorAll?.("[data-transition]").forEach(t=>this._processTransition(t))},_cleanupTree(r){r.hasAttribute?.("data-effect")&&this._cleanupElement(r),r.hasAttribute?.("data-transition")&&this._cleanupTransition(r),r.querySelectorAll?.("[data-effect]").forEach(t=>this._cleanupElement(t)),r.querySelectorAll?.("[data-transition]").forEach(t=>this._cleanupTransition(t))},_processElement(r){if(this._processed.has(r))return;this._processed.add(r),r.removeAttribute("data-effect-processed"),r.removeAttribute("data-effect-armed");let t=r.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];for(let e of t)this._initEffect(r,e);this._wireTrigger(r,t)},_initEffect(r,t){let e=this._effects.get(t);if(!e)return;let i=this._instances.get(r);if(i?.has(t))return;let s=e(r);s&&(i||(i=new Map,this._instances.set(r,i)),typeof s=="function"?i.set(t,{cleanup:s}):i.set(t,s))},_parseTrigger(r){let t=r.indexOf(":");return t>-1?[r.slice(0,t),r.slice(t+1)]:[r,null]},_wireTrigger(r,t){let e=r.getAttribute("data-trigger");if(!e||!e.trim()){r.removeAttribute("data-effect-armed"),this._activateEffects(r);return}let i=e.split(/\s+/).filter(Boolean);this._wiredTriggers??=new WeakMap;let s=this._wiredTriggers.get(r);s||(s=new Set,this._wiredTriggers.set(r,s));let n=!1;for(let o of i){if(s.has(o))continue;let[a,l]=this._parseTrigger(o),c=this._triggers.get(a);if(!c){n=!0;continue}s.add(o);let h=c(r,()=>this._activateEffects(r),l);if(h){let u=this._triggerCleanups.get(r);if(u){let p=u;this._triggerCleanups.set(r,()=>{p(),h()})}else this._triggerCleanups.set(r,h)}}s.size&&r.setAttribute("data-effect-armed",""),n?(this._unresolved.add(r),this._scheduleUnresolvedCheck()):this._unresolved.delete(r)},_scheduleUnresolvedCheck(){if(this._unresolvedTimer)return;let r=()=>{this._unresolvedTimer=null,this._resolveUnknownTriggers()};typeof window>"u"||typeof window.addEventListener!="function"||(document.readyState==="complete"?this._unresolvedTimer=setTimeout(r,0):(this._unresolvedTimer=!0,window.addEventListener("load",()=>setTimeout(r,0),{once:!0})))},_resolveUnknownTriggers(){for(let r of[...this._unresolved]){if(this._unresolved.delete(r),!r.isConnected||!this._processed.has(r))continue;let e=(r.getAttribute("data-trigger")||"").split(/\s+/).filter(Boolean).filter(i=>!this._triggers.has(this._parseTrigger(i)[0]));if(e.length){for(let i of e){let s=this._parseTrigger(i)[0];this._warnedTriggers.has(s)||(this._warnedTriggers.add(s),console.warn(`[VB] data-trigger="${i}": no trigger named "${s}" is registered. The effect runs immediately instead. Register it with VB.trigger('${s}', \u2026) or check the spelling.`,r))}!r.hasAttribute("data-effect-armed")&&!r.hasAttribute("data-effect-active")&&this._activateEffects(r)}}},_activateEffects(r){r.setAttribute("data-effect-active",""),this.emit(r,"vb:phase-change",{active:!0});let t=this._instances.get(r);if(t)for(let[,e]of t)e.activate&&e.activate()},_cleanupElement(r){let t=this._instances.get(r);if(t){for(let[,i]of t)i.cleanup&&i.cleanup();this._instances.delete(r)}let e=this._triggerCleanups.get(r);e&&(e(),this._triggerCleanups.delete(r)),this._wiredTriggers?.delete(r),this._unresolved.delete(r),r.removeAttribute("data-effect-armed"),this._processed.delete(r)},_reconcileEffects(r){if(!r.hasAttribute("data-effect")){this._cleanupElement(r),r.removeAttribute("data-effect-active");return}let t=r.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[],e=this._instances.get(r);if(e)for(let[i,s]of e)t.includes(i)||(s.cleanup&&s.cleanup(),e.delete(i));for(let i of t)e?.has(i)||this._initEffect(r,i);this._processed.has(r)||this._processElement(r)},_reconcileTrigger(r){if(!r.hasAttribute("data-effect"))return;let t=this._triggerCleanups.get(r);if(t&&(t(),this._triggerCleanups.delete(r)),this._wiredTriggers?.delete(r),this._unresolved.delete(r),r.removeAttribute("data-effect-armed"),!this._processed.has(r)){this._processElement(r);return}let e=r.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];this._wireTrigger(r,e)},_parseStagger(r){let t=(r||"").trim().split(/\s+/).filter(Boolean),e=t.find(s=>/^(\d+(\.\d+)?|\.\d+)(ms|s)$/i.test(s))||null;return{mode:t.find(s=>s==="reverse"||s==="random"||s==="grid")||"",time:e}},_processStagger(r){let{mode:t,time:e}=this._parseStagger(r.getAttribute("data-stagger"));e?(r.style.setProperty("--vb-stagger",e),this._staggerTime.add(r)):this._staggerTime.has(r)&&(r.style.removeProperty("--vb-stagger"),this._staggerTime.delete(r));let i=Array.from(r.children),s=i.length,n;if(t==="reverse")n=Array.from({length:s},(o,a)=>s-1-a);else if(t==="random"){let o=this._hashString(this.uid(r));n=Array.from({length:s},(l,c)=>c);let a=o;for(let l=s-1;l>0;l--){a^=a<<13,a^=a>>>17,a^=a<<5;let c=Math.abs(a)%(l+1);[n[l],n[c]]=[n[c],n[l]]}}else t==="grid"?n=this._gridStaggerIndices(r,i):n=Array.from({length:s},(o,a)=>a);for(let o=0;o<s;o++)i[o].style.setProperty("--vb-stagger-index",String(n[o]))},_gridStaggerIndices(r,t){let e=t.length,i=()=>Array.from({length:e},(c,h)=>h);if(!e)return[];let s=t.map(c=>{let h=getComputedStyle(c);return[parseInt(h.gridRowStart,10),parseInt(h.gridColumnStart,10)]});if(s.every(([c,h])=>Number.isFinite(c)&&Number.isFinite(h))){let c=Math.min(...s.map(([u])=>u)),h=Math.min(...s.map(([,u])=>u));return s.map(([u,p])=>u-c+(p-h))}let n=t.map(c=>c.getBoundingClientRect?.());if(!n.every(Boolean)||n.every(c=>c.width===0&&c.height===0))return i();let o=getComputedStyle(r).direction==="rtl",a=this._trackRanks(n.map(c=>[c.top,c.bottom])),l=this._trackRanks(n.map(c=>o?[-c.right,-c.left]:[c.left,c.right]));return a.map((c,h)=>c+l[h])},_trackRanks(r){let t=r.map((n,o)=>o).sort((n,o)=>r[n][0]-r[o][0]),e=new Array(r.length),i=-1,s=-1/0;for(let n of t){let[o,a]=r[n];o>=s-.5?(i++,s=a):s=Math.min(s,a),e[n]=i}return e},_cleanupStagger(r){this._staggerTime.has(r)&&(r.style.removeProperty("--vb-stagger"),this._staggerTime.delete(r));for(let t of Array.from(r.children))t.style?.removeProperty("--vb-stagger-index")},_hashString(r){let t=5381;for(let e=0;e<r.length;e++)t=(t<<5)+t^r.charCodeAt(e);return t|0},_vtIdent(r){let t=String(r).replace(/[^A-Za-z0-9_ -￿-]/g,"-");return(!t||/^(-?\d|--)/.test(t))&&(t=`vb-${t}`),t},_processTransition(r){if(this._transitionProcessed.has(r)||r.matches?.("[data-swap], content-swap"))return;let t=(r.getAttribute("data-transition")||"").trim();if(!t)return;this._transitionProcessed.add(r),r.removeAttribute("data-transition-processed");let[e,i]=this._parseTrigger(t),s=this._transitions.get(e);if(s){let n=s(r,i);n&&this._transitionCleanups.set(r,n)}else r.style.viewTransitionName=this._vtIdent(`${e}-${this.uid(r)}`),this._transitionFallback.add(r)},_cleanupTransition(r){if(!this._transitionProcessed.has(r))return;let t=this._transitionCleanups.get(r);t&&(t(),this._transitionCleanups.delete(r)),this._transitionFallback.has(r)&&(this._transitionFallback.delete(r),r.style.viewTransitionName=""),this._transitionProcessed.delete(r)},_reconcileTransition(r){this._cleanupTransition(r),r.hasAttribute("data-transition")&&this._processTransition(r)}};_r[Rr]=v;if(typeof window<"u"){let r=window.VB;if(r&&r!==v)for(let t of Object.keys(r))t in v||(v[t]=r[t]);window.VB=v}typeof document<"u"&&!v._autoBooted&&(v._autoBooted=!0,document.body?v.observe():document.addEventListener("DOMContentLoaded",()=>v.observe(),{once:!0}));function ee(r,t){v.deactivate(r),r.offsetWidth,t()}function Ni(r,t){if(v.prefersReducedMotion()){t();return}let e=new IntersectionObserver(([i])=>{i.isIntersecting&&(e.disconnect(),t())},{threshold:.1});return e.observe(r),()=>e.disconnect()}function _l(r){let t=(r||"0").trim(),e=parseFloat(t);return!Number.isFinite(e)||e<0?0:/^[\d.]+s$/i.test(t)?e*1e3:e}v.trigger("scroll",(r,t)=>Ni(r,t));v.trigger("hover",(r,t)=>{let e=!1,i=!1;function s(h){let u=e||i;h==="hover"?e=!0:i=!0,u||ee(r,t)}function n(){!e&&!i&&v.deactivate(r)}let o=()=>s("hover"),a=()=>{e=!1,n()},l=()=>s("focus"),c=h=>{h.relatedTarget instanceof Node&&r.contains(h.relatedTarget)||(i=!1,n())};return r.addEventListener("pointerenter",o),r.addEventListener("pointerleave",a),r.addEventListener("focusin",l),r.addEventListener("focusout",c),()=>{r.removeEventListener("pointerenter",o),r.removeEventListener("pointerleave",a),r.removeEventListener("focusin",l),r.removeEventListener("focusout",c)}});v.trigger("click",(r,t,e)=>{function i(){e==="replay"?ee(r,t):r.hasAttribute("data-effect-active")?v.deactivate(r):t()}return r.addEventListener("click",i),()=>r.removeEventListener("click",i)});v.trigger("time",(r,t,e)=>{let i=setTimeout(t,_l(e));return()=>clearTimeout(i)});v.trigger("intersect",(r,t,e)=>{if(v.prefersReducedMotion()){t();return}if((e||"once")==="toggle"){let s=new IntersectionObserver(([n])=>{n.isIntersecting?t():v.deactivate(r)},{threshold:.1});return s.observe(r),()=>s.disconnect()}return Ni(r,t)});v.trigger("media",(r,t,e)=>{if(!e)return;let i=window.matchMedia(e);function s(){i.matches?t():v.deactivate(r)}return i.addEventListener("change",s),s(),()=>i.removeEventListener("change",s)});v.trigger("event",(r,t,e)=>{if(!e)return;let i=()=>ee(r,t);return r.addEventListener(e,i),()=>r.removeEventListener(e,i)});v.trigger("vt",(r,t)=>{let e=()=>ee(r,t);return r.addEventListener("vb:vt-update-done",e),()=>r.removeEventListener("vb:vt-update-done",e)});var Nl=typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()");for(let r of["view-progress","scroll-progress"])v.trigger(r,(t,e)=>{if(!(Nl&&!v.prefersReducedMotion()))return Ni(t,e)});var Pl=12;function et(r,t,e){let i=v.uid(t),s=e===void 0?`${r}-${i}`:`${r}-${i}-${e}`;return typeof CSS<"u"&&CSS.escape?CSS.escape(s):s.replace(/[^\w-]/g,"_")}function ut(r,t,e){return r.style.viewTransitionName=t,e&&(r.style.viewTransitionClass=e),()=>{r.style.viewTransitionName="",e&&(r.style.viewTransitionClass="")}}v.transition("morph",r=>ut(r,et("morph",r)));function Il(r,t){let e=(t||"forward").trim().toLowerCase();if(e==="left")return"slide-left";if(e==="right")return"slide-right";let s=!(getComputedStyle(r).direction==="rtl");return(e==="back"?!s:s)?"slide-left":"slide-right"}v.transition("slide",(r,t)=>ut(r,et("slide",r),Il(r,t)));v.transition("fade",r=>ut(r,et("fade",r),"fade"));v.transition("scale",r=>ut(r,et("scale",r),"scale"));v.transition("none",r=>ut(r,et("none",r),"vt-none"));function $l(r){let t=new Set,e=()=>{let s=Array.from(r.children);for(let n of t)n.parentElement!==r&&(n.style.viewTransitionName="",n.style.viewTransitionClass="",t.delete(n));s.forEach((n,o)=>{if(!(n instanceof HTMLElement))return;let a=Math.min(o,Pl-1);n.style.viewTransitionName=et("stagger",r,v.uid(n)),n.style.viewTransitionClass=`fade vt-stagger-${a}`,t.add(n)})};e();let i=new MutationObserver(e);return i.observe(r,{childList:!0}),()=>{i.disconnect();for(let s of t)s.style.viewTransitionName="",s.style.viewTransitionClass="";t.clear()}}v.transition("stagger",r=>$l(r));v.transition("effect",(r,t)=>{let e=(t||"fade").trim();return ut(r,et("effect",r),/^-?[_a-zA-Z][\w-]*$/.test(e)?e:"fade")});var Nr="data-effect-glitch-init";v.effect("glitch",r=>(r.setAttribute("data-glitch-text",(r.textContent||"").trim()),r.setAttribute(Nr,""),{cleanup(){r.removeAttribute(Nr),r.removeAttribute("data-glitch-text")}}));var ie="vb-split-sr",Pi="vb-split";function zl(r){return r.closest?.("[lang]")?.getAttribute("lang")||void 0}function dt(r,t){if(typeof Intl<"u"&&"Segmenter"in Intl)try{let e=new Intl.Segmenter(t,{granularity:"grapheme"});return Array.from(e.segment(r),i=>i.segment)}catch{}return Array.from(r)}function Bl(r,t){let e=[],i;if(typeof Intl<"u"&&"Segmenter"in Intl)try{i=Array.from(new Intl.Segmenter(t,{granularity:"word"}).segment(r))}catch{i=null}if(!i){for(let n of r.split(/(\s+)/))n&&e.push({text:n,space:/^\s+$/.test(n)});return e}let s="";for(let n of i){if(/^\s+$/.test(n.segment)){s&&(e.push({text:s,space:!1}),s=""),e.push({text:n.segment,space:!0});continue}let o=e[e.length-1];if(!n.isWordLike){o&&!o.space?o.text+=n.segment:s+=n.segment;continue}e.push({text:s+n.segment,space:!1}),s=""}return s&&e.push({text:s,space:!1}),e}function P(r){for(let t of r.querySelectorAll(`.${ie}`)){let e=t.nextElementSibling;e?.classList.contains(Pi)&&e.remove(),t.replaceWith(document.createTextNode(t.textContent||""))}r.normalize()}function Pr(r){let t=r.querySelectorAll(`.${ie}`);return t.length?Array.from(t,e=>e.textContent).join(""):r.textContent||""}function pt(r,{unit:t="word",className:e="",locale:i}={}){P(r);let s=i||zl(r),n=[],o=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,{acceptNode(c){let h=c.parentElement;return h&&h.closest("script, style, template, svg, math")?NodeFilter.FILTER_REJECT:c.nodeValue&&c.nodeValue.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});for(;o.nextNode();)n.push(o.currentNode);let a=[],l=c=>{let h=document.createElement("span");return e&&(h.className=e),h.textContent=c,a.push(h),h};for(let c of n){let h=c.nodeValue||"",u=document.createElement("span");u.className=ie,u.textContent=h;let p=document.createElement("span");if(p.className=Pi,p.setAttribute("aria-hidden","true"),t==="grapheme")for(let d of dt(h,s)){let f=l(d);/^\s+$/.test(d)&&f.setAttribute("data-space",""),p.append(f)}else for(let d of Bl(h,s))p.append(d.space?document.createTextNode(d.text):l(d.text));c.replaceWith(u,p)}return a}function Ir(r,t){P(r);let e=document.createElement("span");e.className=ie,e.textContent=t;let i=document.createElement("span");return i.className=Pi,i.setAttribute("aria-hidden","true"),r.replaceChildren(e,i),i}function Ii(r){let t=0,e=null;for(let i of r){let s=i.getBoundingClientRect(),n=s.top;e!==null&&n-e>s.height/2&&t++,e=n,i.style.setProperty("--i",String(t))}return r.length?t+1:0}var $i="data-effect-blur-reveal-init";v.effect("blur-reveal",r=>{let t=r;if(P(t),t.removeAttribute($i),v.prefersReducedMotion())return{cleanup(){}};t.style.setProperty("--blur-delay",v.params(t).get("blur-reveal-delay")||"80ms");let e=pt(t,{className:"vb-blur-chunk"});e.forEach((s,n)=>s.style.setProperty("--i",String(n))),t.setAttribute($i,"");let i=null;if(t.classList.contains("line")){Ii(e);let s=t.clientWidth;i=new ResizeObserver(()=>{t.clientWidth!==s&&(s=t.clientWidth,Ii(e))}),i.observe(t)}return{activate(){t.setAttribute("data-effect-active","")},cleanup(){i?.disconnect(),P(t),t.removeAttribute($i),t.style.removeProperty("--blur-delay")}}});var zi="data-effect-typewriter-init",jl=2e3,Ol=400,Dl=200;v.effect("typewriter",r=>{let t=r;if(P(t),t.querySelectorAll(":scope > .vb-typewriter-cursor").forEach(u=>u.remove()),t.removeAttribute(zi),v.prefersReducedMotion())return{cleanup(){}};let e=pt(t,{unit:"grapheme",className:"vb-typewriter-char"});t.setAttribute(zi,"");let i=0,s=null,n=()=>{clearTimeout(i),i=0},o=()=>!!t.closest("[data-paused]"),a=(u,p)=>{i=window.setTimeout(function d(){if(o()){i=window.setTimeout(d,Dl);return}u()},p)},l=u=>e.forEach((p,d)=>{p.hidden=d>=u}),c=(u,p)=>{let d=u+p;for(;d>0&&d<e.length&&e[d-1].hasAttribute("data-space");)d+=p;return d};function h(){n();let u=v.params(t),p=u.getTime("typewriter-speed",50),d=u.getTime("typewriter-delay",0),f=t.classList.contains("loop");!s&&!t.classList.contains("no-cursor")&&(s=document.createElement("span"),s.className="vb-typewriter-cursor",s.textContent="|",s.setAttribute("aria-hidden","true"),t.append(s));let m=0;l(0);let y=()=>{m<e.length?(m=c(m,1),l(m),a(y,p)):f&&a(w,jl)},w=()=>{m>0?(m=Math.max(0,c(m,-1)),l(m),a(w,p/2)):a(y,Ol)};a(y,d)}return{activate(){h()},cleanup(){n(),s?.remove(),s=null,P(t),t.removeAttribute(zi)}}});var Bi="data-effect-scramble-init",Fl="!<>-_\\/[]{}=+*^?#";function ql(r){let t=v.params(r).get("scramble-chars"),e=/^(['"])(.*)\1$/.exec(t);e&&(t=e[2]);let i=dt(t);return i.length?i:dt(Fl)}var Hl=r=>r[Math.floor(Math.random()*r.length)];v.effect("scramble",r=>{let t=r;if(P(t),t.removeAttribute(Bi),v.prefersReducedMotion())return{cleanup(){}};let e=pt(t,{unit:"grapheme",className:"vb-scramble-char"}),i=e.map(c=>c.textContent||""),s=e.flatMap((c,h)=>c.hasAttribute("data-space")?[]:[h]);t.setAttribute(Bi,"");let n=0,o=()=>{clearTimeout(n),n=0},a=()=>e.forEach((c,h)=>{c.textContent=i[h]});function l(){o();let c=v.params(t),h=c.getTime("scramble-duration",1500),u=Math.max(1,c.getTime("scramble-speed",30)),p=ql(t),d=Math.max(1,Math.ceil(h/u)),f=0,m=()=>{let y=Math.floor(f/d*s.length);s.forEach((w,k)=>{e[w].textContent=k<y?i[w]:Hl(p)}),f++,f<=d?n=window.setTimeout(m,u):a()};m()}return{activate(){l()},cleanup(){o(),P(t),t.removeAttribute(Bi)}}});var $r="animate-image-wrapper";function Ul(r){let t=(r.getAttribute("alt")||"").trim(),e=q(r,"animation-pause","Pause animation");return e.includes("{alt}")?e.replace("{alt}",t).trim():t?`${e}: ${t}`:e}v.effect("animate-image",r=>{let t=r;if(t.tagName!=="IMG"||!t.parentNode)return{cleanup(){}};t.removeAttribute("data-effect-animate-image-init"),t.hasAttribute("alt")||console.warn("[animate-image] Image has no alt text; describe what the animation shows.",t);let e=t.getAttribute("data-animate-image-src");if(e){t.src=e;let C=t.getAttribute("data-animate-image-srcset");C&&(t.srcset=C),t.removeAttribute("data-animate-image-src"),t.removeAttribute("data-animate-image-srcset")}let i=t.parentElement?.tagName==="PICTURE"?t.parentElement:null,s=i||t,n=i?[...i.querySelectorAll(":scope > source")]:[],o=s.parentElement?.classList.contains($r)?s.parentElement:null,a=o||document.createElement("span");o?a.querySelectorAll(":scope > .animate-image-toggle, :scope > .animate-image-placeholder").forEach(C=>C.remove()):(a.className=$r,s.parentNode?.insertBefore(a,s),a.appendChild(s));let l=document.createElement("span");l.className="animate-image-placeholder",l.hidden=!0,a.appendChild(l);let c=document.createElement("button");c.type="button",c.className="animate-image-toggle",c.setAttribute("aria-pressed","false"),c.setAttribute("aria-label",Ul(t)),a.appendChild(c);let h=t.hasAttribute("data-animate-image-paused"),u=t.getAttribute("data-poster"),p=!1,d=!1,f=null;function m(){if(u||!t.naturalWidth)return;let C=document.createElement("canvas");C.width=t.naturalWidth,C.height=t.naturalHeight;let I=C.getContext("2d");if(I)try{I.drawImage(t,0,0),u=C.toDataURL("image/png")}catch{u=null}}function y(){c.setAttribute("aria-pressed",String(p)),c.classList.toggle("paused",p),t.toggleAttribute("data-animate-image-paused",p)}function w({auto:C=!1}={}){if(!p){if(m(),p=!0,d=C,f={src:t.currentSrc||t.src,srcset:t.getAttribute("srcset"),sizes:t.getAttribute("sizes"),sources:n.map(I=>[I,I.getAttribute("srcset"),I.getAttribute("sizes")])},t.setAttribute("data-animate-image-src",t.getAttribute("src")||f.src),f.srcset&&t.setAttribute("data-animate-image-srcset",f.srcset),u){for(let[I]of f.sources)I.removeAttribute("srcset"),I.removeAttribute("sizes");t.removeAttribute("srcset"),t.removeAttribute("sizes"),t.src=u}else l.textContent=t.getAttribute("alt")||"",l.hidden=!1,a.setAttribute("data-animate-image-hidden","");y()}}function k(){if(p){if(p=!1,d=!1,f){for(let[C,I,qi]of f.sources)I!=null&&C.setAttribute("srcset",I),qi!=null&&C.setAttribute("sizes",qi);f.sizes!=null&&t.setAttribute("sizes",f.sizes),f.srcset!=null&&t.setAttribute("srcset",f.srcset),t.src=t.getAttribute("data-animate-image-src")||f.src}f=null,t.removeAttribute("data-animate-image-src"),t.removeAttribute("data-animate-image-srcset"),l.hidden=!0,a.removeAttribute("data-animate-image-hidden"),y()}}c.addEventListener("click",()=>p?k():w());function A(C){t.complete&&t.naturalWidth?C():t.addEventListener("load",C,{once:!0})}A(m),h?A(()=>w()):v.prefersReducedMotion()&&A(()=>w({auto:!0}));let T=()=>{v.prefersReducedMotion()?A(()=>w({auto:!0})):d&&k()},j=window.matchMedia("(prefers-reduced-motion: reduce)");j.addEventListener("change",T);let R=new MutationObserver(T);return R.observe(document.documentElement,{attributes:!0,attributeFilter:["data-motion-reduced"]}),{cleanup(){j.removeEventListener("change",T),R.disconnect(),p&&k(),t.toggleAttribute("data-animate-image-paused",h),c.remove(),l.remove(),a.parentNode&&(a.parentNode.insertBefore(s,a),a.remove())}}});var zr="vb-stamp-noise",ft="http://www.w3.org/2000/svg";function Vl(){if(document.getElementById(zr))return;let r=document.createElementNS(ft,"svg");r.setAttribute("aria-hidden","true"),r.setAttribute("focusable","false"),r.setAttribute("width","0"),r.setAttribute("height","0"),r.style.position="absolute",r.style.overflow="hidden";let t=document.createElementNS(ft,"filter");t.id=zr;for(let[o,a]of Object.entries({x:"-5%",y:"-5%",width:"110%",height:"110%"}))t.setAttribute(o,a);let e=document.createElementNS(ft,"feTurbulence");for(let[o,a]of Object.entries({type:"fractalNoise",baseFrequency:"0.75",numOctaves:"4",stitchTiles:"stitch",result:"noise"}))e.setAttribute(o,a);let i=document.createElementNS(ft,"feColorMatrix");for(let[o,a]of Object.entries({type:"saturate",values:"0",in:"noise",result:"greyNoise"}))i.setAttribute(o,a);let s=document.createElementNS(ft,"feComposite");for(let[o,a]of Object.entries({in:"SourceGraphic",in2:"greyNoise",operator:"in"}))s.setAttribute(o,a);t.append(e,i,s);let n=document.createElementNS(ft,"defs");n.append(t),r.append(n),document.body.prepend(r)}v.effect("stamp",()=>(Vl(),{cleanup(){}}));var Br="data-effect-flipboard-init",se=" ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,:!?/-",Wl=60,Kl=30,Gl=80,W="\xA0",jr=new WeakMap;function Yl(){let r=document.createElement("span");r.className="vb-flap-char";for(let e of["top","bottom","flip-top","flip-bottom"]){let i=document.createElement("span");i.className=`vb-flap-${e}`;let s=document.createElement("span");s.className="vb-flap-text",s.textContent=W,i.append(s),r.append(i)}let t=document.createElement("span");return t.className="vb-flap-hinge",r.append(t),r}function Or(r,t){for(let e of r.querySelectorAll(".vb-flap-text"))e.textContent=t||W}function re(r,t){return new Promise(e=>{let i=window.setTimeout(()=>{r.timers.delete(i),e(void 0)},t);r.timers.add(i)})}async function Xl(r,t,e,i,s){let n=t.querySelector(".vb-flap-top .vb-flap-text"),o=t.querySelector(".vb-flap-bottom .vb-flap-text"),a=t.querySelector(".vb-flap-flip-top"),l=t.querySelector(".vb-flap-flip-bottom");n.textContent=e||W,o.textContent=e||W,a.querySelector(".vb-flap-text").textContent=e||W,l.querySelector(".vb-flap-text").textContent=i||W,a.classList.add("vb-flap-flipping"),l.classList.add("vb-flap-flipping"),await re(r,s/2),n.textContent=i||W,await re(r,s/2),o.textContent=i||W,a.classList.remove("vb-flap-flipping"),l.classList.remove("vb-flap-flipping")}async function Jl(r,t,e,i,s,n){for(let o=0;o<i;o++){if(r.generation!==s)return;let a=o===i-1,l=se[o%se.length],c=a?e:se[(o+1)%se.length];await Xl(r,t,l,c,n),a||await re(r,Kl)}}function Dr(r){r.generation++;for(let t of r.timers)clearTimeout(t);r.timers.clear()}function Zl(r,t){let e=Ir(r,t.original);return r.classList.add("vb-flap-board"),t.chars.map(()=>e.appendChild(Yl()))}function Ql(r,t){Dr(t);let e=r,i=v.params(e).getTime("flip-ms",Wl);e.style.setProperty("--_vb-flip-duration",`${i}ms`);let s=Zl(r,t),n=t.generation;if(v.prefersReducedMotion()){s.forEach((o,a)=>Or(o,t.chars[a]));return}Promise.all(s.map(async(o,a)=>{if(await re(t,a*Gl),t.generation!==n)return;let l=4+Math.floor(Math.random()*7);await Jl(t,o,t.chars[a],l,n,i)})).then(()=>{t.generation===n&&s.forEach((o,a)=>Or(o,t.chars[a]))})}v.effect("flipboard",r=>{let t=Pr(r).trim();if(P(r),r.classList.remove("vb-flap-board"),!t)return{cleanup(){}};let e={original:t,chars:dt(t.toLocaleUpperCase(r.closest("[lang]")?.getAttribute("lang")||void 0)),generation:0,timers:new Set};return jr.set(r,e),r.setAttribute(Br,""),Ql(r,e),{cleanup(){Dr(e),jr.delete(r),r.textContent=e.original,r.classList.remove("vb-flap-board"),r.removeAttribute(Br),r.style.removeProperty("--_vb-flip-duration")}}});var ne=new Map,ji=null,oe=!1;function tc(r){for(let[t,e]of ne)r.querySelectorAll(t).forEach(e)}function ec(r){if(r.nodeType!==Node.ELEMENT_NODE)return;let t=r;for(let[e,i]of ne)t.matches(e)&&i(t),t.querySelectorAll(e).forEach(i)}function ic(){ji||(ji=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes)ec(e)}),ji.observe(document.documentElement,{childList:!0,subtree:!0}))}function sc(){oe||(oe=!0,tc(document))}function Fr(r,t){ne.set(r,t),ic(),oe||document.readyState!=="loading"?(oe=!0,document.querySelectorAll(r).forEach(t)):ne.size===1&&document.addEventListener("DOMContentLoaded",sc)}var K=null;async function rc(){if(K)return;K=(await Promise.resolve().then(()=>(ye(),ve))).resolveEmoji}var Hr="[data-emoji]",Ur=/(?<![\p{L}\p{N}_]):([a-z0-9_+-]+):/gu,nc=/[a-z]/,oc="script,style,code,pre,kbd,samp,var,textarea,code-block,[data-emoji-skip]",Oi=["alt","title","aria-label"],Vr=new Set(["INPUT","TEXTAREA"]),ac=100,lc=new Set(["insertFromPaste","insertFromDrop","insertReplacementText","insertFromYank"]),it=new WeakMap;function Di(r,t="keep"){if(!K||!r.includes(":"))return r;let e=K;return r.replace(Ur,(i,s)=>{let n=e(s);return n?n.emoji:t==="strip"&&nc.test(s)?"":i})}function cc(r){return r.getAttribute("data-emoji-unknown")==="strip"?"strip":"keep"}function hc(r){if(it.has(r)||!r.hasAttribute("data-emoji"))return;if(r.removeAttribute("data-emoji-init"),Vr.has(r.tagName)){it.set(r,dc(r));return}if(Fi(r),r.getAttribute("data-emoji-scan")!=="observe"){it.set(r,()=>{});return}let t=null,e=new MutationObserver(()=>{t&&clearTimeout(t),t=setTimeout(()=>{t=null,Fi(r)},ac)});e.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:Oi}),it.set(r,()=>{e.disconnect(),t&&clearTimeout(t)})}function uc(r){let t=it.get(r);t&&(t(),it.delete(r))}function dc(r){let t=!1,e=!1,i=()=>{t=!0},s=()=>{t=!1,o(!0)},n=a=>{let{isComposing:l,inputType:c}=a;t||l||c==="historyUndo"||c==="historyRedo"||o(!!c&&!lc.has(c))};function o(a=!1){if(!e){e=!0;try{pc(r,a)}finally{e=!1}}}return r.addEventListener("compositionstart",i),r.addEventListener("compositionend",s),r.addEventListener("input",n),r.value&&o(),()=>{r.removeEventListener("compositionstart",i),r.removeEventListener("compositionend",s),r.removeEventListener("input",n)}}function pc(r,t=!1){if(!K)return;let e=r.value,i=r.selectionStart,s=[];for(let a of e.matchAll(Ur)){let l=a.index??0,c=l+a[0].length;if(t&&i!==null&&c!==i)continue;let h=K(a[1]);h&&s.push({start:l,end:c,emoji:h.emoji})}if(s.length===0)return;if(r.selectionStart===null){r.value=Di(e,"keep");return}let n=r.selectionStart??e.length,o=document.activeElement===r&&typeof document.execCommand=="function";for(let a=s.length-1;a>=0;a--){let{start:l,end:c,emoji:h}=s[a];n>=c?n-=c-l-h.length:n>l&&(n=l+h.length);let u=!1;if(o){r.setSelectionRange(l,c);try{u=document.execCommand("insertText",!1,h)&&r.value.slice(l,l+h.length)===h}catch{u=!1}}u||r.setRangeText(h,l,c)}r.setSelectionRange(n,n)}function qr(r,t){if(r.isContentEditable)return!0;let e=r.closest(oc);return!!(e&&e!==t&&t.contains(e))}function Fi(r){if(!K)return;let t=cc(r),e=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,{acceptNode(o){let a=o.parentElement;return!a||qr(a,r)?NodeFilter.FILTER_REJECT:(o.textContent??"").includes(":")?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),i=[];for(;e.nextNode();)i.push(e.currentNode);for(let o of i){let a=o.textContent??"",l=Di(a,t);l!==a&&(o.textContent=l)}let s=Oi.map(o=>`[${o}*=":"]`).join(","),n=[r,...r.querySelectorAll(s)];for(let o of n)if(!(o!==r&&qr(o,r)))for(let a of Oi){let l=o.getAttribute(a);if(!l)continue;let c=Di(l,t);c!==l&&o.setAttribute(a,c)}}document.addEventListener("vb:emoji-extended",()=>{if(K)for(let r of document.querySelectorAll(Hr))!it.has(r)||Vr.has(r.tagName)||Fi(r)});function Wr(r){rc().then(()=>hc(r))}Fr(Hr,Wr);new MutationObserver(r=>{for(let{target:t}of r){let e=t;e.hasAttribute("data-emoji")?Wr(e):uc(e)}}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-emoji"],subtree:!0});
1320
+ }`)}function Ja(r){for(let t of r)tt.set(t,(tt.get(t)??0)+1);yr()}function Za(r){for(let t of r){let e=(tt.get(t)??0)-1;e>0?tt.set(t,e):tt.delete(t)}yr()}function Qa(r){let t=Lt.get(r),e=t?[...t.values()].flat():[];e.length===0?(CSS.highlights.delete(`hn-${r}`),Lt.delete(r)):CSS.highlights.set(`hn-${r}`,new Highlight(...e))}function mr(r,t){let e=new Set(t.keys());for(let[i,s]of Lt)s.has(r)&&e.add(i);for(let i of e){let s=t.get(i)??[],n=Lt.get(i);s.length?(n||Lt.set(i,n=new Map),n.set(r,s)):n?.delete(r),Qa(i)}}function gr(r,t,e){let i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT),s=0;for(;i.nextNode();){if(i.currentNode===t)return s+e;s+=(i.currentNode.textContent??"").length}return-1}function Xt(r,t,e){let i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT),s=0,n=null,o=0,a=null,l=0;for(;i.nextNode();){let c=i.currentNode,h=(c.textContent??"").length;if(!n&&s+h>t&&(n=c,o=t-s),s+h>=e){a=c,l=e-s;break}s+=h}if(!n||!a)return null;try{let c=document.createRange();return c.setStart(n,Math.min(o,(n.textContent??"").length)),c.setEnd(a,Math.min(l,(a.textContent??"").length)),c}catch{return null}}var Ai=class{#t;#e;#i;#s;#r=[];#n=!Ka;#a;#c;#h=!1;#l=[];#o=new Map;constructor(t){this.#t=t,this.#s=t.hasAttribute("data-highlights-readonly");let e=t.dataset.highlights;this.#e=e&&e!==""?e:location.pathname;let i=t.dataset.highlightsColors,s=i?i.split(",").map(n=>n.trim()).filter(ki):[...Wa];this.#i=[...new Set(s)],this.#n||Ja(this.#i),this.#w(),this.#s||(this.#a=this.#p.bind(this),this.#c=this.#d.bind(this),t.addEventListener("pointerup",this.#a),t.addEventListener("click",this.#c)),t.setAttribute("data-highlights-init",""),this.#m().then(()=>{this.#h||this.#w()})}get colors(){return[...this.#i]}get destroyed(){return this.#h}get element(){return this.#t}getHighlights(){return this.#r.map(t=>({...t}))}removeHighlight(t){let e=this.#r.findIndex(i=>i.id===t);e<0||(this.#r.splice(e,1),this.#v(),this.#w(),this.#x("highlights:removed",{id:t}),ot(Yt(this.#t,"removed")))}clearAll(){this.#r=[],this.#v(),this.#w()}exportHighlights(){return JSON.stringify({version:1,highlights:this.#r})}importHighlights(t){let e;try{e=typeof t=="string"?JSON.parse(t):t}catch{return{imported:0,rejected:0}}if(!e||!Array.isArray(e.highlights))return{imported:0,rejected:0};let i=this.#u(e.highlights);return this.#r=i,this.#v(),this.#w(),{imported:i.length,rejected:e.highlights.length-i.length}}#u(t){let e={textLength:(this.#t.textContent??"").length,colors:this.#i},i=new Set,s=[];for(let n of t){let o=Xa(n,e);!o||i.has(o.id)||(i.add(o.id),s.push(o))}return s}destroy(){this.#h||(this.#h=!0,this.#a&&this.#t.removeEventListener("pointerup",this.#a),this.#c&&this.#t.removeEventListener("click",this.#c),this.#n?this.#t.querySelectorAll("mark[data-hn-id]").forEach(t=>{let e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t),e.normalize()}):(mr(this,new Map),Za(this.#i)),this.#T(),this.#o.clear(),this.#t.removeAttribute("data-highlights-init"),Jt.get(this.#t)===this&&Jt.delete(this.#t))}#p(){requestAnimationFrame(()=>{if(this.#h)return;let t=window.getSelection();if(!t||t.isCollapsed||!t.toString().trim())return;let e=t.getRangeAt(0);this.#t.contains(e.commonAncestorContainer)&&this.#x("highlights:selected",{text:t.toString().trim(),rect:e.getBoundingClientRect()})})}#d(t){let e=t.target.closest?.(".hn-margin-annotation");if(e){let s=e.dataset.hnId,n=this.#r.find(o=>o.id===s);if(n){this.#x("highlights:clicked",{id:s,highlight:{...n}}),this.#x("highlights:request-note",{id:s,highlight:{...n},controller:this});return}}let i=t.target.closest?.("mark[data-hn-id]");if(i){let s=i.dataset.hnId,n=this.#r.find(o=>o.id===s);if(n){this.#x("highlights:clicked",{id:s,highlight:{...n}});return}}if(!this.#n){let s=this.#y(t.clientX,t.clientY);s&&this.#x("highlights:clicked",{id:s.id,highlight:{...s}})}}findHighlightRect(t){let e=this.#r.find(n=>n.id===t);if(!e)return null;let i=this.#f(e);if(!i)return null;let s=i.getClientRects();return s.length?s[0]:null}#f(t){return this.#o.get(t.id)??Xt(this.#t,t.startOffset,t.endOffset)}#k(){this.#o.clear();for(let t of this.#r){let e=Xt(this.#t,t.startOffset,t.endOffset);e&&this.#o.set(t.id,e)}}#y(t,e){for(let i of this.#r){let s=this.#o.get(i.id);if(!s)continue;let n=s.getClientRects();for(let o of n)if(t>=o.left&&t<=o.right&&e>=o.top&&e<=o.bottom)return i}return null}_createFromSelection(t){let e=window.getSelection();if(!e||e.isCollapsed)return;let i=e.getRangeAt(0);if(!this.#t.contains(i.commonAncestorContainer))return;let s=gr(this.#t,i.startContainer,i.startOffset),n=gr(this.#t,i.endContainer,i.endOffset);if(s<0||n<0||s>=n)return;let o=e.toString().trim(),a={id:vr(),startOffset:s,endOffset:n,text:o,color:t,note:"",created:Date.now()};this.#r.push(a),this.#v(),this.#w(),e.removeAllRanges(),this.#x("highlights:added",{id:a.id,text:o,color:t,note:""}),ot(Yt(this.#t,"added"))}_changeColor(t,e){let i=this.#r.find(s=>s.id===t);i&&(i.color=e,this.#v(),this.#w())}_updateNote(t,e){let i=this.#r.find(s=>s.id===t);i&&(i.note=e,this.#v(),this.#A(),this.#x("highlights:note-changed",{id:t,note:e}),ot(Yt(this.#t,"noteSaved")))}async#m(){let t=await _.get(dr,this.#e);if(!t||!Array.isArray(t.highlights)||this.#h)return;let e=this.#u(t.highlights),i=pr(this.#t.textContent);t.contentHash&&t.contentHash!==i?(this.#r=e.filter(s=>{let n=Xt(this.#t,s.startOffset,s.endOffset);return n?n.toString().trim()===s.text:!1}),this.#v()):this.#r=e}#v(){let t={version:1,contentHash:pr(this.#t.textContent),highlights:this.#r};_.set(dr,this.#e,t).catch(()=>{})}#w(){this.#n?(this.#b(),this.#k()):(this.#k(),this.#g()),this.#A()}#g(){let t=new Map;for(let e of this.#i)t.set(e,[]);for(let e of this.#r){let i=this.#o.get(e.id);i&&t.has(e.color)&&t.get(e.color).push(i)}mr(this,t)}#b(){this.#t.querySelectorAll("mark[data-hn-id]").forEach(e=>{let i=e.parentNode;for(;e.firstChild;)i.insertBefore(e.firstChild,e);i.removeChild(e)}),this.#t.normalize();let t=[...this.#r].sort((e,i)=>i.startOffset-e.startOffset);for(let e of t){let i=Xt(this.#t,e.startOffset,e.endOffset);if(!i)continue;let s=document.createElement("mark");s.dataset.hnId=e.id,ki(e.color)&&(s.dataset.hnColor=e.color,s.style.setProperty("--_hn-color",`var(--highlight-${e.color})`),s.style.setProperty("--_hn-ink",`var(--highlight-${e.color}-ink, var(--highlight-ink))`));try{i.surroundContents(s)}catch{let n=i.extractContents();s.appendChild(n),i.insertNode(s)}}}#T(){for(let t of this.#l)t.remove();this.#l=[]}#A(){if(this.#T(),this.#r.length===0)return;getComputedStyle(this.#t).position==="static"&&(this.#t.style.position="relative");let e=this.#t.getBoundingClientRect(),i=Yt(this.#t,"annotation");for(let s of this.#r){let n=this.#o.get(s.id);if(!n)continue;let o=n.getClientRects();if(o.length===0)continue;let a=o[0].top-e.top,l=document.createElement("span");if(l.className="hn-margin-annotation",l.dataset.hnId=s.id,l.setAttribute("aria-hidden","true"),l.style.insetBlockStart=`${a}px`,s.note){let c=document.createElement("span");c.className="hn-note-indicator",c.textContent="*",l.append(c,` ${i}`),l.classList.add("hn-has-note")}else l.textContent=i;this.#t.appendChild(l),this.#l.push(l)}}#x(t,e={}){this.#t.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0}))}};function H(r){let t=Jt.get(r);if(t&&!t.destroyed)return t;let e=new Ai(r);return Jt.set(r,e),e}function br(r=document){r.querySelectorAll(wi).forEach(t=>{t.hasAttribute("data-highlights-init")||H(t)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>br()):br();var tl=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches(wi)&&H(i),i.querySelectorAll(wi).forEach(s=>{s.hasAttribute("data-highlights-init")||H(s)})}});tl.observe(document.documentElement,{childList:!0,subtree:!0});var el=["yellow","green","blue","pink"],il=/^[a-z0-9_-]+$/i,sl=["annotation","added","removed"],rl=0,xi=class extends b{#t=null;#e=null;#i="yellow";#s=null;#r=null;#n=!1;#a=null;setup(){this.#s=this.closest("selection-menu");let t=this.#y();t.includes(this.#i)||(this.#i=t[0]??"yellow"),this.#s?this.#c():this.#f()}teardown(){this.#t?.destroy(),this.#t=null,this.#a?.remove(),this.#a=null,this.#n?this.#r?.remove():this.#r?.removeAttribute("aria-expanded"),this.#r=null,this.#n=!1,this.#s=null}#c(){let t=this.hasAttribute("readonly");for(let n of this.#p())this.#d(n);if(t)return;let e=this.#y(),i=this.querySelector(":scope > button");if(this.#n=!i,!i){i=document.createElement("button"),i.type="button",i.setAttribute("aria-label",this.dataset.labelButton||"Highlight selection");let n=document.createElement("icon-wc");n.setAttribute("name","highlighter"),n.setAttribute("size","sm"),n.setAttribute("aria-hidden","true"),i.appendChild(n),this.appendChild(i)}this.#r=i;let s=document.createElement("div");s.className="highlight-color-dropdown",s.id=`highlight-palette-${++rl}`,s.setAttribute("role","group"),s.setAttribute("aria-label",this.dataset.labelPalette||"Highlight color"),s.hidden=!0;for(let n of e){let o=document.createElement("button");o.type="button",o.className="highlight-color-swatch",o.dataset.color=n,o.title=n,o.setAttribute("aria-label",n),o.setAttribute("aria-pressed",String(n===this.#i)),o.style.setProperty("--_swatch",`var(--highlight-${n})`),s.appendChild(o)}this.appendChild(s),this.#a=s,i.setAttribute("aria-expanded","false"),i.setAttribute("aria-controls",s.id),this.listen(i,"click",n=>{n.stopPropagation(),this.#h(s.hidden)}),this.listen(s,"click",n=>{let o=n.target.closest?.(".highlight-color-swatch");o&&(n.stopPropagation(),this.#o(o.dataset.color??this.#i),this.#h(!1),this.#u(this.#i))}),this.listen(this,"keydown",n=>{let o=n;o.key!=="Escape"||s.hidden||(o.stopPropagation(),this.#h(!1),i.focus())}),this.listen(document,"pointerdown",n=>{!s.hidden&&!this.contains(n.target)&&this.#h(!1)}),this.listen(this.#s,"selection-menu:dismiss",()=>this.#h(!1))}#h(t){!this.#a||!this.#r||(this.#a.hidden=!t,this.#r.setAttribute("aria-expanded",String(t)),t&&(this.#l(),(this.#a.querySelector('[aria-pressed="true"]')??this.#a.firstElementChild)?.focus({preventScroll:!0})))}#l(){let t=this.#a;if(!t)return;t.style.removeProperty("--_hn-shift");let{left:e,right:i}=t.getBoundingClientRect(),s=8,n=e<s?s-e:i>window.innerWidth-s?window.innerWidth-s-i:0;n&&t.style.setProperty("--_hn-shift",`${n}px`)}#o(t){this.#i=t,this.#a?.querySelectorAll(".highlight-color-swatch").forEach(e=>e.setAttribute("aria-pressed",String(e.dataset.color===t)))}#u(t){let e=this.#s,i=e?.getSelection?.();if(!i?.target)return;let s=this.#d(i.target);if(!s)return;let n=window.getSelection();n&&(n.isCollapsed||!n.rangeCount)&&i.range&&(n.removeAllRanges(),n.addRange(i.range)),s._createFromSelection(t),this.#e=i.target,e.dismiss?.()}#p(){let t=this.#s;if(!t)return[];let e=new Set,i=t.getAttribute("for"),s=i&&document.getElementById(i);return s&&e.add(s),t.id&&document.querySelectorAll(`[data-selection-menu="${CSS.escape(t.id)}"]`).forEach(n=>e.add(n)),[...e]}#d(t){t.hasAttribute("data-highlights-init")||(t.setAttribute("data-highlights",this.getAttribute("storage-key")||""),this.hasAttribute("colors")&&t.setAttribute("data-highlights-colors",this.getAttribute("colors")??""));for(let i of sl){let s=this.getAttribute(`data-label-${i}`);s&&t.setAttribute(`data-highlights-label-${i}`,s)}let e=H(t);return this.hasAttribute("readonly")&&!t.hasAttribute("data-highlights-readonly")&&(t.setAttribute("data-highlights-readonly",""),e.destroy(),e=H(t)),e}#f(){let t=this.#k();t&&(this.#t=this.#d(t))}#k(){let t=this.getAttribute("for");return t?document.getElementById(t):this.firstElementChild}#y(){let t=this.getAttribute("colors"),e=t?t.split(",").map(i=>i.trim()).filter(i=>il.test(i)):[];return e.length?[...new Set(e)]:[...el]}#m(){if(this.#t&&!this.#t.destroyed)return this.#t;let t=this.#e?.isConnected?this.#e:this.#p()[0];return t?this.#d(t):null}highlightSelection(t=this.#i){this.hasAttribute("readonly")||!this.#y().includes(t)||(this.#o(t),this.#s?this.#u(t):this.#t?._createFromSelection(t))}getHighlights(){return this.#m()?.getHighlights()??[]}removeHighlight(t){this.#m()?.removeHighlight(t)}clearAll(){this.#m()?.clearAll()}exportHighlights(){return this.#m()?.exportHighlights()??'{"version":1,"highlights":[]}'}importHighlights(t){return this.#m()?.importHighlights(t)??{imported:0,rejected:0}}};g("highlight-wc",xi);var Zt=CSS.supports("anchor-name","--x"),nl=CSS.supports("position-area","bottom"),ol=(()=>{let r=document.createElement("span");return r.setAttribute("popover","hint"),r.popover==="hint"})(),al=["auto","manual","hint"];function ll(r){let t=al.includes(r||"")?r:"auto";return t==="hint"&&!ol?"auto":t}var cl=["top","bottom","left","right","inset-inline-start","inset-inline-end"],hl=["position","top","left","right","bottom","margin"],wr=8,ul=0,dl=0;function kr(r){return!r||r==="none"?[]:r.split(",").map(t=>t.trim()).filter(Boolean)}var Ei=class extends b{static get observedAttributes(){return["data-mode","data-anchor","data-position"]}#t=null;#e=null;#i=`--pop-over-anchor-${++dl}`;#s=!1;#r=!1;#n=!1;setup(){if(this.id||(this.id=`pop-over-${++ul}`),(!this.hasAttribute("popover")||this.#s)&&this.#a(),this.#c(),this.#h(),this.listen(this,"beforetoggle",t=>{let e=t.newState==="open"?"show":"hide";this.dispatchEvent(new CustomEvent(`pop-over:${e}`,{detail:{state:t.newState},bubbles:!0,composed:!0})),!Zt&&t.newState==="open"&&this.#t&&queueMicrotask(()=>{this.matches(":popover-open")&&this.#u()})}),!Zt){let t=()=>{this.matches(":popover-open")&&this.#t&&this.#u()};this.listen(window,"resize",t),this.listen(window,"scroll",t,{capture:!0,passive:!0})}}teardown(){this.#l(),this.#r&&(cl.forEach(t=>this.style.removeProperty(t)),this.#r=!1),this.#n&&(hl.forEach(t=>this.style.removeProperty(t)),this.#n=!1),this.#t=null}attributeChangedCallback(t,e,i){if(e!==i){if(!this.hasAttribute("data-upgraded")){t==="data-mode"&&this.hasAttribute("popover")&&!this.isConnected&&(this.#s=!0);return}if(t==="data-mode"){this.#a();return}this._reinit()}}#a(){let t=ll(this.dataset.mode);this.getAttribute("popover")!==t&&this.setAttribute("popover",t),this.#s=!0}show(){this.matches(":popover-open")||(this.showPopover(),!Zt&&this.#t&&this.matches(":popover-open")&&this.#u())}hide(){this.matches(":popover-open")&&this.hidePopover()}toggle(){this.matches(":popover-open")?this.hide():this.show()}get open(){return this.matches(":popover-open")}#c(){let t=this.dataset.anchor;if(t){let e=document.getElementById(t);if(!e)try{e=document.querySelector(t)}catch{e=null}this.#t=e}else this.#t=document.querySelector(`[popovertarget="${CSS.escape(this.id)}"]`)}#h(){if(!this.#t||!Zt)return;let t=this.#t,e=t.style.getPropertyValue("anchor-name"),i=kr(e||getComputedStyle(t).getPropertyValue("anchor-name"));i.includes(this.#i)||i.push(this.#i),t.style.setProperty("anchor-name",i.join(", ")),this.#e=this.#i,this.style.setProperty("position-anchor",this.#i),this.setAttribute("data-anchor-name",this.#i),nl||this.#o(this.dataset.position||"bottom")}#l(){if(this.#t&&this.#e){let t=kr(this.#t.style.getPropertyValue("anchor-name")).filter(e=>e!==this.#e);t.length?this.#t.style.setProperty("anchor-name",t.join(", ")):this.#t.style.removeProperty("anchor-name")}this.#e=null,this.style.getPropertyValue("position-anchor")&&this.style.removeProperty("position-anchor"),this.hasAttribute("data-anchor-name")&&this.removeAttribute("data-anchor-name")}#o(t){let e="var(--_pop-over-offset, var(--size-xs))",i=t.endsWith("-end")?{"inset-inline-end":"anchor(end)"}:{"inset-inline-start":"anchor(start)"},s={top:{bottom:`calc(anchor(top) + ${e})`,...i},bottom:{top:`calc(anchor(bottom) + ${e})`,...i},left:{right:`calc(anchor(left) + ${e})`,top:"anchor(top)"},right:{left:`calc(anchor(right) + ${e})`,top:"anchor(top)"}},n=t.split("-")[0],o=s[n]||s.bottom;Object.entries(o).forEach(([a,l])=>this.style.setProperty(a,l)),this.#r=!0}#u(){if(!this.#t)return;let t=this.#t.getBoundingClientRect(),e=this.dataset.position||"bottom",i=this.#p(),s=document.documentElement.clientWidth,n=document.documentElement.clientHeight;this.style.position="fixed",this.style.margin="0",this.style.right="auto",this.style.bottom="auto",this.#n=!0;let o=this.offsetWidth,a=this.offsetHeight,l=e.split("-")[0];["top","bottom","left","right"].includes(l)||(l="bottom");let c={top:t.top-i,bottom:n-t.bottom-i,left:t.left-i,right:s-t.right-i},h={top:"bottom",bottom:"top",left:"right",right:"left"},u=l==="top"||l==="bottom"?a:o;c[l]<u&&c[h[l]]>c[l]&&(l=h[l]);let p,d;switch(l){case"top":p=t.top-a-i,d=t.left;break;case"left":p=t.top,d=t.left-o-i;break;case"right":p=t.top,d=t.right+i;break;default:p=t.bottom+i,d=t.left;break}if(l==="top"||l==="bottom"){let m=getComputedStyle(this).direction==="rtl";d=e.endsWith("-end")!==m?t.right-o:t.left}else e.endsWith("-end")&&(p=t.bottom-a);let f=(m,y,w)=>Math.max(wr,Math.min(m,w-y-wr));d=f(d,o,s),p=f(p,a,n),this.style.top=`${Math.round(p)}px`,this.style.left=`${Math.round(d)}px`}#p(){let t={none:0,xs:4,s:8,m:16,l:24};return t[this.dataset.offset||""]??t.xs}};g("pop-over",Ei);var Ar=8,Qt=8,pl=300,fl="Text selection actions",xr="F10",ml='button:not([disabled]), a[href], [role="button"]:not([aria-disabled="true"])',gl='[role="group"], [role="menu"], [role="listbox"], [role="radiogroup"], dialog, [popover]:not([data-selection-menu-host])',bl=0,Si=class extends b{#t=null;#e=new Set;#i=!1;#s;#r=null;#n=null;#a=null;#c=0;#h=!1;#l="mouse";#o="pointer";#u=!1;#p=new Set;setup(){let t=this.querySelector(":scope > pop-over[data-selection-menu-host]");if(t)this.#s=t;else{this.#s=document.createElement("pop-over"),this.#s.setAttribute("data-selection-menu-host",""),this.#s.dataset.mode="manual",this.#s.id=`selection-menu-${++bl}`;let e=[...this.children];for(let i of e)i!==this.#s&&this.#s.appendChild(i);this.appendChild(this.#s)}this.#s.setAttribute("role","toolbar"),this.#s.setAttribute("aria-orientation","horizontal"),this.#s.setAttribute("aria-label",this.dataset.label||fl),this.#s.setAttribute("aria-keyshortcuts",`Alt+${xr}`),this.hidden=!1,this.#d(),this.listen(document,"pointerup",this.#f),this.listen(document,"pointerdown",this.#T),this.listen(document,"keydown",this.#A),this.listen(document,"keyup",this.#k),this.listen(document,"selectionchange",this.#y),this.listen(window,"scroll",this.#g,{capture:!0,passive:!0}),this.listen(window,"resize",this.#g),this.listen(this.#s,"keydown",this.#L),this.id&&(this.#r=new MutationObserver(()=>this.#d()),this.#r.observe(document.body,{childList:!0,subtree:!0,attributeFilter:["data-selection-menu"]}))}teardown(){this.#r?.disconnect(),this.#r=null,this.#a&&clearTimeout(this.#a),this.#a=null,cancelAnimationFrame(this.#c),this.#n?.getAttribute("data-selection-menu")===this.id&&this.#n.removeAttribute("data-selection-menu"),this.#n=null;for(let t of this.#p)t.removeAttribute("tabindex");this.#p.clear(),this.#i=!1,this.#t=null,this.#h=!1}getSelection(){return this.#t?{...this.#t}:null}dismiss(){this.#i&&this.#b({restoreFocus:!0})}get actions(){return[...(this.#s||this).children].map(e=>({tag:e.tagName.toLowerCase(),attrs:Object.fromEntries([...e.attributes].map(i=>[i.name,i.value])),html:e.innerHTML||void 0}))}set actions(t){let e=Array.isArray(t)?t:[],i=this.#s||this;for(;i.firstChild;)i.firstChild.remove();this.#p.clear();for(let s of e){if(s instanceof Element){i.appendChild(s);continue}if(!s?.tag)continue;let n=document.createElement(s.tag);if(s.attrs)for(let[o,a]of Object.entries(s.attrs))a==null||a===!1||n.setAttribute(o,a===!0?"":String(a));s.html&&(n.innerHTML=s.html),i.appendChild(n)}this.dispatchEvent(new CustomEvent("selection-menu:actions-changed",{detail:{actions:this.actions,source:"property"},bubbles:!0}))}#d(){this.#e.clear();let t=this.getAttribute("for");if(t){let e=document.getElementById(t);e&&(this.#e.add(e),this.id&&!e.hasAttribute("data-selection-menu")&&(e.setAttribute("data-selection-menu",this.id),this.#n=e))}this.id&&document.querySelectorAll(`[data-selection-menu="${CSS.escape(this.id)}"]`).forEach(e=>{this.#e.add(e)})}#f=t=>{this.#h=!1,this.#l=t.pointerType||"mouse",requestAnimationFrame(()=>{this.isConnected&&this.#m()})};#k=t=>{!t.shiftKey&&t.key!=="Shift"||this.#s?.contains(document.activeElement)||(this.#l="keyboard",this.#m())};#y=()=>{this.#h||this.#u||(this.#a&&clearTimeout(this.#a),this.#a=setTimeout(()=>{if(this.#a=null,!this.isConnected||this.#h||this.#u||this.#s?.contains(document.activeElement))return;let t=window.getSelection();if(!t||t.isCollapsed||!t.toString().trim()){this.#i&&this.#o==="keyboard"&&this.#b({restoreFocus:!1});return}this.#o==="keyboard"&&(this.#l="keyboard"),this.#m()},pl))};#m(){let t=window.getSelection();if(!t||t.rangeCount===0||t.isCollapsed||!t.toString().trim())return!1;let e=t.getRangeAt(0),i=e.commonAncestorContainer,s=i.nodeType===Node.ELEMENT_NODE?i:i.parentElement,n=null;for(let c of this.#e)if(c.contains(s)){n=c;break}if(!n)return!1;let o=t.toString().trim(),a=this.#t,l=this.#i&&a&&a.target===n&&a.text===o&&a.range.compareBoundaryPoints(Range.START_TO_START,e)===0&&a.range.compareBoundaryPoints(Range.END_TO_END,e)===0;return this.#t={range:e.cloneRange(),text:o,target:n},l||this.dispatchEvent(new CustomEvent("selection-menu:select",{detail:{range:this.#t.range,text:o,target:n},bubbles:!0})),this.#v(),!0}#v(){this.#s&&(this.#s.show(),this.#i=!0,this.#S(),cancelAnimationFrame(this.#c),this.#c=requestAnimationFrame(()=>this.#w()))}#w(){if(!this.#i||!this.#t||!this.#s)return;let t=this.#t.range.getBoundingClientRect();if(t.bottom<0||t.top>window.innerHeight||t.width===0&&t.height===0){this.#b({restoreFocus:!0});return}let i=this.#s.getBoundingClientRect(),s=i.width||200,n=i.height||40,o=t.top-n-Ar,a=t.bottom+Ar,l;this.#l==="touch"?l=a+n+Qt<=window.innerHeight?a:o:l=o<Qt?a:o;let c=t.left+t.width/2-s/2,h=window.innerWidth-s-Qt;c=Math.max(Qt,Math.min(c,h)),this.#s.style.top=`${l}px`,this.#s.style.left=`${c}px`}#g=()=>{this.#i&&(cancelAnimationFrame(this.#c),this.#c=requestAnimationFrame(()=>this.#w()))};#b({restoreFocus:t=!1,restoreRange:e=!1}={}){let i=this.#t,s=!!this.#s?.contains(document.activeElement);if(this.#s&&this.#s.hide(),this.#i=!1,this.#t=null,cancelAnimationFrame(this.#c),this.#u=!0,this.dispatchEvent(new CustomEvent("selection-menu:dismiss",{bubbles:!0})),t&&s&&i?.target?.isConnected){let n=i.target;if(n.hasAttribute("tabindex")||(n.setAttribute("tabindex","-1"),n.addEventListener("blur",()=>{n.getAttribute("tabindex")==="-1"&&n.removeAttribute("tabindex")},{once:!0})),n.focus({preventScroll:!0}),e){let o=window.getSelection();o&&(o.removeAllRanges(),o.addRange(i.range))}}}#T=t=>{if(this.#h=!0,this.#o="pointer",this.#u=!1,!this.#i)return;let e=t.target;this.#s?.contains(e)||this.contains(e)||this.#b()};#A=t=>{if(["Shift","Alt","Control","Meta"].includes(t.key)||(this.#u=!1),this.#o="keyboard",!t.defaultPrevented){if(t.key==="Escape"&&this.#i){t.preventDefault(),this.#b({restoreFocus:!0,restoreRange:!0});return}if(t.key===xr&&t.altKey&&!t.ctrlKey&&!t.metaKey){if(!this.#i&&(this.#l="keyboard",!this.#m()))return;t.preventDefault(),this.#E(0)}}};#x(){return this.#s?[...this.#s.querySelectorAll(ml)].filter(t=>{let e=t.closest(gl);if(e&&this.#s.contains(e))return!1;let i=t.closest("[hidden]");return!(i&&this.#s.contains(i))}):[]}#S(){let t=this.#x(),e=t.find(i=>i===document.activeElement)??t.find(i=>i.getAttribute("tabindex")==="0")??t[0];for(let i of t)i.setAttribute("tabindex",i===e?"0":"-1"),this.#p.add(i)}#E(t){this.#S();let e=this.#x();if(!e.length)return;let i=(t%e.length+e.length)%e.length;for(let s of e)s.setAttribute("tabindex",s===e[i]?"0":"-1");e[i].focus()}#L=t=>{let e=t.target;if(e.matches('input, textarea, select, [contenteditable]:not([contenteditable="false"])'))return;let i=this.#x(),s=i.indexOf(e);if(s===-1)return;let n=getComputedStyle(this.#s).direction==="rtl",o=n?"ArrowLeft":"ArrowRight",a=n?"ArrowRight":"ArrowLeft",l=-1;if(t.key===o)l=s+1;else if(t.key===a)l=s-1;else if(t.key==="Home")l=0;else if(t.key==="End")l=i.length-1;else return;t.preventDefault(),this.#E(l)}};g("selection-menu",Si);var vl={add:"Add private note",view:"View notes",dialog:"Private note",heading:"Private note",placeholder:"Add a note\u2026",textarea:"Note for highlighted text",save:"Save",cancel:"Cancel"},Er=!1,Ci=new Set;function Sr(r,t,e){if(!r.contains(t))return-1;let i=document.createRange();return i.setStart(r,0),i.setEnd(t,e),i.toString().length}var Ti=class extends b{#t=!1;#e=null;#i=null;#s=null;#r=null;#n=null;setup(){this.#t=!!this.closest("selection-menu");let t=this.hasAttribute("for");Ci.add(this),Er||(Er=!0,document.addEventListener("highlights:request-note",yl));let e=this.querySelector(":scope > button[data-note-action]");if(!this.#t&&!t){e?.remove();return}if(!e){e=document.createElement("button"),e.type="button",e.setAttribute("data-note-action","");let i=document.createElement("icon-wc");i.setAttribute("name","sticky-note"),i.setAttribute("size","sm"),i.setAttribute("aria-hidden","true"),e.appendChild(i),this.appendChild(e)}e.setAttribute("aria-label",this.#a(this.#t?"add":"view")),this.listen(e,"click",this.#t?()=>this.#c():()=>this.#h())}teardown(){Ci.delete(this),this.#d({restoreFocus:!1})}#a(t){return this.getAttribute(`data-label-${t}`)??vl[t]??t}openFor(t,e,i){this.#l(t,e,i??document.activeElement)}#c(){let t=this.closest("selection-menu");if(!t)return;let e=t.getSelection();if(!e)return;let i=e.target,s=document.activeElement;i.hasAttribute("data-highlights-init")||i.setAttribute("data-highlights","");let n=H(i),o=e.range,a=Sr(i,o.startContainer,o.startOffset),l=Sr(i,o.endContainer,o.endOffset),c=null;if(a>=0&&l>a&&(c=n.getHighlights().find(h=>h.startOffset<=a&&h.endOffset>=l)??null),!c){let h=window.getSelection();h&&(h.isCollapsed||h.rangeCount===0)&&(h.removeAllRanges(),h.addRange(o)),n._createFromSelection("yellow");let u=n.getHighlights();c=u.find(p=>p.startOffset===a&&p.endOffset===l)??u[u.length-1]??null}t.dismiss(),c&&this.#l(c,n,s)}#h(){let t=this.getAttribute("for"),e=t?document.getElementById(t):null;if(!e)return;e.hasAttribute("data-highlights-init")||e.setAttribute("data-highlights","");let i=H(e),s=i.getHighlights(),n=s.find(o=>o.note)??s[0];n&&this.#l(n,i,document.activeElement)}#l(t,e,i){this.#d({restoreFocus:!1});let s=e.element;this.#i=i&&i!==document.body?i:null,this.#s=t,this.#r=e;let n=document.createElement("div");n.className="hn-note-panel",n.setAttribute("role","dialog"),n.setAttribute("aria-label",this.#a("dialog"));let o=document.createElement("header");o.className="hn-note-header";let a=document.createElement("small");a.textContent=this.#a("heading"),o.appendChild(a),n.appendChild(o);let l=document.createElement("blockquote");l.className="hn-note-quote",l.textContent=t.text.length>80?t.text.slice(0,80)+"\u2026":t.text,n.appendChild(l);let c=document.createElement("textarea");c.className="hn-note-textarea",c.placeholder=this.#a("placeholder"),c.value=t.note||"",c.rows=3,c.setAttribute("aria-label",this.#a("textarea")),n.appendChild(c);let h=document.createElement("footer");h.className="hn-note-actions";let u=()=>{e._updateNote(t.id,c.value.trim()),this.#d()},p=document.createElement("button");p.type="button",p.className="hn-action hn-action-save",p.textContent=this.#a("save"),p.addEventListener("click",u);let d=document.createElement("button");if(d.type="button",d.className="hn-action",d.textContent=this.#a("cancel"),d.addEventListener("click",()=>this.#d()),h.append(p,d),n.appendChild(h),n.addEventListener("keydown",f=>{f.key==="Escape"?(f.preventDefault(),f.stopPropagation(),this.#d()):f.key==="Enter"&&(f.metaKey||f.ctrlKey)&&f.target===c&&(f.preventDefault(),u())}),getComputedStyle(s).position==="static"&&(s.setAttribute("data-note-host",""),this.#n=s),s.appendChild(n),typeof e.findHighlightRect=="function"){let f=e.findHighlightRect(t.id);if(f){let m=s.getBoundingClientRect();n.style.top=`${f.top-m.top}px`}}this.#e=n,requestAnimationFrame(()=>{this.#e===n&&(c.focus(),document.addEventListener("pointerdown",this.#o))})}#o=t=>{if(!this.#e||this.#e.contains(t.target))return;this.#d({restoreFocus:!1});let e=this.#u;document.addEventListener("pointerup",()=>{setTimeout(()=>{let i=document.activeElement;(!i||i===document.body)&&e?.()})},{once:!0,capture:!0})};#u=null;#p(){let t=this.#i,e=this.#r?.element,i=this.#s?.id;return()=>{if(t?.isConnected&&(typeof t.checkVisibility!="function"||t.checkVisibility())&&(t.focus({preventScroll:!0}),document.activeElement===t)||!e?.isConnected)return;let n=(i?e.querySelector(`mark[data-hn-id="${CSS.escape(i)}"]`):null)??e;n.tabIndex<0&&!n.hasAttribute("tabindex")&&(n.setAttribute("tabindex","-1"),n.addEventListener("blur",()=>n.removeAttribute("tabindex"),{once:!0})),n.focus({preventScroll:!0})}}#d({restoreFocus:t=!0}={}){if(!this.#e)return;let e=this.#p();document.removeEventListener("pointerdown",this.#o),this.#e.remove(),this.#e=null,this.#n?.removeAttribute("data-note-host"),this.#n=null,this.#u=e,this.#i=null,this.#s=null,this.#r=null,t&&e()}};function yl(r){let{highlight:t,controller:e}=r.detail||{};if(!t||!e)return;let i=Ci.values().next().value;i&&i.openFor(t,e)}g("note-wc",Ti);var wl=0,Li=class extends b{#t=null;#e=null;setup(){if(this.#t=this.querySelector(":scope > button"),this.#e=this.querySelector(":scope > .comment-wc-reason"),!this.#t){let e=document.createElement("button");e.type="button";let i=document.createElement("icon-wc");i.setAttribute("name","message-circle"),i.setAttribute("size","sm"),i.setAttribute("aria-hidden","true"),e.appendChild(i);let s=document.createElement("span");s.className="comment-wc-reason visually-hidden",s.id=`comment-wc-reason-${++wl}`,s.textContent="Comments are unavailable: this content has no review surface.",this.append(e,s),this.#t=e,this.#e=s}this.#s(),this.listen(this,"click",this.#r);let t=this.closest("selection-menu");t&&this.listen(t,"toggle",()=>this.#s())}#i(){let t=this.closest("review-surface");if(t)return t;let e=this.closest("selection-menu")?.getAttribute("for");return e?document.querySelector(`review-surface[for="${CSS.escape(e)}"]`):null}#s(){let t=this.#t;if(!t)return;!!this.#i()?(t.removeAttribute("aria-disabled"),t.removeAttribute("aria-describedby"),t.setAttribute("aria-label","Add comment")):(t.setAttribute("aria-disabled","true"),t.setAttribute("aria-label","Add comment"),this.#e&&t.setAttribute("aria-describedby",this.#e.id))}#r=t=>{if(!this.#t?.contains(t.target))return;this.#s();let e=this.#i();if(!e)return;let i=this.closest("selection-menu");if(!i)return;let s=i.getSelection();if(!s)return;let n=s.range.getBoundingClientRect(),o=e.getBoundingClientRect(),a=(n.left+n.width/2-o.left)/o.width*100,l=(n.top-o.top)/o.height*100;typeof e.addPin=="function"&&e.addPin({x:a,y:l,text:s.text}),this.dispatchEvent(new CustomEvent("comment-wc:created",{detail:{text:s.text,x:a,y:l},bubbles:!0})),i.dismiss()}};g("comment-wc",Li);var Mi='track[kind="chapters"][data-chapter-list]';function Cr(r=document){r.querySelectorAll(Mi).forEach(t=>Ri(t))}function Ri(r){if(r.hasAttribute("data-chapter-list-init"))return;r.setAttribute("data-chapter-list-init","");let t=r.parentElement;if(!t||t.tagName!=="VIDEO")return;let e=r.track;e.mode==="disabled"&&(e.mode="hidden"),r.readyState>=2?Tr(t,e,r):r.addEventListener("load",()=>Tr(t,e,r),{once:!0})}function Tr(r,t,e){let i=t.cues;if(!i||i.length===0)return;let s=document.createElement("nav");s.setAttribute("aria-label",e.getAttribute("data-label")||"Video chapters"),s.classList.add("chapter-list");let n=document.createElement("ol");for(let a of i){let l=document.createElement("li"),c=document.createElement("button");c.type="button";let h=document.createElement("span");h.textContent=a.text;let u=document.createElement("time");u.textContent=kl(a.startTime),u.setAttribute("datetime",Al(a.startTime)),c.appendChild(h),c.appendChild(u),c.addEventListener("click",()=>{r.currentTime=a.startTime,r.paused&&r.play()?.catch(()=>{})}),l.appendChild(c),n.appendChild(l)}s.appendChild(n),r.insertAdjacentElement("afterend",s);let o=null;r.addEventListener("timeupdate",()=>{let a=r.currentTime,l=-1;for(let h=0;h<i.length;h++)if(a>=i[h].startTime&&a<i[h].endTime){l=h;break}let c=l>=0?n.children[l]:null;c!==o&&(o&&(o.removeAttribute("data-active"),o.querySelector("button")?.removeAttribute("aria-current")),o=c,o&&(o.setAttribute("data-active",""),o.querySelector("button")?.setAttribute("aria-current","true")))})}function kl(r){let t=Math.floor(r/3600),e=Math.floor(r%3600/60),i=Math.floor(r%60);return t>0?`${t}:${String(e).padStart(2,"0")}:${String(i).padStart(2,"0")}`:`${e}:${String(i).padStart(2,"0")}`}function Al(r){let t=Math.floor(r/3600),e=Math.floor(r%3600/60),i=Math.floor(r%60);return`PT${t?t+"H":""}${e?e+"M":""}${i}S`}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Cr()):Cr();var xl=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches?.(Mi)&&Ri(i),i.querySelectorAll?.(Mi).forEach(s=>Ri(s))}});xl.observe(document.documentElement,{childList:!0,subtree:!0});var ht="[data-command], [commandfor]",El="Page Actions",B=new Map;function te(r){if(B.has(r)||r.hasAttribute("data-command-init"))return;r.setAttribute("data-command-init","");let t=r.getAttribute("data-command")||r.textContent.trim();if(!t)return;let e=r.getAttribute("data-command-group")||El,i=r.getAttribute("data-command-icon")||null,s=r.getAttribute("data-shortcut")||null,n=null;s&&(n=G(s,()=>r.click()));let o={element:r,label:t,group:e,icon:i,shortcut:s,unbind:n};B.set(r,o),document.dispatchEvent(new CustomEvent("vb:command-registry-change",{detail:{action:"add",entry:o}}))}function _i(r){let t=B.get(r);t&&(t.unbind?.(),B.delete(r),r.removeAttribute("data-command-init"),document.dispatchEvent(new CustomEvent("vb:command-registry-change",{detail:{action:"remove",element:r}})))}function Sl(){let r=new Map;for(let t of B.values()){if(t.element.hidden||t.element.closest("[hidden]"))continue;let e=r.get(t.group)||[];e.push(t),r.set(t.group,e)}return r}function Lr(r=document){r.querySelectorAll(ht).forEach(te)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Lr()):Lr();var Cl=new MutationObserver(r=>{for(let t of r){for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;i.matches(ht)&&te(i),i.querySelectorAll(ht).forEach(te)}for(let e of t.removedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let i=e;B.has(i)&&_i(i),i.querySelectorAll(ht).forEach(s=>{B.has(s)&&_i(s)})}if(t.type==="attributes"&&t.target.nodeType===Node.ELEMENT_NODE){let e=t.target;e.matches(ht)&&!B.has(e)?te(e):!e.matches(ht)&&B.has(e)&&_i(e)}}});Cl.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-command","commandfor"]});function Tl(){let r='footer, aside, dialog, [hidden], [aria-hidden="true"]',e=[];return document.querySelectorAll("nav a[href]").forEach(i=>{if(i.closest(r)||B.has(i))return;let s=i.textContent.trim();!s||e.length>=50||e.push({element:i,label:s,group:"Navigation",icon:null,shortcut:null,auto:!0,action:null})}),document.querySelectorAll("h2[id], h3[id]").forEach(i=>{if(i.closest(r)||B.has(i))return;let s=i.textContent.trim();!s||e.length>=50||e.push({element:i,label:`Jump to: ${s}`,group:"On This Page",icon:null,shortcut:null,auto:!0,action:()=>i.scrollIntoView({behavior:"smooth"})})}),e}window.__commandRegistry={getRegisteredCommands:Sl,scanAutoDiscoverable:Tl};var Ll=window.matchMedia("(prefers-reduced-motion: reduce)");function Ml(){return Ll.matches||document.documentElement.hasAttribute("data-motion-reduced")}var Mr=0,Rl=new Map([["vb-fade-in","entrance"],["vb-slide-up","entrance"],["vb-pop","entrance"],["vb-slide-in-ltr","entrance"],["vb-slide-in-rtl","entrance"],["vb-fade-slide-up","entrance"],["vb-shadow-lift","entrance"],["vb-fade-out","exit"],["vb-collapse","exit"],["vb-slide-out-ltr","exit"],["vb-slide-out-rtl","exit"],["vb-shake","attention"],["vb-pulse","attention"],["vb-bounce","attention"],["vb-blink","attention"],["vb-neon-pulse","decoration"],["vb-3d-shift","decoration"],["vb-outline-glow-pulse","decoration"],["vb-rainbow","decoration"],["vb-gradient-flow","decoration"],["vb-shimmer","decoration"],["vb-shimmer-gradient","decoration"],["vb-glow","decoration"],["vb-float","decoration"]]),Rr="__vbEffectsRuntime",_r=globalThis,v=_r[Rr]??{_effects:new Map,_triggers:new Map,_transitions:new Map,_instances:new WeakMap,_triggerCleanups:new WeakMap,_wiredTriggers:new WeakMap,_transitionCleanups:new WeakMap,_transitionFallback:new WeakSet,_processed:new WeakSet,_transitionProcessed:new WeakSet,_staggerTime:new WeakSet,_unresolved:new Set,_warnedTriggers:new Set,_unresolvedTimer:null,_keyframePhase:Rl,_observer:null,_animationEndHandler:null,_autoBooted:!1,effect(r,t){this._effects.set(r,t),document.querySelectorAll("[data-effect]").forEach(e=>{if(!(e.getAttribute("data-effect")||"").split(/\s+/).includes(r))return;let s=!this._instances.get(e)?.has(r);this._initEffect(e,r),s&&e.hasAttribute("data-effect-active")&&this._instances.get(e)?.get(r)?.activate?.()})},trigger(r,t){this._triggers.set(r,t),document.querySelectorAll("[data-effect][data-trigger]").forEach(e=>{if(!this._processed.has(e))return;let i=e.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];this._wireTrigger(e,i)})},transition(r,t){this._transitions.set(r,t),document.querySelectorAll("[data-transition]").forEach(e=>{if(!this._transitionProcessed.has(e)||!this._transitionFallback.has(e))return;let i=e.getAttribute("data-transition")||"",s=i.indexOf(":");if((s>-1?i.slice(0,s):i)!==r)return;this._transitionFallback.delete(e);let n=e;n.style.viewTransitionName="";let o=t(e,s>-1?i.slice(s+1):null);o&&this._transitionCleanups.set(e,o)})},uid(r){return r.id?r.id:(r._vbUid||(Mr++,r._vbUid=`vb-${Mr}`),r._vbUid)},theme(r,t){this._themes=this._themes||new Map,this._themes.set(r,t)},applyTheme(r,t=document.documentElement){let e=this._themes?.get(r);if(e)for(let[i,s]of Object.entries(e))t.style.setProperty(i,s)},swap(r){if(!document.startViewTransition){r(),queueMicrotask(()=>this._dispatchVtDone(document.body));return}let t=document.startViewTransition(r);return t.updateCallbackDone.then(()=>{this._dispatchVtDone(document.body)}).catch(()=>{}),t},_dispatchVtDone(r){r.querySelectorAll('[data-trigger~="vt"]').forEach(t=>{this.emit(t,"vb:vt-update-done",{})})},activate(r){this._activateEffects(r)},deactivate(r){r.hasAttribute("data-effect-active")&&(r.removeAttribute("data-effect-active"),this.emit(r,"vb:phase-change",{active:!1}))},onPhaseEnd(r,t,e){let i=s=>{s.detail?.phase===t&&e(s.detail)};return r.addEventListener("vb:effect-phase-end",i),()=>r.removeEventListener("vb:effect-phase-end",i)},registerKeyframe(r,t){this._keyframePhase.set(r,t)},observe(r=document){if(r.querySelectorAll("[data-effect]").forEach(e=>this._processElement(e)),r.querySelectorAll("[data-stagger]").forEach(e=>this._processStagger(e)),r.querySelectorAll("[data-transition]").forEach(e=>this._processTransition(e)),this._observer)return;this._observer=new MutationObserver(e=>{let i=new Set;for(let s of e){if(s.type==="childList"){let n=s.target;n.hasAttribute?.("data-stagger")&&i.add(n);for(let o of s.addedNodes)o.nodeType===Node.ELEMENT_NODE&&this._processTree(o);for(let o of s.removedNodes)o.nodeType===Node.ELEMENT_NODE&&(o.isConnected||this._cleanupTree(o))}if(s.type==="attributes"){let n=s.target;s.attributeName==="data-effect"&&this._reconcileEffects(n),s.attributeName==="data-trigger"&&this._reconcileTrigger(n),s.attributeName==="data-stagger"&&(n.hasAttribute("data-stagger")?i.add(n):this._cleanupStagger(n)),s.attributeName==="data-transition"&&this._reconcileTransition(n)}}for(let s of i)s.isConnected&&this._processStagger(s)});let t=r===document?document.body:r;this._observer.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-effect","data-trigger","data-stagger","data-transition"]}),this._animationEndHandler||(this._animationEndHandler=e=>{let i=e.target;if(!(i instanceof Element)||!i.hasAttribute("data-effect"))return;let s=this._keyframePhase.get(e.animationName);s&&this.emit(i,"vb:effect-phase-end",{phase:s,animationName:e.animationName})},document.addEventListener("animationend",this._animationEndHandler))},disconnect(){this._observer&&(this._observer.disconnect(),this._observer=null),this._animationEndHandler&&(document.removeEventListener("animationend",this._animationEndHandler),this._animationEndHandler=null)},params(r){let t=getComputedStyle(r);return{get(e){return t.getPropertyValue(`--vb-${e}`).trim()},getNumber(e,i=0){let s=t.getPropertyValue(`--vb-${e}`).trim();return s?parseFloat(s):i},getTime(e,i=0){let s=t.getPropertyValue(`--vb-${e}`).trim();if(!s)return i;let n=parseFloat(s);return Number.isFinite(n)?/s\s*$/.test(s)&&!/ms\s*$/.test(s)?n*1e3:n:i},hasClass(e){return r.classList.contains(e)}}},emit(r,t,e={}){r.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:e}))},prefersReducedMotion:Ml,_processTree(r){r.hasAttribute?.("data-effect")&&this._processElement(r),r.hasAttribute?.("data-stagger")&&this._processStagger(r),r.hasAttribute?.("data-transition")&&this._processTransition(r),r.querySelectorAll?.("[data-effect]").forEach(t=>this._processElement(t)),r.querySelectorAll?.("[data-stagger]").forEach(t=>this._processStagger(t)),r.querySelectorAll?.("[data-transition]").forEach(t=>this._processTransition(t))},_cleanupTree(r){r.hasAttribute?.("data-effect")&&this._cleanupElement(r),r.hasAttribute?.("data-transition")&&this._cleanupTransition(r),r.querySelectorAll?.("[data-effect]").forEach(t=>this._cleanupElement(t)),r.querySelectorAll?.("[data-transition]").forEach(t=>this._cleanupTransition(t))},_processElement(r){if(this._processed.has(r))return;this._processed.add(r),r.removeAttribute("data-effect-processed"),r.removeAttribute("data-effect-armed");let t=r.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];for(let e of t)this._initEffect(r,e);this._wireTrigger(r,t)},_initEffect(r,t){let e=this._effects.get(t);if(!e)return;let i=this._instances.get(r);if(i?.has(t))return;let s=e(r);s&&(i||(i=new Map,this._instances.set(r,i)),typeof s=="function"?i.set(t,{cleanup:s}):i.set(t,s))},_parseTrigger(r){let t=r.indexOf(":");return t>-1?[r.slice(0,t),r.slice(t+1)]:[r,null]},_wireTrigger(r,t){let e=r.getAttribute("data-trigger");if(!e||!e.trim()){r.removeAttribute("data-effect-armed"),this._activateEffects(r);return}let i=e.split(/\s+/).filter(Boolean);this._wiredTriggers??=new WeakMap;let s=this._wiredTriggers.get(r);s||(s=new Set,this._wiredTriggers.set(r,s));let n=!1;for(let o of i){if(s.has(o))continue;let[a,l]=this._parseTrigger(o),c=this._triggers.get(a);if(!c){n=!0;continue}s.add(o);let h=c(r,()=>this._activateEffects(r),l);if(h){let u=this._triggerCleanups.get(r);if(u){let p=u;this._triggerCleanups.set(r,()=>{p(),h()})}else this._triggerCleanups.set(r,h)}}s.size&&r.setAttribute("data-effect-armed",""),n?(this._unresolved.add(r),this._scheduleUnresolvedCheck()):this._unresolved.delete(r)},_scheduleUnresolvedCheck(){if(this._unresolvedTimer)return;let r=()=>{this._unresolvedTimer=null,this._resolveUnknownTriggers()};typeof window>"u"||typeof window.addEventListener!="function"||(document.readyState==="complete"?this._unresolvedTimer=setTimeout(r,0):(this._unresolvedTimer=!0,window.addEventListener("load",()=>setTimeout(r,0),{once:!0})))},_resolveUnknownTriggers(){for(let r of[...this._unresolved]){if(this._unresolved.delete(r),!r.isConnected||!this._processed.has(r))continue;let e=(r.getAttribute("data-trigger")||"").split(/\s+/).filter(Boolean).filter(i=>!this._triggers.has(this._parseTrigger(i)[0]));if(e.length){for(let i of e){let s=this._parseTrigger(i)[0];this._warnedTriggers.has(s)||(this._warnedTriggers.add(s),console.warn(`[VB] data-trigger="${i}": no trigger named "${s}" is registered. The effect runs immediately instead. Register it with VB.trigger('${s}', \u2026) or check the spelling.`,r))}!r.hasAttribute("data-effect-armed")&&!r.hasAttribute("data-effect-active")&&this._activateEffects(r)}}},_activateEffects(r){r.setAttribute("data-effect-active",""),this.emit(r,"vb:phase-change",{active:!0});let t=this._instances.get(r);if(t)for(let[,e]of t)e.activate&&e.activate()},_cleanupElement(r){let t=this._instances.get(r);if(t){for(let[,i]of t)i.cleanup&&i.cleanup();this._instances.delete(r)}let e=this._triggerCleanups.get(r);e&&(e(),this._triggerCleanups.delete(r)),this._wiredTriggers?.delete(r),this._unresolved.delete(r),r.removeAttribute("data-effect-armed"),this._processed.delete(r)},_reconcileEffects(r){if(!r.hasAttribute("data-effect")){this._cleanupElement(r),r.removeAttribute("data-effect-active");return}let t=r.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[],e=this._instances.get(r);if(e)for(let[i,s]of e)t.includes(i)||(s.cleanup&&s.cleanup(),e.delete(i));for(let i of t)e?.has(i)||this._initEffect(r,i);this._processed.has(r)||this._processElement(r)},_reconcileTrigger(r){if(!r.hasAttribute("data-effect"))return;let t=this._triggerCleanups.get(r);if(t&&(t(),this._triggerCleanups.delete(r)),this._wiredTriggers?.delete(r),this._unresolved.delete(r),r.removeAttribute("data-effect-armed"),!this._processed.has(r)){this._processElement(r);return}let e=r.getAttribute("data-effect")?.split(/\s+/).filter(Boolean)||[];this._wireTrigger(r,e)},_parseStagger(r){let t=(r||"").trim().split(/\s+/).filter(Boolean),e=t.find(s=>/^(\d+(\.\d+)?|\.\d+)(ms|s)$/i.test(s))||null;return{mode:t.find(s=>s==="reverse"||s==="random"||s==="grid")||"",time:e}},_processStagger(r){let{mode:t,time:e}=this._parseStagger(r.getAttribute("data-stagger"));e?(r.style.setProperty("--vb-stagger",e),this._staggerTime.add(r)):this._staggerTime.has(r)&&(r.style.removeProperty("--vb-stagger"),this._staggerTime.delete(r));let i=Array.from(r.children),s=i.length,n;if(t==="reverse")n=Array.from({length:s},(o,a)=>s-1-a);else if(t==="random"){let o=this._hashString(this.uid(r));n=Array.from({length:s},(l,c)=>c);let a=o;for(let l=s-1;l>0;l--){a^=a<<13,a^=a>>>17,a^=a<<5;let c=Math.abs(a)%(l+1);[n[l],n[c]]=[n[c],n[l]]}}else t==="grid"?n=this._gridStaggerIndices(r,i):n=Array.from({length:s},(o,a)=>a);for(let o=0;o<s;o++)i[o].style.setProperty("--vb-stagger-index",String(n[o]))},_gridStaggerIndices(r,t){let e=t.length,i=()=>Array.from({length:e},(c,h)=>h);if(!e)return[];let s=t.map(c=>{let h=getComputedStyle(c);return[parseInt(h.gridRowStart,10),parseInt(h.gridColumnStart,10)]});if(s.every(([c,h])=>Number.isFinite(c)&&Number.isFinite(h))){let c=Math.min(...s.map(([u])=>u)),h=Math.min(...s.map(([,u])=>u));return s.map(([u,p])=>u-c+(p-h))}let n=t.map(c=>c.getBoundingClientRect?.());if(!n.every(Boolean)||n.every(c=>c.width===0&&c.height===0))return i();let o=getComputedStyle(r).direction==="rtl",a=this._trackRanks(n.map(c=>[c.top,c.bottom])),l=this._trackRanks(n.map(c=>o?[-c.right,-c.left]:[c.left,c.right]));return a.map((c,h)=>c+l[h])},_trackRanks(r){let t=r.map((n,o)=>o).sort((n,o)=>r[n][0]-r[o][0]),e=new Array(r.length),i=-1,s=-1/0;for(let n of t){let[o,a]=r[n];o>=s-.5?(i++,s=a):s=Math.min(s,a),e[n]=i}return e},_cleanupStagger(r){this._staggerTime.has(r)&&(r.style.removeProperty("--vb-stagger"),this._staggerTime.delete(r));for(let t of Array.from(r.children))t.style?.removeProperty("--vb-stagger-index")},_hashString(r){let t=5381;for(let e=0;e<r.length;e++)t=(t<<5)+t^r.charCodeAt(e);return t|0},_vtIdent(r){let t=String(r).replace(/[^A-Za-z0-9_ -￿-]/g,"-");return(!t||/^(-?\d|--)/.test(t))&&(t=`vb-${t}`),t},_processTransition(r){if(this._transitionProcessed.has(r)||r.matches?.("[data-swap], content-swap"))return;let t=(r.getAttribute("data-transition")||"").trim();if(!t)return;this._transitionProcessed.add(r),r.removeAttribute("data-transition-processed");let[e,i]=this._parseTrigger(t),s=this._transitions.get(e);if(s){let n=s(r,i);n&&this._transitionCleanups.set(r,n)}else r.style.viewTransitionName=this._vtIdent(`${e}-${this.uid(r)}`),this._transitionFallback.add(r)},_cleanupTransition(r){if(!this._transitionProcessed.has(r))return;let t=this._transitionCleanups.get(r);t&&(t(),this._transitionCleanups.delete(r)),this._transitionFallback.has(r)&&(this._transitionFallback.delete(r),r.style.viewTransitionName=""),this._transitionProcessed.delete(r)},_reconcileTransition(r){this._cleanupTransition(r),r.hasAttribute("data-transition")&&this._processTransition(r)}};_r[Rr]=v;if(typeof window<"u"){let r=window.VB;if(r&&r!==v)for(let t of Object.keys(r))t in v||(v[t]=r[t]);window.VB=v}typeof document<"u"&&!v._autoBooted&&(v._autoBooted=!0,document.body?v.observe():document.addEventListener("DOMContentLoaded",()=>v.observe(),{once:!0}));function ee(r,t){v.deactivate(r),r.offsetWidth,t()}function Ni(r,t){if(v.prefersReducedMotion()){t();return}let e=new IntersectionObserver(([i])=>{i.isIntersecting&&(e.disconnect(),t())},{threshold:.1});return e.observe(r),()=>e.disconnect()}function _l(r){let t=(r||"0").trim(),e=parseFloat(t);return!Number.isFinite(e)||e<0?0:/^[\d.]+s$/i.test(t)?e*1e3:e}v.trigger("scroll",(r,t)=>Ni(r,t));v.trigger("hover",(r,t)=>{let e=!1,i=!1;function s(h){let u=e||i;h==="hover"?e=!0:i=!0,u||ee(r,t)}function n(){!e&&!i&&v.deactivate(r)}let o=()=>s("hover"),a=()=>{e=!1,n()},l=()=>s("focus"),c=h=>{h.relatedTarget instanceof Node&&r.contains(h.relatedTarget)||(i=!1,n())};return r.addEventListener("pointerenter",o),r.addEventListener("pointerleave",a),r.addEventListener("focusin",l),r.addEventListener("focusout",c),()=>{r.removeEventListener("pointerenter",o),r.removeEventListener("pointerleave",a),r.removeEventListener("focusin",l),r.removeEventListener("focusout",c)}});v.trigger("click",(r,t,e)=>{function i(){e==="replay"?ee(r,t):r.hasAttribute("data-effect-active")?v.deactivate(r):t()}return r.addEventListener("click",i),()=>r.removeEventListener("click",i)});v.trigger("time",(r,t,e)=>{let i=setTimeout(t,_l(e));return()=>clearTimeout(i)});v.trigger("intersect",(r,t,e)=>{if(v.prefersReducedMotion()){t();return}if((e||"once")==="toggle"){let s=new IntersectionObserver(([n])=>{n.isIntersecting?t():v.deactivate(r)},{threshold:.1});return s.observe(r),()=>s.disconnect()}return Ni(r,t)});v.trigger("media",(r,t,e)=>{if(!e)return;let i=window.matchMedia(e);function s(){i.matches?t():v.deactivate(r)}return i.addEventListener("change",s),s(),()=>i.removeEventListener("change",s)});v.trigger("event",(r,t,e)=>{if(!e)return;let i=()=>ee(r,t);return r.addEventListener(e,i),()=>r.removeEventListener(e,i)});v.trigger("vt",(r,t)=>{let e=()=>ee(r,t);return r.addEventListener("vb:vt-update-done",e),()=>r.removeEventListener("vb:vt-update-done",e)});var Nl=typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()");for(let r of["view-progress","scroll-progress"])v.trigger(r,(t,e)=>{if(!(Nl&&!v.prefersReducedMotion()))return Ni(t,e)});var Pl=12;function et(r,t,e){let i=v.uid(t),s=e===void 0?`${r}-${i}`:`${r}-${i}-${e}`;return typeof CSS<"u"&&CSS.escape?CSS.escape(s):s.replace(/[^\w-]/g,"_")}function ut(r,t,e){return r.style.viewTransitionName=t,e&&(r.style.viewTransitionClass=e),()=>{r.style.viewTransitionName="",e&&(r.style.viewTransitionClass="")}}v.transition("morph",r=>ut(r,et("morph",r)));function Il(r,t){let e=(t||"forward").trim().toLowerCase();if(e==="left")return"slide-left";if(e==="right")return"slide-right";let s=!(getComputedStyle(r).direction==="rtl");return(e==="back"?!s:s)?"slide-left":"slide-right"}v.transition("slide",(r,t)=>ut(r,et("slide",r),Il(r,t)));v.transition("fade",r=>ut(r,et("fade",r),"fade"));v.transition("scale",r=>ut(r,et("scale",r),"scale"));v.transition("none",r=>ut(r,et("none",r),"vt-none"));function $l(r){let t=new Set,e=()=>{let s=Array.from(r.children);for(let n of t)n.parentElement!==r&&(n.style.viewTransitionName="",n.style.viewTransitionClass="",t.delete(n));s.forEach((n,o)=>{if(!(n instanceof HTMLElement))return;let a=Math.min(o,Pl-1);n.style.viewTransitionName=et("stagger",r,v.uid(n)),n.style.viewTransitionClass=`fade vt-stagger-${a}`,t.add(n)})};e();let i=new MutationObserver(e);return i.observe(r,{childList:!0}),()=>{i.disconnect();for(let s of t)s.style.viewTransitionName="",s.style.viewTransitionClass="";t.clear()}}v.transition("stagger",r=>$l(r));v.transition("effect",(r,t)=>{let e=(t||"fade").trim();return ut(r,et("effect",r),/^-?[_a-zA-Z][\w-]*$/.test(e)?e:"fade")});var Nr="data-effect-glitch-init";v.effect("glitch",r=>(r.setAttribute("data-glitch-text",(r.textContent||"").trim()),r.setAttribute(Nr,""),{cleanup(){r.removeAttribute(Nr),r.removeAttribute("data-glitch-text")}}));var ie="vb-split-sr",Pi="vb-split";function zl(r){return r.closest?.("[lang]")?.getAttribute("lang")||void 0}function dt(r,t){if(typeof Intl<"u"&&"Segmenter"in Intl)try{let e=new Intl.Segmenter(t,{granularity:"grapheme"});return Array.from(e.segment(r),i=>i.segment)}catch{}return Array.from(r)}function Bl(r,t){let e=[],i;if(typeof Intl<"u"&&"Segmenter"in Intl)try{i=Array.from(new Intl.Segmenter(t,{granularity:"word"}).segment(r))}catch{i=null}if(!i){for(let n of r.split(/(\s+)/))n&&e.push({text:n,space:/^\s+$/.test(n)});return e}let s="";for(let n of i){if(/^\s+$/.test(n.segment)){s&&(e.push({text:s,space:!1}),s=""),e.push({text:n.segment,space:!0});continue}let o=e[e.length-1];if(!n.isWordLike){o&&!o.space?o.text+=n.segment:s+=n.segment;continue}e.push({text:s+n.segment,space:!1}),s=""}return s&&e.push({text:s,space:!1}),e}function P(r){for(let t of r.querySelectorAll(`.${ie}`)){let e=t.nextElementSibling;e?.classList.contains(Pi)&&e.remove(),t.replaceWith(document.createTextNode(t.textContent||""))}r.normalize()}function Pr(r){let t=r.querySelectorAll(`.${ie}`);return t.length?Array.from(t,e=>e.textContent).join(""):r.textContent||""}function pt(r,{unit:t="word",className:e="",locale:i}={}){P(r);let s=i||zl(r),n=[],o=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,{acceptNode(c){let h=c.parentElement;return h&&h.closest("script, style, template, svg, math")?NodeFilter.FILTER_REJECT:c.nodeValue&&c.nodeValue.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});for(;o.nextNode();)n.push(o.currentNode);let a=[],l=c=>{let h=document.createElement("span");return e&&(h.className=e),h.textContent=c,a.push(h),h};for(let c of n){let h=c.nodeValue||"",u=document.createElement("span");u.className=ie,u.textContent=h;let p=document.createElement("span");if(p.className=Pi,p.setAttribute("aria-hidden","true"),t==="grapheme")for(let d of dt(h,s)){let f=l(d);/^\s+$/.test(d)&&f.setAttribute("data-space",""),p.append(f)}else for(let d of Bl(h,s))p.append(d.space?document.createTextNode(d.text):l(d.text));c.replaceWith(u,p)}return a}function Ir(r,t){P(r);let e=document.createElement("span");e.className=ie,e.textContent=t;let i=document.createElement("span");return i.className=Pi,i.setAttribute("aria-hidden","true"),r.replaceChildren(e,i),i}function Ii(r){let t=0,e=null;for(let i of r){let s=i.getBoundingClientRect(),n=s.top;e!==null&&n-e>s.height/2&&t++,e=n,i.style.setProperty("--i",String(t))}return r.length?t+1:0}var $i="data-effect-blur-reveal-init";v.effect("blur-reveal",r=>{let t=r;if(P(t),t.removeAttribute($i),v.prefersReducedMotion())return{cleanup(){}};t.style.setProperty("--blur-delay",v.params(t).get("blur-reveal-delay")||"80ms");let e=pt(t,{className:"vb-blur-chunk"});e.forEach((s,n)=>s.style.setProperty("--i",String(n))),t.setAttribute($i,"");let i=null;if(t.classList.contains("line")){Ii(e);let s=t.clientWidth;i=new ResizeObserver(()=>{t.clientWidth!==s&&(s=t.clientWidth,Ii(e))}),i.observe(t)}return{activate(){t.setAttribute("data-effect-active","")},cleanup(){i?.disconnect(),P(t),t.removeAttribute($i),t.style.removeProperty("--blur-delay")}}});var zi="data-effect-typewriter-init",jl=2e3,Ol=400,Dl=200;v.effect("typewriter",r=>{let t=r;if(P(t),t.querySelectorAll(":scope > .vb-typewriter-cursor").forEach(u=>u.remove()),t.removeAttribute(zi),v.prefersReducedMotion())return{cleanup(){}};let e=pt(t,{unit:"grapheme",className:"vb-typewriter-char"});t.setAttribute(zi,"");let i=0,s=null,n=()=>{clearTimeout(i),i=0},o=()=>!!t.closest("[data-paused]"),a=(u,p)=>{i=window.setTimeout(function d(){if(o()){i=window.setTimeout(d,Dl);return}u()},p)},l=u=>e.forEach((p,d)=>{p.hidden=d>=u}),c=(u,p)=>{let d=u+p;for(;d>0&&d<e.length&&e[d-1].hasAttribute("data-space");)d+=p;return d};function h(){n();let u=v.params(t),p=u.getTime("typewriter-speed",50),d=u.getTime("typewriter-delay",0),f=t.classList.contains("loop");!s&&!t.classList.contains("no-cursor")&&(s=document.createElement("span"),s.className="vb-typewriter-cursor",s.textContent="|",s.setAttribute("aria-hidden","true"),t.append(s));let m=0;l(0);let y=()=>{m<e.length?(m=c(m,1),l(m),a(y,p)):f&&a(w,jl)},w=()=>{m>0?(m=Math.max(0,c(m,-1)),l(m),a(w,p/2)):a(y,Ol)};a(y,d)}return{activate(){h()},cleanup(){n(),s?.remove(),s=null,P(t),t.removeAttribute(zi)}}});var Bi="data-effect-scramble-init",Fl="!<>-_\\/[]{}=+*^?#";function ql(r){let t=v.params(r).get("scramble-chars"),e=/^(['"])(.*)\1$/.exec(t);e&&(t=e[2]);let i=dt(t);return i.length?i:dt(Fl)}var Hl=r=>r[Math.floor(Math.random()*r.length)];v.effect("scramble",r=>{let t=r;if(P(t),t.removeAttribute(Bi),v.prefersReducedMotion())return{cleanup(){}};let e=pt(t,{unit:"grapheme",className:"vb-scramble-char"}),i=e.map(c=>c.textContent||""),s=e.flatMap((c,h)=>c.hasAttribute("data-space")?[]:[h]);t.setAttribute(Bi,"");let n=0,o=()=>{clearTimeout(n),n=0},a=()=>e.forEach((c,h)=>{c.textContent=i[h]});function l(){o();let c=v.params(t),h=c.getTime("scramble-duration",1500),u=Math.max(1,c.getTime("scramble-speed",30)),p=ql(t),d=Math.max(1,Math.ceil(h/u)),f=0,m=()=>{let y=Math.floor(f/d*s.length);s.forEach((w,k)=>{e[w].textContent=k<y?i[w]:Hl(p)}),f++,f<=d?n=window.setTimeout(m,u):a()};m()}return{activate(){l()},cleanup(){o(),P(t),t.removeAttribute(Bi)}}});var $r="animate-image-wrapper";function Ul(r){let t=(r.getAttribute("alt")||"").trim(),e=q(r,"animation-pause","Pause animation");return e.includes("{alt}")?e.replace("{alt}",t).trim():t?`${e}: ${t}`:e}v.effect("animate-image",r=>{let t=r;if(t.tagName!=="IMG"||!t.parentNode)return{cleanup(){}};t.removeAttribute("data-effect-animate-image-init"),t.hasAttribute("alt")||console.warn("[animate-image] Image has no alt text; describe what the animation shows.",t);let e=t.getAttribute("data-animate-image-src");if(e){t.src=e;let C=t.getAttribute("data-animate-image-srcset");C&&(t.srcset=C),t.removeAttribute("data-animate-image-src"),t.removeAttribute("data-animate-image-srcset")}let i=t.parentElement?.tagName==="PICTURE"?t.parentElement:null,s=i||t,n=i?[...i.querySelectorAll(":scope > source")]:[],o=s.parentElement?.classList.contains($r)?s.parentElement:null,a=o||document.createElement("span");o?a.querySelectorAll(":scope > .animate-image-toggle, :scope > .animate-image-placeholder").forEach(C=>C.remove()):(a.className=$r,s.parentNode?.insertBefore(a,s),a.appendChild(s));let l=document.createElement("span");l.className="animate-image-placeholder",l.hidden=!0,a.appendChild(l);let c=document.createElement("button");c.type="button",c.className="animate-image-toggle",c.setAttribute("aria-pressed","false"),c.setAttribute("aria-label",Ul(t)),a.appendChild(c);let h=t.hasAttribute("data-animate-image-paused"),u=t.getAttribute("data-poster"),p=!1,d=!1,f=null;function m(){if(u||!t.naturalWidth)return;let C=document.createElement("canvas");C.width=t.naturalWidth,C.height=t.naturalHeight;let I=C.getContext("2d");if(I)try{I.drawImage(t,0,0),u=C.toDataURL("image/png")}catch{u=null}}function y(){c.setAttribute("aria-pressed",String(p)),c.classList.toggle("paused",p),t.toggleAttribute("data-animate-image-paused",p)}function w({auto:C=!1}={}){if(!p){if(m(),p=!0,d=C,f={src:t.currentSrc||t.src,srcset:t.getAttribute("srcset"),sizes:t.getAttribute("sizes"),sources:n.map(I=>[I,I.getAttribute("srcset"),I.getAttribute("sizes")])},t.setAttribute("data-animate-image-src",t.getAttribute("src")||f.src),f.srcset&&t.setAttribute("data-animate-image-srcset",f.srcset),u){for(let[I]of f.sources)I.removeAttribute("srcset"),I.removeAttribute("sizes");t.removeAttribute("srcset"),t.removeAttribute("sizes"),t.src=u}else l.textContent=t.getAttribute("alt")||"",l.hidden=!1,a.setAttribute("data-animate-image-hidden","");y()}}function k(){if(p){if(p=!1,d=!1,f){for(let[C,I,qi]of f.sources)I!=null&&C.setAttribute("srcset",I),qi!=null&&C.setAttribute("sizes",qi);f.sizes!=null&&t.setAttribute("sizes",f.sizes),f.srcset!=null&&t.setAttribute("srcset",f.srcset),t.src=t.getAttribute("data-animate-image-src")||f.src}f=null,t.removeAttribute("data-animate-image-src"),t.removeAttribute("data-animate-image-srcset"),l.hidden=!0,a.removeAttribute("data-animate-image-hidden"),y()}}c.addEventListener("click",()=>p?k():w());function A(C){t.complete&&t.naturalWidth?C():t.addEventListener("load",C,{once:!0})}A(m),h?A(()=>w()):v.prefersReducedMotion()&&A(()=>w({auto:!0}));let T=()=>{v.prefersReducedMotion()?A(()=>w({auto:!0})):d&&k()},j=window.matchMedia("(prefers-reduced-motion: reduce)");j.addEventListener("change",T);let R=new MutationObserver(T);return R.observe(document.documentElement,{attributes:!0,attributeFilter:["data-motion-reduced"]}),{cleanup(){j.removeEventListener("change",T),R.disconnect(),p&&k(),t.toggleAttribute("data-animate-image-paused",h),c.remove(),l.remove(),a.parentNode&&(a.parentNode.insertBefore(s,a),a.remove())}}});var zr="vb-stamp-noise",ft="http://www.w3.org/2000/svg";function Vl(){if(document.getElementById(zr))return;let r=document.createElementNS(ft,"svg");r.setAttribute("aria-hidden","true"),r.setAttribute("focusable","false"),r.setAttribute("width","0"),r.setAttribute("height","0"),r.style.position="absolute",r.style.overflow="hidden";let t=document.createElementNS(ft,"filter");t.id=zr;for(let[o,a]of Object.entries({x:"-5%",y:"-5%",width:"110%",height:"110%"}))t.setAttribute(o,a);let e=document.createElementNS(ft,"feTurbulence");for(let[o,a]of Object.entries({type:"fractalNoise",baseFrequency:"0.75",numOctaves:"4",stitchTiles:"stitch",result:"noise"}))e.setAttribute(o,a);let i=document.createElementNS(ft,"feColorMatrix");for(let[o,a]of Object.entries({type:"saturate",values:"0",in:"noise",result:"greyNoise"}))i.setAttribute(o,a);let s=document.createElementNS(ft,"feComposite");for(let[o,a]of Object.entries({in:"SourceGraphic",in2:"greyNoise",operator:"in"}))s.setAttribute(o,a);t.append(e,i,s);let n=document.createElementNS(ft,"defs");n.append(t),r.append(n),document.body.prepend(r)}v.effect("stamp",()=>(Vl(),{cleanup(){}}));var Br="data-effect-flipboard-init",se=" ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,:!?/-",Wl=60,Kl=30,Gl=80,W="\xA0",jr=new WeakMap;function Yl(){let r=document.createElement("span");r.className="vb-flap-char";for(let e of["top","bottom","flip-top","flip-bottom"]){let i=document.createElement("span");i.className=`vb-flap-${e}`;let s=document.createElement("span");s.className="vb-flap-text",s.textContent=W,i.append(s),r.append(i)}let t=document.createElement("span");return t.className="vb-flap-hinge",r.append(t),r}function Or(r,t){for(let e of r.querySelectorAll(".vb-flap-text"))e.textContent=t||W}function re(r,t){return new Promise(e=>{let i=window.setTimeout(()=>{r.timers.delete(i),e(void 0)},t);r.timers.add(i)})}async function Xl(r,t,e,i,s){let n=t.querySelector(".vb-flap-top .vb-flap-text"),o=t.querySelector(".vb-flap-bottom .vb-flap-text"),a=t.querySelector(".vb-flap-flip-top"),l=t.querySelector(".vb-flap-flip-bottom");n.textContent=e||W,o.textContent=e||W,a.querySelector(".vb-flap-text").textContent=e||W,l.querySelector(".vb-flap-text").textContent=i||W,a.classList.add("vb-flap-flipping"),l.classList.add("vb-flap-flipping"),await re(r,s/2),n.textContent=i||W,await re(r,s/2),o.textContent=i||W,a.classList.remove("vb-flap-flipping"),l.classList.remove("vb-flap-flipping")}async function Jl(r,t,e,i,s,n){for(let o=0;o<i;o++){if(r.generation!==s)return;let a=o===i-1,l=se[o%se.length],c=a?e:se[(o+1)%se.length];await Xl(r,t,l,c,n),a||await re(r,Kl)}}function Dr(r){r.generation++;for(let t of r.timers)clearTimeout(t);r.timers.clear()}function Zl(r,t){let e=Ir(r,t.original);return r.classList.add("vb-flap-board"),t.chars.map(()=>e.appendChild(Yl()))}function Ql(r,t){Dr(t);let e=r,i=v.params(e).getTime("flip-ms",Wl);e.style.setProperty("--_vb-flip-duration",`${i}ms`);let s=Zl(r,t),n=t.generation;if(v.prefersReducedMotion()){s.forEach((o,a)=>Or(o,t.chars[a]));return}Promise.all(s.map(async(o,a)=>{if(await re(t,a*Gl),t.generation!==n)return;let l=4+Math.floor(Math.random()*7);await Jl(t,o,t.chars[a],l,n,i)})).then(()=>{t.generation===n&&s.forEach((o,a)=>Or(o,t.chars[a]))})}v.effect("flipboard",r=>{let t=Pr(r).trim();if(P(r),r.classList.remove("vb-flap-board"),!t)return{cleanup(){}};let e={original:t,chars:dt(t.toLocaleUpperCase(r.closest("[lang]")?.getAttribute("lang")||void 0)),generation:0,timers:new Set};return jr.set(r,e),r.setAttribute(Br,""),Ql(r,e),{cleanup(){Dr(e),jr.delete(r),r.textContent=e.original,r.classList.remove("vb-flap-board"),r.removeAttribute(Br),r.style.removeProperty("--_vb-flip-duration")}}});var ne=new Map,ji=null,oe=!1;function tc(r){for(let[t,e]of ne)r.querySelectorAll(t).forEach(e)}function ec(r){if(r.nodeType!==Node.ELEMENT_NODE)return;let t=r;for(let[e,i]of ne)t.matches(e)&&i(t),t.querySelectorAll(e).forEach(i)}function ic(){ji||(ji=new MutationObserver(r=>{for(let t of r)for(let e of t.addedNodes)ec(e)}),ji.observe(document.documentElement,{childList:!0,subtree:!0}))}function sc(){oe||(oe=!0,tc(document))}function Fr(r,t){ne.set(r,t),ic(),oe||document.readyState!=="loading"?(oe=!0,document.querySelectorAll(r).forEach(t)):ne.size===1&&document.addEventListener("DOMContentLoaded",sc)}var K=null;async function rc(){if(K)return;K=(await Promise.resolve().then(()=>(ye(),ve))).resolveEmoji}var Hr="[data-emoji]",Ur=/(?<![\p{L}\p{N}_]):([a-z0-9_+-]+):/gu,nc=/[a-z]/,oc="script,style,code,pre,kbd,samp,var,textarea,code-block,[data-emoji-skip]",Oi=["alt","title","aria-label"],Vr=new Set(["INPUT","TEXTAREA"]),ac=100,lc=new Set(["insertFromPaste","insertFromDrop","insertReplacementText","insertFromYank"]),it=new WeakMap;function Di(r,t="keep"){if(!K||!r.includes(":"))return r;let e=K;return r.replace(Ur,(i,s)=>{let n=e(s);return n?n.emoji:t==="strip"&&nc.test(s)?"":i})}function cc(r){return r.getAttribute("data-emoji-unknown")==="strip"?"strip":"keep"}function hc(r){if(it.has(r)||!r.hasAttribute("data-emoji"))return;if(r.removeAttribute("data-emoji-init"),Vr.has(r.tagName)){it.set(r,dc(r));return}if(Fi(r),r.getAttribute("data-emoji-scan")!=="observe"){it.set(r,()=>{});return}let t=null,e=new MutationObserver(()=>{t&&clearTimeout(t),t=setTimeout(()=>{t=null,Fi(r)},ac)});e.observe(r,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:Oi}),it.set(r,()=>{e.disconnect(),t&&clearTimeout(t)})}function uc(r){let t=it.get(r);t&&(t(),it.delete(r))}function dc(r){let t=!1,e=!1,i=()=>{t=!0},s=()=>{t=!1,o(!0)},n=a=>{let{isComposing:l,inputType:c}=a;t||l||c==="historyUndo"||c==="historyRedo"||o(!!c&&!lc.has(c))};function o(a=!1){if(!e){e=!0;try{pc(r,a)}finally{e=!1}}}return r.addEventListener("compositionstart",i),r.addEventListener("compositionend",s),r.addEventListener("input",n),r.value&&o(),()=>{r.removeEventListener("compositionstart",i),r.removeEventListener("compositionend",s),r.removeEventListener("input",n)}}function pc(r,t=!1){if(!K)return;let e=r.value,i=r.selectionStart,s=[];for(let a of e.matchAll(Ur)){let l=a.index??0,c=l+a[0].length;if(t&&i!==null&&c!==i)continue;let h=K(a[1]);h&&s.push({start:l,end:c,emoji:h.emoji})}if(s.length===0)return;if(r.selectionStart===null){r.value=Di(e,"keep");return}let n=r.selectionStart??e.length,o=document.activeElement===r&&typeof document.execCommand=="function";for(let a=s.length-1;a>=0;a--){let{start:l,end:c,emoji:h}=s[a];n>=c?n-=c-l-h.length:n>l&&(n=l+h.length);let u=!1;if(o){r.setSelectionRange(l,c);try{u=document.execCommand("insertText",!1,h)&&r.value.slice(l,l+h.length)===h}catch{u=!1}}u||r.setRangeText(h,l,c)}r.setSelectionRange(n,n)}function qr(r,t){if(r.isContentEditable)return!0;let e=r.closest(oc);return!!(e&&e!==t&&t.contains(e))}function Fi(r){if(!K)return;let t=cc(r),e=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,{acceptNode(o){let a=o.parentElement;return!a||qr(a,r)?NodeFilter.FILTER_REJECT:(o.textContent??"").includes(":")?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),i=[];for(;e.nextNode();)i.push(e.currentNode);for(let o of i){let a=o.textContent??"",l=Di(a,t);l!==a&&(o.textContent=l)}let s=Oi.map(o=>`[${o}*=":"]`).join(","),n=[r,...r.querySelectorAll(s)];for(let o of n)if(!(o!==r&&qr(o,r)))for(let a of Oi){let l=o.getAttribute(a);if(!l)continue;let c=Di(l,t);c!==l&&o.setAttribute(a,c)}}document.addEventListener("vb:emoji-extended",()=>{if(K)for(let r of document.querySelectorAll(Hr))!it.has(r)||Vr.has(r.tagName)||Fi(r)});function Wr(r){rc().then(()=>hc(r))}Fr(Hr,Wr);new MutationObserver(r=>{for(let{target:t}of r){let e=t;e.hasAttribute("data-emoji")?Wr(e):uc(e)}}).observe(document.documentElement,{attributes:!0,attributeFilter:["data-emoji"],subtree:!0});
1321
1321
  //# sourceMappingURL=vanilla-breeze-extras.js.map